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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a485788eeecfff354b48a006a86e1d854357d0c9 | 50 | py | Python | aerosandbox/weights/__init__.py | raihaan123/AeroSandbox | 1e7c78f04b066415f671237a4833ba98901bb9ec | [
"MIT"
] | 1 | 2021-11-01T22:48:12.000Z | 2021-11-01T22:48:12.000Z | aerosandbox/weights/__init__.py | raihaan123/AeroSandbox | 1e7c78f04b066415f671237a4833ba98901bb9ec | [
"MIT"
] | null | null | null | aerosandbox/weights/__init__.py | raihaan123/AeroSandbox | 1e7c78f04b066415f671237a4833ba98901bb9ec | [
"MIT"
] | null | null | null | from aerosandbox.weights.mass_properties import *
| 25 | 49 | 0.86 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a485dec593e36886639d25ea0cb31bfa15127541 | 93 | py | Python | __name__ == '__main__'/test_import_new.py | kyaiooiayk/Python-Programming | b70dde24901cd24b38e2ead7c9a1b2d1808fc4b0 | [
"OLDAP-2.3"
] | null | null | null | __name__ == '__main__'/test_import_new.py | kyaiooiayk/Python-Programming | b70dde24901cd24b38e2ead7c9a1b2d1808fc4b0 | [
"OLDAP-2.3"
] | null | null | null | __name__ == '__main__'/test_import_new.py | kyaiooiayk/Python-Programming | b70dde24901cd24b38e2ead7c9a1b2d1808fc4b0 | [
"OLDAP-2.3"
] | null | null | null | import important_new
print("Called from test_import_new.py, __name__ has value?:", __name__) | 31 | 71 | 0.806452 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 54 | 0.580645 |
a485e51be320a1c41ace27db12d2c0b78a42c680 | 2,568 | py | Python | 7/make_fig_7a.py | mohitganguly/test_amanda | a2f19934ce8e7206fa0ddbd4960dc4cfa809518e | [
"MIT"
] | 1 | 2020-03-24T17:02:36.000Z | 2020-03-24T17:02:36.000Z | 7/make_fig_7a.py | mohitganguly/test_amanda | a2f19934ce8e7206fa0ddbd4960dc4cfa809518e | [
"MIT"
] | null | null | null | 7/make_fig_7a.py | mohitganguly/test_amanda | a2f19934ce8e7206fa0ddbd4960dc4cfa809518e | [
"MIT"
] | 1 | 2022-01-03T08:41:52.000Z | 2022-01-03T08:41:52.000Z | from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
import itertools
nseg = 999
l = 20
blocks = np.genfromtxt('block_HH.txt', delimiter = ' ')
x = range(32,40)
dia = blocks[0:,0]
print len(dia)
block1 = blocks[0,1:]
block1 = block1*l/nseg
block2 = blocks[1,1:]
block1 = block2*l/nseg
b... | 29.860465 | 93 | 0.626558 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 970 | 0.377726 |
a4863c3e8d16dad6c9bb7aafdd0d568e61fb79a7 | 388 | py | Python | triplinker/journeys/migrations/0007_auto_20200907_1616.py | GonnaFlyMethod/triplinker | f4189e499ad48fd9102dd2211a8884078136eae9 | [
"MIT"
] | null | null | null | triplinker/journeys/migrations/0007_auto_20200907_1616.py | GonnaFlyMethod/triplinker | f4189e499ad48fd9102dd2211a8884078136eae9 | [
"MIT"
] | null | null | null | triplinker/journeys/migrations/0007_auto_20200907_1616.py | GonnaFlyMethod/triplinker | f4189e499ad48fd9102dd2211a8884078136eae9 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.8 on 2020-09-07 16:16
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('journeys', '0006_auto_20200907_1607'),
]
operations = [
migrations.RenameField(
model_name='activity',
old_name='description... | 20.421053 | 48 | 0.610825 | 303 | 0.780928 | 0 | 0 | 0 | 0 | 0 | 0 | 130 | 0.335052 |
a4872bfc5ea2ebaa9569179a301218bcadb5ad3d | 8,965 | py | Python | old/old_another_small_jobshop_dwave_another_example.py | MiRudnik/quantum_optimization | 9c63c9164d9a8620d7610cc0576a1e3ee7319d98 | [
"MIT"
] | null | null | null | old/old_another_small_jobshop_dwave_another_example.py | MiRudnik/quantum_optimization | 9c63c9164d9a8620d7610cc0576a1e3ee7319d98 | [
"MIT"
] | null | null | null | old/old_another_small_jobshop_dwave_another_example.py | MiRudnik/quantum_optimization | 9c63c9164d9a8620d7610cc0576a1e3ee7319d98 | [
"MIT"
] | 1 | 2021-07-13T21:50:53.000Z | 2021-07-13T21:50:53.000Z | import numpy as np
# Set Q for the problem QUBO
from utils.jobshop_helpers import get_machine_and_time_slot, get_operation_length, is_last_row, get_qubits_from_slot_and_machine, \
get_time_slot
def main():
# qubo_matrix = np.zeros((40,40))
jobs = [[2, 1], [1,2]]
j_flat = []
for job in jobs:
j_fla... | 46.21134 | 139 | 0.62164 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,323 | 0.370664 |
a48740f19c411c12d63473995b985326be58c92a | 425 | py | Python | sensors/TemperaturaDHT11.py | tec-csf/reto-iot-en-supermercado-2019-nova-iot-supermarket | 0eb643132478a06477404dcd86c4359869ec7d81 | [
"MIT"
] | 1 | 2019-10-28T14:58:14.000Z | 2019-10-28T14:58:14.000Z | sensors/TemperaturaDHT11.py | tec-csf/reto-iot-en-supermercado-2019-nova-iot-supermarket | 0eb643132478a06477404dcd86c4359869ec7d81 | [
"MIT"
] | null | null | null | sensors/TemperaturaDHT11.py | tec-csf/reto-iot-en-supermercado-2019-nova-iot-supermarket | 0eb643132478a06477404dcd86c4359869ec7d81 | [
"MIT"
] | null | null | null | import Adafruit_DHT
sensor = Adafruit_DHT.DHT11
pin_temp = 3
def temperatura(pin_temp):
temperature = 0
if (temperature <=22):
humidity, temperature = Adafruit_DHT.read_retry(sensor, pin_temp)
if humidity is not None and temperature is not None:
print('Temp={0:0.1f}*C Humidity={1:0.... | 38.636364 | 86 | 0.663529 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 72 | 0.169412 |
a4880c07ec70056b56e0d43278747671d02751da | 4,716 | py | Python | tests/middleware/test_http_to_https.py | ai-mocap/hypercorn | 0c1a74a726d5e54a2a3876edba8ad2a0a547c5d5 | [
"MIT"
] | 264 | 2018-06-02T17:49:46.000Z | 2022-03-29T07:39:06.000Z | tests/middleware/test_http_to_https.py | ai-mocap/hypercorn | 0c1a74a726d5e54a2a3876edba8ad2a0a547c5d5 | [
"MIT"
] | 52 | 2018-06-14T19:30:00.000Z | 2022-02-27T04:26:48.000Z | tests/middleware/test_http_to_https.py | nonebot/nonecorn | 813408d385f11b6bbdaee63d6b6ace8c87586d25 | [
"MIT"
] | 29 | 2018-06-13T23:54:48.000Z | 2022-02-20T15:23:14.000Z | from __future__ import annotations
import pytest
from hypercorn.middleware import HTTPToHTTPSRedirectMiddleware
from hypercorn.typing import HTTPScope, WebsocketScope
from ..helpers import empty_framework
@pytest.mark.asyncio
@pytest.mark.parametrize("raw_path", [b"/abc", b"/abc%3C"])
async def test_http_to_https_r... | 27.578947 | 84 | 0.545589 | 0 | 0 | 0 | 0 | 3,860 | 0.81849 | 3,656 | 0.775233 | 1,375 | 0.291561 |
a48881351fb66e53f1af28f4da440b46709db632 | 2,428 | py | Python | N-MOS_transistor_by_Python/I-V_Characteristics_n-MOSFET.py | yasser296/Python-Projects | eae3598e2d4faf08d9def92c8b417c2e7946c5f4 | [
"MIT"
] | null | null | null | N-MOS_transistor_by_Python/I-V_Characteristics_n-MOSFET.py | yasser296/Python-Projects | eae3598e2d4faf08d9def92c8b417c2e7946c5f4 | [
"MIT"
] | null | null | null | N-MOS_transistor_by_Python/I-V_Characteristics_n-MOSFET.py | yasser296/Python-Projects | eae3598e2d4faf08d9def92c8b417c2e7946c5f4 | [
"MIT"
] | null | null | null | from numpy import arange
from matplotlib import pyplot , figure
# Kn = Kn' * W/L 4
Kn=1e-3
# Vth is th threshold voltagee
Vth = 1.5
# Sweep drain to source voltge from 0 to 12V
Vds = arange(0, 12, 0.1).tolist()
Vgs = [4 , 6 , 8 , 10 ]
Id = list() # Drain Current Id (A)
for I in range(1,len(Vgs)+1) :
Id.append... | 22.90566 | 119 | 0.639209 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 671 | 0.276359 |
a488bfa5aa832da083db4e6b51c66de316b8a1a6 | 7,652 | py | Python | mods/default/client/gui/game_overlays.py | mpbagot/hsc-major-project-code | eaa69bf566b5b34ae7d4aa78504f97576fa2bb1c | [
"MIT"
] | 4 | 2018-04-17T11:55:06.000Z | 2021-02-25T16:03:47.000Z | mods/default/client/gui/game_overlays.py | mpbagot/mata | eaa69bf566b5b34ae7d4aa78504f97576fa2bb1c | [
"MIT"
] | null | null | null | mods/default/client/gui/game_overlays.py | mpbagot/mata | eaa69bf566b5b34ae7d4aa78504f97576fa2bb1c | [
"MIT"
] | null | null | null | """
game_overlays.py
A module containing the GUI overlays of the default client game
"""
# Import the Modding API
from api.gui.gui import *
from api.gui.objects import *
from api.colour import *
from api.packets import SendCommandPacket
# Import stuff from the mod modules
from mods.default.client.gui.extras import *
f... | 40.062827 | 127 | 0.595792 | 7,283 | 0.951777 | 0 | 0 | 0 | 0 | 0 | 0 | 1,254 | 0.163879 |
a488cd89e65f252e4c293f2398293943079200dc | 11,362 | py | Python | JumpscaleLib/tools/docsite/Doc.py | threefoldtech/jumpscale_lib9 | 03c1451133d777e5af106fcc6f75c1138bb997f2 | [
"Apache-2.0"
] | null | null | null | JumpscaleLib/tools/docsite/Doc.py | threefoldtech/jumpscale_lib9 | 03c1451133d777e5af106fcc6f75c1138bb997f2 | [
"Apache-2.0"
] | 220 | 2018-07-29T08:37:17.000Z | 2019-08-05T15:01:27.000Z | JumpscaleLib/tools/docsite/Doc.py | threefoldtech/jumpscale_lib9 | 03c1451133d777e5af106fcc6f75c1138bb997f2 | [
"Apache-2.0"
] | 1 | 2018-08-20T09:16:08.000Z | 2018-08-20T09:16:08.000Z | from .Link import Link
from jumpscale import j
import toml
import copy
JSBASE = j.application.jsbase_get_class()
class Doc(JSBASE):
"""
"""
def __init__(self, path, name, docsite):
JSBASE.__init__(self)
self.path = path
self.docsite = docsite
self.cat = ""
if "/... | 33.417647 | 114 | 0.535557 | 11,244 | 0.989615 | 0 | 0 | 3,680 | 0.323887 | 0 | 0 | 2,544 | 0.223904 |
a488dc1030b3dc25a1a80edd71496da9acd520e7 | 603 | py | Python | ground.py | michalovsky/flappy-bird | a28e86bbeb57635798b51fca58c2bd8c5cc9730b | [
"MIT"
] | 1 | 2021-06-14T09:36:09.000Z | 2021-06-14T09:36:09.000Z | ground.py | michalovsky/flappy-bird | a28e86bbeb57635798b51fca58c2bd8c5cc9730b | [
"MIT"
] | null | null | null | ground.py | michalovsky/flappy-bird | a28e86bbeb57635798b51fca58c2bd8c5cc9730b | [
"MIT"
] | null | null | null | from images import GROUND_IMAGE
class Ground:
VELOCITY = 5
WIDTH = GROUND_IMAGE.get_width()
IMAGE = GROUND_IMAGE
def __init__(self, y):
self.y = y
self.x1 = 0
self.x2 = self.WIDTH
def move(self):
self.x1 -= self.VELOCITY
self.x2 -= self.VELOCITY
i... | 22.333333 | 50 | 0.558872 | 568 | 0.941957 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a48a6e2b13af24cc7dc9ac36c9c5a8fbfb6e3bef | 654 | py | Python | LitterFilter/Event.py | mattdbartlett/LitterFilter | c03759a9cf7628774bdb73249fb3e64aea50d700 | [
"MIT"
] | null | null | null | LitterFilter/Event.py | mattdbartlett/LitterFilter | c03759a9cf7628774bdb73249fb3e64aea50d700 | [
"MIT"
] | null | null | null | LitterFilter/Event.py | mattdbartlett/LitterFilter | c03759a9cf7628774bdb73249fb3e64aea50d700 | [
"MIT"
] | null | null | null |
class EventGenerator(object):
"""
Evaluate event sources when run is called
"""
def __init__(self, stateMachine):
self.__stateMachine = stateMachine
self.__sources = list()
def AddEventSource(self, eventSource):
self.__sources.append(eventSource)
def Run(self):
... | 22.551724 | 57 | 0.625382 | 649 | 0.992355 | 0 | 0 | 0 | 0 | 0 | 0 | 101 | 0.154434 |
a48bcd95f6ff3785768fc221bb5436bed3d1d5bd | 1,937 | py | Python | tally_ho/apps/tally/views/reports/races.py | crononauta/tally-ho | ba2207bfaef27bee3ff13a393983ca493f767238 | [
"Apache-2.0"
] | null | null | null | tally_ho/apps/tally/views/reports/races.py | crononauta/tally-ho | ba2207bfaef27bee3ff13a393983ca493f767238 | [
"Apache-2.0"
] | null | null | null | tally_ho/apps/tally/views/reports/races.py | crononauta/tally-ho | ba2207bfaef27bee3ff13a393983ca493f767238 | [
"Apache-2.0"
] | null | null | null | from django.views.generic import TemplateView
from guardian.mixins import LoginRequiredMixin
from tally_ho.libs.views.exports import valid_ballots
from tally_ho.libs.permissions import groups
from tally_ho.libs.reports import progress as p
from tally_ho.libs.views import mixins
class RacesReportView(LoginRequiredMix... | 33.396552 | 64 | 0.587506 | 1,654 | 0.853898 | 0 | 0 | 0 | 0 | 0 | 0 | 200 | 0.103252 |
a48cab57e933e3836e7ed795f6be0328aa3d87f5 | 25,944 | py | Python | scheduler.py | bsautrey/python-mapreduce | a3f487b431773b3630eea0e389d1d5ace34a7ef5 | [
"MIT"
] | 7 | 2017-05-17T07:26:38.000Z | 2021-06-18T18:18:26.000Z | scheduler.py | bsautrey/python-mapreduce | a3f487b431773b3630eea0e389d1d5ace34a7ef5 | [
"MIT"
] | null | null | null | scheduler.py | bsautrey/python-mapreduce | a3f487b431773b3630eea0e389d1d5ace34a7ef5 | [
"MIT"
] | 1 | 2021-06-18T18:18:37.000Z | 2021-06-18T18:18:37.000Z | # scheduler.py is used to submit, schedule, run jobs on the cluster.
import os,sys,fcntl,subprocess,random,traceback,errno
from time import sleep,time,ctime
import ujson
sys.path.append('/home/ben/code')
sys.path.append('/home/ben/file_transfer')
from manage_cluster import ManageCluster
from file_transfer import Fil... | 36.438202 | 103 | 0.512488 | 20,346 | 0.784228 | 0 | 0 | 0 | 0 | 0 | 0 | 8,424 | 0.324699 |
a48ddbfd57f4568c1f65e7ebc0518dccbe096322 | 843 | py | Python | 15. 3Sum/main.py | Competitive-Programmers-Community/LeetCode | 841fdee805b1a626e9f1cd0e12398d25054638af | [
"MIT"
] | 2 | 2019-10-05T09:48:20.000Z | 2019-10-05T15:40:01.000Z | 15. 3Sum/main.py | Competitive-Programmers-Community/LeetCode | 841fdee805b1a626e9f1cd0e12398d25054638af | [
"MIT"
] | null | null | null | 15. 3Sum/main.py | Competitive-Programmers-Community/LeetCode | 841fdee805b1a626e9f1cd0e12398d25054638af | [
"MIT"
] | 3 | 2020-09-27T05:48:30.000Z | 2021-08-13T10:07:08.000Z | class Solution:
def threeSum(self, nums):
"""
:type nums: List[int]
:rtype: List[List[int]]
"""
nums.sort()
res=[]
for k in range(len(nums)-2):
if k>0 and nums[k]==nums[k-1]:
continue
l=k+1
r=len(nums)-1
... | 27.193548 | 57 | 0.309609 | 842 | 0.998814 | 0 | 0 | 0 | 0 | 0 | 0 | 77 | 0.09134 |
a48e2876e063fca41404c9b42cd9234687e02f29 | 1,251 | py | Python | psono/restapi/serializers/share_right_accept.py | dirigeant/psono-server | a18c5b3c4d8bbbe4ecf1615b210d99fb77752205 | [
"Apache-2.0",
"CC0-1.0"
] | 48 | 2018-04-19T15:50:58.000Z | 2022-01-23T15:58:11.000Z | psono/restapi/serializers/share_right_accept.py | dirigeant/psono-server | a18c5b3c4d8bbbe4ecf1615b210d99fb77752205 | [
"Apache-2.0",
"CC0-1.0"
] | 9 | 2018-09-13T14:56:18.000Z | 2020-01-17T16:44:33.000Z | psono/restapi/serializers/share_right_accept.py | dirigeant/psono-server | a18c5b3c4d8bbbe4ecf1615b210d99fb77752205 | [
"Apache-2.0",
"CC0-1.0"
] | 11 | 2019-09-20T11:53:47.000Z | 2021-07-18T22:41:31.000Z | from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers, exceptions
from ..fields import UUIDField
from ..models import User_Share_Right
class ShareRightAcceptSerializer(serializers.Serializer):
share_right_id = UUIDField(required=True)
key = serializers.CharField(max_... | 40.354839 | 132 | 0.718625 | 1,072 | 0.856914 | 0 | 0 | 0 | 0 | 0 | 0 | 218 | 0.174261 |
a48f32363a4214c8c84b8ccdfb70d7f2134e405c | 3,086 | py | Python | nb_cli/prompts/input.py | cdlaimin/nb-cli | b428a9a24091c072accedbeee56064c6a3cfd15a | [
"MIT"
] | 88 | 2020-10-02T07:16:06.000Z | 2022-03-30T01:24:36.000Z | nb_cli/prompts/input.py | cdlaimin/nb-cli | b428a9a24091c072accedbeee56064c6a3cfd15a | [
"MIT"
] | 13 | 2021-01-28T03:14:35.000Z | 2022-01-15T11:47:21.000Z | nb_cli/prompts/input.py | cdlaimin/nb-cli | b428a9a24091c072accedbeee56064c6a3cfd15a | [
"MIT"
] | 11 | 2021-03-11T15:12:23.000Z | 2022-01-13T10:09:18.000Z | from typing import Callable, Optional
from prompt_toolkit.styles import Style
from prompt_toolkit.buffer import Buffer
from prompt_toolkit.layout import Layout
from prompt_toolkit.lexers import SimpleLexer
from prompt_toolkit.application import get_app
from prompt_toolkit.enums import DEFAULT_BUFFER
from prompt_toolki... | 29.390476 | 75 | 0.571614 | 2,527 | 0.80019 | 0 | 0 | 261 | 0.082647 | 0 | 0 | 417 | 0.132046 |
a492098555deaaa16a0fac0a4f18848c23573c77 | 1,133 | py | Python | vspace_utils/templatetags/next_previous.py | visualspace/django-vspace-utils | 9bf86354f8dbcf8ee8c308345836f824e2cd7a63 | [
"BSD-3-Clause"
] | null | null | null | vspace_utils/templatetags/next_previous.py | visualspace/django-vspace-utils | 9bf86354f8dbcf8ee8c308345836f824e2cd7a63 | [
"BSD-3-Clause"
] | null | null | null | vspace_utils/templatetags/next_previous.py | visualspace/django-vspace-utils | 9bf86354f8dbcf8ee8c308345836f824e2cd7a63 | [
"BSD-3-Clause"
] | null | null | null | """
Efficient and generic get next/previous tags for the Django template language,
using Alex Gaynor's excellent templatetag_sugar library.
The library can be found at: http://pypi.python.org/pypi/django-templatetag-sugar
Usage:
{% load next_previous %}
...
{% get_next in <queryset> after <object> as <ne... | 29.815789 | 100 | 0.724625 | 0 | 0 | 0 | 0 | 464 | 0.409532 | 0 | 0 | 491 | 0.433363 |
a49290cc7424f360317d50f2b068b197194ebd8a | 251 | py | Python | tests/fixtures.py | Apkawa/django-modeltranslation-rosetta | 568354ceee201f891e1f9f6d1f5987dbdfa8f84a | [
"MIT"
] | null | null | null | tests/fixtures.py | Apkawa/django-modeltranslation-rosetta | 568354ceee201f891e1f9f6d1f5987dbdfa8f84a | [
"MIT"
] | 14 | 2020-01-06T16:18:37.000Z | 2022-01-20T19:40:56.000Z | tests/fixtures.py | Apkawa/django-modeltranslation-rosetta | 568354ceee201f891e1f9f6d1f5987dbdfa8f84a | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import unicode_literals
import factory
class ArticleFactory(factory.django.DjangoModelFactory):
class Meta:
model = 'tests.Article'
title = factory.Faker('sentence')
body = factory.Faker('text')
| 19.307692 | 56 | 0.717131 | 176 | 0.701195 | 0 | 0 | 0 | 0 | 0 | 0 | 46 | 0.183267 |
a492c95951a23587cee545058f4a9aba5d476ad7 | 4,880 | py | Python | IMU/VTK-6.2.0/IO/Geometry/Testing/Python/motor.py | timkrentz/SunTracker | 9a189cc38f45e5fbc4e4c700d7295a871d022795 | [
"MIT"
] | 4 | 2016-03-30T14:31:52.000Z | 2019-02-02T05:01:32.000Z | IMU/VTK-6.2.0/IO/Geometry/Testing/Python/motor.py | timkrentz/SunTracker | 9a189cc38f45e5fbc4e4c700d7295a871d022795 | [
"MIT"
] | null | null | null | IMU/VTK-6.2.0/IO/Geometry/Testing/Python/motor.py | timkrentz/SunTracker | 9a189cc38f45e5fbc4e4c700d7295a871d022795 | [
"MIT"
] | 2 | 2019-08-30T23:36:13.000Z | 2019-11-08T16:52:01.000Z | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
def GetRGBColor(colorName):
'''
Return the red, green and blue components for a
color as doubles.
'''
rgb = [0.0, 0.0, 0.0] # black
vtk.vt... | 28.208092 | 62 | 0.7625 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 626 | 0.128279 |
a4945675fa5668b6a6e7a48d03c92355e85e8193 | 3,787 | py | Python | Liver_disease/liver_prediction.py | R3DDY97/kaggle_kernels | 8a5a456612bdae712e58188d407714c7cfd04849 | [
"MIT"
] | null | null | null | Liver_disease/liver_prediction.py | R3DDY97/kaggle_kernels | 8a5a456612bdae712e58188d407714c7cfd04849 | [
"MIT"
] | null | null | null | Liver_disease/liver_prediction.py | R3DDY97/kaggle_kernels | 8a5a456612bdae712e58188d407714c7cfd04849 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import pandas as pd
# import numpy as np
from sklearn import (svm, preprocessing)
from sklearn.model_selection import train_test_split, KFold
from sklearn.metrics import (recall_score, precision_score, accuracy_score, confusion_matrix,)
#precision_recall_curve,auc,roc_auc_score,roc_curve,recall_... | 38.252525 | 97 | 0.686295 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,920 | 0.506998 |
a4945a92a6ea4fc3471709318c267e06a6500e97 | 2,208 | py | Python | netspot/nm_helper.py | MaxIV-KitsControls/netspot | 42f505d004bcadcfb32b6ca0511572d38641c23a | [
"MIT"
] | null | null | null | netspot/nm_helper.py | MaxIV-KitsControls/netspot | 42f505d004bcadcfb32b6ca0511572d38641c23a | [
"MIT"
] | null | null | null | netspot/nm_helper.py | MaxIV-KitsControls/netspot | 42f505d004bcadcfb32b6ca0511572d38641c23a | [
"MIT"
] | null | null | null | #!/usr/bin/python -tt
"""NetMagis DB helper."""
import psycopg2
import netspot_settings
class NetMagisDB(object):
"""NetMagis DB helper class."""
def __init__(self):
"""Init."""
self.database = netspot_settings.NM_DATABASE
self.username = netspot_settings.NM_USERNAME
self.password = netspot_set... | 21.861386 | 77 | 0.585598 | 2,045 | 0.926178 | 0 | 0 | 0 | 0 | 0 | 0 | 1,041 | 0.471467 |
a4951993c951ee5441f92978fa0bae320459a650 | 570 | py | Python | practicalnlp/settings.py | paulomann/practical-nlp-pytorch | 7c6b3612599a4d74bf8d1acdd8a8bd25446b526b | [
"MIT"
] | null | null | null | practicalnlp/settings.py | paulomann/practical-nlp-pytorch | 7c6b3612599a4d74bf8d1acdd8a8bd25446b526b | [
"MIT"
] | null | null | null | practicalnlp/settings.py | paulomann/practical-nlp-pytorch | 7c6b3612599a4d74bf8d1acdd8a8bd25446b526b | [
"MIT"
] | 1 | 2019-09-24T17:13:35.000Z | 2019-09-24T17:13:35.000Z | from os.path import dirname, join
ROOT = dirname(dirname(__file__))
DATA = join(ROOT, 'data')
TRAIN_DATA = join(DATA, 'sst2', 'stsa.binary.phrases.train')
VALIDATION_DATA = join(DATA, 'sst2', 'stsa.binary.dev')
TEST_DATA = join(DATA, 'sst2', 'stsa.binary.test')
PRETRAINED_EMBEDDINGS_FILE = join(DATA, 'GoogleNews-vecto... | 43.846154 | 77 | 0.738596 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 222 | 0.389474 |
a4958cb92424a6e7c9c549c160c10cca38cc0e8c | 1,146 | py | Python | bbs/decorators.py | weijiang1994/bbs-admin-backend | a703500ed155fd59cc7dc8843d68238efc69a07f | [
"Apache-2.0"
] | 4 | 2022-01-21T07:06:48.000Z | 2022-03-02T10:47:55.000Z | bbs/decorators.py | weijiang1994/bbs-admin-backend | a703500ed155fd59cc7dc8843d68238efc69a07f | [
"Apache-2.0"
] | 3 | 2022-02-21T16:00:11.000Z | 2022-02-24T09:29:14.000Z | bbs/decorators.py | weijiang1994/bbs-admin-backend | a703500ed155fd59cc7dc8843d68238efc69a07f | [
"Apache-2.0"
] | 1 | 2022-03-31T07:54:59.000Z | 2022-03-31T07:54:59.000Z | """
# coding:utf-8
@Time : 2021/12/06
@Author : jiangwei
@File : decorators.py
@Desc : decorators
@email : qq804022023@gmail.com
@Software: PyCharm
"""
from flask import request, jsonify
from bbs.setting import basedir
import os
from functools import wraps
def track_error(func):
"""
track running ... | 22.038462 | 62 | 0.572426 | 0 | 0 | 0 | 0 | 576 | 0.48731 | 0 | 0 | 450 | 0.380711 |
a495964d82d25e210cda079c174cec9fcd420d1c | 2,447 | py | Python | Tools/extract-sfc.py | Navasnaz/mib2-toolbox | 732f859d0dbb94dcf5c0d8388c959b7389a4c4f0 | [
"MIT"
] | 339 | 2019-09-18T21:46:50.000Z | 2022-03-31T07:50:04.000Z | Tools/extract-sfc.py | Navasnaz/mib2-toolbox | 732f859d0dbb94dcf5c0d8388c959b7389a4c4f0 | [
"MIT"
] | 188 | 2019-09-19T23:09:49.000Z | 2022-03-30T20:21:34.000Z | Tools/extract-sfc.py | Navasnaz/mib2-toolbox | 732f859d0dbb94dcf5c0d8388c959b7389a4c4f0 | [
"MIT"
] | 115 | 2019-09-19T19:49:15.000Z | 2022-03-12T21:10:00.000Z | # ----------------------------------------------------------
# --- Quick 'n' dirty CFF file extractor
#
# File: extract-sfc.py
# Author: Jille
# Revision: 1
# Purpose: MIB2 sfc file exporter
# Comments: Usage: extract-sfc.py <filename> <outdir>
# Changelog: First version
# -------------------... | 23.304762 | 115 | 0.591336 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 966 | 0.394769 |
a4977a487dfb53fc9bdd74cbde790e28018c0ba6 | 1,344 | py | Python | crusoe_observe/cve-connector/cve_connector/vendor_cve/implementation/parsers/general_and_format_parsers/general_parser.py | CSIRT-MU/CRUSOE | 73e4ac0ced6c3ac46d24ac5c3feb01a1e88bd36b | [
"MIT"
] | 3 | 2021-11-09T09:55:17.000Z | 2022-02-19T02:58:27.000Z | crusoe_observe/cve-connector/cve_connector/vendor_cve/implementation/parsers/general_and_format_parsers/general_parser.py | CSIRT-MU/CRUSOE | 73e4ac0ced6c3ac46d24ac5c3feb01a1e88bd36b | [
"MIT"
] | null | null | null | crusoe_observe/cve-connector/cve_connector/vendor_cve/implementation/parsers/general_and_format_parsers/general_parser.py | CSIRT-MU/CRUSOE | 73e4ac0ced6c3ac46d24ac5c3feb01a1e88bd36b | [
"MIT"
] | null | null | null | """Module contains superclass for parsers."""
from abc import ABC, abstractmethod
from datetime import date, timedelta
from html_table_extractor.extractor import Extractor
from lxml.html import tostring
class GeneralParser(ABC):
"""
Superclass for parsers.
"""
def __init__(self, url, from_date=None, ... | 25.846154 | 85 | 0.611607 | 1,137 | 0.845982 | 0 | 0 | 732 | 0.544643 | 0 | 0 | 363 | 0.270089 |
a497d79fdef45fad56951301307fe17492fbee45 | 2,651 | py | Python | core/src/cgcloud/core/apache.py | ompcloud/cgcloud | ec97c3e6df2df549ebf45c69f16fb6d118877d9c | [
"Apache-2.0"
] | 24 | 2015-07-27T02:44:30.000Z | 2022-02-02T10:37:25.000Z | core/src/cgcloud/core/apache.py | ompcloud/cgcloud | ec97c3e6df2df549ebf45c69f16fb6d118877d9c | [
"Apache-2.0"
] | 243 | 2015-05-29T18:39:08.000Z | 2018-07-17T19:42:28.000Z | core/src/cgcloud/core/apache.py | ompcloud/cgcloud | ec97c3e6df2df549ebf45c69f16fb6d118877d9c | [
"Apache-2.0"
] | 22 | 2015-07-16T01:04:08.000Z | 2021-10-10T21:18:36.000Z | import json
import logging
import os
from bd2k.util.strings import interpolate as fmt
from fabric.operations import run
from cgcloud.core.box import Box
from cgcloud.fabric.operations import sudo
log = logging.getLogger( __name__ )
class ApacheSoftwareBox( Box ):
"""
A box to be mixed in to ease the hassle... | 40.166667 | 98 | 0.592984 | 2,413 | 0.910223 | 0 | 0 | 0 | 0 | 0 | 0 | 1,096 | 0.413429 |
a49912576008590c13a1def1c8f65551249b8211 | 2,252 | py | Python | xicam/core/tests/test_threads.py | Xi-CAM/Xi-cam-unified | 8b2811a8c13e18ec3b8860dfa5aee1eabc42da9e | [
"BSD-3-Clause-LBNL"
] | null | null | null | xicam/core/tests/test_threads.py | Xi-CAM/Xi-cam-unified | 8b2811a8c13e18ec3b8860dfa5aee1eabc42da9e | [
"BSD-3-Clause-LBNL"
] | null | null | null | xicam/core/tests/test_threads.py | Xi-CAM/Xi-cam-unified | 8b2811a8c13e18ec3b8860dfa5aee1eabc42da9e | [
"BSD-3-Clause-LBNL"
] | 1 | 2020-05-04T19:28:07.000Z | 2020-05-04T19:28:07.000Z | from pytestqt import qtbot
import pytest
import os
@pytest.mark.skip(reason="thread module testing has issues")
def test_threads(qtbot):
from xicam.core import threads
from qtpy.QtCore import QObject, Signal
def callback(a):
assert a == 10
t = threads.QThreadFuture(sum, [1, 2, 3, 4], callba... | 21.447619 | 93 | 0.671403 | 50 | 0.022202 | 402 | 0.178508 | 2,189 | 0.972025 | 0 | 0 | 170 | 0.075488 |
a4991ee5bb3a8049313bf554b77dbf8520f3ded7 | 2,374 | py | Python | actions/lib/base.py | StackStorm-Exchange/powerdns | 13879e0e66b29a466d82c1077a1d4abde69c0d3e | [
"Apache-2.0"
] | null | null | null | actions/lib/base.py | StackStorm-Exchange/powerdns | 13879e0e66b29a466d82c1077a1d4abde69c0d3e | [
"Apache-2.0"
] | null | null | null | actions/lib/base.py | StackStorm-Exchange/powerdns | 13879e0e66b29a466d82c1077a1d4abde69c0d3e | [
"Apache-2.0"
] | 1 | 2021-12-01T14:49:27.000Z | 2021-12-01T14:49:27.000Z | # coding=utf-8
from st2common import log as logging
from st2common.runners.base_action import Action
from powerdns.exceptions import PDNSCanonicalError, PDNSError
import powerdns
__all__ = ["PowerDNSClient"]
LOG = logging.getLogger(__name__)
class PowerDNSClientError(Exception):
def __init__(self, message):
... | 28.95122 | 73 | 0.603201 | 2,124 | 0.894693 | 0 | 0 | 0 | 0 | 0 | 0 | 187 | 0.07877 |
a49a7796657fa08d5519667b5c665162e1e0b2bd | 522 | py | Python | Aula 10 Estrutura Condicional IF/Aula 10.py | JadilsonJR/Python | 99eab305249ccd02c31f1913d569a9b601eff06a | [
"MIT"
] | null | null | null | Aula 10 Estrutura Condicional IF/Aula 10.py | JadilsonJR/Python | 99eab305249ccd02c31f1913d569a9b601eff06a | [
"MIT"
] | null | null | null | Aula 10 Estrutura Condicional IF/Aula 10.py | JadilsonJR/Python | 99eab305249ccd02c31f1913d569a9b601eff06a | [
"MIT"
] | null | null | null |
a= 10
b= 5
op = "/"
if op == "+":
res=a+b
print("Operação Soma, o Resultado foi de:", a ,"+", b ,"=" , res )
if op == "-":
res=a-b
print("Operação Subtração, o Resultado foi de:", a ,"-", b ,"=" , res )
if op == "/":
res=a/b
print("Operação Subtração, o Resultado de:", a ,"/", b ,"=" , res )... | 15.818182 | 75 | 0.469349 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 296 | 0.548148 |
a49afb80789480d7cb57a77b968a1e32a26b82e3 | 806 | py | Python | app.py | iUwej/Remote-Logger-Server | 8adfd4b85e277ea7e4bd24c22462ff54f0ddedd8 | [
"Unlicense"
] | null | null | null | app.py | iUwej/Remote-Logger-Server | 8adfd4b85e277ea7e4bd24c22462ff54f0ddedd8 | [
"Unlicense"
] | null | null | null | app.py | iUwej/Remote-Logger-Server | 8adfd4b85e277ea7e4bd24c22462ff54f0ddedd8 | [
"Unlicense"
] | null | null | null |
from flask import Flask
from flask import request
from flask import jsonify
from flask_redis import FlaskRedis
app = Flask(__name__)
#provide the redis configuration in the app configs to use this
redis_store = FlaskRedis(app)
@app.route('/')
def index():
return 'Home to the remote logger'
@app.route('/loge... | 17.148936 | 63 | 0.705955 | 0 | 0 | 0 | 0 | 519 | 0.643921 | 0 | 0 | 206 | 0.255583 |
a49c560366637a4b9c308293ac6bef9e243f0019 | 736 | py | Python | tabular/tests/unittests/models/test_linear.py | zhiqiangdon/autogluon | 71ee7ef0f05d8f0aad112d8c1719174aa33194d9 | [
"Apache-2.0"
] | 4,462 | 2019-12-09T17:41:07.000Z | 2022-03-31T22:00:41.000Z | tabular/tests/unittests/models/test_linear.py | zhiqiangdon/autogluon | 71ee7ef0f05d8f0aad112d8c1719174aa33194d9 | [
"Apache-2.0"
] | 1,408 | 2019-12-09T17:48:59.000Z | 2022-03-31T20:24:12.000Z | tabular/tests/unittests/models/test_linear.py | zhiqiangdon/autogluon | 71ee7ef0f05d8f0aad112d8c1719174aa33194d9 | [
"Apache-2.0"
] | 623 | 2019-12-10T02:04:18.000Z | 2022-03-20T17:11:01.000Z |
from autogluon.tabular.models.lr.lr_model import LinearModel
def test_linear_binary(fit_helper):
fit_args = dict(
hyperparameters={LinearModel: {}},
)
dataset_name = 'adult'
fit_helper.fit_and_validate_dataset(dataset_name=dataset_name, fit_args=fit_args)
def test_linear_multiclass(fit_help... | 27.259259 | 85 | 0.73913 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 24 | 0.032609 |
a49de0a573a17e1a8abeb597091da40cf1ac2a4e | 2,529 | py | Python | DBProcessing/ProcessIphoneBackup.py | georgezywang/RealTime_Wechat_Analysis | baa9ba4a06d9d6b4ce13b951f1b3846ebd338ce8 | [
"MIT"
] | null | null | null | DBProcessing/ProcessIphoneBackup.py | georgezywang/RealTime_Wechat_Analysis | baa9ba4a06d9d6b4ce13b951f1b3846ebd338ce8 | [
"MIT"
] | null | null | null | DBProcessing/ProcessIphoneBackup.py | georgezywang/RealTime_Wechat_Analysis | baa9ba4a06d9d6b4ce13b951f1b3846ebd338ce8 | [
"MIT"
] | null | null | null | import sqlite3 as sqlite
import os
from Utils import *
iphoneBackupDir = "IphoneBackup"
m_nsAliasName = "wxid_t798rxqmvz7s11"
PARSED_DB_PATH = "DataStore/Contact.db"
PARSED_DATA_CONNECTION = ConnectNonEncryptedDB(PARSED_DB_PATH)
userAlias, userChatEncryption, userDB = GetUpdateContactInfo(PARSED_DATA_CONNECTION, m_ns... | 38.318182 | 123 | 0.594306 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 976 | 0.385923 |
a49eab646b818bca17a2eac3acba44ec620d5a5e | 3,496 | py | Python | qrl/core/StakeValidator.py | djuhn/QRL-1 | 47c4b8beb8e1be8c5a0fdf16b33532f32899ce13 | [
"MIT"
] | null | null | null | qrl/core/StakeValidator.py | djuhn/QRL-1 | 47c4b8beb8e1be8c5a0fdf16b33532f32899ce13 | [
"MIT"
] | null | null | null | qrl/core/StakeValidator.py | djuhn/QRL-1 | 47c4b8beb8e1be8c5a0fdf16b33532f32899ce13 | [
"MIT"
] | 1 | 2021-11-03T06:56:27.000Z | 2021-11-03T06:56:27.000Z | # coding=utf-8
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
from google.protobuf.json_format import MessageToJson, Parse
from qrl.core import config
from qrl.core.Transaction import StakeTransaction
from qrl.generated ... | 31.495495 | 128 | 0.680492 | 3,116 | 0.891304 | 0 | 0 | 2,051 | 0.58667 | 0 | 0 | 594 | 0.169908 |
a49f7d80f24b4797e2ac4f693214e1ea5cd6017e | 2,936 | py | Python | sohojoe_wrappers.py | Sohojoe/many_towers | 527b3c4b591a3d0919b76395ecfc22c4c0059b08 | [
"MIT"
] | null | null | null | sohojoe_wrappers.py | Sohojoe/many_towers | 527b3c4b591a3d0919b76395ecfc22c4c0059b08 | [
"MIT"
] | null | null | null | sohojoe_wrappers.py | Sohojoe/many_towers | 527b3c4b591a3d0919b76395ecfc22c4c0059b08 | [
"MIT"
] | null | null | null | import os
import gym
import numpy as np
def done_grading(env):
if hasattr(env, 'done_grading'):
return env.done_grading()
if hasattr(env, 'env'):
return done_grading(env.env)
if hasattr(env, '_env'):
return done_grading(env._env)
def is_grading(env):
if hasattr(env, 'is_gradin... | 32.988764 | 96 | 0.583447 | 2,446 | 0.833106 | 0 | 0 | 0 | 0 | 0 | 0 | 312 | 0.106267 |
a49f7fa75323d77c51d8a4ddc4900cade3b8ccc9 | 308 | py | Python | setup.py | FL33TW00D/COP-Kmeans | 7c9c6cc4256107ef8ee89adc491661016342fdfe | [
"MIT"
] | 125 | 2017-06-20T12:33:51.000Z | 2022-03-08T05:40:14.000Z | setup.py | FL33TW00D/COP-Kmeans | 7c9c6cc4256107ef8ee89adc491661016342fdfe | [
"MIT"
] | 6 | 2017-09-12T07:18:03.000Z | 2020-11-18T19:43:53.000Z | setup.py | Behrouz-Babaki/copkmeans | 36ca01fbf001c9bf080408074c2f46838257c14b | [
"MIT"
] | 35 | 2017-05-03T13:53:50.000Z | 2021-11-21T19:16:03.000Z | from setuptools import setup, find_packages
setup(
name='copkmeans',
version='1.5',
description='',
author='',
author_email='',
url='https://github.com/Behrouz-Babaki/COP-Kmeans',
license=license,
packages=find_packages(),
include_package_data=True,
zip_safe=False
)
| 20.533333 | 55 | 0.665584 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 68 | 0.220779 |
a4a1716bce679ffd4ca64f50cb6d4adb175258a8 | 1,210 | py | Python | python-poo/name_value_object.py | alexsandrox/ddd-valueobjects-python | 5b02966512dcf1c099e80b90e1aa965fa339d397 | [
"MIT"
] | null | null | null | python-poo/name_value_object.py | alexsandrox/ddd-valueobjects-python | 5b02966512dcf1c099e80b90e1aa965fa339d397 | [
"MIT"
] | null | null | null | python-poo/name_value_object.py | alexsandrox/ddd-valueobjects-python | 5b02966512dcf1c099e80b90e1aa965fa339d397 | [
"MIT"
] | null | null | null | """
Class:
- NameValueObject
Summary:
- It is usually a good idea to replace common primitives, such as strings, with suitable
value objects.
While I can represent a phone number as a string, turning it into a phone number object
makes variables and parameters m... | 43.214286 | 137 | 0.652893 | 649 | 0.536364 | 0 | 0 | 0 | 0 | 0 | 0 | 628 | 0.519008 |
a4a22bd41876d7d8004bf1557ae0bfbb73b1abde | 1,464 | py | Python | main.py | Rishikesh-kumar-7258/Block_breaker | 7183f5c8732f5a60e909a5d30436614046fb76b2 | [
"MIT"
] | 20 | 2021-08-30T10:55:34.000Z | 2021-08-30T10:57:51.000Z | main.py | Rishikesh-kumar-7258/Block_breaker | 7183f5c8732f5a60e909a5d30436614046fb76b2 | [
"MIT"
] | 7 | 2021-08-22T09:00:39.000Z | 2021-11-05T09:33:46.000Z | main.py | Rishikesh-kumar-7258/Block_breaker | 7183f5c8732f5a60e909a5d30436614046fb76b2 | [
"MIT"
] | 2 | 2021-08-25T07:22:24.000Z | 2021-09-03T02:42:01.000Z | import pygame
from src.spritesheet import SpriteSheet, balls, blocks, sliders
from src.statemachine import Statemachine
from src.states.gameoverstate import GameOver
from src.states.highscoreState import Highscore
from src.states.levelpassedstate import LevelPassed
from src.states.playstate import Play
from src.states... | 25.241379 | 75 | 0.738388 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 270 | 0.184426 |
a4a374d1f47637ba07c0cd5f25d45e1f33628c90 | 1,466 | py | Python | jdcloud_sdk/services/asset/models/OperatingStatementVo.py | Tanc009/jdcloud-sdk-python | 8b045c99bc5b73ca7348e950b6f01e03a27982f5 | [
"Apache-2.0"
] | 14 | 2018-04-19T09:53:56.000Z | 2022-01-27T06:05:48.000Z | jdcloud_sdk/services/asset/models/OperatingStatementVo.py | Tanc009/jdcloud-sdk-python | 8b045c99bc5b73ca7348e950b6f01e03a27982f5 | [
"Apache-2.0"
] | 15 | 2018-09-11T05:39:54.000Z | 2021-07-02T12:38:02.000Z | jdcloud_sdk/services/asset/models/OperatingStatementVo.py | Tanc009/jdcloud-sdk-python | 8b045c99bc5b73ca7348e950b6f01e03a27982f5 | [
"Apache-2.0"
] | 33 | 2018-04-20T05:29:16.000Z | 2022-02-17T09:10:05.000Z | # coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# 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 ... | 38.578947 | 126 | 0.705321 | 1,023 | 0.603896 | 0 | 0 | 0 | 0 | 0 | 0 | 1,301 | 0.768005 |
a4a6b6bc1a07e212eb0593d122c2db090785358b | 690 | py | Python | circuitpython_typing/device_drivers.py | tekktrik/Adafruit_CircuitPython_Typing | f6e60bddbf853acd367e2abd77d3253a38af0189 | [
"MIT"
] | null | null | null | circuitpython_typing/device_drivers.py | tekktrik/Adafruit_CircuitPython_Typing | f6e60bddbf853acd367e2abd77d3253a38af0189 | [
"MIT"
] | 10 | 2022-02-14T02:43:06.000Z | 2022-03-28T18:34:41.000Z | circuitpython_typing/device_drivers.py | tekktrik/Adafruit_CircuitPython_Typing | f6e60bddbf853acd367e2abd77d3253a38af0189 | [
"MIT"
] | 3 | 2022-02-21T20:28:20.000Z | 2022-03-07T17:03:22.000Z | # SPDX-FileCopyrightText: Copyright (c) 2022 Alec Delaney
# SPDX-License-Identifier: MIT
"""
`circuitpython_typing.device_drivers`
================================================================================
Type annotation definitions for device drivers. Used for `adafruit_register`.
* Author(s): Alec Delaney
""... | 26.538462 | 80 | 0.684058 | 126 | 0.182609 | 0 | 0 | 0 | 0 | 0 | 0 | 463 | 0.671014 |
a4a94de479ad444e62d5c5754fb01c753297dfe3 | 34,996 | py | Python | moya/tags/server.py | moyaproject/moya | 78b91d87b4519f91dfdd2b40dab44e72f201a843 | [
"MIT"
] | 129 | 2015-02-16T12:02:50.000Z | 2021-11-06T00:20:01.000Z | moya/tags/server.py | liaohandel/moya | 78b91d87b4519f91dfdd2b40dab44e72f201a843 | [
"MIT"
] | 5 | 2015-02-19T15:56:41.000Z | 2015-09-08T18:58:35.000Z | moya/tags/server.py | liaohandel/moya | 78b91d87b4519f91dfdd2b40dab44e72f201a843 | [
"MIT"
] | 14 | 2015-02-19T17:20:34.000Z | 2022-03-28T01:38:09.000Z | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
from ..elements import Attribute
from ..elements.elementbase import LogicElement
from ..tags.context import ContextElementBase, DataSetter
from .. import logic
from ..urlmapper import URLMapper, Missing... | 33.81256 | 213 | 0.566808 | 33,064 | 0.944794 | 3,833 | 0.109527 | 3,290 | 0.094011 | 0 | 0 | 6,464 | 0.184707 |
a4a9ae71eefe78d31d10c9cf6561fad89222ead9 | 13,716 | py | Python | iter_app/src/environment.py | Wisc-HCI/ITER | 2ae8a5f0ae17783db4db25198ec0d97e72cd7296 | [
"MIT"
] | 1 | 2021-04-07T15:54:44.000Z | 2021-04-07T15:54:44.000Z | iter_app/src/environment.py | Wisc-HCI/ITER | 2ae8a5f0ae17783db4db25198ec0d97e72cd7296 | [
"MIT"
] | null | null | null | iter_app/src/environment.py | Wisc-HCI/ITER | 2ae8a5f0ae17783db4db25198ec0d97e72cd7296 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
'''
Environment Node
Author Curt Henrichs
Date 5-16-19
Provides environment context for ITER runner.
'''
# __MODES__ for environment object type
MODE_COLLISION_MOVEIT = 'collision_moveit'
MODE_MARKER = 'marker'
import os
import tf
import yaml
import json
import time
import uuid
import rospy... | 43.542857 | 174 | 0.664261 | 11,680 | 0.85156 | 0 | 0 | 0 | 0 | 0 | 0 | 2,263 | 0.16499 |
8ef5c654eb24fbff56f7dc6c657508169778666e | 721 | py | Python | iast/serializers/department.py | luzhongyang/DongTai-webapi | f07b2b1bc1222999d0bb7e3300e65c953ee966f5 | [
"Apache-2.0"
] | 6 | 2021-09-01T07:37:37.000Z | 2022-02-10T08:28:47.000Z | iast/serializers/department.py | luzhongyang/DongTai-webapi | f07b2b1bc1222999d0bb7e3300e65c953ee966f5 | [
"Apache-2.0"
] | 51 | 2021-11-09T09:19:05.000Z | 2022-02-10T02:37:04.000Z | iast/serializers/department.py | luzhongyang/DongTai-webapi | f07b2b1bc1222999d0bb7e3300e65c953ee966f5 | [
"Apache-2.0"
] | 21 | 2021-09-01T06:32:19.000Z | 2022-03-03T03:23:37.000Z | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# author:owefsad
# software: PyCharm
# project: lingzhi-webapi
from rest_framework import serializers
from dongtai.models import User
from dongtai.models.department import Department
class DepartmentSerializer(serializers.ModelSerializer):
user_count = serializers.Ser... | 27.730769 | 86 | 0.710125 | 489 | 0.678225 | 0 | 0 | 0 | 0 | 0 | 0 | 160 | 0.221914 |
8ef69a8e8cd014e8cddf55bfd7f3ad8fb1bda81e | 5,132 | py | Python | src/media/data/nouns.py | cjcodeproj/medialibrary | 466ba475561f7701fe41ebe196aaf789a0aa7237 | [
"MIT"
] | null | null | null | src/media/data/nouns.py | cjcodeproj/medialibrary | 466ba475561f7701fe41ebe196aaf789a0aa7237 | [
"MIT"
] | 29 | 2021-09-06T00:46:30.000Z | 2022-03-23T16:47:04.000Z | src/media/data/nouns.py | cjcodeproj/medialibrary | 466ba475561f7701fe41ebe196aaf789a0aa7237 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
'''
Objects for representation of proper nouns used in keywords.
'''
# pylint: disable=too-few-public-methods
# pylint: disable=too-many-branches
# pylint: disable=too-many-instance-attributes
from media.xml.namespaces import Namespaces
class AbstractNoun():
'''
Root class for all noun... | 28.511111 | 66 | 0.567225 | 4,859 | 0.946804 | 0 | 0 | 0 | 0 | 0 | 0 | 1,179 | 0.229735 |
8ef75298706c9e95500d4b99ead2e2f3a0f95ab6 | 1,325 | py | Python | get_together/views/utils.py | alysivji/GetTogether | 403d9945fff019701de41d081ad4452e771e1ce1 | [
"BSD-2-Clause"
] | 446 | 2018-01-21T09:22:41.000Z | 2022-03-25T17:46:12.000Z | get_together/views/utils.py | alysivji/GetTogether | 403d9945fff019701de41d081ad4452e771e1ce1 | [
"BSD-2-Clause"
] | 272 | 2018-01-03T16:55:39.000Z | 2022-03-11T23:12:30.000Z | get_together/views/utils.py | alysivji/GetTogether | 403d9945fff019701de41d081ad4452e771e1ce1 | [
"BSD-2-Clause"
] | 100 | 2018-01-27T02:04:15.000Z | 2021-09-09T09:02:21.000Z | import math
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from events.location import get_client_ip, get_geoip
from events.models import Team
KM_PER_DEGREE_LAT = 110.574
KM_PER_DEGREE_LNG = 111.320 # At the equator
DEFAULT_NEAR_DISTANCE = 100 # kilometeres
def get_nearb... | 33.974359 | 85 | 0.667925 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 100 | 0.075472 |
8ef8e6caf23a898242e0cad01c4af50ac98c7dfb | 12,399 | py | Python | spar_python/analytics/ta2/parse_circuit_log_test.py | nathanawmk/SPARTA | 6eeb28b2dd147088b6e851876b36eeba3e700f16 | [
"BSD-2-Clause"
] | 37 | 2017-06-09T13:55:23.000Z | 2022-01-28T12:51:17.000Z | spar_python/analytics/ta2/parse_circuit_log_test.py | nathanawmk/SPARTA | 6eeb28b2dd147088b6e851876b36eeba3e700f16 | [
"BSD-2-Clause"
] | null | null | null | spar_python/analytics/ta2/parse_circuit_log_test.py | nathanawmk/SPARTA | 6eeb28b2dd147088b6e851876b36eeba3e700f16 | [
"BSD-2-Clause"
] | 5 | 2017-06-09T13:55:26.000Z | 2021-11-11T03:51:56.000Z | # *****************************************************************
# Copyright 2013 MIT Lincoln Laboratory
# Project: SPAR
# Authors: Tim Meunier
# Description: Unit tests for the perfomer encrypted
# circuit log file parser
# ************************************... | 50.198381 | 135 | 0.603678 | 11,703 | 0.943866 | 0 | 0 | 258 | 0.020808 | 0 | 0 | 3,820 | 0.308089 |
8efd24e6ffdf51325fc1702ee241c99388f98dff | 3,937 | py | Python | tests/unit/runners/test_asam.py | HudsonWu/mysalt | 8ce2f66e0d0338157923f0ea0dab912a0f43e52e | [
"Apache-2.0"
] | null | null | null | tests/unit/runners/test_asam.py | HudsonWu/mysalt | 8ce2f66e0d0338157923f0ea0dab912a0f43e52e | [
"Apache-2.0"
] | null | null | null | tests/unit/runners/test_asam.py | HudsonWu/mysalt | 8ce2f66e0d0338157923f0ea0dab912a0f43e52e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
tests.unit.runners.test_asam
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unit tests for the asam runner
"""
from __future__ import absolute_import, print_function, unicode_literals
import logging
import salt.runners.asam as asam
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.... | 35.790909 | 87 | 0.618491 | 3,510 | 0.891542 | 0 | 0 | 0 | 0 | 0 | 0 | 1,362 | 0.345949 |
8efe2c4eaba4d7937fbcd9cb1f00f290f7aabadc | 99 | py | Python | 08-List-Comprehensions/02-List-Comprehension-with-If-Conditional/main.py | 0x00000024/learn-python | 97057dc427feaf8e6da5ca373e7e02d4a1b949ae | [
"MIT"
] | null | null | null | 08-List-Comprehensions/02-List-Comprehension-with-If-Conditional/main.py | 0x00000024/learn-python | 97057dc427feaf8e6da5ca373e7e02d4a1b949ae | [
"MIT"
] | null | null | null | 08-List-Comprehensions/02-List-Comprehension-with-If-Conditional/main.py | 0x00000024/learn-python | 97057dc427feaf8e6da5ca373e7e02d4a1b949ae | [
"MIT"
] | null | null | null | temps = [221, 233, 132, -9999, 434]
new_temps = [i for i in temps if i != -9999]
print(new_temps) | 19.8 | 44 | 0.636364 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f1006919002985162e2bf9e8cb28be291d009c56 | 531 | py | Python | setup.py | zebpalmer/Python | c21c813a5af54de3d6671b822012f346553623b4 | [
"MIT"
] | 2 | 2019-09-18T10:50:31.000Z | 2021-03-20T08:52:04.000Z | setup.py | zebpalmer/Python | c21c813a5af54de3d6671b822012f346553623b4 | [
"MIT"
] | null | null | null | setup.py | zebpalmer/Python | c21c813a5af54de3d6671b822012f346553623b4 | [
"MIT"
] | null | null | null | try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import Quandl
setup(name = 'Quandl',
description = 'Package for Quandl API access',
version = Quandl.__version__,
author = ", ".join(Quandl.__authors__),
maintainer = Quandl.__maintainer__,
mai... | 24.136364 | 52 | 0.629002 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 81 | 0.152542 |
f103e29578195afcbfb92ba556cee4316213c6ba | 1,833 | py | Python | tests/python/unittest/test_infer_type.py | mozga-intel/incubator-mxnet | 7dcfedca704f39b4b9b7497dabf3fea47ad40df4 | [
"BSL-1.0",
"Apache-2.0"
] | 13 | 2017-08-11T05:19:48.000Z | 2020-05-12T02:09:27.000Z | tests/python/unittest/test_infer_type.py | mozga-intel/incubator-mxnet | 7dcfedca704f39b4b9b7497dabf3fea47ad40df4 | [
"BSL-1.0",
"Apache-2.0"
] | 4 | 2021-03-30T11:59:59.000Z | 2022-03-12T00:40:23.000Z | tests/python/unittest/test_infer_type.py | mozga-intel/incubator-mxnet | 7dcfedca704f39b4b9b7497dabf3fea47ad40df4 | [
"BSL-1.0",
"Apache-2.0"
] | 13 | 2016-11-10T06:38:46.000Z | 2021-03-18T21:26:11.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 33.327273 | 91 | 0.713039 | 0 | 0 | 0 | 0 | 871 | 0.475177 | 0 | 0 | 788 | 0.429896 |
f1040870685ccb486372b534a48008c1e473c417 | 871 | py | Python | Examples/ReinforcementLearning/deeprl/env/env_factory.py | burhandodhy/CNTK | fcdeef63d0192c7b4b7428b14c1f9750d6c1de2e | [
"MIT"
] | 17,702 | 2016-01-25T14:03:01.000Z | 2019-05-06T09:23:41.000Z | Examples/ReinforcementLearning/deeprl/env/env_factory.py | burhandodhy/CNTK | fcdeef63d0192c7b4b7428b14c1f9750d6c1de2e | [
"MIT"
] | 3,489 | 2016-01-25T13:32:09.000Z | 2019-05-03T11:29:15.000Z | Examples/ReinforcementLearning/deeprl/env/env_factory.py | burhandodhy/CNTK | fcdeef63d0192c7b4b7428b14c1f9750d6c1de2e | [
"MIT"
] | 5,180 | 2016-01-25T14:02:12.000Z | 2019-05-06T04:24:28.000Z | # Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE.md file in the project root
# for full license information.
# ==============================================================================
from gym import envs
from . import maze2d, puddleworld
def register_env(env_id):... | 29.033333 | 80 | 0.552239 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 339 | 0.389208 |
f104bbe2ef41441b68ca62399f90007c7e48f1ad | 2,599 | py | Python | labdrivers/version.py | pbnjeff89/labdrivers | 1091b9f746a5a011d94cd63abf5010fc8cde1556 | [
"MIT"
] | null | null | null | labdrivers/version.py | pbnjeff89/labdrivers | 1091b9f746a5a011d94cd63abf5010fc8cde1556 | [
"MIT"
] | null | null | null | labdrivers/version.py | pbnjeff89/labdrivers | 1091b9f746a5a011d94cd63abf5010fc8cde1556 | [
"MIT"
] | null | null | null | from os.path import join as pjoin
# Format expected by setup.py and doc/source/conf.py: string of form "X.Y.Z"
_version_major = 0
_version_minor = 9
_version_micro = 8 # use '' for first of series, number for 1 and above
_version_extra = 'dev'
# _version_extra = '' # Uncomment this for full releases
# Construct ful... | 32.4875 | 77 | 0.709504 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,732 | 0.66641 |
f10572b5580f12fbec993a136bc3e170dbb62b5c | 10,347 | py | Python | experiments/gbnf/experiment/boosted_experiment.py | robert-giaquinto/survae_flows | 4d7dc638f77c48ad3c8393b967c33ac9dbad60fe | [
"MIT"
] | 2 | 2021-03-06T19:37:39.000Z | 2022-01-09T11:19:45.000Z | experiments/gbnf/experiment/boosted_experiment.py | robert-giaquinto/survae_flows | 4d7dc638f77c48ad3c8393b967c33ac9dbad60fe | [
"MIT"
] | null | null | null | experiments/gbnf/experiment/boosted_experiment.py | robert-giaquinto/survae_flows | 4d7dc638f77c48ad3c8393b967c33ac9dbad60fe | [
"MIT"
] | null | null | null | import torch
import torchvision.utils as vutils
import math
import numpy as np
from survae.distributions import DataParallelDistribution
from survae.utils import elbo_bpd
from .utils import get_args_table, clean_dict
# Path
import os
import time
from survae.data.path import get_survae_path
# Experiment
from .base im... | 45.183406 | 163 | 0.586837 | 9,824 | 0.949454 | 0 | 0 | 0 | 0 | 0 | 0 | 1,669 | 0.161303 |
f105b721afb9f845c4e320b2b60eb5e5d9422cbd | 6,838 | py | Python | code4step2/data_registration.py | yukeyi/MCDS-Capstone | f7ce48fc5d3f5f96c1f29556585ed2338683c7d2 | [
"MIT"
] | null | null | null | code4step2/data_registration.py | yukeyi/MCDS-Capstone | f7ce48fc5d3f5f96c1f29556585ed2338683c7d2 | [
"MIT"
] | null | null | null | code4step2/data_registration.py | yukeyi/MCDS-Capstone | f7ce48fc5d3f5f96c1f29556585ed2338683c7d2 | [
"MIT"
] | null | null | null | import os
import numpy as np
import pandas as pd
import xarray as xr
import pickle as pkl
from datetime import datetime
from scipy import ndimage as ndi
import SimpleITK as sitk
import skimage as skim
from skimage import feature, morphology
import glob
class RegHearts:
'''Class that generates liver masks for MRE ... | 45.586667 | 100 | 0.665107 | 5,699 | 0.833431 | 0 | 0 | 0 | 0 | 0 | 0 | 2,188 | 0.319977 |
f10624ebcad4c054bd4763bf4f173e415f217f5f | 4,635 | py | Python | cmscalibration/data/dataset.py | mxsg/CMS-Model-Calibration | f7f85e863190f7a7ef0922dca4d0a8f8178e5a9e | [
"MIT"
] | null | null | null | cmscalibration/data/dataset.py | mxsg/CMS-Model-Calibration | f7f85e863190f7a7ef0922dca4d0a8f8178e5a9e | [
"MIT"
] | null | null | null | cmscalibration/data/dataset.py | mxsg/CMS-Model-Calibration | f7f85e863190f7a7ef0922dca4d0a8f8178e5a9e | [
"MIT"
] | null | null | null | from enum import Enum
class Metric(Enum):
""" Contains the possible metrics a dataset can exhibit.
Available metrics currently include ones from the following categories:
- performance metrics
- timing information and time stamps
- entity (e.g., job or node) category information
"""
# Per... | 30.097403 | 118 | 0.66192 | 4,607 | 0.993959 | 0 | 0 | 877 | 0.189213 | 0 | 0 | 1,789 | 0.385976 |
f1070e7683c969a25dc48150b2ca61554d3bb23f | 5,754 | py | Python | src/ikazuchi/plugins/speech.py | t2y/ikazuchi.plugins.speech | 6b73241460368ce50e71801e39d7e2159b59c56f | [
"Apache-2.0"
] | null | null | null | src/ikazuchi/plugins/speech.py | t2y/ikazuchi.plugins.speech | 6b73241460368ce50e71801e39d7e2159b59c56f | [
"Apache-2.0"
] | null | null | null | src/ikazuchi/plugins/speech.py | t2y/ikazuchi.plugins.speech | 6b73241460368ce50e71801e39d7e2159b59c56f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import codecs
import subprocess
from tempfile import NamedTemporaryFile
from ikazuchi.core.handler.base import BaseHandler
from ikazuchi.core.handler.utils import get_and_check_file_access
from ikazuchi.core.translator import TRANSLATE_API as API
from ikazuchi.ikazuchi import (base_parser, sub... | 38.36 | 79 | 0.634689 | 3,268 | 0.567953 | 0 | 0 | 0 | 0 | 0 | 0 | 804 | 0.139729 |
f10a2eb48e0f895a84465c9f5a4dec731cfd9d4c | 1,584 | py | Python | minicCompiler.py | CorentinGoet/miniC-Compiler | 8631b1ce47e9de1c3a3255d7c0a941242ad48292 | [
"MIT"
] | null | null | null | minicCompiler.py | CorentinGoet/miniC-Compiler | 8631b1ce47e9de1c3a3255d7c0a941242ad48292 | [
"MIT"
] | null | null | null | minicCompiler.py | CorentinGoet/miniC-Compiler | 8631b1ce47e9de1c3a3255d7c0a941242ad48292 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
@author Corentin Goetghebeur (github.com/CorentinGoet).
"""
from lexer_pkg.lexer import Lexer
from parser_pkg.parser import Parser
from CLI.CLIinterface import CLI
import sys
import os
from CLI.actions import Actions
from pretty_printer_pkg.pretty_printer import PrettyPrinter
def main():
... | 21.405405 | 64 | 0.614268 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 371 | 0.234217 |
f10f8aba420899a3f319690d32052dd346a3cc8f | 472 | py | Python | ai_controller/controller.py | mingsumsze1/mcts | e67b80eb138d122a75e12b7d1886edb84de0ede5 | [
"MIT"
] | null | null | null | ai_controller/controller.py | mingsumsze1/mcts | e67b80eb138d122a75e12b7d1886edb84de0ede5 | [
"MIT"
] | null | null | null | ai_controller/controller.py | mingsumsze1/mcts | e67b80eb138d122a75e12b7d1886edb84de0ede5 | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
from environment.controller import Controller
from environment.game_state import GameState
class AIController(Controller, ABC):
"""
AI player controller
"""
def pick_move(self, state : GameState):
return self.pick_move_with_likelihood(state)[0]
@abstractmethod
def... | 23.6 | 57 | 0.75 | 341 | 0.722458 | 0 | 0 | 172 | 0.364407 | 0 | 0 | 96 | 0.20339 |
f110bbe65f1ea9ba273384dc8c0ede07db3a4131 | 1,025 | py | Python | QTM_F/1D/pH2/cor.py | binggu56/qmd | e2628710de15f8a8b9a1280fcf92f9e87559414c | [
"MIT"
] | null | null | null | QTM_F/1D/pH2/cor.py | binggu56/qmd | e2628710de15f8a8b9a1280fcf92f9e87559414c | [
"MIT"
] | null | null | null | QTM_F/1D/pH2/cor.py | binggu56/qmd | e2628710de15f8a8b9a1280fcf92f9e87559414c | [
"MIT"
] | null | null | null | ##!/usr/bin/python
import numpy as np
import pylab as plt
import matplotlib as mpl
import seaborn as sns
sns.set_context("poster",font_scale=1.5)
sns.set_style({'font.family':'Times New Roman'})
mpl.rcParams['lines.linewidth'] = 2
data = np.genfromtxt(fname='cor.dat')
ncols = data.shape[1]
#for x in range(1,ncol... | 25.625 | 64 | 0.633171 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 474 | 0.462439 |
f111dbbb6122c9440b75b9f703c03c87600c2765 | 721 | py | Python | packages/pyright-internal/src/tests/samples/tuples10.py | sasano8/pyright | e804f324ee5dbd25fd37a258791b3fd944addecd | [
"MIT"
] | 4,391 | 2019-05-07T01:18:57.000Z | 2022-03-31T20:45:44.000Z | packages/pyright-internal/src/tests/samples/tuples10.py | sasano8/pyright | e804f324ee5dbd25fd37a258791b3fd944addecd | [
"MIT"
] | 2,740 | 2019-05-07T03:29:30.000Z | 2022-03-31T12:57:46.000Z | packages/pyright-internal/src/tests/samples/tuples10.py | sasano8/pyright | e804f324ee5dbd25fd37a258791b3fd944addecd | [
"MIT"
] | 455 | 2019-05-07T12:55:14.000Z | 2022-03-31T17:09:15.000Z | # This sample tests that inferred types for tuples strip
# literals under the appropriate circumstances.
from typing import List, Literal, Tuple
a1 = (1, 2)
t1: Literal["tuple[Literal[1], Literal[2]]"] = reveal_type(a1)
a2 = list((1, 2))
t2: Literal["list[int]"] = reveal_type(a2)
a3: List[Literal[1]] = list((1,))... | 23.258065 | 65 | 0.638003 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 251 | 0.348128 |
f1126fefbaeaa1ea0dabd1a4a9a79fda14c3c53a | 2,260 | py | Python | experiment_tests/basic_experiments.py | probablytom/bpi_13_python | ef042674d3d40857237511af1fbca59ede97e75e | [
"MIT"
] | null | null | null | experiment_tests/basic_experiments.py | probablytom/bpi_13_python | ef042674d3d40857237511af1fbca59ede97e75e | [
"MIT"
] | null | null | null | experiment_tests/basic_experiments.py | probablytom/bpi_13_python | ef042674d3d40857237511af1fbca59ede97e75e | [
"MIT"
] | null | null | null | import unittest
from theatre_au import Clock
from actor_au import Troupe
from domain_model import construct_universe, action_log, generate_XES, new_trace
class ExperimentalScratchpad(unittest.TestCase):
def setUp(self):
self.clock = Clock()
self.reps = Troupe()
self.specialists = Troupe()... | 29.350649 | 109 | 0.569027 | 2,050 | 0.90708 | 0 | 0 | 0 | 0 | 0 | 0 | 191 | 0.084513 |
f113582e7cd0fe94674bc2e6c6d22332d46a63a0 | 5,027 | py | Python | chess/states/intro.py | cuiqui/chrisis | d824bde0bc4a3b9def86550f5bae0db6398f971e | [
"MIT"
] | null | null | null | chess/states/intro.py | cuiqui/chrisis | d824bde0bc4a3b9def86550f5bae0db6398f971e | [
"MIT"
] | null | null | null | chess/states/intro.py | cuiqui/chrisis | d824bde0bc4a3b9def86550f5bae0db6398f971e | [
"MIT"
] | null | null | null | import logging
from pathlib import Path
from dataclasses import dataclass
from typing import Union
import pygame as pg
import chess.settings as s
from chess.states.state import State
from chess.panels.intro.title import Title
from chess.panels.intro.menu import Menu
from chess.panels.console import Console
from chess... | 31.616352 | 88 | 0.539089 | 4,520 | 0.899145 | 0 | 0 | 4,531 | 0.901333 | 0 | 0 | 382 | 0.07599 |
f114f18da4ab04c0defa026734c3b47686aa23f5 | 624 | py | Python | examples/custom_full_model_prediction.py | vickyvava/ImageAI | fc23bc1374d5a29f816c0895b37cb769b1766eac | [
"MIT"
] | 6 | 2019-09-03T01:45:20.000Z | 2021-09-08T09:07:49.000Z | examples/custom_full_model_prediction.py | vickyvava/ImageAI | fc23bc1374d5a29f816c0895b37cb769b1766eac | [
"MIT"
] | 3 | 2020-08-09T11:49:24.000Z | 2020-10-20T00:25:07.000Z | examples/custom_full_model_prediction.py | vickyvava/ImageAI | fc23bc1374d5a29f816c0895b37cb769b1766eac | [
"MIT"
] | 1 | 2019-12-30T18:56:05.000Z | 2019-12-30T18:56:05.000Z | from imageai.Prediction.Custom import CustomImagePrediction
import os
execution_path = os.getcwd()
predictor = CustomImagePrediction()
predictor.setModelPath(model_path=os.path.join(execution_path, "idenprof_full_resnet_ex-001_acc-0.119792.h5")) # Download the model via this link https://github.com/OlafenwaMoses/Ima... | 32.842105 | 209 | 0.820513 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 165 | 0.264423 |
f11502da809353d3e04bfd40b3e232ef13fb8a10 | 2,390 | py | Python | meiduo/apps/users/utils.py | libin-c/Meiduo | 58468fd619a8d9f022df442a10a56b1b12ed1dd8 | [
"MIT"
] | null | null | null | meiduo/apps/users/utils.py | libin-c/Meiduo | 58468fd619a8d9f022df442a10a56b1b12ed1dd8 | [
"MIT"
] | 5 | 2020-05-11T20:23:15.000Z | 2021-11-02T15:46:04.000Z | meiduo/apps/users/utils.py | libin-c/Meiduo | 58468fd619a8d9f022df442a10a56b1b12ed1dd8 | [
"MIT"
] | null | null | null | import re
from django.conf import settings
from django.contrib.auth.backends import ModelBackend
from itsdangerous import BadData
from apps.users.models import User
# 自定义认证后端类
from meiduo.settings.dev import logger
from utils.secret import SecretOauth
def get_user_by_account(account):
"""
根据account查询用户
... | 24.387755 | 84 | 0.6 | 999 | 0.382466 | 0 | 0 | 0 | 0 | 0 | 0 | 836 | 0.320061 |
f11540df96f4088719e10fce2174e7adbb4cfb75 | 423 | py | Python | hippynn/graphs/nodes/__init__.py | tautomer/hippynn | df4504a5ea4680cfc61f490984dcddeac7ed99ee | [
"BSD-3-Clause"
] | 21 | 2021-11-17T00:56:35.000Z | 2022-03-22T05:57:11.000Z | hippynn/graphs/nodes/__init__.py | tautomer/hippynn | df4504a5ea4680cfc61f490984dcddeac7ed99ee | [
"BSD-3-Clause"
] | 4 | 2021-12-17T16:16:53.000Z | 2022-03-16T23:50:38.000Z | hippynn/graphs/nodes/__init__.py | tautomer/hippynn | df4504a5ea4680cfc61f490984dcddeac7ed99ee | [
"BSD-3-Clause"
] | 6 | 2021-11-30T21:09:31.000Z | 2022-03-18T07:07:32.000Z | """
Definitions of nodes for graph computation.
"""
import warnings
from ... import settings
if settings.DEBUG_NODE_CREATION:
warnings.warn("Printing automatic node creation info! Output will be verbose.")
def _debprint(*args, **kwargs):
if settings.DEBUG_NODE_CREATION:
print("AutoNode:", *args, **k... | 21.15 | 83 | 0.704492 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 126 | 0.297872 |
f116e25e44c1bee36f55a82c2b9058f44ab798b0 | 5,391 | py | Python | prometheus_ecs_discoverer/marshalling.py | lejmr/prometheus-ecs-discoverer | d4968c6e3f8588a9f64157462a82420d099ac583 | [
"Apache-2.0"
] | null | null | null | prometheus_ecs_discoverer/marshalling.py | lejmr/prometheus-ecs-discoverer | d4968c6e3f8588a9f64157462a82420d099ac583 | [
"Apache-2.0"
] | null | null | null | prometheus_ecs_discoverer/marshalling.py | lejmr/prometheus-ecs-discoverer | d4968c6e3f8588a9f64157462a82420d099ac583 | [
"Apache-2.0"
] | null | null | null | import json
import os
import re
from typing import Dict, List, Type
from loguru import logger
from prometheus_ecs_discoverer import s
from prometheus_ecs_discoverer.discovery import Target
# Copyright 2018, 2019 Signal Media Ltd. Licensed under the Apache License 2.0
# Modifications Copyright 2020 Tim Schwenke. Lice... | 27.932642 | 86 | 0.59488 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,822 | 0.337971 |
f117604d765d64de174902fb0fbc7bb4e32707ff | 129 | py | Python | test/generate_x.py | ksemianov/torch2caffe | 1a4e622f0ddb1212dbfc0ffca91ed0ad1a0a0545 | [
"MIT"
] | null | null | null | test/generate_x.py | ksemianov/torch2caffe | 1a4e622f0ddb1212dbfc0ffca91ed0ad1a0a0545 | [
"MIT"
] | null | null | null | test/generate_x.py | ksemianov/torch2caffe | 1a4e622f0ddb1212dbfc0ffca91ed0ad1a0a0545 | [
"MIT"
] | null | null | null | import sys
import numpy as np
assert len(sys.argv) == 6
x = np.random.randn(*map(int, sys.argv[1:-1]))
np.save(sys.argv[-1], x)
| 18.428571 | 46 | 0.658915 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f117d7f32926745dd2bc177a8ad4c629308d255f | 1,242 | py | Python | tests/mlflow/test_mlflow_logging.py | MuttData/soam | 65612a02552668c6721dc20e675654883391c3e9 | [
"Apache-2.0"
] | 1 | 2021-09-17T01:14:57.000Z | 2021-09-17T01:14:57.000Z | tests/mlflow/test_mlflow_logging.py | MuttData/soam | 65612a02552668c6721dc20e675654883391c3e9 | [
"Apache-2.0"
] | null | null | null | tests/mlflow/test_mlflow_logging.py | MuttData/soam | 65612a02552668c6721dc20e675654883391c3e9 | [
"Apache-2.0"
] | 1 | 2021-08-09T14:22:50.000Z | 2021-08-09T14:22:50.000Z | from unittest.mock import patch
import mlflow
from soam.core import SoamFlow
from soam.workflow import Slicer
from tests.helpers import sample_data_df # pylint: disable=unused-import
def test_simple_flow(sample_data_df, tmpdir): # pylint: disable=redefined-outer-name
tmp_path = "file://" + str(tmpdir) + "/mlr... | 40.064516 | 85 | 0.6562 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 340 | 0.273752 |
f11901c892a2e1651656900a41006977b1b933d2 | 1,609 | py | Python | emote_recognizer.py | realPanamo/EmoteRecognizer | 9467b7f673266b258fe2cfd76f49c3dd83b2839c | [
"MIT"
] | 2 | 2019-06-23T17:59:52.000Z | 2019-06-25T06:33:15.000Z | emote_recognizer.py | juliarn/EmoteRecognizer | 9467b7f673266b258fe2cfd76f49c3dd83b2839c | [
"MIT"
] | null | null | null | emote_recognizer.py | juliarn/EmoteRecognizer | 9467b7f673266b258fe2cfd76f49c3dd83b2839c | [
"MIT"
] | null | null | null | import enum
import cv2
import numpy
import requests
import config
from model.model import KerasModel
from model.training_data import TrainingData
class EmoteType(enum.Enum):
PEEPO = 0
KAPPA = 1
class EmoteRecognizer:
def __init__(self):
training_data = TrainingData(config.peepo_data_dir, conf... | 29.254545 | 108 | 0.683033 | 1,455 | 0.904288 | 0 | 0 | 0 | 0 | 0 | 0 | 501 | 0.311374 |
f119173712c2b862677623c0eea51d0e26339373 | 633 | py | Python | Python/Supermarket-Queue.py | kbgoda/Codewars-Challenges | b163df4f0bb5ccf5b6482d26b7c1d1a4ec4e9683 | [
"MIT"
] | null | null | null | Python/Supermarket-Queue.py | kbgoda/Codewars-Challenges | b163df4f0bb5ccf5b6482d26b7c1d1a4ec4e9683 | [
"MIT"
] | null | null | null | Python/Supermarket-Queue.py | kbgoda/Codewars-Challenges | b163df4f0bb5ccf5b6482d26b7c1d1a4ec4e9683 | [
"MIT"
] | null | null | null | # Author: Karan Goda
# https://www.codewars.com/kata/57b06f90e298a7b53d000a86
def queue_time(customers, n):
# e.g. customers = [12, 13]
queues = []
if customers is [] or n <= 0:
return 0
elif n >= 1:
# E.g. for 3 queues (n = 3), value would be (0, 0, 0)
[queues.append(0) for queu... | 31.65 | 61 | 0.578199 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 198 | 0.312796 |
f11a59c34afba587fb8aa830114d8088e1e90046 | 777 | py | Python | setup.py | mitchelllisle/monstermash | 724907514a9727a2970b3ddffe4d6fb2a490da48 | [
"MIT"
] | null | null | null | setup.py | mitchelllisle/monstermash | 724907514a9727a2970b3ddffe4d6fb2a490da48 | [
"MIT"
] | null | null | null | setup.py | mitchelllisle/monstermash | 724907514a9727a2970b3ddffe4d6fb2a490da48 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
with open('requirements/requirements.txt') as f:
requirements = f.read().splitlines()
with open('requirements/requirements-test.txt') as f:
test_requirements = f.read().splitlines()
setup(
name='monstermash',
author='Mitchell Lisle',
author_email='m.... | 25.064516 | 56 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 269 | 0.346203 |
f11a62a225b14fde953a537552d646f6d24b4f0a | 2,117 | py | Python | flatpickr/_base.py | maqnius/django-flatpickr | 92d5bbf9d4c0c01f904053b39f587053d072b45d | [
"MIT"
] | 40 | 2019-03-07T08:48:58.000Z | 2021-12-25T21:26:14.000Z | flatpickr/_base.py | maqnius/django-flatpickr | 92d5bbf9d4c0c01f904053b39f587053d072b45d | [
"MIT"
] | 6 | 2019-08-06T11:08:25.000Z | 2021-11-16T10:05:52.000Z | flatpickr/_base.py | maqnius/django-flatpickr | 92d5bbf9d4c0c01f904053b39f587053d072b45d | [
"MIT"
] | 8 | 2020-01-02T15:14:38.000Z | 2022-01-24T13:10:26.000Z | # -*- coding: utf-8 -*-
"""Contains Base Date-Picker input class for widgets of this package."""
from django.forms.widgets import DateTimeBaseInput
from flatpickr._settings import WidgetSettings
from flatpickr._media import WidgetMedia
from flatpickr._config import WidgetConfig
class BasePickerInput(DateTimeBaseInpu... | 34.145161 | 79 | 0.64478 | 1,834 | 0.86632 | 0 | 0 | 0 | 0 | 0 | 0 | 696 | 0.328767 |
f11af5159da93a6017221c5833ef55a7b96baeab | 354 | py | Python | biopandas/pdb/__init__.py | tahmidbintaslim/biopandas | 75a2d15584a61ad11536104fa280f2885454a394 | [
"BSD-3-Clause"
] | 453 | 2015-11-24T01:16:05.000Z | 2022-03-18T13:52:04.000Z | biopandas/pdb/__init__.py | tahmidbintaslim/biopandas | 75a2d15584a61ad11536104fa280f2885454a394 | [
"BSD-3-Clause"
] | 84 | 2015-11-24T07:41:53.000Z | 2022-03-17T00:37:37.000Z | biopandas/pdb/__init__.py | tahmidbintaslim/biopandas | 75a2d15584a61ad11536104fa280f2885454a394 | [
"BSD-3-Clause"
] | 115 | 2015-12-01T01:37:43.000Z | 2022-03-10T13:20:24.000Z | # BioPandas
# Author: Sebastian Raschka <mail@sebastianraschka.com>
# License: BSD 3 clause
# Project Website: http://rasbt.github.io/biopandas/
# Code Repository: https://github.com/rasbt/biopandas
"""
BioPandas module for working with Protein Data Bank (PDB)
files in pandas DataFrames.
"""
from .pandas_pdb import P... | 23.6 | 57 | 0.757062 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 298 | 0.841808 |
f11ca3fdd4ba7c8d116c74428211e0b05be66c95 | 17,854 | py | Python | sdk/python/pulumi_azure_native/costmanagement/v20210101/_inputs.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/costmanagement/v20210101/_inputs.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/costmanagement/v20210101/_inputs.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 44.635 | 1,390 | 0.674359 | 17,077 | 0.95648 | 0 | 0 | 17,229 | 0.964994 | 0 | 0 | 9,258 | 0.518539 |
f11f0d6ac32bd29c53535c13dbecdf64bee130f1 | 1,968 | py | Python | app/usr/lib/chewup/chewup/ui/indicator.py | samwhelp/util-chewup | aedcfe4a765218e11936dc4e5c259157635d7f41 | [
"MIT"
] | null | null | null | app/usr/lib/chewup/chewup/ui/indicator.py | samwhelp/util-chewup | aedcfe4a765218e11936dc4e5c259157635d7f41 | [
"MIT"
] | null | null | null | app/usr/lib/chewup/chewup/ui/indicator.py | samwhelp/util-chewup | aedcfe4a765218e11936dc4e5c259157635d7f41 | [
"MIT"
] | null | null | null |
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
gi.require_version('AppIndicator3', '0.1')
from gi.repository import AppIndicator3 as AppIndicator
class Indicator:
app = None
view = None
indicator = None
menu = None
icon_name_on_win_activate = 'empty'
icon_name_on_win_deactivate = '... | 23.710843 | 69 | 0.745427 | 1,790 | 0.909553 | 0 | 0 | 0 | 0 | 0 | 0 | 219 | 0.11128 |
f11f62efb3e0225c391fb17a49be38c58be39674 | 4,779 | py | Python | mutation_lib_prep/cosmic_integrator.py | vrushali-broad/ctat-mutations | ba451dc36039f47e9c61b3ee76211070f6dc53a5 | [
"BSD-3-Clause"
] | null | null | null | mutation_lib_prep/cosmic_integrator.py | vrushali-broad/ctat-mutations | ba451dc36039f47e9c61b3ee76211070f6dc53a5 | [
"BSD-3-Clause"
] | null | null | null | mutation_lib_prep/cosmic_integrator.py | vrushali-broad/ctat-mutations | ba451dc36039f47e9c61b3ee76211070f6dc53a5 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
from __future__ import (absolute_import, division,
print_function, unicode_literals)
#import inspect
import os,sys
import csv
import argparse
import subprocess
import gzip
import glob
import logging
##
## This script decorates the Cosmic coding vari... | 38.853659 | 517 | 0.676292 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,273 | 0.475623 |
f11fc082634360f202d4baf18fad1a6d3429b438 | 1,472 | py | Python | Simple HTTP Server/httpServer.py | daniellycosta/python_scripts_hacktoberfest2019 | 642e648b41c88984b41a22f786fade6a54ef5001 | [
"MIT"
] | null | null | null | Simple HTTP Server/httpServer.py | daniellycosta/python_scripts_hacktoberfest2019 | 642e648b41c88984b41a22f786fade6a54ef5001 | [
"MIT"
] | null | null | null | Simple HTTP Server/httpServer.py | daniellycosta/python_scripts_hacktoberfest2019 | 642e648b41c88984b41a22f786fade6a54ef5001 | [
"MIT"
] | 1 | 2020-10-02T03:30:44.000Z | 2020-10-02T03:30:44.000Z | import socket
from HTMLParser import HTMLParser
indexFile = open('index.html','r')
index = indexFile.read()
page404File = open('page404.html','r')
page404 = page404File.read()
# server host and port definition
HOST = '' # server ip (empty)
PORT = 8080 # server port
# create a socket with IPv4 (AF_INET)... | 28.307692 | 94 | 0.699049 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 666 | 0.452446 |
f1212ab75574f42e605d0d03910218033dfcfd8a | 1,035 | py | Python | dryad/test_status_controller.py | Francis-T/citas-dryad | 2974aeb2b2754df3f23a098d614e3892bb5e2319 | [
"MIT"
] | null | null | null | dryad/test_status_controller.py | Francis-T/citas-dryad | 2974aeb2b2754df3f23a098d614e3892bb5e2319 | [
"MIT"
] | null | null | null | dryad/test_status_controller.py | Francis-T/citas-dryad | 2974aeb2b2754df3f23a098d614e3892bb5e2319 | [
"MIT"
] | 1 | 2016-09-05T08:25:30.000Z | 2016-09-05T08:25:30.000Z | #
# Status Indicator Circuit Controller Test
# Author: Francis T
#
# Tests the status indicator circuit controller
#
import unittest
import status_controller as statc
class BasicFuncTestCase(unittest.TestCase):
def setUp(self):
#statc.initialize()
return
def test_status_inactive(self... | 24.069767 | 70 | 0.683092 | 807 | 0.77971 | 0 | 0 | 0 | 0 | 0 | 0 | 149 | 0.143961 |
f121b237306aa5803c642431f163fbdc7a638007 | 1,296 | py | Python | src/adversarial_q_learning/network/dqn.py | shuvoxcd01/neural_tic_tac_toe | a988230ff3dd0d882ebc0fb19630c9ff22fef629 | [
"Apache-2.0"
] | null | null | null | src/adversarial_q_learning/network/dqn.py | shuvoxcd01/neural_tic_tac_toe | a988230ff3dd0d882ebc0fb19630c9ff22fef629 | [
"Apache-2.0"
] | null | null | null | src/adversarial_q_learning/network/dqn.py | shuvoxcd01/neural_tic_tac_toe | a988230ff3dd0d882ebc0fb19630c9ff22fef629 | [
"Apache-2.0"
] | null | null | null | import os
from tensorflow.keras import Sequential
from tensorflow.keras.layers import Dense, InputLayer, Flatten
from tensorflow.keras.models import clone_model
class DQN:
@staticmethod
def get_q_network(input_shape, num_actions):
model = Sequential()
model.add(InputLayer(input_shape=input_sh... | 28.173913 | 77 | 0.681327 | 1,131 | 0.872685 | 0 | 0 | 1,098 | 0.847222 | 0 | 0 | 24 | 0.018519 |
f122a05ae2a117a955547f6e8fd27731b4497e6e | 6,160 | py | Python | conmato/member.py | ngocbh/codeforces-management-tools | 4064cf3cf4bd9ffabdab15e4243e3fbe80a824ad | [
"MIT"
] | 6 | 2020-03-24T16:57:31.000Z | 2020-09-19T13:34:14.000Z | conmato/member.py | ngocjr7/codeforces-standings-crawler | 1bb8bf468299ea2c944a238627ee1516625cb91e | [
"MIT"
] | 1 | 2021-02-04T04:39:55.000Z | 2021-02-04T04:39:55.000Z | conmato/member.py | ngocjr7/codeforces-standings-crawler | 1bb8bf468299ea2c944a238627ee1516625cb91e | [
"MIT"
] | 1 | 2020-04-26T11:25:55.000Z | 2020-04-26T11:25:55.000Z | from __future__ import absolute_import
import re
import requests
import time
import random
from conmato.utils import *
def remove_participants(session, member, group_id=GROUP_ID):
url = MEMBERS_URL.format(group_id)
payload = {
'_tta': member['_tta'],
'action': 'removeMember',
'csrf... | 33.478261 | 101 | 0.601948 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,540 | 0.25 |
f123b44307466fc8929799150b7a0789336de9af | 2,271 | py | Python | data/transcoder_evaluation_gfg/python/REMOVE_MINIMUM_NUMBER_ELEMENTS_NO_COMMON_ELEMENT_EXIST_ARRAY.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 241 | 2021-07-20T08:35:20.000Z | 2022-03-31T02:39:08.000Z | data/transcoder_evaluation_gfg/python/REMOVE_MINIMUM_NUMBER_ELEMENTS_NO_COMMON_ELEMENT_EXIST_ARRAY.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 49 | 2021-07-22T23:18:42.000Z | 2022-03-24T09:15:26.000Z | data/transcoder_evaluation_gfg/python/REMOVE_MINIMUM_NUMBER_ELEMENTS_NO_COMMON_ELEMENT_EXIST_ARRAY.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 71 | 2021-07-21T05:17:52.000Z | 2022-03-29T23:49:28.000Z | # Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
def f_gold ( a , b , n , m ) :
countA = dict ( )
countB = dict ( )
for i in range ( n ) :
countA [ a [ i ] ]... | 56.775 | 303 | 0.453545 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 221 | 0.097314 |
f123c50479e273b94aab8c70c02be92191fe755f | 6,620 | py | Python | canary/argument_pipeline/component_prediction.py | Open-Argumentation/Canary | 1a3128a5357f0428b7cb19d66b52e83dbe75fff0 | [
"MIT"
] | 3 | 2020-12-16T19:26:39.000Z | 2022-03-16T16:41:31.000Z | canary/argument_pipeline/component_prediction.py | Open-Argumentation/Canary | 1a3128a5357f0428b7cb19d66b52e83dbe75fff0 | [
"MIT"
] | 4 | 2021-05-25T13:28:40.000Z | 2022-01-15T12:44:54.000Z | canary/argument_pipeline/component_prediction.py | Open-Argumentation/Canary | 1a3128a5357f0428b7cb19d66b52e83dbe75fff0 | [
"MIT"
] | 2 | 2020-12-10T13:40:36.000Z | 2020-12-16T19:34:03.000Z | import pandas
from imblearn.over_sampling import RandomOverSampler
from nltk.tree import Tree
from scipy.sparse import hstack
from sklearn.base import TransformerMixin, BaseEstimator
from sklearn.feature_extraction import DictVectorizer
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.pipeline i... | 36.373626 | 116 | 0.623112 | 5,666 | 0.855891 | 0 | 0 | 3,273 | 0.494411 | 0 | 0 | 1,787 | 0.26994 |
f125c669b4d659e35b8a378e25dd4d527ec4dbd4 | 27,310 | py | Python | flask/lib/python3.8/site-packages/to/trainer.py | Otybrian/blogpost | 518599019e11cd7ee11e01470c4d51dfb4583274 | [
"MIT"
] | null | null | null | flask/lib/python3.8/site-packages/to/trainer.py | Otybrian/blogpost | 518599019e11cd7ee11e01470c4d51dfb4583274 | [
"MIT"
] | null | null | null | flask/lib/python3.8/site-packages/to/trainer.py | Otybrian/blogpost | 518599019e11cd7ee11e01470c4d51dfb4583274 | [
"MIT"
] | null | null | null | import re
import os
import traceback
import importlib.util
from prompt_toolkit import prompt
from prompt_toolkit.history import FileHistory
from prompt_toolkit.auto_suggest import AutoSuggestFromHistory
from prompt_toolkit.validation import ValidationError
from colored import fg, bg, attr
import torch.optim as optim
... | 38.464789 | 119 | 0.528781 | 26,745 | 0.979312 | 0 | 0 | 0 | 0 | 0 | 0 | 6,154 | 0.225339 |
f1266a803627ec1031a1ee5077266bcc7b6391cf | 1,420 | py | Python | lambdata/test_lambdata.py | leibo411/lambdata-leibo411 | 59b322e4e3e4d27970dea21efdecaa7d65029c7f | [
"MIT"
] | null | null | null | lambdata/test_lambdata.py | leibo411/lambdata-leibo411 | 59b322e4e3e4d27970dea21efdecaa7d65029c7f | [
"MIT"
] | null | null | null | lambdata/test_lambdata.py | leibo411/lambdata-leibo411 | 59b322e4e3e4d27970dea21efdecaa7d65029c7f | [
"MIT"
] | null | null | null | """Basic unit test for lambdata"""
import unittest
import random
from example_module import favorite_animals, colors, add, increment, becca, rand_num
class ExampleTests(unittest.TestCase):
"""Making sure examples work as expected"""
def test_add(self):
"""Testing that add works as expected"""
... | 23.278689 | 84 | 0.600704 | 1,208 | 0.850704 | 0 | 0 | 0 | 0 | 0 | 0 | 337 | 0.237324 |
f1298764a70d48a5cc02427e03a11f21ba24e293 | 6,989 | py | Python | capt/function/push.py | tmanfree/capt | a6c1c12bb2677aef718f550c5fa7ffd4b71dedd4 | [
"MIT"
] | null | null | null | capt/function/push.py | tmanfree/capt | a6c1c12bb2677aef718f550c5fa7ffd4b71dedd4 | [
"MIT"
] | null | null | null | capt/function/push.py | tmanfree/capt | a6c1c12bb2677aef718f550c5fa7ffd4b71dedd4 | [
"MIT"
] | null | null | null |
# system imports
import sys
import os
import time
# local imports
from function.find import Find
from connector.switch import Switch
class Push:
def __init__(self):
self.find = Find()
def template(self, args, config, logger):
dev_id_list = []
address_list = []
try:
... | 41.35503 | 129 | 0.606954 | 6,851 | 0.980255 | 0 | 0 | 0 | 0 | 0 | 0 | 3,325 | 0.475748 |
f12a3ccfb07fc32ea4a8769b9c53d6c5dadcdff4 | 5,200 | py | Python | python/py_basic_ide/pyBASIC/parser.py | josephlewis42/personal_codebase | aa0fff9a908ab90bc78d24aa69d1b91163c35314 | [
"Unlicense"
] | 3 | 2015-11-24T17:06:58.000Z | 2018-05-01T14:03:57.000Z | python/py_basic_ide/pyBASIC/parser.py | josephlewis42/personal_codebase | aa0fff9a908ab90bc78d24aa69d1b91163c35314 | [
"Unlicense"
] | null | null | null | python/py_basic_ide/pyBASIC/parser.py | josephlewis42/personal_codebase | aa0fff9a908ab90bc78d24aa69d1b91163c35314 | [
"Unlicense"
] | null | null | null | #!/usr/bin/python
SHOW_ERRORS = True
import sys
def error_fx(text):
'''The default error handling, print the text to the console.
replace with your own function if you want, have it print to your
wx application or whatever.'''
sys.stderr.write(text)
def show_error(text):
'''
Send an error if SHO... | 26.804124 | 88 | 0.674808 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,311 | 0.444423 |
f12d14efa8b178a7fd6e3c412a22307369c3675c | 2,076 | py | Python | src/config/config.py | mirzak/mender-python-client | 383bd5d130fb67d3f38aa4a4442b0bd74ec29cca | [
"Apache-2.0"
] | null | null | null | src/config/config.py | mirzak/mender-python-client | 383bd5d130fb67d3f38aa4a4442b0bd74ec29cca | [
"Apache-2.0"
] | null | null | null | src/config/config.py | mirzak/mender-python-client | 383bd5d130fb67d3f38aa4a4442b0bd74ec29cca | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Northern.tech AS
#
# 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 ag... | 31.938462 | 84 | 0.664258 | 345 | 0.166185 | 0 | 0 | 0 | 0 | 0 | 0 | 1,050 | 0.50578 |
f12dc2176e2beefeeb42b25ea4471be881f3f01d | 1,316 | py | Python | Arays/6_Equilibrium index of an array_approach_2.py | sounak95/100_days_of_code | 50fbf088ce6ab2137aa216a30e3b3f828b278a22 | [
"Apache-2.0"
] | null | null | null | Arays/6_Equilibrium index of an array_approach_2.py | sounak95/100_days_of_code | 50fbf088ce6ab2137aa216a30e3b3f828b278a22 | [
"Apache-2.0"
] | null | null | null | Arays/6_Equilibrium index of an array_approach_2.py | sounak95/100_days_of_code | 50fbf088ce6ab2137aa216a30e3b3f828b278a22 | [
"Apache-2.0"
] | null | null | null | """
Description - Equilibrium index of an array is an index such that the sum of elements at lower indexes is equal to the sum of elements at higher indexes. We are given an Array of integers, We have to find out the first index i from left such that -
A[0] + A[1] + ... A[i-1] = A[i+1] + A[i+2] ... A[n-1]
Input
[-7, 1... | 23.087719 | 279 | 0.604103 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,055 | 0.801672 |
f12dec8fdb6f941c195c95911262bfc88aa141b4 | 491 | py | Python | kozmic/projects/__init__.py | artofhuman/kozmic-ci | 930c06e0ad6d5a1fe16b81c036a1d676004eeb37 | [
"BSD-3-Clause"
] | 1 | 2021-06-05T18:36:13.000Z | 2021-06-05T18:36:13.000Z | kozmic/projects/__init__.py | artofhuman/kozmic-ci | 930c06e0ad6d5a1fe16b81c036a1d676004eeb37 | [
"BSD-3-Clause"
] | null | null | null | kozmic/projects/__init__.py | artofhuman/kozmic-ci | 930c06e0ad6d5a1fe16b81c036a1d676004eeb37 | [
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
"""
kozmic.projects
~~~~~~~~~~~~~~~
.. attribute:: bp
:class:`flask.Blueprint` that provides all the means for managing and
viewing projects.
"""
from flask import Blueprint
from flask.ext.login import login_required
bp = Blueprint('projects', __name__)
@bp.before_request
@login_required
d... | 15.34375 | 73 | 0.694501 | 0 | 0 | 0 | 0 | 155 | 0.315682 | 0 | 0 | 212 | 0.431772 |
f12e84e71dc2614e3a6f1d2f7d671fe27072ff71 | 474 | py | Python | py_framework/wsgi.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | py_framework/wsgi.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | py_framework/wsgi.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | from wsgiref.simple_server import make_server
def application(envrion, start_response):
response_body = [
'{key}: {value}'.format(key=key, value=value) for key, value in sorted(envrion.items())
]
response_body = '\n'.join(response_body)
status = '200'
response_headers = [
('Conten... | 26.333333 | 95 | 0.670886 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 69 | 0.14557 |
f130b64b0ff7b024705421268b8468e5fc3ddf42 | 3,345 | py | Python | pomma/determine_symbols_and_max_repeats.py | NickleDave/pomma | e41dc4b354edb0c3a52685365fd79653e1930d43 | [
"BSD-3-Clause"
] | 1 | 2019-02-06T16:51:46.000Z | 2019-02-06T16:51:46.000Z | pomma/determine_symbols_and_max_repeats.py | NickleDave/pomma | e41dc4b354edb0c3a52685365fd79653e1930d43 | [
"BSD-3-Clause"
] | null | null | null | pomma/determine_symbols_and_max_repeats.py | NickleDave/pomma | e41dc4b354edb0c3a52685365fd79653e1930d43 | [
"BSD-3-Clause"
] | null | null | null | from itertools import groupby, chain
def determine_symbols_and_max_repeats(sequences):
"""determines unique set of symbols used in sequences, and maximum number
of repeats of those symbols (consecutive repeats, not just repeats in the
sense of occurrences). Any symbol with a maximum number of repeats > 1... | 41.8125 | 85 | 0.637668 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,865 | 0.557549 |
f130c55a426adac68bf09f355daa9ca3125bc0da | 292 | py | Python | week2/scripts/tb_publisher.py | ajaykrishna1878/Robotics-Automation-QSTP-2021 | f5b8626db20a60f9dd923bab5a0bec118d0abc67 | [
"MIT"
] | null | null | null | week2/scripts/tb_publisher.py | ajaykrishna1878/Robotics-Automation-QSTP-2021 | f5b8626db20a60f9dd923bab5a0bec118d0abc67 | [
"MIT"
] | null | null | null | week2/scripts/tb_publisher.py | ajaykrishna1878/Robotics-Automation-QSTP-2021 | f5b8626db20a60f9dd923bab5a0bec118d0abc67 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import rospy
from std_msgs.msg import Float32
rospy.init_node('radius_publisher')
pub = rospy.Publisher('/radius', Float32, queue_size=1)
rate = rospy.Rate(1)
if __name__ == '__main__':
while not rospy.is_shutdown():
pub.publish(0.5)
rate.sleep() | 22.461538 | 55 | 0.695205 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 59 | 0.202055 |
f1313cae1d8ecddeb5f75f139601242ca6ec08e2 | 3,330 | py | Python | exps/supp-synthetic/synth_utils.py | Viktour19/overlap-code | f5c6e63146a00f65710c38b9181bb9d12de6454f | [
"MIT"
] | 2 | 2020-07-09T03:15:58.000Z | 2022-03-09T11:57:17.000Z | exps/supp-synthetic/synth_utils.py | Viktour19/overlap-code | f5c6e63146a00f65710c38b9181bb9d12de6454f | [
"MIT"
] | null | null | null | exps/supp-synthetic/synth_utils.py | Viktour19/overlap-code | f5c6e63146a00f65710c38b9181bb9d12de6454f | [
"MIT"
] | 1 | 2021-05-18T11:55:04.000Z | 2021-05-18T11:55:04.000Z | import pandas as pd
import numpy as np
identity_func = lambda a, b: b
def compliance(D, R, inv_trans=lambda x,y : y):
ops = {'<=': (lambda x,y : x <= y),
'>': (lambda x,y : x > y),
'>=': (lambda x,y : x >= y),
'<': (lambda x,y : x < y),
'==': (lambda x,y : x == y),
... | 33.979592 | 85 | 0.58979 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 839 | 0.251952 |
f13146176d51f8cb1731e866ee6731f529600270 | 97 | py | Python | setup.py | souravdatta/words | 1d4d8e5f192b24b2c734d839fe3eaa540256e2ed | [
"MIT"
] | null | null | null | setup.py | souravdatta/words | 1d4d8e5f192b24b2c734d839fe3eaa540256e2ed | [
"MIT"
] | null | null | null | setup.py | souravdatta/words | 1d4d8e5f192b24b2c734d839fe3eaa540256e2ed | [
"MIT"
] | null | null | null | # Py2Exe setup file
from distutils.core import setup
import py2exe
setup(console=['words.py'])
| 13.857143 | 32 | 0.762887 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 29 | 0.298969 |
f131822d2876d486bc9f4306fc36427725e30437 | 2,014 | py | Python | Tools/Recon/Profile/Phone_Number/atheris.py | Apollo-o/Whistle | f6df3b67be81fe36f0ecb8b4831bc5dc9cdc4a52 | [
"CC0-1.0"
] | null | null | null | Tools/Recon/Profile/Phone_Number/atheris.py | Apollo-o/Whistle | f6df3b67be81fe36f0ecb8b4831bc5dc9cdc4a52 | [
"CC0-1.0"
] | null | null | null | Tools/Recon/Profile/Phone_Number/atheris.py | Apollo-o/Whistle | f6df3b67be81fe36f0ecb8b4831bc5dc9cdc4a52 | [
"CC0-1.0"
] | null | null | null | # Author: O-O
# Date: 6/23/2019
# Description: A Simple Reverse Lookup Program.
import webbrowser
# Generates URLS.
# Precondition: A String.
# Postcondition: Web-Browser Controller (Opens URLS)
def generate_urls(phone_number):
# Phone Number.
area,prefix,line = phone_number[:3], phone_number[3:6], phone_num... | 32.483871 | 151 | 0.576465 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,252 | 0.621648 |
f132e74654ba84f3c9be398d164080b7c216ae8e | 867 | py | Python | examples/show_tempos.py | storagebot/pyechonest | aa39f008e9ecdefedb3f37187596c6cf2b770e80 | [
"BSD-3-Clause"
] | 1 | 2015-04-26T12:21:23.000Z | 2015-04-26T12:21:23.000Z | examples/show_tempos.py | debrice/pyechonest | 8afe498ad70d456d064c328fe55a0049441c1cac | [
"BSD-3-Clause"
] | null | null | null | examples/show_tempos.py | debrice/pyechonest | 8afe498ad70d456d064c328fe55a0049441c1cac | [
"BSD-3-Clause"
] | null | null | null | # Shows the tempos for all of the songs in a director
# requires eyeD3, available from http://eyed3.nicfit.net/
import sys
import os
import eyeD3
import tempo
def show_tempo(mp3):
"given an mp3, print out the artist, title and tempo of the song"
tag = eyeD3.Tag()
tag.link(mp3)
my_tempo = tempo.get_te... | 24.771429 | 69 | 0.635525 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 318 | 0.366782 |
f1343917f3d52976f0620a8993ab397c596d873e | 321 | py | Python | dialogos/quotes/urls.py | bertucho/epic-movie-quotes-quiz | 09e4ec58a441ab74c1ce6e0fde4e71b08a4d7250 | [
"MIT"
] | null | null | null | dialogos/quotes/urls.py | bertucho/epic-movie-quotes-quiz | 09e4ec58a441ab74c1ce6e0fde4e71b08a4d7250 | [
"MIT"
] | null | null | null | dialogos/quotes/urls.py | bertucho/epic-movie-quotes-quiz | 09e4ec58a441ab74c1ce6e0fde4e71b08a4d7250 | [
"MIT"
] | null | null | null | from django.conf.urls import patterns, url
from quotes import views
from views import *
urlpatterns = patterns('',
url(r'^sdf$', index, name='index'),
url(r'^$', GameView.as_view(), name='game'),
url(r'^post$', AnswerView.as_view(), name='answer'),
url(r'^edit$', QuoteUpdate.as_view(), name='update'),
)
... | 29.181818 | 55 | 0.65109 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 62 | 0.193146 |
f134d17016594831785b2ac0544232f61c2c3c64 | 318 | py | Python | setup.py | timbook/modelmonitor | 876fdc8fb2b48e8e0942f9e7809193c62f0aa77e | [
"MIT"
] | null | null | null | setup.py | timbook/modelmonitor | 876fdc8fb2b48e8e0942f9e7809193c62f0aa77e | [
"MIT"
] | null | null | null | setup.py | timbook/modelmonitor | 876fdc8fb2b48e8e0942f9e7809193c62f0aa77e | [
"MIT"
] | null | null | null | import setuptools
setuptools.setup(
name="modelmonitor",
author="Tim Book",
author_email="timothykbook@gmail.com",
description="A library for monitoring data changes over time",
url="https://github.com/timbook/modelmonitor",
packages=setuptools.find_packages(),
python_requires='>=3.6',
)
| 26.5 | 66 | 0.713836 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 145 | 0.455975 |
f1378b6a473af8bf2230b8b3abb2ec910392d01c | 4,995 | py | Python | Data-Lake/etl.py | naderAsadi/Udacity-Data-Engineering-Projects | d12c42b3260379a470abd244f98a1fd5b32718f7 | [
"MIT"
] | 4 | 2020-10-03T18:14:20.000Z | 2021-11-01T08:15:32.000Z | Data-Lake/etl.py | naderAsadi/Udacity-Data-Engineering-Projects | d12c42b3260379a470abd244f98a1fd5b32718f7 | [
"MIT"
] | null | null | null | Data-Lake/etl.py | naderAsadi/Udacity-Data-Engineering-Projects | d12c42b3260379a470abd244f98a1fd5b32718f7 | [
"MIT"
] | null | null | null | import configparser
from datetime import datetime
import os
from pyspark.sql import SparkSession
from pyspark.sql.functions import udf, col, monotonically_increasing_id
from pyspark.sql.functions import year, month, dayofmonth, hour, weekofyear, date_format, dayofweek
from pyspark.sql.types import *
config = configpa... | 40.609756 | 140 | 0.646847 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,765 | 0.353353 |
f137db4cbba929f8e984ccaf98ff3fbc2e3814b3 | 460 | py | Python | portafolio/core/migrations/0031_career_important_title.py | jhonfmg7/portafolioDjango | 64db6a371a84dcad4f22dd7cdeb598c7c2db124e | [
"Apache-2.0"
] | null | null | null | portafolio/core/migrations/0031_career_important_title.py | jhonfmg7/portafolioDjango | 64db6a371a84dcad4f22dd7cdeb598c7c2db124e | [
"Apache-2.0"
] | null | null | null | portafolio/core/migrations/0031_career_important_title.py | jhonfmg7/portafolioDjango | 64db6a371a84dcad4f22dd7cdeb598c7c2db124e | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.0.5 on 2020-08-26 20:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0030_remove_project_important_title'),
]
operations = [
migrations.AddField(
model_name='career',
name='impo... | 24.210526 | 108 | 0.636957 | 367 | 0.797826 | 0 | 0 | 0 | 0 | 0 | 0 | 134 | 0.291304 |