hexsha stringlengths 40 40 | size int64 5 2.06M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 248 | max_stars_repo_name stringlengths 5 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 248 | max_issues_repo_name stringlengths 5 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 248 | max_forks_repo_name stringlengths 5 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 5 2.06M | avg_line_length float64 1 1.02M | max_line_length int64 3 1.03M | alphanum_fraction float64 0 1 | count_classes int64 0 1.6M | score_classes float64 0 1 | count_generators int64 0 651k | score_generators float64 0 1 | count_decorators int64 0 990k | score_decorators float64 0 1 | count_async_functions int64 0 235k | score_async_functions float64 0 1 | count_documentation int64 0 1.04M | score_documentation float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3aeaaea0220995b51a401a8289992641fdab006b | 238 | py | Python | ytdl_gui/__init__.py | Aakodal/ytdl-python | fa40b7722fb51c8cad17d690b83b0f08f36c203a | [
"MIT"
] | null | null | null | ytdl_gui/__init__.py | Aakodal/ytdl-python | fa40b7722fb51c8cad17d690b83b0f08f36c203a | [
"MIT"
] | null | null | null | ytdl_gui/__init__.py | Aakodal/ytdl-python | fa40b7722fb51c8cad17d690b83b0f08f36c203a | [
"MIT"
] | null | null | null | import bottle
root = __import__("pathlib").Path(__file__).resolve().parent
bottle.TEMPLATE_PATH = [str(root / "views")]
app = bottle.default_app()
host = "127.0.0.1"
port = "65534"
from . import controller
from . import download_video
| 19.833333 | 60 | 0.722689 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 34 | 0.142857 |
3aeb5f1a3b042dd49ac3276109266415fd562f10 | 2,045 | py | Python | src/emutils/geometry/ball.py | emanuele-albini/emutils | d5e3939da8a14b629879f06d87d4bd371e7117ab | [
"MIT"
] | null | null | null | src/emutils/geometry/ball.py | emanuele-albini/emutils | d5e3939da8a14b629879f06d87d4bd371e7117ab | [
"MIT"
] | null | null | null | src/emutils/geometry/ball.py | emanuele-albini/emutils | d5e3939da8a14b629879f06d87d4bd371e7117ab | [
"MIT"
] | null | null | null | import logging
import numpy as np
__all__ = [
'generate_random_points_inside_balls',
'generate_random_point_inside_balls',
'generate_random_points_inside_ball',
'generate_random_point_inside_ball',
]
# %%
def generate_random_points_inside_balls(
X,
normalizer,
mode,
phi,
n=1,
... | 28.402778 | 116 | 0.6489 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 385 | 0.188264 |
3aec38a277d65b28e5bc3af20165517902bdb701 | 1,189 | py | Python | day03/part1.py | mtn/advent19 | 15d4ae84d248fcf66cb5ebdefee7cad4e6c4a9c2 | [
"MIT"
] | null | null | null | day03/part1.py | mtn/advent19 | 15d4ae84d248fcf66cb5ebdefee7cad4e6c4a9c2 | [
"MIT"
] | null | null | null | day03/part1.py | mtn/advent19 | 15d4ae84d248fcf66cb5ebdefee7cad4e6c4a9c2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
def getpts(path):
pts = set()
loc = [0, 0]
for step in path:
direction = step[0]
distance = int(step[1:])
if direction == "R":
for s in range(distance):
pts.add((loc[0] + s + 1, loc[1]))
loc[0] += distance
eli... | 23.78 | 78 | 0.502103 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 52 | 0.043734 |
3aece6336549f29b4f897302ef630eedb4bbc785 | 609 | py | Python | tests/plugins/test_openrectv.py | hymer-up/streamlink | f09bf6e04cddc78eceb9ded655f716ef3ee4b84f | [
"BSD-2-Clause"
] | 5 | 2017-03-21T19:43:17.000Z | 2018-10-03T14:04:29.000Z | tests/plugins/test_openrectv.py | hymer-up/streamlink | f09bf6e04cddc78eceb9ded655f716ef3ee4b84f | [
"BSD-2-Clause"
] | 7 | 2016-10-13T23:29:31.000Z | 2018-06-28T14:04:32.000Z | tests/plugins/test_openrectv.py | bumplzz69/streamlink | 34abc43875d7663ebafa241573dece272e93d88b | [
"BSD-2-Clause"
] | 2 | 2016-11-24T18:37:33.000Z | 2017-03-21T19:43:49.000Z | import unittest
from streamlink.plugins.openrectv import OPENRECtv
class TestPluginOPENRECtv(unittest.TestCase):
def test_can_handle_url(self):
should_match = [
'https://www.openrec.tv/live/DXRLAPSGTpx',
'https://www.openrec.tv/movie/JsDw3rAV2Rj',
]
for url in shou... | 29 | 59 | 0.648604 | 538 | 0.883415 | 0 | 0 | 0 | 0 | 0 | 0 | 108 | 0.17734 |
3aedb392cb14830050e8adbbfe3be5d562d42189 | 2,264 | py | Python | spotify/migrations/0001_initial.py | FattyMango/Syncfy | 291bda024d91f9c6fd5f59c073ecf16c90325d8a | [
"Apache-2.0"
] | null | null | null | spotify/migrations/0001_initial.py | FattyMango/Syncfy | 291bda024d91f9c6fd5f59c073ecf16c90325d8a | [
"Apache-2.0"
] | null | null | null | spotify/migrations/0001_initial.py | FattyMango/Syncfy | 291bda024d91f9c6fd5f59c073ecf16c90325d8a | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.1.3 on 2021-05-07 18:57
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 47.166667 | 146 | 0.628534 | 2,105 | 0.92977 | 0 | 0 | 0 | 0 | 0 | 0 | 320 | 0.141343 |
3aedf299041cb35f549d54f7d93a4515346863a2 | 6,474 | py | Python | paginas/insights.py | Campos1989/AssureNextDataApp | 65023e3e34a8bd8f80d53fce46778d2f4cf9b640 | [
"MIT"
] | 1 | 2021-06-25T08:53:31.000Z | 2021-06-25T08:53:31.000Z | paginas/insights.py | Campos1989/AssureNextDataApp | 65023e3e34a8bd8f80d53fce46778d2f4cf9b640 | [
"MIT"
] | null | null | null | paginas/insights.py | Campos1989/AssureNextDataApp | 65023e3e34a8bd8f80d53fce46778d2f4cf9b640 | [
"MIT"
] | null | null | null | # Script de criação do dashboard
# https://dash.plotly.com/dash-html-components
# Imports
import traceback
import pandas as pd
import plotly.express as px
import dash_core_components as dcc
import dash_bootstrap_components as dbc
import dash_html_components as html
from dash.dependencies import Input, Output
# Módulo... | 78.95122 | 998 | 0.605653 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,245 | 0.494137 |
3aef6a1d97b22b7334946b3961dc63d93d47db28 | 752 | py | Python | api/serializers.py | isabella232/urlprompt | b689ed0f2e82633653d181959af304590fea8b02 | [
"Apache-2.0"
] | null | null | null | api/serializers.py | isabella232/urlprompt | b689ed0f2e82633653d181959af304590fea8b02 | [
"Apache-2.0"
] | 6 | 2021-09-30T11:31:58.000Z | 2022-03-21T15:12:28.000Z | api/serializers.py | isabella232/urlprompt | b689ed0f2e82633653d181959af304590fea8b02 | [
"Apache-2.0"
] | 1 | 2022-03-27T16:53:05.000Z | 2022-03-27T16:53:05.000Z | from rest_framework import serializers
from core.models import Prompt, CustomUser
class CustomUserSerializer(serializers.ModelSerializer):
class Meta:
model = CustomUser
fields = ["id", "username"]
class PromptSerializer(serializers.HyperlinkedModelSerializer):
created_by = CustomUserSeriali... | 31.333333 | 93 | 0.682181 | 663 | 0.881649 | 0 | 0 | 0 | 0 | 0 | 0 | 157 | 0.208777 |
3aef79b3128b41665021c29aae4c84fa02130963 | 246 | py | Python | tests/test-config.py | kjdoyle/elyra | bfb79a8e84c85b7d0f39bb168224aed69dbbd808 | [
"Apache-2.0"
] | 2 | 2020-05-23T11:21:31.000Z | 2020-06-03T22:52:09.000Z | tests/test-config.py | kjdoyle/elyra | bfb79a8e84c85b7d0f39bb168224aed69dbbd808 | [
"Apache-2.0"
] | null | null | null | tests/test-config.py | kjdoyle/elyra | bfb79a8e84c85b7d0f39bb168224aed69dbbd808 | [
"Apache-2.0"
] | 1 | 2020-05-17T15:19:13.000Z | 2020-05-17T15:19:13.000Z | c.Session.debug = True
c.LabApp.token = 'test'
c.LabApp.open_browser = False
c.NotebookApp.port_retries = 0
c.LabApp.workspaces_dir = './build/cypress-tests'
c.FileContentsManager.root_dir = './build/cypress-tests'
c.LabApp.quit_button = False
| 30.75 | 56 | 0.764228 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 52 | 0.211382 |
3af126e2b1c1da6fe4b8a9b65f8ca9e789c79dde | 191 | py | Python | apps/access/admin.py | usdigitalresponse/rtovid-encampments | b9d0b6ff27c0b47e31b5db5b0f2f92a1da446f86 | [
"MIT"
] | 1 | 2021-06-22T10:11:10.000Z | 2021-06-22T10:11:10.000Z | apps/access/admin.py | usdigitalresponse/rtovid-encampments | b9d0b6ff27c0b47e31b5db5b0f2f92a1da446f86 | [
"MIT"
] | 23 | 2020-05-28T01:00:01.000Z | 2020-06-23T12:49:55.000Z | apps/access/admin.py | RTCovid/encampments | b9d0b6ff27c0b47e31b5db5b0f2f92a1da446f86 | [
"MIT"
] | null | null | null | from django.contrib.gis import admin
from apps.access.models import InvitedEmail
class InvitedEmailAdmin(admin.ModelAdmin):
pass
admin.site.register(InvitedEmail, InvitedEmailAdmin)
| 17.363636 | 52 | 0.816754 | 51 | 0.267016 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3af3501863237636c8ad601e7b05518a6b063f13 | 1,550 | py | Python | phr/ciudadano/migrations/0053_antecedentereaccionadversamedicamento.py | richardqa/django-ex | e5b8585f28a97477150ac5daf5e55c74b70d87da | [
"CC0-1.0"
] | null | null | null | phr/ciudadano/migrations/0053_antecedentereaccionadversamedicamento.py | richardqa/django-ex | e5b8585f28a97477150ac5daf5e55c74b70d87da | [
"CC0-1.0"
] | null | null | null | phr/ciudadano/migrations/0053_antecedentereaccionadversamedicamento.py | richardqa/django-ex | e5b8585f28a97477150ac5daf5e55c74b70d87da | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-02 14:10
from __future__ import unicode_literals
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
dependencies = [
('ciudadano', '0052_auto_20170920_1003'),
]
operations = [
migrat... | 41.891892 | 140 | 0.593548 | 1,381 | 0.890393 | 0 | 0 | 0 | 0 | 0 | 0 | 368 | 0.237266 |
3af4df280e903825cd489383b9d45d6281eb6687 | 491 | py | Python | test/log_check.py | talareq/selenium | 302804aa34149ea38b42fe7b55d806211e9e4435 | [
"Apache-2.0"
] | null | null | null | test/log_check.py | talareq/selenium | 302804aa34149ea38b42fe7b55d806211e9e4435 | [
"Apache-2.0"
] | null | null | null | test/log_check.py | talareq/selenium | 302804aa34149ea38b42fe7b55d806211e9e4435 | [
"Apache-2.0"
] | null | null | null |
def test_example(app):
app.login_admin()
app.get("http://localhost/litecart/admin/?app=catalog&doc=catalog&category_id=1")
menu=app.driver.find_elements_by_css_selector("tr .row")
for n in range(0,len(menu)):
element = app.driver.find_elements_by_css_selector("tr .row")
element[n].clic... | 35.071429 | 96 | 0.672098 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 171 | 0.348269 |
3af623d8cb194fe7d9a3384310c51e0b984f4828 | 302 | py | Python | Tracking/Image/pygui1.py | RoosterQMonee/GTAG-PyAI | 1bef3cfc85da034f9129a008bd6c5e9114ce3cfd | [
"MIT"
] | null | null | null | Tracking/Image/pygui1.py | RoosterQMonee/GTAG-PyAI | 1bef3cfc85da034f9129a008bd6c5e9114ce3cfd | [
"MIT"
] | 1 | 2022-03-30T14:11:13.000Z | 2022-03-30T14:11:37.000Z | Tracking/Image/pygui1.py | RoosterQMonee/GTAG-PyAI | 1bef3cfc85da034f9129a008bd6c5e9114ce3cfd | [
"MIT"
] | null | null | null | from pyautogui import *
import pyautogui
import time
while 1:
if pyautogui.locateOnScreen('img.png', region=(150,175,350,600), grayscale=True, confidence=0.8) != None:
print("I can see it")
time.sleep(0.5)
else:
print("I am unable to see it")
time.sleep(0.5)
| 25.166667 | 109 | 0.625828 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 46 | 0.152318 |
3af692d7975c4dc7bec14dbb6e213b560c3130d8 | 7,526 | py | Python | harvest/detailedreports.py | rzuris/python-harvest_apiv2 | 1a4915c2772aa9d27b74a545b14138d418566832 | [
"MIT"
] | null | null | null | harvest/detailedreports.py | rzuris/python-harvest_apiv2 | 1a4915c2772aa9d27b74a545b14138d418566832 | [
"MIT"
] | null | null | null | harvest/detailedreports.py | rzuris/python-harvest_apiv2 | 1a4915c2772aa9d27b74a545b14138d418566832 | [
"MIT"
] | 1 | 2022-03-28T10:47:37.000Z | 2022-03-28T10:47:37.000Z |
# Copyright 2020 Bradbase
import itertools
from datetime import datetime, timedelta, date
from calendar import monthrange
from harvest import Harvest
from .harvestdataclasses import *
class DetailedReports(Harvest):
def __init__(self, uri, auth):
super().__init__(uri, auth)
self.client_cache = ... | 40.245989 | 622 | 0.558464 | 7,337 | 0.974887 | 0 | 0 | 0 | 0 | 0 | 0 | 370 | 0.049163 |
3af6f1205b131d37a985d1c51f9e6d5d18cb4383 | 328 | py | Python | bibliopixel/commands/kill.py | rec/leds | ed5fd11ed155e7008d4ef6d5b3d82cd7f8b3ed6a | [
"MIT"
] | 253 | 2015-01-03T23:17:57.000Z | 2021-12-14T02:31:08.000Z | bibliopixel/commands/kill.py | rec/leds | ed5fd11ed155e7008d4ef6d5b3d82cd7f8b3ed6a | [
"MIT"
] | 879 | 2015-01-11T16:07:25.000Z | 2021-12-10T16:24:31.000Z | bibliopixel/commands/kill.py | rec/leds | ed5fd11ed155e7008d4ef6d5b3d82cd7f8b3ed6a | [
"MIT"
] | 71 | 2015-01-04T01:02:47.000Z | 2022-03-25T18:30:10.000Z | """
Send a kill signal to a BiblioPixel process running on this
machine to abruptly kill it
DEPRECATED: use
.. code-block:: bash
$ kill -kill `bpa-pid`
"""
DESCRIPTION = """
Example:
.. code-block:: bash
$ bp kill
"""
from .. util.signal_handler import make_command
add_arguments, run = make_command('SI... | 13.666667 | 59 | 0.682927 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 226 | 0.689024 |
3af703dc54a66f683dbd47d8d1a850161cd49620 | 5,645 | py | Python | DataProcessing.py | manohar9600/The-Movies-Recommendation | 138587220ff6bef4c856ea905af5b7e9574e5964 | [
"MIT"
] | null | null | null | DataProcessing.py | manohar9600/The-Movies-Recommendation | 138587220ff6bef4c856ea905af5b7e9574e5964 | [
"MIT"
] | null | null | null | DataProcessing.py | manohar9600/The-Movies-Recommendation | 138587220ff6bef4c856ea905af5b7e9574e5964 | [
"MIT"
] | null | null | null | # Standard imports
import json
import ast
# Third party imports
import pandas as pd
from tabulate import tabulate
# Local application imports
from utils.logger import logger
class Dataloding:
"""Loads movie lens and TMDB data from data folder.
"""
def __init__(self, data_folder='data'):
sel... | 37.384106 | 81 | 0.583702 | 5,411 | 0.958547 | 0 | 0 | 0 | 0 | 0 | 0 | 1,628 | 0.288397 |
aae5f1d79a16e11baab64d302ca2965536e5380a | 95 | py | Python | coremodels/apps.py | pakponj/coursing-field | 0368c2fc546b3955dc1fef1fc00252d8f015f56d | [
"Apache-2.0"
] | null | null | null | coremodels/apps.py | pakponj/coursing-field | 0368c2fc546b3955dc1fef1fc00252d8f015f56d | [
"Apache-2.0"
] | null | null | null | coremodels/apps.py | pakponj/coursing-field | 0368c2fc546b3955dc1fef1fc00252d8f015f56d | [
"Apache-2.0"
] | null | null | null | from django.apps import AppConfig
class CoremodelsConfig(AppConfig):
name = 'coremodels'
| 15.833333 | 34 | 0.768421 | 58 | 0.610526 | 0 | 0 | 0 | 0 | 0 | 0 | 12 | 0.126316 |
aae6433bbacb013e1d4734b577daca4627358efe | 421 | py | Python | easy/1710-maximum-units-on-a-truck.py | changmeng72/leecode_python3 | 8384f52f0dd74b06b1b6aefa277dde6a228ff5f3 | [
"MIT"
] | null | null | null | easy/1710-maximum-units-on-a-truck.py | changmeng72/leecode_python3 | 8384f52f0dd74b06b1b6aefa277dde6a228ff5f3 | [
"MIT"
] | null | null | null | easy/1710-maximum-units-on-a-truck.py | changmeng72/leecode_python3 | 8384f52f0dd74b06b1b6aefa277dde6a228ff5f3 | [
"MIT"
] | null | null | null | class Solution:
def maximumUnits(self, boxTypes: List[List[int]], truckSize: int) -> int:
boxTypes.sort(key=lambda x: x[1],reverse = True)
r = 0
remaining = truckSize
for boxType in boxTypes:
b = min(remaining,boxType[0])
r += b * boxType[1]
... | 32.384615 | 78 | 0.489311 | 407 | 0.966746 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
aae681f8c4e041d774adeeb9e3c2ebb127572c89 | 688 | py | Python | scripts/forms.py | ansa-aboudou/resumex | 8c546403495c6d0045af4530a3f8601f69035528 | [
"MIT"
] | null | null | null | scripts/forms.py | ansa-aboudou/resumex | 8c546403495c6d0045af4530a3f8601f69035528 | [
"MIT"
] | null | null | null | scripts/forms.py | ansa-aboudou/resumex | 8c546403495c6d0045af4530a3f8601f69035528 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from wtforms import Form, StringField, validators
class LoginForm(Form):
username = StringField('Username:', validators=[validators.required(), validators.Length(min=1, max=30)])
password = StringField('Password:', validators=[validators.required(), validators.Length(min=1, max... | 49.142857 | 119 | 0.710756 | 600 | 0.872093 | 0 | 0 | 0 | 0 | 0 | 0 | 76 | 0.110465 |
aae69a1c9858fa2062e072c3ac6fac72ce0dc685 | 334 | py | Python | OpenCV/assign1_2.py | Aanal2901/Autumn-of-Automation | c6ea432d3608652254b841c392dde6aa466b2df4 | [
"MIT"
] | null | null | null | OpenCV/assign1_2.py | Aanal2901/Autumn-of-Automation | c6ea432d3608652254b841c392dde6aa466b2df4 | [
"MIT"
] | null | null | null | OpenCV/assign1_2.py | Aanal2901/Autumn-of-Automation | c6ea432d3608652254b841c392dde6aa466b2df4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Jul 24 00:44:49 2020
@author: Aanal Sonara
"""
import cv2
cap = cv2.VideoCapture(0)
while cap.isOpened():
_, frame = cap.read()
cv2.imshow("live video", frame)
k = cv2.waitKey(1) and 0xFF
if k==27:
break
cap.release()
cv2.destr... | 17.578947 | 36 | 0.577844 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 106 | 0.317365 |
aae6ab08212b4b7afe1925bc3ddbf0db7587516e | 5,515 | py | Python | site_parser/site_parser.py | TheStalkerDen/Comp-Architecture-Lab1 | ad92aed0c639cb223adc033aba5f79cc6a8f5344 | [
"MIT"
] | null | null | null | site_parser/site_parser.py | TheStalkerDen/Comp-Architecture-Lab1 | ad92aed0c639cb223adc033aba5f79cc6a8f5344 | [
"MIT"
] | null | null | null | site_parser/site_parser.py | TheStalkerDen/Comp-Architecture-Lab1 | ad92aed0c639cb223adc033aba5f79cc6a8f5344 | [
"MIT"
] | null | null | null | import configparser
import os
import tempfile
import urllib.request
import xml.dom.minidom
import xml.etree.ElementTree as ET
from urllib.error import HTTPError, URLError
from urllib.parse import urlparse
from bs4 import BeautifulSoup
from tinytag import TinyTag
import gevent
dir_path = os.path.dirname(os.path.realpa... | 36.282895 | 114 | 0.677244 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 398 | 0.072167 |
aae7a8e4bea1bfaeb77207d29d33884bce510446 | 4,341 | py | Python | project/encoder_toy.py | tkosht/wikiencoder | c1744e60e902949e1926c9efe0c24eb3ac5f00fd | [
"MIT"
] | null | null | null | project/encoder_toy.py | tkosht/wikiencoder | c1744e60e902949e1926c9efe0c24eb3ac5f00fd | [
"MIT"
] | null | null | null | project/encoder_toy.py | tkosht/wikiencoder | c1744e60e902949e1926c9efe0c24eb3ac5f00fd | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import numpy
import torch
import torchnet
from tqdm import tqdm
from torchnet.engine import Engine
from torchnet.logger import VisdomPlotLogger, VisdomLogger
import project.deco as deco
from project.sequoder import SequenceEncoder, get_loss
def get_args(... | 31.919118 | 95 | 0.628657 | 0 | 0 | 0 | 0 | 2,421 | 0.557706 | 0 | 0 | 1,197 | 0.275743 |
aae827e1c08cf7a4934daf6680f0a298b8d6f043 | 18,420 | py | Python | families/supplychain_python/sawtooth_supplychain/processor/handler.py | trust-tech/sawtooth-core | fcd66ff2f13dba51d7642049e0c0306dbee3b07d | [
"Apache-2.0"
] | null | null | null | families/supplychain_python/sawtooth_supplychain/processor/handler.py | trust-tech/sawtooth-core | fcd66ff2f13dba51d7642049e0c0306dbee3b07d | [
"Apache-2.0"
] | null | null | null | families/supplychain_python/sawtooth_supplychain/processor/handler.py | trust-tech/sawtooth-core | fcd66ff2f13dba51d7642049e0c0306dbee3b07d | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 40.394737 | 80 | 0.591205 | 16,816 | 0.912921 | 0 | 0 | 16,200 | 0.879479 | 0 | 0 | 4,584 | 0.24886 |
aaebd6d86a473c46810168a0f679eb02f758b767 | 875 | py | Python | pretoinf.py | nirmalya8/CalculateAndConvert | 07eb954e2ac5960363637079bc8c179edec37a69 | [
"CC-BY-3.0"
] | 1 | 2021-01-11T09:01:51.000Z | 2021-01-11T09:01:51.000Z | pretoinf.py | nirmalya8/CalculateAndConvert | 07eb954e2ac5960363637079bc8c179edec37a69 | [
"CC-BY-3.0"
] | null | null | null | pretoinf.py | nirmalya8/CalculateAndConvert | 07eb954e2ac5960363637079bc8c179edec37a69 | [
"CC-BY-3.0"
] | 1 | 2021-01-10T09:25:45.000Z | 2021-01-10T09:25:45.000Z | class prefixtoinfix:
def prefixToInfix(self,prefix):
stack = []
l = []
# read prefix in reverse order
i = len(prefix) - 1
for j in prefix:
if j == ' ':
return [],False
while i >= 0:
if not self.isOperator(prefix[i]):
... | 29.166667 | 92 | 0.377143 | 875 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 99 | 0.113143 |
aaebe47258a943fd8be9436d233e4c883e9d3710 | 13,212 | py | Python | iarm_kernel/iarmkernel.py | howardjp/iMCS-48 | b545a37a9b15fdcdacb4e2ba263f45a9c62df079 | [
"MIT"
] | 20 | 2016-05-16T18:23:49.000Z | 2021-08-06T17:15:34.000Z | iarm_kernel/iarmkernel.py | howardjp/iMCS-48 | b545a37a9b15fdcdacb4e2ba263f45a9c62df079 | [
"MIT"
] | 11 | 2016-07-14T17:57:10.000Z | 2020-11-18T21:11:21.000Z | iarm_kernel/iarmkernel.py | howardjp/iMCS-48 | b545a37a9b15fdcdacb4e2ba263f45a9c62df079 | [
"MIT"
] | 4 | 2016-08-14T19:11:21.000Z | 2021-08-18T09:38:25.000Z | from ipykernel.kernelbase import Kernel
from iarm.arm import Arm
import re
import warnings
import iarm.exceptions
class ArmKernel(Kernel):
implementation = 'IArm'
implementation_version = '0.1.0'
language = 'ARM'
language_version = iarm.__version__
language_info = {
'name': 'ARM Coretex M0... | 37.748571 | 128 | 0.546776 | 12,963 | 0.981153 | 0 | 0 | 0 | 0 | 0 | 0 | 4,497 | 0.340372 |
aaecb8a64722e04f0363e0de885f9fecd7b99152 | 383 | py | Python | pyweb/com/xsqt/Student.py | zhougithui/python | fbac0b2508545083044eafde4bf6eb58d4606eb5 | [
"Apache-2.0"
] | null | null | null | pyweb/com/xsqt/Student.py | zhougithui/python | fbac0b2508545083044eafde4bf6eb58d4606eb5 | [
"Apache-2.0"
] | null | null | null | pyweb/com/xsqt/Student.py | zhougithui/python | fbac0b2508545083044eafde4bf6eb58d4606eb5 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/evn python
class Student(object):
__slots__ = ('__birth', '__age')
@property
def birth(self):
return self.__birth
@birth.setter
def birth(self, value):
self.__birth = value
@property
def age(self):
return 2015 - self.__birth
if __name__ == '__main__... | 15.958333 | 36 | 0.587467 | 268 | 0.699739 | 0 | 0 | 191 | 0.498695 | 0 | 0 | 48 | 0.125326 |
aaee23ba02e2df2083e1a2d6aa2430790b04b2a3 | 35 | py | Python | src/utils/__init__.py | Columbine21/Hierarchical-Attention-Networks | 623840970cb302c7f74515ffff1560c0131b975e | [
"MIT"
] | 1 | 2021-03-15T02:45:28.000Z | 2021-03-15T02:45:28.000Z | src/utils/__init__.py | Columbine21/Hierarchical-Attention-Networks | 623840970cb302c7f74515ffff1560c0131b975e | [
"MIT"
] | null | null | null | src/utils/__init__.py | Columbine21/Hierarchical-Attention-Networks | 623840970cb302c7f74515ffff1560c0131b975e | [
"MIT"
] | null | null | null | from .vocab import gloveVocabulary
| 17.5 | 34 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
aaf0aa3cbdbb1c81c191ac04d6a56e4b822a4b99 | 980 | py | Python | src/weapon.py | gcairesdev/zelda | 33fce4196c306d0a840aa189b0213f2879058090 | [
"MIT"
] | 2 | 2022-03-10T22:22:19.000Z | 2022-03-24T14:42:55.000Z | src/weapon.py | gcairesdev/zelda | 33fce4196c306d0a840aa189b0213f2879058090 | [
"MIT"
] | null | null | null | src/weapon.py | gcairesdev/zelda | 33fce4196c306d0a840aa189b0213f2879058090 | [
"MIT"
] | null | null | null | import pygame
class Weapon(pygame.sprite.Sprite):
def __init__(self, player, groups):
super().__init__(groups)
self.spriteType = 'weapon'
direction = player.status.split('_')[0]
# graphic
fullPath = f'./src/img/weapons/{player.weapon}/{direction}.png'
self.image = ... | 36.296296 | 75 | 0.586735 | 963 | 0.982653 | 0 | 0 | 0 | 0 | 0 | 0 | 102 | 0.104082 |
aaf11ccf2412c6e3efada30eaecd8bb0db6b297a | 3,052 | py | Python | Assignment1/initial/src/main/mp/utils/AST.py | jimcbl/ppl_hcmut_assignment | 7a06d61e4cda8c76f62a1da5b93ef66d98198b80 | [
"MIT"
] | 1 | 2019-11-27T13:41:07.000Z | 2019-11-27T13:41:07.000Z | Assignment1/initial/src/main/mp/utils/AST.py | jimodayne/ppl_hcmut_assignment | 7a06d61e4cda8c76f62a1da5b93ef66d98198b80 | [
"MIT"
] | null | null | null | Assignment1/initial/src/main/mp/utils/AST.py | jimodayne/ppl_hcmut_assignment | 7a06d61e4cda8c76f62a1da5b93ef66d98198b80 | [
"MIT"
] | 1 | 2019-12-03T05:33:13.000Z | 2019-12-03T05:33:13.000Z | from abc import ABC, abstractmethod, ABCMeta
from Visitor import Visitor
class AST(ABC):
def __eq__(self, other):
return self.__dict__ == other.__dict__
@abstractmethod
def accept(self, v, param):
return v.visit(self, param)
class Program(AST):
#decl:list(Decl)
def... | 23.476923 | 154 | 0.572412 | 2,907 | 0.95249 | 0 | 0 | 85 | 0.027851 | 0 | 0 | 325 | 0.106488 |
aaf368c0cbb0ab66f42b16908ff73d7af84048da | 1,224 | py | Python | humans-in-the-loop-files/machine-learning-scripts/ImageDownloader.py | LibraryOfCongress/hitl | 8b054f1433b2129bfbaf16fcb09df637335a04a0 | [
"MIT"
] | 3 | 2021-12-06T16:44:16.000Z | 2022-03-30T05:45:48.000Z | humans-in-the-loop-files/machine-learning-scripts/ImageDownloader.py | LibraryOfCongress/hitl | 8b054f1433b2129bfbaf16fcb09df637335a04a0 | [
"MIT"
] | 8 | 2022-02-14T22:39:19.000Z | 2022-03-31T01:54:06.000Z | humans-in-the-loop-files/machine-learning-scripts/ImageDownloader.py | LibraryOfCongress/hitl | 8b054f1433b2129bfbaf16fcb09df637335a04a0 | [
"MIT"
] | 1 | 2022-02-15T18:59:44.000Z | 2022-02-15T18:59:44.000Z | #
# Download images from the LOC IIIF server and store them locally
#
import requests
from pathlib import Path
import shutil
import time
base = 'https://www.loc.gov/'
iiifbase = 'https://tile.loc.gov/image-services/iiif/'
def getImages(item, dest_dir):
downloaded_images = list()
Path(dest_dir).mkdir(parents=Tr... | 36 | 146 | 0.607843 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 293 | 0.239379 |
aaf4cca94bb840d24c6ed43cf92a6175ba126324 | 1,291 | py | Python | Task2E.py | bendomb/IA-Flood-Warning-System | 8e476010e83b64aca8a05dc31f88fe2d6fbd3c9f | [
"MIT"
] | null | null | null | Task2E.py | bendomb/IA-Flood-Warning-System | 8e476010e83b64aca8a05dc31f88fe2d6fbd3c9f | [
"MIT"
] | null | null | null | Task2E.py | bendomb/IA-Flood-Warning-System | 8e476010e83b64aca8a05dc31f88fe2d6fbd3c9f | [
"MIT"
] | null | null | null | from floodsystem.datafetcher import fetch_measure_levels
from floodsystem.stationdata import build_station_list, update_water_levels
import floodsystem.flood as flood
import floodsystem.plot as plot
from datetime import datetime, timedelta
import datetime
stations = build_station_list()
update_water_levels(stations)
... | 32.275 | 120 | 0.691712 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 333 | 0.25794 |
aaf7c70154f36b59a8bb5810940a58d3ac7062c0 | 2,007 | py | Python | cracker.py | alin-dinescu/WPA2-HalfHandshake-Crack | fc8e31dd0e34c3ac9c7e95fceb222a4212bd1342 | [
"OpenSSL",
"MIT"
] | null | null | null | cracker.py | alin-dinescu/WPA2-HalfHandshake-Crack | fc8e31dd0e34c3ac9c7e95fceb222a4212bd1342 | [
"OpenSSL",
"MIT"
] | null | null | null | cracker.py | alin-dinescu/WPA2-HalfHandshake-Crack | fc8e31dd0e34c3ac9c7e95fceb222a4212bd1342 | [
"OpenSSL",
"MIT"
] | null | null | null | import hmac, hashlib, binascii
from hashlib import sha1
from binascii import a2b_hex, b2a_hex, unhexlify
from pbkdf2_ctypes import pbkdf2_bin
from multiprocessing import Pool, Queue, cpu_count
from datetime import datetime
from time import sleep
numOfPs = cpu_count()
def hmac4times(ptk, pke):
tempPke = pke
r... | 33.45 | 163 | 0.605879 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 62 | 0.030892 |
aaf844dccdd148febc58c248704051fea8ef7efb | 1,256 | py | Python | gui_components/cell.py | FilipRistic2922/SudokuPy | 7098530d2fd9d82cc2e66649c993630ef6e5774a | [
"MIT"
] | null | null | null | gui_components/cell.py | FilipRistic2922/SudokuPy | 7098530d2fd9d82cc2e66649c993630ef6e5774a | [
"MIT"
] | null | null | null | gui_components/cell.py | FilipRistic2922/SudokuPy | 7098530d2fd9d82cc2e66649c993630ef6e5774a | [
"MIT"
] | null | null | null | import pygame
from gui_components.gui_util import get_font, BLACK, BLUE, GRAY
class Cell:
def __init__(self, value, row, col, width, height):
self.value = value
self.temp = 0
self.row = row
self.col = col
self.width = width
self.height = height
self.set_by... | 27.304348 | 105 | 0.527866 | 1,174 | 0.934713 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | 0.005573 |
aaf88ec65f719215938c906b09236be307dd6034 | 2,246 | py | Python | chapter2/remove_dups.py | MubashirullahD/cracking-the-coding-interview | f9595886967e7c63cec19028239e4289e9cd1f9e | [
"MIT"
] | 1 | 2021-12-01T13:26:10.000Z | 2021-12-01T13:26:10.000Z | chapter2/remove_dups.py | MubashirullahD/cracking-the-coding-interview | f9595886967e7c63cec19028239e4289e9cd1f9e | [
"MIT"
] | null | null | null | chapter2/remove_dups.py | MubashirullahD/cracking-the-coding-interview | f9595886967e7c63cec19028239e4289e9cd1f9e | [
"MIT"
] | null | null | null | """
Remove Dups: Write code to remove duplicates from an unsorted linked list.
FOLLOW UP
How would you solve this problem if a temporary buffer is not allowed?
"""
from linkedlist import linkedlist
def remove_dup(linked_list):
placeholder = dict()
pointer1 = linked_list.top # This guy deletes the du... | 27.060241 | 77 | 0.629564 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 356 | 0.158504 |
aaf93a0fc8d0fd36a7282b6699c6daddec972081 | 1,172 | py | Python | examples/sample.py | odra/habet | cb791c3367f06fff0a6557fe5697033b2262bfc8 | [
"MIT"
] | null | null | null | examples/sample.py | odra/habet | cb791c3367f06fff0a6557fe5697033b2262bfc8 | [
"MIT"
] | null | null | null | examples/sample.py | odra/habet | cb791c3367f06fff0a6557fe5697033b2262bfc8 | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
import sys
sys.path.append('../')
from habet import Application, Response, Handler, errors
import json
#custom error register
class InvalidJSONError(errors.BaseServerError):
def __init__(self, *args, **kwargs):
super(InvalidJSONError, self).__init__(*args, **kwargs)
self.status = 4... | 21.309091 | 63 | 0.672355 | 810 | 0.691126 | 0 | 0 | 0 | 0 | 0 | 0 | 244 | 0.208191 |
aafaed7bd2fdeb1c2bbe286e7b1293532edfc8c8 | 2,516 | py | Python | api/models.py | mz-techops/banhammer | 02476db3d2bb617dbe50827687065fbea7553caf | [
"BSD-3-Clause"
] | 3 | 2018-03-09T23:29:25.000Z | 2020-11-25T15:34:13.000Z | api/models.py | whyallyn/banhammer | 59fc81b15d9950a7a40279a9d1df8101c58df569 | [
"BSD-3-Clause"
] | 3 | 2018-05-08T01:10:43.000Z | 2021-03-19T21:56:36.000Z | api/models.py | whyallyn/banhammer | 59fc81b15d9950a7a40279a9d1df8101c58df569 | [
"BSD-3-Clause"
] | 2 | 2018-05-10T15:07:24.000Z | 2018-06-20T16:24:00.000Z | """API Django models."""
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Target(models.Model):
"""Definition of a Target."""
BAN = 'ban'
ALLOW = 'allow'
TARGET_ACTION_CHOICES = (
... | 31.848101 | 76 | 0.636328 | 2,295 | 0.912162 | 0 | 0 | 2,353 | 0.935215 | 0 | 0 | 832 | 0.330684 |
aafb1cf5d24f222fa6f06ff100c89a778fe48350 | 179 | py | Python | accounts/urls.py | Julmgc/Course-Organizer | b383f2845474314186a2ac6589885af890889da8 | [
"MIT"
] | null | null | null | accounts/urls.py | Julmgc/Course-Organizer | b383f2845474314186a2ac6589885af890889da8 | [
"MIT"
] | null | null | null | accounts/urls.py | Julmgc/Course-Organizer | b383f2845474314186a2ac6589885af890889da8 | [
"MIT"
] | null | null | null | from django.urls import path
from .views import UserLogin, UserRegister
urlpatterns = [
path("accounts/", UserRegister.as_view()),
path("login/", UserLogin.as_view()),
]
| 22.375 | 46 | 0.709497 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 19 | 0.106145 |
aafb2505abc576fb91ec98a082757451092677b3 | 1,795 | py | Python | src/ranking_utils/scripts/preprocess.py | fknauf/ranking-utils | ce1a0be4e560d5f156a76cb5c0e3751793c67648 | [
"MIT"
] | null | null | null | src/ranking_utils/scripts/preprocess.py | fknauf/ranking-utils | ce1a0be4e560d5f156a76cb5c0e3751793c67648 | [
"MIT"
] | null | null | null | src/ranking_utils/scripts/preprocess.py | fknauf/ranking-utils | ce1a0be4e560d5f156a76cb5c0e3751793c67648 | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
import argparse
from pathlib import Path
from pytorch_lightning import seed_everything
from ranking_utils.datasets.antique import ANTIQUE
from ranking_utils.datasets.fiqa import FiQA
from ranking_utils.datasets.insuranceqa import InsuranceQA
from ranking_utils.datasets.trecdl import TRECDL20... | 29.42623 | 88 | 0.690808 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 350 | 0.194986 |
aafc4992c92b83ce538e9440118f026965da7bbf | 6,158 | py | Python | camshot.py | corerd/camshot | b85787a27eac97ed6c9617203aab0e0a62a4960a | [
"MIT"
] | 1 | 2020-06-14T11:01:34.000Z | 2020-06-14T11:01:34.000Z | camshot.py | corerd/camshot | b85787a27eac97ed6c9617203aab0e0a62a4960a | [
"MIT"
] | null | null | null | camshot.py | corerd/camshot | b85787a27eac97ed6c9617203aab0e0a62a4960a | [
"MIT"
] | null | null | null | #!/usr/bin/python
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Corrado Ubezio
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rig... | 39.729032 | 142 | 0.709159 | 151 | 0.024521 | 0 | 0 | 0 | 0 | 0 | 0 | 2,129 | 0.345729 |
aafcb95092c87ce209c68768cc38ba847d90f715 | 945 | py | Python | lightcycle-backend/lightcycle/basebot.py | Onapsis/pytron | 2ed0622ae13f010bcd8fdbbd2f1e9cba3d2e3d58 | [
"MIT"
] | null | null | null | lightcycle-backend/lightcycle/basebot.py | Onapsis/pytron | 2ed0622ae13f010bcd8fdbbd2f1e9cba3d2e3d58 | [
"MIT"
] | null | null | null | lightcycle-backend/lightcycle/basebot.py | Onapsis/pytron | 2ed0622ae13f010bcd8fdbbd2f1e9cba3d2e3d58 | [
"MIT"
] | null | null | null | # encoding=utf-8
import random
from collections import namedtuple
Point = namedtuple('Point', 'x y')
DIRECTIONS = {
'N': Point(0, -1),
'E': Point(1, 0),
'S': Point(0, 1),
'W': Point(-1, 0),
}
class LightCycleBaseBot(object):
def get_next_step(self, arena, x, y, direction):
raise NotIm... | 27 | 73 | 0.583069 | 727 | 0.769312 | 0 | 0 | 0 | 0 | 0 | 0 | 96 | 0.101587 |
aafd6a05995c3be1c704460d3a42582a855ce32e | 6,629 | py | Python | TD1/utils/extrinsic.py | AntoineOrgerit/Web-Scrapping | 552f2f85d775ada9e85f897713d20de09c0919ed | [
"BSD-3-Clause"
] | null | null | null | TD1/utils/extrinsic.py | AntoineOrgerit/Web-Scrapping | 552f2f85d775ada9e85f897713d20de09c0919ed | [
"BSD-3-Clause"
] | null | null | null | TD1/utils/extrinsic.py | AntoineOrgerit/Web-Scrapping | 552f2f85d775ada9e85f897713d20de09c0919ed | [
"BSD-3-Clause"
] | null | null | null | """
This module allows to perform a specific extrinsic evaluation of files by a specified criteria.
Antoine Orgerit - François Gréau - Lisa Fougeron
La Rochelle Université - 2019-2020
"""
import langid
import json
import copy
import subprocess
from os import listdir, remove
from os.path import isfile, join
from utils... | 38.994118 | 276 | 0.629808 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,962 | 0.295838 |
aafdf4b1d0c84500a3e64c7af727b3f3bc824d1a | 5,002 | py | Python | cinder/tests/unit/policies/test_quotas.py | arunvinodqmco/cinder | 62cb72c6890e458427ba0601646b186b7b36dc01 | [
"Apache-2.0"
] | 571 | 2015-01-01T17:47:26.000Z | 2022-03-23T07:46:36.000Z | cinder/tests/unit/policies/test_quotas.py | arunvinodqmco/cinder | 62cb72c6890e458427ba0601646b186b7b36dc01 | [
"Apache-2.0"
] | 37 | 2015-01-22T23:27:04.000Z | 2021-02-05T16:38:48.000Z | cinder/tests/unit/policies/test_quotas.py | arunvinodqmco/cinder | 62cb72c6890e458427ba0601646b186b7b36dc01 | [
"Apache-2.0"
] | 841 | 2015-01-04T17:17:11.000Z | 2022-03-31T12:06:51.000Z | # Copyright 2021 Red Hat, Inc.
# All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | 33.797297 | 78 | 0.595162 | 4,126 | 0.82487 | 0 | 0 | 3,157 | 0.631148 | 0 | 0 | 1,730 | 0.345862 |
aafe6ad15866307b4277788796934306b2fe5812 | 2,207 | py | Python | build/lib/like_spider/excel.py | wuyingjie1002/like_spider | 379354a362a693d45513aee4a8d871e79d7f8de4 | [
"MIT"
] | 3 | 2019-02-23T08:19:41.000Z | 2021-01-07T08:05:29.000Z | build/lib/like_spider/excel.py | wuyingjie1002/like_spider | 379354a362a693d45513aee4a8d871e79d7f8de4 | [
"MIT"
] | null | null | null | build/lib/like_spider/excel.py | wuyingjie1002/like_spider | 379354a362a693d45513aee4a8d871e79d7f8de4 | [
"MIT"
] | 1 | 2019-02-23T08:19:43.000Z | 2019-02-23T08:19:43.000Z | import time, os
from openpyxl import load_workbook
from openpyxl import Workbook
from .config import *
class Excel():
"""This is a class that saves data to an excel file."""
def loadFile(self, fileName):
"""load excel file"""
self.wb = load_workbook(fileName)
self.sheets = self.wb.get_... | 33.439394 | 63 | 0.487993 | 2,103 | 0.952877 | 0 | 0 | 0 | 0 | 0 | 0 | 243 | 0.110104 |
aafefeb23bc5b42fc6c15fe4bf23b8763287d5b4 | 357 | py | Python | carbontracker/predictor.py | leondz/carbontracker | f8b4542f4a0f803d053401b53a3cc367281b31a9 | [
"MIT"
] | 186 | 2020-05-02T20:51:48.000Z | 2022-03-30T09:33:44.000Z | carbontracker/predictor.py | johnjdailey/carbontracker | 1c9307b5fc2a408667f3a19c12c2b45be08354b2 | [
"MIT"
] | 43 | 2020-05-10T12:44:26.000Z | 2022-03-09T11:12:11.000Z | carbontracker/predictor.py | johnjdailey/carbontracker | 1c9307b5fc2a408667f3a19c12c2b45be08354b2 | [
"MIT"
] | 10 | 2020-05-04T11:20:04.000Z | 2022-02-16T03:02:39.000Z | import numpy as np
# TODO: Do advanced prediction based on profiling work.
def predict_energy(total_epochs, epoch_energy_usages):
avg_epoch_energy = np.mean(epoch_energy_usages)
return total_epochs * avg_epoch_energy
def predict_time(total_epochs, epoch_times):
avg_epoch_time = np.mean(epoch_times)
... | 27.461538 | 55 | 0.792717 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 0.154062 |
c900a339bfb670f70e69fd6eb2b9f7f8d65dd5a7 | 946 | py | Python | city_scrapers/spiders/det_downtown_development_authority.py | just-hugo/city-scrapers-det | 76b52f11506c99e19b7fcaf135cc7570257a2b62 | [
"MIT"
] | 1 | 2020-10-01T18:27:59.000Z | 2020-10-01T18:27:59.000Z | city_scrapers/spiders/det_downtown_development_authority.py | just-hugo/city-scrapers-det | 76b52f11506c99e19b7fcaf135cc7570257a2b62 | [
"MIT"
] | 9 | 2019-11-30T21:33:24.000Z | 2021-04-07T19:26:47.000Z | city_scrapers/spiders/det_downtown_development_authority.py | just-hugo/city-scrapers-det | 76b52f11506c99e19b7fcaf135cc7570257a2b62 | [
"MIT"
] | 5 | 2019-12-20T17:29:10.000Z | 2021-02-14T01:32:26.000Z | from city_scrapers_core.constants import BOARD
from city_scrapers_core.spiders import CityScrapersSpider
from city_scrapers.mixins import DetAuthorityMixin
class DetDowntownDevelopmentAuthoritySpider(DetAuthorityMixin, CityScrapersSpider):
name = "det_downtown_development_authority"
agency = "Detroit Downtow... | 35.037037 | 83 | 0.663848 | 786 | 0.830867 | 0 | 0 | 0 | 0 | 0 | 0 | 298 | 0.315011 |
c90218f051fff4ea8d9d74263bd6864628d0ed69 | 2,172 | py | Python | code/parsing/parsing_args.py | mdheller/SPARQA | 3678798491abeb350d9500182291b9a73da75bed | [
"MIT"
] | 1 | 2020-06-20T12:27:11.000Z | 2020-06-20T12:27:11.000Z | code/parsing/parsing_args.py | mdheller/SPARQA | 3678798491abeb350d9500182291b9a73da75bed | [
"MIT"
] | null | null | null | code/parsing/parsing_args.py | mdheller/SPARQA | 3678798491abeb350d9500182291b9a73da75bed | [
"MIT"
] | null | null | null | from common.bert_args import BertArgs
from sutime import SUTime
from parsing.nltk_nlp_utils import NLTK_NLP
from common import globals_args
from common import hand_files
parser_mode = globals_args.parser_mode
wh_words_set = {"what", "which", "whom", "who", "when", "where", "why", "how", "how many", "how large",... | 65.818182 | 133 | 0.683702 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 881 | 0.405617 |
c90237976b3a9200b3841c1dddf956cf22c21271 | 1,378 | py | Python | torchtext/datasets/amazonreviewfull.py | parmeet/text | 1fb2aedb48b5ecc5e81741e7c8504486b91655c6 | [
"BSD-3-Clause"
] | 3,172 | 2017-01-18T19:47:03.000Z | 2022-03-27T17:06:03.000Z | torchtext/datasets/amazonreviewfull.py | parmeet/text | 1fb2aedb48b5ecc5e81741e7c8504486b91655c6 | [
"BSD-3-Clause"
] | 1,228 | 2017-01-18T20:09:16.000Z | 2022-03-31T04:42:35.000Z | torchtext/datasets/amazonreviewfull.py | parmeet/text | 1fb2aedb48b5ecc5e81741e7c8504486b91655c6 | [
"BSD-3-Clause"
] | 850 | 2017-01-19T03:19:54.000Z | 2022-03-29T15:29:52.000Z | from torchtext.data.datasets_utils import (
_RawTextIterableDataset,
_wrap_split_argument,
_add_docstring_header,
_download_extract_validate,
_create_dataset_directory,
_create_data_from_csv,
)
import os
import logging
URL = 'https://drive.google.com/uc?export=download&id=0Bz8a_Dbh9QhbZVhsUnRWR... | 30.622222 | 125 | 0.716255 | 0 | 0 | 0 | 0 | 580 | 0.4209 | 0 | 0 | 394 | 0.285922 |
c90243bd480bf830b8eea8819352fe119d1a48da | 2,962 | py | Python | code/examples/VsevolodTymofyeyev/example.py | TrackerSB/MasterThesis | 2792203d28d6c7b62f54545344ee6772d2ec5b64 | [
"MIT"
] | null | null | null | code/examples/VsevolodTymofyeyev/example.py | TrackerSB/MasterThesis | 2792203d28d6c7b62f54545344ee6772d2ec5b64 | [
"MIT"
] | null | null | null | code/examples/VsevolodTymofyeyev/example.py | TrackerSB/MasterThesis | 2792203d28d6c7b62f54545344ee6772d2ec5b64 | [
"MIT"
] | null | null | null | import os
from threading import Thread
from typing import List
from aiExchangeMessages_pb2 import SimulationID
def _handle_vehicle(sid: SimulationID, vid: str, requests: List[str]) -> None:
vid_obj = VehicleID()
vid_obj.vid = vid
i = 0
while i < 10:
i += 1
print(sid.sid + ": Test sta... | 36.121951 | 102 | 0.581702 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 384 | 0.129642 |
c903dd831993098c836cb5e931cb47ef98a3829d | 4,869 | py | Python | python/aocrecs/logic/minimap.py | Rotzbua/aocrecs.com | 2f03ece75e7367a99e5f36874727cd5bb90508f7 | [
"MIT"
] | 7 | 2019-10-08T09:04:48.000Z | 2021-02-06T00:05:53.000Z | python/aocrecs/logic/minimap.py | happyleavesaoc/aocrecs.com | 2f03ece75e7367a99e5f36874727cd5bb90508f7 | [
"MIT"
] | 10 | 2020-01-18T22:14:09.000Z | 2021-07-31T21:43:05.000Z | python/aocrecs/logic/minimap.py | happyleavesaoc/aocrecs.com | 2f03ece75e7367a99e5f36874727cd5bb90508f7 | [
"MIT"
] | 5 | 2020-05-08T11:35:14.000Z | 2022-01-16T12:41:57.000Z | """Generate SVG minimap."""
from aioify import wrap as aiowrap
from subprocess import Popen, PIPE
import math
import xml.etree.ElementTree as ET
from aocrecs.consts import PREDATOR_IDS, HERDABLE_IDS, HUNT_IDS, BOAR_IDS, FISH_IDS, FORAGE_ID, TC_IDS
GOLD_COLOR = '#FFC700'
STONE_COLOR = '#919191'
FOOD_COLOR = '#A5C46C'... | 36.609023 | 142 | 0.59047 | 0 | 0 | 0 | 0 | 1,782 | 0.365989 | 0 | 0 | 767 | 0.157527 |
c9050ca554b19fd1e3228026b793070703e19ae1 | 150 | py | Python | NewspaperSpider/NewspaperSpider/items.py | sidharthk9/NewspaperScraper | 9a8d608c55cc6fdfa6492d2ca58739066d65b16e | [
"Unlicense"
] | null | null | null | NewspaperSpider/NewspaperSpider/items.py | sidharthk9/NewspaperScraper | 9a8d608c55cc6fdfa6492d2ca58739066d65b16e | [
"Unlicense"
] | null | null | null | NewspaperSpider/NewspaperSpider/items.py | sidharthk9/NewspaperScraper | 9a8d608c55cc6fdfa6492d2ca58739066d65b16e | [
"Unlicense"
] | null | null | null | import scrapy
from scrapy.item import Field
class TitleItem(scrapy.Item):
heading = Field()
class LinkItem(scrapy.Item):
article = Field() | 15 | 29 | 0.72 | 101 | 0.673333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c90520de032ac5944e1b5e55e1cdb770212939a5 | 3,526 | py | Python | Application/views.py | gdimitris/FleetManagerBackend | 1a5f0c26a4279894b6ed6507cf729f88502d0883 | [
"MIT"
] | null | null | null | Application/views.py | gdimitris/FleetManagerBackend | 1a5f0c26a4279894b6ed6507cf729f88502d0883 | [
"MIT"
] | null | null | null | Application/views.py | gdimitris/FleetManagerBackend | 1a5f0c26a4279894b6ed6507cf729f88502d0883 | [
"MIT"
] | 1 | 2020-05-05T05:42:00.000Z | 2020-05-05T05:42:00.000Z | import os
from datetime import datetime
from flask import render_template, request, jsonify, send_from_directory, url_for
from Application import app, db
from Application.db_operations import update_researcher_timestamp, insert_location_point_in_db, \
insert_or_update_existing_researcher, get_all_researchers_from_d... | 33.903846 | 99 | 0.731707 | 0 | 0 | 0 | 0 | 3,033 | 0.860182 | 0 | 0 | 663 | 0.188032 |
c905ade7488a7156992eba8440fe0b587bb04770 | 347 | py | Python | app/app.py | JulesGrd/Twitter-Dog-Bot | d0b8a12afbf7ca1c42c540032d1ad9ff5681701b | [
"MIT"
] | 2 | 2021-10-08T21:43:44.000Z | 2021-10-08T22:19:22.000Z | app/app.py | JulesGrd/Twitter-Dog-Bot | d0b8a12afbf7ca1c42c540032d1ad9ff5681701b | [
"MIT"
] | 1 | 2021-11-07T20:07:53.000Z | 2021-11-07T20:07:53.000Z | app/app.py | JulesGrd/Twitter-Dog-Bot | d0b8a12afbf7ca1c42c540032d1ad9ff5681701b | [
"MIT"
] | 1 | 2021-11-07T18:05:19.000Z | 2021-11-07T18:05:19.000Z | import tweepy
import dog
from postDog import postDog
from config import data
if __name__ == '__main__':
auth = tweepy.OAuthHandler(data["OAUTH_HANDLER_1"], data["OAUTH_HANDLER_2"])
auth.set_access_token(data["API_KEY_1"], data["API_KEY_2"])
api = tweepy.API(auth)
dogPic = dog.getDog(filename='assets... | 21.6875 | 80 | 0.717579 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 80 | 0.230548 |
c906663e816567788a872d79ad4e2f03fb4244fb | 12,019 | py | Python | python/loom_viewer/loom_cli.py | arao11/pattern_viz | 3123f19a127c9775fadcca25f83aebfc8dc3b9f9 | [
"BSD-2-Clause"
] | 34 | 2017-10-18T06:09:16.000Z | 2022-03-21T18:53:16.000Z | python/loom_viewer/loom_cli.py | arao11/pattern_viz | 3123f19a127c9775fadcca25f83aebfc8dc3b9f9 | [
"BSD-2-Clause"
] | 52 | 2017-10-19T13:35:39.000Z | 2021-06-03T08:54:55.000Z | python/loom_viewer/loom_cli.py | arao11/pattern_viz | 3123f19a127c9775fadcca25f83aebfc8dc3b9f9 | [
"BSD-2-Clause"
] | 6 | 2018-05-28T06:16:26.000Z | 2020-08-17T11:49:34.000Z | #!/usr/bin/env python
# Copyright (c) 2016 Sten Linnarsson
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# li... | 26.473568 | 144 | 0.719611 | 173 | 0.014394 | 0 | 0 | 0 | 0 | 0 | 0 | 7,135 | 0.593643 |
c907566de3410b8c828deb59e531487549202dc6 | 1,260 | py | Python | test_function.py | will-huynh/process_controller | e193c80976ef1d35fb9e661425bf609a86a313c8 | [
"MIT"
] | 1 | 2021-12-25T04:08:53.000Z | 2021-12-25T04:08:53.000Z | test_function.py | will-huynh/process_controller | e193c80976ef1d35fb9e661425bf609a86a313c8 | [
"MIT"
] | null | null | null | test_function.py | will-huynh/process_controller | e193c80976ef1d35fb9e661425bf609a86a313c8 | [
"MIT"
] | null | null | null | import logging
import tcp_log_socket
logging_socket = tcp_log_socket.local_logging_socket(__name__)
logger = logging_socket.logger
#Test method simulating a method with required arguments; division is used to test exception handling
def test_args(div1, div2):
logger.info("Simulating a method with argument... | 37.058824 | 102 | 0.692857 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 505 | 0.400794 |
c908908fcda77dbed54b6f285d7d03c69d799dc0 | 3,154 | py | Python | users/views.py | elvinaqa/Amazon-Review-Analyzer-Summarizer-Python-NLP-ML- | 6c70e84ffbcb8c8fd65a7fe0847e1f0eb779f759 | [
"Unlicense"
] | 1 | 2020-09-10T11:26:05.000Z | 2020-09-10T11:26:05.000Z | users/views.py | elvinaqa/Amazon-Review-Analyzer-Summarizer-Python-NLP-ML- | 6c70e84ffbcb8c8fd65a7fe0847e1f0eb779f759 | [
"Unlicense"
] | null | null | null | users/views.py | elvinaqa/Amazon-Review-Analyzer-Summarizer-Python-NLP-ML- | 6c70e84ffbcb8c8fd65a7fe0847e1f0eb779f759 | [
"Unlicense"
] | null | null | null | from django.shortcuts import render, redirect
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from .forms import UserRegisterForm, UserUpdateForm, ProfileUpdateForm
#####################################################################
from django.http import HttpResponse
fr... | 38.463415 | 88 | 0.642676 | 0 | 0 | 0 | 0 | 786 | 0.249207 | 0 | 0 | 414 | 0.131262 |
c909851fe73dcfad421fb6354ea395215029d6a8 | 689 | py | Python | tests/test-vext-pth.py | NomAnor/vext | adea4b593ae4c82da0965ec1addaa1cd6d5b396c | [
"MIT"
] | 62 | 2015-03-25T15:56:38.000Z | 2021-01-07T21:32:27.000Z | tests/test-vext-pth.py | NomAnor/vext | adea4b593ae4c82da0965ec1addaa1cd6d5b396c | [
"MIT"
] | 73 | 2015-02-13T16:02:31.000Z | 2021-01-17T19:35:10.000Z | tests/test-vext-pth.py | NomAnor/vext | adea4b593ae4c82da0965ec1addaa1cd6d5b396c | [
"MIT"
] | 8 | 2016-01-24T16:16:46.000Z | 2020-09-23T17:56:47.000Z | import os
import unittest
from vext.install import DEFAULT_PTH_CONTENT
class TestVextPTH(unittest.TestCase):
# Preliminary test, that verifies that
def test_can_exec_pth_content(self):
# Stub test, verify lines starting with 'import' in the pth can
# be exec'd and doesn't raise any exceptions... | 28.708333 | 73 | 0.683599 | 565 | 0.820029 | 0 | 0 | 0 | 0 | 0 | 0 | 296 | 0.429608 |
c9098d28bd2a0a51fc33c4cd5fecc41dc7fc38ec | 2,196 | py | Python | stats/monitor.py | pawankaushal/crossbar-examples | b6e0cc321bad020045c4fafec091f78abd938618 | [
"Apache-2.0"
] | 97 | 2016-12-14T16:48:49.000Z | 2021-09-12T17:48:10.000Z | stats/monitor.py | pawankaushal/crossbar-examples | b6e0cc321bad020045c4fafec091f78abd938618 | [
"Apache-2.0"
] | 38 | 2016-12-13T09:42:38.000Z | 2020-07-05T11:58:07.000Z | stats/monitor.py | pawankaushal/crossbar-examples | b6e0cc321bad020045c4fafec091f78abd938618 | [
"Apache-2.0"
] | 118 | 2016-12-12T21:36:40.000Z | 2021-11-17T11:49:33.000Z | import argparse
from pprint import pformat
import txaio
txaio.use_twisted()
from autobahn.twisted.wamp import ApplicationSession, ApplicationRunner
class ClientSession(ApplicationSession):
async def onJoin(self, details):
print('MONITOR session joined: {}'.format(details))
xbr_config = self.co... | 31.826087 | 89 | 0.583789 | 1,105 | 0.503188 | 0 | 0 | 0 | 0 | 1,059 | 0.48224 | 555 | 0.252732 |
c90c7861eaff4add66e4d61ef78a76a073959d73 | 29,349 | py | Python | spirou/sandbox/fits2ramp.py | clairem789/apero-utils | 68ed0136a36b6badeaf15eb20d673052ad79a949 | [
"MIT"
] | 2 | 2020-10-08T17:03:45.000Z | 2021-03-09T17:49:44.000Z | spirou/sandbox/fits2ramp.py | clairem789/apero-utils | 68ed0136a36b6badeaf15eb20d673052ad79a949 | [
"MIT"
] | 17 | 2020-09-24T17:35:38.000Z | 2020-12-11T16:10:13.000Z | spirou/sandbox/fits2ramp.py | clairem789/apero-utils | 68ed0136a36b6badeaf15eb20d673052ad79a949 | [
"MIT"
] | 5 | 2020-04-10T06:41:00.000Z | 2020-12-16T21:09:14.000Z | #!/usr/bin/env python2.7
# Version date : Aug 21, 2018
#
# --> very minor correction compared to previous version. As keywords may change in files through time, when we delete
# a keyword, we first check if the keyword is preseent rather than "blindly" deleting it
# --> also corrected integer vs float divisions in ... | 40.20411 | 225 | 0.665474 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 18,328 | 0.624485 |
c90f386866b7264c9826cea39ffcc2b6fd5aaf00 | 394 | py | Python | blog/urls.py | encukou/Zpetnovazebnik | 0d058fd67049a3d42814b04486bde93bc406fa3b | [
"MIT"
] | 1 | 2019-12-04T10:10:53.000Z | 2019-12-04T10:10:53.000Z | blog/urls.py | encukou/Zpetnovazebnik | 0d058fd67049a3d42814b04486bde93bc406fa3b | [
"MIT"
] | 14 | 2019-04-07T07:46:07.000Z | 2022-03-11T23:44:31.000Z | blog/urls.py | encukou/Zpetnovazebnik | 0d058fd67049a3d42814b04486bde93bc406fa3b | [
"MIT"
] | 1 | 2019-02-16T09:25:51.000Z | 2019-02-16T09:25:51.000Z | from django.urls import path
from . import views
urlpatterns = [
path('', views.course_list, name='course_list'),
path('<course_slug>/', views.session_list, name='session_list'),
path('<course_slug>/<session_slug>/', views.session_detail, name='session_detail'),
path('<course_slug>/<session_slug>/<pas... | 35.818182 | 114 | 0.72335 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 158 | 0.401015 |
c912b5b1a08a02d640553311c19b5c840ef97729 | 4,651 | py | Python | web_app/api_service.py | shayan-taheri/sql_python_deep_learning | ceb2c41bcb1fed193080f64ba4da018d76166222 | [
"MIT"
] | 23 | 2017-11-29T17:33:30.000Z | 2021-10-15T14:51:12.000Z | web_app/api_service.py | shayan-taheri/sql_python_deep_learning | ceb2c41bcb1fed193080f64ba4da018d76166222 | [
"MIT"
] | 1 | 2017-10-12T11:23:08.000Z | 2017-10-12T11:23:08.000Z | web_app/api_service.py | isabella232/sql_python_deep_learning | ceb2c41bcb1fed193080f64ba4da018d76166222 | [
"MIT"
] | 16 | 2017-12-21T08:55:09.000Z | 2021-03-21T20:17:40.000Z | from api import app, BAD_PARAM, STATUS_OK, BAD_REQUEST
from flask import request, jsonify, abort, make_response,render_template, json
import sys
from lung_cancer.connection_settings import get_connection_string, TABLE_SCAN_IMAGES, TABLE_GIF, TABLE_MODEL, TABLE_FEATURES, LIGHTGBM_MODEL_NAME, DATABASE_NAME,NUMBER_PATIEN... | 33.221429 | 176 | 0.723285 | 0 | 0 | 0 | 0 | 1,549 | 0.333047 | 0 | 0 | 914 | 0.196517 |
c9144a2b1a0cbf40a3d765da71a5f9435588a292 | 335 | py | Python | 10-blood/scripts/bloodMeasure.py | antl-mipt-ru/get | c914bd16131639e1af4452ae7351f2554ef83ce9 | [
"MIT"
] | null | null | null | 10-blood/scripts/bloodMeasure.py | antl-mipt-ru/get | c914bd16131639e1af4452ae7351f2554ef83ce9 | [
"MIT"
] | null | null | null | 10-blood/scripts/bloodMeasure.py | antl-mipt-ru/get | c914bd16131639e1af4452ae7351f2554ef83ce9 | [
"MIT"
] | 1 | 2021-10-11T16:24:32.000Z | 2021-10-11T16:24:32.000Z | import bloodFunctions as blood
import time
try:
samples = []
blood.initSpiAdc()
start = time.time()
while (time.time() - start) < 60:
samples.append(blood.getAdc())
finish = time.time()
blood.deinitSpiAdc()
blood.save(samples, start, finish)
finally:
print("Blood measure sc... | 17.631579 | 42 | 0.641791 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 31 | 0.092537 |
c915f05bb0ce24d1fe5469fea260ce3e99ceb13c | 5,144 | py | Python | bot/exts/utilities/twemoji.py | thatbirdguythatuknownot/sir-lancebot | 7fd74af261385bdf7d989f459bec4c9b0cb4392a | [
"MIT"
] | 77 | 2018-11-19T18:38:50.000Z | 2020-11-16T22:49:59.000Z | bot/exts/utilities/twemoji.py | thatbirdguythatuknownot/sir-lancebot | 7fd74af261385bdf7d989f459bec4c9b0cb4392a | [
"MIT"
] | 373 | 2018-11-17T16:06:06.000Z | 2020-11-20T22:55:03.000Z | bot/exts/utilities/twemoji.py | thatbirdguythatuknownot/sir-lancebot | 7fd74af261385bdf7d989f459bec4c9b0cb4392a | [
"MIT"
] | 165 | 2018-11-19T04:04:44.000Z | 2020-11-18T17:53:28.000Z | import logging
import re
from typing import Literal, Optional
import discord
from discord.ext import commands
from emoji import UNICODE_EMOJI_ENGLISH, is_emoji
from bot.bot import Bot
from bot.constants import Colours, Roles
from bot.utils.decorators import whitelist_override
from bot.utils.extensions import invoke_h... | 34.066225 | 110 | 0.614891 | 4,485 | 0.864495 | 0 | 0 | 4,304 | 0.829607 | 530 | 0.102159 | 2,371 | 0.457016 |
c916bd42a9f49b86089b3c70e101b95ec26db97d | 198 | py | Python | Lecture 28/Lecture28HWAssignment4.py | AtharvaJoshi21/PythonPOC | 6b95eb5bab7b28e9811e43b39e863faf2ee7565b | [
"MIT"
] | 1 | 2019-04-27T15:37:04.000Z | 2019-04-27T15:37:04.000Z | Lecture 28/Lecture28HWAssignment4.py | AtharvaJoshi21/PythonPOC | 6b95eb5bab7b28e9811e43b39e863faf2ee7565b | [
"MIT"
] | null | null | null | Lecture 28/Lecture28HWAssignment4.py | AtharvaJoshi21/PythonPOC | 6b95eb5bab7b28e9811e43b39e863faf2ee7565b | [
"MIT"
] | 1 | 2020-08-14T06:57:08.000Z | 2020-08-14T06:57:08.000Z | # WAP to accept a filename from user and print all words starting with capital letters.
def main():
inputFilePath = input("Please enter file name: ")
if __name__ == "__main__":
main() | 24.75 | 87 | 0.686869 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 123 | 0.621212 |
c916da29a2d83f2c59eacc745d8499ef2a44d2e6 | 1,215 | py | Python | tests/python-playground/least_abs_dev_0.py | marcocannici/scs | 799a4f7daed4294cd98c73df71676195e6c63de4 | [
"MIT"
] | 25 | 2017-06-30T15:31:33.000Z | 2021-04-21T20:12:18.000Z | tests/python-playground/least_abs_dev_0.py | marcocannici/scs | 799a4f7daed4294cd98c73df71676195e6c63de4 | [
"MIT"
] | 34 | 2017-06-07T01:18:17.000Z | 2021-04-24T09:44:00.000Z | tests/python-playground/least_abs_dev_0.py | marcocannici/scs | 799a4f7daed4294cd98c73df71676195e6c63de4 | [
"MIT"
] | 13 | 2017-06-07T01:16:09.000Z | 2021-06-07T09:12:56.000Z | # This is automatically-generated code.
# Uses the jinja2 library for templating.
import cvxpy as cp
import numpy as np
import scipy as sp
# setup
problemID = "least_abs_dev_0"
prob = None
opt_val = None
# Variable declarations
import scipy.sparse as sps
np.random.seed(0)
m = 5000
n = 200
A = np.random.rand... | 18.409091 | 69 | 0.650206 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 334 | 0.274897 |
c9188684a1a8b8220b62b9249ea8815fc31f7412 | 2,621 | py | Python | experimentations/20-climate-data/test-perf.py | Kitware/spark-mpi-experimentation | 9432b63130059fc54843bc5ca6f2f5510e5a4098 | [
"BSD-3-Clause"
] | 4 | 2017-06-15T16:36:01.000Z | 2021-12-25T09:13:22.000Z | experimentations/20-climate-data/test-perf.py | Kitware/spark-mpi-experimentation | 9432b63130059fc54843bc5ca6f2f5510e5a4098 | [
"BSD-3-Clause"
] | 1 | 2018-09-28T23:32:42.000Z | 2018-09-28T23:32:42.000Z | experimentations/20-climate-data/test-perf.py | Kitware/spark-mpi-experimentation | 9432b63130059fc54843bc5ca6f2f5510e5a4098 | [
"BSD-3-Clause"
] | 6 | 2017-07-22T00:10:00.000Z | 2021-12-25T09:13:11.000Z | from __future__ import print_function
import os
import sys
import time
import gdal
import numpy as np
# -------------------------------------------------------------------------
# Files to process
# -------------------------------------------------------------------------
fileNames = [
'tasmax_day_BCSD_rcp85_r1i... | 33.177215 | 79 | 0.518123 | 0 | 0 | 321 | 0.122472 | 0 | 0 | 0 | 0 | 1,286 | 0.490652 |
c9195aa10c6d748883a1b2125a3a031fa6170f06 | 1,380 | py | Python | deluca/envs/lung/__init__.py | AlexanderJYu/deluca | 9e8b0d84d2eb0a58ff82a951b42881bdb2dc9f00 | [
"Apache-2.0"
] | null | null | null | deluca/envs/lung/__init__.py | AlexanderJYu/deluca | 9e8b0d84d2eb0a58ff82a951b42881bdb2dc9f00 | [
"Apache-2.0"
] | null | null | null | deluca/envs/lung/__init__.py | AlexanderJYu/deluca | 9e8b0d84d2eb0a58ff82a951b42881bdb2dc9f00 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 32.857143 | 76 | 0.695652 | 617 | 0.446454 | 0 | 0 | 0 | 0 | 0 | 0 | 707 | 0.511577 |
c91a77c07622a3736aa47e0888f81515c8655b66 | 746 | py | Python | ivoire/__init__.py | Julian/Ivoire | af3f4ac77daf9d6c5167ef8a906557cc9d1d0ba7 | [
"MIT"
] | 9 | 2015-02-05T12:16:47.000Z | 2022-02-04T07:48:23.000Z | ivoire/__init__.py | Julian/Ivoire | af3f4ac77daf9d6c5167ef8a906557cc9d1d0ba7 | [
"MIT"
] | 1 | 2018-02-11T16:31:36.000Z | 2018-02-11T16:31:36.000Z | ivoire/__init__.py | Julian/Ivoire | af3f4ac77daf9d6c5167ef8a906557cc9d1d0ba7 | [
"MIT"
] | null | null | null | """
Ivoire is an RSpec-like testing framework for Python.
Globals defined in this module:
current_result: Should be set by a runner to an object that has the same
interface as unittest.TestResult. It will be used by every
example that is instantiated to record test results d... | 26.642857 | 78 | 0.727882 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 431 | 0.577748 |
c91fcc058836389aa81c0420f1fedf01f1106ff3 | 1,699 | py | Python | similarity.py | Blair-Johnson/faceswap | 79b75f7f112acb3bf6b228116facc4d0812d2099 | [
"MIT"
] | null | null | null | similarity.py | Blair-Johnson/faceswap | 79b75f7f112acb3bf6b228116facc4d0812d2099 | [
"MIT"
] | null | null | null | similarity.py | Blair-Johnson/faceswap | 79b75f7f112acb3bf6b228116facc4d0812d2099 | [
"MIT"
] | 1 | 2021-11-04T08:21:07.000Z | 2021-11-04T08:21:07.000Z | # Blair Johnson 2021
from facenet_pytorch import InceptionResnetV1, MTCNN
import numpy as np
def create_embeddings(images):
'''
Take an iterable of image candidates and return an iterable of image embeddings.
'''
if type(images) != list:
images = [images]
extractor = MTCNN()
encoder ... | 29.807018 | 97 | 0.683343 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 462 | 0.271925 |
c920d8ceac18d8c9ff46fde63a7fa287e05e877b | 6,075 | py | Python | opentamp/domains/robot_manipulation_domain/generate_base_prob.py | Algorithmic-Alignment-Lab/openTAMP | f0642028d551d0436b3a3dbc3bfb2f23a00adc14 | [
"MIT"
] | 4 | 2022-02-13T15:52:18.000Z | 2022-03-26T17:33:13.000Z | opentamp/domains/robot_manipulation_domain/generate_base_prob.py | Algorithmic-Alignment-Lab/OpenTAMP | eecb950bd273da8cbed4394487630e8453f2c242 | [
"MIT"
] | 1 | 2022-02-13T22:48:09.000Z | 2022-02-13T22:48:09.000Z | opentamp/domains/robot_manipulation_domain/generate_base_prob.py | Algorithmic-Alignment-Lab/OpenTAMP | eecb950bd273da8cbed4394487630e8453f2c242 | [
"MIT"
] | null | null | null | from IPython import embed as shell
import itertools
import numpy as np
import random
# SEED = 1234
NUM_PROBS = 1
NUM_CLOTH = 4
filename = "probs/base_prob.prob"
GOAL = "(RobotAt baxter robot_end_pose)"
# init Baxter pose
BAXTER_INIT_POSE = [0, 0, 0]
BAXTER_END_POSE = [0, 0, 0]
R_ARM_INIT = [0, 0, 0, 0, 0, 0, 0] # [... | 41.047297 | 175 | 0.576461 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,727 | 0.448889 |
c9210c12cb167b3a01782592accbb83cee14ae03 | 2,633 | py | Python | tests/views/test_hsva.py | ju-sh/colorviews | b9757dd3a799d68bd89966852f36f06f21e36072 | [
"MIT"
] | 5 | 2021-06-10T21:12:16.000Z | 2022-01-14T05:04:03.000Z | tests/views/test_hsva.py | ju-sh/colorviews | b9757dd3a799d68bd89966852f36f06f21e36072 | [
"MIT"
] | null | null | null | tests/views/test_hsva.py | ju-sh/colorviews | b9757dd3a799d68bd89966852f36f06f21e36072 | [
"MIT"
] | null | null | null | import pytest
from colorviews import AlphaColor
class TestGetAttr:
@pytest.mark.parametrize("attr, expected", [
("h", 0.75),
("s", 0.47),
("v", 0.29),
("a", 0.79),
])
def test_valid(self, attr, expected):
color = AlphaColor.from_hsva(0.75, 0.47, 0.29, 0.79)
... | 29.920455 | 67 | 0.545765 | 1,802 | 0.68439 | 0 | 0 | 2,301 | 0.873908 | 0 | 0 | 162 | 0.061527 |
c92170ef42c7d1d4c09bcc11c88becf053c48250 | 2,645 | py | Python | app/__init__.py | Cinquiom/fifty-cents-frontend | 946f564a87127f5820111321cd48441cc414d277 | [
"MIT"
] | null | null | null | app/__init__.py | Cinquiom/fifty-cents-frontend | 946f564a87127f5820111321cd48441cc414d277 | [
"MIT"
] | null | null | null | app/__init__.py | Cinquiom/fifty-cents-frontend | 946f564a87127f5820111321cd48441cc414d277 | [
"MIT"
] | null | null | null | import random, logging
from collections import Counter
from flask import Flask, session, request, render_template, jsonify
from app.util import unflatten
from app.fiftycents import FiftyCentsGame
from app.fiftycents import Card
log = logging.getLogger('werkzeug')
log.setLevel(logging.ERROR)
app = Flask(... | 38.897059 | 107 | 0.483554 | 0 | 0 | 0 | 0 | 2,249 | 0.850284 | 0 | 0 | 238 | 0.089981 |
c921d773c35312ecebe3d4b6eaaaef9e999e9c07 | 4,905 | py | Python | bluvo_test.py | JanJaapKo/BlUVO | 2a72b06a56069fee5bd118a12b846513096014b1 | [
"MIT"
] | null | null | null | bluvo_test.py | JanJaapKo/BlUVO | 2a72b06a56069fee5bd118a12b846513096014b1 | [
"MIT"
] | null | null | null | bluvo_test.py | JanJaapKo/BlUVO | 2a72b06a56069fee5bd118a12b846513096014b1 | [
"MIT"
] | null | null | null | import time
import logging
import pickle
import json
import consolemenu
from generic_lib import georeverse, geolookup
from bluvo_main import BlueLink
from tools.stamps import postOffice
from params import * # p_parameters are read
logging.basicConfig(format='%(asctime)s - %(levelname)-8s - %(filename)-18s - %(messag... | 50.56701 | 171 | 0.601019 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,375 | 0.280326 |
c92214401251c6b4745f3ba05c668f2913227e7f | 2,962 | py | Python | lda/test3/interpret_topics.py | kaiiam/amazon-continuation | 9faaba80235614e6eea3e305c423975f2ec72e3e | [
"MIT"
] | null | null | null | lda/test3/interpret_topics.py | kaiiam/amazon-continuation | 9faaba80235614e6eea3e305c423975f2ec72e3e | [
"MIT"
] | null | null | null | lda/test3/interpret_topics.py | kaiiam/amazon-continuation | 9faaba80235614e6eea3e305c423975f2ec72e3e | [
"MIT"
] | 1 | 2019-05-28T21:49:45.000Z | 2019-05-28T21:49:45.000Z | #!/usr/bin/env python3
"""
Author : kai
Date : 2019-06-26
Purpose: Rock the Casbah
"""
import argparse
import sys
import re
import csv
# --------------------------------------------------
def get_args():
"""get command-line arguments"""
parser = argparse.ArgumentParser(
description='Argparse Python ... | 26.684685 | 83 | 0.497637 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,024 | 0.345712 |
c924841b1d689ef522dd4926df95b7101d1bb341 | 292 | py | Python | app/users/urls.py | ManojKumarMRK/recipe-app-api | f518e91fc335c46eb1034d865256c94bb3e56b32 | [
"MIT"
] | null | null | null | app/users/urls.py | ManojKumarMRK/recipe-app-api | f518e91fc335c46eb1034d865256c94bb3e56b32 | [
"MIT"
] | null | null | null | app/users/urls.py | ManojKumarMRK/recipe-app-api | f518e91fc335c46eb1034d865256c94bb3e56b32 | [
"MIT"
] | null | null | null | from django.urls import path
from users import views
app_name = 'users'
urlpatterns = [
path('create/',views.CreateUserView.as_view(),name='create'),
path('token/',views.CreateTokenView.as_view(),name='token'),
path('me/', views.ManageUserView.as_view(),name='me'),
] | 26.545455 | 66 | 0.674658 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 48 | 0.164384 |
c92510f03e8c86ab8acb7443fa38d2785d4a3bca | 4,200 | py | Python | archive/visualization/network.py | ajrichards/bayesian-examples | fbd87c6f1613ea516408e9ebc3c9eff1248246e4 | [
"BSD-3-Clause"
] | 2 | 2016-01-27T08:51:23.000Z | 2017-04-17T02:21:34.000Z | archive/visualization/network.py | ajrichards/notebook | fbd87c6f1613ea516408e9ebc3c9eff1248246e4 | [
"BSD-3-Clause"
] | null | null | null | archive/visualization/network.py | ajrichards/notebook | fbd87c6f1613ea516408e9ebc3c9eff1248246e4 | [
"BSD-3-Clause"
] | null | null | null | import matplotlib as mpl
import matplotlib.pyplot as plt
import networkx as nx
import pandas as pd
def get_a_dict(filepath):
df = pd.read_csv(filepath).iloc[:, 1:13]
theme_dict = {}
interesting_theme_idx = [3, 6, 11, 15, 16]
theme_names = ['Horrendous IVR', 'Mobile Disengagement', "Couldn't Find it O... | 44.680851 | 196 | 0.61381 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,316 | 0.313333 |
c926f1cc84ef2be7db59c1ebc4dd4db9c3aeb3e1 | 332 | py | Python | accounting_app/accounting_app/doctype/gl_entry/gl_entry.py | imdadhussain/accounting_app | 0f4b54242d81953c0c3ece3fb098701e86ce0eaf | [
"MIT"
] | null | null | null | accounting_app/accounting_app/doctype/gl_entry/gl_entry.py | imdadhussain/accounting_app | 0f4b54242d81953c0c3ece3fb098701e86ce0eaf | [
"MIT"
] | null | null | null | accounting_app/accounting_app/doctype/gl_entry/gl_entry.py | imdadhussain/accounting_app | 0f4b54242d81953c0c3ece3fb098701e86ce0eaf | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2021, BS and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe.utils.nestedset import get_descendants_of
from frappe.utils import flt
class GLEntry(Document... | 25.538462 | 53 | 0.789157 | 33 | 0.099398 | 0 | 0 | 0 | 0 | 0 | 0 | 113 | 0.340361 |
c926fbd01b5a51930f76ba3ff40785e357d452a6 | 574 | py | Python | main/migrations/0002_auto_20200314_1530.py | kwatog/jumuk | 6234bf18ea0bf1eeb4194ecce23af9b669d4a841 | [
"MIT"
] | null | null | null | main/migrations/0002_auto_20200314_1530.py | kwatog/jumuk | 6234bf18ea0bf1eeb4194ecce23af9b669d4a841 | [
"MIT"
] | 5 | 2020-03-13T09:48:40.000Z | 2021-09-22T18:42:22.000Z | main/migrations/0002_auto_20200314_1530.py | kwatog/jumuk | 6234bf18ea0bf1eeb4194ecce23af9b669d4a841 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.4 on 2020-03-14 15:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='user',
name='first_name',
fi... | 23.916667 | 73 | 0.578397 | 481 | 0.837979 | 0 | 0 | 0 | 0 | 0 | 0 | 102 | 0.1777 |
c92cee00e5a3f53b6fcf563376119be5a8fa6b38 | 645 | py | Python | fusion/dataset/mnist_svhn/transforms.py | Mrinal18/fusion | 34e563f2e50139385577c3880c5de11f8a73f220 | [
"BSD-3-Clause"
] | 14 | 2021-04-05T01:25:12.000Z | 2022-02-17T19:44:28.000Z | fusion/dataset/mnist_svhn/transforms.py | Mrinal18/fusion | 34e563f2e50139385577c3880c5de11f8a73f220 | [
"BSD-3-Clause"
] | 1 | 2021-07-05T08:32:49.000Z | 2021-07-05T12:34:57.000Z | fusion/dataset/mnist_svhn/transforms.py | Mrinal18/fusion | 34e563f2e50139385577c3880c5de11f8a73f220 | [
"BSD-3-Clause"
] | 1 | 2022-02-01T21:56:11.000Z | 2022-02-01T21:56:11.000Z | from torch import Tensor
from torchvision import transforms
class SVHNTransform:
"""
"""
def __call__(self, x) -> Tensor:
"""
Make SVHN transform
Args:
x: Input tensor
Return:
Transform tensor
"""
x = transforms.ToTensor()(x)
... | 17.916667 | 42 | 0.493023 | 579 | 0.897674 | 0 | 0 | 0 | 0 | 0 | 0 | 285 | 0.44186 |
c92dbb28d5fa5849ee22ef3b509bd866ce701e9e | 1,508 | py | Python | scripts/previousScripts-2015-12-25/getVariableInfo.py | mistryrakesh/SMTApproxMC | 7c97e10c46c66e52c4e8972259610953c3357695 | [
"MIT"
] | null | null | null | scripts/previousScripts-2015-12-25/getVariableInfo.py | mistryrakesh/SMTApproxMC | 7c97e10c46c66e52c4e8972259610953c3357695 | [
"MIT"
] | null | null | null | scripts/previousScripts-2015-12-25/getVariableInfo.py | mistryrakesh/SMTApproxMC | 7c97e10c46c66e52c4e8972259610953c3357695 | [
"MIT"
] | null | null | null | #!/home/rakeshmistry/bin/Python-3.4.3/bin/python3
# @author: rakesh mistry - 'inspire'
# @date: 2015-08-06
import sys
import re
import os
import math
# Function: parseSmt2File
def parseSmt2FileVariables(smt2File):
compiledVarPattern = re.compile("[ \t]*\(declare-fun")
varMap = {}
for line in smt2File:
... | 25.133333 | 121 | 0.611406 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 325 | 0.215517 |
c92faeda80f7623d46a23810d5c128754efcada2 | 9,880 | py | Python | simplified_scrapy/core/spider.py | yiyedata/simplified-scrapy | ccfdc686c53b2da3dac733892d4f184f6293f002 | [
"Apache-2.0"
] | 7 | 2019-08-11T10:31:03.000Z | 2021-03-08T10:07:52.000Z | simplified_scrapy/core/spider.py | yiyedata/simplified-scrapy | ccfdc686c53b2da3dac733892d4f184f6293f002 | [
"Apache-2.0"
] | 1 | 2020-12-29T02:30:18.000Z | 2021-01-25T02:49:37.000Z | simplified_scrapy/core/spider.py | yiyedata/simplified-scrapy | ccfdc686c53b2da3dac733892d4f184f6293f002 | [
"Apache-2.0"
] | 4 | 2019-10-22T02:14:35.000Z | 2021-05-13T07:01:56.000Z | #!/usr/bin/python
#coding=utf-8
import json, re, logging, time, io, os
import sys
from simplified_scrapy.core.config_helper import Configs
from simplified_scrapy.core.sqlite_cookiestore import SqliteCookieStore
from simplified_scrapy.core.request_helper import requestPost, requestGet, getResponseStr, extractHtml
from s... | 34.666667 | 102 | 0.542611 | 9,227 | 0.933907 | 0 | 0 | 0 | 0 | 0 | 0 | 651 | 0.065891 |
c92fe0a2d25d872fa12d88c6134dd6759ab24310 | 1,457 | py | Python | Bugscan_exploits-master/exp_list/exp-2469.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 11 | 2020-05-30T13:53:49.000Z | 2021-03-17T03:20:59.000Z | Bugscan_exploits-master/exp_list/exp-2469.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 6 | 2020-05-13T03:25:18.000Z | 2020-07-21T06:24:16.000Z | Bugscan_exploits-master/exp_list/exp-2469.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 6 | 2020-05-30T13:53:51.000Z | 2020-12-01T21:44:26.000Z | #!/usr/bin/evn python
#--coding:utf-8--*--
#Name:天睿电子图书管理系统系统10处注入打包 避免重复
#Refer:http://www.wooyun.org/bugs/wooyun-2015-0120852/
#Author:xq17
def assign(service,arg):
if service=="tianrui_lib":
return True,arg
def audit(arg):
urls = [
arg + 'gl_tj_0.asp?id=1',
arg + '... | 41.628571 | 154 | 0.587509 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 806 | 0.537692 |
c93112ec790fae5b416d3ab6e0ee349a48489f55 | 49,239 | py | Python | FBDParser/charmaps/symbols.py | jonix6/fbdparser | 617a79bf9062092e4fa971bbd66da02cd9d45124 | [
"MIT"
] | 7 | 2021-03-15T08:43:56.000Z | 2022-01-09T11:56:43.000Z | FBDParser/charmaps/symbols.py | jonix6/fbdparser | 617a79bf9062092e4fa971bbd66da02cd9d45124 | [
"MIT"
] | null | null | null | FBDParser/charmaps/symbols.py | jonix6/fbdparser | 617a79bf9062092e4fa971bbd66da02cd9d45124 | [
"MIT"
] | 3 | 2021-09-07T09:40:16.000Z | 2022-01-11T10:32:23.000Z | # -*- coding: utf-8 -*-
def gb2unicode_simple(x):
a, b = (x & 0xFF00) >> 8, x & 0x00FF
if 0xAA <= a <= 0xAF and 0xA1 <= b <= 0xFE:
return 0xE000 + (a - 0xAA) * 0x5E + b - 0xA1
elif 0xA1 <= a <= 0xA7 and (0x40 <= b <= 0x7E or 0x80 <= b <= 0xA0):
return 0xE4C6 + (a - 0xA1) * 0x60 + (0x3F + b ... | 28.744308 | 88 | 0.518268 | 294 | 0.004801 | 0 | 0 | 0 | 0 | 0 | 0 | 24,535 | 0.400689 |
c933cadd6174b03b61565756a1609302c0c6bfc6 | 6,176 | py | Python | moona/lifespan/handlers.py | katunilya/mona | 8f44a9e06910466afbc9b2bcfb42144dcd25ed5a | [
"MIT"
] | 2 | 2022-03-26T15:27:31.000Z | 2022-03-28T22:00:32.000Z | moona/lifespan/handlers.py | katunilya/mona | 8f44a9e06910466afbc9b2bcfb42144dcd25ed5a | [
"MIT"
] | null | null | null | moona/lifespan/handlers.py | katunilya/mona | 8f44a9e06910466afbc9b2bcfb42144dcd25ed5a | [
"MIT"
] | null | null | null | from __future__ import annotations
from copy import deepcopy
from dataclasses import dataclass
from typing import Callable, TypeVar
from pymon import Future, Pipe, cmap, creducel, hof_2, this_async
from pymon.core import returns_future
from moona.lifespan import LifespanContext
LifespanFunc = Callable[[LifespanCont... | 25.841004 | 86 | 0.629858 | 841 | 0.136172 | 0 | 0 | 2,188 | 0.354275 | 1,252 | 0.20272 | 1,804 | 0.292098 |
c9340f2d3c1db26d4655357d65aa1d342c92a30f | 4,246 | py | Python | bot/cogs/birthday/birthday.py | Qtopia-Team/luci | 9b7f1966050910d50f04cbd9733d1c77ffbb8cba | [
"MIT"
] | 5 | 2021-04-27T10:50:54.000Z | 2021-08-02T09:11:56.000Z | bot/cogs/birthday/birthday.py | Qtopia-Team/luci | 9b7f1966050910d50f04cbd9733d1c77ffbb8cba | [
"MIT"
] | 2 | 2021-06-17T14:53:13.000Z | 2021-06-19T02:14:36.000Z | bot/cogs/birthday/birthday.py | luciferchase/luci | 91e30520cfc60177b9916d3f3d41678f590ecdfc | [
"MIT"
] | 4 | 2021-06-11T12:02:42.000Z | 2021-06-30T16:56:46.000Z | import discord
from discord.ext import commands
import json
import os
import psycopg2
import pytz
class Birthday(commands.Cog):
"""Never forget birthday of your friends"""
def __init__(self):
# Set up database
DATABASE_URL = os.environ["DATABASE_URL"]
self.dbcon = psycopg2.connect(D... | 35.090909 | 105 | 0.544277 | 4,148 | 0.97623 | 0 | 0 | 3,406 | 0.8016 | 3,212 | 0.755943 | 1,288 | 0.30313 |
c934c6f917f8d18513144569e61a6ad4e232777a | 651 | py | Python | apps/main/proc_scraper.py | suenklerhaw/seoeffekt | 0a31fdfa1a7246da37e37bf53c03d94c5f13f095 | [
"MIT"
] | 1 | 2022-02-15T14:03:10.000Z | 2022-02-15T14:03:10.000Z | apps/main/proc_scraper.py | suenklerhaw/seoeffekt | 0a31fdfa1a7246da37e37bf53c03d94c5f13f095 | [
"MIT"
] | null | null | null | apps/main/proc_scraper.py | suenklerhaw/seoeffekt | 0a31fdfa1a7246da37e37bf53c03d94c5f13f095 | [
"MIT"
] | null | null | null | #sub processes to scrape using the normal Google scraper
#include libs
import sys
sys.path.insert(0, '..')
from include import *
def save_sources():
call(["python3", "job_save_sources.py"])
def scraper():
call(["python3", "job_scraper.py"])
def reset_scraper():
call(["python3", "job_reset_scraper.py"])
... | 22.448276 | 56 | 0.738863 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 190 | 0.291859 |
c9359b5500958801527c3395149655f6f66f2d7a | 1,620 | py | Python | ingestion/producer1.py | aspk/ratsadtarget | e93cd3f71000ec409e79e6e0c873578f0e8fa8b3 | [
"Apache-2.0"
] | 1 | 2020-03-03T18:46:15.000Z | 2020-03-03T18:46:15.000Z | ingestion/producer1.py | Keyology/ratsadtarget | e93cd3f71000ec409e79e6e0c873578f0e8fa8b3 | [
"Apache-2.0"
] | null | null | null | ingestion/producer1.py | Keyology/ratsadtarget | e93cd3f71000ec409e79e6e0c873578f0e8fa8b3 | [
"Apache-2.0"
] | 1 | 2020-03-03T18:46:18.000Z | 2020-03-03T18:46:18.000Z | # producer to stream data into kafka
from boto.s3.connection import S3Connection
import datetime
import json
import bz2
from kafka import KafkaProducer
from kafka.errors import KafkaError
import time
import pytz
conn = S3Connection()
key = conn.get_bucket('aspk-reddit-posts').get_key('comments/RC_2017-11.bz2')
produc... | 33.061224 | 105 | 0.608642 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 379 | 0.233951 |
c9378ebb2e19a75b65829de15453b31293aca652 | 3,060 | py | Python | src/odin-http/odin/http/models.py | wenshuoliu/odin | 7998ee7541b3de44dd149899168983e964f2b8f7 | [
"Apache-2.0"
] | 4 | 2020-12-15T15:57:14.000Z | 2020-12-16T21:52:23.000Z | src/odin-http/odin/http/models.py | wenshuoliu/odin | 7998ee7541b3de44dd149899168983e964f2b8f7 | [
"Apache-2.0"
] | 2 | 2021-03-15T02:49:56.000Z | 2021-03-27T12:42:38.000Z | src/odin-http/odin/http/models.py | wenshuoliu/odin | 7998ee7541b3de44dd149899168983e964f2b8f7 | [
"Apache-2.0"
] | 5 | 2020-12-15T19:09:00.000Z | 2021-04-21T20:40:38.000Z | #from pydantic import BaseModel as Model
# This gives us backwards compatible API calls
from fastapi_camelcase import CamelModel as Model
from typing import Optional, List
from datetime import date, datetime
class UserDefinition(Model):
username: str
password: Optional[str] = None
firstname: Optional[str]... | 21.103448 | 80 | 0.693137 | 2,792 | 0.912418 | 0 | 0 | 0 | 0 | 0 | 0 | 207 | 0.067647 |
c9380c3f618a01051fb6b644e3bcd12fce9edfdc | 7,931 | py | Python | tests/test_data/test_data_core.py | shaoeric/hyperparameter_hunter | 3709d5e97dd23efa0df1b79982ae029789e1af57 | [
"MIT"
] | 688 | 2018-06-01T23:43:28.000Z | 2022-03-23T06:37:20.000Z | tests/test_data/test_data_core.py | shaoeric/hyperparameter_hunter | 3709d5e97dd23efa0df1b79982ae029789e1af57 | [
"MIT"
] | 188 | 2018-07-09T23:22:31.000Z | 2021-04-01T07:43:46.000Z | tests/test_data/test_data_core.py | shaoeric/hyperparameter_hunter | 3709d5e97dd23efa0df1b79982ae029789e1af57 | [
"MIT"
] | 100 | 2018-08-28T03:30:47.000Z | 2022-01-25T04:37:11.000Z | ##################################################
# Import Own Assets
##################################################
from hyperparameter_hunter.data.data_core import BaseDataChunk, BaseDataset, NullDataChunk
##################################################
# Import Miscellaneous Assets
#########################... | 40.258883 | 102 | 0.667381 | 0 | 0 | 0 | 0 | 5,965 | 0.752112 | 0 | 0 | 3,006 | 0.379019 |
c939aef00a062e0b98f7c418e70663b8692f035d | 108 | py | Python | sample/sample.py | eaybek/getthat | 3ca34902f773ec6a40a1df0b7dac5845a22cc8e4 | [
"MIT"
] | null | null | null | sample/sample.py | eaybek/getthat | 3ca34902f773ec6a40a1df0b7dac5845a22cc8e4 | [
"MIT"
] | null | null | null | sample/sample.py | eaybek/getthat | 3ca34902f773ec6a40a1df0b7dac5845a22cc8e4 | [
"MIT"
] | null | null | null | from getthat import getthat
# from sna.search import Sna
Sna = getthat("sna.search", "Sna")
sna = Sna()
| 12 | 34 | 0.685185 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 45 | 0.416667 |
c93c9aaedb099246f931a93b0f3660c7f68b5819 | 2,481 | py | Python | src/models/zeroshot.py | mmatena/wise-ft | 2630c366d252ad32db82ea886f7ab6a752142792 | [
"MIT"
] | 79 | 2021-10-01T22:29:51.000Z | 2022-03-30T04:19:58.000Z | src/models/zeroshot.py | mmatena/wise-ft | 2630c366d252ad32db82ea886f7ab6a752142792 | [
"MIT"
] | 2 | 2021-11-18T19:50:59.000Z | 2022-01-08T00:57:24.000Z | src/models/zeroshot.py | mmatena/wise-ft | 2630c366d252ad32db82ea886f7ab6a752142792 | [
"MIT"
] | 10 | 2021-10-14T18:29:59.000Z | 2022-03-27T12:40:18.000Z | import os
import torch
from tqdm import tqdm
import numpy as np
import clip.clip as clip
import src.templates as templates
import src.datasets as datasets
from src.args import parse_arguments
from src.models.modeling import ClassificationHead, ImageEncoder, ImageClassifier
from src.models.eval import evaluate
de... | 30.62963 | 94 | 0.694478 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 85 | 0.03426 |
c93cab934e2e3f25cd7169e11400beb6e6d43570 | 425 | py | Python | app/main/__init__.py | csmcallister/beular | 219bcd552c1303eb0557f3ef56d44355a932399e | [
"CNRI-Python"
] | null | null | null | app/main/__init__.py | csmcallister/beular | 219bcd552c1303eb0557f3ef56d44355a932399e | [
"CNRI-Python"
] | null | null | null | app/main/__init__.py | csmcallister/beular | 219bcd552c1303eb0557f3ef56d44355a932399e | [
"CNRI-Python"
] | null | null | null | from flask import Blueprint
bp = Blueprint('main', __name__)
@bp.after_app_request
def after_request(response):
"""Cache Bust
"""
cache_cont = "no-cache, no-store, must-revalidate, public, max-age=0"
response.headers["Cache-Control"] = cache_cont
response.headers["Expires"] = 0
re... | 25 | 74 | 0.665882 | 0 | 0 | 0 | 0 | 309 | 0.727059 | 0 | 0 | 138 | 0.324706 |
c94067f14edbfaeef67d40e03949c3cc7bd61802 | 734 | py | Python | blog/models.py | sd5682295/course_demo-master-2fe2955bdcb6985c2b48bb3487da5732c395bbc2 | face6e8d4e6cc61c3ef437142b71639393de3bf8 | [
"MIT"
] | null | null | null | blog/models.py | sd5682295/course_demo-master-2fe2955bdcb6985c2b48bb3487da5732c395bbc2 | face6e8d4e6cc61c3ef437142b71639393de3bf8 | [
"MIT"
] | null | null | null | blog/models.py | sd5682295/course_demo-master-2fe2955bdcb6985c2b48bb3487da5732c395bbc2 | face6e8d4e6cc61c3ef437142b71639393de3bf8 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
class Category(models.Model):
name = models.CharField(max_length=100)
def __str__(self):
return self.name
class Tag(models.Model):
name = models.CharField(max_length=100)
def __str__(self):
return self.name
class Post(models.Model):
... | 22.9375 | 65 | 0.76703 | 650 | 0.885559 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c94170821cd5e437201c56213668e61ba65bc8e5 | 21,018 | py | Python | methcomp/regression.py | daneishdespot/methcomp | 767d85aa56a8fda372847585decca8879ec2ac98 | [
"MIT"
] | null | null | null | methcomp/regression.py | daneishdespot/methcomp | 767d85aa56a8fda372847585decca8879ec2ac98 | [
"MIT"
] | null | null | null | methcomp/regression.py | daneishdespot/methcomp | 767d85aa56a8fda372847585decca8879ec2ac98 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import pandas as pd
import scipy.stats as st
import statsmodels.api as sm
import math
import numpy as np
__all__ = ["deming", "passingbablok", "linear"]
class _Deming(object):
"""Internal class for drawing a Deming regression plot"""
def __init__(self, method1, method2,
... | 39.433396 | 118 | 0.591683 | 11,336 | 0.539347 | 0 | 0 | 0 | 0 | 0 | 0 | 8,624 | 0.410315 |
c9418c993a05d0182f414df4de245fd5f5288aa8 | 1,470 | py | Python | setup.py | jmacgrillen/perspective | 6e6e833d8921c54c907dd6314d4bc02ba3a3c0b6 | [
"MIT"
] | null | null | null | setup.py | jmacgrillen/perspective | 6e6e833d8921c54c907dd6314d4bc02ba3a3c0b6 | [
"MIT"
] | null | null | null | setup.py | jmacgrillen/perspective | 6e6e833d8921c54c907dd6314d4bc02ba3a3c0b6 | [
"MIT"
] | null | null | null | #! /usr/bin/env python -*- coding: utf-8 -*-
"""
Name:
setup.py
Desscription:
Install the maclib package.
Version:
1 - Inital release
Author:
J.MacGrillen <macgrillen@gmail.com>
Copyright:
Copyright (c) John MacGrillen. All rights reserved.
"""
from setuptool... | 25.344828 | 71 | 0.593197 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 773 | 0.52585 |
c941a3a73b37c420856313d2ddda37d278df3e52 | 1,021 | py | Python | 2021/day2.py | MadsPoder/advent-of-code | 4f190e18d24332e21308a7d251c331777b52a5f1 | [
"MIT"
] | 2 | 2019-12-02T22:27:59.000Z | 2019-12-04T07:48:27.000Z | 2021/day2.py | MadsPoder/advent-of-code | 4f190e18d24332e21308a7d251c331777b52a5f1 | [
"MIT"
] | null | null | null | 2021/day2.py | MadsPoder/advent-of-code | 4f190e18d24332e21308a7d251c331777b52a5f1 | [
"MIT"
] | null | null | null | # Playing with pattern matching in python 3.10
# Add lambda to parse commands into command and corresponding units
parse_command = lambda x, y: (x, int(y))
# Read puzzle input
with open ('day2.txt') as fp:
commands = [parse_command(*x.strip().split(' ')) for x in fp.readlines()]
horizontal_position = 0
depth = 0... | 25.525 | 77 | 0.613124 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 199 | 0.194907 |
c943169325309fd0984d9e08fbc50df17f771916 | 2,159 | py | Python | etl/vector/process_all.py | nismod/oi-risk-vis | a5c7460a8060a797dc844be95d5c23689f42cd17 | [
"MIT"
] | 2 | 2020-09-29T15:52:48.000Z | 2021-03-31T02:58:53.000Z | etl/vector/process_all.py | nismod/oi-risk-vis | a5c7460a8060a797dc844be95d5c23689f42cd17 | [
"MIT"
] | 41 | 2021-05-12T17:12:14.000Z | 2022-03-17T10:49:20.000Z | etl/vector/process_all.py | nismod/infra-risk-vis | 1e5c28cced578d8bd9c78699e9038ecd66f47cf7 | [
"MIT"
] | null | null | null | #!/bin/env python3
from argparse import ArgumentParser
import csv
import os
from pathlib import Path
import subprocess
import sys
this_directory = Path(__file__).parent.resolve()
vector_script_path = this_directory / 'prepare_vector.sh'
def run_single_processing(in_file_path: Path, out_file_path: Path, layer_name: ... | 41.519231 | 156 | 0.742937 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 666 | 0.308476 |
c944a392c3c65b876eac48378aa9aaaa59c4cea9 | 1,688 | py | Python | django/week9/main/models.py | yrtby/Alotech-Fullstack-Bootcamp-Patika | e2fd775e2540b8d9698dcb7dc38f84a6d7912e8d | [
"MIT"
] | 1 | 2021-11-05T09:45:25.000Z | 2021-11-05T09:45:25.000Z | django/week9/main/models.py | yrtby/Alotech-Fullstack-Bootcamp-Patika | e2fd775e2540b8d9698dcb7dc38f84a6d7912e8d | [
"MIT"
] | null | null | null | django/week9/main/models.py | yrtby/Alotech-Fullstack-Bootcamp-Patika | e2fd775e2540b8d9698dcb7dc38f84a6d7912e8d | [
"MIT"
] | 3 | 2021-11-07T07:16:30.000Z | 2021-12-07T20:22:59.000Z | from django.db import models
from django.contrib.auth.models import User
from django.core.validators import MinLengthValidator
# Create your models here.
class Post(models.Model):
image = models.ImageField(upload_to='uploads/')
content = models.TextField(max_length=200, validators=[MinLengthValidator(10)])
... | 35.914894 | 83 | 0.708531 | 1,526 | 0.904028 | 0 | 0 | 430 | 0.254739 | 0 | 0 | 252 | 0.149289 |
c9463207e60b37b4cf9f338b3635a5669f81cf71 | 286 | py | Python | codewars/6kyu/dinamuh/CountingDuplicates/main.py | dinamuh/Training_one | d18e8fb12608ce1753162c20252ca928c4df97ab | [
"MIT"
] | null | null | null | codewars/6kyu/dinamuh/CountingDuplicates/main.py | dinamuh/Training_one | d18e8fb12608ce1753162c20252ca928c4df97ab | [
"MIT"
] | 2 | 2019-01-22T10:53:42.000Z | 2019-01-31T08:02:48.000Z | codewars/6kyu/dinamuh/CountingDuplicates/main.py | dinamuh/Training_one | d18e8fb12608ce1753162c20252ca928c4df97ab | [
"MIT"
] | 13 | 2019-01-22T10:37:42.000Z | 2019-01-25T13:30:43.000Z | def duplicate_count(text):
x = set()
y = set()
for char in text:
char = char.lower()
if char in x:
y.add(char)
x.add(char)
return len(y)
def duplicate_count2(s):
return len([c for c in set(s.lower()) if s.lower().count(c) > 1])
| 20.428571 | 69 | 0.527972 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c947e59db3be68e0dcce4600b6cfeb33b848886c | 375 | py | Python | tests/test_dir_dataset.py | gimlidc/igre | bf3425e838cca3d1fa8254a2550ecb44774ee0ef | [
"MIT"
] | 1 | 2021-09-24T09:12:06.000Z | 2021-09-24T09:12:06.000Z | tests/test_dir_dataset.py | gimlidc/igre | bf3425e838cca3d1fa8254a2550ecb44774ee0ef | [
"MIT"
] | null | null | null | tests/test_dir_dataset.py | gimlidc/igre | bf3425e838cca3d1fa8254a2550ecb44774ee0ef | [
"MIT"
] | null | null | null | import stable.modalities.dir_dataset as dataset
import os.path
def test_load_all_images():
srcdir = os.path.join("tests", "assets")
data, metadata = dataset.load_all_images(srcdir)
assert metadata["resolutions"] == [(125, 140)]
assert data[0].shape[2] == 2
assert metadata["filenames"][0] == ["mari... | 34.090909 | 99 | 0.706667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 95 | 0.253333 |
c949f74729063705c3b6e636bb65a45813ce66bb | 1,118 | py | Python | sample/main.py | qjw/flasgger | d43644da1fea6af596ff0e2f11517b578377850f | [
"MIT"
] | 5 | 2018-03-07T03:54:36.000Z | 2022-01-01T04:43:48.000Z | sample/main.py | qjw/flasgger | d43644da1fea6af596ff0e2f11517b578377850f | [
"MIT"
] | null | null | null | sample/main.py | qjw/flasgger | d43644da1fea6af596ff0e2f11517b578377850f | [
"MIT"
] | 2 | 2021-11-11T08:48:39.000Z | 2022-01-01T04:43:49.000Z | import logging
import jsonschema
from flask import Flask, jsonify
from flask import make_response
from flasgger import Swagger
from sample.config import Config
def init_logging(app):
handler = logging.StreamHandler()
handler.setLevel(logging.INFO)
handler.setFormatter(logging.Formatter(
'%(ascti... | 25.409091 | 77 | 0.675313 | 0 | 0 | 0 | 0 | 306 | 0.270796 | 0 | 0 | 137 | 0.121239 |
c94abc02ec26c5e120241965ee1760edb37aa362 | 909 | py | Python | cuticle_analysis/models/e2e.py | ngngardner/cuticle_analysis | 7ef119d9ee407df0faea63705dcea76d9f42614b | [
"MIT"
] | null | null | null | cuticle_analysis/models/e2e.py | ngngardner/cuticle_analysis | 7ef119d9ee407df0faea63705dcea76d9f42614b | [
"MIT"
] | 4 | 2021-07-02T17:49:44.000Z | 2021-09-27T01:06:41.000Z | cuticle_analysis/models/e2e.py | ngngardner/cuticle_analysis | 7ef119d9ee407df0faea63705dcea76d9f42614b | [
"MIT"
] | null | null | null |
import numpy as np
from .cnn import CNN
from .kviews import KViews
from .. import const
class EndToEnd():
def __init__(
self,
bg_model: CNN,
rs_model: KViews
) -> None:
self.name = 'EndToEnd'
self.bg_model = bg_model
self.rs_model = rs_model
def metadata(... | 24.567568 | 66 | 0.567657 | 816 | 0.89769 | 0 | 0 | 0 | 0 | 0 | 0 | 101 | 0.111111 |