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
1c3a887dabb03f7c39d9c6c34de15cc8e62da156
1,254
py
Python
sub_price/check_sub_price.py
nengchibawanfan/PriceServer
b8ea95fa60ca5b940417f56c45a757c661d83e27
[ "Apache-2.0" ]
null
null
null
sub_price/check_sub_price.py
nengchibawanfan/PriceServer
b8ea95fa60ca5b940417f56c45a757c661d83e27
[ "Apache-2.0" ]
null
null
null
sub_price/check_sub_price.py
nengchibawanfan/PriceServer
b8ea95fa60ca5b940417f56c45a757c661d83e27
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- # Author: zhangchao # Date: 2019-07-18 # Desc: 监控获取价格是否正常,不正常,就重启 import datetime import sys sys.path.append("..") from priceserver.common.db_connection import ConnectRedis import os import time r = ConnectRedis() while True: now = time.time() bytetrade_data = float(r.get("Receive_th...
24.115385
68
0.633174
import datetime import sys sys.path.append("..") from priceserver.common.db_connection import ConnectRedis import os import time r = ConnectRedis() while True: now = time.time() bytetrade_data = float(r.get("Receive_the_data_bytetrade1")) huobi_data = float(r.get("Receive_the_data_huobi1")) coin...
true
true
1c3a88c75dc22fd6c086daa4e3caa2aea840cf10
143
py
Python
painter/config_example.py
pwentrys/SubstanceHelpers
8fb56158ee149792219e9cdb9479aaaed09a46bc
[ "MIT" ]
2
2018-09-12T23:35:33.000Z
2019-10-09T06:56:17.000Z
painter/config_example.py
pwentrys/SubstanceHelpers
8fb56158ee149792219e9cdb9479aaaed09a46bc
[ "MIT" ]
null
null
null
painter/config_example.py
pwentrys/SubstanceHelpers
8fb56158ee149792219e9cdb9479aaaed09a46bc
[ "MIT" ]
null
null
null
NAME = "Painter" # Install path PATH = 'C:\Program Files\Allegorithmic\Substance Painter 2' # Shelf locs SHELVES = [ 'C:\PainterShelf' ]
14.3
59
0.685315
NAME = "Painter" PATH = 'C:\Program Files\Allegorithmic\Substance Painter 2' SHELVES = [ 'C:\PainterShelf' ]
true
true
1c3a8a24e9fc061f7eddf2ad3093701e875437f6
541
py
Python
tests/functional/test_user.py
dimkonko/pyramid_api_example
b3bfb8dbe623544af9b147081d3e25c75a191c24
[ "MIT" ]
null
null
null
tests/functional/test_user.py
dimkonko/pyramid_api_example
b3bfb8dbe623544af9b147081d3e25c75a191c24
[ "MIT" ]
null
null
null
tests/functional/test_user.py
dimkonko/pyramid_api_example
b3bfb8dbe623544af9b147081d3e25c75a191c24
[ "MIT" ]
null
null
null
from http import HTTPStatus from tests import utils from tests.functional import BaseFunctionalTest from pyramid_api_example import routes from pyramid_api_example.constants import json_keys class UserFuncTest(BaseFunctionalTest): def test_get_user(self): expected_user_sid = 1 url = routes.USER...
28.473684
78
0.770795
from http import HTTPStatus from tests import utils from tests.functional import BaseFunctionalTest from pyramid_api_example import routes from pyramid_api_example.constants import json_keys class UserFuncTest(BaseFunctionalTest): def test_get_user(self): expected_user_sid = 1 url = routes.USER...
true
true
1c3a8afeb10498842e4277762aa6b8a972be7995
68,797
py
Python
tests/test_build_latex.py
Paebbels/sphinx
6a0215198fea5ec1dbda398aee8c64999baa0c0d
[ "BSD-2-Clause" ]
null
null
null
tests/test_build_latex.py
Paebbels/sphinx
6a0215198fea5ec1dbda398aee8c64999baa0c0d
[ "BSD-2-Clause" ]
null
null
null
tests/test_build_latex.py
Paebbels/sphinx
6a0215198fea5ec1dbda398aee8c64999baa0c0d
[ "BSD-2-Clause" ]
null
null
null
""" test_build_latex ~~~~~~~~~~~~~~~~ Test the build process with LaTeX builder with the test root. :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import os import re import subprocess from itertools import product from shutil import c...
42.731056
107
0.654592
import os import re import subprocess from itertools import product from shutil import copyfile from subprocess import PIPE, CalledProcessError import pytest from sphinx.builders.latex import default_latex_documents from sphinx.config import Config from sphinx.errors import SphinxError from sphinx.testing.util impor...
true
true
1c3a8c414a28b8a4e64b1e5af1db385c22b871fa
2,894
py
Python
atari_environment.py
geek-guild/async-rl
b208b023541cae468ca4c9eceec590b9bfd71abd
[ "MIT" ]
null
null
null
atari_environment.py
geek-guild/async-rl
b208b023541cae468ca4c9eceec590b9bfd71abd
[ "MIT" ]
null
null
null
atari_environment.py
geek-guild/async-rl
b208b023541cae468ca4c9eceec590b9bfd71abd
[ "MIT" ]
null
null
null
import tensorflow as tf from skimage.transform import resize from skimage.color import rgb2gray import numpy as np from collections import deque class AtariEnvironment(object): """ Small wrapper for gym atari environments. Responsible for preprocessing screens and holding on to a screen buffer of size...
38.078947
103
0.660677
import tensorflow as tf from skimage.transform import resize from skimage.color import rgb2gray import numpy as np from collections import deque class AtariEnvironment(object): def __init__(self, gym_env, resized_width, resized_height, agent_history_length): self.env = gym_env self.resized_width = ...
true
true
1c3a8c56543c4ec65cc7575eab9aa5d09bc0d6f9
3,668
py
Python
toontown/classicchars/DistributedMickey.py
LittleNed/toontown-stride
1252a8f9a8816c1810106006d09c8bdfe6ad1e57
[ "Apache-2.0" ]
3
2020-01-02T08:43:36.000Z
2020-07-05T08:59:02.000Z
toontown/classicchars/DistributedMickey.py
NoraTT/Historical-Commits-Project-Altis-Source
fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179
[ "Apache-2.0" ]
null
null
null
toontown/classicchars/DistributedMickey.py
NoraTT/Historical-Commits-Project-Altis-Source
fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179
[ "Apache-2.0" ]
4
2019-06-20T23:45:23.000Z
2020-10-14T20:30:15.000Z
from pandac.PandaModules import * from toontown.classicchars import DistributedCCharBase from direct.directnotify import DirectNotifyGlobal from direct.fsm import ClassicFSM, State from direct.fsm import State from toontown.classicchars import CharStateDatas from toontown.toonbase import ToontownGlobals from toontown.t...
36.68
270
0.681843
from pandac.PandaModules import * from toontown.classicchars import DistributedCCharBase from direct.directnotify import DirectNotifyGlobal from direct.fsm import ClassicFSM, State from direct.fsm import State from toontown.classicchars import CharStateDatas from toontown.toonbase import ToontownGlobals from toontown.t...
true
true
1c3a8dfa2890051addf80f856407956287991ab1
3,121
py
Python
forms/edit_customer_form.py
chucktilbury/Accounting
15c467dac4405e872f3820e3ff35a53240335631
[ "MIT" ]
null
null
null
forms/edit_customer_form.py
chucktilbury/Accounting
15c467dac4405e872f3820e3ff35a53240335631
[ "MIT" ]
null
null
null
forms/edit_customer_form.py
chucktilbury/Accounting
15c467dac4405e872f3820e3ff35a53240335631
[ "MIT" ]
null
null
null
from system.forms import Forms from system.logger import * #from dialogs.edit_dialogs import * from dialogs.select_dialog import * @class_wrapper class _edit_customer_form(Forms): def __init__(self, owner, row_index): self.logger.set_level(Logger.DEBUG) super().__init__(owner, 'Customer') ...
31.525253
95
0.631849
from system.forms import Forms from system.logger import * from dialogs.select_dialog import * @class_wrapper class _edit_customer_form(Forms): def __init__(self, owner, row_index): self.logger.set_level(Logger.DEBUG) super().__init__(owner, 'Customer') self.row_index = row_index de...
true
true
1c3a8e1b7776bb7c26532d73ed96fde7231f2dc6
1,122
py
Python
contents/app_unittest.py
joeyster/Travel-Planner
85e21b7277a50621ed8cf4b2aa5d1b80d3d47005
[ "MIT" ]
null
null
null
contents/app_unittest.py
joeyster/Travel-Planner
85e21b7277a50621ed8cf4b2aa5d1b80d3d47005
[ "MIT" ]
null
null
null
contents/app_unittest.py
joeyster/Travel-Planner
85e21b7277a50621ed8cf4b2aa5d1b80d3d47005
[ "MIT" ]
null
null
null
import unittest import app # Note: the class must be called Test class Test(unittest.TestCase): def test_if_it_runs_to_the_end(self): #self.assertEqual(app.testing_address(["California", "Nevada", "Illinois", "New York", "Maine"],["Nevada", "Illinois", "New York", "Maine"]), True) #self.assertEqual(app.testi...
70.125
192
0.66934
import unittest import app class Test(unittest.TestCase): def test_if_it_runs_to_the_end(self): assertEqual(app.testing_address(["California", "Montana", "Wyoming", "Idaho", "Texas", "Florida", "Maine"], ["Montana", "Wyoming", "Idaho", "Texas", "Florida", "Maine"]), True) if __name__ == '__...
true
true
1c3a8e554480fc8f2650a603e40fee871e2120be
29,684
py
Python
programs/tfFromJson.py
Nino-cunei/ninmed
30f3c096201184c71279eebd572c4fcae0f3dcea
[ "MIT" ]
null
null
null
programs/tfFromJson.py
Nino-cunei/ninmed
30f3c096201184c71279eebd572c4fcae0f3dcea
[ "MIT" ]
null
null
null
programs/tfFromJson.py
Nino-cunei/ninmed
30f3c096201184c71279eebd572c4fcae0f3dcea
[ "MIT" ]
null
null
null
import sys import os import re import json import yaml from shutil import rmtree from tf.fabric import Fabric from tf.convert.walker import CV HELP = """ python3 tfFromJson.py Generate TF and if successful, load it python3 tfFromJson.py -Pnumber python3 tfFromJson.py -Pnumber:obverse python3 tfFromJson.py -Pnumbe...
33.390326
122
0.467356
import sys import os import re import json import yaml from shutil import rmtree from tf.fabric import Fabric from tf.convert.walker import CV HELP = """ python3 tfFromJson.py Generate TF and if successful, load it python3 tfFromJson.py -Pnumber python3 tfFromJson.py -Pnumber:obverse python3 tfFromJson.py -Pnumbe...
true
true
1c3a8ef5fc397e1e41b51b5816497d1dcb8e05b6
114,734
py
Python
theano/gpuarray/opt.py
JimmyRetza/Theano
72d83bce0d547d54ab3513bcba35c166979f7a6f
[ "BSD-3-Clause" ]
1
2020-05-01T11:09:48.000Z
2020-05-01T11:09:48.000Z
theano/gpuarray/opt.py
JimmyRetza/Theano
72d83bce0d547d54ab3513bcba35c166979f7a6f
[ "BSD-3-Clause" ]
null
null
null
theano/gpuarray/opt.py
JimmyRetza/Theano
72d83bce0d547d54ab3513bcba35c166979f7a6f
[ "BSD-3-Clause" ]
1
2018-04-06T08:31:11.000Z
2018-04-06T08:31:11.000Z
from __future__ import absolute_import, print_function, division import copy import numpy as np import logging import pdb import time from six import iteritems from six.moves import xrange import sys import theano from theano import tensor, scalar, gof, config from theano.compile import optdb from theano.compile.ops i...
39.078338
118
0.613088
from __future__ import absolute_import, print_function, division import copy import numpy as np import logging import pdb import time from six import iteritems from six.moves import xrange import sys import theano from theano import tensor, scalar, gof, config from theano.compile import optdb from theano.compile.ops i...
true
true
1c3a8f24f03cf22ef585b3ddd3df1a97ed17f540
3,407
py
Python
src/experiment3.py
jbrowarczyk/jb-masters-thesis
c345f43b32126d16f10c3706f5f798fde0665ee0
[ "MIT" ]
null
null
null
src/experiment3.py
jbrowarczyk/jb-masters-thesis
c345f43b32126d16f10c3706f5f798fde0665ee0
[ "MIT" ]
null
null
null
src/experiment3.py
jbrowarczyk/jb-masters-thesis
c345f43b32126d16f10c3706f5f798fde0665ee0
[ "MIT" ]
null
null
null
from sklearn.svm import SVC from sklearn.metrics import accuracy_score, confusion_matrix, classification_report from global_settings import TRAIN_VERBOSE from utils import make_train_data, make_test_data, save_txt import numpy as np import joblib import os EXPERIMENT_NAME = "experiment3" FEATURES = ["ar_16","ar_24",...
36.244681
124
0.681538
from sklearn.svm import SVC from sklearn.metrics import accuracy_score, confusion_matrix, classification_report from global_settings import TRAIN_VERBOSE from utils import make_train_data, make_test_data, save_txt import numpy as np import joblib import os EXPERIMENT_NAME = "experiment3" FEATURES = ["ar_16","ar_24",...
true
true
1c3a9025eae1873418a0515dcc1c81865dc85b2e
1,054
py
Python
hot_encoding/hot_encoding.py
JOHNKYON/Kaggle_Learn
6a45931e4ec1e189b95c61e27e90499347840180
[ "MIT" ]
null
null
null
hot_encoding/hot_encoding.py
JOHNKYON/Kaggle_Learn
6a45931e4ec1e189b95c61e27e90499347840180
[ "MIT" ]
null
null
null
hot_encoding/hot_encoding.py
JOHNKYON/Kaggle_Learn
6a45931e4ec1e189b95c61e27e90499347840180
[ "MIT" ]
null
null
null
"""Python script for kaggle house price predict practice""" from sklearn.ensemble import RandomForestRegressor from sklearn.preprocessing import Imputer import pandas as pd def main(): """Main script""" # Load data train_data = pd.read_csv('data/train.csv') test_data = pd.read_csv('data/test.csv') ...
25.707317
70
0.689753
from sklearn.ensemble import RandomForestRegressor from sklearn.preprocessing import Imputer import pandas as pd def main(): train_data = pd.read_csv('data/train.csv') test_data = pd.read_csv('data/test.csv') y_train = train_data.SalePrice x_train = train_data.drop(['SalePrice'], axis=1) x_...
true
true
1c3a91564e3c7ad9a2f962c279bae9bd74910638
36,430
py
Python
tests/staticfiles_tests/tests.py
dsanders11/django-future-staticfiles
47aef8cdcfc76d2099884fb0ed77e39e3974f78b
[ "BSD-3-Clause" ]
null
null
null
tests/staticfiles_tests/tests.py
dsanders11/django-future-staticfiles
47aef8cdcfc76d2099884fb0ed77e39e3974f78b
[ "BSD-3-Clause" ]
null
null
null
tests/staticfiles_tests/tests.py
dsanders11/django-future-staticfiles
47aef8cdcfc76d2099884fb0ed77e39e3974f78b
[ "BSD-3-Clause" ]
null
null
null
# -*- encoding: utf-8 -*- from __future__ import unicode_literals import codecs import os import posixpath import shutil import sys import tempfile import unittest import django from django.conf import settings from django.contrib.staticfiles import finders, storage from django.contrib.staticfiles.management.commands...
39.989023
372
0.668542
from __future__ import unicode_literals import codecs import os import posixpath import shutil import sys import tempfile import unittest import django from django.conf import settings from django.contrib.staticfiles import finders, storage from django.contrib.staticfiles.management.commands import collectstatic fro...
true
true
1c3a9281d90a51a0564b84bda147ed62f5c13d92
1,794
py
Python
haiku_generation/src/models/embedding.py
nivethakesavan2203/haiku-generation
ef66c0aa5a5ffcfcfa26b8e993d3efdfcc1be804
[ "MIT" ]
null
null
null
haiku_generation/src/models/embedding.py
nivethakesavan2203/haiku-generation
ef66c0aa5a5ffcfcfa26b8e993d3efdfcc1be804
[ "MIT" ]
3
2020-10-24T18:32:37.000Z
2020-11-28T23:36:28.000Z
haiku_generation/src/models/embedding.py
nivethakesavan2203/haiku-generation
ef66c0aa5a5ffcfcfa26b8e993d3efdfcc1be804
[ "MIT" ]
null
null
null
import torch ''' one method: load RoBERTa from torch.hub import torch roberta_torch = torch.hub.load('pytorch/fairseq', 'roberta.large') roberta_torch.eval() sentence = "I Love RoBERTa!!! I Love Pytorch!!!" Apply Byte-Pair Encoding to input text, tokens should be a tensor tokens_torch = roberta_torch.encode(sentence...
29.9
151
0.741918
import torch class RobertaModel(): def __init__(self): self.model = torch.hub.load('pytorch/fairseq', 'roberta.large') self.model.eval().cuda() def __call__(self, content): tokens = self.model.encode(content) embed = self.model.extract_features(tokens, return_all_hiddens=Tru...
true
true
1c3a929aa2844f2ac2e11633089511aa74cb0049
4,486
py
Python
tools/automation/tests/run.py
KTH/azure-cli
58aa9e320ea7c5213b4517172eaf71b3f5230fd6
[ "MIT" ]
null
null
null
tools/automation/tests/run.py
KTH/azure-cli
58aa9e320ea7c5213b4517172eaf71b3f5230fd6
[ "MIT" ]
null
null
null
tools/automation/tests/run.py
KTH/azure-cli
58aa9e320ea7c5213b4517172eaf71b3f5230fd6
[ "MIT" ]
1
2017-12-28T04:51:44.000Z
2017-12-28T04:51:44.000Z
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
43.980392
119
0.626839
import argparse import os import sys from automation.utilities.path import filter_user_selected_modules_with_tests, get_repo_root from automation.tests.nose_helper import get_nose_runner from automation.utilities.path import get_test_results_dir def get_unittest_runner(tests): test_cases = list(tests) ...
true
true
1c3a92d72255f09c347645c69476c6e68af4c9c1
19,357
py
Python
galpy/potential/DiskSCFPotential.py
gusbeane/galpy
d6db971285f163456c81775fc2fdc7d75189762c
[ "BSD-3-Clause" ]
null
null
null
galpy/potential/DiskSCFPotential.py
gusbeane/galpy
d6db971285f163456c81775fc2fdc7d75189762c
[ "BSD-3-Clause" ]
null
null
null
galpy/potential/DiskSCFPotential.py
gusbeane/galpy
d6db971285f163456c81775fc2fdc7d75189762c
[ "BSD-3-Clause" ]
null
null
null
############################################################################### # DiskSCFPotential.py: Potential expansion for disk+halo potentials ############################################################################### from pkg_resources import parse_version import copy import numpy import scipy _SCIPY_VERSI...
40.495816
799
0.536498
f._hz_dict= None return None def _parse_hz_dict(self): hz, Hz, dHzdz= [], [], [] for ii in range(self._nhz): th, tH, tdH= self._parse_hz_dict_indiv(self._hz[ii]) hz.append(th) Hz.append(tH) dHzdz.append(tdH) self._hz= hz self._...
true
true
1c3a93f1cd72a0f6b6fbfcf2ca8188fce01f5828
834
py
Python
src/Tikzifyables/Decorationable.py
Lovely-XPP/tkzgeom
bf68e139dc05f759542d6611f4dc07f4f2727b92
[ "MIT" ]
41
2021-11-24T05:54:08.000Z
2022-03-26T10:19:30.000Z
src/Tikzifyables/Decorationable.py
Lovely-XPP/tkzgeom
bf68e139dc05f759542d6611f4dc07f4f2727b92
[ "MIT" ]
1
2022-02-28T04:34:51.000Z
2022-03-07T10:49:27.000Z
src/Tikzifyables/Decorationable.py
Lovely-XPP/tkzgeom
bf68e139dc05f759542d6611f4dc07f4f2727b92
[ "MIT" ]
10
2021-11-24T07:35:17.000Z
2022-03-25T18:42:14.000Z
import Constant as c class Decorationable: def __init__(self, item): """Construct Decorationable.""" self.item = item def tikzify_decoration(self): """Turn curve decoration into tikz code.""" if self.item["line"]["decoration"]["type"] == c.DecorationType.NONE: retur...
41.7
90
0.583933
import Constant as c class Decorationable: def __init__(self, item): self.item = item def tikzify_decoration(self): if self.item["line"]["decoration"]["type"] == c.DecorationType.NONE: return '' if self.item["line"]["decoration"]["type"] == c.DecorationType.TEXT_ALONG_CURVE...
true
true
1c3a9741c2cbff4bf9b26ce9cbf7b6d02d6e6f9d
2,667
py
Python
run_tests.py
Luvideria/lightmetrica-v3
3e83db59998e79648047bac29c37d8eb18d7600d
[ "MIT" ]
101
2019-05-31T21:27:58.000Z
2022-02-03T18:54:16.000Z
run_tests.py
Luvideria/lightmetrica-v3
3e83db59998e79648047bac29c37d8eb18d7600d
[ "MIT" ]
11
2019-09-19T16:03:09.000Z
2020-12-05T18:37:54.000Z
run_tests.py
Luvideria/lightmetrica-v3
3e83db59998e79648047bac29c37d8eb18d7600d
[ "MIT" ]
14
2019-06-05T03:06:09.000Z
2022-01-15T06:36:24.000Z
"""Helper script to run all unit tests""" import os import sys import json import argparse import subprocess as sp from colorama import Fore, Back, Style import pytest from functest.run_all import run_functests def add_bool_arg(parser, name, default): """Add boolean option with mutually exclusive group""" # cf...
41.030769
136
0.615298
import os import sys import json import argparse import subprocess as sp from colorama import Fore, Back, Style import pytest from functest.run_all import run_functests def add_bool_arg(parser, name, default): dest = name.replace('-','_') group = parser.add_mutually_exclusive_group(required=False) gro...
true
true
1c3a974367ccfcc39831aa874107cd41653b60c8
476
py
Python
tests/comment_tests/custom_comments/views.py
webjunkie/django
5dbca13f3baa2e1bafd77e84a80ad6d8a074712e
[ "BSD-3-Clause" ]
790
2015-01-03T02:13:39.000Z
2020-05-10T19:53:57.000Z
AppServer/lib/django-1.5/tests/regressiontests/comment_tests/custom_comments/views.py
nlake44/appscale
6944af660ca4cb772c9b6c2332ab28e5ef4d849f
[ "Apache-2.0" ]
1,361
2015-01-08T23:09:40.000Z
2020-04-14T00:03:04.000Z
AppServer/lib/django-1.5/tests/regressiontests/comment_tests/custom_comments/views.py
nlake44/appscale
6944af660ca4cb772c9b6c2332ab28e5ef4d849f
[ "Apache-2.0" ]
155
2015-01-08T22:59:31.000Z
2020-04-08T08:01:53.000Z
from django.http import HttpResponse def custom_submit_comment(request): return HttpResponse("Hello from the custom submit comment view.") def custom_flag_comment(request, comment_id): return HttpResponse("Hello from the custom flag view.") def custom_delete_comment(request, comment_id): return HttpResp...
31.733333
69
0.787815
from django.http import HttpResponse def custom_submit_comment(request): return HttpResponse("Hello from the custom submit comment view.") def custom_flag_comment(request, comment_id): return HttpResponse("Hello from the custom flag view.") def custom_delete_comment(request, comment_id): return HttpResp...
true
true
1c3a978c83cd8797ced0ce6a31280f63002b394e
876
py
Python
tracing/tracing/mre/job.py
ravitejavalluri/catapult
246a39a82c2213d913a96fff020a263838dc76e6
[ "BSD-3-Clause" ]
null
null
null
tracing/tracing/mre/job.py
ravitejavalluri/catapult
246a39a82c2213d913a96fff020a263838dc76e6
[ "BSD-3-Clause" ]
1
2021-02-23T22:20:14.000Z
2021-02-23T22:20:14.000Z
tracing/tracing/mre/job.py
ravitejavalluri/catapult
246a39a82c2213d913a96fff020a263838dc76e6
[ "BSD-3-Clause" ]
1
2020-12-12T10:38:37.000Z
2020-12-12T10:38:37.000Z
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import uuid from tracing.mre import function_handle class Job(object): def __init__(self, map_function_handle, guid=uuid.uuid4()): assert map_functi...
23.675676
72
0.718037
import uuid from tracing.mre import function_handle class Job(object): def __init__(self, map_function_handle, guid=uuid.uuid4()): assert map_function_handle is not None self._map_function_handle = map_function_handle self._guid = guid @property def guid(self): return self._guid @prope...
true
true
1c3a986e1d6da1213d93abff2a0aa862441301d1
4,570
py
Python
jpype/_jarray.py
marscher/jpype
ce359d7a0ff348831af8abd6e778ed4f7c52c81e
[ "Apache-2.0" ]
6
2015-04-28T16:51:08.000Z
2017-07-12T11:29:00.000Z
jpype/_jarray.py
donaldlab/jpype-py2
1b9850ad4ba4d3c14446a2c31d9c0bb1d4744076
[ "Apache-2.0" ]
29
2015-02-24T11:11:26.000Z
2017-08-25T08:30:18.000Z
jpype/_jarray.py
donaldlab/jpype-py2
1b9850ad4ba4d3c14446a2c31d9c0bb1d4744076
[ "Apache-2.0" ]
1
2015-08-24T13:23:43.000Z
2015-08-24T13:23:43.000Z
#***************************************************************************** # Copyright 2004-2008 Steve Menard # # 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://...
26.264368
119
0.656018
import operator import sys import _jpype import _jclass import _jwrapper _CLASSES = {} _CUSTOMIZERS = [] def _initialize() : _jpype.setJavaArrayClass(_JavaArrayClass) _jpype.setGetJavaArrayClassMethod(_getClassFor) registerArrayCustomizer(CharArrayCustomizer()) registerArrayCustomi...
false
true
1c3a99e3183356804b19506bb3a1a514d934c5ba
77
py
Python
geco/mips/packing/__init__.py
FreestyleBuild/GeCO
6db1a549b3145b3bc5d3025a9bccc03be6575564
[ "MIT" ]
8
2020-12-16T09:59:05.000Z
2022-03-18T09:48:43.000Z
geco/mips/packing/__init__.py
FreestyleBuild/GeCO
6db1a549b3145b3bc5d3025a9bccc03be6575564
[ "MIT" ]
101
2020-11-09T10:20:03.000Z
2022-03-24T13:50:06.000Z
geco/mips/packing/__init__.py
FreestyleBuild/GeCO
6db1a549b3145b3bc5d3025a9bccc03be6575564
[ "MIT" ]
3
2021-04-06T13:26:03.000Z
2022-03-22T13:22:16.000Z
from geco.mips.packing.generic import * from geco.mips.packing.tang import *
25.666667
39
0.792208
from geco.mips.packing.generic import * from geco.mips.packing.tang import *
true
true
1c3a9b110a5850286ee33cd2b54e8186479fc867
1,029
py
Python
src/utils/misc.py
iN1k1/deep-pyramidal-representations-peron-re-identification
18eacd3b7bde2c4767ba290b655cb0f5c72ed8fe
[ "MIT" ]
13
2019-08-09T08:33:27.000Z
2020-12-21T08:51:33.000Z
src/utils/misc.py
iN1k1/deep-pyramidal-representations-peron-re-identification
18eacd3b7bde2c4767ba290b655cb0f5c72ed8fe
[ "MIT" ]
5
2021-03-19T02:17:23.000Z
2022-03-11T23:53:44.000Z
src/utils/misc.py
iN1k1/deep-pyramidal-representations-peron-re-identification
18eacd3b7bde2c4767ba290b655cb0f5c72ed8fe
[ "MIT" ]
4
2019-11-06T08:02:21.000Z
2021-01-13T20:34:23.000Z
import copy import pickle def create_list_of_dictionaries(num_items): return [{} for _ in range(num_items)] def clone(obj): return copy.deepcopy(obj) def save(file_name, **kwargs): with open(file_name, 'wb') as fp: pickle.dump(len(kwargs)+1, fp) keys = list(kwargs.keys()) pickl...
24.5
64
0.589893
import copy import pickle def create_list_of_dictionaries(num_items): return [{} for _ in range(num_items)] def clone(obj): return copy.deepcopy(obj) def save(file_name, **kwargs): with open(file_name, 'wb') as fp: pickle.dump(len(kwargs)+1, fp) keys = list(kwargs.keys()) pickl...
true
true
1c3a9c1696c04d95ff2bc346a005dbf72e3c517c
8,992
py
Python
examples/seq2seq/utils.py
anonSub2/bem
2791575213ce2d64381ee3f5dd2e5428be23b960
[ "MIT" ]
2
2021-02-14T10:27:31.000Z
2022-01-03T06:53:49.000Z
examples/seq2seq/utils.py
anonSub2/bem
2791575213ce2d64381ee3f5dd2e5428be23b960
[ "MIT" ]
9
2020-11-13T17:51:46.000Z
2022-03-12T00:46:15.000Z
examples/seq2seq/utils.py
anonSub2/bem
2791575213ce2d64381ee3f5dd2e5428be23b960
[ "MIT" ]
1
2021-02-12T16:31:47.000Z
2021-02-12T16:31:47.000Z
import itertools import json import os import pickle from pathlib import Path from typing import Callable, Dict, Iterable, List import git import numpy as np import torch from rouge_score import rouge_scorer, scoring from sacrebleu import corpus_bleu from torch import nn from torch.utils.data import Dataset, Sampler f...
33.058824
119
0.663479
import itertools import json import os import pickle from pathlib import Path from typing import Callable, Dict, Iterable, List import git import numpy as np import torch from rouge_score import rouge_scorer, scoring from sacrebleu import corpus_bleu from torch import nn from torch.utils.data import Dataset, Sampler f...
true
true
1c3a9cc108eeeaa60a56ed7406883c6368b6ea5c
7,821
py
Python
sdks/python/http_client/v1/polyaxon_sdk/models/v1_run_artifact.py
gregmbi/polyaxon
8f24089fa9cb5df28fc7b70aec27d6d23ee81e8d
[ "Apache-2.0" ]
null
null
null
sdks/python/http_client/v1/polyaxon_sdk/models/v1_run_artifact.py
gregmbi/polyaxon
8f24089fa9cb5df28fc7b70aec27d6d23ee81e8d
[ "Apache-2.0" ]
null
null
null
sdks/python/http_client/v1/polyaxon_sdk/models/v1_run_artifact.py
gregmbi/polyaxon
8f24089fa9cb5df28fc7b70aec27d6d23ee81e8d
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/python # # Copyright 2018-2020 Polyaxon, 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 ...
25.558824
85
0.567319
import pprint import re import six from polyaxon_sdk.configuration import Configuration class V1RunArtifact(object): openapi_types = { "name": "str", "state": "str", "kind": "V1ArtifactKind", "path": "str", "connection": "str", "summary": "o...
true
true
1c3a9cd61084c77c0da42925d3d0f03f40572a9e
6,298
py
Python
dojango/data/__init__.py
google-code-export/dojango
d350a0042635fcdb1a57b413a9836a728bc13d48
[ "BSD-3-Clause" ]
12
2015-06-07T23:14:36.000Z
2018-05-14T11:03:41.000Z
dojango/data/__init__.py
thedrow/dojango
9a6193153598ca22a088031c903930c8944f612b
[ "BSD-3-Clause" ]
2
2015-04-03T09:16:37.000Z
2015-11-01T01:39:49.000Z
dojango/data/__init__.py
thedrow/dojango
9a6193153598ca22a088031c903930c8944f612b
[ "BSD-3-Clause" ]
4
2017-02-19T03:15:45.000Z
2019-12-27T15:01:50.000Z
import re __all__ = ('QueryInfo', 'QueryReadStoreInfo', 'JsonRestStoreInfo', 'JsonQueryRestStoreInfo',) class QueryInfoFeatures(object): sorting = True paging = False class QueryInfo(object): '''Usage (is that the right solution?): info = QueryInfo(request) info.extract() ...
34.604396
103
0.544141
import re __all__ = ('QueryInfo', 'QueryReadStoreInfo', 'JsonRestStoreInfo', 'JsonQueryRestStoreInfo',) class QueryInfoFeatures(object): sorting = True paging = False class QueryInfo(object): start = 0 end = 25 filters = {} sorting = [] request = None max_count = 25...
true
true
1c3a9d06ab53caee2453bd894a5e26b2ee1e502f
16,846
py
Python
Improving Deep Neural Networks Hyperparameter tuning, Regularization and Optimization/Initialization.py
ghbtest/deep-learning-coursera
95d343f2136e20f285963a2605739dc966d82b09
[ "MIT" ]
null
null
null
Improving Deep Neural Networks Hyperparameter tuning, Regularization and Optimization/Initialization.py
ghbtest/deep-learning-coursera
95d343f2136e20f285963a2605739dc966d82b09
[ "MIT" ]
null
null
null
Improving Deep Neural Networks Hyperparameter tuning, Regularization and Optimization/Initialization.py
ghbtest/deep-learning-coursera
95d343f2136e20f285963a2605739dc966d82b09
[ "MIT" ]
null
null
null
#!/usr/bin/env python # coding: utf-8 # # Initialization # # Welcome to the first assignment of "Improving Deep Neural Networks". # # Training your neural network requires specifying an initial value of the weights. A well chosen initialization method will help learning. # # If you completed the previous course ...
33.692
426
0.649056
import numpy as np import matplotlib.pyplot as plt import sklearn import sklearn.datasets from init_utils import sigmoid, relu, compute_loss, forward_propagation, backward_propagation from init_utils import update_parameters, predict, load_dataset, plot_decision_boundary, predict_dec get_ipython().run_line_magic('...
true
true
1c3a9d8f7b6e6385b2b168615513a966bcde5285
3,042
py
Python
basmati/basmati_cmd.py
markmuetz/basmati
cb6fc0e1959501f7ea136c5184f897557459bc54
[ "Apache-2.0" ]
4
2020-02-21T02:42:37.000Z
2021-09-08T17:10:38.000Z
basmati/basmati_cmd.py
markmuetz/basmati
cb6fc0e1959501f7ea136c5184f897557459bc54
[ "Apache-2.0" ]
null
null
null
basmati/basmati_cmd.py
markmuetz/basmati
cb6fc0e1959501f7ea136c5184f897557459bc54
[ "Apache-2.0" ]
1
2021-09-08T09:15:32.000Z
2021-09-08T09:15:32.000Z
import argparse import sys from typing import List from basmati.basmati_demo import demo_main from basmati.basmati_errors import BasmatiError from basmati.downloader import download_main, DATASETS, HYDROBASINS_REGIONS from basmati.setup_logging import setup_logger from basmati.version import get_version def _build_p...
37.097561
93
0.624918
import argparse import sys from typing import List from basmati.basmati_demo import demo_main from basmati.basmati_errors import BasmatiError from basmati.downloader import download_main, DATASETS, HYDROBASINS_REGIONS from basmati.setup_logging import setup_logger from basmati.version import get_version def _build_p...
true
true
1c3a9dd8d891bfd4b9d4f475db13dadf84fa110b
1,243
py
Python
allennlp/modules/seq2vec_encoders/seq2vec_encoder.py
nadgeri14/allennlp
2eefffaf71612263a1c20e8ce4107849cfd5efe3
[ "Apache-2.0" ]
null
null
null
allennlp/modules/seq2vec_encoders/seq2vec_encoder.py
nadgeri14/allennlp
2eefffaf71612263a1c20e8ce4107849cfd5efe3
[ "Apache-2.0" ]
null
null
null
allennlp/modules/seq2vec_encoders/seq2vec_encoder.py
nadgeri14/allennlp
2eefffaf71612263a1c20e8ce4107849cfd5efe3
[ "Apache-2.0" ]
null
null
null
from allennlp.modules.encoder_base import _EncoderBase from allennlp.common import Registrable class Seq2VecEncoder(_EncoderBase, Registrable): """ A ``Seq2VecEncoder`` is a ``Module`` that takes as input a sequence of vectors and returns a single vector. Input shape : ``(batch_size, sequence_length, inp...
41.433333
105
0.680611
from allennlp.modules.encoder_base import _EncoderBase from allennlp.common import Registrable class Seq2VecEncoder(_EncoderBase, Registrable): def get_input_dim(self) -> int: raise NotImplementedError def get_output_dim(self) -> int: raise NotImplementedError
true
true
1c3a9e2d07809822b70de13a2212e36d403b00b3
149
py
Python
Muta3DMaps/core/AsyncV/__init__.py
NatureGeorge/SIFTS_Plus_Muta_Maps
60f84e6024508e65ee3791103762b95666d3c646
[ "MIT" ]
null
null
null
Muta3DMaps/core/AsyncV/__init__.py
NatureGeorge/SIFTS_Plus_Muta_Maps
60f84e6024508e65ee3791103762b95666d3c646
[ "MIT" ]
null
null
null
Muta3DMaps/core/AsyncV/__init__.py
NatureGeorge/SIFTS_Plus_Muta_Maps
60f84e6024508e65ee3791103762b95666d3c646
[ "MIT" ]
null
null
null
# @Date: 2019-11-20T22:46:50+08:00 # @Email: 1730416009@stu.suda.edu.cn # @Filename: __init__.py # @Last modified time: 2019-11-24T23:13:42+08:00
29.8
48
0.691275
true
true
1c3a9e8a268974d656e0c50418552adb90db0085
1,799
py
Python
test/functional/sapling_malleable_sigs.py
ISLAMIC-DIGITAL-COIN/IDC
f78f9f0aa065698b4f826ed7765e9591e7ca855d
[ "MIT" ]
1
2021-12-30T23:56:46.000Z
2021-12-30T23:56:46.000Z
test/functional/sapling_malleable_sigs.py
martin-braun/IDC
96af3558b4e2ae127082856ac9ed134d04878e69
[ "MIT" ]
null
null
null
test/functional/sapling_malleable_sigs.py
martin-braun/IDC
96af3558b4e2ae127082856ac9ed134d04878e69
[ "MIT" ]
1
2022-01-10T22:15:21.000Z
2022-01-10T22:15:21.000Z
#!/usr/bin/env python3 # Copyright (c) 2018 The Zcash developers # Copyright (c) 2020 The PIVX developers # Distributed under the MIT software license, see the accompanying # file COPYING or https://www.opensource.org/licenses/mit-license.php . from test_framework.test_framework import islamic_digital_coinTestFramewor...
31.561404
75
0.683157
from test_framework.test_framework import islamic_digital_coinTestFramework from test_framework.messages import ( CTransaction, ) from test_framework.util import ( assert_equal, assert_raises_rpc_error, bytes_to_hex_str, hex_str_to_bytes, ) from decimal import Decimal from io import BytesIO ...
true
true
1c3a9e997419f1c66cb061c2fa8a7c938ae57ecc
1,929
py
Python
panel/models/tabulator.py
Jacob-Barhak/panel
04cad38ea703e4e69fb76f063a27f4ffe40688e8
[ "BSD-3-Clause" ]
1
2021-03-09T04:46:05.000Z
2021-03-09T04:46:05.000Z
panel/models/tabulator.py
Jacob-Barhak/panel
04cad38ea703e4e69fb76f063a27f4ffe40688e8
[ "BSD-3-Clause" ]
2
2022-01-13T03:54:51.000Z
2022-03-12T01:01:00.000Z
panel/models/tabulator.py
Jacob-Barhak/panel
04cad38ea703e4e69fb76f063a27f4ffe40688e8
[ "BSD-3-Clause" ]
null
null
null
""" Implementation of the Tabulator model. See http://tabulator.info/ """ from bokeh.core.properties import ( Any, Bool, Dict, Enum, Instance, Int, List, Nullable, String ) from bokeh.models import ColumnDataSource from bokeh.models.layouts import HTMLBox from bokeh.models.widgets.tables import TableColumn JS_SR...
23.240964
119
0.658891
from bokeh.core.properties import ( Any, Bool, Dict, Enum, Instance, Int, List, Nullable, String ) from bokeh.models import ColumnDataSource from bokeh.models.layouts import HTMLBox from bokeh.models.widgets.tables import TableColumn JS_SRC = "https://unpkg.com/tabulator-tables@4.9.3/dist/js/tabulator.js" MOMENT_...
true
true
1c3a9f36db55aa34814abb37e951ccba7dc54305
11,362
py
Python
neutron/tests/common/l3_test_common.py
glove747/liberty-neutron
35a4c85e781d10da4521565c3a367e4ecb50739d
[ "Apache-2.0" ]
null
null
null
neutron/tests/common/l3_test_common.py
glove747/liberty-neutron
35a4c85e781d10da4521565c3a367e4ecb50739d
[ "Apache-2.0" ]
null
null
null
neutron/tests/common/l3_test_common.py
glove747/liberty-neutron
35a4c85e781d10da4521565c3a367e4ecb50739d
[ "Apache-2.0" ]
null
null
null
# Copyright (c) 2015 Openstack Foundation # # 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 ...
37.622517
78
0.539606
import copy import netaddr from oslo_utils import uuidutils from six import moves from neutron.common import constants as l3_constants _uuid = uuidutils.generate_uuid class FakeDev(object): def __init__(self, name): self.name = name def get_ha_interface(ip='169.254.192.1', mac='12:34:56:...
true
true
1c3aa08c26ba618b852d49dd757979604b6e5f00
135
py
Python
fed_distill/resnet/__init__.py
Ahmedjjj/dataset-distillation
f2e4267d070c7fb8e50476297e95638f351b76d6
[ "MIT" ]
null
null
null
fed_distill/resnet/__init__.py
Ahmedjjj/dataset-distillation
f2e4267d070c7fb8e50476297e95638f351b76d6
[ "MIT" ]
null
null
null
fed_distill/resnet/__init__.py
Ahmedjjj/dataset-distillation
f2e4267d070c7fb8e50476297e95638f351b76d6
[ "MIT" ]
null
null
null
from fed_distill.resnet.deep_inv import get_resnet_cifar_adi, get_resnet_cifar_di from fed_distill.resnet.resnet_cifar import ResNet18
45
81
0.896296
from fed_distill.resnet.deep_inv import get_resnet_cifar_adi, get_resnet_cifar_di from fed_distill.resnet.resnet_cifar import ResNet18
true
true
1c3aa1c173c1c552d607933ad7f23096267b65be
939
py
Python
1101-1200/1152-Erect the Fence/1152-Erect the Fence.py
jiadaizhao/LintCode
a8aecc65c47a944e9debad1971a7bc6b8776e48b
[ "MIT" ]
77
2017-12-30T13:33:37.000Z
2022-01-16T23:47:08.000Z
1101-1200/1152-Erect the Fence/1152-Erect the Fence.py
jxhangithub/LintCode-1
a8aecc65c47a944e9debad1971a7bc6b8776e48b
[ "MIT" ]
1
2018-05-14T14:15:40.000Z
2018-05-14T14:15:40.000Z
1101-1200/1152-Erect the Fence/1152-Erect the Fence.py
jxhangithub/LintCode-1
a8aecc65c47a944e9debad1971a7bc6b8776e48b
[ "MIT" ]
39
2017-12-07T14:36:25.000Z
2022-03-10T23:05:37.000Z
""" Definition for a point. class Point: def __init__(self, a=0, b=0): self.x = a self.y = b """ class Solution: """ @param points: List[point] @return: return List[point] """ def outerTrees(self, points): # write your code here def orientation(p, q, r): ...
28.454545
80
0.479233
class Solution: def outerTrees(self, points): def orientation(p, q, r): return (q.x - p.x) * (r.y - q.y) - (q.y - p.y) * (r.x - q.x) points.sort(key=lambda p: (p.x, p.y)) hull = [] for point in points: while len(hull) >= 2 and orientation(hu...
true
true
1c3aa23cdce53bafdf329c20bc2930e04167cc41
3,034
py
Python
nova/tests/unit/virt/libvirt/volume/test_scaleio.py
lixiaoy1/nova
357b8b38e88300948bb2e07d1bbaabd1e9d7b60e
[ "Apache-2.0" ]
1
2018-12-28T06:47:39.000Z
2018-12-28T06:47:39.000Z
nova/tests/unit/virt/libvirt/volume/test_scaleio.py
lixiaoy1/nova
357b8b38e88300948bb2e07d1bbaabd1e9d7b60e
[ "Apache-2.0" ]
null
null
null
nova/tests/unit/virt/libvirt/volume/test_scaleio.py
lixiaoy1/nova
357b8b38e88300948bb2e07d1bbaabd1e9d7b60e
[ "Apache-2.0" ]
null
null
null
# Copyright (c) 2015 EMC Corporation # 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 requi...
40.453333
78
0.664799
import mock from os_brick.initiator import connector from nova.tests.unit.virt.libvirt.volume import test_volume from nova.virt.libvirt.volume import scaleio class LibvirtScaleIOVolumeDriverTestCase( test_volume.LibvirtVolumeBaseTestCase): def test_libvirt_scaleio_driver(self): l...
true
true
1c3aa2b66d2aadf5d9b79addb89a1d275b4cfe78
1,036
py
Python
pgroonga/migrations/0003_v2_api_upgrade.py
pranayshahxyz/zulip
3da483487af79fde9dce2d21124dfa39b94936a5
[ "Apache-2.0" ]
1
2020-03-19T00:52:48.000Z
2020-03-19T00:52:48.000Z
pgroonga/migrations/0003_v2_api_upgrade.py
pranayshahxyz/zulip
3da483487af79fde9dce2d21124dfa39b94936a5
[ "Apache-2.0" ]
null
null
null
pgroonga/migrations/0003_v2_api_upgrade.py
pranayshahxyz/zulip
3da483487af79fde9dce2d21124dfa39b94936a5
[ "Apache-2.0" ]
1
2020-07-06T11:43:28.000Z
2020-07-06T11:43:28.000Z
from django.conf import settings from django.db import migrations class Migration(migrations.Migration): atomic = False dependencies = [ ('pgroonga', '0002_html_escape_subject'), ] database_setting = settings.DATABASES["default"] operations = [ migrations.RunSQL([""" ALTER ROLE %...
28
77
0.733591
from django.conf import settings from django.db import migrations class Migration(migrations.Migration): atomic = False dependencies = [ ('pgroonga', '0002_html_escape_subject'), ] database_setting = settings.DATABASES["default"] operations = [ migrations.RunSQL([""" ALTER ROLE %...
true
true
1c3aa448b5cb1afcb70e5b7f5dc5aa3936e5f3a4
973
py
Python
String/415. Add Strings.py
beckswu/Leetcode
480e8dc276b1f65961166d66efa5497d7ff0bdfd
[ "MIT" ]
138
2020-02-08T05:25:26.000Z
2021-11-04T11:59:28.000Z
String/415. Add Strings.py
beckswu/Leetcode
480e8dc276b1f65961166d66efa5497d7ff0bdfd
[ "MIT" ]
null
null
null
String/415. Add Strings.py
beckswu/Leetcode
480e8dc276b1f65961166d66efa5497d7ff0bdfd
[ "MIT" ]
24
2021-01-02T07:18:43.000Z
2022-03-20T08:17:54.000Z
""" 415. Add Strings """ class Solution: def addStrings(self, num1, num2): """ :type num1: str :type num2: str :rtype: str """ i = len(num1)-1; j = len(num2)-1 carry = 0 res = "" while i >= 0 or j >= 0 or carry > 0: ...
27.8
73
0.432682
class Solution: def addStrings(self, num1, num2): i = len(num1)-1; j = len(num2)-1 carry = 0 res = "" while i >= 0 or j >= 0 or carry > 0: carry += ord(num1[i]) - ord('0') if i >= 0 else 0 carry += ord(num2[j]) - ord('0') if j >= 0 else 0 ...
true
true
1c3aa727a7efd294cba76ebcbd5e4e98734126c2
8,378
py
Python
src/callbacks/wandb_callbacks.py
Unity-Technologies/lightning-hydra-template
4bdf4e62c6f93021d7fae86a51c5d706990a933d
[ "MIT" ]
3
2021-04-30T20:50:19.000Z
2021-09-25T09:39:46.000Z
src/callbacks/wandb_callbacks.py
Unity-Technologies/lightning-hydra-template
4bdf4e62c6f93021d7fae86a51c5d706990a933d
[ "MIT" ]
null
null
null
src/callbacks/wandb_callbacks.py
Unity-Technologies/lightning-hydra-template
4bdf4e62c6f93021d7fae86a51c5d706990a933d
[ "MIT" ]
1
2022-02-10T18:20:20.000Z
2022-02-10T18:20:20.000Z
import glob import os from typing import List import matplotlib.pyplot as plt import seaborn as sn import torch import wandb from pytorch_lightning import Callback, Trainer from pytorch_lightning.loggers import LoggerCollection, WandbLogger from sklearn import metrics from sklearn.metrics import f1_score, precision_sc...
34.056911
116
0.620196
import glob import os from typing import List import matplotlib.pyplot as plt import seaborn as sn import torch import wandb from pytorch_lightning import Callback, Trainer from pytorch_lightning.loggers import LoggerCollection, WandbLogger from sklearn import metrics from sklearn.metrics import f1_score, precision_sc...
true
true
1c3aa7498c859db5061e314b79119fd96c0a1892
1,054
py
Python
tests/test_perspective.py
gregunz/invertransforms
3b0621c567d309ee054115cc90cb188808bd63b2
[ "BSD-3-Clause" ]
5
2019-10-14T18:56:08.000Z
2019-10-17T13:50:11.000Z
tests/test_perspective.py
gregunz/invertransforms
3b0621c567d309ee054115cc90cb188808bd63b2
[ "BSD-3-Clause" ]
1
2021-04-06T18:05:19.000Z
2021-04-06T18:05:19.000Z
tests/test_perspective.py
gregunz/invertransforms
3b0621c567d309ee054115cc90cb188808bd63b2
[ "BSD-3-Clause" ]
null
null
null
import invertransforms as T from invertransforms.lib import InvertibleError from tests.invertible_test_case import InvertibleTestCase class TestPerspective(InvertibleTestCase): def test_invert_before_apply(self): with self.assertRaises(InvertibleError): T.RandomPerspective().inverse() de...
36.344828
78
0.701139
import invertransforms as T from invertransforms.lib import InvertibleError from tests.invertible_test_case import InvertibleTestCase class TestPerspective(InvertibleTestCase): def test_invert_before_apply(self): with self.assertRaises(InvertibleError): T.RandomPerspective().inverse() de...
true
true
1c3aa8e1d7c7b7e9cb0b5311c357596b0f060e61
305
py
Python
careless/models/likelihoods/base.py
JBGreisman/careless
8f6c0859973757d11b26b65d9dc51d443030aa70
[ "MIT" ]
5
2021-02-08T16:34:38.000Z
2022-03-25T19:16:09.000Z
careless/models/likelihoods/base.py
JBGreisman/careless
8f6c0859973757d11b26b65d9dc51d443030aa70
[ "MIT" ]
28
2021-01-15T21:31:40.000Z
2022-03-30T21:06:54.000Z
careless/models/likelihoods/base.py
JBGreisman/careless
8f6c0859973757d11b26b65d9dc51d443030aa70
[ "MIT" ]
5
2021-02-12T18:43:58.000Z
2022-02-02T21:38:56.000Z
from careless.models.base import BaseModel class Likelihood(BaseModel): def call(inputs): raise NotImplementedError( "Likelihoods must implement a call method that returns a `tfp.distribution.Distribution` " "or a similar object with a `log_prob` method." )
27.727273
102
0.678689
from careless.models.base import BaseModel class Likelihood(BaseModel): def call(inputs): raise NotImplementedError( "Likelihoods must implement a call method that returns a `tfp.distribution.Distribution` " "or a similar object with a `log_prob` method." )
true
true
1c3aa996949639478b54efba258f458d4268313e
888
py
Python
petroflow/src/base_delegator.py
atwahsz/petroflow
089ca9559a94a7b597cde94601999489ac43d5ec
[ "Apache-2.0" ]
44
2019-10-15T07:03:14.000Z
2022-01-11T09:09:24.000Z
petroflow/src/base_delegator.py
atwahsz/petroflow
089ca9559a94a7b597cde94601999489ac43d5ec
[ "Apache-2.0" ]
15
2019-10-18T07:51:45.000Z
2022-03-10T21:17:16.000Z
petroflow/src/base_delegator.py
atwahsz/petroflow
089ca9559a94a7b597cde94601999489ac43d5ec
[ "Apache-2.0" ]
21
2019-10-30T14:21:54.000Z
2022-03-23T16:19:34.000Z
"""Implements base delegator - a metaclass that creates absent abstract methods of `WellBatch` and `Well` classes.""" from abc import ABCMeta class BaseDelegator(ABCMeta): """Base metaclass that searches for absent abstract methods and creates them.""" def __new__(mcls, name, bases, namespace): ...
37
111
0.69482
from abc import ABCMeta class BaseDelegator(ABCMeta): def __new__(mcls, name, bases, namespace): abstract_methods = [base.__abstractmethods__ for base in bases if hasattr(base, "__abstractmethods__")] abstract_methods = frozenset().union(*abstract_methods) for method in abstract_methods:...
true
true
1c3aa9b9d9095564eae877e1175073726df84e60
5,695
py
Python
pw_trace_tokenized/py/pw_trace_tokenized/get_trace.py
bouffalolab/pigweed
455f460f729591c22c4581a962431c3712fe7ea6
[ "Apache-2.0" ]
1
2022-01-13T10:01:05.000Z
2022-01-13T10:01:05.000Z
pw_trace_tokenized/py/pw_trace_tokenized/get_trace.py
bouffalolab/pigweed
455f460f729591c22c4581a962431c3712fe7ea6
[ "Apache-2.0" ]
null
null
null
pw_trace_tokenized/py/pw_trace_tokenized/get_trace.py
bouffalolab/pigweed
455f460f729591c22c4581a962431c3712fe7ea6
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python3 # Copyright 2021 The Pigweed 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
35.81761
87
0.659526
import argparse import logging import glob from pathlib import Path import sys from typing import Collection, Iterable, Iterator import serial from pw_tokenizer import database from pw_trace import trace from pw_hdlc.rpc import HdlcRpcClient, default_channels from pw_hdlc.rpc_console import SocketClie...
true
true
1c3aabb2158795ae2257c0d560f1b866e0ca84a7
30,099
py
Python
qq/http.py
foxwhite25/qq.py
92e744205e57b4c8922aa5843095ae900b3c1d84
[ "MIT" ]
40
2021-12-07T02:18:14.000Z
2022-03-28T13:14:16.000Z
qq/http.py
foxwhite25/qq.py
92e744205e57b4c8922aa5843095ae900b3c1d84
[ "MIT" ]
2
2021-12-12T17:34:29.000Z
2021-12-17T04:43:03.000Z
qq/http.py
foxwhite25/qq.py
92e744205e57b4c8922aa5843095ae900b3c1d84
[ "MIT" ]
5
2021-12-10T11:17:41.000Z
2022-03-05T13:53:50.000Z
# The MIT License (MIT) # Copyright (c) 2021-present foxwhite25 # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, ...
36.089928
119
0.573973
from __future__ import annotations import asyncio import datetime import logging import sys import weakref from types import TracebackType from typing import ( ClassVar, Any, Optional, Dict, Union, TypeVar, Type, Coroutine, List, Tuple, TYPE_CHECKING, NamedTuple ) from urllib.parse import ...
true
true
1c3aacb6c616d830effc8166735c00bdd26092f7
1,288
py
Python
htpanel/app.py
mpavelka/htpasswd-webpanel
eba3f270316ea288e41491ef27f7f45bb219aeef
[ "MIT" ]
null
null
null
htpanel/app.py
mpavelka/htpasswd-webpanel
eba3f270316ea288e41491ef27f7f45bb219aeef
[ "MIT" ]
null
null
null
htpanel/app.py
mpavelka/htpasswd-webpanel
eba3f270316ea288e41491ef27f7f45bb219aeef
[ "MIT" ]
null
null
null
import asab import asab.web import logging import os from .template import Jinja2TemplateService from .url import URLService from .htpasswd.handler import HtpasswdHandler from .htpasswd.service import HtpasswdService ### L = logging.getLogger(__name__) ### asab.Config.add_defaults({ "htpasswd_webpanel": { "secr...
22.596491
88
0.710404
import asab import asab.web import logging import os from .template import Jinja2TemplateService from .url import URLService from .htpasswd.handler import HtpasswdHandler from .htpasswd.service import HtpasswdService = logging.getLogger(__name__) sab.Config.add_defaults({ "htpasswd_webpanel": { "secret": "", "...
true
true
1c3aadbf71b01cdadf7ef4006970fff5e47739a5
4,907
py
Python
data/data_utils.py
zheang01/FACT
a877cc86acc4d29fb7589c8ac571c8aef09e5fd8
[ "MIT" ]
65
2021-06-14T16:16:40.000Z
2022-03-30T03:10:52.000Z
data/data_utils.py
zheang01/FACT
a877cc86acc4d29fb7589c8ac571c8aef09e5fd8
[ "MIT" ]
5
2021-07-14T06:58:38.000Z
2021-11-29T10:52:27.000Z
data/data_utils.py
zheang01/FACT
a877cc86acc4d29fb7589c8ac571c8aef09e5fd8
[ "MIT" ]
13
2021-06-14T16:16:40.000Z
2022-03-14T12:29:19.000Z
from torchvision import transforms import random import torch import numpy as np from math import sqrt def dataset_info(filepath): with open(filepath, 'r') as f: images_list = f.readlines() file_names = [] labels = [] for row in images_list: row = row.strip().split(' ') ...
39.572581
116
0.539637
from torchvision import transforms import random import torch import numpy as np from math import sqrt def dataset_info(filepath): with open(filepath, 'r') as f: images_list = f.readlines() file_names = [] labels = [] for row in images_list: row = row.strip().split(' ') ...
true
true
1c3aaee898c9af4b492728a688ea91e279cfa236
59,831
py
Python
pysnmp/XUPS-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
11
2021-02-02T16:27:16.000Z
2021-08-31T06:22:49.000Z
pysnmp/XUPS-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
75
2021-02-24T17:30:31.000Z
2021-12-08T00:01:18.000Z
pysnmp/XUPS-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
10
2019-04-30T05:51:36.000Z
2022-02-16T03:33:41.000Z
# # PySNMP MIB module XUPS-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/XUPS-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 21:38:10 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:1...
157.865435
10,518
0.73619
Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsUnion, SingleValueConstraint, ConstraintsIntersection, ValueSizeConstraint, ValueRangeConstraint = mibBuild...
true
true
1c3aaefe05715e4b4a91554a88789cdcc9ea6606
677
py
Python
sheepdoge/app.py
mattjmcnaughton/sheepdoge
9c028d6f51cb59afcaf25a5680f961ec7e25676b
[ "Apache-2.0" ]
7
2018-03-18T07:25:10.000Z
2022-01-28T17:35:08.000Z
sheepdoge/app.py
mattjmcnaughton/sheepdoge
9c028d6f51cb59afcaf25a5680f961ec7e25676b
[ "Apache-2.0" ]
15
2017-08-19T14:03:10.000Z
2017-12-29T23:22:05.000Z
sheepdoge/app.py
mattjmcnaughton/sheepdoge
9c028d6f51cb59afcaf25a5680f961ec7e25676b
[ "Apache-2.0" ]
null
null
null
"""Orchestrates the different `sheepdoge` operations.""" from sheepdoge.config import Config from sheepdoge.action import Action # pylint: disable=unused-import class Sheepdoge(object): """A class we instantiate with instances of the `Action`, which indicate which cli command we'll perform. :param acti...
29.434783
76
0.66322
from sheepdoge.config import Config from sheepdoge.action import Action class Sheepdoge(object): def __init__(self, action, config=None): self._action = action self._config = config or Config.get_config_singleton() def run(self): self._action.run()
true
true
1c3ab0b0932c8237da05d6071187d05b66064048
3,915
py
Python
torchpq/legacy/IVFPQTopk.py
mhamilton723/TorchPQ
f3d560ec04d9c741943fa930a1257c9be9445cbe
[ "MIT" ]
103
2021-02-10T18:01:56.000Z
2022-03-30T21:35:05.000Z
torchpq/legacy/IVFPQTopk.py
mhamilton723/TorchPQ
f3d560ec04d9c741943fa930a1257c9be9445cbe
[ "MIT" ]
9
2021-05-28T14:52:33.000Z
2022-03-03T13:09:25.000Z
torchpq/legacy/IVFPQTopk.py
mhamilton723/TorchPQ
f3d560ec04d9c741943fa930a1257c9be9445cbe
[ "MIT" ]
10
2021-04-24T04:25:24.000Z
2022-02-24T07:30:42.000Z
import torch import numpy as np import math from ..kernels import ComputeProductCuda class IVFPQTopk: def __init__(self, n_subvectors, n_clusters, n_cs=4, ): assert torch.cuda.is_available() self.n_subvectors = n_subvectors self.n_clusters = n_clusters self.n_cs = n_cs self.sm_siz...
32.090164
83
0.637292
import torch import numpy as np import math from ..kernels import ComputeProductCuda class IVFPQTopk: def __init__(self, n_subvectors, n_clusters, n_cs=4, ): assert torch.cuda.is_available() self.n_subvectors = n_subvectors self.n_clusters = n_clusters self.n_cs = n_cs self.sm_siz...
true
true
1c3ab1668f9b0b952c25c52d791afe7807b62859
10,702
py
Python
tanjun/__init__.py
thesadru/Tanjun
977eacbd2b0eeafd14a30450aceeb9e329703edd
[ "BSD-3-Clause" ]
null
null
null
tanjun/__init__.py
thesadru/Tanjun
977eacbd2b0eeafd14a30450aceeb9e329703edd
[ "BSD-3-Clause" ]
null
null
null
tanjun/__init__.py
thesadru/Tanjun
977eacbd2b0eeafd14a30450aceeb9e329703edd
[ "BSD-3-Clause" ]
null
null
null
# -*- coding: utf-8 -*- # cython: language_level=3 # BSD 3-Clause License # # Copyright (c) 2020-2022, Faster Speeding # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of sour...
33.548589
100
0.769576
from __future__ import annotations __all__: list[str] = [ "AnyHooks", "BucketResource", "Client", "ClientCallbackNames", "CommandError", "Component", "ConversionError", "FailedCheck", "FailedModuleLoad", "FailedModuleUnload", "HaltExecutio...
true
true
1c3ab1ef5f86b0cd1cd75c356f7f133390e6603d
47,320
py
Python
cwltool/command_line_tool.py
giannisdoukas/cwltool
5a29b0742b8387f1ce8fc11e9b408a3b636432ee
[ "Apache-2.0" ]
null
null
null
cwltool/command_line_tool.py
giannisdoukas/cwltool
5a29b0742b8387f1ce8fc11e9b408a3b636432ee
[ "Apache-2.0" ]
null
null
null
cwltool/command_line_tool.py
giannisdoukas/cwltool
5a29b0742b8387f1ce8fc11e9b408a3b636432ee
[ "Apache-2.0" ]
null
null
null
"""Implementation of CommandLineTool.""" import copy import hashlib import json import locale import logging import os import re import shutil import tempfile import threading import urllib from functools import cmp_to_key, partial from typing import ( Any, Callable, Dict, Generator, List, Mapp...
39.697987
101
0.501078
import copy import hashlib import json import locale import logging import os import re import shutil import tempfile import threading import urllib from functools import cmp_to_key, partial from typing import ( Any, Callable, Dict, Generator, List, Mapping, MutableMapping, MutableSeque...
true
true
1c3ab21238dd0f028ba1695c2193bb7d985c1df8
1,899
py
Python
run.py
SimonLaplacing/Lattice_Planner
bb2b7a0311f261b7ad333688044be50585bcb6f5
[ "MIT" ]
null
null
null
run.py
SimonLaplacing/Lattice_Planner
bb2b7a0311f261b7ad333688044be50585bcb6f5
[ "MIT" ]
null
null
null
run.py
SimonLaplacing/Lattice_Planner
bb2b7a0311f261b7ad333688044be50585bcb6f5
[ "MIT" ]
1
2022-02-18T06:13:59.000Z
2022-02-18T06:13:59.000Z
import glob import os import sys import gym import carla_gym import inspect import argparse import numpy as np import os.path as osp from pathlib import Path currentPath = osp.dirname(osp.abspath(inspect.getfile(inspect.currentframe()))) # sys.path.insert(1, currentPath + '/agents/stable_baselines/') import shutil fro...
35.830189
128
0.679305
import glob import os import sys import gym import carla_gym import inspect import argparse import numpy as np import os.path as osp from pathlib import Path currentPath = osp.dirname(osp.abspath(inspect.getfile(inspect.currentframe()))) import shutil from config import cfg, log_config_to_file, cfg_from_list, cfg_fro...
true
true
1c3ab214cffa2f8e86e722767cbaba250cd2f557
4,854
py
Python
provisioning/profile.py
manicmaniac/provisioning
ca29b9ee6f4274489bbf8fbc79b44ebcfc22e66a
[ "MIT" ]
4
2018-11-05T10:33:57.000Z
2019-10-11T16:12:15.000Z
provisioning/profile.py
manicmaniac/provisioning
ca29b9ee6f4274489bbf8fbc79b44ebcfc22e66a
[ "MIT" ]
null
null
null
provisioning/profile.py
manicmaniac/provisioning
ca29b9ee6f4274489bbf8fbc79b44ebcfc22e66a
[ "MIT" ]
2
2021-01-21T03:45:54.000Z
2021-12-30T00:55:50.000Z
#!/usr/bin/env python # -*- coding:utf-8 -*- import plistlib import uuid import getpass import platform import os from datetime import datetime from OpenSSL.crypto import FILETYPE_ASN1, load_certificate from entitlements import Entitlements class ProvisioningProfile(object): ''' Apple's provisioning profile....
27.117318
86
0.585909
import plistlib import uuid import getpass import platform import os from datetime import datetime from OpenSSL.crypto import FILETYPE_ASN1, load_certificate from entitlements import Entitlements class ProvisioningProfile(object): def __init__(self, data): self._data = data self._plist = self._...
true
true
1c3ab2c57a386d99a67787a8c1d69ac297abe034
2,586
py
Python
securitycenter/noxfile.py
deryrahman/google-cloud-python
b55058c4b2328fde32f29bfd8ea04708fcc578e0
[ "Apache-2.0" ]
1
2020-10-25T04:39:41.000Z
2020-10-25T04:39:41.000Z
securitycenter/noxfile.py
deryrahman/google-cloud-python
b55058c4b2328fde32f29bfd8ea04708fcc578e0
[ "Apache-2.0" ]
4
2018-11-13T22:15:36.000Z
2018-12-07T18:31:38.000Z
securitycenter/noxfile.py
deryrahman/google-cloud-python
b55058c4b2328fde32f29bfd8ea04708fcc578e0
[ "Apache-2.0" ]
null
null
null
# Copyright 2017, Google LLC 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 applicable law or a...
28.733333
75
0.651585
from __future__ import absolute_import import os import nox LOCAL_DEPS = ( os.path.join('..', 'api_core'), os.path.join('..', 'core'), ) def default(session): session.install('mock', 'pytest', 'pytest-cov', *LOCAL_DEPS) session.install('-e', '.') session.run( 'py.test', ...
true
true
1c3ab3b2e1c2b3127edc2cd733cf4b3563ef3be9
1,793
py
Python
setup.py
tylerdave/baxter
4c972e060c21f5d2b6d55dbbdb4407abf2e41cb1
[ "MIT" ]
null
null
null
setup.py
tylerdave/baxter
4c972e060c21f5d2b6d55dbbdb4407abf2e41cb1
[ "MIT" ]
null
null
null
setup.py
tylerdave/baxter
4c972e060c21f5d2b6d55dbbdb4407abf2e41cb1
[ "MIT" ]
null
null
null
"""A setuptools based setup module for Baxter""" #!/usr/bin/env python # -*- coding: utf-8 -*- from codecs import open from os import path from setuptools import setup, find_packages import versioneer here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'README.rst'), encoding='utf-8') as readme_fi...
29.393443
76
0.643614
from codecs import open from os import path from setuptools import setup, find_packages import versioneer here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'README.rst'), encoding='utf-8') as readme_file: readme = readme_file.read() with open(path.join(here, 'HISTORY.rst'), encoding='utf-...
true
true
1c3ab5d14a60389fd672956ef912ecce50ed78dc
2,359
py
Python
src/python/zensols/garmdown/backup.py
garmin-data/garmdown
5f466ebb0b9450890d5fc75336ccafa3654a9464
[ "MIT" ]
14
2020-01-13T10:39:35.000Z
2021-12-19T13:17:46.000Z
src/python/zensols/garmdown/backup.py
garmin-data/garmdown
5f466ebb0b9450890d5fc75336ccafa3654a9464
[ "MIT" ]
4
2020-02-28T08:39:17.000Z
2021-02-28T19:05:06.000Z
src/python/zensols/garmdown/backup.py
garmin-data/garmdown
5f466ebb0b9450890d5fc75336ccafa3654a9464
[ "MIT" ]
6
2020-04-22T06:12:07.000Z
2022-01-02T13:25:24.000Z
import logging from pathlib import Path from datetime import datetime import shutil as su from zensols.persist import persisted from zensols.garmdown import ( Backup, Persister, ) logger = logging.getLogger(__name__) class Backuper(object): """Backup the SQLite database on a periodic basis. """ ...
31.039474
86
0.607037
import logging from pathlib import Path from datetime import datetime import shutil as su from zensols.persist import persisted from zensols.garmdown import ( Backup, Persister, ) logger = logging.getLogger(__name__) class Backuper(object): def __init__(self, config): self.config = config ...
true
true
1c3ab77fe89a139978bf23a2f6badb56e94347eb
463
py
Python
divisors.py
nikithaanil/practice_python
0afc06573dc2df684bc5afcf77d47057fe4811bb
[ "MIT" ]
null
null
null
divisors.py
nikithaanil/practice_python
0afc06573dc2df684bc5afcf77d47057fe4811bb
[ "MIT" ]
null
null
null
divisors.py
nikithaanil/practice_python
0afc06573dc2df684bc5afcf77d47057fe4811bb
[ "MIT" ]
null
null
null
'''Create a program that asks the user for a number and then prints out a list of all the divisors of that number. (If you don’t know what a divisor is, it is a number that divides evenly into another number. For example, 13 is a divisor of 26 because 26 / 13 has no remainder.)''' num=int(input("enter a number: ")) li...
30.866667
114
0.693305
num=int(input("enter a number: ")) limit=num+1 divisor_list=[] for i in range(1,limit): if num % i == 0: divisor_list.append(i) print(divisor_list)
true
true
1c3ab89982bccb51263a24e9dabba740aa178000
246
py
Python
examples/congratulations_app/setup.py
maximsakhno/galo-ioc
d300cc0e63e6ad375b7d2e75ac2b2e2fda30da4f
[ "MIT" ]
9
2022-01-16T11:45:00.000Z
2022-03-23T07:42:24.000Z
examples/congratulations_app/setup.py
maximsakhno/galo-ioc
d300cc0e63e6ad375b7d2e75ac2b2e2fda30da4f
[ "MIT" ]
2
2022-01-16T12:03:14.000Z
2022-01-16T12:11:27.000Z
examples/congratulations_app/setup.py
maximsakhno/galo-ioc
d300cc0e63e6ad375b7d2e75ac2b2e2fda30da4f
[ "MIT" ]
null
null
null
from setuptools import find_packages, setup setup( name="congratulations-app", version="0.1.0", author="Maxim Sakhno", author_email="maxim.sakhno@iqtek.ru", packages=find_packages(where="src"), package_dir={"": "src"}, )
22.363636
43
0.670732
from setuptools import find_packages, setup setup( name="congratulations-app", version="0.1.0", author="Maxim Sakhno", author_email="maxim.sakhno@iqtek.ru", packages=find_packages(where="src"), package_dir={"": "src"}, )
true
true
1c3ab918d5b7e639c71ebfccc8ec4f95dda7aa5e
24,047
py
Python
plugins/keepkey/qt.py
D3m0nKingx/electrum-ganja
be204713107626f3e334e9fd5974c044a9f2ffb6
[ "MIT" ]
null
null
null
plugins/keepkey/qt.py
D3m0nKingx/electrum-ganja
be204713107626f3e334e9fd5974c044a9f2ffb6
[ "MIT" ]
null
null
null
plugins/keepkey/qt.py
D3m0nKingx/electrum-ganja
be204713107626f3e334e9fd5974c044a9f2ffb6
[ "MIT" ]
null
null
null
from functools import partial import threading from PyQt5.Qt import Qt from PyQt5.Qt import QGridLayout, QInputDialog, QPushButton from PyQt5.Qt import QVBoxLayout, QLabel from electrum_ganja_gui.qt.util import * from electrum_ganja.i18n import _ from electrum_ganja.plugins import hook, DeviceMgr from electrum_ganja....
40.965928
83
0.617749
from functools import partial import threading from PyQt5.Qt import Qt from PyQt5.Qt import QGridLayout, QInputDialog, QPushButton from PyQt5.Qt import QVBoxLayout, QLabel from electrum_ganja_gui.qt.util import * from electrum_ganja.i18n import _ from electrum_ganja.plugins import hook, DeviceMgr from electrum_ganja....
true
true
1c3aba465304b6285d331e2c3d8dd66f956edd2d
1,471
py
Python
src/media_server/serializers.py
nefarius/portfolio-backend
f595041354eedee71a4aa5b761501be030b81d09
[ "Apache-2.0" ]
6
2019-06-19T12:56:42.000Z
2021-12-26T07:22:47.000Z
src/media_server/serializers.py
nefarius/portfolio-backend
f595041354eedee71a4aa5b761501be030b81d09
[ "Apache-2.0" ]
13
2019-12-20T10:39:44.000Z
2022-02-10T09:11:09.000Z
src/media_server/serializers.py
nefarius/portfolio-backend
f595041354eedee71a4aa5b761501be030b81d09
[ "Apache-2.0" ]
1
2021-12-01T12:03:29.000Z
2021-12-01T12:03:29.000Z
from rest_framework import serializers from django.core.exceptions import ValidationError from django.utils.translation import gettext_lazy as _ from core.models import Entry from .validators import validate_license as vl def validate_license(value): if value is not None: try: vl(value) ...
29.42
90
0.71448
from rest_framework import serializers from django.core.exceptions import ValidationError from django.utils.translation import gettext_lazy as _ from core.models import Entry from .validators import validate_license as vl def validate_license(value): if value is not None: try: vl(value) ...
true
true
1c3abb1ad5688d5f6754c39edb8aa508dcfa7d1c
1,028
py
Python
Python/flip-binary-tree-to-match-preorder-traversal.py
black-shadows/LeetCode-Solutions
b1692583f7b710943ffb19b392b8bf64845b5d7a
[ "Fair", "Unlicense" ]
null
null
null
Python/flip-binary-tree-to-match-preorder-traversal.py
black-shadows/LeetCode-Solutions
b1692583f7b710943ffb19b392b8bf64845b5d7a
[ "Fair", "Unlicense" ]
null
null
null
Python/flip-binary-tree-to-match-preorder-traversal.py
black-shadows/LeetCode-Solutions
b1692583f7b710943ffb19b392b8bf64845b5d7a
[ "Fair", "Unlicense" ]
null
null
null
# Time: O(n) # Space: O(h) # Definition for a binary tree node. class TreeNode(object): def __init__(self, x): self.val = x self.left = None self.right = None class Solution(object): def flipMatchVoyage(self, root, voyage): """ :type root: TreeNo...
30.235294
66
0.476654
class TreeNode(object): def __init__(self, x): self.val = x self.left = None self.right = None class Solution(object): def flipMatchVoyage(self, root, voyage): def dfs(root, voyage, i, result): if not root: return True ...
true
true
1c3abb9ac79583acad9bbf281f80f7e7c3b927d3
7,926
py
Python
applications/auto_pilot_bigball/container/c2_Obstacle_Detection/app/predict.py
Dumpkin1996/clipper
1a08bbdde846c3cfe76236c68548a848f71605e0
[ "Apache-2.0" ]
2
2019-04-24T13:46:28.000Z
2019-05-28T06:59:26.000Z
applications/auto_pilot_bigball/container/c2_Obstacle_Detection/app/predict.py
SimonZsx/clipper
457088be2ebe68c68b94d90389d1308e35b4c844
[ "Apache-2.0" ]
null
null
null
applications/auto_pilot_bigball/container/c2_Obstacle_Detection/app/predict.py
SimonZsx/clipper
457088be2ebe68c68b94d90389d1308e35b4c844
[ "Apache-2.0" ]
4
2019-04-03T11:03:57.000Z
2019-06-26T08:22:38.000Z
import numpy as np import tensorflow as tf import cv2 import time previous = [] class yolo_tf: w_img = 1280 h_img = 720 weights_file = '/container/c2_Obstacle_Detection/app/weights/YOLO_small.ckpt' alpha = 0.1 threshold = 0.3 iou_threshold = 0.5 result_list = None classes = ["car"] def __init__(self): ...
37.386792
148
0.696064
import numpy as np import tensorflow as tf import cv2 import time previous = [] class yolo_tf: w_img = 1280 h_img = 720 weights_file = '/container/c2_Obstacle_Detection/app/weights/YOLO_small.ckpt' alpha = 0.1 threshold = 0.3 iou_threshold = 0.5 result_list = None classes = ["car"] def __init__(self): ...
true
true
1c3abbb1826a720dc0409dbf7f20ba1bb775ab71
532
py
Python
api/tracker/lib.py
yurebecca/spam-tracker
c210f683cdef1b6c61edc45759534a8f8a2cef49
[ "MIT" ]
null
null
null
api/tracker/lib.py
yurebecca/spam-tracker
c210f683cdef1b6c61edc45759534a8f8a2cef49
[ "MIT" ]
null
null
null
api/tracker/lib.py
yurebecca/spam-tracker
c210f683cdef1b6c61edc45759534a8f8a2cef49
[ "MIT" ]
null
null
null
import re import math # Simple way to count number of words in a string def word_count(str): words = str.split() return len(words) # This is due to python's rounding issue def round_half_up(n, decimals = 0): multiplier = 10 ** decimals return math.floor(n * multiplier + 0.5) / multiplier def pre_pro...
21.28
56
0.62782
import re import math def word_count(str): words = str.split() return len(words) def round_half_up(n, decimals = 0): multiplier = 10 ** decimals return math.floor(n * multiplier + 0.5) / multiplier def pre_process(text): # lowercase text = text.lower() #remove tags text = re.sub("...
true
true
1c3abd66b0857aa0c1ac086a6dc7a04879fe82eb
2,265
py
Python
urls.py
Pickerup-Yirui/ourSpider
f85e39b07335b77a57b08ab5aea5792ad3dc67e7
[ "MIT" ]
null
null
null
urls.py
Pickerup-Yirui/ourSpider
f85e39b07335b77a57b08ab5aea5792ad3dc67e7
[ "MIT" ]
null
null
null
urls.py
Pickerup-Yirui/ourSpider
f85e39b07335b77a57b08ab5aea5792ad3dc67e7
[ "MIT" ]
null
null
null
""" author = "YiRui Wang" 定义了一系列抓取51jobs页面上urls的函数(包) 创建于2020 1 16 getPageNum(num):根据初始url找到并返回网页总页数 webUrlsPool(page_num):根据得到的网页总数,构造并返回所有符合搜索标准的网页url列表 getJobUrls(pageUrl):根据pageUrl,得到该page上的jobUrl """ import requests from bs4 import BeautifulSoup def getPageNum(): """ 根据初始url找到并返回网页总页数 """ # k...
27.962963
160
0.661369
import requests from bs4 import BeautifulSoup def getPageNum(): url = 'https://search.51job.com/list/070300%252C020000,000000,0000,00,9,99,\ %25E6%2595%25B0%25E5%25AD%2597%25E8%2590%25A5%25E9%2594%2580,2,1.html?\ lang=c&stype=&postchannel=0000&workyear=99&cotype=99&degreefrom=99&jobterm=...
true
true
1c3abe858e449d13064c1b268f168670810c2b42
14,657
py
Python
samples/02_basics/08_texture_arrays/src/08_texture_arrays.py
SiminBadri/Wolf.Engine
3da04471ec26e162e1cbb7cc88c7ce37ee32c954
[ "BSL-1.0", "Apache-2.0", "libpng-2.0" ]
1
2020-07-15T13:14:26.000Z
2020-07-15T13:14:26.000Z
samples/02_basics/08_texture_arrays/src/08_texture_arrays.py
foroughmajidi/Wolf.Engine
f08a8cbd519ca2c70b1c8325250dc9af7ac4c498
[ "BSL-1.0", "Apache-2.0", "libpng-2.0" ]
null
null
null
samples/02_basics/08_texture_arrays/src/08_texture_arrays.py
foroughmajidi/Wolf.Engine
f08a8cbd519ca2c70b1c8325250dc9af7ac4c498
[ "BSL-1.0", "Apache-2.0", "libpng-2.0" ]
null
null
null
import sys, os #get path of script _script_path = os.path.realpath(__file__) _script_dir = os.path.dirname(_script_path) pyWolfPath = _script_dir if sys.platform == "linux" or sys.platform == "linux2": print "Linux not tested yet" elif sys.platform == "darwin": print "OS X not tested yet" elif sys.platform ==...
37.873385
212
0.580132
import sys, os _script_path = os.path.realpath(__file__) _script_dir = os.path.dirname(_script_path) pyWolfPath = _script_dir if sys.platform == "linux" or sys.platform == "linux2": print "Linux not tested yet" elif sys.platform == "darwin": print "OS X not tested yet" elif sys.platform == "win32": pyWol...
false
true
1c3abf155ac5dafd3b312ee9b76e109b091d1503
2,368
py
Python
examples/adspygoogle/dfp/v201302/creative_wrapper_service/create_creative_wrappers.py
cherry-wb/googleads-python-lib
24a1ecb7c1cca5af3624a3b03ebaa7f5147b4a04
[ "Apache-2.0" ]
null
null
null
examples/adspygoogle/dfp/v201302/creative_wrapper_service/create_creative_wrappers.py
cherry-wb/googleads-python-lib
24a1ecb7c1cca5af3624a3b03ebaa7f5147b4a04
[ "Apache-2.0" ]
null
null
null
examples/adspygoogle/dfp/v201302/creative_wrapper_service/create_creative_wrappers.py
cherry-wb/googleads-python-lib
24a1ecb7c1cca5af3624a3b03ebaa7f5147b4a04
[ "Apache-2.0" ]
2
2020-04-02T19:00:31.000Z
2020-08-06T03:28:38.000Z
#!/usr/bin/python # # Copyright 2013 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
34.823529
80
0.712416
__author__ = 'api.shamjeff@gmail.com (Jeff Sham)' import os import sys sys.path.insert(0, os.path.join('..', '..', '..', '..', '..')) from adspygoogle import DfpClient LABEL_ID = 'INSERT_CREATIVE_WRAPPER_LABEL_ID_HERE' def main(client, label_id): creative_wrapper_service = client.GetServic...
true
true
1c3abf390f833ba023c82673917278d8ccce4a81
4,331
py
Python
lisa/show_segmentation.py
mjirik/lisa
06c5cb8f375f51302341e768512f02236774c8a3
[ "BSD-3-Clause" ]
22
2015-01-26T12:58:54.000Z
2021-04-15T17:48:13.000Z
lisa/show_segmentation.py
mjirik/lisa
06c5cb8f375f51302341e768512f02236774c8a3
[ "BSD-3-Clause" ]
31
2015-01-23T14:46:13.000Z
2018-05-18T14:47:18.000Z
lisa/show_segmentation.py
mjirik/lisa
06c5cb8f375f51302341e768512f02236774c8a3
[ "BSD-3-Clause" ]
13
2015-06-30T08:54:27.000Z
2020-09-11T16:08:19.000Z
#! /usr/bin/python # -*- coding: utf-8 -*- """ Module is used for visualization of segmentation stored in pkl file. """ import sys import os.path path_to_script = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.join(path_to_script, "../extern/dicom2fem/src")) from loguru import logger # logge...
25.034682
124
0.643962
import sys import os.path path_to_script = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.join(path_to_script, "../extern/dicom2fem/src")) from loguru import logger from PyQt5.QtWidgets import QApplication import argparse import numpy as np try: import dicom2fem import d...
true
true
1c3abf7fcae14682cbe89c0667091899ac054267
5,384
py
Python
examples/plot_interpolation.py
mdrolet01/scikit-fda
f16ffb3986408c12a2dfdf910688bd56ddecb188
[ "BSD-3-Clause" ]
1
2020-06-27T22:25:49.000Z
2020-06-27T22:25:49.000Z
examples/plot_interpolation.py
KonstantinKlepikov/scikit-fda
93c4ad80aaba8739b4f90932a2a759d6f5960387
[ "BSD-3-Clause" ]
null
null
null
examples/plot_interpolation.py
KonstantinKlepikov/scikit-fda
93c4ad80aaba8739b4f90932a2a759d6f5960387
[ "BSD-3-Clause" ]
null
null
null
""" Interpolation ===================== This example shows the types of interpolation used in the evaluation of FDataGrids. """ # Author: Pablo Marcos Manchón # License: MIT # sphinx_gallery_thumbnail_number = 3 import skfda from skfda.representation.interpolation import SplineInterpolation from mpl_toolkits.mplot...
34.961039
80
0.570208
import skfda from skfda.representation.interpolation import SplineInterpolation from mpl_toolkits.mplot3d import axes3d import matplotlib.pyplot as plt import numpy as np
true
true
1c3ac11edbb911fcd05ae9c9593b4e3342b95310
4,326
py
Python
fbpcs/private_computation/test/service/test_compute_metrics_stage_service.py
chaitanya2334/fbpcs
8b9f35df31b1c85820805c1a0df7c6a881b15b6c
[ "MIT" ]
33
2021-05-07T19:45:15.000Z
2021-08-11T17:10:26.000Z
fbpcs/private_computation/test/service/test_compute_metrics_stage_service.py
chaitanya2334/fbpcs
8b9f35df31b1c85820805c1a0df7c6a881b15b6c
[ "MIT" ]
111
2021-05-18T22:43:05.000Z
2021-08-13T15:58:12.000Z
fbpcs/private_computation/test/service/test_compute_metrics_stage_service.py
chaitanya2334/fbpcs
8b9f35df31b1c85820805c1a0df7c6a881b15b6c
[ "MIT" ]
14
2021-05-18T22:42:24.000Z
2021-07-26T17:51:18.000Z
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from collections import defaultdict from unittest import IsolatedAsyncioTestCase from unittest.mock import AsyncMock,...
41.596154
96
0.718678
from collections import defaultdict from unittest import IsolatedAsyncioTestCase from unittest.mock import AsyncMock, MagicMock, patch from fbpcp.entity.mpc_instance import MPCParty from fbpcs.common.entity.pcs_mpc_instance import PCSMPCInstance from fbpcs.onedocker_binary_config import OneDockerBinaryConfig fro...
true
true
1c3ac2c3e925dd7380b9f7412396e842a9a3d381
7,543
py
Python
backend/coreapp/models/github.py
ChrisNonyminus/decomp.me
b51e8d586ba95bd20f6b2e5881ecc34459e761bc
[ "MIT" ]
47
2021-11-05T14:20:58.000Z
2022-03-19T18:56:46.000Z
backend/coreapp/models/github.py
ChrisNonyminus/decomp.me
b51e8d586ba95bd20f6b2e5881ecc34459e761bc
[ "MIT" ]
131
2021-10-20T09:17:16.000Z
2022-03-31T22:22:54.000Z
backend/coreapp/models/github.py
ChrisNonyminus/decomp.me
b51e8d586ba95bd20f6b2e5881ecc34459e761bc
[ "MIT" ]
20
2021-11-23T18:49:45.000Z
2022-03-29T06:25:10.000Z
import shutil import subprocess from pathlib import Path from typing import Optional import requests from django.conf import settings from django.contrib.auth import login from django.contrib.auth.models import User from django.core.cache import cache from django.db import models, transaction from django.dispatch imp...
31.429167
92
0.610367
import shutil import subprocess from pathlib import Path from typing import Optional import requests from django.conf import settings from django.contrib.auth import login from django.contrib.auth.models import User from django.core.cache import cache from django.db import models, transaction from django.dispatch imp...
true
true
1c3ac2d09d38edf07628177024ae5dbc3817b8e9
17,488
py
Python
tensorflow/python/training/optimizer.py
adsar/tensorflow
b4b2575ec4bf7e6da2686505f61b5f16cb9273ab
[ "Apache-2.0" ]
21
2016-03-10T11:55:45.000Z
2021-02-03T02:49:11.000Z
tensorflow/python/training/optimizer.py
getnamo/tensorflow
b4b2575ec4bf7e6da2686505f61b5f16cb9273ab
[ "Apache-2.0" ]
null
null
null
tensorflow/python/training/optimizer.py
getnamo/tensorflow
b4b2575ec4bf7e6da2686505f61b5f16cb9273ab
[ "Apache-2.0" ]
39
2016-03-25T05:13:09.000Z
2020-06-16T01:30:53.000Z
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
36.132231
80
0.687043
from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from tensorflow.python.ops import control_flow_ops from tensorflow.python.ops import gradients from te...
true
true
1c3ac313d13f15b5d98c34af76ec504b207cd802
1,682
py
Python
2021/20/20a.py
befeleme/aoc
dec81ceeffb8746af28eeeb7f925b219f2445079
[ "WTFPL" ]
3
2021-12-07T17:46:48.000Z
2022-02-23T13:33:19.000Z
2021/20/20a.py
befeleme/aoc
dec81ceeffb8746af28eeeb7f925b219f2445079
[ "WTFPL" ]
null
null
null
2021/20/20a.py
befeleme/aoc
dec81ceeffb8746af28eeeb7f925b219f2445079
[ "WTFPL" ]
null
null
null
import fileinput from itertools import product from collections import Counter def find_neighbors(coor): # calculate all neighbors from offsets n = [(coor[0] + x[0], coor[1] + x[1]) for x in OFFSETS] n.sort(key=lambda y: y[1]) return n def read_binary_number(pixels, image): bin_str = "" conve...
25.104478
61
0.613555
import fileinput from itertools import product from collections import Counter def find_neighbors(coor): n = [(coor[0] + x[0], coor[1] + x[1]) for x in OFFSETS] n.sort(key=lambda y: y[1]) return n def read_binary_number(pixels, image): bin_str = "" converter = {"#": "1", ".": "0"} for co...
true
true
1c3ac3df3b724f75d33832bc36122e5a31a75e33
371
py
Python
setup.py
zacharyvoase/django-conch
b964715e52f23e998811b6ffc95a481abff141ad
[ "Unlicense" ]
11
2015-02-11T18:00:51.000Z
2020-12-27T19:40:33.000Z
setup.py
zacharyvoase/django-conch
b964715e52f23e998811b6ffc95a481abff141ad
[ "Unlicense" ]
null
null
null
setup.py
zacharyvoase/django-conch
b964715e52f23e998811b6ffc95a481abff141ad
[ "Unlicense" ]
3
2015-02-06T07:15:02.000Z
2019-08-21T06:05:22.000Z
from setuptools import setup, find_packages setup( name='django-conch', version='0.0.1', description='Expose the Django shell as an SSH server.', author='Zachary Voase', author_email='z@zacharyvoase.com', url='https://github.com/zacharyvoase/django-conch', packages=find_packages(), inst...
24.733333
60
0.663073
from setuptools import setup, find_packages setup( name='django-conch', version='0.0.1', description='Expose the Django shell as an SSH server.', author='Zachary Voase', author_email='z@zacharyvoase.com', url='https://github.com/zacharyvoase/django-conch', packages=find_packages(), inst...
true
true
1c3ac6e13ded41f757bb93c822f7b8a62f1e0db5
1,562
py
Python
examples/docs_snippets/docs_snippets_tests/concepts_tests/solids_pipelines_tests/test_op_events.py
facultyai/dagster
779e27faa3e46b7d043cb9624617e655a9ed570c
[ "Apache-2.0" ]
null
null
null
examples/docs_snippets/docs_snippets_tests/concepts_tests/solids_pipelines_tests/test_op_events.py
facultyai/dagster
779e27faa3e46b7d043cb9624617e655a9ed570c
[ "Apache-2.0" ]
null
null
null
examples/docs_snippets/docs_snippets_tests/concepts_tests/solids_pipelines_tests/test_op_events.py
facultyai/dagster
779e27faa3e46b7d043cb9624617e655a9ed570c
[ "Apache-2.0" ]
1
2019-09-11T03:02:27.000Z
2019-09-11T03:02:27.000Z
import pytest from dagster import Failure, graph from docs_snippets.concepts.solids_pipelines.op_events import ( my_asset_op, my_expectation_op, my_failure_metadata_op, my_failure_op, my_metadata_expectation_op, my_metadata_output, my_named_yield_op, my_retry_op, my_simple_return_op,...
22.970588
95
0.684379
import pytest from dagster import Failure, graph from docs_snippets.concepts.solids_pipelines.op_events import ( my_asset_op, my_expectation_op, my_failure_metadata_op, my_failure_op, my_metadata_expectation_op, my_metadata_output, my_named_yield_op, my_retry_op, my_simple_return_op,...
true
true
1c3ac88eb31bff41592b4cd9757639d29e3aa0c2
3,988
py
Python
gazoo_device/gdm_cli.py
dedsec-9/gazoo-device
5ed2867c258da80e53b6aae07ec7a65efe473a28
[ "Apache-2.0" ]
14
2020-11-05T23:23:32.000Z
2022-03-01T18:59:29.000Z
gazoo_device/gdm_cli.py
dedsec-9/gazoo-device
5ed2867c258da80e53b6aae07ec7a65efe473a28
[ "Apache-2.0" ]
null
null
null
gazoo_device/gdm_cli.py
dedsec-9/gazoo-device
5ed2867c258da80e53b6aae07ec7a65efe473a28
[ "Apache-2.0" ]
5
2021-05-20T22:52:51.000Z
2022-02-21T08:46:21.000Z
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
29.984962
80
0.722919
import sys from typing import Dict, NoReturn, Optional, Sequence import fire import gazoo_device from gazoo_device import errors from gazoo_device import extensions from gazoo_device import fire_manager from gazoo_device import fire_patch from gazoo_device import gdm_logger from gazoo_device import packa...
true
true
1c3ac904e382f2b3305eb0cb5780002ae3f4fb61
560
py
Python
launcher/tray/Main.py
liblit/sampler
eaedba51ee8367b9b355e6f85a6c677878160d49
[ "BSD-3-Clause" ]
null
null
null
launcher/tray/Main.py
liblit/sampler
eaedba51ee8367b9b355e6f85a6c677878160d49
[ "BSD-3-Clause" ]
null
null
null
launcher/tray/Main.py
liblit/sampler
eaedba51ee8367b9b355e6f85a6c677878160d49
[ "BSD-3-Clause" ]
1
2019-01-08T11:09:59.000Z
2019-01-08T11:09:59.000Z
import gi gi.require_version('Gtk', '3.0') from contextlib import closing from gi.repository import Gio, Gtk from os.path import abspath, dirname, join from sys import path path.insert(1, join(dirname(dirname(abspath(__file__))), 'common')) from NotificationIcon import NotificationIcon import Keys import Service ...
20.740741
72
0.635714
import gi gi.require_version('Gtk', '3.0') from contextlib import closing from gi.repository import Gio, Gtk from os.path import abspath, dirname, join from sys import path path.insert(1, join(dirname(dirname(abspath(__file__))), 'common')) from NotificationIcon import NotificationIcon import Keys import Service
true
true
1c3ac9352ff35a89ba9ffe44e2a4b1f37bb4ce16
1,469
py
Python
gcloud/contrib/analysis/urls.py
brookylin/bk-sops
6c0cf78879849921c4ff6ad6bf3bb82dfdf5b973
[ "Apache-2.0" ]
881
2019-03-25T02:45:42.000Z
2022-03-30T09:10:49.000Z
gcloud/contrib/analysis/urls.py
m0re-work/bk-sops
d03ba8a4ee0781c6daaf0dd38a7369dc82669f7d
[ "Apache-2.0" ]
3,303
2019-03-25T04:18:03.000Z
2022-03-31T11:52:03.000Z
gcloud/contrib/analysis/urls.py
m0re-work/bk-sops
d03ba8a4ee0781c6daaf0dd38a7369dc82669f7d
[ "Apache-2.0" ]
395
2019-03-25T02:53:36.000Z
2022-03-31T08:37:28.000Z
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in co...
48.966667
115
0.756297
from django.conf.urls import url from gcloud.contrib.analysis import views urlpatterns = [ url(r"^query_instance_by_group/$", views.query_instance_by_group), url(r"^query_template_by_group/$", views.query_template_by_group), url(r"^query_atom_by_group/$", views.query_atom_by_group), url(r"^query_appm...
true
true
1c3ac9ae9d6e7c62868bb21ea49dd185eacdf50e
1,315
py
Python
recgov/utils.py
Carl4/recgov
2ebbf546861e0beece5fd2cb82cc75eabb145dcf
[ "MIT" ]
1
2021-03-27T19:20:03.000Z
2021-03-27T19:20:03.000Z
recgov/utils.py
Carl4/recgov
2ebbf546861e0beece5fd2cb82cc75eabb145dcf
[ "MIT" ]
1
2021-01-26T03:28:33.000Z
2021-01-26T03:28:33.000Z
recgov/utils.py
Carl4/recgov
2ebbf546861e0beece5fd2cb82cc75eabb145dcf
[ "MIT" ]
1
2021-03-27T19:20:44.000Z
2021-03-27T19:20:44.000Z
"""Just a place to put some handy utility functions. """ from datetime import datetime, timedelta # To find the next month easily: Add 31 days, then truncate back to day 1. def this_month(month: datetime) -> datetime: """Find the first day of this month given a datetime. :param month: the date :type mon...
22.672414
74
0.643346
from datetime import datetime, timedelta def this_month(month: datetime) -> datetime: return datetime(month.year, month.month, 1) _A_MONTH = timedelta(days=31) def next_month(month: datetime) -> datetime: dt = this_month(month) return datetime((dt+_A_MONTH).year, (dt+_A_MONTH).month, 1) def tokeni...
true
true
1c3aca0376c40b2275667a1611df6d103e55870d
1,279
py
Python
tests/ant/core/test_node.py
soundsk/python-antrw
302bada33a83a8bfa545723883a21a31fcbb9175
[ "MIT" ]
16
2017-08-23T23:57:14.000Z
2022-01-05T01:00:23.000Z
tests/ant/core/test_node.py
soundsk/python-antrw
302bada33a83a8bfa545723883a21a31fcbb9175
[ "MIT" ]
12
2017-08-26T20:20:29.000Z
2020-01-22T14:52:33.000Z
tests/ant/core/test_node.py
soundsk/python-antrw
302bada33a83a8bfa545723883a21a31fcbb9175
[ "MIT" ]
11
2017-06-08T22:21:56.000Z
2022-01-10T15:48:47.000Z
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2017, Matt Hughes # # 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 w...
47.37037
78
0.6724
true
true
1c3acab8953533a2cf50bd82367a02a4ca668525
836
py
Python
mping.py
chrisju/script
f9fcf04d443c3945e23e60821ec1a3f664ed7787
[ "BSD-3-Clause" ]
null
null
null
mping.py
chrisju/script
f9fcf04d443c3945e23e60821ec1a3f664ed7787
[ "BSD-3-Clause" ]
null
null
null
mping.py
chrisju/script
f9fcf04d443c3945e23e60821ec1a3f664ed7787
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/env python2 # coding = utf8 import sys import os n = 10 ipfile = '/home/zz/bin/DNS' tmpfile = '/tmp/mpinglog' def out(): f = open(tmpfile) for line in f.readlines(): if line.strip() and not line.startswith('#'): if line.startswith('---') \ or line.startswith...
23.885714
62
0.479665
import sys import os n = 10 ipfile = '/home/zz/bin/DNS' tmpfile = '/tmp/mpinglog' def out(): f = open(tmpfile) for line in f.readlines(): if line.strip() and not line.startswith('#'): if line.startswith('---') \ or line.startswith('rtt') \ or line...
false
true
1c3acb79dffe5301debf4d75865233f21cf4f756
95
py
Python
URI2791.py
rashidulhasanhridoy/URI-Online-Judge-Problem-Solve-with-Python-3
c7db434e2e6e40c2ca3bd56db0d04cf79f69de12
[ "Apache-2.0" ]
2
2020-07-21T18:01:37.000Z
2021-11-29T01:08:14.000Z
URI2791.py
rashidulhasanhridoy/URI-Online-Judge-Problem-Solve-with-Python-3
c7db434e2e6e40c2ca3bd56db0d04cf79f69de12
[ "Apache-2.0" ]
null
null
null
URI2791.py
rashidulhasanhridoy/URI-Online-Judge-Problem-Solve-with-Python-3
c7db434e2e6e40c2ca3bd56db0d04cf79f69de12
[ "Apache-2.0" ]
null
null
null
X = list(map(int, input('').split())) for i in X: if i == 1: print(X.index(i) + 1)
19
37
0.473684
X = list(map(int, input('').split())) for i in X: if i == 1: print(X.index(i) + 1)
true
true
1c3acbabae93bd72a25b201657cbaa1571e73910
13,460
py
Python
tests/api/test_files.py
Xandersoft/seahub
f75f238b3e0a907e8a8003f419e367fa36e992e7
[ "Apache-2.0", "BSD-3-Clause" ]
null
null
null
tests/api/test_files.py
Xandersoft/seahub
f75f238b3e0a907e8a8003f419e367fa36e992e7
[ "Apache-2.0", "BSD-3-Clause" ]
null
null
null
tests/api/test_files.py
Xandersoft/seahub
f75f238b3e0a907e8a8003f419e367fa36e992e7
[ "Apache-2.0", "BSD-3-Clause" ]
null
null
null
#coding: UTF-8 """ Test file/dir operations. """ import posixpath import pytest import urllib from urllib import urlencode, quote import urlparse from tests.common.utils import randstring, urljoin from tests.api.apitestbase import ApiTestBase from tests.api.urls import REPOS_URL class FilesApiTest(ApiTestBase): ...
41.16208
87
0.569614
import posixpath import pytest import urllib from urllib import urlencode, quote import urlparse from tests.common.utils import randstring, urljoin from tests.api.apitestbase import ApiTestBase from tests.api.urls import REPOS_URL class FilesApiTest(ApiTestBase): def test_rename_file(self): with self.ge...
true
true
1c3acc9a9d4803560d5db364812a6583f8e90b7d
68
py
Python
nft_notificator.py
twofacednine380/nft-notificator
54f7e139b1784c81b91b9305696c9ab94fc32604
[ "MIT" ]
null
null
null
nft_notificator.py
twofacednine380/nft-notificator
54f7e139b1784c81b91b9305696c9ab94fc32604
[ "MIT" ]
null
null
null
nft_notificator.py
twofacednine380/nft-notificator
54f7e139b1784c81b91b9305696c9ab94fc32604
[ "MIT" ]
null
null
null
from src.utils import _main if __name__ == '__main__': _main()
13.6
27
0.676471
from src.utils import _main if __name__ == '__main__': _main()
true
true
1c3acdecca55f3277f91e256dd8593e2fbe38530
699
py
Python
flop/__init__.py
jwohlwend/flop
c5bbd4c5fae6291e2a056e68b44bcf97e4d757bf
[ "MIT" ]
null
null
null
flop/__init__.py
jwohlwend/flop
c5bbd4c5fae6291e2a056e68b44bcf97e4d757bf
[ "MIT" ]
null
null
null
flop/__init__.py
jwohlwend/flop
c5bbd4c5fae6291e2a056e68b44bcf97e4d757bf
[ "MIT" ]
null
null
null
from flop.hardconcrete import HardConcrete from flop.linear import ProjectedLinear, HardConcreteProjectedLinear, HardConcreteLinear from flop.train import HardConcreteTrainer from flop.utils import make_hard_concrete, make_projected_linear from flop.utils import get_hardconcrete_modules, get_hardconcrete_proj_linear_mo...
49.928571
88
0.816881
from flop.hardconcrete import HardConcrete from flop.linear import ProjectedLinear, HardConcreteProjectedLinear, HardConcreteLinear from flop.train import HardConcreteTrainer from flop.utils import make_hard_concrete, make_projected_linear from flop.utils import get_hardconcrete_modules, get_hardconcrete_proj_linear_mo...
true
true
1c3acf723768c88a3e5ed76910f430f9eea19ef7
744
py
Python
Python3/1599-Maximum-Profit-of-Operating-a-Centennial-Wheel/soln-1.py
zhangyaqi1989/LeetCode-Solutions
2655a1ffc8678ad1de6c24295071308a18c5dc6e
[ "MIT" ]
5
2020-07-24T17:48:59.000Z
2020-12-21T05:56:00.000Z
Python3/1599-Maximum-Profit-of-Operating-a-Centennial-Wheel/soln-1.py
zhangyaqi1989/LeetCode-Solutions
2655a1ffc8678ad1de6c24295071308a18c5dc6e
[ "MIT" ]
null
null
null
Python3/1599-Maximum-Profit-of-Operating-a-Centennial-Wheel/soln-1.py
zhangyaqi1989/LeetCode-Solutions
2655a1ffc8678ad1de6c24295071308a18c5dc6e
[ "MIT" ]
2
2020-07-24T17:49:01.000Z
2020-08-31T19:57:35.000Z
class Solution: def minOperationsMaxProfit(self, customers: List[int], boardingCost: int, runningCost: int) -> int: if runningCost > 4 * boardingCost: return -1 nwaits = 0 best_profit = 0 best_rotations = 0 profit = 0 for i, c in enumerate(itertools.chain(...
37.2
103
0.547043
class Solution: def minOperationsMaxProfit(self, customers: List[int], boardingCost: int, runningCost: int) -> int: if runningCost > 4 * boardingCost: return -1 nwaits = 0 best_profit = 0 best_rotations = 0 profit = 0 for i, c in enumerate(itertools.chain(...
true
true
1c3acf88e2216a9063255815651278e21fd268c9
7,422
py
Python
tensorflow_probability/python/distributions/internal/correlation_matrix_volumes_test.py
souravsingh/probability
0519b63094fdaa4e326357a0cdff056d5ef76cd8
[ "Apache-2.0" ]
1
2021-03-17T14:48:47.000Z
2021-03-17T14:48:47.000Z
tensorflow_probability/python/distributions/internal/correlation_matrix_volumes_test.py
souravsingh/probability
0519b63094fdaa4e326357a0cdff056d5ef76cd8
[ "Apache-2.0" ]
null
null
null
tensorflow_probability/python/distributions/internal/correlation_matrix_volumes_test.py
souravsingh/probability
0519b63094fdaa4e326357a0cdff056d5ef76cd8
[ "Apache-2.0" ]
null
null
null
# Copyright 2018 The TensorFlow Probability 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 law o...
44.710843
103
0.721638
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow_probability.python.distributions.internal import correlation_matrix_volumes_lib as corr from tensorflow_probability.python.distributions.interna...
true
true
1c3ad02285f960adf7dad6ef1557a67fa008156e
3,118
py
Python
company/migrations/0017_auto_20161201_1715.py
uktrade/directory-api
45a9024a7ecc2842895201cbb51420ba9e57a168
[ "MIT" ]
2
2017-06-02T09:09:08.000Z
2021-01-18T10:26:53.000Z
company/migrations/0017_auto_20161201_1715.py
konradko/directory-api
e9cd05b1deaf575e94352c46ddbd1857d8119fda
[ "MIT" ]
629
2016-10-10T09:35:52.000Z
2022-03-25T15:04:04.000Z
company/migrations/0017_auto_20161201_1715.py
konradko/directory-api
e9cd05b1deaf575e94352c46ddbd1857d8119fda
[ "MIT" ]
5
2017-06-22T10:02:22.000Z
2022-03-14T17:55:21.000Z
# -*- coding: utf-8 -*- # Generated by Django 1.9.10 on 2016-12-01 17:15 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('company', '0016_merge'), ] operations = [ migrations.AlterField( ...
100.580645
1,923
0.685696
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('company', '0016_merge'), ] operations = [ migrations.AlterField( model_name='company', name='employees', field...
true
true
1c3ad06c3a369b08b51fe1ac58bcecb9a1f95046
15,296
py
Python
management/forms.py
stustanet/Wahlfang
bd7eb21a187d6c985d34c7f806d6f88e7f00db06
[ "MIT" ]
null
null
null
management/forms.py
stustanet/Wahlfang
bd7eb21a187d6c985d34c7f806d6f88e7f00db06
[ "MIT" ]
null
null
null
management/forms.py
stustanet/Wahlfang
bd7eb21a187d6c985d34c7f806d6f88e7f00db06
[ "MIT" ]
null
null
null
import csv import io import re from datetime import timedelta from typing import Tuple, List from django import forms from django.conf import settings from django.core.validators import validate_email from django.utils import timezone from management.models import ElectionManager from vote.models import Election, App...
39.524548
119
0.600418
import csv import io import re from datetime import timedelta from typing import Tuple, List from django import forms from django.conf import settings from django.core.validators import validate_email from django.utils import timezone from management.models import ElectionManager from vote.models import Election, App...
true
true
1c3ad11a0c2040419ccba925cd61776c686fbc7f
646
py
Python
hccf/utils/mathematics.py
kazarinov/cfdr
bf93428614af15440b60fb894097e94fa4efd168
[ "MIT" ]
null
null
null
hccf/utils/mathematics.py
kazarinov/cfdr
bf93428614af15440b60fb894097e94fa4efd168
[ "MIT" ]
null
null
null
hccf/utils/mathematics.py
kazarinov/cfdr
bf93428614af15440b60fb894097e94fa4efd168
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- import math import scipy as sp def sigmoid(z): s = 1.0 / (1.0 + math.exp(-z)) return s def log_loss(act, pred): epsilon = 1e-15 pred = sp.maximum(epsilon, pred) pred = sp.minimum(1 - epsilon, pred) ll = sum(act * sp.log(pred.astype(float)) + sp.subtract(1, act.astype(...
23.925926
91
0.582043
import math import scipy as sp def sigmoid(z): s = 1.0 / (1.0 + math.exp(-z)) return s def log_loss(act, pred): epsilon = 1e-15 pred = sp.maximum(epsilon, pred) pred = sp.minimum(1 - epsilon, pred) ll = sum(act * sp.log(pred.astype(float)) + sp.subtract(1, act.astype(float)) * sp.log( ...
true
true
1c3ad1bc9968553b109809c28e96e90c83fa686c
137
py
Python
beer_store_api/urls.py
gwoods22/beer-store-api
c21593734022718896720db916b73f0404840dc2
[ "MIT" ]
1
2020-09-10T16:56:56.000Z
2020-09-10T16:56:56.000Z
beer_store_api/urls.py
gwoods22/beer-store-api
c21593734022718896720db916b73f0404840dc2
[ "MIT" ]
null
null
null
beer_store_api/urls.py
gwoods22/beer-store-api
c21593734022718896720db916b73f0404840dc2
[ "MIT" ]
1
2020-09-20T17:47:07.000Z
2020-09-20T17:47:07.000Z
from django.conf.urls import url, include urlpatterns = [ url(r'', include('products.urls')), url(r'', include('land.urls')), ]
19.571429
41
0.635036
from django.conf.urls import url, include urlpatterns = [ url(r'', include('products.urls')), url(r'', include('land.urls')), ]
true
true
1c3ad27979f8587c4744196d0b2622701d53b174
4,444
py
Python
sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/virtual_machine_scale_set_vm_profile.py
pjquirk/azure-sdk-for-python
cbf02ec4f177b96eae1dbbba87c34c2c93880150
[ "MIT" ]
1
2021-09-07T18:36:04.000Z
2021-09-07T18:36:04.000Z
sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/virtual_machine_scale_set_vm_profile.py
pjquirk/azure-sdk-for-python
cbf02ec4f177b96eae1dbbba87c34c2c93880150
[ "MIT" ]
2
2019-10-02T23:37:38.000Z
2020-10-02T01:17:31.000Z
azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/virtual_machine_scale_set_vm_profile.py
xiafu-msft/azure-sdk-for-python
4d9560cfd519ee60667f3cc2f5295a58c18625db
[ "MIT" ]
1
2019-06-17T22:18:23.000Z
2019-06-17T22:18:23.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 ...
54.864198
170
0.707021
from msrest.serialization import Model class VirtualMachineScaleSetVMProfile(Model): _attribute_map = { 'os_profile': {'key': 'osProfile', 'type': 'VirtualMachineScaleSetOSProfile'}, 'storage_profile': {'key': 'storageProfile', 'type': 'VirtualMachineScaleSetStorageProfile'}, '...
true
true
1c3ad38252e97a57417ff208d102b970a5b32ee0
5,703
py
Python
what_apps/cms/tests.py
SlashRoot/WHAT
69e78d01065142446234e77ea7c8c31e3482af29
[ "MIT" ]
null
null
null
what_apps/cms/tests.py
SlashRoot/WHAT
69e78d01065142446234e77ea7c8c31e3482af29
[ "MIT" ]
null
null
null
what_apps/cms/tests.py
SlashRoot/WHAT
69e78d01065142446234e77ea7c8c31e3482af29
[ "MIT" ]
null
null
null
from unittest import expectedFailure from what_apps.cms.models import Question, QandA, QuestionOnForm, BooleanAnswer, \ ContentBlock from what_apps.do.config import set_up as do_set_up from what_apps.utility.tests import WHATTestCase, test_user_factory from what_apps.cms.views import edit_content_block from django....
47.92437
180
0.667017
from unittest import expectedFailure from what_apps.cms.models import Question, QandA, QuestionOnForm, BooleanAnswer, \ ContentBlock from what_apps.do.config import set_up as do_set_up from what_apps.utility.tests import WHATTestCase, test_user_factory from what_apps.cms.views import edit_content_block from django....
true
true
1c3ad3a386b71cbb7c8f485ac55de1c09fcd9451
24,767
py
Python
plexapi/client.py
atoy3731/python-plexapi
ec21c897b7b9087120efd51f67b75c9a8fda7a45
[ "BSD-3-Clause" ]
null
null
null
plexapi/client.py
atoy3731/python-plexapi
ec21c897b7b9087120efd51f67b75c9a8fda7a45
[ "BSD-3-Clause" ]
null
null
null
plexapi/client.py
atoy3731/python-plexapi
ec21c897b7b9087120efd51f67b75c9a8fda7a45
[ "BSD-3-Clause" ]
null
null
null
# -*- coding: utf-8 -*- import time from xml.etree import ElementTree import requests from plexapi import BASE_HEADERS, CONFIG, TIMEOUT, log, logfilter, utils from plexapi.base import PlexObject from plexapi.exceptions import BadRequest, NotFound, Unauthorized, Unsupported from plexapi.playqueue import PlayQueue from ...
43.603873
115
0.610005
import time from xml.etree import ElementTree import requests from plexapi import BASE_HEADERS, CONFIG, TIMEOUT, log, logfilter, utils from plexapi.base import PlexObject from plexapi.exceptions import BadRequest, NotFound, Unauthorized, Unsupported from plexapi.playqueue import PlayQueue from requests.status_codes i...
true
true
1c3ad4111acc4e4d42b72a16a85a190ffbf1d829
1,213
py
Python
src/Routes/v1_message.py
TheMrAnderson/Harbinger
a008226f790da62b8436d762d76c8900763a8f76
[ "Apache-2.0" ]
null
null
null
src/Routes/v1_message.py
TheMrAnderson/Harbinger
a008226f790da62b8436d762d76c8900763a8f76
[ "Apache-2.0" ]
null
null
null
src/Routes/v1_message.py
TheMrAnderson/Harbinger
a008226f790da62b8436d762d76c8900763a8f76
[ "Apache-2.0" ]
null
null
null
from flask import request from flask_restplus import Resource, Namespace, fields ns_messages = Namespace('Messages', description='Handles message actions') m_model = ns_messages.model('harbinger_message', { 'topic': fields.String(description='Topic name'), 'date_added': fields.DateTime(description=''), 'payload': ...
33.694444
102
0.741138
from flask import request from flask_restplus import Resource, Namespace, fields ns_messages = Namespace('Messages', description='Handles message actions') m_model = ns_messages.model('harbinger_message', { 'topic': fields.String(description='Topic name'), 'date_added': fields.DateTime(description=''), 'payload': ...
true
true
1c3ad43033cb8388d598393ffe6e70100da87d89
30,552
py
Python
scipy/optimize/tests/test_least_squares.py
Ennosigaeon/scipy
2d872f7cf2098031b9be863ec25e366a550b229c
[ "BSD-3-Clause" ]
11
2020-06-28T04:30:26.000Z
2022-03-26T08:40:47.000Z
scipy/optimize/tests/test_least_squares.py
Ennosigaeon/scipy
2d872f7cf2098031b9be863ec25e366a550b229c
[ "BSD-3-Clause" ]
44
2019-06-27T15:56:14.000Z
2022-03-15T22:21:10.000Z
scipy/optimize/tests/test_least_squares.py
Ennosigaeon/scipy
2d872f7cf2098031b9be863ec25e366a550b229c
[ "BSD-3-Clause" ]
20
2021-11-07T13:55:56.000Z
2021-12-02T10:54:01.000Z
from itertools import product import numpy as np from numpy.linalg import norm from numpy.testing import (assert_, assert_allclose, assert_equal, suppress_warnings) from pytest import raises as assert_raises from scipy.sparse import issparse, lil_matrix from scipy.sparse.linalg import asline...
39.069054
96
0.559931
from itertools import product import numpy as np from numpy.linalg import norm from numpy.testing import (assert_, assert_allclose, assert_equal, suppress_warnings) from pytest import raises as assert_raises from scipy.sparse import issparse, lil_matrix from scipy.sparse.linalg import asline...
true
true
1c3ad4d233fc232732890fb92f556dcbb8c87887
4,839
py
Python
week_2_data_ingestion/airflow/dags/data_ingestion_yellowtaxi_gcs.py
meswaramoorthy/gcp-de-zoomcamp
1b01ea425404c7c101839cf363dbf556b67d86a0
[ "MIT" ]
null
null
null
week_2_data_ingestion/airflow/dags/data_ingestion_yellowtaxi_gcs.py
meswaramoorthy/gcp-de-zoomcamp
1b01ea425404c7c101839cf363dbf556b67d86a0
[ "MIT" ]
2
2022-02-22T06:40:10.000Z
2022-02-23T05:41:02.000Z
week_2_data_ingestion/airflow/dags/data_ingestion_yellowtaxi_gcs.py
meswaramoorthy/gcp-de-zoomcamp
1b01ea425404c7c101839cf363dbf556b67d86a0
[ "MIT" ]
null
null
null
# Imports import os import logging from datetime import datetime from airflow import DAG from airflow.operators.bash import BashOperator from airflow.operators.python import PythonOperator from airflow.providers.google.cloud.operators.bigquery import BigQueryCreateExternalTableOperator from google.cloud import storag...
36.938931
119
0.66646
import os import logging from datetime import datetime from airflow import DAG from airflow.operators.bash import BashOperator from airflow.operators.python import PythonOperator from airflow.providers.google.cloud.operators.bigquery import BigQueryCreateExternalTableOperator from google.cloud import storage import ...
true
true
1c3ad52d3fc87c3182c23cc3f256734c7bb28c50
331
py
Python
examples/design_search/setup.py
uoa-iai/RoboGrammar
5837107b1588f126e162ba1e9b47f5c9d26c024b
[ "MIT" ]
null
null
null
examples/design_search/setup.py
uoa-iai/RoboGrammar
5837107b1588f126e162ba1e9b47f5c9d26c024b
[ "MIT" ]
null
null
null
examples/design_search/setup.py
uoa-iai/RoboGrammar
5837107b1588f126e162ba1e9b47f5c9d26c024b
[ "MIT" ]
1
2021-05-09T21:51:11.000Z
2021-05-09T21:51:11.000Z
import os from setuptools import setup # Change working directory to the one this file is in os.chdir(os.path.dirname(os.path.realpath(__file__))) setup( name='design_search', version='0.1.0', packages=['design_search'], package_dir={'design_search': '..'}, install_requires=[ 'numpy >= 1.1...
20.6875
53
0.65861
import os from setuptools import setup os.chdir(os.path.dirname(os.path.realpath(__file__))) setup( name='design_search', version='0.1.0', packages=['design_search'], package_dir={'design_search': '..'}, install_requires=[ 'numpy >= 1.19' ] )
true
true
1c3ad68dce23f052ad3db0ec86ff7220479905d4
4,272
py
Python
kolibri/core/tasks/main.py
kuboginichimaru/kolibri
18b398f62baa1c60f8456f7f9c6d6c9447068f69
[ "MIT" ]
null
null
null
kolibri/core/tasks/main.py
kuboginichimaru/kolibri
18b398f62baa1c60f8456f7f9c6d6c9447068f69
[ "MIT" ]
8
2021-05-21T15:31:24.000Z
2022-02-24T15:02:14.000Z
kolibri/core/tasks/main.py
kuboginichimaru/kolibri
18b398f62baa1c60f8456f7f9c6d6c9447068f69
[ "MIT" ]
null
null
null
import logging import os import sqlite3 from django.utils.functional import SimpleLazyObject from sqlalchemy import create_engine from sqlalchemy import event from sqlalchemy import exc from kolibri.core.sqlite.utils import check_sqlite_integrity from kolibri.core.sqlite.utils import repair_sqlite_db from kolibri.cor...
30.297872
88
0.704588
import logging import os import sqlite3 from django.utils.functional import SimpleLazyObject from sqlalchemy import create_engine from sqlalchemy import event from sqlalchemy import exc from kolibri.core.sqlite.utils import check_sqlite_integrity from kolibri.core.sqlite.utils import repair_sqlite_db from kolibri.cor...
true
true
1c3ad6e626f17d7949669b590b2ab4b21b862670
1,491
py
Python
python/verifair/benchmarks/fairsquare/M_BNc_F_NN_V3_H2_Q.py
obastani/verifair
1d5efea041330fa9fe8d59d976bdd3ef97aff417
[ "ECL-2.0", "Apache-2.0" ]
5
2019-11-05T20:40:40.000Z
2020-09-16T03:13:54.000Z
python/verifair/benchmarks/fairsquare/M_BNc_F_NN_V3_H2_Q.py
obastani/verifair
1d5efea041330fa9fe8d59d976bdd3ef97aff417
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
python/verifair/benchmarks/fairsquare/M_BNc_F_NN_V3_H2_Q.py
obastani/verifair
1d5efea041330fa9fe8d59d976bdd3ef97aff417
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
from .helper import * def sample(flag): sex = step([(0,1,0.3307), (1,2,0.6693)]) if sex < 1: capital_gain = gaussian(568.4105, 24248365.5428) if capital_gain < 7298.0000: age = gaussian(38.4208, 184.9151) education_num = gaussian(10.0827, 6.5096) else: ...
33.886364
89
0.539906
from .helper import * def sample(flag): sex = step([(0,1,0.3307), (1,2,0.6693)]) if sex < 1: capital_gain = gaussian(568.4105, 24248365.5428) if capital_gain < 7298.0000: age = gaussian(38.4208, 184.9151) education_num = gaussian(10.0827, 6.5096) else: ...
true
true
1c3ad6e7b9c7fbea3425c301501a21a9d703b98e
1,408
py
Python
Python/longest-happy-prefix.py
sm2774us/leetcode_interview_prep_2021
33b41bea66c266b733372d9a8b9d2965cd88bf8c
[ "Fair" ]
null
null
null
Python/longest-happy-prefix.py
sm2774us/leetcode_interview_prep_2021
33b41bea66c266b733372d9a8b9d2965cd88bf8c
[ "Fair" ]
null
null
null
Python/longest-happy-prefix.py
sm2774us/leetcode_interview_prep_2021
33b41bea66c266b733372d9a8b9d2965cd88bf8c
[ "Fair" ]
null
null
null
# Time: O(n) # Space: O(n) # kmp solution class Solution(object): def longestPrefix(self, s): """ :type s: str :rtype: str """ def getPrefix(pattern): prefix = [-1]*len(pattern) j = -1 for i in range(1, len(pattern)): whil...
27.076923
74
0.426136
class Solution(object): def longestPrefix(self, s): def getPrefix(pattern): prefix = [-1]*len(pattern) j = -1 for i in range(1, len(pattern)): while j != -1 and pattern[j+1] != pattern[i]: j = prefix[j] if pattern[j+...
true
true