hexsha
stringlengths
40
40
size
int64
4
996k
ext
stringclasses
8 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
4
245
max_stars_repo_name
stringlengths
6
130
max_stars_repo_head_hexsha
stringlengths
40
40
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
4
245
max_issues_repo_name
stringlengths
6
130
max_issues_repo_head_hexsha
stringlengths
40
40
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
4
245
max_forks_repo_name
stringlengths
6
130
max_forks_repo_head_hexsha
stringlengths
40
40
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
4
996k
avg_line_length
float64
1.33
58.2k
max_line_length
int64
2
323k
alphanum_fraction
float64
0
0.97
content_no_comment
stringlengths
0
946k
is_comment_constant_removed
bool
2 classes
is_sharp_comment_removed
bool
1 class
790291306b8d75507d391fba9b580cfd2e30e82e
240
py
Python
scripts/field/rienArrow.py
G00dBye/YYMS
1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb
[ "MIT" ]
54
2019-04-16T23:24:48.000Z
2021-12-18T11:41:50.000Z
scripts/field/rienArrow.py
G00dBye/YYMS
1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb
[ "MIT" ]
3
2019-05-19T15:19:41.000Z
2020-04-27T16:29:16.000Z
scripts/field/rienArrow.py
G00dBye/YYMS
1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb
[ "MIT" ]
49
2020-11-25T23:29:16.000Z
2022-03-26T16:20:24.000Z
# Created by MechAviv # ID :: [140010000] # Snow Island : Dangerous Forest if not "o" in sm.getQuestEx(21019, "arr"): sm.avatarOriented("Effect/OnUserEff.img/guideEffect/aranTutorial/tutorialArrow3") sm.setQuestEx(21019, "arr", "o")
40
85
0.720833
if not "o" in sm.getQuestEx(21019, "arr"): sm.avatarOriented("Effect/OnUserEff.img/guideEffect/aranTutorial/tutorialArrow3") sm.setQuestEx(21019, "arr", "o")
true
true
790292a54e8eb8cdf5d33f844f48868af3da1b12
11,103
py
Python
plotly_study/graph_objs/streamtube/hoverlabel/__init__.py
lucasiscovici/plotly_py
42ab769febb45fbbe0a3c677dc4306a4f59cea36
[ "MIT" ]
null
null
null
plotly_study/graph_objs/streamtube/hoverlabel/__init__.py
lucasiscovici/plotly_py
42ab769febb45fbbe0a3c677dc4306a4f59cea36
[ "MIT" ]
null
null
null
plotly_study/graph_objs/streamtube/hoverlabel/__init__.py
lucasiscovici/plotly_py
42ab769febb45fbbe0a3c677dc4306a4f59cea36
[ "MIT" ]
null
null
null
from plotly_study.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Font(_BaseTraceHierarchyType): # color # ----- @property def color(self): """ The 'color' property is a color and may be specified as: - A hex string (e.g. '#f...
34.268519
88
0.565973
from plotly_study.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Font(_BaseTraceHierarchyType): @property def color(self): return self["color"] @color.setter def color(self, val): self["color"] = val @propert...
true
true
79029309861f73ab19d622b1122083230ef6e760
26,947
py
Python
gcp/__main__.py
cleveranjos/Rapid-ML-Gateway
10a14abfce3351791331642c47eddfbf622e76d2
[ "MIT" ]
3
2020-07-15T19:45:31.000Z
2020-09-30T16:15:48.000Z
gcp/__main__.py
cleveranjos/Rapid-ML-Gateway
10a14abfce3351791331642c47eddfbf622e76d2
[ "MIT" ]
12
2020-07-15T17:00:24.000Z
2021-01-19T21:02:00.000Z
gcp/__main__.py
cleveranjos/Rapid-ML-Gateway
10a14abfce3351791331642c47eddfbf622e76d2
[ "MIT" ]
2
2020-07-15T18:59:02.000Z
2020-10-07T17:22:52.000Z
#! /usr/bin/env python3 from ssedata import FunctionType from google.protobuf.json_format import MessageToDict import grpc import argparse import json import logging import logging.config import os import sys import inspect import time from websocket import create_connection import socket import re from concurrent imp...
42.977671
119
0.575426
from ssedata import FunctionType from google.protobuf.json_format import MessageToDict import grpc import argparse import json import logging import logging.config import os import sys import inspect import time from websocket import create_connection import socket import re from concurrent import futures from dateti...
false
true
7902933ebcd21869ec2d83ded7a2afc59a6a6bdf
1,015
py
Python
python/test/test_cinder_volume_source.py
adriangonz/seldon-deploy-sdk
c5504838630a87053387cec57ec2e1e7251971e2
[ "Apache-2.0" ]
6
2021-02-18T14:37:54.000Z
2022-01-13T13:27:43.000Z
python/test/test_cinder_volume_source.py
adriangonz/seldon-deploy-sdk
c5504838630a87053387cec57ec2e1e7251971e2
[ "Apache-2.0" ]
14
2021-01-04T16:32:03.000Z
2021-12-13T17:53:59.000Z
python/test/test_cinder_volume_source.py
adriangonz/seldon-deploy-sdk
c5504838630a87053387cec57ec2e1e7251971e2
[ "Apache-2.0" ]
7
2021-03-17T09:05:55.000Z
2022-01-05T10:39:56.000Z
# coding: utf-8 """ Seldon Deploy API API to interact and manage the lifecycle of your machine learning models deployed through Seldon Deploy. # noqa: E501 OpenAPI spec version: v1alpha1 Contact: hello@seldon.io Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future...
24.756098
122
0.730049
from __future__ import absolute_import import unittest import seldon_deploy_sdk from seldon_deploy_sdk.models.cinder_volume_source import CinderVolumeSource from seldon_deploy_sdk.rest import ApiException class TestCinderVolumeSource(unittest.TestCase): def setUp(self): pass def tearDown(sel...
true
true
790293705ac4f54c3e677fc215193201ae66a8c8
1,076
py
Python
02_commCustom/receiveCustomMavlinkMSG.py
dmdobrea/HoverGames_Challenge2
a7f2d7a5898a67e06720f7db78dc7afa47701537
[ "BSD-3-Clause" ]
3
2021-04-24T10:30:49.000Z
2021-12-04T04:58:06.000Z
02_commCustom/receiveCustomMavlinkMSG.py
dmdobrea/HoverGames_Challenge2
a7f2d7a5898a67e06720f7db78dc7afa47701537
[ "BSD-3-Clause" ]
null
null
null
02_commCustom/receiveCustomMavlinkMSG.py
dmdobrea/HoverGames_Challenge2
a7f2d7a5898a67e06720f7db78dc7afa47701537
[ "BSD-3-Clause" ]
1
2021-05-24T14:18:26.000Z
2021-05-24T14:18:26.000Z
from pymavlink import mavutil #import time mavutil.set_dialect("video_monitor") # create a connection to FMU hoverGames = mavutil.mavlink_connection("/dev/ttymxc2", baud=921600) # wait for the heartbeat message to find the system id hoverGames.wait_heartbeat() print("Heartbeat from system (system %u component %u...
30.742857
112
0.643123
from pymavlink import mavutil mavutil.set_dialect("video_monitor") hoverGames = mavutil.mavlink_connection("/dev/ttymxc2", baud=921600) hoverGames.wait_heartbeat() print("Heartbeat from system (system %u component %u)" %(hoverGames.target_system, hoverGames.target_component)) while (True) : msg = hoverGam...
true
true
79029440277e967106f528a1a3f24a2937e0ceee
27,758
py
Python
readthedocs/api/v3/serializers.py
mehrdad-khojastefar/readthedocs.org
b958bb8d04c454324d612345890b13af54a19eb6
[ "MIT" ]
2,092
2019-06-29T07:47:30.000Z
2022-03-31T14:54:59.000Z
readthedocs/api/v3/serializers.py
mehrdad-khojastefar/readthedocs.org
b958bb8d04c454324d612345890b13af54a19eb6
[ "MIT" ]
2,389
2019-06-29T04:22:55.000Z
2022-03-31T22:57:49.000Z
readthedocs/api/v3/serializers.py
mehrdad-khojastefar/readthedocs.org
b958bb8d04c454324d612345890b13af54a19eb6
[ "MIT" ]
1,185
2019-06-29T21:49:31.000Z
2022-03-30T09:57:15.000Z
import datetime import urllib from django.conf import settings from django.contrib.auth.models import User from django.urls import reverse from django.utils.translation import ugettext as _ from rest_flex_fields import FlexFieldsModelSerializer from rest_flex_fields.serializers import FlexFieldsSerializerMixin from re...
28.180711
89
0.595468
import datetime import urllib from django.conf import settings from django.contrib.auth.models import User from django.urls import reverse from django.utils.translation import ugettext as _ from rest_flex_fields import FlexFieldsModelSerializer from rest_flex_fields.serializers import FlexFieldsSerializerMixin from re...
true
true
7902958aba3b36b6c985cbc6b8b862ef5e83942c
9,239
py
Python
deepchembed/dce.py
hanghu/AutoChemCluster
2ab4ae996b300a90637b124707905201c89d74d8
[ "MIT" ]
2
2019-05-15T06:31:35.000Z
2019-08-31T13:13:21.000Z
deepchembed/dce.py
hanghu/AutoChemCluster
2ab4ae996b300a90637b124707905201c89d74d8
[ "MIT" ]
7
2019-05-02T19:01:40.000Z
2022-02-10T00:11:00.000Z
deepchembed/dce.py
hanghu/AutoChemCluster
2ab4ae996b300a90637b124707905201c89d74d8
[ "MIT" ]
1
2019-08-17T11:34:56.000Z
2019-08-17T11:34:56.000Z
""" DeepChEmbed (DCE) Models """ from dimreducer import DeepAutoEncoder from cluster import KMeansLayer from cluster import KMeans from keras import Model from keras import optimizers from keras.utils import normalize import numpy as np class DCE(): """ The class to build a deep chemical embedding model. ...
41.430493
79
0.573763
from dimreducer import DeepAutoEncoder from cluster import KMeansLayer from cluster import KMeans from keras import Model from keras import optimizers from keras.utils import normalize import numpy as np class DCE(): HARDENING_FUNCS = { 1: lambda x: x, 3: lambda x: (-2*x + 3) * x**2, 5: la...
true
true
790295940172654157a92646c0d15692f2074d43
439
py
Python
tests/bench/web_traffic_jobs/de.wikipedia.org/test_web_traffic_de.wikipedia.org_pyaf_default_clean.py
jmabry/pyaf
afbc15a851a2445a7824bf255af612dc429265af
[ "BSD-3-Clause" ]
377
2016-10-13T20:52:44.000Z
2022-03-29T18:04:14.000Z
tests/bench/web_traffic_jobs/de.wikipedia.org/test_web_traffic_de.wikipedia.org_pyaf_default_clean.py
jmabry/pyaf
afbc15a851a2445a7824bf255af612dc429265af
[ "BSD-3-Clause" ]
160
2016-10-13T16:11:53.000Z
2022-03-28T04:21:34.000Z
tests/bench/web_traffic_jobs/de.wikipedia.org/test_web_traffic_de.wikipedia.org_pyaf_default_clean.py
jmabry/pyaf
afbc15a851a2445a7824bf255af612dc429265af
[ "BSD-3-Clause" ]
63
2017-03-09T14:51:18.000Z
2022-03-27T20:52:57.000Z
import pyaf.Bench.web_traffic.Forecaster as fo PROJECTS = ['de.wikipedia.org'] data_dir = 'data/web-traffic-time-series-forecasting' lForecaster = fo.cProjectForecaster() lForecaster.mDataDirectory = data_dir lForecaster.mBackendName = 'pyaf_default_clean' lForecaster.mKeysFileName = 'key_1.csv.zip' last_date = '20...
27.4375
53
0.794989
import pyaf.Bench.web_traffic.Forecaster as fo PROJECTS = ['de.wikipedia.org'] data_dir = 'data/web-traffic-time-series-forecasting' lForecaster = fo.cProjectForecaster() lForecaster.mDataDirectory = data_dir lForecaster.mBackendName = 'pyaf_default_clean' lForecaster.mKeysFileName = 'key_1.csv.zip' last_date = '20...
true
true
7902965ea82d2a1661b5d7f36b1f090d6ec9ca44
2,089
py
Python
mars/tensor/fft/irfft2.py
haijohn/mars
672b3a33a70565f01b1a3f508908445491d85acf
[ "Apache-2.0" ]
1
2021-11-30T12:07:21.000Z
2021-11-30T12:07:21.000Z
mars/tensor/fft/irfft2.py
JeffroMF/mars
2805241ac55b50c4f6319baa41113fbf8c723832
[ "Apache-2.0" ]
null
null
null
mars/tensor/fft/irfft2.py
JeffroMF/mars
2805241ac55b50c4f6319baa41113fbf8c723832
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 1999-2020 Alibaba Group Holding Ltd. # # 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-...
30.720588
79
0.674485
import numpy as np from ... import opcodes as OperandDef from ..datasource import tensor as astensor from .core import TensorRealIFFTNMixin, validate_fftn, TensorRealFFTN class TensorIRFFT2(TensorRealFFTN, TensorRealIFFTNMixin): _op_type_ = OperandDef.IRFFT2 def __init__(self, shape=None, ax...
true
true
79029717b6e62cbc9fc8eac9d690a9a1a31aa5e4
760
py
Python
kube_hunter/modules/discovery/etcd.py
vipulgupta2048/kube-hunter
fe3dba90d8cc6f947846e6a099a2562e7c2f88b1
[ "Apache-2.0" ]
1
2021-09-13T21:52:52.000Z
2021-09-13T21:52:52.000Z
kube_hunter/modules/discovery/etcd.py
vipulgupta2048/kube-hunter
fe3dba90d8cc6f947846e6a099a2562e7c2f88b1
[ "Apache-2.0" ]
2
2021-05-20T20:17:17.000Z
2022-02-26T09:20:16.000Z
kube_hunter/modules/discovery/etcd.py
vipulgupta2048/kube-hunter
fe3dba90d8cc6f947846e6a099a2562e7c2f88b1
[ "Apache-2.0" ]
1
2020-07-29T07:50:10.000Z
2020-07-29T07:50:10.000Z
import json import logging import requests from kube_hunter.core.events import handler from kube_hunter.core.events.types import Event, OpenPortEvent, Service from kube_hunter.core.types import Discovery class EtcdAccessEvent(Service, Event): """Etcd is a DB that stores cluster's data, it contains configuration ...
28.148148
85
0.735526
import json import logging import requests from kube_hunter.core.events import handler from kube_hunter.core.events.types import Event, OpenPortEvent, Service from kube_hunter.core.types import Discovery class EtcdAccessEvent(Service, Event): def __init__(self): Service.__init__(self, name="Etcd") @han...
true
true
79029782dda1542723bf7287a0f87d6c1c34669f
9,788
py
Python
result_buffer.py
zivaharoni/capacity-rl
20ed628b3bc9f3b08996f289e7855121f3addf71
[ "MIT" ]
2
2020-01-11T23:24:23.000Z
2020-12-26T10:01:38.000Z
result_buffer.py
zivaharoni/capacity-rl
20ed628b3bc9f3b08996f289e7855121f3addf71
[ "MIT" ]
null
null
null
result_buffer.py
zivaharoni/capacity-rl
20ed628b3bc9f3b08996f289e7855121f3addf71
[ "MIT" ]
1
2020-03-11T00:49:26.000Z
2020-03-11T00:49:26.000Z
import numpy as np import matplotlib.pyplot as plt import time import csv import os import scipy.io as mat4py import logging logger = logging.getLogger("logger") class ResultBuffer(object): def __init__(self, log_path, episode_types): self.log_path = log_path self.current_episode = None s...
41.651064
135
0.581324
import numpy as np import matplotlib.pyplot as plt import time import csv import os import scipy.io as mat4py import logging logger = logging.getLogger("logger") class ResultBuffer(object): def __init__(self, log_path, episode_types): self.log_path = log_path self.current_episode = None s...
true
true
79029937c25c32d020ea3a39f31a4367f930a97b
4,974
py
Python
src/cryptography/hazmat/primitives/hashes.py
neheb/cryptography
d37346651bc4b9ebc0b8c7cfdc7c1f21de6a751d
[ "PSF-2.0", "Apache-2.0", "BSD-3-Clause" ]
null
null
null
src/cryptography/hazmat/primitives/hashes.py
neheb/cryptography
d37346651bc4b9ebc0b8c7cfdc7c1f21de6a751d
[ "PSF-2.0", "Apache-2.0", "BSD-3-Clause" ]
null
null
null
src/cryptography/hazmat/primitives/hashes.py
neheb/cryptography
d37346651bc4b9ebc0b8c7cfdc7c1f21de6a751d
[ "PSF-2.0", "Apache-2.0", "BSD-3-Clause" ]
null
null
null
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import abc import six from cryptography import utils from cryptography....
24.87
79
0.649377
from __future__ import absolute_import, division, print_function import abc import six from cryptography import utils from cryptography.exceptions import ( AlreadyFinalized, UnsupportedAlgorithm, _Reasons ) from cryptography.hazmat.backends.interfaces import HashBackend @six.add_metaclass(abc.ABCMeta) clas...
true
true
790299fc930a9d73c1c99e78c1948a94c9b4200c
4,358
py
Python
pybfcontrol/bf_button.py
zhangenter/bf_control
c613c138ffc08ac7a52b71469da445ddf066ce21
[ "MIT" ]
1
2019-05-08T14:48:28.000Z
2019-05-08T14:48:28.000Z
pybfcontrol/bf_button.py
zhangenter/bf_control
c613c138ffc08ac7a52b71469da445ddf066ce21
[ "MIT" ]
null
null
null
pybfcontrol/bf_button.py
zhangenter/bf_control
c613c138ffc08ac7a52b71469da445ddf066ce21
[ "MIT" ]
null
null
null
# -*- coding=utf-8 -*- import pygame from pygame.locals import MOUSEBUTTONDOWN from pybfcontrol.bf_common import BFControlId,BFBase, TEXT_ALIGN_LEFT,TEXT_ALIGN_MIDDLE CLICK_EFFECT_TIME = 100 PADING = 4 class BFButton(BFBase): def __init__(self, parent, rect, text='Button', click=None): super(BFButton, self...
35.430894
137
0.583983
import pygame from pygame.locals import MOUSEBUTTONDOWN from pybfcontrol.bf_common import BFControlId,BFBase, TEXT_ALIGN_LEFT,TEXT_ALIGN_MIDDLE CLICK_EFFECT_TIME = 100 PADING = 4 class BFButton(BFBase): def __init__(self, parent, rect, text='Button', click=None): super(BFButton, self).__init__() s...
true
true
79029aad41b74cee129095b7c6bd80267aad3968
3,980
py
Python
ckworker/ckworker/ckcore.py
mesosphere/cloudkeeper
11be262df5874c1033cfec9964bba1596cab6a36
[ "Apache-2.0" ]
99
2020-04-15T22:56:34.000Z
2021-06-13T15:04:55.000Z
ckworker/ckworker/ckcore.py
mesosphere/cloudkeeper
11be262df5874c1033cfec9964bba1596cab6a36
[ "Apache-2.0" ]
null
null
null
ckworker/ckworker/ckcore.py
mesosphere/cloudkeeper
11be262df5874c1033cfec9964bba1596cab6a36
[ "Apache-2.0" ]
14
2020-04-14T22:13:59.000Z
2021-04-05T16:42:31.000Z
import json import requests from cklib.args import ArgumentParser from cklib.logging import log from cklib.jwt import encode_jwt_to_headers from cklib.graph import Graph, GraphExportIterator def send_to_ckcore(graph: Graph): if not ArgumentParser.args.ckcore_uri: return log.info("ckcore Event Handler...
32.096774
82
0.654271
import json import requests from cklib.args import ArgumentParser from cklib.logging import log from cklib.jwt import encode_jwt_to_headers from cklib.graph import Graph, GraphExportIterator def send_to_ckcore(graph: Graph): if not ArgumentParser.args.ckcore_uri: return log.info("ckcore Event Handler...
true
true
79029cccf9d9b1413e725636648df9be72c5d213
1,104
py
Python
exercises/search_in_sorted_matrix.py
edoriggio/algorithms-and-data-structures
d6f3ac520bb3021400bf47770de692ab0c305b75
[ "Apache-2.0" ]
null
null
null
exercises/search_in_sorted_matrix.py
edoriggio/algorithms-and-data-structures
d6f3ac520bb3021400bf47770de692ab0c305b75
[ "Apache-2.0" ]
null
null
null
exercises/search_in_sorted_matrix.py
edoriggio/algorithms-and-data-structures
d6f3ac520bb3021400bf47770de692ab0c305b75
[ "Apache-2.0" ]
null
null
null
# Copyright 2021 Edoardo Riggio # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
24.533333
74
0.629529
def search_in_sorted_matrix(A, x): for S in A: if binary_search(S, x): return True return False def binary_search(A, x): low = 0 high = len(A) - 1 mid = 0 while low <= high: mid = (high + low) // 2 if A[mid] < x: low = mid + 1 ...
true
true
79029d8b354aeee37cb6869d810b9e3f9aa557ab
1,137
py
Python
src/pyhees/section10_j1_f.py
jjj-design/pyhees
d63e7cd84abfc2f509bc1cd1256598a10aac1825
[ "MIT" ]
null
null
null
src/pyhees/section10_j1_f.py
jjj-design/pyhees
d63e7cd84abfc2f509bc1cd1256598a10aac1825
[ "MIT" ]
null
null
null
src/pyhees/section10_j1_f.py
jjj-design/pyhees
d63e7cd84abfc2f509bc1cd1256598a10aac1825
[ "MIT" ]
null
null
null
# 電子レンジ def get_E_Elc_microwave_d_t(P_Elc_microwave_cook_rtd, t_microwave_cook_d_t): """時刻別消費電力量を計算する Parameters ---------- P_Elc_microwave_cook_rtd : float 調理時の定格待機電力, W t_microwave_cook_d_t : ndarray(N-dimensional array) 1年間の全時間の調理時間を格納したND配列, h d日t時の調理時間が年開始...
22.74
77
0.664908
def get_E_Elc_microwave_d_t(P_Elc_microwave_cook_rtd, t_microwave_cook_d_t): P_Elc_microwave_cook = get_P_Elc_microwave_cook(P_Elc_microwave_cook_rtd) E_Elc_microwave_d_t = P_Elc_microwave_cook * t_microwave_cook_d_t E_Elc_microwave_d_t = E_Elc_microwave_d_t * 10**(-3) return E_Elc_micr...
true
true
79029da5f558df950350ea69fc65ee408f050a19
5,388
py
Python
test2.py
pection/Interactionstudent
74291812d3a5455c805b7ccc2d76dad28e6db77f
[ "MIT" ]
null
null
null
test2.py
pection/Interactionstudent
74291812d3a5455c805b7ccc2d76dad28e6db77f
[ "MIT" ]
null
null
null
test2.py
pection/Interactionstudent
74291812d3a5455c805b7ccc2d76dad28e6db77f
[ "MIT" ]
1
2020-11-24T18:19:02.000Z
2020-11-24T18:19:02.000Z
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'mikeeiei.ui' # # Created by: PyQt4 UI code generator 4.11.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _...
45.661017
111
0.68467
from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fromUtf8(s): return s try: _encoding = QtGui.QApplication.UnicodeUTF8 def _translate(context, text, disambig): return QtGui.QApplication.translate(context, text, di...
true
true
79029dc59c4fb6e36d99fd737bcfda2ff361918c
5,173
py
Python
kitsune/questions/urls.py
safwanrahman/Ford
87e91dea1cc22b1759eea81cef069359ccb5cd0b
[ "BSD-3-Clause" ]
1
2020-11-03T23:46:56.000Z
2020-11-03T23:46:56.000Z
kitsune/questions/urls.py
983834572/kitsune
d4b3dcdce3294214dbc659c375c8491504473213
[ "BSD-3-Clause" ]
8
2020-06-05T18:42:14.000Z
2022-03-11T23:26:51.000Z
kitsune/questions/urls.py
safwanrahman/Ford
87e91dea1cc22b1759eea81cef069359ccb5cd0b
[ "BSD-3-Clause" ]
1
2020-11-03T23:47:55.000Z
2020-11-03T23:47:55.000Z
from django.conf.urls import patterns, url from django.contrib.contenttypes.models import ContentType from kitsune.questions.feeds import ( QuestionsFeed, AnswersFeed, TaggedQuestionsFeed) from kitsune.questions.models import Question, Answer from kitsune.flagit import views as flagit_views urlpatterns = pattern...
45.778761
78
0.626329
from django.conf.urls import patterns, url from django.contrib.contenttypes.models import ContentType from kitsune.questions.feeds import ( QuestionsFeed, AnswersFeed, TaggedQuestionsFeed) from kitsune.questions.models import Question, Answer from kitsune.flagit import views as flagit_views urlpatterns = pattern...
true
true
79029f0a422fecf611aa560616e8b9231a7b35ad
2,930
py
Python
aps/load_region.py
kmunve/APS
4c2f254ede83a3a311cbedc90c76db9ee367a000
[ "MIT" ]
null
null
null
aps/load_region.py
kmunve/APS
4c2f254ede83a3a311cbedc90c76db9ee367a000
[ "MIT" ]
1
2018-12-14T14:47:13.000Z
2018-12-14T14:47:13.000Z
aps/load_region.py
kmunve/APS
4c2f254ede83a3a311cbedc90c76db9ee367a000
[ "MIT" ]
null
null
null
import os import numpy as np from netCDF4 import Dataset def load_region(region_id, local=False, return_regions=False): if local: _vr = Dataset( os.path.join(os.path.dirname(os.path.abspath(__file__)), r"data/terrain_parameters/VarslingsOmr_2017.nc"), "r") # flip up-down b...
43.731343
124
0.669283
import os import numpy as np from netCDF4 import Dataset def load_region(region_id, local=False, return_regions=False): if local: _vr = Dataset( os.path.join(os.path.dirname(os.path.abspath(__file__)), r"data/terrain_parameters/VarslingsOmr_2017.nc"), "r") ...
true
true
79029f33ffec745e921a3a7d539c19e44a1bf04d
371
py
Python
pypy/module/clr/test/test_interp_clr.py
camillobruni/pygirl
ddbd442d53061d6ff4af831c1eab153bcc771b5a
[ "MIT" ]
12
2016-01-06T07:10:28.000Z
2021-05-13T23:02:02.000Z
pypy/module/clr/test/test_interp_clr.py
woodrow/pyoac
b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7
[ "MIT" ]
null
null
null
pypy/module/clr/test/test_interp_clr.py
woodrow/pyoac
b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7
[ "MIT" ]
2
2020-07-09T08:14:22.000Z
2021-01-15T18:01:25.000Z
from pypy.module.clr.interp_clr import split_fullname def test_split_fullname(): split = split_fullname assert split('Foo') == ('', 'Foo') assert split('System.Foo') == ('System', 'Foo') assert split('System.Foo.Bar') == ('System.Foo', 'Bar') assert split('System.Foo.A+B') == ('System.Foo', 'A+B') ...
33.727273
59
0.606469
from pypy.module.clr.interp_clr import split_fullname def test_split_fullname(): split = split_fullname assert split('Foo') == ('', 'Foo') assert split('System.Foo') == ('System', 'Foo') assert split('System.Foo.Bar') == ('System.Foo', 'Bar') assert split('System.Foo.A+B') == ('System.Foo', 'A+B') ...
true
true
79029f3ce26757d6d43f6b0a0b2f72cfa70aac96
1,563
py
Python
model.py
Wowol/Piano-Bot
feab884daa4bbe947bf6d95d816664eb7e46cc48
[ "MIT" ]
null
null
null
model.py
Wowol/Piano-Bot
feab884daa4bbe947bf6d95d816664eb7e46cc48
[ "MIT" ]
null
null
null
model.py
Wowol/Piano-Bot
feab884daa4bbe947bf6d95d816664eb7e46cc48
[ "MIT" ]
null
null
null
from tensorflow.keras.callbacks import LambdaCallback from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, Activation, LSTM from tensorflow.keras.layers import Dropout, TimeDistributed try: from tensorflow.python.keras.layers import CuDNNLSTM as lstm except: from tensorflow....
34.733333
78
0.706974
from tensorflow.keras.callbacks import LambdaCallback from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, Activation, LSTM from tensorflow.keras.layers import Dropout, TimeDistributed try: from tensorflow.python.keras.layers import CuDNNLSTM as lstm except: from tensorflow....
true
true
7902a09eee3aed46a7e4e13f9c77ea9c24f3415b
1,035
py
Python
kubernetes/test/test_apps_v1beta1_deployment_list.py
dix000p/kubernetes-client-python
22e473e02883aca1058606092c86311f02f42be2
[ "Apache-2.0" ]
null
null
null
kubernetes/test/test_apps_v1beta1_deployment_list.py
dix000p/kubernetes-client-python
22e473e02883aca1058606092c86311f02f42be2
[ "Apache-2.0" ]
null
null
null
kubernetes/test/test_apps_v1beta1_deployment_list.py
dix000p/kubernetes-client-python
22e473e02883aca1058606092c86311f02f42be2
[ "Apache-2.0" ]
null
null
null
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.8.1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys im...
23
105
0.729469
from __future__ import absolute_import import os import sys import unittest import kubernetes.client from kubernetes.client.rest import ApiException from kubernetes.client.models.apps_v1beta1_deployment_list import AppsV1beta1DeploymentList class TestAppsV1beta1DeploymentList(unittest.TestCase): def setUp(...
true
true
7902a1a3df2ef642b65640c1f453148653983baf
2,699
py
Python
scripts/count_singletons.py
tomarovsky/MACE
eccc050820f4bb9e483d2592e485ee372ac9453b
[ "Apache-2.0" ]
null
null
null
scripts/count_singletons.py
tomarovsky/MACE
eccc050820f4bb9e483d2592e485ee372ac9453b
[ "Apache-2.0" ]
null
null
null
scripts/count_singletons.py
tomarovsky/MACE
eccc050820f4bb9e483d2592e485ee372ac9453b
[ "Apache-2.0" ]
8
2018-05-17T05:00:11.000Z
2022-03-06T04:08:24.000Z
#!/usr/bin/env python __author__ = 'Sergei F. Kliver' import argparse from RouToolPa.Parsers.VCF import CollectionVCF from MACE.Routines import StatsVCF, Visualization parser = argparse.ArgumentParser() parser.add_argument("-i", "--input_file", action="store", dest="input", required=True, help="In...
51.903846
110
0.593183
__author__ = 'Sergei F. Kliver' import argparse from RouToolPa.Parsers.VCF import CollectionVCF from MACE.Routines import StatsVCF, Visualization parser = argparse.ArgumentParser() parser.add_argument("-i", "--input_file", action="store", dest="input", required=True, help="Input vcf file with mut...
true
true
7902a2557d81bc45729dfd2a009cdcd04d41f097
1,043
py
Python
tools/mo/openvino/tools/mo/ops/prelu.py
ryanloney/openvino-1
4e0a740eb3ee31062ba0df88fcf438564f67edb7
[ "Apache-2.0" ]
1,127
2018-10-15T14:36:58.000Z
2020-04-20T09:29:44.000Z
tools/mo/openvino/tools/mo/ops/prelu.py
ryanloney/openvino-1
4e0a740eb3ee31062ba0df88fcf438564f67edb7
[ "Apache-2.0" ]
439
2018-10-20T04:40:35.000Z
2020-04-19T05:56:25.000Z
tools/mo/openvino/tools/mo/ops/prelu.py
ryanloney/openvino-1
4e0a740eb3ee31062ba0df88fcf438564f67edb7
[ "Apache-2.0" ]
414
2018-10-17T05:53:46.000Z
2020-04-16T17:29:53.000Z
# Copyright (C) 2018-2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import numpy as np from openvino.tools.mo.front.common.partial_infer.elemental import copy_shape_infer from openvino.tools.mo.graph.graph import Graph from openvino.tools.mo.ops.op import Op class PReLU(Op): op = 'PReLU' enabl...
26.075
83
0.57814
import numpy as np from openvino.tools.mo.front.common.partial_infer.elemental import copy_shape_infer from openvino.tools.mo.graph.graph import Graph from openvino.tools.mo.ops.op import Op class PReLU(Op): op = 'PReLU' enabled = True def __init__(self, graph: Graph, attrs: dict): super().__...
true
true
7902a3074e04f09cd07230c3c7b161c70f5e4cab
984
py
Python
var/spack/repos/builtin/packages/py-decorator/package.py
adrianjhpc/spack
0a9e4fcee57911f2db586aa50c8873d9cca8de92
[ "ECL-2.0", "Apache-2.0", "MIT" ]
2
2020-10-15T01:08:42.000Z
2021-10-18T01:28:18.000Z
var/spack/repos/builtin/packages/py-decorator/package.py
adrianjhpc/spack
0a9e4fcee57911f2db586aa50c8873d9cca8de92
[ "ECL-2.0", "Apache-2.0", "MIT" ]
2
2019-07-30T10:12:28.000Z
2019-12-17T09:02:27.000Z
var/spack/repos/builtin/packages/py-decorator/package.py
adrianjhpc/spack
0a9e4fcee57911f2db586aa50c8873d9cca8de92
[ "ECL-2.0", "Apache-2.0", "MIT" ]
5
2019-07-30T09:42:14.000Z
2021-01-25T05:39:20.000Z
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyDecorator(PythonPackage): """The aim of the decorator module it to simplify the usage of...
42.782609
95
0.748984
from spack import * class PyDecorator(PythonPackage): homepage = "https://github.com/micheles/decorator" url = "https://pypi.io/packages/source/d/decorator/decorator-4.4.0.tar.gz" version('4.4.0', sha256='86156361c50488b84a3f148056ea716ca587df2f0de1d34750d35c21312725de') version('4.3.0', s...
true
true
7902a35c8e4c8d64bcf9903324f8fd93964ef60b
3,015
py
Python
firebase/firestore-py/lib/faculty/logic.py
BraydenKO/RamLife
10c9bbb7338fbaf6c3d1c98bb2f559e6cc089ee6
[ "MIT" ]
2
2021-04-12T03:09:40.000Z
2021-05-22T04:05:54.000Z
firebase/firestore-py/lib/faculty/logic.py
BraydenKO/RamLife
10c9bbb7338fbaf6c3d1c98bb2f559e6cc089ee6
[ "MIT" ]
58
2020-03-10T18:48:52.000Z
2021-08-31T23:19:09.000Z
firebase/firestore-py/lib/faculty/logic.py
BraydenKO/RamLife
10c9bbb7338fbaf6c3d1c98bb2f559e6cc089ee6
[ "MIT" ]
8
2020-09-08T18:29:54.000Z
2021-04-20T23:11:50.000Z
from collections import defaultdict from typing import DefaultDict from .. import utils from .. import data ''' A collection of functions o index faculty data. No function in this class reads data from the data files, just works logic on them. This helps keep the program modular, by separating the data sources from t...
27.916667
76
0.733002
from collections import defaultdict from typing import DefaultDict from .. import utils from .. import data def get_faculty_sections(faculty,section_teachers): result = defaultdict(set) missing_emails = set() for key, value in section_teachers.items(): section_id = key faculty_id = value if f...
true
true
7902a4319036067d24b6513ad2ff3935b6cfcbf7
1,305
py
Python
integration/single/test_basic_state_machine.py
will-driven/serverless-application-model
5e2e61bc459da259cb3f9256ee6fe33ec28d5591
[ "Apache-2.0" ]
1
2021-02-15T15:05:06.000Z
2021-02-15T15:05:06.000Z
integration/single/test_basic_state_machine.py
will-driven/serverless-application-model
5e2e61bc459da259cb3f9256ee6fe33ec28d5591
[ "Apache-2.0" ]
null
null
null
integration/single/test_basic_state_machine.py
will-driven/serverless-application-model
5e2e61bc459da259cb3f9256ee6fe33ec28d5591
[ "Apache-2.0" ]
null
null
null
from integration.helpers.base_test import BaseTest class TestBasicLayerVersion(BaseTest): """ Basic AWS::Serverless::StateMachine tests """ def test_basic_state_machine_inline_definition(self): """ Creates a State Machine from inline definition """ self.create_and_veri...
29.659091
77
0.629885
from integration.helpers.base_test import BaseTest class TestBasicLayerVersion(BaseTest): def test_basic_state_machine_inline_definition(self): self.create_and_verify_stack("basic_state_machine_inline_definition") def test_basic_state_machine_with_tags(self): self.create_and_verify_stack("ba...
true
true
7902a5206d6375bfc1bb4ff1fe6f7a3f5a713972
115
py
Python
ccc/2017/ccc17j2.py
pi-guy-in-the-sky/competitive-programming
e079f6caf07b5de061ea4f56218f9b577e49a965
[ "MIT" ]
null
null
null
ccc/2017/ccc17j2.py
pi-guy-in-the-sky/competitive-programming
e079f6caf07b5de061ea4f56218f9b577e49a965
[ "MIT" ]
null
null
null
ccc/2017/ccc17j2.py
pi-guy-in-the-sky/competitive-programming
e079f6caf07b5de061ea4f56218f9b577e49a965
[ "MIT" ]
1
2020-10-25T05:46:57.000Z
2020-10-25T05:46:57.000Z
n = int(input()) k = int(input()) total = n for i in range(k): total += int(str(n) + ('0' * (i+1))) print(total)
16.428571
38
0.530435
n = int(input()) k = int(input()) total = n for i in range(k): total += int(str(n) + ('0' * (i+1))) print(total)
true
true
7902a62871e19bdb7d09da3d9697a5c59621294d
30,717
py
Python
aries_cloudagent/protocols/coordinate_mediation/v1_0/tests/test_routes.py
TimoGlastra/aries-cloudagent-python
21a36ed8106426fd80f889abac4cef2a376e1cc3
[ "Apache-2.0" ]
null
null
null
aries_cloudagent/protocols/coordinate_mediation/v1_0/tests/test_routes.py
TimoGlastra/aries-cloudagent-python
21a36ed8106426fd80f889abac4cef2a376e1cc3
[ "Apache-2.0" ]
22
2021-02-13T18:48:53.000Z
2021-04-27T07:29:50.000Z
aries_cloudagent/protocols/coordinate_mediation/v1_0/tests/test_routes.py
sklump/aries-cloudagent-python
d3895f6394a5f24a895731bcf6fb672e0d84804e
[ "Apache-2.0" ]
2
2021-02-19T17:53:37.000Z
2021-02-19T17:56:48.000Z
import json import asynctest from asynctest import TestCase as AsyncTestCase from asynctest import mock as async_mock from aries_cloudagent.config.injection_context import InjectionContext from aries_cloudagent.messaging.request_context import RequestContext from .....admin.request_context import AdminRequestContext...
43.385593
88
0.648078
import json import asynctest from asynctest import TestCase as AsyncTestCase from asynctest import mock as async_mock from aries_cloudagent.config.injection_context import InjectionContext from aries_cloudagent.messaging.request_context import RequestContext from .....admin.request_context import AdminRequestContext...
true
true
7902a683656203949c1d46f98d8fbe04a39cc4e9
298
py
Python
django_budget/budget/migrations/0005_delete_vehiclelog.py
MadeleenRoestorff/django_budget
3e13d96b9e3468ec1e3d059373899691d81bebaa
[ "MIT" ]
null
null
null
django_budget/budget/migrations/0005_delete_vehiclelog.py
MadeleenRoestorff/django_budget
3e13d96b9e3468ec1e3d059373899691d81bebaa
[ "MIT" ]
1
2021-12-01T10:51:08.000Z
2021-12-01T13:40:07.000Z
django_budget/budget/migrations/0005_delete_vehiclelog.py
MadeleenRoestorff/django_budget
3e13d96b9e3468ec1e3d059373899691d81bebaa
[ "MIT" ]
null
null
null
# Generated by Django 3.2.8 on 2021-11-29 09:01 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('budget', '0004_auto_20211125_1330'), ] operations = [ migrations.DeleteModel( name='VehicleLog', ), ]
17.529412
47
0.607383
from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('budget', '0004_auto_20211125_1330'), ] operations = [ migrations.DeleteModel( name='VehicleLog', ), ]
true
true
7902a6b01d177e8dc60a18f379430c98d05385f0
119
py
Python
grtoolkit/Mechanics/Friction/__init__.py
ZenosParadox/grtoolkit
2e34f151a78f57864e39e572c221ca4b73e48bb7
[ "MIT" ]
3
2020-02-02T14:33:30.000Z
2020-07-29T00:27:46.000Z
grtoolkit/Mechanics/Friction/__init__.py
ZenosParadox/grtoolkit
2e34f151a78f57864e39e572c221ca4b73e48bb7
[ "MIT" ]
null
null
null
grtoolkit/Mechanics/Friction/__init__.py
ZenosParadox/grtoolkit
2e34f151a78f57864e39e572c221ca4b73e48bb7
[ "MIT" ]
2
2020-02-02T14:33:32.000Z
2022-03-21T14:33:34.000Z
def Coeff_Static_Friction(Mat_on_Mat): # Read from CSV pass def Coeff_Kinetic_Friction(Mat_on_Mat): pass
14.875
39
0.739496
def Coeff_Static_Friction(Mat_on_Mat): pass def Coeff_Kinetic_Friction(Mat_on_Mat): pass
true
true
7902a6dd62affb36e1ade2107471d9c6f3fb1c73
1,217
py
Python
src/ML_Algorithms/ExpectationMaximization/m_step_gaussian_mixture.py
leonardbj/AIMS
7f8f484ab829f15366cb04ab37f799ad88edd29a
[ "MIT" ]
null
null
null
src/ML_Algorithms/ExpectationMaximization/m_step_gaussian_mixture.py
leonardbj/AIMS
7f8f484ab829f15366cb04ab37f799ad88edd29a
[ "MIT" ]
null
null
null
src/ML_Algorithms/ExpectationMaximization/m_step_gaussian_mixture.py
leonardbj/AIMS
7f8f484ab829f15366cb04ab37f799ad88edd29a
[ "MIT" ]
null
null
null
""" converted from Matlab code source: http://www.robots.ox.ac.uk/~fwood/teaching/AIMS_CDT_ML_2015/homework/HW_2_em/ """ import numpy as np def m_step_gaussian_mixture(data, gamma): """% Performs the M-step of the EM algorithm for gaussain mixture model. % % @param data : n x d matrix with rows as d dim...
29.682927
99
0.555464
import numpy as np def m_step_gaussian_mixture(data, gamma): n = np.shape(data)[0] d = np.shape(data)[1] k = np.shape(gamma)[1] pi = np.zeros(k) mu = np.zeros((k, d)) sigma = np.zeros((k, d, d)) for kk in range(k): Nkk = np.sum(gamma[:, kk]) pi[kk] = Nkk / n ...
true
true
7902a7a41dcbe980541fa794f0964f38a7f3a7e0
433
py
Python
scripts/what_web_fetch_cpes.py
Wolodija/aucote
bb21ff02965ed0cca5a55ee559eae77856d9866c
[ "Apache-2.0" ]
1
2019-12-05T11:17:18.000Z
2019-12-05T11:17:18.000Z
scripts/what_web_fetch_cpes.py
FCG-LLC/aucote
bb21ff02965ed0cca5a55ee559eae77856d9866c
[ "Apache-2.0" ]
13
2019-12-05T10:34:41.000Z
2019-12-05T10:49:27.000Z
scripts/what_web_fetch_cpes.py
Wolodija/aucote
bb21ff02965ed0cca5a55ee559eae77856d9866c
[ "Apache-2.0" ]
4
2019-11-09T17:37:07.000Z
2019-12-16T09:50:02.000Z
from sys import argv from requests import get import re app_name = argv[1] result = get('https://nvd.nist.gov/view/vuln/search-results?query={0}'.format(app_name)) cves = re.findall(r"CVE-\d{4}-\d+", result.text) for cve in reversed(cves): result = get('https://nvd.nist.gov/vuln/detail/' + cve) cpes = re.fin...
27.0625
88
0.642032
from sys import argv from requests import get import re app_name = argv[1] result = get('https://nvd.nist.gov/view/vuln/search-results?query={0}'.format(app_name)) cves = re.findall(r"CVE-\d{4}-\d+", result.text) for cve in reversed(cves): result = get('https://nvd.nist.gov/vuln/detail/' + cve) cpes = re.fin...
true
true
7902a7f18b40495ac61fcbbfc7b7ac409ac842d0
862
py
Python
Smiley_face.py
ShashankShenoy21/Matlab-and-Python
148fe060dcbc73f75ac9fcd8bef9f31f82b15e67
[ "MIT" ]
null
null
null
Smiley_face.py
ShashankShenoy21/Matlab-and-Python
148fe060dcbc73f75ac9fcd8bef9f31f82b15e67
[ "MIT" ]
null
null
null
Smiley_face.py
ShashankShenoy21/Matlab-and-Python
148fe060dcbc73f75ac9fcd8bef9f31f82b15e67
[ "MIT" ]
null
null
null
# Python program to draw smile # face emoji using turtle import turtle # turtle object pen = turtle.Turtle() # function for creation of eye def eye(col, rad): pen.down() pen.fillcolor(col) pen.begin_fill() pen.circle(rad) pen.end_fill() pen.up() # draw face pen.fillcolo...
15.672727
31
0.616009
import turtle pen = turtle.Turtle() def eye(col, rad): pen.down() pen.fillcolor(col) pen.begin_fill() pen.circle(rad) pen.end_fill() pen.up() pen.fillcolor('yellow') pen.begin_fill() pen.circle(100) pen.end_fill() pen.up() pen.goto(-40, 120) eye('white', 15) ...
true
true
7902a815a49d93ab7dd1653dd1e5281ec186e3a0
3,017
py
Python
bob/devtools/scripts/update_bob.py
bioidiap/bob.devtools
98ec996056a1e11d6d9c91b619441610fbf60bbe
[ "BSD-3-Clause" ]
null
null
null
bob/devtools/scripts/update_bob.py
bioidiap/bob.devtools
98ec996056a1e11d6d9c91b619441610fbf60bbe
[ "BSD-3-Clause" ]
null
null
null
bob/devtools/scripts/update_bob.py
bioidiap/bob.devtools
98ec996056a1e11d6d9c91b619441610fbf60bbe
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/env python import click from ..log import get_logger, verbosity_option from . import bdt logger = get_logger(__name__) @click.command( epilog="""\b Examples: bdt gitlab update-bob -vv bdt gitlab update-bob -vv --stable """ ) @click.option( "--stable/--beta", help="To use the stable ...
27.427273
75
0.603911
import click from ..log import get_logger, verbosity_option from . import bdt logger = get_logger(__name__) @click.command( epilog="""\b Examples: bdt gitlab update-bob -vv bdt gitlab update-bob -vv --stable """ ) @click.option( "--stable/--beta", help="To use the stable versions in the list ...
true
true
7902a87bd46b24158775ae80473a412640509329
1,145
py
Python
apps/bloguser/pipline.py
dryprojects/MyBlog
ec04ba2bc658e96cddeb1d4766047ca8e89ff656
[ "BSD-3-Clause" ]
2
2021-08-17T13:29:21.000Z
2021-09-04T05:00:01.000Z
apps/bloguser/pipline.py
dryprojects/MyBlog
ec04ba2bc658e96cddeb1d4766047ca8e89ff656
[ "BSD-3-Clause" ]
1
2020-07-16T11:22:32.000Z
2020-07-16T11:22:32.000Z
apps/bloguser/pipline.py
dryprojects/MyBlog
ec04ba2bc658e96cddeb1d4766047ca8e89ff656
[ "BSD-3-Clause" ]
1
2020-09-18T10:41:59.000Z
2020-09-18T10:41:59.000Z
#!usr/bin/env python #-*- coding:utf-8 -*- """ @author: nico @file: pipline.py @time: 2018/05/05 """ from django.contrib.auth import get_user_model from bloguser.utils import get_image_from_url from uuid import uuid4 User = get_user_model() def save_bloguser_extra_profile(backend, user, resp...
25.444444
97
0.628821
from django.contrib.auth import get_user_model from bloguser.utils import get_image_from_url from uuid import uuid4 User = get_user_model() def save_bloguser_extra_profile(backend, user, response, *args, **kwargs): if backend.name == 'github': image_url = response.get('avatar_url') ...
true
true
7902a8889fddace3453a6e6fa5254c23f82a4adf
8,097
py
Python
trainCNN.py
linrio/WhetherOrNotMe
239a6d3be82fecb58eb3ade4cf2966d5d294ce10
[ "Apache-2.0" ]
null
null
null
trainCNN.py
linrio/WhetherOrNotMe
239a6d3be82fecb58eb3ade4cf2966d5d294ce10
[ "Apache-2.0" ]
null
null
null
trainCNN.py
linrio/WhetherOrNotMe
239a6d3be82fecb58eb3ade4cf2966d5d294ce10
[ "Apache-2.0" ]
null
null
null
import tensorflow as tf import cv2 import numpy as np import os from sklearn.model_selection import train_test_split import random import sys my_image_path = 'my_face' others_image_path = 'other_people' image_data = [] label_data = [] def get_padding_size(image): #def get_padding_size(image): h, ...
40.283582
156
0.632827
import tensorflow as tf import cv2 import numpy as np import os from sklearn.model_selection import train_test_split import random import sys my_image_path = 'my_face' others_image_path = 'other_people' image_data = [] label_data = [] def get_padding_size(image): h, w, _ = image.shape long...
true
true
7902a898bae3d0ee8b6a07c5b49fd1be50de7cc3
9,992
py
Python
exp/exp002/trainner.py
fkubota/kaggle-Rainforest-Connection-Species-Audio-Detection
7134edff0ba1c60f597b64a0efd953b7707b98e1
[ "MIT" ]
1
2021-02-24T03:25:51.000Z
2021-02-24T03:25:51.000Z
exp/exp003/trainner.py
fkubota/kaggle-Rainforest-Connection-Species-Audio-Detection
7134edff0ba1c60f597b64a0efd953b7707b98e1
[ "MIT" ]
null
null
null
exp/exp003/trainner.py
fkubota/kaggle-Rainforest-Connection-Species-Audio-Detection
7134edff0ba1c60f597b64a0efd953b7707b98e1
[ "MIT" ]
null
null
null
from ipdb import set_trace as st from icecream import ic import gc import os import wandb import pandas as pd from fastprogress import progress_bar from loguru import logger import numpy as np import torch from sklearn.metrics import accuracy_score import utils as U import configuration as C import result_handler as r...
36.870849
80
0.572258
from ipdb import set_trace as st from icecream import ic import gc import os import wandb import pandas as pd from fastprogress import progress_bar from loguru import logger import numpy as np import torch from sklearn.metrics import accuracy_score import utils as U import configuration as C import result_handler as r...
true
true
7902a9642cd00215ba2dce5277df7856bc5d626e
7,059
py
Python
seamseg/data/dataset.py
stanfordmlgroup/seamseg
574e89a4e5e99b0aca90071a0c37c31e57c5449e
[ "BSD-3-Clause" ]
2
2021-01-11T08:57:40.000Z
2021-01-11T08:57:44.000Z
seamseg/data/dataset.py
stanfordmlgroup/seamseg
574e89a4e5e99b0aca90071a0c37c31e57c5449e
[ "BSD-3-Clause" ]
null
null
null
seamseg/data/dataset.py
stanfordmlgroup/seamseg
574e89a4e5e99b0aca90071a0c37c31e57c5449e
[ "BSD-3-Clause" ]
1
2020-09-28T07:55:50.000Z
2020-09-28T07:55:50.000Z
import glob from itertools import chain from os import path import numpy as np import torch.utils.data as data import umsgpack from PIL import Image class ISSDataset(data.Dataset): """Instance segmentation dataset This assumes the dataset to be formatted as defined in: https://github.com/mapillary/s...
33.140845
120
0.593285
import glob from itertools import chain from os import path import numpy as np import torch.utils.data as data import umsgpack from PIL import Image class ISSDataset(data.Dataset): _IMG_DIR = "img" _MSK_DIR = "msk" _LST_DIR = "lst" _METADATA_FILE = "metadata.bin" def __init__(self, root_dir, spl...
true
true
7902ab0e67a99494380d14a788dcfc8a27e7cbe4
7,836
py
Python
contrib/bitrpc/bitrpc.py
bitmea-project/bitmea
02b400578d0eee35304c27a7b3d8fa4ef7f057e3
[ "MIT" ]
1
2017-11-05T11:51:38.000Z
2017-11-05T11:51:38.000Z
contrib/bitrpc/bitrpc.py
bitmea-project/bitmea
02b400578d0eee35304c27a7b3d8fa4ef7f057e3
[ "MIT" ]
null
null
null
contrib/bitrpc/bitrpc.py
bitmea-project/bitmea
02b400578d0eee35304c27a7b3d8fa4ef7f057e3
[ "MIT" ]
null
null
null
from jsonrpc import ServiceProxy import sys import string # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:25176") else: access = Se...
24.110769
79
0.668198
from jsonrpc import ServiceProxy import sys import string rpcuser = "" rpcpass = "" if rpcpass == "": access = ServiceProxy("http://127.0.0.1:25176") else: access = ServiceProxy("http://"+rpcuser+":"+rpcpass+"@127.0.0.1:25176") cmd = sys.argv[1].lower() if cmd == "backupwallet": try: path = raw_input("Enter...
false
true
7902acb04630a9f1b4f45b81c474f8a41d9902fc
3,516
py
Python
flapison/exceptions.py
Leechael/flapison
379b37774fd16197c803a7b5e3bd9eca99191337
[ "MIT" ]
13
2019-12-03T22:03:36.000Z
2020-11-24T05:09:02.000Z
flapison/exceptions.py
Leechael/flapison
379b37774fd16197c803a7b5e3bd9eca99191337
[ "MIT" ]
16
2019-11-11T23:20:20.000Z
2020-11-19T09:03:17.000Z
flapison/exceptions.py
Leechael/flapison
379b37774fd16197c803a7b5e3bd9eca99191337
[ "MIT" ]
7
2019-11-14T11:06:13.000Z
2020-09-28T08:14:40.000Z
# -*- coding: utf-8 -*- """Collection of useful http error for the Api""" class JsonApiException(Exception): """Base exception class for unknown errors""" title = "Unknown error" status = "500" source = None def __init__( self, detail, source=None, title=None, ...
24.93617
116
0.625711
class JsonApiException(Exception): title = "Unknown error" status = "500" source = None def __init__( self, detail, source=None, title=None, status=None, code=None, id_=None, links=None, meta=None, ): self.detail =...
true
true
7902ad581daf449f16c00ca77842b11f33a21f72
1,304
py
Python
pypy/objspace/std/test/test_annmm.py
kantai/passe-pypy-taint-tracking
b60a3663f8fe89892dc182c8497aab97e2e75d69
[ "MIT" ]
2
2016-07-06T23:30:20.000Z
2017-05-30T15:59:31.000Z
pypy/objspace/std/test/test_annmm.py
kantai/passe-pypy-taint-tracking
b60a3663f8fe89892dc182c8497aab97e2e75d69
[ "MIT" ]
null
null
null
pypy/objspace/std/test/test_annmm.py
kantai/passe-pypy-taint-tracking
b60a3663f8fe89892dc182c8497aab97e2e75d69
[ "MIT" ]
2
2020-07-09T08:14:22.000Z
2021-01-15T18:01:25.000Z
from pypy.objspace.std.multimethod import * from rpython.annotator.annrpython import RPythonAnnotator class W_Root(object): pass class W_Int(W_Root): pass class W_Str(W_Root): pass str_w = MultiMethodTable(1, root_class=W_Root, argnames_before=['space']) int_w = MultiMethodTable(1, root_class=W_Root, a...
22.877193
73
0.669479
from pypy.objspace.std.multimethod import * from rpython.annotator.annrpython import RPythonAnnotator class W_Root(object): pass class W_Int(W_Root): pass class W_Str(W_Root): pass str_w = MultiMethodTable(1, root_class=W_Root, argnames_before=['space']) int_w = MultiMethodTable(1, root_class=W_Root, a...
true
true
7902ad96592838372ac3d5038aeba106a3da787c
8,756
py
Python
ucam_wls/context.py
edwinbalani/ucam-wls
1c828c1b9cbf4e6b38fb1986235e20a746726f6a
[ "MIT" ]
null
null
null
ucam_wls/context.py
edwinbalani/ucam-wls
1c828c1b9cbf4e6b38fb1986235e20a746726f6a
[ "MIT" ]
3
2020-11-20T18:36:11.000Z
2020-12-03T00:55:56.000Z
ucam_wls/context.py
edwinbalani/ucam-wls
1c828c1b9cbf4e6b38fb1986235e20a746726f6a
[ "MIT" ]
null
null
null
import datetime from . import status from .errors import InvalidAuthRequest, ProtocolVersionUnsupported, NoMutualAuthType from .signing import Key from .response import AuthResponse class AuthPrincipal: def __init__(self, userid, auth_methods, ptags=None, session_expiry=None): self.userid = userid ...
43.346535
95
0.646071
import datetime from . import status from .errors import InvalidAuthRequest, ProtocolVersionUnsupported, NoMutualAuthType from .signing import Key from .response import AuthResponse class AuthPrincipal: def __init__(self, userid, auth_methods, ptags=None, session_expiry=None): self.userid = userid ...
true
true
7902ae902f0242a19bcf6952a2b51c71729cf8da
6,123
py
Python
components/server/src/routes/report.py
Gamer1120/quality-time
f3a0d6f75cd6055d78995d37feae72bc3e837e4b
[ "Apache-2.0" ]
1
2021-02-22T07:53:36.000Z
2021-02-22T07:53:36.000Z
components/server/src/routes/report.py
Gamer1120/quality-time
f3a0d6f75cd6055d78995d37feae72bc3e837e4b
[ "Apache-2.0" ]
338
2020-10-29T04:28:09.000Z
2022-02-22T04:09:33.000Z
components/server/src/routes/report.py
dicksnel/quality-time
4c04f8852aa97175f2bca2b5c5391b3e09b657af
[ "Apache-2.0" ]
1
2022-01-06T04:07:03.000Z
2022-01-06T04:07:03.000Z
"""Report routes.""" import os from urllib import parse import bottle import requests from pymongo.database import Database from database import sessions from database.datamodels import latest_datamodel from database.measurements import recent_measurements_by_metric_uuid from database.reports import insert_new_repor...
44.05036
114
0.709783
import os from urllib import parse import bottle import requests from pymongo.database import Database from database import sessions from database.datamodels import latest_datamodel from database.measurements import recent_measurements_by_metric_uuid from database.reports import insert_new_report, latest_reports fro...
true
true
7902af6a46c574329e2c40a124e6dc48cbbe1d0c
525
py
Python
project-euler/14/solution.py
gashev/algorithms
ea750b84658e282afad9db3cd51081e30521074b
[ "Unlicense" ]
1
2020-07-23T21:33:43.000Z
2020-07-23T21:33:43.000Z
project-euler/14/solution.py
gashev/algorithms
ea750b84658e282afad9db3cd51081e30521074b
[ "Unlicense" ]
null
null
null
project-euler/14/solution.py
gashev/algorithms
ea750b84658e282afad9db3cd51081e30521074b
[ "Unlicense" ]
null
null
null
lengths = {0: 0, 1: 1} def sequenceLength(n: int) -> int: global lengths if n not in lengths: if n % 2 == 0: lengths[n] = sequenceLength(n//2) + 1 else: lengths[n] = sequenceLength(3 * n + 1) + 1 return lengths[n] def solution(n: int = 1000000) -> int: result ...
22.826087
56
0.531429
lengths = {0: 0, 1: 1} def sequenceLength(n: int) -> int: global lengths if n not in lengths: if n % 2 == 0: lengths[n] = sequenceLength(n//2) + 1 else: lengths[n] = sequenceLength(3 * n + 1) + 1 return lengths[n] def solution(n: int = 1000000) -> int: result ...
true
true
7902b04bd4549c6fba3065d0f0628471d91cc796
4,170
py
Python
api/lib/perm/acl.py
lilixiang/cmdb
d60857c26b9b81c8a33b72548b637cbde8782fe1
[ "MIT" ]
1
2020-02-15T00:13:45.000Z
2020-02-15T00:13:45.000Z
api/lib/perm/acl.py
lilixiang/cmdb
d60857c26b9b81c8a33b72548b637cbde8782fe1
[ "MIT" ]
null
null
null
api/lib/perm/acl.py
lilixiang/cmdb
d60857c26b9b81c8a33b72548b637cbde8782fe1
[ "MIT" ]
1
2019-10-31T07:55:20.000Z
2019-10-31T07:55:20.000Z
# -*- coding:utf-8 -*- import functools import six from flask import current_app, g, request from flask import session, abort from api.extensions import cache def get_access_token(): return class AccessTokenCache(object): @classmethod def get(cls): if cache.get("AccessToken") is not None: ...
29.785714
89
0.622302
import functools import six from flask import current_app, g, request from flask import session, abort from api.extensions import cache def get_access_token(): return class AccessTokenCache(object): @classmethod def get(cls): if cache.get("AccessToken") is not None: return cache...
true
true
7902b34f6b114df659048615489dfce1fb8a915f
417
py
Python
cbexplorer/types/AbstractType.py
ambitus/cbexplorer
8bb50efce9f81e29ad96c5c1bd49e3d3e95cc97e
[ "Apache-2.0" ]
1
2021-12-07T10:09:44.000Z
2021-12-07T10:09:44.000Z
cbexplorer/types/AbstractType.py
ambitus/cbexplorer
8bb50efce9f81e29ad96c5c1bd49e3d3e95cc97e
[ "Apache-2.0" ]
1
2021-12-20T22:03:05.000Z
2021-12-20T22:03:05.000Z
cbexplorer/types/AbstractType.py
ambitus/cbexplorer
8bb50efce9f81e29ad96c5c1bd49e3d3e95cc97e
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2020- IBM Inc. All rights reserved # SPDX-License-Identifier: Apache2.0 # """ """ from abc import ABC, abstractproperty, abstractmethod class AbstractType(ABC): @abstractproperty def length(self): pass @abstractmethod def __call__...
16.68
53
0.657074
from abc import ABC, abstractproperty, abstractmethod class AbstractType(ABC): @abstractproperty def length(self): pass @abstractmethod def __call__(self): pass def _get_chunk(self): return self.locator.content(self.length)
true
true
7902b4e7cc22288f67b261811b0a338d1c514027
421
py
Python
backend/battleroyal_lite_28428/wsgi.py
crowdbotics-apps/battleroyal-lite-28428
0897d028c48f1021edf707799d1e6eead9d4a608
[ "FTL", "AML", "RSA-MD" ]
null
null
null
backend/battleroyal_lite_28428/wsgi.py
crowdbotics-apps/battleroyal-lite-28428
0897d028c48f1021edf707799d1e6eead9d4a608
[ "FTL", "AML", "RSA-MD" ]
null
null
null
backend/battleroyal_lite_28428/wsgi.py
crowdbotics-apps/battleroyal-lite-28428
0897d028c48f1021edf707799d1e6eead9d4a608
[ "FTL", "AML", "RSA-MD" ]
null
null
null
""" WSGI config for battleroyal_lite_28428 project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefaul...
24.764706
82
0.800475
import os from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'battleroyal_lite_28428.settings') application = get_wsgi_application()
true
true
7902b4e8d5c6a365b8aec1450fe7b1cbb2c5f3f1
6,764
py
Python
run.py
jparsai/cvejob
8f9462a1ecdf1d4de877ac5f44e772239ffcb379
[ "Apache-2.0" ]
null
null
null
run.py
jparsai/cvejob
8f9462a1ecdf1d4de877ac5f44e772239ffcb379
[ "Apache-2.0" ]
null
null
null
run.py
jparsai/cvejob
8f9462a1ecdf1d4de877ac5f44e772239ffcb379
[ "Apache-2.0" ]
null
null
null
"""Run CVEjob.""" import sys from decimal import Decimal import multiprocessing import nvdlib from nvdlib.manager import FeedManager from nvdlib.query_selectors import in_range from cvejob.filters.input import validate_cve from cvejob.config import Config from cvejob.identifiers import get_identifier_cls from cvejob...
29.666667
88
0.582496
import sys from decimal import Decimal import multiprocessing import nvdlib from nvdlib.manager import FeedManager from nvdlib.query_selectors import in_range from cvejob.filters.input import validate_cve from cvejob.config import Config from cvejob.identifiers import get_identifier_cls from cvejob.cpe2pkg import ge...
true
true
7902b4e8efc61c4f0d7ad21a1538407cbb8b5c9f
10,568
py
Python
src/module_tick.py
lanl/pymplot
093769a06051c6b41be76ce1431e6a6e64477e5a
[ "BSD-3-Clause" ]
3
2020-10-29T20:49:10.000Z
2020-11-01T05:01:49.000Z
src/module_tick.py
lanl/pymplot
093769a06051c6b41be76ce1431e6a6e64477e5a
[ "BSD-3-Clause" ]
null
null
null
src/module_tick.py
lanl/pymplot
093769a06051c6b41be76ce1431e6a6e64477e5a
[ "BSD-3-Clause" ]
2
2020-11-12T19:07:14.000Z
2020-11-25T21:45:54.000Z
''' Module: Set regular or irregular axis ticks for a plot. ''' from module_utility import * import numpy as np import matplotlib.pyplot as plt # ticks : contains irregular ticks locations # tickbeg : regular major ticks begin location # tickend : regular major ticks end location # tickd : regular major ti...
37.475177
108
0.568793
from module_utility import * import numpy as np import matplotlib.pyplot as plt def define_tick(ticks, tickbeg, tickend, tickd, mtick, xbeg, xend, ns, d, axislen, format, extend=False): if ticks is None: if tickd is None: tick_interval = nice((xend - xbeg) / 5.0) ...
true
true
7902b51d73c71ea57a8e3a2f7e254e9fb0256044
1,016
py
Python
stagesetting/validators.py
kezabelle/django-stagesetting
d01029c309915599e9a0413c1be0957638725f69
[ "BSD-2-Clause-FreeBSD" ]
5
2015-10-19T13:35:57.000Z
2020-06-15T14:26:28.000Z
stagesetting/validators.py
kezabelle/django-stagesetting
d01029c309915599e9a0413c1be0957638725f69
[ "BSD-2-Clause-FreeBSD" ]
9
2015-08-19T14:05:27.000Z
2017-05-17T09:27:41.000Z
stagesetting/validators.py
kezabelle/django-stagesetting
d01029c309915599e9a0413c1be0957638725f69
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import unicode_literals from django.core.exceptions import ValidationError from django.core.validators import RegexValidator from django.utils.translation import ugettext_lazy as _ from re import compile setting_name_re_str = '^[A-Z][A-Z0-...
29.882353
78
0.722441
from __future__ import absolute_import from __future__ import unicode_literals from django.core.exceptions import ValidationError from django.core.validators import RegexValidator from django.utils.translation import ugettext_lazy as _ from re import compile setting_name_re_str = '^[A-Z][A-Z0-9_]+[A-Z0-9]$' class S...
true
true
7902b5cdce5da8596b8def22ae4be02ddead718b
8,051
py
Python
comodit_client/api/exporter.py
geoco84/comodit-client
4cf47e60a6739ed8b88ce8b955ed57375c4d400d
[ "MIT" ]
null
null
null
comodit_client/api/exporter.py
geoco84/comodit-client
4cf47e60a6739ed8b88ce8b955ed57375c4d400d
[ "MIT" ]
null
null
null
comodit_client/api/exporter.py
geoco84/comodit-client
4cf47e60a6739ed8b88ce8b955ed57375c4d400d
[ "MIT" ]
null
null
null
# coding: utf-8 """ Provides the exporter tool. The exporter can be used to export ComodIT entities to local directories. """ from __future__ import print_function from builtins import object import os from comodit_client.api.collection import EntityNotFoundException from comodit_client.api.exceptions import PythonAp...
31.822134
106
0.600795
from __future__ import print_function from builtins import object import os from comodit_client.api.collection import EntityNotFoundException from comodit_client.api.exceptions import PythonApiException from comodit_client.api.host import Host from comodit_client.rest.exceptions import ApiException from comodit_clie...
true
true
7902b64da8a83c100463dd21a0346ef4f982c06a
3,271
py
Python
part_of_speech.py
ruchind159/grammar_correction
4af73cd2403c02b827161ad464b0c8339d3715f1
[ "Apache-2.0" ]
2
2021-03-15T14:07:05.000Z
2021-08-12T09:22:00.000Z
part_of_speech.py
steven-cheng-com/grammar_correction_with_bert
fc1a168dc8d4ada954637aa615656fb7e82cc02a
[ "Apache-2.0" ]
2
2020-11-16T08:53:39.000Z
2021-03-04T12:06:53.000Z
part_of_speech.py
ruchind159/grammar_correction
4af73cd2403c02b827161ad464b0c8339d3715f1
[ "Apache-2.0" ]
null
null
null
import nltk # nltk.download('stopwords') #if doesnt work download all these first # nltk.download('punkt') # nltk.download('averaged_perceptron_tagger') from nltk.corpus import stopwords from nltk.tokenize import word_tokenize, sent_tokenize stop_words = set(stopwords.words('english')) meaning_with_example = { ...
30.570093
81
0.642006
import nltk rom nltk.tokenize import word_tokenize, sent_tokenize stop_words = set(stopwords.words('english')) meaning_with_example = { "CC" : "coordinating conjunction", "CD" : "cardinal digit", "DT" : "determiner", "EX" : "existential there (like: “there is” … think of it like “there exists”)", "FW" : "forei...
true
true
7902b7d331b3cc1103d0723383f0188ca9a5695d
2,442
py
Python
stanCode_projects/name_searching_system/milestone1.py
kenhuang1204/stanCode_projects
f697a34a1c54a864c1140cb0f2f76e2d70b45698
[ "MIT" ]
null
null
null
stanCode_projects/name_searching_system/milestone1.py
kenhuang1204/stanCode_projects
f697a34a1c54a864c1140cb0f2f76e2d70b45698
[ "MIT" ]
null
null
null
stanCode_projects/name_searching_system/milestone1.py
kenhuang1204/stanCode_projects
f697a34a1c54a864c1140cb0f2f76e2d70b45698
[ "MIT" ]
null
null
null
""" File: Milestone1.py Name: 黃科諺 ----------------------- This file tests the milestone 1 for our babyname.py project """ import sys def add_data_for_name(name_data, year, rank, name): name_info = {year: rank} if name in name_data: if year in name_data[name]: exist_rank = int(name_data[na...
31.307692
107
0.47502
import sys def add_data_for_name(name_data, year, rank, name): name_info = {year: rank} if name in name_data: if year in name_data[name]: exist_rank = int(name_data[name][year]) if int(rank) < exist_rank: name_data[name][year] = rank else: n...
true
true
7902b80bc51d759fc1c6b2262f316e6019c967d6
299
py
Python
mass_api_client/schemas/scheduled_analysis.py
tbehner/mass_api_client
eec1764b062e2b24a9d1f8f59f665e6b56c9d366
[ "MIT" ]
2
2017-06-27T12:28:40.000Z
2017-10-13T09:34:18.000Z
mass_api_client/schemas/scheduled_analysis.py
tbehner/mass_api_client
eec1764b062e2b24a9d1f8f59f665e6b56c9d366
[ "MIT" ]
124
2016-11-22T13:11:07.000Z
2019-10-22T23:36:10.000Z
mass_api_client/schemas/scheduled_analysis.py
tbehner/mass_api_client
eec1764b062e2b24a9d1f8f59f665e6b56c9d366
[ "MIT" ]
null
null
null
from marshmallow import fields from .base import BaseSchema class ScheduledAnalysisSchema(BaseSchema): analysis_system_instance = fields.Url(required=True) sample = fields.Url(required=True) analysis_scheduled = fields.DateTime(required=True) priority = fields.Int(required=True)
27.181818
56
0.782609
from marshmallow import fields from .base import BaseSchema class ScheduledAnalysisSchema(BaseSchema): analysis_system_instance = fields.Url(required=True) sample = fields.Url(required=True) analysis_scheduled = fields.DateTime(required=True) priority = fields.Int(required=True)
true
true
7902b81321920a85441cfdd8e8511a4049d31b8c
4,152
py
Python
anwa/main_click.py
mjirik/anwa
c77138debdec3915f1f9539278dee248348c2c61
[ "MIT" ]
null
null
null
anwa/main_click.py
mjirik/anwa
c77138debdec3915f1f9539278dee248348c2c61
[ "MIT" ]
null
null
null
anwa/main_click.py
mjirik/anwa
c77138debdec3915f1f9539278dee248348c2c61
[ "MIT" ]
null
null
null
# /usr/bin/env python # -*- coding: utf-8 -*- """ Modul is used for GUI of Lisa """ from loguru import logger import sys import click from pathlib import Path import ast from . import app_tools # print("start") # from . import image # print("start 5") # print("start 6") # from scaffan import algorithm from . impo...
28.634483
110
0.678227
from loguru import logger import sys import click from pathlib import Path import ast from . import app_tools from . import algorithm CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"]) @click.group(context_settings=CONTEXT_SETTINGS, invoke_without_command=True) @click.pass_context def ru...
true
true
7902b82d00f17ada7e994316eefb3f7ae752f3ce
9,066
py
Python
test/interval_test.py
diatche/intervalpy
8204265fe3a24bd9268a46af644c58778ee7112a
[ "MIT" ]
null
null
null
test/interval_test.py
diatche/intervalpy
8204265fe3a24bd9268a46af644c58778ee7112a
[ "MIT" ]
null
null
null
test/interval_test.py
diatche/intervalpy
8204265fe3a24bd9268a46af644c58778ee7112a
[ "MIT" ]
null
null
null
import pytest import math import os import sys module_dir = os.path.dirname(__file__) sys.path.append(os.path.join(module_dir, '..', 'intervalpy')) from intervalpy import Interval def test_intersection(): # closed, closed d1 = Interval(0, 2, start_open=False, end_open=False) d2 = Interval(1, 3, start_open...
32.263345
107
0.647695
import pytest import math import os import sys module_dir = os.path.dirname(__file__) sys.path.append(os.path.join(module_dir, '..', 'intervalpy')) from intervalpy import Interval def test_intersection(): d1 = Interval(0, 2, start_open=False, end_open=False) d2 = Interval(1, 3, start_open=False, end_open...
true
true
7902b96858ce90e6851ca8f3ac49612340413a94
2,940
py
Python
scripts/importcode.py
paulscottrobson/flat
976644db7f52f04dae50dce43504ede9e97f695e
[ "MIT" ]
null
null
null
scripts/importcode.py
paulscottrobson/flat
976644db7f52f04dae50dce43504ede9e97f695e
[ "MIT" ]
null
null
null
scripts/importcode.py
paulscottrobson/flat
976644db7f52f04dae50dce43504ede9e97f695e
[ "MIT" ]
null
null
null
# *************************************************************************************** # *************************************************************************************** # # Name : importcode.py # Author : Paul Robson (paul@robsons.org.uk) # Date : 12th March 2019. # Purpose : Import code into buffer ...
31.956522
121
0.591837
import sys from imagelib import * image = BinaryImage() bufferInfo = image.sourcePages() firstSourcePage = bufferInfo[0] sourcePageCount = bufferInfo[1] pageSize = image.getBufferSize() for p in range(firstSourcePage,firstSourcePage+sourcePageCount*2,2): for a in range(0xC000,0x10000,pageSize): imag...
true
true
7902ba97f62d0493076275418dfc4a67cd95fa69
67,692
py
Python
model_selection.py
EnricoPittini/model-selection
dcd3e202773372088047056d866c12c15dba65ac
[ "MIT" ]
null
null
null
model_selection.py
EnricoPittini/model-selection
dcd3e202773372088047056d866c12c15dba65ac
[ "MIT" ]
null
null
null
model_selection.py
EnricoPittini/model-selection
dcd3e202773372088047056d866c12c15dba65ac
[ "MIT" ]
null
null
null
""" Module for the selection of machine learning models. There are several different functions which can perform the model selection: all of them have an intuitive interface, but are also powerful and flexible. In addition, almost all these functions can optionally make plots, which sum up the performed selection...
52.110855
130
0.664643
import matplotlib.pyplot as plt import numpy as np from sklearn.utils import resample from sklearn.model_selection import train_test_split, cross_val_score, TimeSeriesSplit, GridSearchCV from sklearn.metrics import mean_squared_error, accuracy_score from sklearn.preprocessing import MinMaxScaler, PolynomialFea...
true
true
7902bb213fbc19165021f2e2d67ce2e3cb89f9a8
17,735
py
Python
test/test_art.py
stragu/beets
da46a62772ab7a88c5799c84841f744dfc0f0a20
[ "MIT" ]
null
null
null
test/test_art.py
stragu/beets
da46a62772ab7a88c5799c84841f744dfc0f0a20
[ "MIT" ]
null
null
null
test/test_art.py
stragu/beets
da46a62772ab7a88c5799c84841f744dfc0f0a20
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # This file is part of beets. # Copyright 2016, Adrian Sampson. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation t...
37.574153
79
0.66287
from __future__ import (division, absolute_import, print_function, unicode_literals) import os import shutil import responses from mock import patch from test import _common from test._common import unittest from beetsplug import fetchart from beets.autotag import AlbumInfo, A...
true
true
7902bb410a1d585a1dec814f872cb619765ef7b6
1,111
py
Python
azure-servicefabric/azure/servicefabric/models/wait_for_primary_placement_safety_check.py
v-Ajnava/azure-sdk-for-python
a1f6f80eb5869c5b710e8bfb66146546697e2a6f
[ "MIT" ]
null
null
null
azure-servicefabric/azure/servicefabric/models/wait_for_primary_placement_safety_check.py
v-Ajnava/azure-sdk-for-python
a1f6f80eb5869c5b710e8bfb66146546697e2a6f
[ "MIT" ]
null
null
null
azure-servicefabric/azure/servicefabric/models/wait_for_primary_placement_safety_check.py
v-Ajnava/azure-sdk-for-python
a1f6f80eb5869c5b710e8bfb66146546697e2a6f
[ "MIT" ]
null
null
null
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
34.71875
91
0.633663
from .partition_safety_check import PartitionSafetyCheck class WaitForPrimaryPlacementSafetyCheck(PartitionSafetyCheck): _validation = { 'kind': {'required': True}, } def __init__(self, partition_id=None): super(WaitForPrimaryPlacementSafetyCheck, self).__init__(partition_id=p...
true
true
7902bce9c4ad380033291c205f4cafacc3be37e2
749
py
Python
utils/color.py
WangYihang/Reverse-Shell-Manager
7c660b7a080dd1068139db7e061c626c66f94beb
[ "Unlicense" ]
372
2017-10-23T03:22:57.000Z
2022-03-30T02:06:43.000Z
utils/color.py
SpaceRealms/Reverse-Shell-Manager
5bf429c278950d63a41fd51f01df495a3b870e94
[ "Unlicense" ]
9
2017-10-26T06:59:45.000Z
2020-09-28T11:24:20.000Z
utils/color.py
SpaceRealms/Reverse-Shell-Manager
5bf429c278950d63a41fd51f01df495a3b870e94
[ "Unlicense" ]
106
2017-10-24T05:33:57.000Z
2021-12-30T03:29:50.000Z
#!/usr/bin/envpython # -*- coding: utf-8 -*- def black(string): return'\033[30m'+string+'\033[0m' def blue(string): return'\033[94m'+string+'\033[0m' def gray(string): return'\033[1;30m'+string+'\033[0m' def green(string): return'\033[92m'+string+'\033[0m' def cyan(string): return'\033[96m'+str...
19.205128
39
0.635514
def black(string): return'\033[30m'+string+'\033[0m' def blue(string): return'\033[94m'+string+'\033[0m' def gray(string): return'\033[1;30m'+string+'\033[0m' def green(string): return'\033[92m'+string+'\033[0m' def cyan(string): return'\033[96m'+string+'\033[0m' def lightPurple(string): ...
true
true
7902bd4370ad3d055382dfc98a2c7333e9bbb30d
2,395
py
Python
venv/lib/python3.9/site-packages/markdown/extensions/meta.py
qarik-hanrattyjen/apache-airflow-backport-providers-google-2021.3.3
630dcef73e6a258b6e9a52f934e2dd912ce741f8
[ "Apache-2.0" ]
182
2017-03-05T07:43:13.000Z
2022-03-15T13:09:07.000Z
venv/lib/python3.9/site-packages/markdown/extensions/meta.py
qarik-hanrattyjen/apache-airflow-backport-providers-google-2021.3.3
630dcef73e6a258b6e9a52f934e2dd912ce741f8
[ "Apache-2.0" ]
15
2018-05-02T11:05:30.000Z
2018-05-11T20:51:27.000Z
env/lib/python3.6/site-packages/markdown/extensions/meta.py
bcss-pm/incidents
927a102104b5718fe118bceb307d3cd633d6699b
[ "MIT" ]
38
2017-04-26T14:13:37.000Z
2021-06-24T11:36:38.000Z
""" Meta Data Extension for Python-Markdown ======================================= This extension adds Meta Data handling to markdown. See <https://Python-Markdown.github.io/extensions/meta_data> for documentation. Original code Copyright 2007-2008 [Waylan Limberg](http://achinghead.com). All changes Copyright 200...
30.316456
74
0.561169
from __future__ import absolute_import from __future__ import unicode_literals from . import Extension from ..preprocessors import Preprocessor import re import logging log = logging.getLogger('MARKDOWN') META_RE = re.compile(r'^[ ]{0,3}(?P<key>[A-Za-z0-9_-]+):\s*(?P<value>.*)') META_MORE_RE = re.compile(r'^[ ]{4,}...
true
true
7902bda17a6f03db284d8ff883e0efa9e30816fa
817
py
Python
Lib/site-packages/wx-2.8-msw-unicode/wx/tools/Editra/src/__init__.py
ekkipermana/robotframework-test
243ca26f69962f8cf20cd7d054e0ff3e709bc7f4
[ "bzip2-1.0.6" ]
27
2020-11-12T19:24:54.000Z
2022-03-27T23:10:45.000Z
Lib/site-packages/wx-2.8-msw-unicode/wx/tools/Editra/src/__init__.py
ekkipermana/robotframework-test
243ca26f69962f8cf20cd7d054e0ff3e709bc7f4
[ "bzip2-1.0.6" ]
2
2020-11-02T06:30:39.000Z
2022-02-23T18:39:55.000Z
Lib/site-packages/wx-2.8-msw-unicode/wx/tools/Editra/src/__init__.py
ekkipermana/robotframework-test
243ca26f69962f8cf20cd7d054e0ff3e709bc7f4
[ "bzip2-1.0.6" ]
7
2018-02-13T10:22:39.000Z
2019-07-04T07:39:28.000Z
############################################################################### # Name: __init__.py # # Purpose: Import the required base modules needed for launching Editra into # # into the namespace. # ...
58.357143
79
0.383109
true
true
7902bfe62c34045bcf5da4d2c7aed97cdc66b949
3,871
py
Python
alps/descriptors.py
michalporeba/alps-py
bfbfd048437e1fb77d253bc649d3965257dd557c
[ "MIT" ]
null
null
null
alps/descriptors.py
michalporeba/alps-py
bfbfd048437e1fb77d253bc649d3965257dd557c
[ "MIT" ]
null
null
null
alps/descriptors.py
michalporeba/alps-py
bfbfd048437e1fb77d253bc649d3965257dd557c
[ "MIT" ]
null
null
null
from diogi.functions import * from diogi.conventions import to_data from .docs import WithDocsMixin def noop_resolver(href: str) -> dict: pass class Descriptor: @staticmethod def parse(obj: any, resolver: callable): if dict == type(obj): href = get_if_exists(obj, "href", None) ...
27.453901
85
0.587703
from diogi.functions import * from diogi.conventions import to_data from .docs import WithDocsMixin def noop_resolver(href: str) -> dict: pass class Descriptor: @staticmethod def parse(obj: any, resolver: callable): if dict == type(obj): href = get_if_exists(obj, "href", None) ...
true
true
7902c0eb5175879fdc97f1cf09a1cd5cc8374bfd
4,994
py
Python
models/official/unet3d/unet_main.py
tensorflow/tpu-demos
8aac591077e5781785aa6c22bc400472ba14dada
[ "Apache-2.0" ]
65
2017-07-28T03:47:42.000Z
2018-02-04T20:54:18.000Z
models/official/unet3d/unet_main.py
tensorflow/tpu-demos
8aac591077e5781785aa6c22bc400472ba14dada
[ "Apache-2.0" ]
10
2017-08-11T22:55:40.000Z
2018-02-07T01:11:28.000Z
models/official/unet3d/unet_main.py
tensorflow/tpu-demos
8aac591077e5781785aa6c22bc400472ba14dada
[ "Apache-2.0" ]
28
2017-07-28T08:20:06.000Z
2018-01-28T16:28:12.000Z
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
35.928058
80
0.718662
from __future__ import absolute_import from __future__ import division from __future__ import print_function from absl import app from absl import flags import tensorflow.compat.v1 as tf from tensorflow.compat.v1 import estimator as tf_estimator from hyperparameters import params_dict import input_read...
true
true
7902c17011b88149151bf12ca4db88d98f3a35a8
8,388
py
Python
osh/builtin_bracket.py
Schweinepriester/oil
8b0e5c58a825223341896064d63a95c8b57a9c05
[ "Apache-2.0" ]
2,209
2016-11-20T10:32:58.000Z
2022-03-31T20:51:27.000Z
osh/builtin_bracket.py
Schweinepriester/oil
8b0e5c58a825223341896064d63a95c8b57a9c05
[ "Apache-2.0" ]
1,074
2016-12-07T05:02:48.000Z
2022-03-22T02:09:11.000Z
osh/builtin_bracket.py
Schweinepriester/oil
8b0e5c58a825223341896064d63a95c8b57a9c05
[ "Apache-2.0" ]
147
2016-12-11T04:13:28.000Z
2022-03-27T14:50:00.000Z
""" builtin_bracket.py """ from __future__ import print_function from _devbuild.gen.id_kind_asdl import Id from _devbuild.gen.runtime_asdl import value from _devbuild.gen.syntax_asdl import ( word, word_e, word_t, word__String, bool_expr, ) from _devbuild.gen.types_asdl import lex_mode_e from asdl import runtime ...
29.850534
82
0.651884
from __future__ import print_function from _devbuild.gen.id_kind_asdl import Id from _devbuild.gen.runtime_asdl import value from _devbuild.gen.syntax_asdl import ( word, word_e, word_t, word__String, bool_expr, ) from _devbuild.gen.types_asdl import lex_mode_e from asdl import runtime from core import error from...
true
true
7902c1dde76668cd152efaed3547620712f047f2
461
py
Python
components/climber.py
BlueCrewRobotics/2017Robot
d55c9179df819ed27da61c314dc8d74b0938c376
[ "MIT" ]
null
null
null
components/climber.py
BlueCrewRobotics/2017Robot
d55c9179df819ed27da61c314dc8d74b0938c376
[ "MIT" ]
null
null
null
components/climber.py
BlueCrewRobotics/2017Robot
d55c9179df819ed27da61c314dc8d74b0938c376
[ "MIT" ]
null
null
null
#climber.py #Robot Code For BlueCrew 6153 import wpilib #Commands to make the robot climb. class Climber: climb_motor = wpilib.Talon #Set robot to climb when motor is on. def climb(self): self.climb_motor.set(1) #Stops the robot from climbing when motor is off. def stop_climb(self...
21.952381
53
0.657267
import wpilib class Climber: climb_motor = wpilib.Talon def climb(self): self.climb_motor.set(1) def stop_climb(self): self.climb_motor.set(0) def execute(self): pass
true
true
7902c390ad5e9c53d1a89d41161ecf5ce7f436b3
845
py
Python
hook/viewsets.py
PythonBenin/sphinx-bot
3b58d2109ae62294aff33c86e02a50e11f4b730b
[ "MIT" ]
null
null
null
hook/viewsets.py
PythonBenin/sphinx-bot
3b58d2109ae62294aff33c86e02a50e11f4b730b
[ "MIT" ]
6
2021-03-19T03:35:31.000Z
2022-02-10T08:52:55.000Z
hook/viewsets.py
PythonBenin/sphinx-bot
3b58d2109ae62294aff33c86e02a50e11f4b730b
[ "MIT" ]
1
2019-11-28T18:12:19.000Z
2019-11-28T18:12:19.000Z
from importlib import import_module from rest_framework import status from rest_framework.response import Response from rest_framework.viewsets import GenericViewSet class HookViewSet(GenericViewSet): def post(self, request, *args, **kwargs): data = request.data action = data['action'] e...
33.8
73
0.648521
from importlib import import_module from rest_framework import status from rest_framework.response import Response from rest_framework.viewsets import GenericViewSet class HookViewSet(GenericViewSet): def post(self, request, *args, **kwargs): data = request.data action = data['action'] e...
true
true
7902c3b72cd784fa20d29ada443a30329b5c8004
32,091
py
Python
scipy/linalg/interpolative.py
jake-is-ESD-protected/scipy
d7283ff75c218c300f372b5fdd960b987c1709a1
[ "BSD-3-Clause" ]
9,095
2015-01-02T18:24:23.000Z
2022-03-31T20:35:31.000Z
scipy/linalg/interpolative.py
jake-is-ESD-protected/scipy
d7283ff75c218c300f372b5fdd960b987c1709a1
[ "BSD-3-Clause" ]
11,500
2015-01-01T01:15:30.000Z
2022-03-31T23:07:35.000Z
scipy/linalg/interpolative.py
jake-is-ESD-protected/scipy
d7283ff75c218c300f372b5fdd960b987c1709a1
[ "BSD-3-Clause" ]
5,838
2015-01-05T11:56:42.000Z
2022-03-31T23:21:19.000Z
#****************************************************************************** # Copyright (C) 2013 Kenneth L. Ho # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # Redistributions of source code must retain t...
31.931343
92
0.628743
import scipy.linalg._interpolative_backend as _backend import numpy as np import sys __all__ = [ 'estimate_rank', 'estimate_spectral_norm', 'estimate_spectral_norm_diff', 'id_to_svd', 'interp_decomp', 'rand', 'reconstruct_interp_matrix', 'reconstruct_matr...
true
true
7902c40e0f551462066ba9cc008879b2ca3e1188
14,764
py
Python
dataloader.py
WuYichen-97/Learning-to-Purify-Noisy-Labels-via-Meta-Soft-Label-Corrector
9fda4caf75a35de891a48aae44b6cb0cd36ea8cc
[ "MIT" ]
6
2021-02-01T07:13:36.000Z
2021-12-29T10:36:07.000Z
dataloader.py
WuYichen-97/Learning-to-Purify-Noisy-Labels-via-Meta-Soft-Label-Corrector
9fda4caf75a35de891a48aae44b6cb0cd36ea8cc
[ "MIT" ]
null
null
null
dataloader.py
WuYichen-97/Learning-to-Purify-Noisy-Labels-via-Meta-Soft-Label-Corrector
9fda4caf75a35de891a48aae44b6cb0cd36ea8cc
[ "MIT" ]
1
2021-08-18T15:57:04.000Z
2021-08-18T15:57:04.000Z
# -*- coding: utf-8 -*- """ Created on Mon Apr 27 17:38:25 2020 @author: Wu Yichen """ from PIL import Image import os import os.path import errno import numpy as np import sys import pickle import torch.utils.data as data from torchvision.datasets.utils import download_url, check_integrity impo...
41.125348
149
0.5424
from PIL import Image import os import os.path import errno import numpy as np import sys import pickle import torch.utils.data as data from torchvision.datasets.utils import download_url, check_integrity import torch import torch.nn.functional as F from torch.autograd import Variable as V import w...
true
true
7902c53b185572acc62ef81ebd0bc6fd7de38a1b
4,733
py
Python
src/sentry/api/serializers/models/event.py
E-LLP/sentry
83d97a0ca45cdaac1d5f3026058131a3aeae0068
[ "BSD-3-Clause" ]
null
null
null
src/sentry/api/serializers/models/event.py
E-LLP/sentry
83d97a0ca45cdaac1d5f3026058131a3aeae0068
[ "BSD-3-Clause" ]
null
null
null
src/sentry/api/serializers/models/event.py
E-LLP/sentry
83d97a0ca45cdaac1d5f3026058131a3aeae0068
[ "BSD-3-Clause" ]
null
null
null
from __future__ import absolute_import from datetime import datetime from django.utils import timezone from sentry.api.serializers import Serializer, register from sentry.models import Event, EventError @register(Event) class EventSerializer(Serializer): _reserved_keys = frozenset(['sentry.interfaces.User', 'sd...
32.868056
81
0.530319
from __future__ import absolute_import from datetime import datetime from django.utils import timezone from sentry.api.serializers import Serializer, register from sentry.models import Event, EventError @register(Event) class EventSerializer(Serializer): _reserved_keys = frozenset(['sentry.interfaces.User', 'sd...
true
true
7902c56f3ea0b4239139062b5bcad280b0812ae0
3,385
py
Python
test/test_misc.py
abulimov/lyricstagger
f57caa78357391178348ae80d5c969724343292a
[ "MIT" ]
5
2015-12-03T08:40:32.000Z
2020-08-17T20:30:03.000Z
test/test_misc.py
abulimov/lyricstagger
f57caa78357391178348ae80d5c969724343292a
[ "MIT" ]
1
2018-07-14T15:54:04.000Z
2018-07-14T15:54:04.000Z
test/test_misc.py
abulimov/lyricstagger
f57caa78357391178348ae80d5c969724343292a
[ "MIT" ]
null
null
null
""" Tests for lyrics_tagger """ from __future__ import unicode_literals from __future__ import print_function import unittest import mock import lyricstagger.misc as misc import test.fakers as fakers # pylint: disable=R0904 class MiscCheck(unittest.TestCase): """Test miscelanous functions""" def test_get_tags...
41.280488
79
0.612703
from __future__ import unicode_literals from __future__ import print_function import unittest import mock import lyricstagger.misc as misc import test.fakers as fakers class MiscCheck(unittest.TestCase): def test_get_tags_multi(self): for mime in ['audio/mp3', 'audio/ogg']: audio = fakers.Fak...
true
true
7902c5942ba0de21459bf49c2f14c0a72d985738
8,138
py
Python
AiR-M/ban/base_model.py
szzexpoi/AiR
938ecfec51a306144eb72758530d42e35a10208d
[ "MIT" ]
35
2020-07-07T03:01:46.000Z
2022-03-17T23:33:35.000Z
AiR-M/ban/base_model.py
szzexpoi/AiR
938ecfec51a306144eb72758530d42e35a10208d
[ "MIT" ]
3
2020-09-15T08:14:09.000Z
2021-12-29T21:56:23.000Z
AiR-M/ban/base_model.py
szzexpoi/AiR
938ecfec51a306144eb72758530d42e35a10208d
[ "MIT" ]
5
2020-07-07T10:14:54.000Z
2020-12-07T07:27:24.000Z
""" Bilinear Attention Networks Jin-Hwa Kim, Jaehyun Jun, Byoung-Tak Zhang https://arxiv.org/abs/1805.07932 This code is written by Jin-Hwa Kim. """ import sys sys.path.append('./ban') import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.utils.weight_norm import weight_norm from attention i...
36.00885
124
0.617842
import sys sys.path.append('./ban') import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.utils.weight_norm import weight_norm from attention import BiAttention from language_model import WordEmbedding, QuestionEmbedding from classifier import SimpleClassifier from fc import FCNet from bc imp...
true
true
7902c59b488d0959fa886c67b556db7f20b57f52
8,624
py
Python
BlackJack.py
tse4a/Python-Challenge
d85fdbb4b291443e9be0a93ea1efce57b5e0b44b
[ "MIT" ]
null
null
null
BlackJack.py
tse4a/Python-Challenge
d85fdbb4b291443e9be0a93ea1efce57b5e0b44b
[ "MIT" ]
null
null
null
BlackJack.py
tse4a/Python-Challenge
d85fdbb4b291443e9be0a93ea1efce57b5e0b44b
[ "MIT" ]
null
null
null
import random class Card: def __init__(self, suit, rank): self.suit = suit self.rank = rank def __str__(self): return f"{self.suit} {self.rank}: {BlackJack.values[self.rank]}" class Hand: def __init__(self): self.cards = [] # start with empty list self.value = ...
31.822878
116
0.57224
import random class Card: def __init__(self, suit, rank): self.suit = suit self.rank = rank def __str__(self): return f"{self.suit} {self.rank}: {BlackJack.values[self.rank]}" class Hand: def __init__(self): self.cards = [] self.value = 0 self.aces = 0...
true
true
7902c7384238931709171b3fd07b5a318cbd9914
1,134
py
Python
cardea/fhir/Annotation.py
sarahmish/Cardea
85c4246c12178e6d1b9cc12eb39c264f3c20f3e9
[ "MIT" ]
69
2021-01-28T22:25:10.000Z
2022-03-15T00:23:33.000Z
cardea/fhir/Annotation.py
sarahmish/Cardea
85c4246c12178e6d1b9cc12eb39c264f3c20f3e9
[ "MIT" ]
30
2018-08-29T12:45:23.000Z
2019-12-24T11:08:12.000Z
cardea/fhir/Annotation.py
sarahmish/Cardea
85c4246c12178e6d1b9cc12eb39c264f3c20f3e9
[ "MIT" ]
14
2021-03-24T01:21:25.000Z
2022-03-12T11:53:40.000Z
from .fhirbase import fhirbase class Annotation(fhirbase): """ A text note which also contains information about who made the statement and when. Args: authorReference: The individual responsible for making the annotation. authorString: The individual responsible for making the anno...
25.2
78
0.614638
from .fhirbase import fhirbase class Annotation(fhirbase): __name__ = 'Annotation' def __init__(self, dict_values=None): self.authorReference = None self.authorString = None self.time = None self.text = None self.object_id = Non...
true
true
7902c773ba74624a3d1cfe76d12ec8fe7987d2f2
74
py
Python
pypi_package_project/core.py
rexzhang/pypi-package-project-template
bd7948a5d01a62c607cd82b72023d118b1860454
[ "MIT" ]
38
2021-03-25T06:33:07.000Z
2022-03-11T03:56:15.000Z
pypi_package_project/core.py
rexzhang/pypi-package-project-template
bd7948a5d01a62c607cd82b72023d118b1860454
[ "MIT" ]
15
2021-05-19T03:24:51.000Z
2022-03-25T22:40:02.000Z
pypi_package_project/core.py
rexzhang/pypi-package-project-template
bd7948a5d01a62c607cd82b72023d118b1860454
[ "MIT" ]
8
2021-03-29T06:59:34.000Z
2022-03-11T03:56:17.000Z
#!/usr/bin/env python # coding=utf-8 class PyPIPackageProject: pass
10.571429
25
0.702703
class PyPIPackageProject: pass
true
true
7902c79bcbd5c7f0c40b1e42b37e2c2c6033cc96
9,853
py
Python
smdebug/mxnet/hook.py
jsspric/sagemaker-debugger
d7010869e19ae49c4f371935f27afcb585195f79
[ "Apache-2.0" ]
133
2019-12-03T18:56:27.000Z
2022-03-18T19:54:49.000Z
smdebug/mxnet/hook.py
jsspric/sagemaker-debugger
d7010869e19ae49c4f371935f27afcb585195f79
[ "Apache-2.0" ]
384
2019-12-04T03:04:14.000Z
2022-03-31T20:42:48.000Z
smdebug/mxnet/hook.py
jsspric/sagemaker-debugger
d7010869e19ae49c4f371935f27afcb585195f79
[ "Apache-2.0" ]
64
2019-12-05T20:39:51.000Z
2022-03-25T13:30:54.000Z
# Third Party import mxnet as mx from mxnet.ndarray import NDArray # First Party from smdebug.core.collection import DEFAULT_MXNET_COLLECTIONS, CollectionKeys from smdebug.core.hook import CallbackHook from smdebug.core.json_config import DEFAULT_WORKER_NAME from smdebug.core.utils import FRAMEWORK, error_handling_age...
36.628253
106
0.653405
import mxnet as mx from mxnet.ndarray import NDArray from smdebug.core.collection import DEFAULT_MXNET_COLLECTIONS, CollectionKeys from smdebug.core.hook import CallbackHook from smdebug.core.json_config import DEFAULT_WORKER_NAME from smdebug.core.utils import FRAMEWORK, error_handling_agent from smdebug.mxnet.coll...
true
true
7902c7e16383dbcff154b497b31f425d77375cca
7,736
py
Python
homevision_netio_controller/controller.py
jackoson/homevision-netio-controller
a50fc68654db9cbfbe49dacfa5235bcd5afbcef0
[ "MIT" ]
1
2018-09-24T17:57:18.000Z
2018-09-24T17:57:18.000Z
homevision_netio_controller/controller.py
jackoson/homevision-netio-controller
a50fc68654db9cbfbe49dacfa5235bcd5afbcef0
[ "MIT" ]
null
null
null
homevision_netio_controller/controller.py
jackoson/homevision-netio-controller
a50fc68654db9cbfbe49dacfa5235bcd5afbcef0
[ "MIT" ]
null
null
null
import socket class UserException(Exception): pass def user_exception(s): raise UserException(s) class Macro: """Represents a macro to be run""" def __init__(self, code): """code: int - index of macro to run""" self.code = code class Command: """Represents a macro to be run""" def __init__(self, ...
34.230088
173
0.650724
import socket class UserException(Exception): pass def user_exception(s): raise UserException(s) class Macro: def __init__(self, code): self.code = code class Command: def __init__(self, command): self.command = command class HomeVisionController: def __init__( self, ip_address, p...
true
true
7902c98a93d7736cd750fff46aacbca1fb7ce426
353
py
Python
plugins/digitalbitbox/cmdline.py
surinder83singh/Elymus
054ba5138da886db0523182101f862961b18e6f7
[ "MIT" ]
153
2018-02-26T16:22:27.000Z
2020-10-08T09:15:05.000Z
plugins/digitalbitbox/cmdline.py
surinder83singh/Elymus
054ba5138da886db0523182101f862961b18e6f7
[ "MIT" ]
89
2018-03-03T23:17:11.000Z
2020-07-13T10:19:29.000Z
plugins/digitalbitbox/cmdline.py
surinder83singh/Elymus
054ba5138da886db0523182101f862961b18e6f7
[ "MIT" ]
30
2018-03-03T13:41:14.000Z
2019-11-01T18:05:07.000Z
from electrum.plugins import hook from .digitalbitbox import DigitalBitboxPlugin from ..hw_wallet import CmdLineHandler class Plugin(DigitalBitboxPlugin): handler = CmdLineHandler() @hook def init_keystore(self, keystore): if not isinstance(keystore, self.keystore_class): return ...
29.416667
57
0.736544
from electrum.plugins import hook from .digitalbitbox import DigitalBitboxPlugin from ..hw_wallet import CmdLineHandler class Plugin(DigitalBitboxPlugin): handler = CmdLineHandler() @hook def init_keystore(self, keystore): if not isinstance(keystore, self.keystore_class): return ...
true
true
7902ca1541187ac7d6d64c3f6ce1de5be3f2e3df
2,178
py
Python
DP/Leetcode1143.py
Rylie-W/LeetRecord
623c4efe88b3af54b8a65f6ec23db850b8c6f46f
[ "Apache-2.0" ]
null
null
null
DP/Leetcode1143.py
Rylie-W/LeetRecord
623c4efe88b3af54b8a65f6ec23db850b8c6f46f
[ "Apache-2.0" ]
null
null
null
DP/Leetcode1143.py
Rylie-W/LeetRecord
623c4efe88b3af54b8a65f6ec23db850b8c6f46f
[ "Apache-2.0" ]
null
null
null
class Solution: def longestCommonSubsequence(self, text1: str, text2: str) -> int: ''' #最长连续公共子串 l1=len(text1) l2=len(text2) if l1==0 or l2==0: return 0 dp = [[0 for i in range(l2)] for i in range(l1)] res = 0 if text1[0]==text2[0]: ...
27.225
119
0.435721
class Solution: def longestCommonSubsequence(self, text1: str, text2: str) -> int: if len(text1)==0 or len(text2)==0: return 0 if text1[-1]==text2[-1]: return 1+self.longestCommonSubsequence(text1[:-1],text2[:-1]) else: return max(sel...
true
true
7902ca1e83acd9aee63248151912385c91291913
3,129
py
Python
tdsa_augmentation/data_creation/shrink_glove_to_targets.py
apmoore1/tdsa_augmentation
71c9ffa79ea48e817408d0dc496cc146ce75a942
[ "Apache-2.0" ]
null
null
null
tdsa_augmentation/data_creation/shrink_glove_to_targets.py
apmoore1/tdsa_augmentation
71c9ffa79ea48e817408d0dc496cc146ce75a942
[ "Apache-2.0" ]
null
null
null
tdsa_augmentation/data_creation/shrink_glove_to_targets.py
apmoore1/tdsa_augmentation
71c9ffa79ea48e817408d0dc496cc146ce75a942
[ "Apache-2.0" ]
null
null
null
import argparse from pathlib import Path import tempfile from typing import List from gensim.models import KeyedVectors from gensim.scripts.glove2word2vec import glove2word2vec from target_extraction.data_types import TargetTextCollection from target_extraction.tokenizers import spacy_tokenizer def parse_path(path_st...
42.863014
169
0.660914
import argparse from pathlib import Path import tempfile from typing import List from gensim.models import KeyedVectors from gensim.scripts.glove2word2vec import glove2word2vec from target_extraction.data_types import TargetTextCollection from target_extraction.tokenizers import spacy_tokenizer def parse_path(path_st...
true
true
7902cb2718542b07ccbd7a246e71308ac495f714
3,429
py
Python
vertica_python/tests/base.py
jakubjedelsky/vertica-python
f379576b6949638c90908f5ebded321dce9330e5
[ "MIT" ]
1
2019-06-17T19:05:10.000Z
2019-06-17T19:05:10.000Z
vertica_python/tests/base.py
jakubjedelsky/vertica-python
f379576b6949638c90908f5ebded321dce9330e5
[ "MIT" ]
null
null
null
vertica_python/tests/base.py
jakubjedelsky/vertica-python
f379576b6949638c90908f5ebded321dce9330e5
[ "MIT" ]
2
2020-06-20T21:26:31.000Z
2021-04-03T10:44:40.000Z
from __future__ import print_function, division, absolute_import import os import unittest from six import string_types from .. import * from ..compat import as_text, as_str, as_bytes DEFAULT_VP_TEST_HOST = '127.0.0.1' DEFAULT_VP_TEST_PORT = 5433 DEFAULT_VP_TEST_USER = 'dbadmin' DEFAULT_VP_TEST_PASSWD = '' DEFAULT_...
32.971154
82
0.642461
from __future__ import print_function, division, absolute_import import os import unittest from six import string_types from .. import * from ..compat import as_text, as_str, as_bytes DEFAULT_VP_TEST_HOST = '127.0.0.1' DEFAULT_VP_TEST_PORT = 5433 DEFAULT_VP_TEST_USER = 'dbadmin' DEFAULT_VP_TEST_PASSWD = '' DEFAULT_...
true
true
7902cca06e3a841cee96255c053ca834cc5022f5
7,223
py
Python
src/pte/filetools/filefinder_abc.py
richardkoehler/pynm-decode
3120a410d79d3fce45d0f59025d68ba2d5e80d9e
[ "MIT" ]
1
2022-01-08T09:33:09.000Z
2022-01-08T09:33:09.000Z
src/pte/filetools/filefinder_abc.py
richardkoehler/pynm-decode
3120a410d79d3fce45d0f59025d68ba2d5e80d9e
[ "MIT" ]
null
null
null
src/pte/filetools/filefinder_abc.py
richardkoehler/pynm-decode
3120a410d79d3fce45d0f59025d68ba2d5e80d9e
[ "MIT" ]
null
null
null
"""Define abstract base classes to construct FileFinder classes.""" import os import shutil from abc import ABC, abstractmethod from dataclasses import dataclass, field from pathlib import Path from typing import Optional, Sequence, Union import mne_bids @dataclass class FileFinder(ABC): """Basic representation...
33.439815
79
0.56417
import os import shutil from abc import ABC, abstractmethod from dataclasses import dataclass, field from pathlib import Path from typing import Optional, Sequence, Union import mne_bids @dataclass class FileFinder(ABC): hemispheres: Union[dict, None] = field(default_factory=dict) directory: Union[Path, st...
true
true
7902cd3008a52c8c535baaa6c0bc85a9ac49f83c
2,525
py
Python
ilxutils/ilxutils/database_client.py
tmsincomb/pyontutils
dad24e7178d8d8cd3bd60d53b9039952fa7a5a1e
[ "MIT" ]
11
2017-05-12T08:50:03.000Z
2022-01-22T20:23:25.000Z
ilxutils/ilxutils/database_client.py
tmsincomb/pyontutils
dad24e7178d8d8cd3bd60d53b9039952fa7a5a1e
[ "MIT" ]
81
2016-02-25T07:39:15.000Z
2022-02-17T20:20:27.000Z
ilxutils/ilxutils/database_client.py
tmsincomb/pyontutils
dad24e7178d8d8cd3bd60d53b9039952fa7a5a1e
[ "MIT" ]
257
2017-07-18T19:32:22.000Z
2022-02-03T17:26:18.000Z
from collections import defaultdict import pandas as pd import pickle from sqlalchemy import create_engine, inspect, Table, Column from sqlalchemy.engine.url import make_url from sys import exit class DatabaseClient: """ Takes care of the database pass opening to find the url and can query the respected ...
33.666667
90
0.540594
from collections import defaultdict import pandas as pd import pickle from sqlalchemy import create_engine, inspect, Table, Column from sqlalchemy.engine.url import make_url from sys import exit class DatabaseClient: def __init__(self, dbpass_path, dbname): self.dbpass_path = dbpass_path self.db...
true
true
7902ce0e0f474b9d52cbbbf288f0fab89b6b4bfe
4,422
py
Python
app.py
skrzypak/soaf
f742d4b090fad72893ed1f509f4abdbb020aa99d
[ "MIT" ]
null
null
null
app.py
skrzypak/soaf
f742d4b090fad72893ed1f509f4abdbb020aa99d
[ "MIT" ]
null
null
null
app.py
skrzypak/soaf
f742d4b090fad72893ed1f509f4abdbb020aa99d
[ "MIT" ]
null
null
null
import glob import shutil import subprocess import os import sys import argparse # Read and save metadata from file def exiftool_metadata(path): metadata = {} exifToolPath = 'exifTool.exe' ''' use Exif tool to get the metadata ''' process = subprocess.Popen( [ exifToolPath, ...
32.755556
130
0.556083
import glob import shutil import subprocess import os import sys import argparse def exiftool_metadata(path): metadata = {} exifToolPath = 'exifTool.exe' process = subprocess.Popen( [ exifToolPath, path ], stdout=subprocess.PIPE, stderr=subprocess.S...
true
true
7902cfa1585d2886bd5352c72d9a37fa9e074b40
7,243
py
Python
homeassistant/components/dyson/vacuum.py
FlorianLudwig/home-assistant
29ad3961e581d3591ce0963a7fa01672abadedf7
[ "Apache-2.0" ]
2
2017-10-26T19:43:55.000Z
2017-12-30T23:29:00.000Z
homeassistant/components/dyson/vacuum.py
FlorianLudwig/home-assistant
29ad3961e581d3591ce0963a7fa01672abadedf7
[ "Apache-2.0" ]
2
2019-04-15T02:43:04.000Z
2019-04-15T02:49:10.000Z
homeassistant/components/dyson/vacuum.py
FlorianLudwig/home-assistant
29ad3961e581d3591ce0963a7fa01672abadedf7
[ "Apache-2.0" ]
1
2019-06-19T07:43:11.000Z
2019-06-19T07:43:11.000Z
""" Support for the Dyson 360 eye vacuum cleaner robot. For more details about this platform, please refer to the documentation https://home-assistant.io/components/vacuum.dyson/ """ import logging from homeassistant.components.vacuum import ( SUPPORT_BATTERY, SUPPORT_FAN_SPEED, SUPPORT_PAUSE, SUPPORT_RETURN_HOME...
34.655502
79
0.654701
import logging from homeassistant.components.vacuum import ( SUPPORT_BATTERY, SUPPORT_FAN_SPEED, SUPPORT_PAUSE, SUPPORT_RETURN_HOME, SUPPORT_STATUS, SUPPORT_STOP, SUPPORT_TURN_OFF, SUPPORT_TURN_ON, VacuumDevice) from homeassistant.helpers.icon import icon_for_battery_level from . import DYSON_DEVICES _LO...
true
true
7902cff85dd9987e371017e720b8eb7568470281
428
py
Python
output/models/nist_data/union/short_g_year/schema_instance/nistschema_sv_iv_union_short_g_year_pattern_3_xsd/nistschema_sv_iv_union_short_g_year_pattern_3.py
tefra/xsdata-w3c-tests
b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f
[ "MIT" ]
1
2021-08-14T17:59:21.000Z
2021-08-14T17:59:21.000Z
output/models/nist_data/union/short_g_year/schema_instance/nistschema_sv_iv_union_short_g_year_pattern_3_xsd/nistschema_sv_iv_union_short_g_year_pattern_3.py
tefra/xsdata-w3c-tests
b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f
[ "MIT" ]
4
2020-02-12T21:30:44.000Z
2020-04-15T20:06:46.000Z
output/models/nist_data/union/short_g_year/schema_instance/nistschema_sv_iv_union_short_g_year_pattern_3_xsd/nistschema_sv_iv_union_short_g_year_pattern_3.py
tefra/xsdata-w3c-tests
b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f
[ "MIT" ]
null
null
null
from dataclasses import dataclass, field __NAMESPACE__ = "NISTSchema-SV-IV-union-short-gYear-pattern-3-NS" @dataclass class NistschemaSvIvUnionShortGYearPattern3: class Meta: name = "NISTSchema-SV-IV-union-short-gYear-pattern-3" namespace = "NISTSchema-SV-IV-union-short-gYear-pattern-3-NS" v...
23.777778
69
0.64486
from dataclasses import dataclass, field __NAMESPACE__ = "NISTSchema-SV-IV-union-short-gYear-pattern-3-NS" @dataclass class NistschemaSvIvUnionShortGYearPattern3: class Meta: name = "NISTSchema-SV-IV-union-short-gYear-pattern-3" namespace = "NISTSchema-SV-IV-union-short-gYear-pattern-3-NS" v...
true
true
7902d0a5a3ebe22ec9f92c39e04b99535a9f9cb4
3,270
py
Python
benchmarks/jhaskellbenchmark.py
hnefatl/dissertation-project
400152de25fd476c20730d85663da7f1e16b9b52
[ "BSD-3-Clause" ]
3
2019-01-27T22:13:29.000Z
2022-03-10T20:11:47.000Z
benchmarks/jhaskellbenchmark.py
hnefatl/dissertation-project
400152de25fd476c20730d85663da7f1e16b9b52
[ "BSD-3-Clause" ]
2
2019-01-27T14:07:15.000Z
2019-04-23T15:13:57.000Z
benchmarks/jhaskellbenchmark.py
hnefatl/dissertation-project
400152de25fd476c20730d85663da7f1e16b9b52
[ "BSD-3-Clause" ]
1
2019-01-27T21:42:55.000Z
2019-01-27T21:42:55.000Z
import os import shutil import subprocess import re import string import pathlib import timeit import jmhbenchmark class JHaskellBenchmark(jmhbenchmark.JMHBenchmark): def __init__(self, name, source_path, compiler_args=None): if compiler_args is None: compiler_args = [] source_path = ...
32.376238
113
0.576758
import os import shutil import subprocess import re import string import pathlib import timeit import jmhbenchmark class JHaskellBenchmark(jmhbenchmark.JMHBenchmark): def __init__(self, name, source_path, compiler_args=None): if compiler_args is None: compiler_args = [] source_path = ...
true
true
7902d1fca3bc1c75daba249dfaafa2560662d62f
1,103
py
Python
website-generator.d/80-not-found-page.py
Lyrics/lyrics-website
d16073e4a4abc9032942d36d29c72aee1b245ff6
[ "BSD-3-Clause" ]
3
2020-12-04T13:40:44.000Z
2021-06-19T10:02:52.000Z
website-generator.d/80-not-found-page.py
Lyrics/lyrics-website
d16073e4a4abc9032942d36d29c72aee1b245ff6
[ "BSD-3-Clause" ]
20
2020-02-12T06:40:16.000Z
2022-01-16T08:45:19.000Z
website-generator.d/80-not-found-page.py
Lyrics/lyrics-website
d16073e4a4abc9032942d36d29c72aee1b245ff6
[ "BSD-3-Clause" ]
1
2020-12-10T11:29:15.000Z
2020-12-10T11:29:15.000Z
## Creates 404 page import pystache import utils def main(data): html = pystache.render(data["templates"]["page"], { "title": "Page not found", "description": "Error 404: page not found", ## Since we don't know the depth of this page relative to the root, ## we have to assum...
40.851852
98
0.614687
import utils def main(data): html = pystache.render(data["templates"]["page"], { "title": "Page not found", "description": "Error 404: page not found", oot of this web resource "navigation": utils.generateTopBarNavigation("/" + data["config"].get("Site", "DbPath")), ...
true
true
7902d2d6689267442854e94c42c7ba663bc01b2a
3,504
py
Python
db/dbClient.py
dota2heqiuzhi/proxy_pool
c5aa6b37799c265dd5f331db0449fee788b8cc0d
[ "MIT" ]
null
null
null
db/dbClient.py
dota2heqiuzhi/proxy_pool
c5aa6b37799c265dd5f331db0449fee788b8cc0d
[ "MIT" ]
null
null
null
db/dbClient.py
dota2heqiuzhi/proxy_pool
c5aa6b37799c265dd5f331db0449fee788b8cc0d
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # !/usr/bin/env python """ ------------------------------------------------- File Name: DbClient.py Description : DB工厂类 Author : JHao date: 2016/12/2 ------------------------------------------------- Change Activity: 2016/12/02: DB工厂类 ...
28.487805
107
0.50742
__author__ = 'JHao' import os import sys from util.six import urlparse, withMetaclass from util.singleton import Singleton sys.path.append(os.path.dirname(os.path.abspath(__file__))) class DbClient(withMetaclass(Singleton)): def __init__(self, db_conn): self.parseDbConn(db_conn) self.__initD...
true
true
7902d3771bc4bc4186cf4f97a4a24526e1f11130
27,032
py
Python
tests/cupy_tests/core_tests/test_ndarray_elementwise_op.py
Onkar627/cupy
8eef1ad5393c0a92c5065bc05137bf997f37044a
[ "MIT" ]
1
2022-01-12T22:57:54.000Z
2022-01-12T22:57:54.000Z
tests/cupy_tests/core_tests/test_ndarray_elementwise_op.py
Onkar627/cupy
8eef1ad5393c0a92c5065bc05137bf997f37044a
[ "MIT" ]
null
null
null
tests/cupy_tests/core_tests/test_ndarray_elementwise_op.py
Onkar627/cupy
8eef1ad5393c0a92c5065bc05137bf997f37044a
[ "MIT" ]
1
2022-03-21T20:19:12.000Z
2022-03-21T20:19:12.000Z
import operator import numpy import pytest import cupy from cupy import testing class TestArrayElementwiseOp: @testing.for_all_dtypes_combination(names=['x_type', 'y_type']) @testing.numpy_cupy_allclose(rtol=1e-6, accept_error=TypeError) def check_array_scalar_op(self, op, xp, x_type, y_type, swap=Fals...
34.835052
79
0.660328
import operator import numpy import pytest import cupy from cupy import testing class TestArrayElementwiseOp: @testing.for_all_dtypes_combination(names=['x_type', 'y_type']) @testing.numpy_cupy_allclose(rtol=1e-6, accept_error=TypeError) def check_array_scalar_op(self, op, xp, x_type, y_type, swap=Fals...
true
true
7902d3d65beb69e0425055a6b53fa94e39aa393d
434
py
Python
data/get-sensor-data.py
PecceG2/Home-Assistant-SNMP-Sensor-Server
5b8a27de098c160d2280b08109c8da270bd13730
[ "MIT" ]
null
null
null
data/get-sensor-data.py
PecceG2/Home-Assistant-SNMP-Sensor-Server
5b8a27de098c160d2280b08109c8da270bd13730
[ "MIT" ]
null
null
null
data/get-sensor-data.py
PecceG2/Home-Assistant-SNMP-Sensor-Server
5b8a27de098c160d2280b08109c8da270bd13730
[ "MIT" ]
null
null
null
import sys, os import json from requests import get sensorID = sys.argv[1] SupervisorToken = os.environ["SUPERVISOR_TOKEN"] url = "http://supervisor/core/api/states/"+sensorID headers = { "Authorization": "Bearer "+SupervisorToken, "content-type": "application/json", } ha_sensor_data_request = get(url, hea...
21.7
51
0.748848
import sys, os import json from requests import get sensorID = sys.argv[1] SupervisorToken = os.environ["SUPERVISOR_TOKEN"] url = "http://supervisor/core/api/states/"+sensorID headers = { "Authorization": "Bearer "+SupervisorToken, "content-type": "application/json", } ha_sensor_data_request = get(url, hea...
true
true
7902d433aad59b705c0a7a17b81b4925abd64ba1
6,043
py
Python
examples/app/clustering/main.py
SiggyF/bokeh
52a2ce993b0f1102fd9e136f66036f52e91cdcc3
[ "BSD-3-Clause" ]
null
null
null
examples/app/clustering/main.py
SiggyF/bokeh
52a2ce993b0f1102fd9e136f66036f52e91cdcc3
[ "BSD-3-Clause" ]
null
null
null
examples/app/clustering/main.py
SiggyF/bokeh
52a2ce993b0f1102fd9e136f66036f52e91cdcc3
[ "BSD-3-Clause" ]
null
null
null
import numpy as np np.random.seed(0) from bokeh.io import curdoc from bokeh.layouts import widgetbox, row, column from bokeh.models import ColumnDataSource, Select, Slider from bokeh.plotting import figure from bokeh.palettes import Spectral6 from sklearn import cluster, datasets from sklearn.neighbors import kneighb...
31.473958
74
0.608307
import numpy as np np.random.seed(0) from bokeh.io import curdoc from bokeh.layouts import widgetbox, row, column from bokeh.models import ColumnDataSource, Select, Slider from bokeh.plotting import figure from bokeh.palettes import Spectral6 from sklearn import cluster, datasets from sklearn.neighbors import kneighb...
true
true
7902d4cda740f439190486eb8a11420759266e38
4,842
py
Python
dqc/api/loadbasis.py
Jaikinator/dqc
47c964c7d1323a35f4f69521d40476c41843810e
[ "Apache-2.0" ]
39
2021-05-31T17:01:23.000Z
2022-03-23T19:20:35.000Z
dqc/api/loadbasis.py
Jaikinator/dqc
47c964c7d1323a35f4f69521d40476c41843810e
[ "Apache-2.0" ]
14
2021-09-01T13:39:11.000Z
2022-03-13T16:45:39.000Z
dqc/api/loadbasis.py
Jaikinator/dqc
47c964c7d1323a35f4f69521d40476c41843810e
[ "Apache-2.0" ]
6
2021-07-16T09:08:29.000Z
2022-02-24T01:13:54.000Z
import os import torch from typing import List from dqc.utils.datastruct import CGTOBasis __all__ = ["loadbasis"] _dtype = torch.double _device = torch.device("cpu") def loadbasis(cmd: str, dtype: torch.dtype = _dtype, device: torch.device = _device, requires_grad: bool = False) -> \ ...
31.647059
101
0.564436
import os import torch from typing import List from dqc.utils.datastruct import CGTOBasis __all__ = ["loadbasis"] _dtype = torch.double _device = torch.device("cpu") def loadbasis(cmd: str, dtype: torch.dtype = _dtype, device: torch.device = _device, requires_grad: bool = False) -> \ ...
true
true
7902d5e6c435aa46f407cf0e82499ae2efbef440
598
py
Python
examples/mycommands.py
gtmanfred/irc3
1ade641c35a75f5944f78707722c93af34ad8e86
[ "MIT" ]
178
2015-01-10T22:44:41.000Z
2022-01-27T03:35:30.000Z
examples/mycommands.py
gtmanfred/irc3
1ade641c35a75f5944f78707722c93af34ad8e86
[ "MIT" ]
136
2015-01-11T09:32:01.000Z
2022-02-07T13:33:40.000Z
examples/mycommands.py
gtmanfred/irc3
1ade641c35a75f5944f78707722c93af34ad8e86
[ "MIT" ]
58
2015-02-02T13:34:01.000Z
2021-09-23T16:03:18.000Z
# -*- coding: utf-8 -*- from irc3.plugins.command import command @command def echo(bot, mask, target, args): """Echo command %%echo <words>... """ yield ' '.join(args['<words>']) @command(permission='admin', public=False) def adduser(bot, mask, target, args): """Add a user %%adduse...
19.933333
56
0.618729
from irc3.plugins.command import command @command def echo(bot, mask, target, args): yield ' '.join(args['<words>']) @command(permission='admin', public=False) def adduser(bot, mask, target, args): bot.privmsg(mask.nick, 'User added') @command(show_in_help_list=False) def my_secret_operation(bot, mask, t...
true
true
7902d6fc769f65ea7a3770011a1b1d995a07eea6
7,788
py
Python
pytorch_lightning/callbacks/early_stopping.py
shivin7/pytorch-lightning
9f2b29a7cd4b56c0d6afbbc4a1e0971d49c5f1d7
[ "Apache-2.0" ]
null
null
null
pytorch_lightning/callbacks/early_stopping.py
shivin7/pytorch-lightning
9f2b29a7cd4b56c0d6afbbc4a1e0971d49c5f1d7
[ "Apache-2.0" ]
null
null
null
pytorch_lightning/callbacks/early_stopping.py
shivin7/pytorch-lightning
9f2b29a7cd4b56c0d6afbbc4a1e0971d49c5f1d7
[ "Apache-2.0" ]
null
null
null
r""" Early Stopping ^^^^^^^^^^^^^^ Monitor a validation metric and stop training when it stops improving. """ from copy import deepcopy import numpy as np import torch import torch.distributed as dist from pytorch_lightning import _logger as log from pytorch_lightning.callbacks.base import Callback from pytorch_lig...
37.442308
116
0.635336
from copy import deepcopy import numpy as np import torch import torch.distributed as dist from pytorch_lightning import _logger as log from pytorch_lightning.callbacks.base import Callback from pytorch_lightning.utilities import rank_zero_warn torch_inf = torch.tensor(np.Inf) try: import torch_xla import t...
true
true
7902d739fcae01a162ee9425a03e26a9514d0900
44
py
Python
arclet/edoves/main/message/__init__.py
ArcletProject/Edoves
b28423057ab765796d5299b5d8f98a0e8ce494dd
[ "MIT" ]
2
2022-01-25T16:05:30.000Z
2022-02-12T18:33:39.000Z
arclet/edoves/main/message/__init__.py
ArcletProject/Edoves
b28423057ab765796d5299b5d8f98a0e8ce494dd
[ "MIT" ]
4
2022-03-04T08:24:53.000Z
2022-03-23T15:22:26.000Z
arclet/edoves/main/message/__init__.py
ArcletProject/Edoves
b28423057ab765796d5299b5d8f98a0e8ce494dd
[ "MIT" ]
null
null
null
from .chain import * from .element import *
14.666667
22
0.727273
from .chain import * from .element import *
true
true
7902d850c8928e9f903904e80cbc33fda5c7b2b3
884
py
Python
Lists/lists-beg.py
Peabody29/Python_Projects-ST
e15eec8ac00a501c09296163c9adaf25ca928f5b
[ "MIT" ]
null
null
null
Lists/lists-beg.py
Peabody29/Python_Projects-ST
e15eec8ac00a501c09296163c9adaf25ca928f5b
[ "MIT" ]
null
null
null
Lists/lists-beg.py
Peabody29/Python_Projects-ST
e15eec8ac00a501c09296163c9adaf25ca928f5b
[ "MIT" ]
null
null
null
"""DATA STRUCTURES""" # Algorithms are set of rules used to solve a problem # Data structures are a way of organizing data in a computer # colors = ['red', 'yellow', [5, 6], 'blue'] friends = ['Josh', 'Renee', 'Agnes'] # print(colors) # print(colors[1]) # colors[2] = 'green' # mutability of lists # print(colors) # pri...
35.36
96
0.676471
friends = ['Josh', 'Renee', 'Agnes']
true
true
7902d8816f7003d12c5ca747d93f8fe1b0722dff
277
py
Python
4/tests/test_python.py
microcoder/course-python-mipt
60be3713b1960e31beb355321170c7afe72535b0
[ "MIT" ]
null
null
null
4/tests/test_python.py
microcoder/course-python-mipt
60be3713b1960e31beb355321170c7afe72535b0
[ "MIT" ]
null
null
null
4/tests/test_python.py
microcoder/course-python-mipt
60be3713b1960e31beb355321170c7afe72535b0
[ "MIT" ]
null
null
null
import unittest class TestPython(unittest.TestCase): def test_float_to_int_coercion(self): self.assertEqual(1, int(1.0)) def test_get_empty_dict(self): self.assertIsNone({}.get('key')) def test_trueness(self): self.assertTrue(bool(10))
19.785714
41
0.67509
import unittest class TestPython(unittest.TestCase): def test_float_to_int_coercion(self): self.assertEqual(1, int(1.0)) def test_get_empty_dict(self): self.assertIsNone({}.get('key')) def test_trueness(self): self.assertTrue(bool(10))
true
true