hexsha
stringlengths
40
40
size
int64
2
1.02M
ext
stringclasses
10 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
2
1.02M
avg_line_length
float64
1
958k
max_line_length
int64
1
987k
alphanum_fraction
float64
0
1
content_no_comment
stringlengths
0
1.01M
is_comment_constant_removed
bool
2 classes
is_sharp_comment_removed
bool
1 class
1c101053ad77fe18e38beeebc93dc8d98cd9232b
2,778
py
Python
tests/unit/test_api.py
OpenPermissions/chub
00762aa17015f4b3010673d1570c708eab3c34ed
[ "Apache-2.0" ]
2
2016-05-03T20:08:29.000Z
2019-05-20T01:45:55.000Z
tests/unit/test_api.py
OpenPermissions/chub
00762aa17015f4b3010673d1570c708eab3c34ed
[ "Apache-2.0" ]
1
2016-05-17T12:20:26.000Z
2016-05-17T12:20:26.000Z
tests/unit/test_api.py
OpenPermissions/chub
00762aa17015f4b3010673d1570c708eab3c34ed
[ "Apache-2.0" ]
1
2019-05-20T01:46:01.000Z
2019-05-20T01:46:01.000Z
# -*- coding: utf-8 -*- # Copyright 2016 Open Permissions Platform Coalition # 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 appl...
34.296296
107
0.672426
from tornado.httpclient import AsyncHTTPClient, HTTPClient from chub import API from chub.api import API_VERSION from mock import patch import pytest def test_async_api(): api = API('http://example.com') assert api.base_url == 'http://example.com/' + API_VERSION isinstance(api.fetch.keywords['httpclient'...
false
true
1c1010e1ec0d924edbab4b4f9644f495e07fe461
3,548
py
Python
src/train-binary.py
patliang/inpredo
3133a9a64edb5f6cb2b91ee4c16ac61ce6c254e3
[ "MIT" ]
null
null
null
src/train-binary.py
patliang/inpredo
3133a9a64edb5f6cb2b91ee4c16ac61ce6c254e3
[ "MIT" ]
null
null
null
src/train-binary.py
patliang/inpredo
3133a9a64edb5f6cb2b91ee4c16ac61ce6c254e3
[ "MIT" ]
null
null
null
import os import sys # If you like to speed up training process with GPU, first install PlaidML and then uncomment the following line. # Otherwise it will fallback to tensorflow. # os.environ["KERAS_BACKEND"] = "plaidml.keras.backend" from tensorflow import keras from keras import optimizers from keras.layers impor...
28.845528
120
0.753664
import os import sys from tensorflow import keras from keras import optimizers from keras.layers import Dropout, Flatten, Dense, Activation, BatchNormalization from keras.layers.convolutional import Convolution2D, MaxPooling2D, Conv2D from keras.models import Sequential from keras.preprocessing.image import ImageDa...
true
true
1c1010edc71d8048d92c0b1e8c9b5d1094970fe9
1,579
py
Python
python/raspberrypi/examples/get_acceleration/get_acceleration.py
cdjq/DFRobot_H3LIS
ad01827562ae820295cf649ef367dc999a3af881
[ "MIT" ]
null
null
null
python/raspberrypi/examples/get_acceleration/get_acceleration.py
cdjq/DFRobot_H3LIS
ad01827562ae820295cf649ef367dc999a3af881
[ "MIT" ]
null
null
null
python/raspberrypi/examples/get_acceleration/get_acceleration.py
cdjq/DFRobot_H3LIS
ad01827562ae820295cf649ef367dc999a3af881
[ "MIT" ]
null
null
null
# -*- coding:utf-8 -*- """ @file get_acceleration.py @brief Get the acceleration in x, y, z directions @copyright Copyright (c) 2010 DFRobot Co.Ltd (http://www.dfrobot.com) @licence The MIT License (MIT) @author [fengli](li.feng@dfrobot.com) @version V1.0 @date 2021-01-16 @get from https://www.df...
23.220588
77
0.645345
import sys sys.path.append("../..") from DFRobot_H3LIS import * import time I2C_MODE = 0x01 ADDRESS_0 = 0x19 acce = DFRobot_H3LIS_I2C(I2C_MODE ,ADDRESS_0) acce.begin() print("chip id :") print(acce.get_id()) acce.set_range(acce.RANGE_100_G) acce.set_acquire_rate(acce.N...
true
true
1c101116d398ed1964d8f9dcb52d13eaef7d74a6
5,771
py
Python
talon/bruteforce.py
atanasoff-yordan/talon
b44636997c3ee3798ad840725eb034d66b5cf713
[ "Apache-2.0" ]
null
null
null
talon/bruteforce.py
atanasoff-yordan/talon
b44636997c3ee3798ad840725eb034d66b5cf713
[ "Apache-2.0" ]
null
null
null
talon/bruteforce.py
atanasoff-yordan/talon
b44636997c3ee3798ad840725eb034d66b5cf713
[ "Apache-2.0" ]
null
null
null
from __future__ import absolute_import import logging import regex as re SIGNATURE_MAX_LINES = 11 TOO_LONG_SIGNATURE_LINE = 60 from talon.utils import get_delimiter log = logging.getLogger(__name__) # regex to fetch signature based on common signature words RE_SIGNATURE = re.compile(r''' ( ...
30.534392
77
0.568706
from __future__ import absolute_import import logging import regex as re SIGNATURE_MAX_LINES = 11 TOO_LONG_SIGNATURE_LINE = 60 from talon.utils import get_delimiter log = logging.getLogger(__name__) RE_SIGNATURE = re.compile(r''' ( (?: ^[\s]*--*[\s]*[a-z \....
true
true
1c101149e7bd3bb2a7a7803770e04eafbd101c03
2,031
py
Python
tests/base/model_valid_epoch_ends.py
Kshitij09/pytorch-lightning
63bd0582e35ad865c1f07f61975456f65de0f41f
[ "Apache-2.0" ]
1
2020-07-30T08:29:54.000Z
2020-07-30T08:29:54.000Z
tests/base/model_valid_epoch_ends.py
Kshitij09/pytorch-lightning
63bd0582e35ad865c1f07f61975456f65de0f41f
[ "Apache-2.0" ]
null
null
null
tests/base/model_valid_epoch_ends.py
Kshitij09/pytorch-lightning
63bd0582e35ad865c1f07f61975456f65de0f41f
[ "Apache-2.0" ]
null
null
null
from abc import ABC import torch class ValidationEpochEndVariations(ABC): """ Houses all variations of validation_epoch_end steps """ def validation_epoch_end(self, outputs): """ Called at the end of validation to aggregate outputs Args: outputs: list of individu...
33.85
102
0.602659
from abc import ABC import torch class ValidationEpochEndVariations(ABC): def validation_epoch_end(self, outputs): def _mean(res, key): return torch.stack([x[key] if isinstance(x, dict) else _mean(x, key) for x in res]).mean() val_loss_mean = _mean(output...
true
true
1c10114aa5cd2e016e79ca3b456e2b7902a24e3e
823
py
Python
parser/support/fields.py
hasdank/facebook-ads-worker
a37cec0394b99195cf956564b550a04c01aa2370
[ "MIT" ]
3
2018-07-08T13:10:29.000Z
2019-04-20T05:08:14.000Z
parser/support/fields.py
hasdank/facebook-ads-worker
a37cec0394b99195cf956564b550a04c01aa2370
[ "MIT" ]
null
null
null
parser/support/fields.py
hasdank/facebook-ads-worker
a37cec0394b99195cf956564b550a04c01aa2370
[ "MIT" ]
1
2018-07-08T13:10:40.000Z
2018-07-08T13:10:40.000Z
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # @copyright 2018, Jeff Tanner, jeff00seattle # @namespace facebook_ads_worker PROFILE = [ ] REFERENCES = [ 'date', 'hour', 'timezone', 'granularity', 'cost_currency', 'ad_name', 'ad_id', 'adset_name', 'adset_id', 'campaign_name'...
21.102564
46
0.682868
PROFILE = [ ] REFERENCES = [ 'date', 'hour', 'timezone', 'granularity', 'cost_currency', 'ad_name', 'ad_id', 'adset_name', 'adset_id', 'campaign_name', 'campaign_id', 'campaign_type', 'campaign_platform', 'impression_device' ] UNMAPPED_IN_AA_METRICS = [ 're...
true
true
1c10116a2e812cb0dda9460d342a9cfaadcfd76d
903
py
Python
tests/scalar/test_basic_sympy.py
michaelosthege/aesara
55c88832ba71f87c9612d573ede74a4c042ef570
[ "BSD-3-Clause" ]
1
2020-12-30T19:12:52.000Z
2020-12-30T19:12:52.000Z
tests/scalar/test_basic_sympy.py
luke14free/Theano-PyMC
511c778f8a595444e009bcad738d552413b16f2c
[ "BSD-3-Clause" ]
null
null
null
tests/scalar/test_basic_sympy.py
luke14free/Theano-PyMC
511c778f8a595444e009bcad738d552413b16f2c
[ "BSD-3-Clause" ]
null
null
null
import pytest import theano sympy = pytest.importorskip("sympy") from theano.scalar.basic import floats from theano.scalar.basic_sympy import SymPyCCode xs = sympy.Symbol("x") ys = sympy.Symbol("y") xt, yt = floats("xy") @pytest.mark.skipif(not theano.config.cxx, reason="Need cxx for this test") def test_SymPy...
22.575
75
0.625692
import pytest import theano sympy = pytest.importorskip("sympy") from theano.scalar.basic import floats from theano.scalar.basic_sympy import SymPyCCode xs = sympy.Symbol("x") ys = sympy.Symbol("y") xt, yt = floats("xy") @pytest.mark.skipif(not theano.config.cxx, reason="Need cxx for this test") def test_SymPy...
true
true
1c1011a78a5fadcb07aab754600b336cc2ac09cb
952
py
Python
lab3/final/Source/scripts/make_an_Arff.py
etzinis/pat_rec_ntua
e565b791206a6a1ab44630db519fd54f62f6e3e0
[ "MIT" ]
2
2018-09-01T00:26:34.000Z
2022-01-06T14:13:26.000Z
lab3/final/Source/scripts/make_an_Arff.py
etzinis/pat_rec_ntua
e565b791206a6a1ab44630db519fd54f62f6e3e0
[ "MIT" ]
null
null
null
lab3/final/Source/scripts/make_an_Arff.py
etzinis/pat_rec_ntua
e565b791206a6a1ab44630db519fd54f62f6e3e0
[ "MIT" ]
null
null
null
import os, sys def make_header(arff_name, data_lines): dataout = open(arff_name,"w") dataout.write("%Thymios - Kostantinos Pattern Recognition\n") dataout.write("@RELATION Music_Emotion_Recognition\n\n") for i in range(1,len(data_lines[0].split(","))): dataout.write("@ATTRIBUTE Feature"+ str(i) + " NUMERIC\n") ...
28
89
0.689076
import os, sys def make_header(arff_name, data_lines): dataout = open(arff_name,"w") dataout.write("%Thymios - Kostantinos Pattern Recognition\n") dataout.write("@RELATION Music_Emotion_Recognition\n\n") for i in range(1,len(data_lines[0].split(","))): dataout.write("@ATTRIBUTE Feature"+ str(i) + " NUMERIC\n") ...
false
true
1c1013afb900f2719af16cb2bfa59008ac9e12f6
1,481
py
Python
test/test_option.py
jonathf/npoly
9df4bd2a3b134e8a196e24389c0ad84c26da9662
[ "BSD-2-Clause" ]
8
2019-12-13T23:54:33.000Z
2021-11-08T22:44:25.000Z
test/test_option.py
jonathf/npoly
9df4bd2a3b134e8a196e24389c0ad84c26da9662
[ "BSD-2-Clause" ]
54
2019-08-25T20:03:10.000Z
2021-08-09T08:59:27.000Z
test/test_option.py
jonathf/npoly
9df4bd2a3b134e8a196e24389c0ad84c26da9662
[ "BSD-2-Clause" ]
2
2020-03-05T12:03:28.000Z
2021-03-07T16:56:09.000Z
import pytest import numpy import numpoly POLYNOMIAL_CONFIGURATIONS = [ dict(zip(["display_graded", "display_inverse", "display_reverse", "expected_output"], args) ) for args in [ (False, False, False, "1+q0+q0**2+q1+q0*q1+q1**2"), (False, True, False, "q1**2+q0*q1+q1+q0**2+q0+1"...
37.025
95
0.628629
import pytest import numpy import numpoly POLYNOMIAL_CONFIGURATIONS = [ dict(zip(["display_graded", "display_inverse", "display_reverse", "expected_output"], args) ) for args in [ (False, False, False, "1+q0+q0**2+q1+q0*q1+q1**2"), (False, True, False, "q1**2+q0*q1+q1+q0**2+q0+1"...
true
true
1c1013b0762c54d5680825317eda0c483cecec04
170
py
Python
testcase/api/department/__init__.py
lewyuejian/Automation
18122ce2c5debe485fab7dac5f8007f4b7b2d51f
[ "MIT" ]
1
2021-12-07T08:38:54.000Z
2021-12-07T08:38:54.000Z
testcase/api/department/__init__.py
lewyuejian/ApiAutomation
18122ce2c5debe485fab7dac5f8007f4b7b2d51f
[ "MIT" ]
null
null
null
testcase/api/department/__init__.py
lewyuejian/ApiAutomation
18122ce2c5debe485fab7dac5f8007f4b7b2d51f
[ "MIT" ]
1
2021-08-15T07:12:52.000Z
2021-08-15T07:12:52.000Z
#!/usr/bin/env python3 # -*- encoding: utf-8 -*- ''' @author: yuejl @application: @contact: lewyuejian@163.com @file: __init__.py.py @time: 2021/6/26 0026 9:11 @desc: '''
17
28
0.652941
true
true
1c1014474a9dcbed848223febcb1b624df2f9296
1,837
py
Python
package/spack-r-rtsne/package.py
ctuning/ck-spack
307934efce1be2d4f104251275c82fbc70127105
[ "BSD-3-Clause" ]
1
2018-07-17T07:45:09.000Z
2018-07-17T07:45:09.000Z
package/spack-r-rtsne/package.py
ctuning/ck-spack
307934efce1be2d4f104251275c82fbc70127105
[ "BSD-3-Clause" ]
null
null
null
package/spack-r-rtsne/package.py
ctuning/ck-spack
307934efce1be2d4f104251275c82fbc70127105
[ "BSD-3-Clause" ]
null
null
null
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
43.738095
78
0.678824
from spack import * class RRtsne(RPackage): homepage = "https://CRAN.R-project.org/package=Rtsne" url = "https://cran.r-project.org/src/contrib/Rtsne_0.13.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/Rtsne" version('0.13', 'ea1d2ef2bda16735bbf219ffda5b0661') version('0...
true
true
1c1014e9d48ab664c183f1b0aa8a1413fc52c7d7
35,062
py
Python
src/access_key_auto_rotation/account_scan.py
joeyparis/serverless-aws-iam-access-key-auto-rotation
273478a0efbdc0a9d83ce70f9f5e17d3a6bbdc0f
[ "MIT-0" ]
null
null
null
src/access_key_auto_rotation/account_scan.py
joeyparis/serverless-aws-iam-access-key-auto-rotation
273478a0efbdc0a9d83ce70f9f5e17d3a6bbdc0f
[ "MIT-0" ]
null
null
null
src/access_key_auto_rotation/account_scan.py
joeyparis/serverless-aws-iam-access-key-auto-rotation
273478a0efbdc0a9d83ce70f9f5e17d3a6bbdc0f
[ "MIT-0" ]
null
null
null
# (c) 2021 Amazon Web Services, Inc. or its affiliates. All Rights Reserved. # This AWS Content is provided subject to the terms of the AWS Customer Agreement available at # https://aws.amazon.com/agreement/ or other written agreement between Customer # and Amazon Web Services, Inc. """Key Actions - Mapping of Action ...
45.24129
94
0.475386
import datetime import dateutil.tz from enum import Enum from config import Config, log from exemption_handler import validate_exemption_group class ActionReasons(Enum): UNUSED_EXPIRED_KEY = 'Expired key has never been used.' EXPIRED_ACTIVE_KEY = 'Active key has expired.' FORCED_ROTATION = 'Forced acti...
true
true
1c101516d2722fbf88afbba806e7502fe7b6d596
1,955
py
Python
awsmetric2csv.py
gabrieldesousah/awsmetric2csv
adcc8f42a8c1b5eba8a1f7413c24165d2e7d65ff
[ "MIT" ]
14
2018-04-23T20:24:54.000Z
2021-04-20T01:46:13.000Z
awsmetric2csv.py
gabrieldesousah/awsmetric2csv
adcc8f42a8c1b5eba8a1f7413c24165d2e7d65ff
[ "MIT" ]
1
2020-03-04T15:01:25.000Z
2020-03-23T09:41:47.000Z
awsmetric2csv.py
gabrieldesousah/awsmetric2csv
adcc8f42a8c1b5eba8a1f7413c24165d2e7d65ff
[ "MIT" ]
13
2018-05-07T11:15:32.000Z
2021-06-23T09:45:06.000Z
import argparse import csv import utils # parse argument parser = argparse.ArgumentParser() parser.add_argument("resource") parser.add_argument("--period", help=""" The granularity, in seconds, of the returned data points. A period can be as short as one minute (60 seconds) and must be a multiple of 60. Th...
32.04918
72
0.689003
import argparse import csv import utils parser = argparse.ArgumentParser() parser.add_argument("resource") parser.add_argument("--period", help=""" The granularity, in seconds, of the returned data points. A period can be as short as one minute (60 seconds) and must be a multiple of 60. The default value i...
true
true
1c101523a55f6bafd87858a322540cf8a50bfd03
1,294
py
Python
scripts/box3d_trpo/train_encoder_on_states.py
fredshentu/public_model_based_controller
9301699bc56aa49ba5c699f7d5be299046a8aa0c
[ "MIT" ]
null
null
null
scripts/box3d_trpo/train_encoder_on_states.py
fredshentu/public_model_based_controller
9301699bc56aa49ba5c699f7d5be299046a8aa0c
[ "MIT" ]
null
null
null
scripts/box3d_trpo/train_encoder_on_states.py
fredshentu/public_model_based_controller
9301699bc56aa49ba5c699f7d5be299046a8aa0c
[ "MIT" ]
null
null
null
from rllab.envs.normalized_env import normalize from railrl.predictors.dynamics_model import ConvEncoder, InverseModel, ForwardModel from railrl.predictors.mlp import Mlp from sandbox.rocky.tf.envs.base import TfEnv from rllab.envs.gym_env import GymEnv import argparse import numpy as np import tensorflow as tf ENV_N...
27.531915
84
0.646059
from rllab.envs.normalized_env import normalize from railrl.predictors.dynamics_model import ConvEncoder, InverseModel, ForwardModel from railrl.predictors.mlp import Mlp from sandbox.rocky.tf.envs.base import TfEnv from rllab.envs.gym_env import GymEnv import argparse import numpy as np import tensorflow as tf ENV_N...
true
true
1c101577f75d5b9ca82868b8a8f2ca852e08682e
1,007
py
Python
tumblelog/views.py
myles-archive/django-tumblelog
0444679117e3fceed24a9b45f050ce61b68c2b14
[ "MIT" ]
null
null
null
tumblelog/views.py
myles-archive/django-tumblelog
0444679117e3fceed24a9b45f050ce61b68c2b14
[ "MIT" ]
null
null
null
tumblelog/views.py
myles-archive/django-tumblelog
0444679117e3fceed24a9b45f050ce61b68c2b14
[ "MIT" ]
null
null
null
from django.views.generic.detail import DetailView from django.views.generic.list import ListView from tumblelog.models import Post from tumblelog.settings import POSTS_PER_PAGE class PostListView(ListView): context_object_name = 'posts' paginate_by = POSTS_PER_PAGE def get_queryset(self): retur...
27.216216
72
0.673287
from django.views.generic.detail import DetailView from django.views.generic.list import ListView from tumblelog.models import Post from tumblelog.settings import POSTS_PER_PAGE class PostListView(ListView): context_object_name = 'posts' paginate_by = POSTS_PER_PAGE def get_queryset(self): retur...
true
true
1c10163f20a5661ac804e13b0423bd7362d827dc
1,222
py
Python
.history/my_classes/FunctionParameters/KeywordArgs_20210630193333.py
minefarmer/deep-Dive-1
b0675b853180c5b5781888266ea63a3793b8d855
[ "Unlicense" ]
null
null
null
.history/my_classes/FunctionParameters/KeywordArgs_20210630193333.py
minefarmer/deep-Dive-1
b0675b853180c5b5781888266ea63a3793b8d855
[ "Unlicense" ]
null
null
null
.history/my_classes/FunctionParameters/KeywordArgs_20210630193333.py
minefarmer/deep-Dive-1
b0675b853180c5b5781888266ea63a3793b8d855
[ "Unlicense" ]
null
null
null
''' [Keyword Arguments] Positional parameters can, optionally be passed as named (keyword) arguments def func(a, b, c): # code func(1, 2, 3) -> a = 1, b = 2, c = 3 func(a=1, c=3, b=2) -> a = 1, b = 2, c = 3 Using named arguments in this case is entirely up to the caller. ...
23.960784
85
0.57856
true
true
1c10175815eb6c4e70a48fd177a584ea9c464120
26,203
py
Python
sample_project/env/lib/python3.9/site-packages/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_bytecode_utils.py
Istiakmorsalin/ML-Data-Science
681e68059b146343ef55b0671432dc946970730d
[ "MIT" ]
null
null
null
sample_project/env/lib/python3.9/site-packages/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_bytecode_utils.py
Istiakmorsalin/ML-Data-Science
681e68059b146343ef55b0671432dc946970730d
[ "MIT" ]
null
null
null
sample_project/env/lib/python3.9/site-packages/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_bytecode_utils.py
Istiakmorsalin/ML-Data-Science
681e68059b146343ef55b0671432dc946970730d
[ "MIT" ]
null
null
null
""" Bytecode analysing utils. Originally added for using in smart step into. Note: not importable from Python 2. """ import sys if sys.version_info[0] < 3: raise ImportError('This module is only compatible with Python 3.') from _pydev_bundle import pydev_log from types import CodeType from _pydevd_fr...
32.11152
120
0.598672
import sys if sys.version_info[0] < 3: raise ImportError('This module is only compatible with Python 3.') from _pydev_bundle import pydev_log from types import CodeType from _pydevd_frame_eval.vendored.bytecode.instr import _Variable from _pydevd_frame_eval.vendored import bytecode from _pydevd_frame_eva...
true
true
1c101842cabe88c9325183b2b071c02439a223e8
1,445
py
Python
docs/conf.py
vladiibine/mlfazan
90f53b29413a2b4bffdb86930fee3ad6426642e3
[ "MIT" ]
null
null
null
docs/conf.py
vladiibine/mlfazan
90f53b29413a2b4bffdb86930fee3ad6426642e3
[ "MIT" ]
null
null
null
docs/conf.py
vladiibine/mlfazan
90f53b29413a2b4bffdb86930fee3ad6426642e3
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.autosummary', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.ifconfig', 'sphinx.ext.viewcode', 'sphinx.ext.napoleon', 'sphinx.ext.extlinks', ] if os.getenv...
26.272727
78
0.687889
from __future__ import unicode_literals import os extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.autosummary', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.ifconfig', 'sphinx.ext.viewcode', 'sphinx.ext.napoleon', 'sphinx.ext.extlinks', ] if os.getenv('SPELLCHECK'): exte...
true
true
1c10188521bd977744121400d2fa05e946034b2d
3,044
py
Python
utils/bert/create_sent_embedding.py
ze-lin/AudioCaption
0d383c56350b57b3867a91578a11b332b1a29789
[ "MIT" ]
12
2020-08-25T15:00:43.000Z
2022-03-23T13:47:55.000Z
utils/bert/create_sent_embedding.py
ze-lin/AudioCaption
0d383c56350b57b3867a91578a11b332b1a29789
[ "MIT" ]
1
2021-12-14T15:26:18.000Z
2021-12-15T05:31:34.000Z
utils/bert/create_sent_embedding.py
ze-lin/AudioCaption
0d383c56350b57b3867a91578a11b332b1a29789
[ "MIT" ]
2
2021-07-19T01:45:24.000Z
2021-12-17T08:02:36.000Z
import pickle import fire import numpy as np import pandas as pd from tqdm import tqdm class EmbeddingExtractor(object): def extract_sentbert(self, caption_file: str, output: str, dev: bool=True, zh: bool=False): from sentence_transformers import SentenceTransformer lang2model = { "zh...
34.988506
114
0.554534
import pickle import fire import numpy as np import pandas as pd from tqdm import tqdm class EmbeddingExtractor(object): def extract_sentbert(self, caption_file: str, output: str, dev: bool=True, zh: bool=False): from sentence_transformers import SentenceTransformer lang2model = { "zh...
true
true
1c101a0595fb814c05d8564fda98794c6d04cf3a
3,142
py
Python
gui/qt/utxo_list.py
BitzenyCoreDevelopers/electrum_Zeny
597c7ccb32a90a132047b7a992578512d7db6d9e
[ "MIT" ]
6
2017-12-23T06:04:38.000Z
2020-09-18T16:21:29.000Z
gui/qt/utxo_list.py
BitzenyCoreDevelopers/electrum_Zeny
597c7ccb32a90a132047b7a992578512d7db6d9e
[ "MIT" ]
1
2018-01-13T15:20:53.000Z
2018-01-13T15:20:53.000Z
gui/qt/utxo_list.py
BitzenyCoreDevelopers/electrum_Zeny
597c7ccb32a90a132047b7a992578512d7db6d9e
[ "MIT" ]
4
2018-01-13T14:00:52.000Z
2022-02-05T13:41:30.000Z
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2015 Thomas Voegtlin # # 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...
42.459459
138
0.673456
from .util import * from electrum_zeny.i18n import _ from electrum_zeny.bitcoin import is_address class UTXOList(MyTreeWidget): filter_columns = [0, 2] def __init__(self, parent=None): MyTreeWidget.__init__(self, parent, self.create_menu, [ _('Address'), _('Label'), _('Amount'), _('Height'), _('Out...
true
true
1c101a43daaecd696dc074d5892b60a2080b9885
135
py
Python
python/testData/intentions/PyInvertIfConditionIntentionTest/commentsTypeFollowup_after.py
Tasemo/intellij-community
50aeaf729b7073e91c7c77487a1f155e0dfe3fcd
[ "Apache-2.0" ]
2
2019-04-28T07:48:50.000Z
2020-12-11T14:18:08.000Z
python/testData/intentions/PyInvertIfConditionIntentionTest/commentsTypeFollowup_after.py
Tasemo/intellij-community
50aeaf729b7073e91c7c77487a1f155e0dfe3fcd
[ "Apache-2.0" ]
null
null
null
python/testData/intentions/PyInvertIfConditionIntentionTest/commentsTypeFollowup_after.py
Tasemo/intellij-community
50aeaf729b7073e91c7c77487a1f155e0dfe3fcd
[ "Apache-2.0" ]
null
null
null
def func(): value = "not-none" # type: ignore if value is not None: print(value) return print("None")
15
25
0.518519
def func(): value = "not-none" if value is not None: print(value) return print("None")
true
true
1c101a533c5d11cad8b5fef3245b674ac36a732e
1,489
py
Python
049-modoc-county/final-results/parse_modoc.py
worace/california-2016-election-precinct-maps
39e9a6e797aca1b5b5f5129294807dfadb5a795d
[ "MIT" ]
82
2016-12-30T02:07:31.000Z
2022-02-26T00:39:38.000Z
049-modoc-county/final-results/parse_modoc.py
worace/california-2016-election-precinct-maps
39e9a6e797aca1b5b5f5129294807dfadb5a795d
[ "MIT" ]
3
2017-01-16T19:12:31.000Z
2017-04-03T03:07:29.000Z
049-modoc-county/final-results/parse_modoc.py
worace/california-2016-election-precinct-maps
39e9a6e797aca1b5b5f5129294807dfadb5a795d
[ "MIT" ]
29
2017-01-02T08:45:30.000Z
2021-11-17T15:19:31.000Z
import sys import os import re from subprocess import call call(['pdftotext','-layout',sys.argv[1]]) pages = [] currentPage = '' pageNo = 0 if not os.path.exists('results/'): os.makedirs('results/') with open(sys.argv[1].replace('pdf','txt')) as file: filename = 'results/%s.csv' % sys.argv[1].replace('.pdf','') ...
57.269231
151
0.674278
import sys import os import re from subprocess import call call(['pdftotext','-layout',sys.argv[1]]) pages = [] currentPage = '' pageNo = 0 if not os.path.exists('results/'): os.makedirs('results/') with open(sys.argv[1].replace('pdf','txt')) as file: filename = 'results/%s.csv' % sys.argv[1].replace('.pdf','') ...
false
true
1c101aa9e7df25a7cbc33bd52c2d18229a901b2d
4,273
py
Python
train.py
takyamamoto/Local-Predictive_Coding_Network-with_Chainer
390f8ed3951f4bba912c6a70d04b859fe9a8461d
[ "MIT" ]
2
2018-09-30T07:14:07.000Z
2021-09-08T06:40:42.000Z
train.py
takyamamoto/Local-Predictive_Coding_Network-with_Chainer
390f8ed3951f4bba912c6a70d04b859fe9a8461d
[ "MIT" ]
null
null
null
train.py
takyamamoto/Local-Predictive_Coding_Network-with_Chainer
390f8ed3951f4bba912c6a70d04b859fe9a8461d
[ "MIT" ]
1
2022-03-30T19:14:48.000Z
2022-03-30T19:14:48.000Z
# -*- coding: utf-8 -*- """ Created on Sat Jul 21 08:51:18 2018 @author: user """ import argparse import chainer from chainer import training from chainer.training import extensions from chainer import iterators, optimizers, serializers from chainer import cuda import chainer.links as L from chainer.datasets import ...
37.482456
130
0.65715
import argparse import chainer from chainer import training from chainer.training import extensions from chainer import iterators, optimizers, serializers from chainer import cuda import chainer.links as L from chainer.datasets import get_cifar10 from chainer.datasets import get_cifar100 import network def main(): ...
true
true
1c101c6fff132a41c6a0b85d3ebaf3c068d28178
4,830
py
Python
test/user_script_test.py
majorlin/pyOCD
62dbca36645a72152f0fb9049e5d46070f8b66b7
[ "Apache-2.0" ]
1
2022-02-13T13:47:49.000Z
2022-02-13T13:47:49.000Z
test/user_script_test.py
majorlin/pyOCD
62dbca36645a72152f0fb9049e5d46070f8b66b7
[ "Apache-2.0" ]
null
null
null
test/user_script_test.py
majorlin/pyOCD
62dbca36645a72152f0fb9049e5d46070f8b66b7
[ "Apache-2.0" ]
null
null
null
# pyOCD debugger # Copyright (c) 2020 Arm Limited # SPDX-License-Identifier: Apache-2.0 # # 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 # # ...
33.541667
109
0.661284
from __future__ import print_function import argparse import os import sys import traceback import logging from pyocd.core.helpers import ConnectHelper from pyocd.probe.pydapaccess import DAPAccess from pyocd.core.memory_map import MemoryType from pyocd.commands.execution_context import CommandExecutionContext from ...
true
true
1c101dc032e642ce38c049cc649bf6549aa358fe
1,647
py
Python
core.py
r614/PokeBlocks
5b5777a2e961307268655542c760d4ad728c1790
[ "MIT" ]
null
null
null
core.py
r614/PokeBlocks
5b5777a2e961307268655542c760d4ad728c1790
[ "MIT" ]
null
null
null
core.py
r614/PokeBlocks
5b5777a2e961307268655542c760d4ad728c1790
[ "MIT" ]
null
null
null
import datetime import hashlib import random class Block: blockNo = 0 data = None next = None hash = None nonce = 0 previous_hash = 0x0 timestamp = datetime.datetime.now() def __init__(self, data): self.data = data def getdata(self): return self.data def hash(...
27
233
0.538555
import datetime import hashlib import random class Block: blockNo = 0 data = None next = None hash = None nonce = 0 previous_hash = 0x0 timestamp = datetime.datetime.now() def __init__(self, data): self.data = data def getdata(self): return self.data def hash(...
true
true
1c101dcaf94aefbadeed7a087f55d6241fb723ec
623
py
Python
__init__.py
chledowski/google-research
ed3768f4a0bb95d059b60e7a3bb867ca0a9792ac
[ "Apache-2.0" ]
null
null
null
__init__.py
chledowski/google-research
ed3768f4a0bb95d059b60e7a3bb867ca0a9792ac
[ "Apache-2.0" ]
null
null
null
__init__.py
chledowski/google-research
ed3768f4a0bb95d059b60e7a3bb867ca0a9792ac
[ "Apache-2.0" ]
null
null
null
# coding=utf-8 # Copyright 2020 The Google Research Authors. # # 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...
38.9375
75
0.743178
true
true
1c101e35d64c30e01a33276dd98210f1ab3dc9ea
432
py
Python
env/lib/python3.8/site-packages/plotly/validators/mesh3d/_name.py
acrucetta/Chicago_COVI_WebApp
a37c9f492a20dcd625f8647067394617988de913
[ "MIT", "Unlicense" ]
76
2020-07-06T14:44:05.000Z
2022-02-14T15:30:21.000Z
env/lib/python3.8/site-packages/plotly/validators/mesh3d/_name.py
acrucetta/Chicago_COVI_WebApp
a37c9f492a20dcd625f8647067394617988de913
[ "MIT", "Unlicense" ]
11
2020-08-09T02:30:14.000Z
2022-03-12T00:50:14.000Z
env/lib/python3.8/site-packages/plotly/validators/mesh3d/_name.py
acrucetta/Chicago_COVI_WebApp
a37c9f492a20dcd625f8647067394617988de913
[ "MIT", "Unlicense" ]
11
2020-07-12T16:18:07.000Z
2022-02-05T16:48:35.000Z
import _plotly_utils.basevalidators class NameValidator(_plotly_utils.basevalidators.StringValidator): def __init__(self, plotly_name="name", parent_name="mesh3d", **kwargs): super(NameValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, edit_typ...
33.230769
75
0.645833
import _plotly_utils.basevalidators class NameValidator(_plotly_utils.basevalidators.StringValidator): def __init__(self, plotly_name="name", parent_name="mesh3d", **kwargs): super(NameValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, edit_typ...
true
true
1c101ed96ecff0a2c1655a05a0d1bd716d7dd649
5,830
py
Python
migration/20170713-13-move-authentication-configuration-to-external-integrations.py
tdilauro/simplified-circulation
f52d333616f63e2bff0cf1de98ef301bf152fba1
[ "Apache-2.0" ]
null
null
null
migration/20170713-13-move-authentication-configuration-to-external-integrations.py
tdilauro/simplified-circulation
f52d333616f63e2bff0cf1de98ef301bf152fba1
[ "Apache-2.0" ]
null
null
null
migration/20170713-13-move-authentication-configuration-to-external-integrations.py
tdilauro/simplified-circulation
f52d333616f63e2bff0cf1de98ef301bf152fba1
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python """Move authentication integration details from the Configuration file into the database as ExternalIntegrations """ import os import sys import json import logging bin_dir = os.path.split(__file__)[0] package_dir = os.path.join(bin_dir, "..") sys.path.append(os.path.abspath(package_dir)) from c...
38.104575
118
0.739451
"""Move authentication integration details from the Configuration file into the database as ExternalIntegrations """ import os import sys import json import logging bin_dir = os.path.split(__file__)[0] package_dir = os.path.join(bin_dir, "..") sys.path.append(os.path.abspath(package_dir)) from core.model import ( ...
false
true
1c101f276c33dc6d54089213352c4fea8a4c122f
24,209
py
Python
sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_01_01/aio/operations/_kube_environments_operations.py
vincenttran-msft/azure-sdk-for-python
348b56f9f03eeb3f7b502eed51daf494ffff874d
[ "MIT" ]
1
2021-09-07T18:39:05.000Z
2021-09-07T18:39:05.000Z
sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_01_01/aio/operations/_kube_environments_operations.py
vincenttran-msft/azure-sdk-for-python
348b56f9f03eeb3f7b502eed51daf494ffff874d
[ "MIT" ]
null
null
null
sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_01_01/aio/operations/_kube_environments_operations.py
vincenttran-msft/azure-sdk-for-python
348b56f9f03eeb3f7b502eed51daf494ffff874d
[ "MIT" ]
1
2022-03-04T06:21:56.000Z
2022-03-04T06:21:56.000Z
# 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 may ...
45.505639
239
0.674295
import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error f...
true
true
1c101f44efea9e95b192816dfba5150740493113
480
py
Python
clinicaaddl/clinicaaddl/__init__.py
HorlavaNastassya/AD-DL
58999a8300cea9a8f3b868a968281dc8f148a532
[ "MIT" ]
null
null
null
clinicaaddl/clinicaaddl/__init__.py
HorlavaNastassya/AD-DL
58999a8300cea9a8f3b868a968281dc8f148a532
[ "MIT" ]
null
null
null
clinicaaddl/clinicaaddl/__init__.py
HorlavaNastassya/AD-DL
58999a8300cea9a8f3b868a968281dc8f148a532
[ "MIT" ]
null
null
null
__all__ = ['__version__'] # Load the Clinica package version import sys import pkgutil # __version__ = pkgutil.get_data(__package__, 'VERSION').decode('ascii').strip() # version = __version__ __path__ = pkgutil.extend_path(__path__, __name__) # import pkg_resources # version = pkg_resources.require("Clinica")[0].vers...
26.666667
80
0.74375
__all__ = ['__version__'] import sys import pkgutil __path__ = pkgutil.extend_path(__path__, __name__) if sys.version_info < (3, 6): print(f"ClinicaDL requires Python 3.6") sys.exit(1)
true
true
1c101fea9be510b684a9c55de1e05d9aedc9090c
262
py
Python
internetdefense/apps/include/management/commands/clearcache.py
gnubrasil/idl-members
25f0c048c9cae047cedc4aa0eb58548fac760849
[ "MIT" ]
175
2015-01-01T06:23:10.000Z
2021-12-07T09:08:51.000Z
internetdefense/apps/include/management/commands/clearcache.py
jwyterlin/idl-members
76c467ff38de1c46666d911837f934a76aa6fc7b
[ "MIT" ]
5
2015-03-21T03:34:32.000Z
2017-03-03T00:19:49.000Z
internetdefense/apps/include/management/commands/clearcache.py
jwyterlin/idl-members
76c467ff38de1c46666d911837f934a76aa6fc7b
[ "MIT" ]
38
2015-02-03T23:49:05.000Z
2020-07-30T16:26:56.000Z
from django.core.cache import cache from django.core.management.base import BaseCommand class Command(BaseCommand): help = 'Flush the entire cache' def handle(self, *args, **options): cache.clear() self.stdout.write('Cache cleared\n')
23.818182
51
0.698473
from django.core.cache import cache from django.core.management.base import BaseCommand class Command(BaseCommand): help = 'Flush the entire cache' def handle(self, *args, **options): cache.clear() self.stdout.write('Cache cleared\n')
true
true
1c1020df86d547b22ce4ecbdf583ae5da96cc1ae
15,830
py
Python
src/sage/geometry/polyhedron/palp_database.py
defeo/sage
d8822036a9843bd4d75845024072515ede56bcb9
[ "BSL-1.0" ]
2
2018-06-30T01:37:35.000Z
2018-06-30T01:37:39.000Z
src/sage/geometry/polyhedron/palp_database.py
boothby/sage
1b1e6f608d1ef8ee664bb19e991efbbc68cbd51f
[ "BSL-1.0" ]
null
null
null
src/sage/geometry/polyhedron/palp_database.py
boothby/sage
1b1e6f608d1ef8ee664bb19e991efbbc68cbd51f
[ "BSL-1.0" ]
null
null
null
""" Access the PALP database(s) of reflexive lattice polytopes EXAMPLES:: sage: from sage.geometry.polyhedron.palp_database import PALPreader sage: for lp in PALPreader(2): ....: cone = Cone([(1,r[0],r[1]) for r in lp.vertices()]) ....: fan = Fan([cone]) ....: X = ToricVariety(fan) ...
33.609342
114
0.54561
from __future__ import print_function from subprocess import Popen, PIPE from sage.structure.sage_object import SageObject from sage.matrix.all import matrix from sage.rings.all import Integer, ZZ from sage.geometry.polyhedron.ppl_lattice_polytope import LatticePolytope_PPL from sage.geometry.polyhedron.constructor ...
true
true
1c102127de5b99f56f5ab54c52a79ed2f292485e
1,810
py
Python
user.py
Lenus254/password-locker
dbbe22011a975795285c01d3d955250ebd1b9cab
[ "MIT" ]
null
null
null
user.py
Lenus254/password-locker
dbbe22011a975795285c01d3d955250ebd1b9cab
[ "MIT" ]
null
null
null
user.py
Lenus254/password-locker
dbbe22011a975795285c01d3d955250ebd1b9cab
[ "MIT" ]
null
null
null
from ast import If class User: """ Class that generates new instances of users. """ user_list = [] # Empty list to store users def __init__(self, first_name, last_name, user_name, password): """instance of a class""" self.first_name = first_name self.last_name = last_na...
26.231884
109
0.592818
from ast import If class User: user_list = [] def __init__(self, first_name, last_name, user_name, password): self.first_name = first_name self.last_name = last_name self.user_name = user_name self.password = password def save_user(self): User.user_list.append(...
true
true
1c10214e3e1dcfd97205034bcfea5e763b5cc753
6,150
py
Python
apps/train_net.py
liruilong940607/trainer.pytorch
d8580589827fe0ab23206465a5a097657c572f1c
[ "MIT" ]
4
2020-06-19T03:46:17.000Z
2021-08-24T02:40:03.000Z
apps/train_net.py
liruilong940607/trainer.pytorch
d8580589827fe0ab23206465a5a097657c572f1c
[ "MIT" ]
null
null
null
apps/train_net.py
liruilong940607/trainer.pytorch
d8580589827fe0ab23206465a5a097657c572f1c
[ "MIT" ]
3
2020-06-19T04:44:47.000Z
2020-06-20T02:50:27.000Z
# Usage: # python train_net.py -cfg ../configs/example.yaml -- learning_rate 1.0 import sys import os import argparse import time import torch import torch.nn as nn import torch.nn.functional as F import torchvision sys.path.insert(0, '../') from lib.common.trainer import Trainer from lib.common.config import get_cf...
33.243243
97
0.573821
import sys import os import argparse import time import torch import torch.nn as nn import torch.nn.functional as F import torchvision sys.path.insert(0, '../') from lib.common.trainer import Trainer from lib.common.config import get_cfg_defaults parser = argparse.ArgumentParser() parser.add_argument( '-cfg', '-...
true
true
1c10217f4124b54738311709b8f6b1bad5fdbe1d
3,141
py
Python
sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/_configuration.py
rsdoherty/azure-sdk-for-python
6bba5326677468e6660845a703686327178bb7b1
[ "MIT" ]
2,728
2015-01-09T10:19:32.000Z
2022-03-31T14:50:33.000Z
sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/_configuration.py
rsdoherty/azure-sdk-for-python
6bba5326677468e6660845a703686327178bb7b1
[ "MIT" ]
17,773
2015-01-05T15:57:17.000Z
2022-03-31T23:50:25.000Z
sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/_configuration.py
rsdoherty/azure-sdk-for-python
6bba5326677468e6660845a703686327178bb7b1
[ "MIT" ]
1,916
2015-01-19T05:05:41.000Z
2022-03-31T19:36:44.000Z
# 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 may ...
44.239437
129
0.677491
from typing import TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies from ._version import VERSION if TYPE_CHECKING: from typing import Any from azure.core.credentials import TokenCredential class AutomanageClientConfiguration(Configuration): ...
true
true
1c1021bdc225e165fd628be1239fbf668da01c5d
4,407
py
Python
tools/dom/scripts/emitter_test.py
omerlevran46/sdk
b1955d63ad678b651b09db3dd286136c4463f36b
[ "BSD-3-Clause" ]
8,969
2015-05-16T16:49:24.000Z
2022-03-31T19:54:40.000Z
tools/dom/scripts/emitter_test.py
omerlevran46/sdk
b1955d63ad678b651b09db3dd286136c4463f36b
[ "BSD-3-Clause" ]
30,202
2015-05-17T02:27:45.000Z
2022-03-31T22:54:46.000Z
tools/dom/scripts/emitter_test.py
omerlevran46/sdk
b1955d63ad678b651b09db3dd286136c4463f36b
[ "BSD-3-Clause" ]
1,619
2015-05-16T21:36:42.000Z
2022-03-29T20:36:59.000Z
#!/usr/bin/env python3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. """Tests for emitter module.""" import logging.config import unittest import emitte...
30.818182
83
0.518039
import logging.config import unittest import emitter class EmitterTestCase(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def check(self, e, expected): self.assertEqual(''.join(e.Fragments()), expected) def testExample(self): e = emitter.Emitter...
true
true
1c1021d8412a2ee840dea8a0b6e35b234782de34
29,120
py
Python
tests/test_notebook_diff.py
tarmstrong/nbdiff
3fdfb89f94fc0f4821bc04999ddf53b34d882ab9
[ "MIT" ]
100
2015-01-19T07:35:26.000Z
2022-03-29T08:38:38.000Z
tests/test_notebook_diff.py
tarmstrong/nbdiff
3fdfb89f94fc0f4821bc04999ddf53b34d882ab9
[ "MIT" ]
8
2015-06-11T00:21:17.000Z
2018-08-09T14:04:32.000Z
tests/test_notebook_diff.py
tarmstrong/nbdiff
3fdfb89f94fc0f4821bc04999ddf53b34d882ab9
[ "MIT" ]
17
2015-01-18T21:08:48.000Z
2022-02-23T00:20:24.000Z
from nbdiff.comparable import CellComparator from nbdiff.notebook_diff import ( cells_diff, words_diff, lines_diff, diff_modified_items, ) def test_diff_cells0(): A = [ {'cell_type': "code", 'language': "python", "outputs": [ { "output_type":...
27.240412
73
0.38774
from nbdiff.comparable import CellComparator from nbdiff.notebook_diff import ( cells_diff, words_diff, lines_diff, diff_modified_items, ) def test_diff_cells0(): A = [ {'cell_type': "code", 'language': "python", "outputs": [ { "output_type":...
true
true
1c102663c268f8847e0c7952b1579c6d948110ca
3,095
py
Python
cpgames/cpgames.py
rexzhong1949/Games
1de54788b0a85cd36d4181cff23b56f3bae525c4
[ "MIT" ]
1
2022-02-27T10:33:41.000Z
2022-02-27T10:33:41.000Z
cpgames/cpgames.py
rexzhong1949/Games
1de54788b0a85cd36d4181cff23b56f3bae525c4
[ "MIT" ]
null
null
null
cpgames/cpgames.py
rexzhong1949/Games
1de54788b0a85cd36d4181cff23b56f3bae525c4
[ "MIT" ]
null
null
null
''' Function: Python小游戏合集 Author: Charles 微信公众号: Charles的皮卡丘 ''' import sys import warnings from PyQt5.QtWidgets import QApplication if __name__ == '__main__': from modules import * else: from .modules import * warnings.filterwarnings('ignore') '''Python实用工具集''' class CPGames(): def __init__(s...
36.411765
89
0.597092
import sys import warnings from PyQt5.QtWidgets import QApplication if __name__ == '__main__': from modules import * else: from .modules import * warnings.filterwarnings('ignore') class CPGames(): def __init__(self, **kwargs): for key, value in kwargs.items(): setattr(self, key, value) sel...
true
true
1c1026964384582f4c67c112dae044fd99a7bf4e
547
py
Python
snmp_orm/config.py
blackwithwhite666/snmp_orm
324a98a18772997ce9853ae2a269842af8b718bb
[ "MIT" ]
1
2015-04-29T20:48:50.000Z
2015-04-29T20:48:50.000Z
snmp_orm/config.py
blackwithwhite666/snmp_orm
324a98a18772997ce9853ae2a269842af8b718bb
[ "MIT" ]
null
null
null
snmp_orm/config.py
blackwithwhite666/snmp_orm
324a98a18772997ce9853ae2a269842af8b718bb
[ "MIT" ]
null
null
null
"""Default configuration for snmp_orm.""" from __future__ import absolute_import #: Should we print debug info? DEBUG = False #: Which adapter we should use by default? DEFAULT_ADAPTER = 'snmp_orm.adapters.pysnmp' #: Default SNMP device's port to connect. SNMP_PORT = 161 #: Default SNMP device's address to connect...
24.863636
64
0.74223
from __future__ import absolute_import DEBUG = False DEFAULT_ADAPTER = 'snmp_orm.adapters.pysnmp' SNMP_PORT = 161 #: Default SNMP device's address to connect, used in unit-tests. SNMP_TEST_AGENT_ADDRESS = ('localhost', 60161) BULK_ROW = 50 OID_OBJECT_ID = '1.3.6.1.2.1.1.2.0'
true
true
1c10277c5ea119273482511528797cad636a109a
239
py
Python
plots/redshift_error_v_prob.py
bibanez/TdR-Quasars
e64d4994a3d50ef3e5834ad08eb9297547f33d99
[ "MIT" ]
1
2020-12-24T19:31:40.000Z
2020-12-24T19:31:40.000Z
plots/redshift_error_v_prob.py
bibanez/TdR-Quasars
e64d4994a3d50ef3e5834ad08eb9297547f33d99
[ "MIT" ]
null
null
null
plots/redshift_error_v_prob.py
bibanez/TdR-Quasars
e64d4994a3d50ef3e5834ad08eb9297547f33d99
[ "MIT" ]
null
null
null
from squeze.squeze_common_functions import deserialize, load_json import matplotlib.pyplot as plt print("[?] Loading file...") df = deserialize(load_json("../sample_quasars/candidates_width70_sig6_validation_64plates_sample0.json"))
39.833333
106
0.807531
from squeze.squeze_common_functions import deserialize, load_json import matplotlib.pyplot as plt print("[?] Loading file...") df = deserialize(load_json("../sample_quasars/candidates_width70_sig6_validation_64plates_sample0.json"))
true
true
1c1027a68cd1026a23f542c5e8e0890c9a03d6cf
2,023
py
Python
tests/test_simple_x.py
Conflate/elasticpypi
0255c245176f93ff93e8e126c46ced8a44a44519
[ "Apache-2.0" ]
199
2017-02-23T03:34:41.000Z
2021-09-26T09:49:14.000Z
tests/test_simple_x.py
Conflate/elasticpypi
0255c245176f93ff93e8e126c46ced8a44a44519
[ "Apache-2.0" ]
58
2017-02-24T14:22:39.000Z
2021-08-25T04:53:55.000Z
tests/test_simple_x.py
Conflate/elasticpypi
0255c245176f93ff93e8e126c46ced8a44a44519
[ "Apache-2.0" ]
21
2017-02-25T18:13:52.000Z
2021-11-12T23:13:14.000Z
from flask_testing import TestCase from elasticpypi.api import app from elasticpypi.config import config from tests import fixtures from moto import mock_dynamodb2 from tests import mock_dynamodb_table TABLE = config['table'] class ElasticPypiTests(TestCase): def create_app(self): app.config['TESTING'] ...
31.609375
75
0.506673
from flask_testing import TestCase from elasticpypi.api import app from elasticpypi.config import config from tests import fixtures from moto import mock_dynamodb2 from tests import mock_dynamodb_table TABLE = config['table'] class ElasticPypiTests(TestCase): def create_app(self): app.config['TESTING'] ...
true
true
1c102827f5fa7a4c7f2ec165623a6ac7b67d42d8
1,012
py
Python
catcher/modules/__init__.py
kbelova/catcher
90c8ae02fbd8841b2786bb757e56749e26bb78c3
[ "Apache-2.0" ]
84
2018-03-03T21:11:06.000Z
2022-02-19T14:50:20.000Z
catcher/modules/__init__.py
kbelova/catcher
90c8ae02fbd8841b2786bb757e56749e26bb78c3
[ "Apache-2.0" ]
131
2019-01-08T18:49:23.000Z
2022-03-29T04:00:30.000Z
catcher/modules/__init__.py
kbelova/catcher
90c8ae02fbd8841b2786bb757e56749e26bb78c3
[ "Apache-2.0" ]
11
2019-01-10T10:47:12.000Z
2021-09-24T05:13:40.000Z
from abc import ABC, abstractmethod from os import listdir from os.path import join from typing import Union class Module(ABC): def __init__(self, resources) -> None: super().__init__() self._resources = resources @abstractmethod def before(self, *args, **kwargs): """ Run...
24.095238
84
0.579051
from abc import ABC, abstractmethod from os import listdir from os.path import join from typing import Union class Module(ABC): def __init__(self, resources) -> None: super().__init__() self._resources = resources @abstractmethod def before(self, *args, **kwargs): pass @abst...
true
true
1c10283250f03d0ad8aeaa7f2d2a56cee8080f86
6,810
py
Python
tests/io/test_exports.py
midpipps/pyTenable
06aabe929ae482080dc2a63f56234b9a873f78ca
[ "MIT" ]
1
2020-05-22T12:08:52.000Z
2020-05-22T12:08:52.000Z
tests/io/test_exports.py
oklymenok/pyTenable
73475e37034608afa5e9c7b20c9cec33a2818622
[ "MIT" ]
null
null
null
tests/io/test_exports.py
oklymenok/pyTenable
73475e37034608afa5e9c7b20c9cec33a2818622
[ "MIT" ]
null
null
null
from .fixtures import * from datetime import datetime, timedelta from tenable.errors import * from tenable.io.exports import ExportsIterator def test_vuln_num_assets_typeerror(api): with pytest.raises(TypeError): api.exports.vulns(num_assets='nope') def test_vuln_severity_typeerror(api): with pytest.r...
36.612903
80
0.694567
from .fixtures import * from datetime import datetime, timedelta from tenable.errors import * from tenable.io.exports import ExportsIterator def test_vuln_num_assets_typeerror(api): with pytest.raises(TypeError): api.exports.vulns(num_assets='nope') def test_vuln_severity_typeerror(api): with pytest.r...
true
true
1c1028b22c867435341463b2275c420e2d753fcd
3,357
py
Python
jobmanager/signalDelay.py
vale981/jobmanager
3229dad6d013b0582762f9c38378bf42a30c0767
[ "MIT" ]
null
null
null
jobmanager/signalDelay.py
vale981/jobmanager
3229dad6d013b0582762f9c38378bf42a30c0767
[ "MIT" ]
null
null
null
jobmanager/signalDelay.py
vale981/jobmanager
3229dad6d013b0582762f9c38378bf42a30c0767
[ "MIT" ]
null
null
null
""" The signalDelay module provides a decorator to protect a function from being interrupted via signaling mechanism. When a protected function receives a signal, the signal will be stored and emitted again AFTER the function has terminated. """ import logging import traceback import signal import os ...
31.971429
100
0.603813
import logging import traceback import signal import os log = logging.getLogger(__name__) SIG_MAP = {} for s in signal.__dict__: if s.startswith("SIG") and s[3] != '_': SIG_MAP[getattr(signal, s)] = s class SigHandler(object): def __init__(self): self.sigs_caught = [] def __call__(self,...
true
true
1c10290dfaedf23bfb68ec7edda169374b06468b
546
py
Python
30-Day-Challange/Day-11/permutations.py
EashanKaushik/LeetCode
8ee2a61cefa42b332b6252fafff4a2772d25aa31
[ "Apache-2.0" ]
null
null
null
30-Day-Challange/Day-11/permutations.py
EashanKaushik/LeetCode
8ee2a61cefa42b332b6252fafff4a2772d25aa31
[ "Apache-2.0" ]
null
null
null
30-Day-Challange/Day-11/permutations.py
EashanKaushik/LeetCode
8ee2a61cefa42b332b6252fafff4a2772d25aa31
[ "Apache-2.0" ]
null
null
null
class Solution: def permute(self, nums): ans = list() curr = list() self.permutations(nums, curr, ans) return ans def permutations(self, nums, curr, ans): if len(nums) == 0: ans.append(curr.copy()) return for index in range(0, len(nums...
21
46
0.516484
class Solution: def permute(self, nums): ans = list() curr = list() self.permutations(nums, curr, ans) return ans def permutations(self, nums, curr, ans): if len(nums) == 0: ans.append(curr.copy()) return for index in range(0, len(nums...
true
true
1c10291d5ce02affd89f598067904c5fa1523c14
3,683
py
Python
tests/tabular/forecasting/test_data.py
twsl/lightning-flash
9927853ac23551b444dbe969e287879c69be4094
[ "Apache-2.0" ]
null
null
null
tests/tabular/forecasting/test_data.py
twsl/lightning-flash
9927853ac23551b444dbe969e287879c69be4094
[ "Apache-2.0" ]
null
null
null
tests/tabular/forecasting/test_data.py
twsl/lightning-flash
9927853ac23551b444dbe969e287879c69be4094
[ "Apache-2.0" ]
1
2022-02-28T15:59:39.000Z
2022-02-28T15:59:39.000Z
# Copyright The PyTorch Lightning team. # # 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 i...
38.768421
114
0.743959
from unittest.mock import MagicMock, patch import pytest from pytorch_lightning.utilities.exceptions import MisconfigurationException from flash.tabular.forecasting import TabularForecastingData from tests.helpers.utils import _TABULAR_TESTING @pytest.mark.skipif(not _TABULAR_TESTING, reason="Tabular libraries aren...
true
true
1c1029b61430cd3da1d466f41a9ffd2e7fbc2b5d
3,394
py
Python
parser.py
Symbian9/VectorTileExporter
578fd14017323c2b0b35dbe5e155fd20aef7f7d4
[ "MIT" ]
76
2021-05-19T16:41:17.000Z
2022-01-31T15:30:42.000Z
parser.py
Symbian9/VectorTileExporter
578fd14017323c2b0b35dbe5e155fd20aef7f7d4
[ "MIT" ]
null
null
null
parser.py
Symbian9/VectorTileExporter
578fd14017323c2b0b35dbe5e155fd20aef7f7d4
[ "MIT" ]
5
2021-05-23T11:23:59.000Z
2021-05-25T09:01:21.000Z
import os import json import math from datetime import datetime # taken from https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#Lon..2Flat._to_tile_numbers_2 def num2deg(xtile, ytile, zoom): n = 2.0 ** zoom lon_deg = xtile / n * 360.0 - 180.0 lat_rad = math.atan(math.sinh(math.pi * (1 - 2 * ytile /...
41.390244
136
0.542133
import os import json import math from datetime import datetime def num2deg(xtile, ytile, zoom): n = 2.0 ** zoom lon_deg = xtile / n * 360.0 - 180.0 lat_rad = math.atan(math.sinh(math.pi * (1 - 2 * ytile / n))) lat_deg = math.degrees(lat_rad) return (lat_deg, lon_deg) def listdirs(path): ret...
true
true
1c102ab55fa557555ab8f4f325b73eb3e2953179
1,455
py
Python
server/tests/routes/test_login.py
manoloesparta/imissu
d8ec8d217feb7af725639cb0572ea4df4d719ae9
[ "MIT" ]
null
null
null
server/tests/routes/test_login.py
manoloesparta/imissu
d8ec8d217feb7af725639cb0572ea4df4d719ae9
[ "MIT" ]
2
2021-11-17T07:43:38.000Z
2022-02-27T21:07:26.000Z
server/tests/routes/test_login.py
manoloesparta/lostinparadise
83b492bac601d3c97f5fcd486b416e984aedcc4a
[ "MIT" ]
null
null
null
import mongomock from pytest import fixture from unittest.mock import patch from sanic_testing import TestManager from lostinp.services.authentication import MockedAuthService from tests.routes.mocks.login import ( INCOMPLETE_REQUEST, INVALID_USER_REQUEST, VALID_REQUEST, ) @mongomock.patch(servers=(("mo...
28.529412
70
0.772509
import mongomock from pytest import fixture from unittest.mock import patch from sanic_testing import TestManager from lostinp.services.authentication import MockedAuthService from tests.routes.mocks.login import ( INCOMPLETE_REQUEST, INVALID_USER_REQUEST, VALID_REQUEST, ) @mongomock.patch(servers=(("mo...
true
true
1c102b22e90a961f83a9613d279ebd6a417de2cb
8,087
py
Python
tests/unit/algorithms/metrics/RelativePermabilityTest.py
vasudevanv/OpenPNM
51dbd5d9fb5210a67493ab839a91320d77ffd2d8
[ "MIT" ]
null
null
null
tests/unit/algorithms/metrics/RelativePermabilityTest.py
vasudevanv/OpenPNM
51dbd5d9fb5210a67493ab839a91320d77ffd2d8
[ "MIT" ]
null
null
null
tests/unit/algorithms/metrics/RelativePermabilityTest.py
vasudevanv/OpenPNM
51dbd5d9fb5210a67493ab839a91320d77ffd2d8
[ "MIT" ]
null
null
null
import openpnm as op import numpy.testing as nt mgr = op.Workspace() class RelativePermeabilityTest: def setup_class(self): self.net = op.network.Cubic(shape=[5, 5, 5], spacing=1) self.geo = op.geometry.GenericGeometry(network=self.net, pores=self.ne...
45.432584
77
0.561766
import openpnm as op import numpy.testing as nt mgr = op.Workspace() class RelativePermeabilityTest: def setup_class(self): self.net = op.network.Cubic(shape=[5, 5, 5], spacing=1) self.geo = op.geometry.GenericGeometry(network=self.net, pores=self.ne...
true
true
1c102b4e0c74fda1e7708233275d927d04f5b2f2
1,770
py
Python
Scripts/rst2odt_prepstyles.py
fuliginCloak/Directory
8400bd855b692e5ae93e478e369c69511275074f
[ "MIT" ]
null
null
null
Scripts/rst2odt_prepstyles.py
fuliginCloak/Directory
8400bd855b692e5ae93e478e369c69511275074f
[ "MIT" ]
null
null
null
Scripts/rst2odt_prepstyles.py
fuliginCloak/Directory
8400bd855b692e5ae93e478e369c69511275074f
[ "MIT" ]
null
null
null
#!c:\users\nicks\onedrive\desktop\projects\bohnmangement-site\directory\scripts\python.exe # $Id: rst2odt_prepstyles.py 5839 2009-01-07 19:09:28Z dkuhlman $ # Author: Dave Kuhlman <dkuhlman@rexx.com> # Copyright: This module has been placed in the public domain. """ Fix a word-processor-generated styles.odt for odtwr...
26.029412
90
0.646328
from lxml import etree import sys import zipfile from tempfile import mkstemp import shutil import os NAMESPACES = { "style": "urn:oasis:names:tc:opendocument:xmlns:style:1.0", "fo": "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" } def prepstyle(filename): zin = zipfile.ZipFile(fil...
true
true
1c102b9a3d865d63634cc04924aa23e19d0cc155
9,299
py
Python
allennlp/predictors/semantic_role_labeler.py
SivilTaram/allennlp
b50f22c3f45281c1be6a0fbb041137c3f5bf2131
[ "Apache-2.0" ]
24
2019-09-16T00:10:54.000Z
2021-09-08T19:31:51.000Z
allennlp/predictors/semantic_role_labeler.py
CharlotteSean/allennlp
0663762960a4522d4740eea460f63a06eeba126d
[ "Apache-2.0" ]
2
2019-01-12T00:19:06.000Z
2019-02-27T05:29:31.000Z
allennlp/predictors/semantic_role_labeler.py
CharlotteSean/allennlp
0663762960a4522d4740eea460f63a06eeba126d
[ "Apache-2.0" ]
7
2019-09-16T02:37:31.000Z
2021-09-01T06:06:17.000Z
from typing import List from overrides import overrides from allennlp.common.util import JsonDict, sanitize, group_by_count from allennlp.data import DatasetReader, Instance from allennlp.data.tokenizers.word_splitter import SpacyWordSplitter from allennlp.models import Model from allennlp.predictors.predictor import...
37.955102
100
0.555113
from typing import List from overrides import overrides from allennlp.common.util import JsonDict, sanitize, group_by_count from allennlp.data import DatasetReader, Instance from allennlp.data.tokenizers.word_splitter import SpacyWordSplitter from allennlp.models import Model from allennlp.predictors.predictor import...
true
true
1c102ce094a024e88cc10cb4b1e41f2340c13ba0
3,249
py
Python
skill.py
justindz/Mines-RPG
b408fda0184a47f1364074a5e0b2c130c9caba49
[ "Unlicense" ]
1
2022-01-07T02:30:26.000Z
2022-01-07T02:30:26.000Z
skill.py
justindz/Mines-RPG
b408fda0184a47f1364074a5e0b2c130c9caba49
[ "Unlicense" ]
null
null
null
skill.py
justindz/Mines-RPG
b408fda0184a47f1364074a5e0b2c130c9caba49
[ "Unlicense" ]
null
null
null
from items import weapon from elements import Elements import ability from ability import EffectType, Effect from items.weapon import all_types, bladed_types, melee_types class Skill(ability.Ability): def __init__(self, _name, _description, _cost, _effects, _activates, _consumes, _weapon_types, _multiplier, _area...
29.27027
120
0.532472
from items import weapon from elements import Elements import ability from ability import EffectType, Effect from items.weapon import all_types, bladed_types, melee_types class Skill(ability.Ability): def __init__(self, _name, _description, _cost, _effects, _activates, _consumes, _weapon_types, _multiplier, _area...
true
true
1c102f121e20274002d039d7c5301ca84a0b92c6
448
py
Python
tests/parser/exceptions/test_insufficient_arguments.py
williamremor/vyper
4d33dc4140f7d0c339876afb6af7b417bd0ed8e0
[ "MIT" ]
1
2018-08-31T02:32:57.000Z
2018-08-31T02:32:57.000Z
tests/parser/exceptions/test_insufficient_arguments.py
williamremor/vyper
4d33dc4140f7d0c339876afb6af7b417bd0ed8e0
[ "MIT" ]
null
null
null
tests/parser/exceptions/test_insufficient_arguments.py
williamremor/vyper
4d33dc4140f7d0c339876afb6af7b417bd0ed8e0
[ "MIT" ]
null
null
null
import pytest from pytest import raises from vyper import compiler from vyper.exceptions import StructureException fail_list = [ """ @public def foo() -> num: return as_wei_value(10) """ ] @pytest.mark.parametrize('bad_code', fail_list) def test_insufficient_arguments(bad_code): with raises(StructureExc...
21.333333
77
0.745536
import pytest from pytest import raises from vyper import compiler from vyper.exceptions import StructureException fail_list = [ """ @public def foo() -> num: return as_wei_value(10) """ ] @pytest.mark.parametrize('bad_code', fail_list) def test_insufficient_arguments(bad_code): with raises(StructureExc...
true
true
1c102fcff0bcfd7387876f3062c6d1b19b53b26e
1,406
py
Python
river/models/state.py
manzerw/django-river
58fa53ce9e1d790201afa8d044e85cb8ae00c55f
[ "BSD-3-Clause" ]
null
null
null
river/models/state.py
manzerw/django-river
58fa53ce9e1d790201afa8d044e85cb8ae00c55f
[ "BSD-3-Clause" ]
null
null
null
river/models/state.py
manzerw/django-river
58fa53ce9e1d790201afa8d044e85cb8ae00c55f
[ "BSD-3-Clause" ]
null
null
null
from __future__ import unicode_literals from django.db import models from django.db.models.signals import pre_save from django.template.defaultfilters import slugify try: from django.utils.encoding import python_2_unicode_compatible except ImportError: from six import python_2_unicode_compatible from django.u...
26.037037
77
0.704125
from __future__ import unicode_literals from django.db import models from django.db.models.signals import pre_save from django.template.defaultfilters import slugify try: from django.utils.encoding import python_2_unicode_compatible except ImportError: from six import python_2_unicode_compatible from django.u...
true
true
1c10300a07796ce38673596b9e99f02b2eb466c1
3,044
py
Python
data/cifar_data.py
massquantity/DNN-implementation
bca336749a2076fa2873f57d9c2b6f98ebf18a0d
[ "MIT" ]
null
null
null
data/cifar_data.py
massquantity/DNN-implementation
bca336749a2076fa2873f57d9c2b6f98ebf18a0d
[ "MIT" ]
null
null
null
data/cifar_data.py
massquantity/DNN-implementation
bca336749a2076fa2873f57d9c2b6f98ebf18a0d
[ "MIT" ]
null
null
null
import os import shutil import gzip, tarfile import pickle import subprocess import urllib.request import numpy as np pardir = os.path.dirname(os.path.abspath(__file__)) if not os.path.exists(pardir + "/cifar_raw_data"): os.makedirs(pardir + "/cifar_raw_data") dataset_dir = pardir + "/cifar_raw_data/" def _downl...
28.185185
83
0.614652
import os import shutil import gzip, tarfile import pickle import subprocess import urllib.request import numpy as np pardir = os.path.dirname(os.path.abspath(__file__)) if not os.path.exists(pardir + "/cifar_raw_data"): os.makedirs(pardir + "/cifar_raw_data") dataset_dir = pardir + "/cifar_raw_data/" def _downl...
true
true
1c10302674495495301231b64e1d210b9fe52d8a
563
py
Python
Python/DivideTwoIntegersTest.py
TonnyL/Windary
39f85cdedaaf5b85f7ce842ecef975301fc974cf
[ "MIT" ]
205
2017-11-16T08:38:46.000Z
2022-03-06T05:50:03.000Z
Python/DivideTwoIntegersTest.py
santosh241/Windary
39f85cdedaaf5b85f7ce842ecef975301fc974cf
[ "MIT" ]
3
2018-04-10T10:17:52.000Z
2020-12-11T08:00:09.000Z
Python/DivideTwoIntegersTest.py
santosh241/Windary
39f85cdedaaf5b85f7ce842ecef975301fc974cf
[ "MIT" ]
28
2018-04-10T06:42:42.000Z
2021-09-14T14:15:39.000Z
from unittest import TestCase from DivideTwoIntegers import DivideTwoIntegers class TestDivideTwoIntegers(TestCase): def test_divide(self): d = DivideTwoIntegers() self.assertTrue(d.divide(1, 1) == 1) self.assertTrue(d.divide(0, 1) == 0) self.assertTrue(d.divide(-1, -1) == 1) ...
24.478261
64
0.648313
from unittest import TestCase from DivideTwoIntegers import DivideTwoIntegers class TestDivideTwoIntegers(TestCase): def test_divide(self): d = DivideTwoIntegers() self.assertTrue(d.divide(1, 1) == 1) self.assertTrue(d.divide(0, 1) == 0) self.assertTrue(d.divide(-1, -1) == 1) ...
true
true
1c1030aa8c7325d3cdeb12229e731ce3d07e1a92
1,148
py
Python
data_analysis.py
2018sjain/language-by-letters
bd952db6a26562bf575ad3e0ef48ee8c9d0b216a
[ "MIT" ]
null
null
null
data_analysis.py
2018sjain/language-by-letters
bd952db6a26562bf575ad3e0ef48ee8c9d0b216a
[ "MIT" ]
null
null
null
data_analysis.py
2018sjain/language-by-letters
bd952db6a26562bf575ad3e0ef48ee8c9d0b216a
[ "MIT" ]
null
null
null
import numpy as np def num(letter): letter = letter.lower() if letter == ' ': return 0 return ord(letter) - 96 def percents(vals): total = sum(vals) if total == 0: total = 1 percents = [(var/total) for var in vals] return percents files = [['ENGLISH/english_clean.txt', 'english'], ['SPANISH/spanish_clean.txt...
29.435897
92
0.632404
import numpy as np def num(letter): letter = letter.lower() if letter == ' ': return 0 return ord(letter) - 96 def percents(vals): total = sum(vals) if total == 0: total = 1 percents = [(var/total) for var in vals] return percents files = [['ENGLISH/english_clean.txt', 'english'], ['SPANISH/spanish_clean.txt...
true
true
1c10313ddec1091cbefbf6e8a799f18c73d46b80
8,555
py
Python
model_zoo/official/nlp/tinybert/run_general_distill.py
noaeilat14/mindspore
837bd032ef37ba24be61259acd9474bb4e148d76
[ "Apache-2.0" ]
2
2021-04-22T07:00:59.000Z
2021-11-08T02:49:09.000Z
model_zoo/official/nlp/tinybert/run_general_distill.py
noaeilat14/mindspore
837bd032ef37ba24be61259acd9474bb4e148d76
[ "Apache-2.0" ]
3
2021-03-31T20:15:40.000Z
2022-02-09T23:50:46.000Z
built-in/MindSpore/Official/nlp/TinyBERT_for_MindSpore/run_general_distill.py
Huawei-Ascend/modelzoo
df51ed9c1d6dbde1deef63f2a037a369f8554406
[ "Apache-2.0" ]
1
2021-05-12T06:30:29.000Z
2021-05-12T06:30:29.000Z
# Copyright 2020 Huawei Technologies Co., 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-2.0 # # Unless required by applicable law or agreed to...
53.805031
116
0.661952
import os import argparse import datetime import mindspore.communication.management as D import mindspore.common.dtype as mstype from mindspore import context from mindspore.train.model import Model from mindspore.train.callback import TimeMonitor from mindspore.context import ParallelMode from mindspore.nn.optim imp...
true
true
1c10337dd4946f0ac48c9f49bf488a0437706bdb
888
py
Python
nn_meter/__init__.py
kaleid-liner/nn-Meter
526f8ddeeb33816a0b2b7f97964683e0510cd85d
[ "MIT" ]
null
null
null
nn_meter/__init__.py
kaleid-liner/nn-Meter
526f8ddeeb33816a0b2b7f97964683e0510cd85d
[ "MIT" ]
null
null
null
nn_meter/__init__.py
kaleid-liner/nn-Meter
526f8ddeeb33816a0b2b7f97964683e0510cd85d
[ "MIT" ]
null
null
null
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. try: import pkg_resources # part of setuptools __version__ = pkg_resources.require("nn-meter")[0].version except ModuleNotFoundError: __version__ = 'UNKNOWN' from .nn_meter import ( nnMeter, load_latency_predictor, list_...
29.6
75
0.783784
try: import pkg_resources __version__ = pkg_resources.require("nn-meter")[0].version except ModuleNotFoundError: __version__ = 'UNKNOWN' from .nn_meter import ( nnMeter, load_latency_predictor, list_latency_predictors, model_file_to_graph, model_to_graph ) from .utils.utils import dow...
true
true
1c1034ec5819af3c1a0e03df138bf6cb445e9523
3,027
py
Python
build/lib/sphinxext/gallery_order.py
xiaoouwang/frenchnlp
56a901e47eb716e9be78ac424cee70f9d4344893
[ "MIT" ]
1
2021-11-13T17:21:44.000Z
2021-11-13T17:21:44.000Z
build/lib/sphinxext/gallery_order.py
xiaoouwang/frenchnlp
56a901e47eb716e9be78ac424cee70f9d4344893
[ "MIT" ]
null
null
null
build/lib/sphinxext/gallery_order.py
xiaoouwang/frenchnlp
56a901e47eb716e9be78ac424cee70f9d4344893
[ "MIT" ]
null
null
null
""" Configuration for the order of gallery sections and examples. Paths are relative to the conf.py file. """ from sphinx_gallery.sorting import ExplicitOrder # Gallery sections shall be displayed in the following order. # Non-matching sections are appended. explicit_order_folders = [ '../ex...
35.611765
77
0.593657
from sphinx_gallery.sorting import ExplicitOrder explicit_order_folders = [ '../examples/lines_bars_and_markers', '../examples/images_contours_and_fields', '../examples/subplots_axes_and_figures', '../examples/stat...
true
true
1c10355fb26f55ac79f263d656301d19db69de1c
899
py
Python
slides/services/calendar_service.py
arnovr/epaper-dashboard
eddcf6d189df139375eacd07f90fe97a839fc451
[ "MIT" ]
null
null
null
slides/services/calendar_service.py
arnovr/epaper-dashboard
eddcf6d189df139375eacd07f90fe97a839fc451
[ "MIT" ]
null
null
null
slides/services/calendar_service.py
arnovr/epaper-dashboard
eddcf6d189df139375eacd07f90fe97a839fc451
[ "MIT" ]
null
null
null
from datetime import datetime from ics import Calendar import requests from slides.calendar.calendar_drawing import CalendarDrawing from slides.slide_runner import SlideRunner from dateutil import parser class CalendarService(): def __init__(self, ics_url): self.ics_url = ics_url def getNow(self): ...
29.966667
83
0.605117
from datetime import datetime from ics import Calendar import requests from slides.calendar.calendar_drawing import CalendarDrawing from slides.slide_runner import SlideRunner from dateutil import parser class CalendarService(): def __init__(self, ics_url): self.ics_url = ics_url def getNow(self): ...
true
true
1c10358125d995187fae0939e1ee61dd5d12154c
688
py
Python
req_py_libraries.py
nikhil9r/inst_inv_parser
acbb842c290d5be1ba4f709f97958fe8c59bbbe9
[ "MIT" ]
null
null
null
req_py_libraries.py
nikhil9r/inst_inv_parser
acbb842c290d5be1ba4f709f97958fe8c59bbbe9
[ "MIT" ]
null
null
null
req_py_libraries.py
nikhil9r/inst_inv_parser
acbb842c290d5be1ba4f709f97958fe8c59bbbe9
[ "MIT" ]
null
null
null
from bs4 import BeautifulSoup import re from datetime import datetime, timedelta import datetime as dt from dateutil.relativedelta import relativedelta import numpy as np import csv import os import time import json import math import xml.etree.ElementTree as ET import xmltodict import pandas as pd import decimal impor...
17.641026
48
0.761628
from bs4 import BeautifulSoup import re from datetime import datetime, timedelta import datetime as dt from dateutil.relativedelta import relativedelta import numpy as np import csv import os import time import json import math import xml.etree.ElementTree as ET import xmltodict import pandas as pd import decimal impor...
true
true
1c1035d06e379733879e47557a0e0dcaea27133e
5,885
py
Python
common/sync_package.py
shyam196/tlcpack
9053527ffd3ea227fa8ce45b2be9758453056da5
[ "Apache-2.0" ]
null
null
null
common/sync_package.py
shyam196/tlcpack
9053527ffd3ea227fa8ce45b2be9758453056da5
[ "Apache-2.0" ]
null
null
null
common/sync_package.py
shyam196/tlcpack
9053527ffd3ea227fa8ce45b2be9758453056da5
[ "Apache-2.0" ]
null
null
null
""" Synchronize name and the tvm version """ import os import re import subprocess import argparse # Modify the following two settings during release # ----------------------------------------------------------- # Tag used for stable build. # We need to use a tag after v0.7 to enable windows build # switch to a stabl...
33.061798
102
0.550212
import os import re import subprocess import argparse __stable_build__ = "7b11b921720e0d79ba63182f2bce4b703824c7b7" def py_str(cstr): return cstr.decode("utf-8") def checkout_source(src, tag): def run_cmd(cmd): proc = subprocess.Popen( cmd, cwd=src, stdout=subprocess.PIPE, stderr=subpro...
true
true
1c103742edb384093baba895dbbb252a63343818
2,519
py
Python
COERbuoy/__main__.py
SiHeTh/COERbuoy
996af84e7e8605d585070517cce862f7ee32bebb
[ "BSD-3-Clause" ]
1
2021-09-27T23:58:50.000Z
2021-09-27T23:58:50.000Z
COERbuoy/__main__.py
SiHeTh/COERbuoy
996af84e7e8605d585070517cce862f7ee32bebb
[ "BSD-3-Clause" ]
1
2021-10-01T00:13:10.000Z
2021-10-03T21:33:32.000Z
COERbuoy/__main__.py
SiHeTh/COERbuoy
996af84e7e8605d585070517cce862f7ee32bebb
[ "BSD-3-Clause" ]
null
null
null
from .simulation import start_simu, reg_wave, bretschneider_wave, decay_test import COERbuoy.GUI as GUIServer import argparse from argparse import RawTextHelpFormatter as tf; parser=argparse.ArgumentParser(description="The COERbuoy model",formatter_class=tf) parser.add_argument("--regular_wave", nargs=4,type=str, meta...
46.648148
92
0.569671
from .simulation import start_simu, reg_wave, bretschneider_wave, decay_test import COERbuoy.GUI as GUIServer import argparse from argparse import RawTextHelpFormatter as tf; parser=argparse.ArgumentParser(description="The COERbuoy model",formatter_class=tf) parser.add_argument("--regular_wave", nargs=4,type=str, meta...
true
true
1c10382b66a84830266bf1db679cb1895261916a
22,946
py
Python
east_asian_spacing/dump.py
kojiishi/contextual-spacing
a38e8c1319ef511c8c9875899cfbd2dfdf5797bf
[ "Apache-2.0" ]
2
2021-03-09T20:40:04.000Z
2021-04-15T06:15:42.000Z
east_asian_spacing/dump.py
kojiishi/contextual-spacing
a38e8c1319ef511c8c9875899cfbd2dfdf5797bf
[ "Apache-2.0" ]
null
null
null
east_asian_spacing/dump.py
kojiishi/contextual-spacing
a38e8c1319ef511c8c9875899cfbd2dfdf5797bf
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python3 import argparse import asyncio import difflib import itertools import logging import os import pathlib import re import shutil import sys import tempfile from typing import Iterable from east_asian_spacing.font import Font from east_asian_spacing.log_utils import init_logging logger = logging.g...
39.906087
84
0.52885
import argparse import asyncio import difflib import itertools import logging import os import pathlib import re import shutil import sys import tempfile from typing import Iterable from east_asian_spacing.font import Font from east_asian_spacing.log_utils import init_logging logger = logging.getLogger('dump') clas...
true
true
1c10392cb2cf08dba954969a175bfa5d15fbe4bb
7,546
py
Python
python/fate_flow/apps/data_access_app.py
kakasu/FATE
cfc61ef268154e08a9e7125c047c318c5e5eb42a
[ "Apache-2.0" ]
2
2020-11-21T11:25:08.000Z
2020-11-21T11:25:11.000Z
python/fate_flow/apps/data_access_app.py
TroubleMaker1994/FATE
23ad848bcc7ae7f304a376d3f46f4af26872c8a2
[ "Apache-2.0" ]
null
null
null
python/fate_flow/apps/data_access_app.py
TroubleMaker1994/FATE
23ad848bcc7ae7f304a376d3f46f4af26872c8a2
[ "Apache-2.0" ]
1
2021-02-03T08:23:42.000Z
2021-02-03T08:23:42.000Z
# # Copyright 2019 The FATE 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 appli...
40.138298
147
0.633581
import os import shutil from flask import Flask, request from fate_flow.entity.types import StatusSet from fate_arch import storage from fate_flow.settings import stat_logger, UPLOAD_DATA_FROM_CLIENT from fate_flow.utils.api_utils import get_json_result from fate_flow.utils import detect_utils, job_utils from fate_fl...
true
true
1c10393f1420e4b74f0f3c31c40ecbc36c31f5bb
1,119
py
Python
openstates/data/migrations/0018_auto_20200914_1032.py
washabstract/openstates-core
ea69564f1f56fe4a80181b0aa715731bbc47e3f5
[ "MIT" ]
9
2020-04-04T00:19:07.000Z
2022-02-27T02:24:12.000Z
openstates/data/migrations/0018_auto_20200914_1032.py
washabstract/openstates-core
ea69564f1f56fe4a80181b0aa715731bbc47e3f5
[ "MIT" ]
17
2020-03-31T18:19:59.000Z
2022-01-03T15:18:48.000Z
openstates/data/migrations/0018_auto_20200914_1032.py
washabstract/openstates-core
ea69564f1f56fe4a80181b0aa715731bbc47e3f5
[ "MIT" ]
19
2020-04-10T21:32:21.000Z
2022-03-02T20:23:21.000Z
# Generated by Django 3.0.5 on 2020-09-14 10:32 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ("data", "0017_remove_person_summary"), ] operations = [ migrations.RemoveField( model_name="bill", name="locked_fields", ...
24.326087
47
0.529937
from django.db import migrations class Migration(migrations.Migration): dependencies = [ ("data", "0017_remove_person_summary"), ] operations = [ migrations.RemoveField( model_name="bill", name="locked_fields", ), migrations.RemoveField( ...
true
true
1c10396de413354b084d4846001187e996d33ffa
2,607
py
Python
scripts/artifacts/powerlogAppinfo.py
mastenp/iLEAPP
ee40ef7505b36d0b9b04131f284a9d4d036514a5
[ "MIT" ]
1
2020-10-06T20:28:03.000Z
2020-10-06T20:28:03.000Z
scripts/artifacts/powerlogAppinfo.py
mastenp/iLEAPP
ee40ef7505b36d0b9b04131f284a9d4d036514a5
[ "MIT" ]
null
null
null
scripts/artifacts/powerlogAppinfo.py
mastenp/iLEAPP
ee40ef7505b36d0b9b04131f284a9d4d036514a5
[ "MIT" ]
null
null
null
import glob import os import pathlib import plistlib import sqlite3 import scripts.artifacts.artGlobals #use to get iOS version -> iOSversion = scripts.artifacts.artGlobals.versionf from packaging import version #use to search per version number from scripts.artifact_report import ArtifactHtmlReport from scripts.ilapf...
39.5
175
0.614499
import glob import os import pathlib import plistlib import sqlite3 import scripts.artifacts.artGlobals from packaging import version from scripts.artifact_report import ArtifactHtmlReport from scripts.ilapfuncs import logfunc, tsv, timeline, is_platform_windows from scripts.ccl import ccl_bplist def get_powerlogApp...
true
true
1c103ad9b6332d75c297a666d3fbe563ce4eba04
3,335
py
Python
test/programytest/parser/template/graph_tests/test_star.py
cdoebler1/AIML2
ee692ec5ea3794cd1bc4cc8ec2a6b5e5c20a0d6a
[ "MIT" ]
345
2016-11-23T22:37:04.000Z
2022-03-30T20:44:44.000Z
test/programytest/parser/template/graph_tests/test_star.py
MikeyBeez/program-y
00d7a0c7d50062f18f0ab6f4a041068e119ef7f0
[ "MIT" ]
275
2016-12-07T10:30:28.000Z
2022-02-08T21:28:33.000Z
test/programytest/parser/template/graph_tests/test_star.py
VProgramMist/modified-program-y
f32efcafafd773683b3fe30054d5485fe9002b7d
[ "MIT" ]
159
2016-11-28T18:59:30.000Z
2022-03-20T18:02:44.000Z
import xml.etree.ElementTree as ET from programy.parser.template.nodes.base import TemplateNode from programy.parser.template.nodes.star import TemplateStarNode from programy.parser.template.nodes.word import TemplateWordNode from programytest.parser.template.graph_tests.graph_test_client import TemplateGraphTestClien...
36.648352
94
0.675262
import xml.etree.ElementTree as ET from programy.parser.template.nodes.base import TemplateNode from programy.parser.template.nodes.star import TemplateStarNode from programy.parser.template.nodes.word import TemplateWordNode from programytest.parser.template.graph_tests.graph_test_client import TemplateGraphTestClien...
true
true
1c103c140dd093a5183995562b219d56066b6f14
8,851
py
Python
fs/archive/base.py
mattalexx/fs.archive
7f0c8c9897ac745e116009af2cacad6f07a2ae6b
[ "MIT" ]
14
2019-01-10T16:24:48.000Z
2022-03-18T06:26:22.000Z
fs/archive/base.py
mattalexx/fs.archive
7f0c8c9897ac745e116009af2cacad6f07a2ae6b
[ "MIT" ]
13
2018-02-20T04:17:46.000Z
2022-03-24T11:18:47.000Z
fs/archive/base.py
mattalexx/fs.archive
7f0c8c9897ac745e116009af2cacad6f07a2ae6b
[ "MIT" ]
6
2017-12-22T10:27:48.000Z
2022-02-14T01:35:34.000Z
# coding: utf-8 from __future__ import absolute_import from __future__ import unicode_literals import os import io import abc import six import sys import shutil import tempfile from .. import errors from ..mode import Mode from ..copy import copy_file from ..path import abspath, normpath, join, dirname from ..base i...
33.026119
79
0.595413
from __future__ import absolute_import from __future__ import unicode_literals import os import io import abc import six import sys import shutil import tempfile from .. import errors from ..mode import Mode from ..copy import copy_file from ..path import abspath, normpath, join, dirname from ..base import FS from .....
true
true
1c103cb9d777e4091a5ec451829cf511d6fe9f39
229
py
Python
TextRank.py
aurora314156/textrank
e33543b537e36b6443d9a7aae60f75b277cf84d0
[ "MIT" ]
null
null
null
TextRank.py
aurora314156/textrank
e33543b537e36b6443d9a7aae60f75b277cf84d0
[ "MIT" ]
null
null
null
TextRank.py
aurora314156/textrank
e33543b537e36b6443d9a7aae60f75b277cf84d0
[ "MIT" ]
null
null
null
# -*- coding: UTF-8 -*- import jieba from jieba import analyse import os def textrank(corpus): print("Start process Textrank!") textrank = jieba.analyse.textrank(corpus, withWeight=True, topK=200) return textrank
17.615385
72
0.707424
import jieba from jieba import analyse import os def textrank(corpus): print("Start process Textrank!") textrank = jieba.analyse.textrank(corpus, withWeight=True, topK=200) return textrank
true
true
1c103d5a7fac420ade213fffe7fe7a9e715175fd
2,818
py
Python
explainaboard/tests/test_machine_translation.py
hwidjaja/ExplainaBoard
0e670ad2df9326eb6b4ad99ba435fd7b6806557a
[ "MIT" ]
null
null
null
explainaboard/tests/test_machine_translation.py
hwidjaja/ExplainaBoard
0e670ad2df9326eb6b4ad99ba435fd7b6806557a
[ "MIT" ]
null
null
null
explainaboard/tests/test_machine_translation.py
hwidjaja/ExplainaBoard
0e670ad2df9326eb6b4ad99ba435fd7b6806557a
[ "MIT" ]
null
null
null
import os import unittest from explainaboard import FileType, get_processor, Source, TaskType from explainaboard.loaders.loader_registry import get_custom_dataset_loader from explainaboard.tests.utils import test_artifacts_path class TestMachineTranslation(unittest.TestCase): artifact_path = os.path.join(test_ar...
34.790123
87
0.643009
import os import unittest from explainaboard import FileType, get_processor, Source, TaskType from explainaboard.loaders.loader_registry import get_custom_dataset_loader from explainaboard.tests.utils import test_artifacts_path class TestMachineTranslation(unittest.TestCase): artifact_path = os.path.join(test_ar...
true
true
1c103dc2e0d2d247dd9ac017946c2c53b31e5da1
1,524
py
Python
build-website.py
catsocks/tennis-sdl
0338d21bc13994ffa440ce70375e1369ef2a64e8
[ "CC0-1.0" ]
null
null
null
build-website.py
catsocks/tennis-sdl
0338d21bc13994ffa440ce70375e1369ef2a64e8
[ "CC0-1.0" ]
null
null
null
build-website.py
catsocks/tennis-sdl
0338d21bc13994ffa440ce70375e1369ef2a64e8
[ "CC0-1.0" ]
null
null
null
#!/usr/bin/env python3 import argparse import os import sys from pathlib import Path import shutil parser = argparse.ArgumentParser() parser.add_argument( "-g", "--game-build-path", default="build", help="path to a build of the game", ) parser.add_argument( "-b", "--build-path", default="bu...
25.830508
85
0.644357
import argparse import os import sys from pathlib import Path import shutil parser = argparse.ArgumentParser() parser.add_argument( "-g", "--game-build-path", default="build", help="path to a build of the game", ) parser.add_argument( "-b", "--build-path", default="build-website", help=...
true
true
1c103de64c247e370591551f3d5cb5c75dddfe98
212
py
Python
example.py
MaryJ25/Calculator
2c46f46054069d0f11f9318e7167f39293eea45f
[ "MIT" ]
null
null
null
example.py
MaryJ25/Calculator
2c46f46054069d0f11f9318e7167f39293eea45f
[ "MIT" ]
null
null
null
example.py
MaryJ25/Calculator
2c46f46054069d0f11f9318e7167f39293eea45f
[ "MIT" ]
null
null
null
from calculator.calculator import Calculator c = Calculator() c.start(5) print(c.add(10)) print(c.add(15)) print(c.get_current()) print(c.divide(2)) c.start(4) print(c.multiply(4)) print(c.root(2))
16.307692
45
0.674528
from calculator.calculator import Calculator c = Calculator() c.start(5) print(c.add(10)) print(c.add(15)) print(c.get_current()) print(c.divide(2)) c.start(4) print(c.multiply(4)) print(c.root(2))
true
true
1c103e3f80bd4b31f2b7333bb022d6e3dad5bf5e
1,238
py
Python
audioEngine/AudioEngine.py
zigakleine/AmbientMusicForUniversities
9008942aa846cd9e8e97615f0270c123f7e499e1
[ "MIT" ]
2
2021-08-15T12:07:13.000Z
2021-08-16T06:46:37.000Z
audioEngine/AudioEngine.py
zigakleine/AmbientMusicForUniversities
9008942aa846cd9e8e97615f0270c123f7e499e1
[ "MIT" ]
null
null
null
audioEngine/AudioEngine.py
zigakleine/AmbientMusicForUniversities
9008942aa846cd9e8e97615f0270c123f7e499e1
[ "MIT" ]
null
null
null
from pylibpd import * from threading import Thread import pyaudio import time class AudioEngine(Thread): def __init__(self): Thread.__init__(self) self.daemon = True self.running = True def run(self): p = pyaudio.PyAudio() ch = 1 sr = 44100 tpb = 6 bs = libpd_blocksize() stream = p.open(format=...
17.194444
66
0.647819
from pylibpd import * from threading import Thread import pyaudio import time class AudioEngine(Thread): def __init__(self): Thread.__init__(self) self.daemon = True self.running = True def run(self): p = pyaudio.PyAudio() ch = 1 sr = 44100 tpb = 6 bs = libpd_blocksize() stream = p.open(format=...
true
true
1c103f16d354b2d0185323bf6f8affaefc004e7f
7,419
py
Python
archive/old_plots/plot_gene_ld_condition_freq_syn_nonsyn_common.py
garudlab/mother_infant
98a27c83bf5ece9497d5a030c6c9396a8c514781
[ "BSD-2-Clause" ]
2
2020-08-09T06:19:11.000Z
2021-08-18T17:12:23.000Z
archive/old_plots/plot_gene_ld_condition_freq_syn_nonsyn_common.py
garudlab/mother_infant
98a27c83bf5ece9497d5a030c6c9396a8c514781
[ "BSD-2-Clause" ]
null
null
null
archive/old_plots/plot_gene_ld_condition_freq_syn_nonsyn_common.py
garudlab/mother_infant
98a27c83bf5ece9497d5a030c6c9396a8c514781
[ "BSD-2-Clause" ]
8
2019-02-20T22:21:55.000Z
2021-02-13T00:55:40.000Z
import matplotlib matplotlib.use('Agg') import os import parse_midas_data import pylab import sys import numpy import diversity_utils from numpy.random import choice species_name=sys.argv[1] # Load subject and sample metadata sys.stderr.write("Loading HMP metadata...\n") subject_sample_map = parse_midas_data.parse...
49.13245
262
0.752527
import matplotlib matplotlib.use('Agg') import os import parse_midas_data import pylab import sys import numpy import diversity_utils from numpy.random import choice species_name=sys.argv[1] sys.stderr.write("Loading HMP metadata...\n") subject_sample_map = parse_midas_data.parse_subject_sample_map() sys.stderr.wr...
true
true
1c104101fef5c99e4b915e1392349e09cfd27168
5,992
py
Python
mindspore/python/mindspore/nn/probability/bijector/scalar_affine.py
httpsgithu/mindspore
c29d6bb764e233b427319cb89ba79e420f1e2c64
[ "Apache-2.0" ]
1
2022-02-23T09:13:43.000Z
2022-02-23T09:13:43.000Z
mindspore/python/mindspore/nn/probability/bijector/scalar_affine.py
949144093/mindspore
c29d6bb764e233b427319cb89ba79e420f1e2c64
[ "Apache-2.0" ]
null
null
null
mindspore/python/mindspore/nn/probability/bijector/scalar_affine.py
949144093/mindspore
c29d6bb764e233b427319cb89ba79e420f1e2c64
[ "Apache-2.0" ]
null
null
null
# Copyright 2020 Huawei Technologies Co., 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-2.0 # # Unless required by applicable law or agreed to...
33.104972
109
0.581609
from mindspore.ops import operations as P from ..distribution._utils.custom_ops import log_generic from .bijector import Bijector class ScalarAffine(Bijector): def __init__(self, scale=1.0, shift=0.0, name='ScalarAffine'): param = dict(locals()) ...
true
true
1c1041d6c8d530ba27cf0ab9b0c1480544644e54
3,664
py
Python
bindings/python/ensmallen/datasets/string/candidatusryanbacteriabacteriumrifcsphigho201full4522.py
AnacletoLAB/ensmallen_graph
b2c1b18fb1e5801712852bcc239f239e03076f09
[ "MIT" ]
5
2021-02-17T00:44:45.000Z
2021-08-09T16:41:47.000Z
bindings/python/ensmallen/datasets/string/candidatusryanbacteriabacteriumrifcsphigho201full4522.py
AnacletoLAB/ensmallen_graph
b2c1b18fb1e5801712852bcc239f239e03076f09
[ "MIT" ]
18
2021-01-07T16:47:39.000Z
2021-08-12T21:51:32.000Z
bindings/python/ensmallen/datasets/string/candidatusryanbacteriabacteriumrifcsphigho201full4522.py
AnacletoLAB/ensmallen
b2c1b18fb1e5801712852bcc239f239e03076f09
[ "MIT" ]
3
2021-01-14T02:20:59.000Z
2021-08-04T19:09:52.000Z
""" This file offers the methods to automatically retrieve the graph Candidatus Ryanbacteria bacterium RIFCSPHIGHO2_01_FULL_45_22. The graph is automatically retrieved from the STRING repository. References --------------------- Please cite the following if you use the data: ```bib @article{szklarczyk2019string, ...
34.895238
223
0.692959
from typing import Dict from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph from ...ensmallen import Graph def CandidatusRyanbacteriaBacteriumRifcsphigho201Full4522( directed: bool = False, preprocess: bool = True, load_nodes: bool = True, verbose: int = 2, cache: bool = True, ...
true
true
1c10421ea201ce4caebb17f10a71423e3fc3aa7d
5,084
py
Python
airflow/api_connexion/schemas/common_schema.py
odracci/incubator-airflow
3bb63d4cfbbb534298d32ec987f25a02c11fc4e6
[ "Apache-2.0" ]
2
2016-08-23T14:22:15.000Z
2017-09-28T19:45:26.000Z
airflow/api_connexion/schemas/common_schema.py
odracci/incubator-airflow
3bb63d4cfbbb534298d32ec987f25a02c11fc4e6
[ "Apache-2.0" ]
4
2019-01-24T11:01:17.000Z
2022-02-28T04:28:07.000Z
airflow/api_connexion/schemas/common_schema.py
socar-inc/airflow
5de3f1e6ab25bb1eb55c52a249ce82c900d683a8
[ "Apache-2.0" ]
6
2018-04-09T07:46:05.000Z
2019-07-16T00:13:15.000Z
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
30.261905
97
0.689024
import datetime import inspect import typing import marshmallow from dateutil import relativedelta from marshmallow import Schema, fields, validate from marshmallow_oneofschema import OneOfSchema from airflow.models.mappedoperator import MappedOperator from airflow.serialization.serialized_objects import SerializedB...
true
true
1c10421fdef9f0d9c32a583457c237458972d442
1,398
py
Python
Section_3/Exercise_12.py
Szymon-Budziak/WDI_exercises_solutions
51ffc9ec8b3cd6809bd55e98ecb8aed759c2d460
[ "MIT" ]
null
null
null
Section_3/Exercise_12.py
Szymon-Budziak/WDI_exercises_solutions
51ffc9ec8b3cd6809bd55e98ecb8aed759c2d460
[ "MIT" ]
null
null
null
Section_3/Exercise_12.py
Szymon-Budziak/WDI_exercises_solutions
51ffc9ec8b3cd6809bd55e98ecb8aed759c2d460
[ "MIT" ]
1
2021-11-21T09:38:33.000Z
2021-11-21T09:38:33.000Z
""" Proszę napisać program, który wypełnia N-elementową tablicę t pseudolosowymi liczbami nieparzystymi z zakresu [1..99], a następnie wyznacza i wypisuje różnicę pomiędzy długością najdłuższego znajdującego się w niej ciągu arytmetycznego o dodatniej różnicy, a długością najdłuższego ciągu arytmetycznego o ujemnej róż...
33.285714
91
0.672389
from random import randint def the_longest_sequence(): t = list() N = 100 i = 1 j = 1 last_difference = longest_increasing = longest_decreasing = current_sequence_length = 1 for i in range(N): x = randint(1, N) if x not in t and x % 2 == 1: t.append(x) else:...
true
true
1c1043db290e1bbc927030ab122c1d827b7a9d08
4,688
py
Python
lnbits/extensions/livestream/crud.py
lightningames/lnbits
63d7431898f9ab79522765dbb29c8a2fd874820a
[ "MIT" ]
null
null
null
lnbits/extensions/livestream/crud.py
lightningames/lnbits
63d7431898f9ab79522765dbb29c8a2fd874820a
[ "MIT" ]
null
null
null
lnbits/extensions/livestream/crud.py
lightningames/lnbits
63d7431898f9ab79522765dbb29c8a2fd874820a
[ "MIT" ]
null
null
null
from typing import List, Optional from lnbits.core.crud import create_account, create_wallet from . import db from .models import Livestream, Track, Producer async def create_livestream(*, wallet_id: str) -> int: result = await db.execute( """ INSERT INTO livestreams (wallet) VALUES (?) ...
25.900552
84
0.600896
from typing import List, Optional from lnbits.core.crud import create_account, create_wallet from . import db from .models import Livestream, Track, Producer async def create_livestream(*, wallet_id: str) -> int: result = await db.execute( """ INSERT INTO livestreams (wallet) VALUES (?) ...
true
true
1c104551181414c6faefcc8b7b466d6e4a4ef382
6,262
py
Python
CTFd/api/v1/tag_challenge.py
ldecoster/Plateforme-CTF
5ff3a5b64167919712584461433f872044366c62
[ "Apache-2.0" ]
null
null
null
CTFd/api/v1/tag_challenge.py
ldecoster/Plateforme-CTF
5ff3a5b64167919712584461433f872044366c62
[ "Apache-2.0" ]
2
2020-11-02T16:51:42.000Z
2021-02-12T15:18:47.000Z
CTFd/api/v1/tag_challenge.py
ldecoster/Plateforme-CTF
5ff3a5b64167919712584461433f872044366c62
[ "Apache-2.0" ]
null
null
null
from typing import List from flask import request from flask_restx import Namespace, Resource from CTFd.api.v1.helpers.request import validate_args from CTFd.api.v1.helpers.schemas import sqlalchemy_to_pydantic from CTFd.api.v1.schemas import APIDetailedSuccessResponse, APIListSuccessResponse from CTFd.constants impo...
37.053254
113
0.655701
from typing import List from flask import request from flask_restx import Namespace, Resource from CTFd.api.v1.helpers.request import validate_args from CTFd.api.v1.helpers.schemas import sqlalchemy_to_pydantic from CTFd.api.v1.schemas import APIDetailedSuccessResponse, APIListSuccessResponse from CTFd.constants impo...
true
true
1c10461ecc110b15574db06473a7004ff6c75949
16,085
py
Python
melp/taft/utils/cosmic.py
maximilianKoeper/melp
863d1c55a36adf29f3508e15ecd5ed0a77544f53
[ "MIT" ]
1
2021-12-07T10:00:23.000Z
2021-12-07T10:00:23.000Z
melp/taft/utils/cosmic.py
maximilianKoeper/melp
863d1c55a36adf29f3508e15ecd5ed0a77544f53
[ "MIT" ]
null
null
null
melp/taft/utils/cosmic.py
maximilianKoeper/melp
863d1c55a36adf29f3508e15ecd5ed0a77544f53
[ "MIT" ]
1
2021-11-15T13:41:06.000Z
2021-11-15T13:41:06.000Z
import warnings import ROOT import numpy as np from melp.libs.misc import index_finder from melp.taft.utils.mu3eDisplay_helper import Trajectory, generate_txt_event_file # --------------------------------------------- """ def cosmic_correction_z(__detector__, **kwargs): print("analyzing cosmics file #1") kwa...
41.138107
129
0.595772
import warnings import ROOT import numpy as np from melp.libs.misc import index_finder from melp.taft.utils.mu3eDisplay_helper import Trajectory, generate_txt_event_file def station_station_timing(filename: str, detector, **kwargs): warnings.warn("INEFFICIENT") root_file = ROOT.TFile.Open(filename, "R...
true
true
1c10467861891c6795b315427cf52bea58525f8e
927
py
Python
pyls/plugins/definition.py
kennydo/python-language-server
f856c20f35da51e85f76b391fe4a4c7e786932fc
[ "MIT" ]
null
null
null
pyls/plugins/definition.py
kennydo/python-language-server
f856c20f35da51e85f76b391fe4a4c7e786932fc
[ "MIT" ]
null
null
null
pyls/plugins/definition.py
kennydo/python-language-server
f856c20f35da51e85f76b391fe4a4c7e786932fc
[ "MIT" ]
null
null
null
# Copyright 2017 Palantir Technologies, Inc. import logging from pyls import hookimpl, uris log = logging.getLogger(__name__) @hookimpl def pyls_definitions(config, document, position): settings = config.plugin_settings('jedi_definition') definitions = document.jedi_script(position).goto_assignments( ...
34.333333
106
0.67206
import logging from pyls import hookimpl, uris log = logging.getLogger(__name__) @hookimpl def pyls_definitions(config, document, position): settings = config.plugin_settings('jedi_definition') definitions = document.jedi_script(position).goto_assignments( follow_imports=settings.get('follow_imports'...
true
true
1c10467ab5b3ec94236f1919d724c097baec186b
1,386
py
Python
src/streamlink/plugins/tv360.py
eleeeeeee/abc
5d81d68c7a47e931f050632ae7cddb3b044971b4
[ "BSD-2-Clause" ]
3
2020-03-03T13:21:44.000Z
2021-07-21T09:53:31.000Z
src/streamlink/plugins/tv360.py
eleeeeeee/abc
5d81d68c7a47e931f050632ae7cddb3b044971b4
[ "BSD-2-Clause" ]
3
2018-06-22T23:33:46.000Z
2018-06-25T00:14:35.000Z
src/streamlink/plugins/tv360.py
eleeeeeee/abc
5d81d68c7a47e931f050632ae7cddb3b044971b4
[ "BSD-2-Clause" ]
1
2020-08-12T08:27:22.000Z
2020-08-12T08:27:22.000Z
from __future__ import print_function import re from functools import partial from streamlink.plugin import Plugin from streamlink.plugin.api import http from streamlink.plugin.api import validate from streamlink.stream import HLSStream from streamlink.utils import parse_json class TV360(Plugin): url_re = re.com...
30.130435
90
0.588745
from __future__ import print_function import re from functools import partial from streamlink.plugin import Plugin from streamlink.plugin.api import http from streamlink.plugin.api import validate from streamlink.stream import HLSStream from streamlink.utils import parse_json class TV360(Plugin): url_re = re.com...
true
true
1c1046dfa8a726f355f25a5b77cadd07fc13fb66
15,839
py
Python
src/python/phyre/metrics.py
KyraKerz/phyre
cec6c9be22f96fef6793fba079935b2071735ac5
[ "Apache-2.0" ]
null
null
null
src/python/phyre/metrics.py
KyraKerz/phyre
cec6c9be22f96fef6793fba079935b2071735ac5
[ "Apache-2.0" ]
null
null
null
src/python/phyre/metrics.py
KyraKerz/phyre
cec6c9be22f96fef6793fba079935b2071735ac5
[ "Apache-2.0" ]
null
null
null
# Copyright (c) Facebook, Inc. and its affiliates. # # 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 ...
36.834884
80
0.670181
from typing import (Any, Callable, Dict, List, Sequence, Tuple, Union) import collections import functools import hashlib import itertools import logging import math import phyre.action_mappers import phyre.action_simulator import phyre.loader import phyre.util MAIN_EVAL_SETUPS: Sequence[str] = ( 'ball_cross_temp...
true
true
1c10473315d444dba34e29bb71fe90720f8c3901
4,734
py
Python
foundations/model_base.py
Happy-Virus-IkBeom/LTH_Tensorflow
aad2b8a4e32ca2c183de4d0075e9ec569a3113a0
[ "Apache-2.0" ]
712
2018-11-03T01:04:23.000Z
2022-03-22T06:29:41.000Z
foundations/model_base.py
ROBOWORD/lottery-ticket-hypothesis
a032bd01c689823a208b8ca616d483187e1e471e
[ "Apache-2.0" ]
16
2019-05-08T03:17:00.000Z
2021-12-11T04:08:57.000Z
foundations/model_base.py
ROBOWORD/lottery-ticket-hypothesis
a032bd01c689823a208b8ca616d483187e1e471e
[ "Apache-2.0" ]
139
2018-11-18T06:26:22.000Z
2022-03-28T22:04:53.000Z
# Copyright (C) 2018 Google Inc. # # 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 writing, ...
30.74026
80
0.674905
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf class ModelBase(object): def __init__(self, presets=None, masks=None): self._masks = masks if masks else {} self._presets = presets if presets else {} self._weights = ...
true
true
1c10480d4ed3622280438836b43eb5f44520e663
32
py
Python
ml_component/tests/__init__.py
Build-Week-SpotifySong4/DataScience
6a7a19dea55d3a75d674cb66a0a32060ca453a5c
[ "MIT" ]
1
2020-03-02T18:05:16.000Z
2020-03-02T18:05:16.000Z
ml_component/tests/__init__.py
Build-Week-SpotifySong4/DataScience
6a7a19dea55d3a75d674cb66a0a32060ca453a5c
[ "MIT" ]
null
null
null
ml_component/tests/__init__.py
Build-Week-SpotifySong4/DataScience
6a7a19dea55d3a75d674cb66a0a32060ca453a5c
[ "MIT" ]
1
2020-03-03T22:44:45.000Z
2020-03-03T22:44:45.000Z
# ml_component/tests/__init__.py
32
32
0.84375
true
true
1c104839b0fd7157052a09e963629e6658dbf1d0
1,864
bzl
Python
maven.bzl
Han0nly/jazzer
b34f6aad8151551005bd502e42fbc1472e69f10b
[ "Apache-2.0" ]
1
2022-03-03T15:06:03.000Z
2022-03-03T15:06:03.000Z
maven.bzl
Han0nly/jazzer
b34f6aad8151551005bd502e42fbc1472e69f10b
[ "Apache-2.0" ]
null
null
null
maven.bzl
Han0nly/jazzer
b34f6aad8151551005bd502e42fbc1472e69f10b
[ "Apache-2.0" ]
null
null
null
# Copyright 2021 Code Intelligence GmbH # # 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 ...
43.348837
97
0.711373
load("@rules_jvm_external//:specs.bzl", "maven") JAZZER_API_VERSION = "0.10.0" JAZZER_API_COORDINATES = "com.code-intelligence:jazzer-api:%s" % JAZZER_API_VERSION MAVEN_ARTIFACTS = [ "com.alibaba:fastjson:1.2.75", "com.beust:klaxon:5.5", "com.fasterxml.jackson.core:jackson-core:2.12.1", "com.fasterxm...
true
true
1c10484fb988679f3a7b4f96a9575df4968ac1cc
1,851
py
Python
acsploit/input/regex.py
IMULMUL/acsploit
928277a0f0d8ddedfeb747abae84e9d86be48a09
[ "BSD-3-Clause" ]
107
2018-05-03T16:53:01.000Z
2022-02-23T14:47:20.000Z
acsploit/input/regex.py
IMULMUL/acsploit
928277a0f0d8ddedfeb747abae84e9d86be48a09
[ "BSD-3-Clause" ]
7
2019-04-28T00:41:35.000Z
2021-05-04T20:35:54.000Z
acsploit/input/regex.py
IMULMUL/acsploit
928277a0f0d8ddedfeb747abae84e9d86be48a09
[ "BSD-3-Clause" ]
16
2019-03-29T12:39:16.000Z
2021-03-03T11:09:45.000Z
import exrex import re from acsploit.options import Options class RegexMatchGenerator: """Regex Generator""" INPUT_NAME = 'regex' def __init__(self): """Initialize the Regex Generator.""" self.options = Options() self.options.add_option('regex', '.*', 'Generated strings will matc...
38.5625
107
0.688817
import exrex import re from acsploit.options import Options class RegexMatchGenerator: INPUT_NAME = 'regex' def __init__(self): self.options = Options() self.options.add_option('regex', '.*', 'Generated strings will match this regex') def get_random(self): return exrex.getone(se...
true
true
1c10487afee2102c5a1650c8695c046283f31007
2,132
py
Python
notas/nota.py
S8Vega/todo_list
bb289b22a038a5a29082d18941ffe0d56082b8d3
[ "MIT" ]
null
null
null
notas/nota.py
S8Vega/todo_list
bb289b22a038a5a29082d18941ffe0d56082b8d3
[ "MIT" ]
null
null
null
notas/nota.py
S8Vega/todo_list
bb289b22a038a5a29082d18941ffe0d56082b8d3
[ "MIT" ]
null
null
null
import conexion connect = conexion.conectar() database = connect[0] cursor = connect[1] class Nota: def __init__(self, usuario_id, titulo = "", descripcion = "", realizada = ""): self.usuario_id = usuario_id self.titulo = titulo self.descripcion = descripcion self.realizada = str(r...
41
121
0.615854
import conexion connect = conexion.conectar() database = connect[0] cursor = connect[1] class Nota: def __init__(self, usuario_id, titulo = "", descripcion = "", realizada = ""): self.usuario_id = usuario_id self.titulo = titulo self.descripcion = descripcion self.realizada = str(r...
true
true
1c1048a049d966b8d9479c2dd6b7735c04dbb031
20,304
py
Python
peripheral/nvic/config/nvic.py
Unitek-KL/csp
2ac7ba59465f23959e51d2f16a5712b57b79ef5f
[ "0BSD" ]
null
null
null
peripheral/nvic/config/nvic.py
Unitek-KL/csp
2ac7ba59465f23959e51d2f16a5712b57b79ef5f
[ "0BSD" ]
null
null
null
peripheral/nvic/config/nvic.py
Unitek-KL/csp
2ac7ba59465f23959e51d2f16a5712b57b79ef5f
[ "0BSD" ]
1
2019-09-02T01:57:39.000Z
2019-09-02T01:57:39.000Z
# coding: utf-8 """***************************************************************************** * Copyright (C) 2018 Microchip Technology Inc. and its subsidiaries. * * Subject to your compliance with these terms, you may use Microchip software * and any derivatives exclusively with Microchip products. It is your * re...
52.875
193
0.673069
from os.path import join Log.writeInfoMessage("Loading Interrupt Manager for " + Variables.get("__PROCESSOR")) global nvicPriorityLevels nvicPriorityLevels = 0 global nvicPriorityGroup nvicPriorityGroup = [] global nvicCorePriorityGroup nvicCorePriorityGroup = [] node = ATDF.getNode("/avr-tools-device-file/devic...
true
true
1c104c6231ea505ceebaeb9c85685ace07a219d1
4,781
py
Python
muadib_utils/__init__.py
lordoftheflies/muadib-notebook
0bba86d775e25800a92e490e71f4e2aba7a09cd3
[ "Apache-2.0" ]
1
2018-05-16T06:31:13.000Z
2018-05-16T06:31:13.000Z
muadib_utils/__init__.py
lordoftheflies/muadib-notebook
0bba86d775e25800a92e490e71f4e2aba7a09cd3
[ "Apache-2.0" ]
4
2018-03-27T00:08:11.000Z
2018-04-21T20:30:53.000Z
muadib_utils/__init__.py
lordoftheflies/muadib-notebook
0bba86d775e25800a92e490e71f4e2aba7a09cd3
[ "Apache-2.0" ]
null
null
null
import queue import time from ipywidgets import widgets class FormFieldFactory(object): def __init__(self): pass def create_field_interval(self, **kwargs): return widgets.IntSlider( **kwargs ) def create_field_choice(self, **kwargs): return widgets.Dropdown( ...
22.658768
75
0.581887
import queue import time from ipywidgets import widgets class FormFieldFactory(object): def __init__(self): pass def create_field_interval(self, **kwargs): return widgets.IntSlider( **kwargs ) def create_field_choice(self, **kwargs): return widgets.Dropdown( ...
true
true
1c104cba770ad71ae3c0ce82601408b537460f82
216
py
Python
app/utils/geolocation.py
edementyev/py-telegram-broker
7cf6ab9a243e1309e4edd8257efb0f6a7340bfae
[ "MIT" ]
null
null
null
app/utils/geolocation.py
edementyev/py-telegram-broker
7cf6ab9a243e1309e4edd8257efb0f6a7340bfae
[ "MIT" ]
7
2020-12-07T09:11:01.000Z
2022-03-02T18:15:01.000Z
app/utils/geolocation.py
edementyev/py-telegram-broker
7cf6ab9a243e1309e4edd8257efb0f6a7340bfae
[ "MIT" ]
null
null
null
def validate_postal_code(postal_code: str) -> int: try: if len(postal_code) != 6: raise ValueError result = int(postal_code) except ValueError: return -1 return result
24
50
0.601852
def validate_postal_code(postal_code: str) -> int: try: if len(postal_code) != 6: raise ValueError result = int(postal_code) except ValueError: return -1 return result
true
true
1c104d260327204959d7d57ce34140ba019f164f
2,807
py
Python
tests/test_exceptions.py
pyansys/openapi-common
869869b6b8d59165e46d3357e44e07c70f18a294
[ "MIT" ]
1
2022-02-17T21:03:18.000Z
2022-02-17T21:03:18.000Z
tests/test_exceptions.py
pyansys/openapi-common
869869b6b8d59165e46d3357e44e07c70f18a294
[ "MIT" ]
46
2022-02-09T17:29:18.000Z
2022-03-21T13:42:59.000Z
tests/test_exceptions.py
pyansys/openapi-common
869869b6b8d59165e46d3357e44e07c70f18a294
[ "MIT" ]
null
null
null
import uuid import pytest from requests.utils import CaseInsensitiveDict from ansys.openapi.common import ApiException, ApiConnectionException from ansys.openapi.common._exceptions import AuthenticationWarning def test_api_connection_exception_repr(): status_code = 403 reason_phrase = "Forbidden" messag...
35.987179
86
0.764161
import uuid import pytest from requests.utils import CaseInsensitiveDict from ansys.openapi.common import ApiException, ApiConnectionException from ansys.openapi.common._exceptions import AuthenticationWarning def test_api_connection_exception_repr(): status_code = 403 reason_phrase = "Forbidden" messag...
true
true
1c104f43133df257356780e72e7905c2ec7034d7
2,659
py
Python
changes/backends/jenkins/factory_builder.py
alex/changes
69a17b4c639e7082a75d037384ccb68ead3a0b4b
[ "Apache-2.0" ]
1
2015-11-08T13:00:44.000Z
2015-11-08T13:00:44.000Z
changes/backends/jenkins/factory_builder.py
alex/changes
69a17b4c639e7082a75d037384ccb68ead3a0b4b
[ "Apache-2.0" ]
null
null
null
changes/backends/jenkins/factory_builder.py
alex/changes
69a17b4c639e7082a75d037384ccb68ead3a0b4b
[ "Apache-2.0" ]
null
null
null
from __future__ import absolute_import, division import re from changes.config import db from changes.db.utils import get_or_create from changes.jobs.sync_job_step import sync_job_step from changes.models import JobPhase from .builder import JenkinsBuilder BASE_XPATH = '/freeStyleProject/build[action/cause/upstream...
35.453333
136
0.622791
from __future__ import absolute_import, division import re from changes.config import db from changes.db.utils import get_or_create from changes.jobs.sync_job_step import sync_job_step from changes.models import JobPhase from .builder import JenkinsBuilder BASE_XPATH = '/freeStyleProject/build[action/cause/upstream...
true
true
1c104ff611449934763aa5da0d5f794e0e9d1767
12,043
py
Python
test/functional/mining_pos_fakestake.py
VsyncCrypto/VSX-3.9.5
9a30f997bf48bf3d95451930a75619b5da1fef62
[ "MIT" ]
29
2017-09-11T17:50:29.000Z
2021-06-30T18:04:49.000Z
test/functional/mining_pos_fakestake.py
VsyncCrypto/VSX-3.9.5
9a30f997bf48bf3d95451930a75619b5da1fef62
[ "MIT" ]
1
2020-09-29T23:18:28.000Z
2020-09-29T23:18:28.000Z
test/functional/mining_pos_fakestake.py
VsyncCrypto/VSX-3.9.5
9a30f997bf48bf3d95451930a75619b5da1fef62
[ "MIT" ]
10
2017-09-12T19:54:26.000Z
2019-11-22T02:14:22.000Z
#!/usr/bin/env python3 # Copyright (c) 2019-2020 The VSYNC developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ Covers various scenarios of PoS blocks where the coinstake input is already spent (either in a previous bloc...
42.108392
103
0.616043
from io import BytesIO from time import sleep from test_framework.authproxy import JSONRPCException from test_framework.messages import COutPoint from test_framework.test_framework import VsyncTestFramework from test_framework.util import ( sync_blocks, assert_equal, bytes_to_hex_str, set_node_times ...
true
true
1c1050b36ec0321b8a1e7471276fb460cd173006
413
py
Python
information/migrations/0002_auto_20151220_1238.py
albertomontesg/real-time-scores
f5123da82455372baaec0ad008d4ff1b71de7077
[ "MIT" ]
null
null
null
information/migrations/0002_auto_20151220_1238.py
albertomontesg/real-time-scores
f5123da82455372baaec0ad008d4ff1b71de7077
[ "MIT" ]
7
2015-12-20T10:31:29.000Z
2015-12-20T13:01:09.000Z
information/migrations/0002_auto_20151220_1238.py
albertomontesg/real-time-scores
f5123da82455372baaec0ad008d4ff1b71de7077
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2015-12-20 12:38 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('information', '0001_initial'), ] operations = [ migrations.RenameField( mo...
19.666667
45
0.59322
from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('information', '0001_initial'), ] operations = [ migrations.RenameField( model_name='team', old_name='url', new_name='url...
true
true
1c105186f59b60c2d3a25c2df9d71c6a63939bf4
27,767
py
Python
code/tensor2tensor/tensor2tensor/models/image_transformer_2d.py
cake-lab/transient_deep_learning
87c6717e4026801623cf0327e78ad57f51cb1461
[ "Apache-2.0" ]
11
2019-12-12T17:34:04.000Z
2022-03-03T11:21:13.000Z
tensor2tensor/models/image_transformer_2d.py
smit-hinsu/tensor2tensor
8d3d175d649680c8e5b98a1b1c1c5e782ff492ac
[ "Apache-2.0" ]
63
2017-12-19T20:29:10.000Z
2021-08-04T21:49:36.000Z
tensor2tensor/models/image_transformer_2d.py
smit-hinsu/tensor2tensor
8d3d175d649680c8e5b98a1b1c1c5e782ff492ac
[ "Apache-2.0" ]
3
2019-09-16T19:35:42.000Z
2020-09-04T02:23:13.000Z
# coding=utf-8 # Copyright 2018 The Tensor2Tensor Authors. # # 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...
30.715708
88
0.726618
from __future__ import absolute_import from __future__ import division from __future__ import print_function import copy import numpy as np from tensor2tensor.layers import common_hparams from tensor2tensor.layers import common_image_attention as cia from tensor2tensor.layers import common_layers from tensor2tensor....
true
true
1c1052c479875df71505f012f56be1eeaf0a3daa
859
py
Python
plato_fit_integrals/initialise/base_objs.py
RFogarty1/fit_plato_ints
0d2843b97944d4cb37aeba6e24c4b4db580a834e
[ "MIT" ]
null
null
null
plato_fit_integrals/initialise/base_objs.py
RFogarty1/fit_plato_ints
0d2843b97944d4cb37aeba6e24c4b4db580a834e
[ "MIT" ]
null
null
null
plato_fit_integrals/initialise/base_objs.py
RFogarty1/fit_plato_ints
0d2843b97944d4cb37aeba6e24c4b4db580a834e
[ "MIT" ]
null
null
null
class PointDefectRunnerBase(): def writeFiles(self): raise NotImplementedError() @property def workFolder(self): raise NotImplementedError() @workFolder.setter def workFolder(self, value): raise NotImplementedError() @property def ePerAtom(self): raise NotImplementedError() @property def nAtoms(...
15.618182
42
0.757858
class PointDefectRunnerBase(): def writeFiles(self): raise NotImplementedError() @property def workFolder(self): raise NotImplementedError() @workFolder.setter def workFolder(self, value): raise NotImplementedError() @property def ePerAtom(self): raise NotImplementedError() @property def nAtoms(...
true
true