hexsha
stringlengths
40
40
size
int64
4
996k
ext
stringclasses
8 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
4
245
max_stars_repo_name
stringlengths
6
130
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
10
max_stars_count
int64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
4
245
max_issues_repo_name
stringlengths
6
130
max_issues_repo_head_hexsha
stringlengths
40
40
max_issues_repo_licenses
listlengths
1
10
max_issues_count
int64
1
67k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
4
245
max_forks_repo_name
stringlengths
6
130
max_forks_repo_head_hexsha
stringlengths
40
40
max_forks_repo_licenses
listlengths
1
10
max_forks_count
int64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
4
996k
avg_line_length
float64
1.33
58.2k
max_line_length
int64
2
323k
alphanum_fraction
float64
0
0.97
content_no_comment
stringlengths
0
946k
is_comment_constant_removed
bool
2 classes
is_sharp_comment_removed
bool
1 class
f7295b40d74fc0ff213abaf939f429fe1b3a169a
1,016
py
Python
cpa.py
joyousprakhar/DialogWAE
5d3a32f131ac80d0c7e25d24735933264703346d
[ "Unlicense" ]
null
null
null
cpa.py
joyousprakhar/DialogWAE
5d3a32f131ac80d0c7e25d24735933264703346d
[ "Unlicense" ]
null
null
null
cpa.py
joyousprakhar/DialogWAE
5d3a32f131ac80d0c7e25d24735933264703346d
[ "Unlicense" ]
null
null
null
import models, experiments, configs, data print("haha") config = getattr(configs, 'config_'+'DialogWAE_GMP')() args.dataset='DailyDial' args.data_path='./data' data_path=data_path+dataset+'/' print("haha") corpus = getattr(data, dataset+'Corpus')(data_path, wordvec_path='/media/prakhar/Local Disk/glove/'+'glove.twitter...
48.380952
161
0.749016
import models, experiments, configs, data print("haha") config = getattr(configs, 'config_'+'DialogWAE_GMP')() args.dataset='DailyDial' args.data_path='./data' data_path=data_path+dataset+'/' print("haha") corpus = getattr(data, dataset+'Corpus')(data_path, wordvec_path='/media/prakhar/Local Disk/glove/'+'glove.twitter...
true
true
f7295b50c4c66a23ceae1f918df8e7b8086720db
46
py
Python
gradslam/version.py
glebshevchukk/gradslam
ce38c98537e1521b5e0a780f1c53f26924df7dab
[ "MIT" ]
1,048
2020-11-06T03:49:27.000Z
2022-03-28T17:57:05.000Z
gradslam/version.py
glebshevchukk/gradslam
ce38c98537e1521b5e0a780f1c53f26924df7dab
[ "MIT" ]
32
2020-11-08T09:19:21.000Z
2022-03-14T20:36:25.000Z
gradslam/version.py
glebshevchukk/gradslam
ce38c98537e1521b5e0a780f1c53f26924df7dab
[ "MIT" ]
124
2020-11-08T07:29:57.000Z
2022-03-16T11:40:56.000Z
# Export version number __version__ = "0.1.0"
15.333333
23
0.717391
__version__ = "0.1.0"
true
true
f7295bce721b3d0cb3aa2aeb4ce6d113b18dc2aa
2,084
py
Python
NiaPy/benchmarks/ridge.py
lukapecnik/NiaPy
a40ac08a4c06a13019ec5e39cc137461884928b0
[ "MIT" ]
1
2020-03-16T11:15:43.000Z
2020-03-16T11:15:43.000Z
NiaPy/benchmarks/ridge.py
lukapecnik/NiaPy
a40ac08a4c06a13019ec5e39cc137461884928b0
[ "MIT" ]
null
null
null
NiaPy/benchmarks/ridge.py
lukapecnik/NiaPy
a40ac08a4c06a13019ec5e39cc137461884928b0
[ "MIT" ]
1
2020-03-25T16:20:36.000Z
2020-03-25T16:20:36.000Z
# encoding=utf8 """Implementation of Ridge benchmark.""" import math from NiaPy.benchmarks.benchmark import Benchmark __all__ = ["Ridge"] class Ridge(Benchmark): r"""Implementation of Ridge function. Date: 2018 Author: Lucija Brezočnik License: MIT Function: **Ridge function** :mat...
22.170213
92
0.516315
import math from NiaPy.benchmarks.benchmark import Benchmark __all__ = ["Ridge"] class Ridge(Benchmark): Name = ["Ridge"] def __init__(self, Lower=-64.0, Upper=64.0): Benchmark.__init__(self, Lower, Upper) @staticmethod def latex_code(): return r'''$f(\mathbf{x}) = \sum_{i=1}^...
true
true
f7295c3f9b37e8e0cfb6e3e5eac7c40d078fa1d6
490
py
Python
config/config.py
morethanoneanimal/Nagel-Schreckenberg-simulation
2af5cd2e68060114d5c0fd3f5f936c3313542e0b
[ "MIT" ]
23
2016-03-17T13:19:26.000Z
2021-05-26T02:03:07.000Z
config/config.py
morethanoneanimal/Nagel-Schreckenberg-simulation
2af5cd2e68060114d5c0fd3f5f936c3313542e0b
[ "MIT" ]
2
2018-06-26T07:32:00.000Z
2021-10-07T18:25:38.000Z
config/config.py
morethanoneanimal/Nagel-Schreckenberg-simulation
2af5cd2e68060114d5c0fd3f5f936c3313542e0b
[ "MIT" ]
11
2016-02-10T02:16:19.000Z
2021-10-04T01:13:18.000Z
from simulation.speedLimits import * from simulation.trafficGenerators import * maxFps= 40 size = width, heigth = 1280, 500 # in miliseconds updateFrame = 500 seed = None lanes = 2 length = 200 maxSpeed = 5 maxLength = 10000 speedLimits = [ SpeedLimit( range=((100,1),(100,1)), limit=0, ticks=0, active=False), ...
22.272727
85
0.704082
from simulation.speedLimits import * from simulation.trafficGenerators import * maxFps= 40 size = width, heigth = 1280, 500 updateFrame = 500 seed = None lanes = 2 length = 200 maxSpeed = 5 maxLength = 10000 speedLimits = [ SpeedLimit( range=((100,1),(100,1)), limit=0, ticks=0, active=False), SpeedLimit(...
true
true
f7295d92eab502b61133988532484ecbe17f21c7
42,301
py
Python
corehq/apps/hqwebapp/views.py
kkrampa/commcare-hq
d64d7cad98b240325ad669ccc7effb07721b4d44
[ "BSD-3-Clause" ]
1
2020-05-05T13:10:01.000Z
2020-05-05T13:10:01.000Z
corehq/apps/hqwebapp/views.py
kkrampa/commcare-hq
d64d7cad98b240325ad669ccc7effb07721b4d44
[ "BSD-3-Clause" ]
1
2019-12-09T14:00:14.000Z
2019-12-09T14:00:14.000Z
corehq/apps/hqwebapp/views.py
MaciejChoromanski/commcare-hq
fd7f65362d56d73b75a2c20d2afeabbc70876867
[ "BSD-3-Clause" ]
5
2015-11-30T13:12:45.000Z
2019-07-01T19:27:07.000Z
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import functools import json import logging import os import re import sys import traceback import uuid from datetime import datetime from django.utils import html from six.moves.urllib.parse import urlparse...
34.475143
138
0.638117
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import functools import json import logging import os import re import sys import traceback import uuid from datetime import datetime from django.utils import html from six.moves.urllib.parse import urlparse...
true
true
f7295da7d222acd8a82f33191d3b5261cefa3096
14,546
py
Python
examples/pytorch/gcmc/model.py
Woooosz/dgl
729ff2ef385f302af562c8305b1006d067d2067f
[ "Apache-2.0" ]
null
null
null
examples/pytorch/gcmc/model.py
Woooosz/dgl
729ff2ef385f302af562c8305b1006d067d2067f
[ "Apache-2.0" ]
null
null
null
examples/pytorch/gcmc/model.py
Woooosz/dgl
729ff2ef385f302af562c8305b1006d067d2067f
[ "Apache-2.0" ]
null
null
null
"""NN modules""" import torch as th import torch.nn as nn from torch.nn import init import dgl.function as fn import dgl.nn.pytorch as dglnn from utils import get_activation class GCMCGraphConv(nn.Module): """Graph convolution module used in the GCMC model. Parameters ---------- in_feats : int ...
35.050602
92
0.532586
import torch as th import torch.nn as nn from torch.nn import init import dgl.function as fn import dgl.nn.pytorch as dglnn from utils import get_activation class GCMCGraphConv(nn.Module): def __init__(self, in_feats, out_feats, weight=True, devi...
true
true
f7295e891b8f82eac3622be486b13ebd9a4de231
582
py
Python
math/increment_num.py
ethyl2/code_challenges
3c9ccca1782f92728e60a515a7ca797f6d470e81
[ "MIT" ]
null
null
null
math/increment_num.py
ethyl2/code_challenges
3c9ccca1782f92728e60a515a7ca797f6d470e81
[ "MIT" ]
null
null
null
math/increment_num.py
ethyl2/code_challenges
3c9ccca1782f92728e60a515a7ca797f6d470e81
[ "MIT" ]
null
null
null
""" https://leetcode.com/problems/plus-one/ Given a non-empty arr of digits representing a non-neg int, increment that int by 1. Most significant digit is at the head of the list. Each el contains a single digit. The int doesn't contain leading zeros, except for the int 0 itself. examples: [1,2,3] -> [1,2,4] [4,3,2,1...
23.28
84
0.652921
from typing import List class Solution: def plusOne(self, digits: List[int]) -> List[int]: digits[-1] += 1 return int(''.join(map(str, digits))) s = Solution() print(s.plusOne([1, 2, 3])) print(s.plusOne([4, 3, 2, 1]))
true
true
f729608a38e760963ece4719b36116f0a7dd4182
511
py
Python
py/signal.py
jzhou/ai
a5efbfb5e93e404129c974491705c24e9bc49c9d
[ "MIT" ]
null
null
null
py/signal.py
jzhou/ai
a5efbfb5e93e404129c974491705c24e9bc49c9d
[ "MIT" ]
null
null
null
py/signal.py
jzhou/ai
a5efbfb5e93e404129c974491705c24e9bc49c9d
[ "MIT" ]
null
null
null
#!/usr/bin/python # -*- coding: utf-8 -*- import signal, os import time def handler(signum, frame): print ("Signal handler called with signal: " +str(signum)) print ("complete operations needed when alarm received") def main(): signal.signal(signal.SIGALRM, handler) print ("set alarm signal") si...
22.217391
62
0.643836
import signal, os import time def handler(signum, frame): print ("Signal handler called with signal: " +str(signum)) print ("complete operations needed when alarm received") def main(): signal.signal(signal.SIGALRM, handler) print ("set alarm signal") signal.alarm(3) print ("before alarm")...
true
true
f72960a610aeb01762a3fbc0fba450b38edd8a76
489
py
Python
pyhammer/tasks/svn/tortoisesvncommittask.py
webbers/pyhammer
84efafed65ab05c071a55944b91343b9fd1ef58e
[ "MIT" ]
2
2015-07-06T15:57:33.000Z
2016-09-10T11:46:24.000Z
pyhammer/tasks/svn/tortoisesvncommittask.py
webbers/pyhammer
84efafed65ab05c071a55944b91343b9fd1ef58e
[ "MIT" ]
null
null
null
pyhammer/tasks/svn/tortoisesvncommittask.py
webbers/pyhammer
84efafed65ab05c071a55944b91343b9fd1ef58e
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- import subprocess from pyhammer.tasks.taskbase import TaskBase class TortoiseSvnCommitTask( TaskBase ): def __init__( self, path ): super(TortoiseSvnCommitTask, self).__init__() self.__path = path def RunCmd( self, CmdLine, CmdDir = None ): p = subprocess.Pope...
28.764706
74
0.642127
import subprocess from pyhammer.tasks.taskbase import TaskBase class TortoiseSvnCommitTask( TaskBase ): def __init__( self, path ): super(TortoiseSvnCommitTask, self).__init__() self.__path = path def RunCmd( self, CmdLine, CmdDir = None ): p = subprocess.Popen( CmdLine, cwd = CmdDi...
true
true
f72960c7b2824b79159bedb69ae89d8779ae572d
454
py
Python
app/utils/data_imports.py
thiagomurtinho/Iris_Classification
8b04fed7f7162c3a6bd276c0dbfb2c291c02492c
[ "MIT" ]
null
null
null
app/utils/data_imports.py
thiagomurtinho/Iris_Classification
8b04fed7f7162c3a6bd276c0dbfb2c291c02492c
[ "MIT" ]
null
null
null
app/utils/data_imports.py
thiagomurtinho/Iris_Classification
8b04fed7f7162c3a6bd276c0dbfb2c291c02492c
[ "MIT" ]
null
null
null
def extraction_colunms_value(DataFrame, DataCompare, ColumName): data = [] index = DataFrame.Species.str.contains(DataCompare) if(ColumName == 'SepalLengthCm'): data = DataFrame[index].SepalLengthCm if(ColumName == 'SepalWidthCm'): data = DataFrame[index].SepalWidthCm if(ColumName == 'PetalWidthCm'):...
32.428571
64
0.72467
def extraction_colunms_value(DataFrame, DataCompare, ColumName): data = [] index = DataFrame.Species.str.contains(DataCompare) if(ColumName == 'SepalLengthCm'): data = DataFrame[index].SepalLengthCm if(ColumName == 'SepalWidthCm'): data = DataFrame[index].SepalWidthCm if(ColumName == 'PetalWidthCm'):...
true
true
f72961a71ee62380a011d47d8b613f6a186272ad
3,766
py
Python
modules/fluid/fluid_variationalform.py
marchirschvogel/ambit
9c21852d2c7c562b7accdd34025fc6b829eb1d3e
[ "BSD-4-Clause" ]
3
2021-03-22T14:17:09.000Z
2021-05-03T15:24:09.000Z
modules/fluid/fluid_variationalform.py
marchirschvogel/ambit
9c21852d2c7c562b7accdd34025fc6b829eb1d3e
[ "BSD-4-Clause" ]
null
null
null
modules/fluid/fluid_variationalform.py
marchirschvogel/ambit
9c21852d2c7c562b7accdd34025fc6b829eb1d3e
[ "BSD-4-Clause" ]
2
2021-03-29T10:52:09.000Z
2021-11-26T15:56:38.000Z
#!/usr/bin/env python3 # Copyright (c) 2019-2022, Dr.-Ing. Marc Hirschvogel # All rights reserved. # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import ufl # fluid mechanics variational forms class # Principle of Virtual Power # TeX...
36.211538
241
0.624535
import ufl class variationalform: def __init__(self, var_v, dv, var_p, dp, n=None): self.var_v = var_v self.var_p = var_p self.dv = dv self.dp = dp self.n = n ddomain, v_old=None): if v_old is None: return rho*uf...
true
true
f72961c755fe3f726acfd0ab5f4be711323edce6
51
py
Python
paddlenlp/transformers/nezha/__init__.py
tanhanzhuo/PaddleNLP
d0d20678f2bec820570b4f09ca49cd402d20c3b6
[ "Apache-2.0" ]
7,091
2021-02-05T13:56:25.000Z
2022-03-31T11:42:50.000Z
paddlenlp/transformers/nezha/__init__.py
xihuanafeng/PaddleNLP
14c3209118b2cadcce9a8f66b760c9cddb3a02ad
[ "Apache-2.0" ]
844
2021-02-10T01:09:29.000Z
2022-03-31T12:12:58.000Z
paddlenlp/transformers/nezha/__init__.py
xihuanafeng/PaddleNLP
14c3209118b2cadcce9a8f66b760c9cddb3a02ad
[ "Apache-2.0" ]
1,035
2021-02-05T14:26:48.000Z
2022-03-31T11:42:57.000Z
from .modeling import * from .tokenizer import *
17
25
0.72549
from .modeling import * from .tokenizer import *
true
true
f72961fc4ed12b1c027b054640810df1e55e9e82
31,380
py
Python
hyperparameter_hunter/reporting.py
mdjabc/hyperparameter_hunter
bfbd1faf63272a62e6f971d7e9a0487d71aea8f6
[ "MIT" ]
1
2019-04-22T02:22:03.000Z
2019-04-22T02:22:03.000Z
hyperparameter_hunter/reporting.py
mdjabc/hyperparameter_hunter
bfbd1faf63272a62e6f971d7e9a0487d71aea8f6
[ "MIT" ]
null
null
null
hyperparameter_hunter/reporting.py
mdjabc/hyperparameter_hunter
bfbd1faf63272a62e6f971d7e9a0487d71aea8f6
[ "MIT" ]
null
null
null
################################################## # Import Own Assets ################################################## from hyperparameter_hunter import exceptions from hyperparameter_hunter.settings import G from hyperparameter_hunter.utils.general_utils import now_time, expand_mins_secs ##########################...
40.438144
107
0.605736
true
true
f7296230975ff63d0a67cb8dd9d9df2ce6ab8ea5
11,474
py
Python
ez_setup.py
mrmin123/snovault
88cbd863ef556c1032c88fdc0fc243e07fb2f922
[ "MIT" ]
null
null
null
ez_setup.py
mrmin123/snovault
88cbd863ef556c1032c88fdc0fc243e07fb2f922
[ "MIT" ]
null
null
null
ez_setup.py
mrmin123/snovault
88cbd863ef556c1032c88fdc0fc243e07fb2f922
[ "MIT" ]
2
2021-07-07T18:41:25.000Z
2021-07-27T23:45:27.000Z
#!/usr/bin/env python """ Setuptools bootstrapping installer. Run this script to install or upgrade setuptools. """ import os import shutil import sys import tempfile import zipfile import optparse import subprocess import platform import textwrap import contextlib import warnings from distutils import log try: ...
29.270408
79
0.66228
import os import shutil import sys import tempfile import zipfile import optparse import subprocess import platform import textwrap import contextlib import warnings from distutils import log try: from urllib.request import urlopen except ImportError: from urllib2 import urlopen try: from site import ...
true
true
f72962892eadfb62069ec0593f97f3237cf5cc30
4,662
py
Python
rsnet/dataset/raster.py
xyt556/rsnet
5f20f5308f89695e9f26ee4724d5591201d0c52d
[ "MIT" ]
1
2022-03-01T08:47:14.000Z
2022-03-01T08:47:14.000Z
rsnet/dataset/raster.py
xyt556/rsnet
5f20f5308f89695e9f26ee4724d5591201d0c52d
[ "MIT" ]
null
null
null
rsnet/dataset/raster.py
xyt556/rsnet
5f20f5308f89695e9f26ee4724d5591201d0c52d
[ "MIT" ]
1
2022-03-07T06:08:38.000Z
2022-03-07T06:08:38.000Z
import os import rasterio import numpy as np from ..utils import pair, bytescale from .base import BaseRasterData class RasterSampleDataset(BaseRasterData): """Dataset wrapper for remote sensing data. Args: fname: win_size: step_size: pad_size: band_index: """ ...
29.506329
80
0.515444
import os import rasterio import numpy as np from ..utils import pair, bytescale from .base import BaseRasterData class RasterSampleDataset(BaseRasterData): def __init__(self, fname, win_size=512, step_size=512, pad_size=0, ban...
true
true
f729638d4432f934d5191c5b2c629e6a492d192e
12,736
py
Python
sedfitter/sed/sed.py
KainRasleafar/sedfitter
4f0e9e46f7903a853166835bb74857cc15eef219
[ "BSD-2-Clause" ]
15
2015-07-04T02:00:30.000Z
2021-05-13T09:03:10.000Z
sedfitter/sed/sed.py
KainRasleafar/sedfitter
4f0e9e46f7903a853166835bb74857cc15eef219
[ "BSD-2-Clause" ]
45
2015-04-27T20:19:22.000Z
2022-01-28T06:24:31.000Z
sedfitter/sed/sed.py
KainRasleafar/sedfitter
4f0e9e46f7903a853166835bb74857cc15eef219
[ "BSD-2-Clause" ]
19
2015-04-21T15:32:04.000Z
2022-03-02T21:53:46.000Z
from __future__ import print_function, division import os import numpy as np from astropy import log from astropy.io import fits from astropy.table import Table from scipy.interpolate import interp1d from astropy import units as u from ..utils.validator import validate_array from .helpers import parse_unit_safe, as...
31.760599
131
0.568153
from __future__ import print_function, division import os import numpy as np from astropy import log from astropy.io import fits from astropy.table import Table from scipy.interpolate import interp1d from astropy import units as u from ..utils.validator import validate_array from .helpers import parse_unit_safe, as...
true
true
f729647581b758f0c2709642d4b1e0819a3ee950
1,310
py
Python
shopyo/config.py
ChristianCelora/shopyo
9e602b1f6bc118850875c33f7f2ae5d179767c88
[ "MIT" ]
1
2020-12-23T18:22:21.000Z
2020-12-23T18:22:21.000Z
shopyo/config.py
ChristianCelora/shopyo
9e602b1f6bc118850875c33f7f2ae5d179767c88
[ "MIT" ]
null
null
null
shopyo/config.py
ChristianCelora/shopyo
9e602b1f6bc118850875c33f7f2ae5d179767c88
[ "MIT" ]
null
null
null
import os base_path = os.path.dirname(os.path.abspath(__file__)) class Config: """Parent configuration class.""" DEBUG = False SQLALCHEMY_DATABASE_URI = "sqlite:///shopyo.db" SQLALCHEMY_TRACK_MODIFICATIONS = False SECRET_KEY = os.urandom(24) BASE_DIR = base_path STATIC = os.path.join(BAS...
25.686275
84
0.701527
import os base_path = os.path.dirname(os.path.abspath(__file__)) class Config: DEBUG = False SQLALCHEMY_DATABASE_URI = "sqlite:///shopyo.db" SQLALCHEMY_TRACK_MODIFICATIONS = False SECRET_KEY = os.urandom(24) BASE_DIR = base_path STATIC = os.path.join(BASE_DIR, "static") UPLOADED_PATH_IMA...
true
true
f7296659d3869c20f2288c83afc6f34918f2cc2f
10,867
py
Python
main/MCN.py
Rick0514/VPR_SMCN
7a00dc8e4de0c21438474c05a4a7be18d05367fa
[ "MIT" ]
null
null
null
main/MCN.py
Rick0514/VPR_SMCN
7a00dc8e4de0c21438474c05a4a7be18d05367fa
[ "MIT" ]
null
null
null
main/MCN.py
Rick0514/VPR_SMCN
7a00dc8e4de0c21438474c05a4a7be18d05367fa
[ "MIT" ]
null
null
null
import numpy as np import matplotlib.pyplot as plt import main.utils as utils import time # ---------------------------- 说明 ---------------------------------- # MCN的python复现 # ---------------------------- 说明 ---------------------------------- class MCNParams: """ a struct define the input params MCN class us...
35.168285
139
0.587743
import numpy as np import matplotlib.pyplot as plt import main.utils as utils import time class MCNParams: def __init__(self, probAddCon, nCellPerCol, nConPerCol, minColActivity, nColPerPattern, kActiveCol): self.probAddCon = probAddCon self.nCellPerCol = nCellPerCol s...
true
true
f7296673f74ba92c24a65b3326f5d137140b8592
25,486
py
Python
pytorch3dunet/augment/transforms.py
FynnBe/pytorch-3dunet
34918e82c3afeff02360b03964de973eac3a4f75
[ "MIT" ]
null
null
null
pytorch3dunet/augment/transforms.py
FynnBe/pytorch-3dunet
34918e82c3afeff02360b03964de973eac3a4f75
[ "MIT" ]
null
null
null
pytorch3dunet/augment/transforms.py
FynnBe/pytorch-3dunet
34918e82c3afeff02360b03964de973eac3a4f75
[ "MIT" ]
null
null
null
import importlib import numpy as np import torch from scipy.ndimage import rotate, map_coordinates, gaussian_filter from scipy.ndimage.filters import convolve from skimage.filters import gaussian from skimage.segmentation import find_boundaries from torchvision.transforms import Compose # WARN: use fixed random state...
36.723343
122
0.635996
import importlib import numpy as np import torch from scipy.ndimage import rotate, map_coordinates, gaussian_filter from scipy.ndimage.filters import convolve from skimage.filters import gaussian from skimage.segmentation import find_boundaries from torchvision.transforms import Compose GLOBAL_RANDOM_STATE = np.rand...
true
true
f7296753d900057b6ee906f435a24ab68c98469f
2,040
py
Python
tests/providers/google/cloud/operators/test_video_intelligence_system.py
emilioego/airflow
3457c7847cd24413ff5b622e65c27d8370f94502
[ "Apache-2.0", "BSD-2-Clause", "MIT", "ECL-2.0", "BSD-3-Clause" ]
79
2021-10-15T07:32:27.000Z
2022-03-28T04:10:19.000Z
tests/providers/google/cloud/operators/test_video_intelligence_system.py
emilioego/airflow
3457c7847cd24413ff5b622e65c27d8370f94502
[ "Apache-2.0", "BSD-2-Clause", "MIT", "ECL-2.0", "BSD-3-Clause" ]
210
2021-07-17T00:25:52.000Z
2021-12-29T00:44:48.000Z
tests/providers/google/cloud/operators/test_video_intelligence_system.py
emilioego/airflow
3457c7847cd24413ff5b622e65c27d8370f94502
[ "Apache-2.0", "BSD-2-Clause", "MIT", "ECL-2.0", "BSD-3-Clause" ]
23
2021-10-15T02:36:37.000Z
2022-03-17T02:59:27.000Z
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
40.8
110
0.763725
import os import pytest from airflow.providers.google.cloud.example_dags.example_video_intelligence import GCP_BUCKET_NAME from tests.providers.google.cloud.utils.gcp_authenticator import GCP_AI_KEY, GCP_GCS_KEY from tests.test_utils.gcp_system_helpers import CLOUD_DAG_FOLDER, GoogleSystemTest, provi...
true
true
f7296786eaf8c32bfc2c367f3dc5235847f3635e
2,002
py
Python
python3.4Smartforest/lib/python3.4/site-packages/setuptools/lib2to3_ex.py
letouriste001/SmartForest_2.0
109b78bf1e8c8404800f377ab969395ccbb617be
[ "MIT" ]
1
2019-06-30T20:04:39.000Z
2019-06-30T20:04:39.000Z
python3.4Smartforest/lib/python3.4/site-packages/setuptools/lib2to3_ex.py
letouriste001/SmartForest_2.0
109b78bf1e8c8404800f377ab969395ccbb617be
[ "MIT" ]
4
2021-03-18T20:36:02.000Z
2022-01-13T00:47:28.000Z
python3.4Smartforest/lib/python3.4/site-packages/setuptools/lib2to3_ex.py
letouriste001/SmartForest_2.0
109b78bf1e8c8404800f377ab969395ccbb617be
[ "MIT" ]
2
2016-07-23T22:12:34.000Z
2018-06-23T03:40:58.000Z
""" Customized Mixin2to3 support: - adds support for converting doctests This module raises an ImportError on Python 2. """ from distutils.util import Mixin2to3 as _Mixin2to3 from distutils import log from lib2to3.refactor import RefactoringTool, get_fixers_from_package import setuptools class DistutilsRefactori...
31.777778
77
0.668332
from distutils.util import Mixin2to3 as _Mixin2to3 from distutils import log from lib2to3.refactor import RefactoringTool, get_fixers_from_package import setuptools class DistutilsRefactoringTool(RefactoringTool): def log_error(self, msg, *args, **kw): log.error(msg, *args) def log_message(self, ms...
true
true
f72968210da92edd72ee76214e4061c3041b2b56
1,545
py
Python
P4D2_2018_East/exercises/basic/receive.py
ptcrews/p4-mininet-tutorials
2e857053ba5cb9e90af11690d5cdd1116ec790fd
[ "Apache-2.0" ]
23
2018-06-26T11:06:24.000Z
2022-03-07T02:59:49.000Z
P4D2_2018_East/exercises/basic/receive.py
ptcrews/p4-mininet-tutorials
2e857053ba5cb9e90af11690d5cdd1116ec790fd
[ "Apache-2.0" ]
1
2022-02-04T08:29:34.000Z
2022-02-04T08:29:34.000Z
P4D2_2018_East/exercises/basic/receive.py
ptcrews/p4-mininet-tutorials
2e857053ba5cb9e90af11690d5cdd1116ec790fd
[ "Apache-2.0" ]
104
2018-03-29T09:17:35.000Z
2022-03-31T05:35:11.000Z
#!/usr/bin/env python import sys import struct import os from scapy.all import sniff, sendp, hexdump, get_if_list, get_if_hwaddr from scapy.all import Packet, IPOption from scapy.all import ShortField, IntField, LongField, BitField, FieldListField, FieldLenField from scapy.all import IP, TCP, UDP, Raw from scapy.layer...
28.611111
94
0.549515
import sys import struct import os from scapy.all import sniff, sendp, hexdump, get_if_list, get_if_hwaddr from scapy.all import Packet, IPOption from scapy.all import ShortField, IntField, LongField, BitField, FieldListField, FieldLenField from scapy.all import IP, TCP, UDP, Raw from scapy.layers.inet import _IPOpti...
false
true
f729699287f520c8ea12e89ebedc305b0d14814f
512
py
Python
pavement.py
yueranyuan/pyscreenshot
3287b798691de8791bc3b3314f2545f7b0b1cb99
[ "BSD-2-Clause" ]
null
null
null
pavement.py
yueranyuan/pyscreenshot
3287b798691de8791bc3b3314f2545f7b0b1cb99
[ "BSD-2-Clause" ]
null
null
null
pavement.py
yueranyuan/pyscreenshot
3287b798691de8791bc3b3314f2545f7b0b1cb99
[ "BSD-2-Clause" ]
null
null
null
from path import Path from paver.doctools import cog, html from paver.easy import options from paver.options import Bunch from paver.setuputils import setup IMPORTS=[cog, html, setup] options( cog=Bunch( basedir='.', pattern='README.rst', includedir='pyscreenshot', beginspec='...
19.692308
67
0.621094
from path import Path from paver.doctools import cog, html from paver.easy import options from paver.options import Bunch from paver.setuputils import setup IMPORTS=[cog, html, setup] options( cog=Bunch( basedir='.', pattern='README.rst', includedir='pyscreenshot', beginspec='...
true
true
f72969afd180df2df3d7f7508b8f7475f20eba44
213
py
Python
.history/my_classes/FirstClassFunctions/reducing_functions_20210707134010.py
minefarmer/deep-Dive-1
b0675b853180c5b5781888266ea63a3793b8d855
[ "Unlicense" ]
null
null
null
.history/my_classes/FirstClassFunctions/reducing_functions_20210707134010.py
minefarmer/deep-Dive-1
b0675b853180c5b5781888266ea63a3793b8d855
[ "Unlicense" ]
null
null
null
.history/my_classes/FirstClassFunctions/reducing_functions_20210707134010.py
minefarmer/deep-Dive-1
b0675b853180c5b5781888266ea63a3793b8d855
[ "Unlicense" ]
null
null
null
"""Reducing Functions in Python These are functions that recombine an iterable recursively, ending up with a single return value Also called accumulators, aggregators, or folding functions Example """
21.3
96
0.769953
true
true
f72969ff813909f4ad42f15958aa9f086b6a58bf
2,694
py
Python
qgis3script-importernvdbdata.py
alexdiem/nvdbapi-V3
18265ee6d02aed17d6199e5ed42fe731c9320a08
[ "MIT" ]
null
null
null
qgis3script-importernvdbdata.py
alexdiem/nvdbapi-V3
18265ee6d02aed17d6199e5ed42fe731c9320a08
[ "MIT" ]
null
null
null
qgis3script-importernvdbdata.py
alexdiem/nvdbapi-V3
18265ee6d02aed17d6199e5ed42fe731c9320a08
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ Script for å interaktivt legge til NVDB-vegnett og fagdata via python kommandolinje i QGIS. Se dokumentasjon på bruk av nvdbapi - funskjoner på https://github.com/LtGlahn/nvdbapi-V3 Legg dette scriptet et sted hvor det er lettvint å finne fra QGIS. F.eks. C:/Users/<dittbrukernavn>. EKS...
30.269663
128
0.69562
import sys
true
true
f7296b28fa92684ef445111a79a67994059f7ec4
1,221
py
Python
uer/layers/layer_norm.py
krevas/ET-BERT
464ce3e7942d4450f55021e267ceb9dd48a36b1f
[ "MIT" ]
null
null
null
uer/layers/layer_norm.py
krevas/ET-BERT
464ce3e7942d4450f55021e267ceb9dd48a36b1f
[ "MIT" ]
null
null
null
uer/layers/layer_norm.py
krevas/ET-BERT
464ce3e7942d4450f55021e267ceb9dd48a36b1f
[ "MIT" ]
null
null
null
import torch import torch.nn as nn class LayerNorm(nn.Module): """ Layer Normalization. https://arxiv.org/abs/1607.06450 """ def __init__(self, hidden_size, eps=1e-6): super(LayerNorm, self).__init__() self.eps = eps self.gamma = nn.Parameter(torch.ones(hidden_size)) ...
30.525
85
0.648649
import torch import torch.nn as nn class LayerNorm(nn.Module): def __init__(self, hidden_size, eps=1e-6): super(LayerNorm, self).__init__() self.eps = eps self.gamma = nn.Parameter(torch.ones(hidden_size)) self.beta = nn.Parameter(torch.zeros(hidden_size)) def forward(self, x)...
true
true
f7296caf0343cb6f90357dd2e44f0d8fe56e2610
12,507
py
Python
libbt/BitTornado/BitTornado/launchmanycore.py
breezechen/zevent
f86219b3ce4afbb516b22c41ce125b0f916c490c
[ "Apache-2.0" ]
29
2015-01-06T09:02:31.000Z
2021-05-10T16:46:03.000Z
libbt/BitTornado/BitTornado/launchmanycore.py
geniejl/zevent
5dd3de57adf1deecc8f008db387ebfa460767fda
[ "Apache-2.0" ]
11
2015-03-03T11:31:03.000Z
2020-08-03T23:20:45.000Z
libbt/BitTornado/BitTornado/launchmanycore.py
geniejl/zevent
5dd3de57adf1deecc8f008db387ebfa460767fda
[ "Apache-2.0" ]
18
2015-01-06T09:02:31.000Z
2019-06-24T00:08:13.000Z
#!/usr/bin/env python # Written by John Hoffman # see LICENSE.txt for license information from BitTornado import PSYCO if PSYCO.psyco: try: import psyco assert psyco.__version__ >= 0x010100f0 psyco.full() except: pass from download_bt1 import BT1Download from RawServer import ...
32.740838
89
0.524107
from BitTornado import PSYCO if PSYCO.psyco: try: import psyco assert psyco.__version__ >= 0x010100f0 psyco.full() except: pass from download_bt1 import BT1Download from RawServer import RawServer, UPnP_ERROR from RateLimiter import RateLimiter from ServerPortHandler import...
false
true
f7296d8cca9c497a86c7bfa0cae698b09c4f4759
105
py
Python
URI/1-Beginner/1073.py
vicenteneto/online-judge-solutions
4176e2387658f083b980d7b49bc98300a4c28411
[ "MIT" ]
null
null
null
URI/1-Beginner/1073.py
vicenteneto/online-judge-solutions
4176e2387658f083b980d7b49bc98300a4c28411
[ "MIT" ]
null
null
null
URI/1-Beginner/1073.py
vicenteneto/online-judge-solutions
4176e2387658f083b980d7b49bc98300a4c28411
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- for i in range(2, int(raw_input()) + 1, 2): print '%d^2 = %d' % (i, i ** 2)
21
43
0.447619
for i in range(2, int(raw_input()) + 1, 2): print '%d^2 = %d' % (i, i ** 2)
false
true
f7296ddca1f1526d81de73d1fd2bc229a1a53869
777
py
Python
chapter_3/my_service/scrap/zoo.py
rinjyu/the_red
c099e830ae3ee9063c3e9d29f4ee627241c7eeed
[ "Apache-2.0" ]
13
2021-07-26T06:09:19.000Z
2022-03-22T07:01:22.000Z
chapter_3/my_service/scrap/zoo.py
rinjyu/the_red
c099e830ae3ee9063c3e9d29f4ee627241c7eeed
[ "Apache-2.0" ]
11
2021-07-25T03:35:25.000Z
2021-08-13T23:05:38.000Z
chapter_3/my_service/scrap/zoo.py
rinjyu/the_red
c099e830ae3ee9063c3e9d29f4ee627241c7eeed
[ "Apache-2.0" ]
8
2021-09-02T14:54:17.000Z
2022-03-14T10:28:37.000Z
from kazoo.client import KazooClient from kazoo.exceptions import NoNodeError from kazoo.exceptions import NodeExistsError _callback = None _zk = None def init_kazoo(hosts, data_path, callback, children=True): global _zk global _callback _zk = KazooClient(hosts=hosts) _zk.start() _callback = ca...
23.545455
58
0.594595
from kazoo.client import KazooClient from kazoo.exceptions import NoNodeError from kazoo.exceptions import NodeExistsError _callback = None _zk = None def init_kazoo(hosts, data_path, callback, children=True): global _zk global _callback _zk = KazooClient(hosts=hosts) _zk.start() _callback = ca...
true
true
f7296e2a3e9328088302e2141a4ad4afd4c901b1
1,166
py
Python
docstringer/decorators.py
ttamg/docstringer
f28cdc178e8cb5dd7ca16c885f3837a052807e16
[ "MIT" ]
null
null
null
docstringer/decorators.py
ttamg/docstringer
f28cdc178e8cb5dd7ca16c885f3837a052807e16
[ "MIT" ]
null
null
null
docstringer/decorators.py
ttamg/docstringer
f28cdc178e8cb5dd7ca16c885f3837a052807e16
[ "MIT" ]
null
null
null
import functools from .events import FunctionEvent from .formatters import BaseFormatter, DefaultFormatter def docstringer( _func=None, *, active=True, formatter: BaseFormatter = DefaultFormatter() ): """ A decorator that will output the function docstring, call values and return value when the function...
27.116279
124
0.651801
import functools from .events import FunctionEvent from .formatters import BaseFormatter, DefaultFormatter def docstringer( _func=None, *, active=True, formatter: BaseFormatter = DefaultFormatter() ): def wrapper(func): @functools.wraps(func) def inner(*args, **kwargs): if not a...
true
true
f7296e3c7738ac9586479e919858bf2e64daf411
2,066
py
Python
api/core/management/commands/populate_db.py
mf-tech-solutions/cusgeo
7e15b707bc7f1ae1fd7a091e64c41a6f7c8092c3
[ "MIT" ]
null
null
null
api/core/management/commands/populate_db.py
mf-tech-solutions/cusgeo
7e15b707bc7f1ae1fd7a091e64c41a6f7c8092c3
[ "MIT" ]
null
null
null
api/core/management/commands/populate_db.py
mf-tech-solutions/cusgeo
7e15b707bc7f1ae1fd7a091e64c41a6f7c8092c3
[ "MIT" ]
null
null
null
from django.core.management.base import BaseCommand from django.db.utils import OperationalError from customers.models import Customer from geolocation.models import Location import csv import sys class Command(BaseCommand): """ Command that populates the Customers table """ def __init__(self, *arg...
30.835821
57
0.484511
from django.core.management.base import BaseCommand from django.db.utils import OperationalError from customers.models import Customer from geolocation.models import Location import csv import sys class Command(BaseCommand): def __init__(self, *args, **kwargs): super().__init__() self.customers...
true
true
f7296e7682b97a09000c105cac73b1070d2a032f
2,284
py
Python
lib/rtc.py
FlorianPoot/M5StickCWatch
c5e63b5915b1163636084666a14f1d61ae708adf
[ "MIT" ]
21
2019-11-15T15:29:12.000Z
2022-03-20T12:15:48.000Z
lib/rtc.py
FlorianPoot/M5StickCWatch
c5e63b5915b1163636084666a14f1d61ae708adf
[ "MIT" ]
4
2019-10-01T08:48:04.000Z
2020-11-17T12:05:43.000Z
lib/rtc.py
FlorianPoot/M5StickCWatch
c5e63b5915b1163636084666a14f1d61ae708adf
[ "MIT" ]
1
2019-11-15T15:29:17.000Z
2019-11-15T15:29:17.000Z
import ustruct import i2c_bus class RTC: def __init__(self): self.addr = 0x51 self.i2c = i2c_bus.get(i2c_bus.M_BUS) def get_time(self): buf = self._regchar(0x02, buf=bytearray(3)) seconds = self.bcd2_to_byte(buf[0] & 0x7f) minutes = self.bcd2_to_byte(buf[1] & 0x7f) ...
27.518072
76
0.569177
import ustruct import i2c_bus class RTC: def __init__(self): self.addr = 0x51 self.i2c = i2c_bus.get(i2c_bus.M_BUS) def get_time(self): buf = self._regchar(0x02, buf=bytearray(3)) seconds = self.bcd2_to_byte(buf[0] & 0x7f) minutes = self.bcd2_to_byte(buf[1] & 0x7f) ...
true
true
f7296e825616df59c56e8fca75e277ba8e588d8a
622
py
Python
hw/ip/mono_fm/transform.py
xupsh/pp4fpgas-cn-hls
d14bd0769ce7f9674f206faf93b7622c5bf905bf
[ "Apache-2.0" ]
152
2018-08-06T14:08:59.000Z
2022-03-29T23:15:05.000Z
hw/ip/mono_fm/transform.py
sinjinchang/pp4fpgas-cn-hls
d14bd0769ce7f9674f206faf93b7622c5bf905bf
[ "Apache-2.0" ]
2
2019-04-12T16:30:25.000Z
2019-08-13T19:59:03.000Z
hw/ip/mono_fm/transform.py
sinjinchang/pp4fpgas-cn-hls
d14bd0769ce7f9674f206faf93b7622c5bf905bf
[ "Apache-2.0" ]
63
2018-08-25T10:43:04.000Z
2022-03-26T09:12:35.000Z
import numpy as np detection_file = 'samples.npy' detections = None if detection_file is not None: detections = np.load(detection_file) np.savetxt('samples.txt', detections, fmt='%0.18f') f = open('samples.txt') out = open('complex.txt', "w") lines = f.readlines() for line in lines: for i in line: if i...
20.733333
51
0.485531
import numpy as np detection_file = 'samples.npy' detections = None if detection_file is not None: detections = np.load(detection_file) np.savetxt('samples.txt', detections, fmt='%0.18f') f = open('samples.txt') out = open('complex.txt', "w") lines = f.readlines() for line in lines: for i in line: if i...
true
true
f7296efbb9bd563afe90dc691e822b8ad26cace4
15,124
py
Python
coremltools/converters/mil/mil/ops/defs/recurrent.py
freedomtan/coremltools
5ee9b537b81c44c140a2fa7571e547dfaa24e1ea
[ "BSD-3-Clause" ]
1
2020-12-23T15:42:01.000Z
2020-12-23T15:42:01.000Z
coremltools/converters/mil/mil/ops/defs/recurrent.py
freedomtan/coremltools
5ee9b537b81c44c140a2fa7571e547dfaa24e1ea
[ "BSD-3-Clause" ]
75
2020-11-24T05:37:45.000Z
2022-02-25T15:14:23.000Z
coremltools/converters/mil/mil/ops/defs/recurrent.py
freedomtan/coremltools
5ee9b537b81c44c140a2fa7571e547dfaa24e1ea
[ "BSD-3-Clause" ]
null
null
null
# Copyright (c) 2020, Apple Inc. All rights reserved. # # Use of this source code is governed by a BSD-3-clause license that can be # found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause from coremltools.converters.mil.mil import get_new_symbol from ._op_reqs import * @register_op(doc_...
36.009524
89
0.560698
from coremltools.converters.mil.mil import get_new_symbol from ._op_reqs import * @register_op(doc_str="") class gru(Operation): input_spec = InputSpec( x=TensorInputType(), initial_h=TensorInputType(), weight=TensorInputType(const=True), bias=TensorInputType(const=True, ...
true
true
f7296f92c8bd8dfa5fbda73084e6170fffd08c76
1,403
py
Python
RPSJacobi2.py.py
KuhlersClassroom/PythonRPS
6393a4d8a2758433bcb5a16190d1699239f8991b
[ "MIT" ]
null
null
null
RPSJacobi2.py.py
KuhlersClassroom/PythonRPS
6393a4d8a2758433bcb5a16190d1699239f8991b
[ "MIT" ]
null
null
null
RPSJacobi2.py.py
KuhlersClassroom/PythonRPS
6393a4d8a2758433bcb5a16190d1699239f8991b
[ "MIT" ]
null
null
null
import random symbols = ['rock', 'paper', 'scissors'] player_wins = 0 computer_wins = 0 while max([player_wins, computer_wins]) < 3: player_symbol = None while player_symbol is None: input_symbol = input("What symbol do you want? ") if input_symbol in symbols: player_s...
26.471698
59
0.548824
import random symbols = ['rock', 'paper', 'scissors'] player_wins = 0 computer_wins = 0 while max([player_wins, computer_wins]) < 3: player_symbol = None while player_symbol is None: input_symbol = input("What symbol do you want? ") if input_symbol in symbols: player_s...
true
true
f729700d53fe2914422fc5bfb94c839529955fce
9,972
py
Python
src/openfermion/utils/rdm_mapping_functions_test.py
Emieeel/OpenFermion
c19d9667c5970473893f9bc0183556c4cd354dd7
[ "Apache-2.0" ]
1,291
2017-09-27T22:00:26.000Z
2022-03-25T14:34:50.000Z
src/openfermion/utils/rdm_mapping_functions_test.py
SamarthVadia/OpenFermion
865d8591cad9b0681f6dd25a391a5292ed2de1d4
[ "Apache-2.0" ]
521
2017-09-27T21:36:17.000Z
2022-03-02T12:45:56.000Z
src/openfermion/utils/rdm_mapping_functions_test.py
SamarthVadia/OpenFermion
865d8591cad9b0681f6dd25a391a5292ed2de1d4
[ "Apache-2.0" ]
365
2017-09-27T21:25:38.000Z
2022-03-29T19:28:46.000Z
# 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, software # distribu...
45.122172
79
0.632872
import os import unittest import numpy import h5py from openfermion.config import DATA_DIRECTORY, THIS_DIRECTORY from openfermion.chem import MolecularData from openfermion.utils.rdm_mapping_functions import ( kronecker_delta, map_two_pdm_to_two_hole_dm, map_two_pdm_to_one_pdm, map_one_pdm_to_one_ho...
true
true
f72971baca3ca517c2e3eac6e71581887c328f74
20,278
py
Python
botorch/test_functions/multi_objective.py
NTR0314/botorch
f0310c9a415947f3264dac7f3438744784843323
[ "MIT" ]
null
null
null
botorch/test_functions/multi_objective.py
NTR0314/botorch
f0310c9a415947f3264dac7f3438744784843323
[ "MIT" ]
1
2021-04-17T11:04:24.000Z
2021-04-17T11:18:12.000Z
botorch/test_functions/multi_objective.py
NTR0314/botorch
f0310c9a415947f3264dac7f3438744784843323
[ "MIT" ]
null
null
null
#! /usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Multi-objective optimization benchmark problems. References .. [Deb2005dtlz] K. Deb, L. Thiele, M. Laumanns...
31.149002
88
0.547589
from __future__ import annotations import math from typing import Optional import torch from botorch.test_functions.base import ( ConstrainedBaseTestProblem, MultiObjectiveTestProblem, ) from botorch.test_functions.synthetic import Branin from botorch.utils.sampling import sample_hypersphere, sample_si...
true
true
f7297230ad6a4050958a36c1f28f9d0abd69b6a2
15,799
py
Python
ptf-tests/tests/lib/helper.py
robertmacdavid/up4-abstract
b1d184ef5528b7a96da9c26c3d22ff2616d41fa3
[ "Apache-2.0" ]
3
2021-11-18T00:00:13.000Z
2021-11-18T02:09:19.000Z
ptf-tests/tests/lib/helper.py
robertmacdavid/up4-abstract
b1d184ef5528b7a96da9c26c3d22ff2616d41fa3
[ "Apache-2.0" ]
null
null
null
ptf-tests/tests/lib/helper.py
robertmacdavid/up4-abstract
b1d184ef5528b7a96da9c26c3d22ff2616d41fa3
[ "Apache-2.0" ]
null
null
null
# Copyright 2020-2021 Open Networking Foundation # Copyright 2021-present Princeton University # # 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...
39.009877
100
0.62352
import re import google.protobuf.text_format import grpc from ptf import testutils as testutils from p4.config.v1 import p4info_pb2 from p4.v1 import p4runtime_pb2, p4runtime_pb2_grpc, p4data_pb2 from convert import encode def get_match_field_value(match_field): match_type = match_field.WhichOneo...
true
true
f729748acc8620809f6dd195df4ac38d7f1b2eb8
5,457
py
Python
distributed/protocol/compression.py
gjoseph92/distributed
af64e07a01e8ce0d76744099a93ca2155d835ba8
[ "BSD-3-Clause" ]
null
null
null
distributed/protocol/compression.py
gjoseph92/distributed
af64e07a01e8ce0d76744099a93ca2155d835ba8
[ "BSD-3-Clause" ]
null
null
null
distributed/protocol/compression.py
gjoseph92/distributed
af64e07a01e8ce0d76744099a93ca2155d835ba8
[ "BSD-3-Clause" ]
null
null
null
""" Record known compressors Includes utilities for determining whether or not to compress """ from __future__ import print_function, division, absolute_import import logging import random import dask from toolz import identity, partial try: import blosc n = blosc.set_nthreads(2) if hasattr("blosc", "r...
27.560606
85
0.645226
from __future__ import print_function, division, absolute_import import logging import random import dask from toolz import identity, partial try: import blosc n = blosc.set_nthreads(2) if hasattr("blosc", "releasegil"): blosc.set_releasegil(True) except ImportError: blosc = False from ..ut...
true
true
f72974964b34bc8965a973df3379b8aa79b3c1da
1,819
py
Python
src/sas/sasgui/perspectives/calculator/console.py
opendatafit/sasview
c470220eecfc9f6d8a0e27e2ea8919dcb1b38e39
[ "BSD-3-Clause" ]
null
null
null
src/sas/sasgui/perspectives/calculator/console.py
opendatafit/sasview
c470220eecfc9f6d8a0e27e2ea8919dcb1b38e39
[ "BSD-3-Clause" ]
1
2021-09-20T13:20:35.000Z
2021-09-20T13:20:35.000Z
src/sas/sasgui/perspectives/calculator/console.py
opendatafit/sasview
c470220eecfc9f6d8a0e27e2ea8919dcb1b38e39
[ "BSD-3-Clause" ]
null
null
null
""" Console Module display message of a dialog """ import wx import sys from sas.sascalc.dataloader.loader import Loader _BOX_WIDTH = 60 CONSOLE_WIDTH = 340 CONSOLE_HEIGHT = 240 if sys.platform.count("win32") > 0: _STATICBOX_WIDTH = 450 PANEL_WIDTH = 500 PANEL_HEIGHT = 550 FONT_VARIANT = 0 else: _S...
27.149254
76
0.59978
import wx import sys from sas.sascalc.dataloader.loader import Loader _BOX_WIDTH = 60 CONSOLE_WIDTH = 340 CONSOLE_HEIGHT = 240 if sys.platform.count("win32") > 0: _STATICBOX_WIDTH = 450 PANEL_WIDTH = 500 PANEL_HEIGHT = 550 FONT_VARIANT = 0 else: _STATICBOX_WIDTH = 480 PANEL_WIDTH = 530 PANE...
true
true
f72974cef8a7f46849e53080deca073565237e4d
305
py
Python
core/libs/sqlsyntax.py
PanDAWMS/panda-bigmon-core-new
4b806af8b0616657dcf293af376c48f61c32b86f
[ "Apache-2.0" ]
null
null
null
core/libs/sqlsyntax.py
PanDAWMS/panda-bigmon-core-new
4b806af8b0616657dcf293af376c48f61c32b86f
[ "Apache-2.0" ]
null
null
null
core/libs/sqlsyntax.py
PanDAWMS/panda-bigmon-core-new
4b806af8b0616657dcf293af376c48f61c32b86f
[ "Apache-2.0" ]
null
null
null
""" A set of functions to handle syntax differences between DBs """ def bind_var(var, db='oracle'): """Format of named bind variable""" if db == 'postgresql': return '%({})s'.format(var) elif db == 'oracle': return ':{}'.format(var) else: return ':{}'.format(var)
23.461538
59
0.567213
def bind_var(var, db='oracle'): if db == 'postgresql': return '%({})s'.format(var) elif db == 'oracle': return ':{}'.format(var) else: return ':{}'.format(var)
true
true
f729751bd00eae316fcc00d7b6a627402edd0ae3
6,271
py
Python
corelib.py
jaredvann/UntitledLanguage
456f3a636d62028a85ee61eb3a9f04214f799e78
[ "MIT" ]
2
2020-02-07T13:20:03.000Z
2020-06-29T15:58:30.000Z
corelib.py
jaredvann/UntitledLanguage
456f3a636d62028a85ee61eb3a9f04214f799e78
[ "MIT" ]
1
2020-05-09T07:22:42.000Z
2020-05-09T07:22:42.000Z
corelib.py
jaredvann/Untitled-Language
456f3a636d62028a85ee61eb3a9f04214f799e78
[ "MIT" ]
null
null
null
import ctypes import llvmlite.ir as ir from CodeGen import LLVMCodeGenerator from coretypes import * from scopes import Scope from typelib import * ZERO = ir.Constant(ir.IntType(64), 0) def _eq_Float(cg: LLVMCodeGenerator, args, arg_types): return cg.builder.fcmp_ordered("==", args[0], args[1]) def _neq_Floa...
39.19375
106
0.721735
import ctypes import llvmlite.ir as ir from CodeGen import LLVMCodeGenerator from coretypes import * from scopes import Scope from typelib import * ZERO = ir.Constant(ir.IntType(64), 0) def _eq_Float(cg: LLVMCodeGenerator, args, arg_types): return cg.builder.fcmp_ordered("==", args[0], args[1]) def _neq_Floa...
true
true
f7297760253eb2b85eb98ece71815fc89a9a9ce5
16
py
Python
mp_sort/virtenv/lib/python3.6/site-packages/transcrypt/development/manual_tests/incidental_tests/indirect_import_error/main.py
ang-jason/fip_powerx_mini_projects-foxtrot
37e3671969b516369e2d1c7cab5890b75c489f56
[ "MIT" ]
2,200
2016-10-12T16:47:13.000Z
2022-03-30T16:40:35.000Z
mp_sort/virtenv/lib/python3.6/site-packages/transcrypt/development/manual_tests/incidental_tests/indirect_import_error/main.py
ang-jason/fip_powerx_mini_projects-foxtrot
37e3671969b516369e2d1c7cab5890b75c489f56
[ "MIT" ]
672
2016-10-12T16:36:48.000Z
2022-03-25T00:57:04.000Z
mp_sort/virtenv/lib/python3.6/site-packages/transcrypt/development/manual_tests/incidental_tests/indirect_import_error/main.py
ang-jason/fip_powerx_mini_projects-foxtrot
37e3671969b516369e2d1c7cab5890b75c489f56
[ "MIT" ]
230
2016-10-20T14:31:40.000Z
2022-03-16T15:57:15.000Z
import module1
8
15
0.8125
import module1
true
true
f72977954a5e1f601a1400481980aba248b7012f
736
py
Python
bird/tests/test_mdct_tools.py
mmoussallam/bird
6a362de7d3a52dfcddaed13e8c736d039b03fbb4
[ "BSD-3-Clause" ]
11
2015-02-02T21:41:41.000Z
2022-03-12T17:23:01.000Z
bird/tests/test_mdct_tools.py
mmoussallam/bird
6a362de7d3a52dfcddaed13e8c736d039b03fbb4
[ "BSD-3-Clause" ]
1
2021-01-03T20:45:36.000Z
2021-01-04T16:02:49.000Z
bird/tests/test_mdct_tools.py
mmoussallam/bird
6a362de7d3a52dfcddaed13e8c736d039b03fbb4
[ "BSD-3-Clause" ]
5
2016-04-06T20:42:27.000Z
2021-01-03T20:42:53.000Z
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Manuel Moussallam <manuel.moussallam@gmail.com> # # License: BSD (3-clause) import numpy as np from numpy.testing import assert_array_almost_equal from bird.mdct_tools import mdct, imdct def test_mdct(): "Test mdct and imdct tight frame prope...
26.285714
69
0.638587
import numpy as np from numpy.testing import assert_array_almost_equal from bird.mdct_tools import mdct, imdct def test_mdct(): sfreq = 1000. f = 7. x1 = np.sin(2. * np.pi * f * np.arange(128, dtype=float) / sfreq) x2 = np.sin(2. * np.pi * f * np.arange(512, dtype=float) / sfreq) rng = n...
true
true
f729799211cb994510bf480b3445854fbf4b7f51
230
py
Python
worms/criteria/__init__.py
abiedermann/worms
026c45a88d5c71b0e035ac83de6f4dc107316ed8
[ "Apache-2.0" ]
4
2018-01-30T23:13:43.000Z
2021-02-12T22:36:54.000Z
worms/criteria/__init__.py
abiedermann/worms
026c45a88d5c71b0e035ac83de6f4dc107316ed8
[ "Apache-2.0" ]
9
2018-02-23T00:52:25.000Z
2022-01-26T00:02:32.000Z
worms/criteria/__init__.py
abiedermann/worms
026c45a88d5c71b0e035ac83de6f4dc107316ed8
[ "Apache-2.0" ]
4
2018-06-28T21:30:14.000Z
2022-03-30T17:50:42.000Z
from .base import * from .hash_util import * from .cyclic import * from .bounded import * from .unbounded import * from .dihedral_lattice import * from .null import * from .bridge import * from .stack import * from .f222 import *
20.909091
31
0.73913
from .base import * from .hash_util import * from .cyclic import * from .bounded import * from .unbounded import * from .dihedral_lattice import * from .null import * from .bridge import * from .stack import * from .f222 import *
true
true
f7297b112e68f422996bc6c06de8e71039f120a1
3,024
py
Python
2018/day12/puzzle2.py
tcmitchell/AdventOfCode
caaac1aa37c999d4804f9f4154bf7033a06e98af
[ "MIT" ]
null
null
null
2018/day12/puzzle2.py
tcmitchell/AdventOfCode
caaac1aa37c999d4804f9f4154bf7033a06e98af
[ "MIT" ]
null
null
null
2018/day12/puzzle2.py
tcmitchell/AdventOfCode
caaac1aa37c999d4804f9f4154bf7033a06e98af
[ "MIT" ]
null
null
null
import argparse import collections import datetime import itertools import logging import re import sys import time # 500 17458 # 5000 179458 # 50000 1799458 # 50B 1799999999458 def parse_args(args): parser = argparse.ArgumentParser() parser.add_argument("input", type=argparse.FileType('r'), ...
26.068966
74
0.585317
import argparse import collections import datetime import itertools import logging import re import sys import time def parse_args(args): parser = argparse.ArgumentParser() parser.add_argument("input", type=argparse.FileType('r'), metavar="PUZZLE_INPUT") parser.add_argument('-...
true
true
f7297b3454c8f6b937a03623d2c2441074999c25
4,066
py
Python
src/aks-preview/azext_aks_preview/_completers.py
santosh02iiit/azure-cli-extensions
24247cfa19e2a5894937f19e17fbdc8308b28ef6
[ "MIT" ]
1
2021-08-03T18:32:54.000Z
2021-08-03T18:32:54.000Z
src/aks-preview/azext_aks_preview/_completers.py
santosh02iiit/azure-cli-extensions
24247cfa19e2a5894937f19e17fbdc8308b28ef6
[ "MIT" ]
4
2020-09-07T12:56:24.000Z
2021-02-04T12:19:20.000Z
src/aks-preview/azext_aks_preview/_completers.py
santosh02iiit/azure-cli-extensions
24247cfa19e2a5894937f19e17fbdc8308b28ef6
[ "MIT" ]
null
null
null
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
43.255319
116
0.727496
from azure.cli.core.commands.parameters import get_one_of_subscription_locations from azure.cli.core.decorators import Completer from azext_aks_preview.vendored_sdks.azure_mgmt_preview_aks.v2021_07_01.models import ContainerServiceVMSizeTypes @Completer def get_k8s_upgrades_completion_list(cmd, prefix, namespa...
true
true
f7297b8786de15ec51495c45a86897ab6e14ca5f
1,167
py
Python
activators/src/motdactivator.py
alexandruavadanii/cm-plugins
5c3f9f389f46f719579ac4cd4065490b1723ebff
[ "Apache-2.0" ]
null
null
null
activators/src/motdactivator.py
alexandruavadanii/cm-plugins
5c3f9f389f46f719579ac4cd4065490b1723ebff
[ "Apache-2.0" ]
null
null
null
activators/src/motdactivator.py
alexandruavadanii/cm-plugins
5c3f9f389f46f719579ac4cd4065490b1723ebff
[ "Apache-2.0" ]
1
2021-04-24T16:48:17.000Z
2021-04-24T16:48:17.000Z
#! /usr/bin/python # Copyright 2019 Nokia # # 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 ...
30.710526
74
0.725793
from cmframework.apis import cmactivator class motdactivator(cmactivator.CMGlobalActivator): playbook = '/opt/openstack-ansible/playbooks/motd.yml' def __init__(self): super(motdactivator, self).__init__() def get_subscription_info(self): return 'cloud.motd' def activa...
true
true
f7297bf8b18239cca9640934586a3c6e0d1b0006
563
py
Python
code/202011/20201119_283_moveZeroes.py
ace7chan/leetcode-daily
d07fe58fdb635dfa2a092515e8e235c476826b09
[ "MIT" ]
null
null
null
code/202011/20201119_283_moveZeroes.py
ace7chan/leetcode-daily
d07fe58fdb635dfa2a092515e8e235c476826b09
[ "MIT" ]
null
null
null
code/202011/20201119_283_moveZeroes.py
ace7chan/leetcode-daily
d07fe58fdb635dfa2a092515e8e235c476826b09
[ "MIT" ]
null
null
null
from typing import List class Solution: def moveZeroes(self, nums: List[int]) -> None: """ Do not return anything, modify nums in-place instead. """ cur_idx = 0 for num in nums: if num == 0: continue nums[cur_idx] = num cu...
22.52
61
0.50444
from typing import List class Solution: def moveZeroes(self, nums: List[int]) -> None: cur_idx = 0 for num in nums: if num == 0: continue nums[cur_idx] = num cur_idx += 1 while cur_idx < len(nums): nums[cur_idx] = 0 ...
true
true
f7297e07cf922dfa791b82c22a538dc4f2b6e22c
1,588
py
Python
misc/zkbreaker.py
hubo1016/vlcp
61c4c2595b610675ac0cbc4dbc46f70ec40090d3
[ "Apache-2.0" ]
252
2015-11-17T14:21:50.000Z
2022-03-11T10:19:47.000Z
misc/zkbreaker.py
SarahZarei/vlcp
61c4c2595b610675ac0cbc4dbc46f70ec40090d3
[ "Apache-2.0" ]
23
2018-01-09T13:28:52.000Z
2019-12-12T06:11:44.000Z
misc/zkbreaker.py
SarahZarei/vlcp
61c4c2595b610675ac0cbc4dbc46f70ec40090d3
[ "Apache-2.0" ]
37
2016-08-03T04:42:22.000Z
2021-12-30T16:57:10.000Z
''' Created on 2016/10/25 :author: hubo ''' from vlcp.config import config from vlcp.protocol.zookeeper import ZooKeeper import vlcp.protocol.zookeeper from random import random from vlcp.event.core import syscall_clearqueue from logging import getLogger _logger = getLogger(__name__) @config('protocol.zookeeper')...
34.521739
139
0.707809
from vlcp.config import config from vlcp.protocol.zookeeper import ZooKeeper import vlcp.protocol.zookeeper from random import random from vlcp.event.core import syscall_clearqueue from logging import getLogger _logger = getLogger(__name__) @config('protocol.zookeeper') class BreakingZooKeeper(ZooKeeper): _def...
true
true
f7297e1604cfd737ba606eafbf1451eb0a2c2972
1,504
py
Python
test/functional/feature_blocksdir.py
fancywarlock/bitcoinr
12b4dee6342556c0890218b843f29cadfab06214
[ "MIT" ]
2
2020-05-31T01:06:06.000Z
2021-06-07T22:29:32.000Z
test/functional/feature_blocksdir.py
fancywarlock/bitcoinr
12b4dee6342556c0890218b843f29cadfab06214
[ "MIT" ]
null
null
null
test/functional/feature_blocksdir.py
fancywarlock/bitcoinr
12b4dee6342556c0890218b843f29cadfab06214
[ "MIT" ]
3
2020-09-24T16:46:45.000Z
2021-06-07T22:29:33.000Z
#!/usr/bin/env python3 # Copyright (c) 2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the blocksdir option. """ import os import shutil from test_framework.test_framework import bitcoinRT...
37.6
167
0.698803
import os import shutil from test_framework.test_framework import bitcoinRTestFramework, initialize_datadir class BlocksdirTest(bitcoinRTestFramework): def set_test_params(self): self.setup_clean_chain = True self.num_nodes = 1 def skip_test_if_missing_module(self): self.skip_if...
true
true
f7297e96bfe1de8e74a8448f1f7dfe04aa9d2b63
6,235
py
Python
tests/test_stac.py
stactools-packages/cop-dem
25a4bb69eb60caa339e11b8293291cdc192e2de8
[ "Apache-2.0" ]
null
null
null
tests/test_stac.py
stactools-packages/cop-dem
25a4bb69eb60caa339e11b8293291cdc192e2de8
[ "Apache-2.0" ]
3
2021-07-29T16:58:52.000Z
2021-08-12T18:18:42.000Z
tests/test_stac.py
stactools-packages/cop-dem
25a4bb69eb60caa339e11b8293291cdc192e2de8
[ "Apache-2.0" ]
1
2021-08-05T23:17:51.000Z
2021-08-05T23:17:51.000Z
import datetime from unittest import TestCase from pystac import Provider, MediaType from pystac.extensions.projection import ProjectionExtension from pystac.provider import ProviderRole from stactools.cop_dem import stac from tests import test_data class StacTest(TestCase): def setUp(self): self.glo30...
41.845638
79
0.631275
import datetime from unittest import TestCase from pystac import Provider, MediaType from pystac.extensions.projection import ProjectionExtension from pystac.provider import ProviderRole from stactools.cop_dem import stac from tests import test_data class StacTest(TestCase): def setUp(self): self.glo30...
true
true
f7297f1d91ce8e6b39e55cc5ac6ecf497f9f71db
1,068
py
Python
example_workspace/inverted_hierarchy/model.py
anicokatz/PyMultiNestPlus
d223ac90bef7c1b61e337b70c2bdb41ed46cb2b7
[ "OML" ]
null
null
null
example_workspace/inverted_hierarchy/model.py
anicokatz/PyMultiNestPlus
d223ac90bef7c1b61e337b70c2bdb41ed46cb2b7
[ "OML" ]
null
null
null
example_workspace/inverted_hierarchy/model.py
anicokatz/PyMultiNestPlus
d223ac90bef7c1b61e337b70c2bdb41ed46cb2b7
[ "OML" ]
null
null
null
# INVERTED HIERARCHY import prior_handler as phandle import math import numpy as np import os cwd = os.path.dirname(os.path.realpath(__file__)) print(cwd) prior_handler = phandle.PriorHandler(cwd) con = prior_handler.c n_pars = prior_handler.n_pars def prior(cube, n_dims, n_pars): return prior_handler.scale(cube)...
26.04878
80
0.627341
import prior_handler as phandle import math import numpy as np import os cwd = os.path.dirname(os.path.realpath(__file__)) print(cwd) prior_handler = phandle.PriorHandler(cwd) con = prior_handler.c n_pars = prior_handler.n_pars def prior(cube, n_dims, n_pars): return prior_handler.scale(cube) def observables(pa...
true
true
f7297fc788219d05bf55769bec2813a65e0f1710
1,478
py
Python
tests/test_documentation_eager.py
burgerkingeater/io
f2de208f474d6ba4926e2c7f9e901e102ca5c254
[ "Apache-2.0" ]
1
2021-05-10T10:44:08.000Z
2021-05-10T10:44:08.000Z
tests/test_documentation_eager.py
burgerkingeater/io
f2de208f474d6ba4926e2c7f9e901e102ca5c254
[ "Apache-2.0" ]
1
2021-02-24T10:37:32.000Z
2021-02-24T10:37:32.000Z
tests/test_documentation_eager.py
burgerkingeater/io
f2de208f474d6ba4926e2c7f9e901e102ca5c254
[ "Apache-2.0" ]
null
null
null
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy of # the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
32.844444
80
0.587957
import os def extract_block(filename, lang): source = "" with open(filename) as f: hit = -1 for line in f: if hit < 0: if line.strip().startswith("```" + lang): hit = line.find("```" + lang) else: if li...
true
true
f72980142790efdf80fe4386352f892f576b4b05
664
py
Python
game/combat/effects/moveeffect/avghp.py
Sipondo/ulix-dexflow
de46482fe08e3d600dd5da581f0524b55e5df961
[ "MIT" ]
5
2021-06-25T16:44:38.000Z
2021-12-31T01:29:00.000Z
game/combat/effects/moveeffect/avghp.py
Sipondo/ulix-dexflow
de46482fe08e3d600dd5da581f0524b55e5df961
[ "MIT" ]
null
null
null
game/combat/effects/moveeffect/avghp.py
Sipondo/ulix-dexflow
de46482fe08e3d600dd5da581f0524b55e5df961
[ "MIT" ]
1
2021-06-25T20:33:47.000Z
2021-06-25T20:33:47.000Z
from game.combat.effects.moveeffect.basemoveeffect import BaseMoveEffect class Avghp(BaseMoveEffect): def after_action(self): user_hp = self.scene.board.get_data(self.move.user).current_hp user_max_hp = self.scene.board.get_actor(self.move.user).stats[0] target_hp = self.scene.board.get_da...
44.266667
78
0.716867
from game.combat.effects.moveeffect.basemoveeffect import BaseMoveEffect class Avghp(BaseMoveEffect): def after_action(self): user_hp = self.scene.board.get_data(self.move.user).current_hp user_max_hp = self.scene.board.get_actor(self.move.user).stats[0] target_hp = self.scene.board.get_da...
true
true
f7298048176e7ee84c55af3bf97f19b8217d90b0
494
py
Python
ProjectEuler.Problem.039.py
jihunroh/ProjectEuler-Python
2fceaf5c3dd61038004b6128c5d9ee7a76142bca
[ "MIT" ]
null
null
null
ProjectEuler.Problem.039.py
jihunroh/ProjectEuler-Python
2fceaf5c3dd61038004b6128c5d9ee7a76142bca
[ "MIT" ]
null
null
null
ProjectEuler.Problem.039.py
jihunroh/ProjectEuler-Python
2fceaf5c3dd61038004b6128c5d9ee7a76142bca
[ "MIT" ]
null
null
null
from ProjectEulerCommons.Base import * def get_triangle_length_pairs(p): return sum([True for a in range(1, p - 2) for b in range(a, p - a - 1) if p - a - b > b and a**2 + b**2 == (p - a - b)**2]) Answer( max_index([(p, get_triangle_length_pairs(p)) for p in range(3, 1000 + 1)])[0] ) """ --------------------...
29.058824
127
0.506073
from ProjectEulerCommons.Base import * def get_triangle_length_pairs(p): return sum([True for a in range(1, p - 2) for b in range(a, p - a - 1) if p - a - b > b and a**2 + b**2 == (p - a - b)**2]) Answer( max_index([(p, get_triangle_length_pairs(p)) for p in range(3, 1000 + 1)])[0] )
true
true
f72981074d6cef71e7e9323c24ea3c9a0020ffe1
2,773
py
Python
neptune-python-utils/neptune_python_utils/glue_neptune_connection_info.py
Alfian878787/amazon-neptune-tools
a447da238e99612a290babc66878fe772727a19e
[ "Apache-2.0" ]
null
null
null
neptune-python-utils/neptune_python_utils/glue_neptune_connection_info.py
Alfian878787/amazon-neptune-tools
a447da238e99612a290babc66878fe772727a19e
[ "Apache-2.0" ]
null
null
null
neptune-python-utils/neptune_python_utils/glue_neptune_connection_info.py
Alfian878787/amazon-neptune-tools
a447da238e99612a290babc66878fe772727a19e
[ "Apache-2.0" ]
null
null
null
# Copyright 2020 Amazon.com, Inc. or its affiliates. # 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. # A copy of the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file ac...
39.614286
116
0.662099
import sys, boto3, os, uuid from urllib.parse import urlparse from botocore.credentials import Credentials from neptune_python_utils.endpoints import Endpoints class GlueNeptuneConnectionInfo: def __init__(self, region, role_arn): self.region = region self.role_arn = role...
true
true
f729829b0184b217d4f1bd32504cb211255b7245
4,125
py
Python
indexclient/parser.py
palkeo/indexd
f55ca6ab9f545d4df3e37b7d48a7bff907e6b27f
[ "BSD-3-Clause" ]
7
2016-10-10T09:36:43.000Z
2020-09-11T06:55:42.000Z
indexclient/parser.py
palkeo/indexd
f55ca6ab9f545d4df3e37b7d48a7bff907e6b27f
[ "BSD-3-Clause" ]
null
null
null
indexclient/parser.py
palkeo/indexd
f55ca6ab9f545d4df3e37b7d48a7bff907e6b27f
[ "BSD-3-Clause" ]
6
2016-04-11T15:57:05.000Z
2019-01-06T10:12:29.000Z
import nodes from parsers import parse """ This file contains a function to parse a query. It will have to return a rootnode. """ BINARY_OPERATOR, UNARY_OPERATOR, MODIFIER, TERM = range(4) # Contains a tuple : The first element is the node, the second is the priority of the operator (the bigger it is, the more the o...
30.330882
156
0.557091
import nodes from parsers import parse BINARY_OPERATOR, UNARY_OPERATOR, MODIFIER, TERM = range(4) OPERATORS = { 'AND': (nodes.AndNode, 5, BINARY_OPERATOR), 'OR': (nodes.OrNode, 10, BINARY_OPERATOR), '&&': (nodes.AndNode, 5, BINARY_OPERATOR), '||': (nodes.OrNode, 10, BINARY_OPERATOR), 'NOT'...
true
true
f72982eaa140f4ef236992892c40e97c081380db
9,193
py
Python
src/brouwers/forum_tools/models.py
modelbrouwers/modelbrouwers
e0ba4819bf726d6144c0a648fdd4731cdc098a52
[ "MIT" ]
6
2015-03-03T13:23:07.000Z
2021-12-19T18:12:41.000Z
src/brouwers/forum_tools/models.py
modelbrouwers/modelbrouwers
e0ba4819bf726d6144c0a648fdd4731cdc098a52
[ "MIT" ]
95
2015-02-07T00:55:39.000Z
2022-02-08T20:22:05.000Z
src/brouwers/forum_tools/models.py
modelbrouwers/modelbrouwers
e0ba4819bf726d6144c0a648fdd4731cdc098a52
[ "MIT" ]
2
2016-03-22T16:53:26.000Z
2019-02-09T22:46:04.000Z
import zlib from datetime import datetime from django.conf import settings from django.db import models from django.urls import reverse from django.utils import timezone from django.utils.http import urlencode from django.utils.timesince import timesince from django.utils.translation import ugettext_lazy as _ from da...
30.952862
88
0.643207
import zlib from datetime import datetime from django.conf import settings from django.db import models from django.urls import reverse from django.utils import timezone from django.utils.http import urlencode from django.utils.timesince import timesince from django.utils.translation import ugettext_lazy as _ from da...
true
true
f7298325890cc141fb4ab076c784498f0c2c5807
899
py
Python
share/qt/clean_mac_info_plist.py
1nv4d3r2/GrainCoin
dd902e788b0c78c591287eb4ae23e54fe3780d43
[ "MIT" ]
3
2019-11-29T23:06:15.000Z
2019-12-04T20:42:50.000Z
share/qt/clean_mac_info_plist.py
1nv4d3r2/GrainCoin
dd902e788b0c78c591287eb4ae23e54fe3780d43
[ "MIT" ]
1
2019-12-04T20:54:56.000Z
2019-12-04T20:59:50.000Z
share/qt/clean_mac_info_plist.py
1nv4d3r2/GrainCoin
dd902e788b0c78c591287eb4ae23e54fe3780d43
[ "MIT" ]
1
2019-12-04T20:43:06.000Z
2019-12-04T20:43:06.000Z
#!/usr/bin/env python # Jonas Schnelli, 2013 # make sure the Graincoin-Qt.app contains the right plist (including the right version) # fix made because of serval bugs in Qt mac deployment (https://bugreports.qt-project.org/browse/QTBUG-21267) from string import Template from datetime import date bitcoinDir = "./"; i...
29.966667
109
0.726363
from string import Template from datetime import date bitcoinDir = "./"; inFile = bitcoinDir+"/share/qt/Info.plist" outFile = "Graincoin-Qt.app/Contents/Info.plist" version = "unknown"; fileForGrabbingVersion = bitcoinDir+"bitcoin-qt.pro" for line in open(fileForGrabbingVersion): lineArr = line.repla...
false
true
f72984a9a6003802c913b46bb52ecb628180101d
915
py
Python
day_09/part1.py
pawlodkowski/advent_of_code_2020
ca41416c340747d7e37eeab60046b770c240338b
[ "MIT" ]
2
2020-12-02T09:14:14.000Z
2020-12-02T22:14:21.000Z
day_09/part1.py
pawlodkowski/advent_of_code_2020
ca41416c340747d7e37eeab60046b770c240338b
[ "MIT" ]
null
null
null
day_09/part1.py
pawlodkowski/advent_of_code_2020
ca41416c340747d7e37eeab60046b770c240338b
[ "MIT" ]
null
null
null
""" Part 1 of https://adventofcode.com/2020/day/9 """ def read_data(filename: str) -> list: with open(filename, "r") as f: data = f.read().split("\n") return data def sum_to_n(n, options): """ Helper function adapted from Day 1 :) """ try: for num in options: comp...
22.875
118
0.525683
def read_data(filename: str) -> list: with open(filename, "r") as f: data = f.read().split("\n") return data def sum_to_n(n, options): try: for num in options: complement = n - num if complement in options: first = num second = comp...
true
true
f7298568842336de097bfeefa793c9af8b3534df
3,238
py
Python
scripts/fetch_json.py
shunte88/discogs-tagger
dc592692b37ea42b7a7b8343afa7e937d718e5c9
[ "MIT" ]
null
null
null
scripts/fetch_json.py
shunte88/discogs-tagger
dc592692b37ea42b7a7b8343afa7e937d718e5c9
[ "MIT" ]
null
null
null
scripts/fetch_json.py
shunte88/discogs-tagger
dc592692b37ea42b7a7b8343afa7e937d718e5c9
[ "MIT" ]
null
null
null
#!/usr/bin/python # -*- coding: utf-8 -*- import os import logging import logging.config import sys import json from optparse import OptionParser import discogs_client parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(parentdir) from discogstagger.tagger_config import TaggerCon...
29.706422
117
0.743669
import os import logging import logging.config import sys import json from optparse import OptionParser import discogs_client parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(parentdir) from discogstagger.tagger_config import TaggerConfig p = OptionParser(version="discogsta...
false
true
f72985e3c3835b49230c4dfe3c6d5af8845591fc
8,470
py
Python
tests/test_txpool.py
rsoliha/LabChain
4694913f52b3d0567f9a289dfc0b7bec30eccfb9
[ "Apache-2.0" ]
null
null
null
tests/test_txpool.py
rsoliha/LabChain
4694913f52b3d0567f9a289dfc0b7bec30eccfb9
[ "Apache-2.0" ]
null
null
null
tests/test_txpool.py
rsoliha/LabChain
4694913f52b3d0567f9a289dfc0b7bec30eccfb9
[ "Apache-2.0" ]
null
null
null
import unittest import os from labchain.datastructure.txpool import TxPool from labchain.datastructure.transaction import Transaction from labchain.util.cryptoHelper import CryptoHelper from labchain.datastructure.blockchain import BlockChain from labchain.util.configReader import ConfigReader from labchain.consensus....
52.608696
105
0.710862
import unittest import os from labchain.datastructure.txpool import TxPool from labchain.datastructure.transaction import Transaction from labchain.util.cryptoHelper import CryptoHelper from labchain.datastructure.blockchain import BlockChain from labchain.util.configReader import ConfigReader from labchain.consensus....
true
true
f729864796f49818be1ba8f4a31b3aafd57c5c19
589
py
Python
gdsfactory/simulation/modes/tests/test_find_modes_dispersion.py
simbilod/gdsfactory
4d76db32674c3edb4d16260e3177ee29ef9ce11d
[ "MIT" ]
null
null
null
gdsfactory/simulation/modes/tests/test_find_modes_dispersion.py
simbilod/gdsfactory
4d76db32674c3edb4d16260e3177ee29ef9ce11d
[ "MIT" ]
null
null
null
gdsfactory/simulation/modes/tests/test_find_modes_dispersion.py
simbilod/gdsfactory
4d76db32674c3edb4d16260e3177ee29ef9ce11d
[ "MIT" ]
null
null
null
import numpy as np from gdsfactory.simulation.modes.find_mode_dispersion import find_mode_dispersion def test_find_modes_waveguide_dispersion() -> None: modes = find_mode_dispersion(wg_width=0.45, resolution=20, cache=None) m1 = modes # print(f"neff1 = {m1.neff}") # print(f"ng1 = {m1.ng}") # ne...
23.56
81
0.689304
import numpy as np from gdsfactory.simulation.modes.find_mode_dispersion import find_mode_dispersion def test_find_modes_waveguide_dispersion() -> None: modes = find_mode_dispersion(wg_width=0.45, resolution=20, cache=None) m1 = modes neff1 = 2.362907833437435 ng1 = 4.202169359...
true
true
f72986a5df5acfae915ca08e7901dfdce218c1f8
45,453
py
Python
Utilities/JSBSimWriteXml.py
elke0011/OpenFlightSim
1e28c54864ffd188f27425c8a71cce8b70a4bd7f
[ "MIT" ]
15
2019-03-15T17:28:23.000Z
2022-03-21T23:52:53.000Z
Utilities/JSBSimWriteXml.py
elke0011/OpenFlightSim
1e28c54864ffd188f27425c8a71cce8b70a4bd7f
[ "MIT" ]
null
null
null
Utilities/JSBSimWriteXml.py
elke0011/OpenFlightSim
1e28c54864ffd188f27425c8a71cce8b70a4bd7f
[ "MIT" ]
5
2019-03-28T17:35:50.000Z
2022-03-04T19:38:03.000Z
""" University of Minnesota Aerospace Engineering and Mechanics - UAV Lab Copyright 2019 Regents of the University of Minnesota. See: LICENSE.md for complete license details. Author: Louis Mueller, Chris Regan """ import os.path from xml.etree import ElementTree as ET import numpy as np ft2m = 0.3048 psf2pa = 47.8...
43.124288
143
0.628451
import os.path from xml.etree import ElementTree as ET import numpy as np ft2m = 0.3048 psf2pa = 47.88026 def SaveXml(elem, saveFile): from xml.dom import minidom uglyXml = ET.tostring(elem, 'utf-8') prettyXml = minidom.parseString(uglyXml).toprettyxml(indent=' ', newl = '\r\n') os.makedirs(o...
true
true
f72986e13bc4533e79920b6bd0a416f26e97ee2f
1,190
py
Python
app.py
ajoss/tk-houdini-geometrynode
b732002c0014f78ff13bea2e86cbe23b890bbbf4
[ "MIT" ]
3
2019-04-17T12:39:20.000Z
2019-11-04T07:25:59.000Z
app.py
ajoss/tk-houdini-geometrynode
b732002c0014f78ff13bea2e86cbe23b890bbbf4
[ "MIT" ]
null
null
null
app.py
ajoss/tk-houdini-geometrynode
b732002c0014f78ff13bea2e86cbe23b890bbbf4
[ "MIT" ]
5
2018-09-19T08:13:14.000Z
2020-02-15T14:50:01.000Z
# Copyright (c) 2015 Pixomondo # # CONFIDENTIAL AND PROPRIETARY # # This work is provided "AS IS" and subject to the MIT License included in this # distribution package. See LICENSE. # By accessing, using, copying or modifying this work you indicate your # agreement to the MIT License. All rights # not expressly grante...
32.162162
81
0.721008
import sgtk class GeometryOutputNode(sgtk.platform.Application): def init_app(self): module = self.import_module("tk_houdini_geometrynode") self.handler = module.ToolkitGeometryNodeHandler(self) def convert_to_geometry_nodes(self): self.handler.convert_sg_to_geometry_nodes(...
true
true
f729876b03555c0a2ee2deffa22d9c2809f617fd
5,342
py
Python
urbanairship/push/schedule.py
urbanairship/python-library
f59d7140c16db7aec48e8ebbaf26f31e7f02ab26
[ "Apache-2.0" ]
26
2015-01-05T21:08:07.000Z
2021-05-13T07:27:19.000Z
urbanairship/push/schedule.py
urbanairship/python-library
f59d7140c16db7aec48e8ebbaf26f31e7f02ab26
[ "Apache-2.0" ]
32
2015-01-08T23:46:36.000Z
2022-02-02T18:17:58.000Z
urbanairship/push/schedule.py
urbanairship/python-library
f59d7140c16db7aec48e8ebbaf26f31e7f02ab26
[ "Apache-2.0" ]
33
2015-01-21T08:02:40.000Z
2022-03-25T06:02:04.000Z
from datetime import datetime from urbanairship import common from urbanairship.push import ScheduledPush VALID_DAYS = [ "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday", ] VALID_RECURRING_TYPES = ["hourly", "daily", "weekly", "monthly", "yearly"] class Schedu...
34.24359
87
0.672595
from datetime import datetime from urbanairship import common from urbanairship.push import ScheduledPush VALID_DAYS = [ "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday", ] VALID_RECURRING_TYPES = ["hourly", "daily", "weekly", "monthly", "yearly"] class Schedu...
true
true
f72987cba217a15bd066d0afb902992a53d03c44
344
py
Python
app/forms.py
LoisaKitakaya/The-Blog
6f2abd70e7d65de938f162b6219c468e5736a1da
[ "MIT" ]
null
null
null
app/forms.py
LoisaKitakaya/The-Blog
6f2abd70e7d65de938f162b6219c468e5736a1da
[ "MIT" ]
null
null
null
app/forms.py
LoisaKitakaya/The-Blog
6f2abd70e7d65de938f162b6219c468e5736a1da
[ "MIT" ]
null
null
null
from django import forms from .models import * # create your forms class PostArticle(forms.ModelForm): class Meta: model = Article fieldS = '__all__' exclude = ['article_author', 'slug', 'posted_on'] class PostComment(forms.ModelForm): class Meta: model = Comment ...
17.2
57
0.622093
from django import forms from .models import * class PostArticle(forms.ModelForm): class Meta: model = Article fieldS = '__all__' exclude = ['article_author', 'slug', 'posted_on'] class PostComment(forms.ModelForm): class Meta: model = Comment fields = ['comm...
true
true
f72987f95fdc25137b7bca9a81ffdf51642c3e8f
3,178
py
Python
django_three/basicforms/basicforms/settings.py
NNDEV1/DjangoStuff
d8b850dce41a18c807a412f7644abae80f3d7c8e
[ "MIT" ]
1
2021-08-14T14:48:37.000Z
2021-08-14T14:48:37.000Z
django_three/basicforms/basicforms/settings.py
NNDEV1/DjangoStuff
d8b850dce41a18c807a412f7644abae80f3d7c8e
[ "MIT" ]
null
null
null
django_three/basicforms/basicforms/settings.py
NNDEV1/DjangoStuff
d8b850dce41a18c807a412f7644abae80f3d7c8e
[ "MIT" ]
null
null
null
""" Django settings for basicforms project. Generated by 'django-admin startproject' using Django 2.1.4. For more information on this file, see https://docs.djangoproject.com/en/2.1/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.1/ref/settings/ """ import os...
25.837398
91
0.699182
import os BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) TEMPLATE_DIR = os.path.join(BASE_DIR, 'templates') SECRET_KEY = 'r7^%rvbmkoi%v%def+cf3s1a#&7d5w_731ctf0r$3q92hl=1p%' DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ 'django.contrib.admin', ...
true
true
f729888ae93196c5c5c069ec12d59f2077f3c962
3,467
py
Python
azure/mgmt/network/v2017_09_01/models/application_gateway_url_path_map.py
EnjoyLifeFund/macHighSierra-py36-pkgs
5668b5785296b314ea1321057420bcd077dba9ea
[ "BSD-3-Clause", "BSD-2-Clause", "MIT" ]
null
null
null
azure/mgmt/network/v2017_09_01/models/application_gateway_url_path_map.py
EnjoyLifeFund/macHighSierra-py36-pkgs
5668b5785296b314ea1321057420bcd077dba9ea
[ "BSD-3-Clause", "BSD-2-Clause", "MIT" ]
null
null
null
azure/mgmt/network/v2017_09_01/models/application_gateway_url_path_map.py
EnjoyLifeFund/macHighSierra-py36-pkgs
5668b5785296b314ea1321057420bcd077dba9ea
[ "BSD-3-Clause", "BSD-2-Clause", "MIT" ]
null
null
null
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # C...
48.830986
216
0.674358
from .sub_resource import SubResource class ApplicationGatewayUrlPathMap(SubResource): _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'default_backend_address_pool': {'key': 'properties.defaultBackendAddressPool', 'type': 'SubResource'}, 'default_backend_http_s...
true
true
f729894909e1053453798c214ec730a6afb2059d
1,694
py
Python
ivi/agilent/agilentDSOX3034A.py
edupo/python-ivi
8105d8064503725dde781f0378d75db58defaecb
[ "MIT" ]
null
null
null
ivi/agilent/agilentDSOX3034A.py
edupo/python-ivi
8105d8064503725dde781f0378d75db58defaecb
[ "MIT" ]
null
null
null
ivi/agilent/agilentDSOX3034A.py
edupo/python-ivi
8105d8064503725dde781f0378d75db58defaecb
[ "MIT" ]
null
null
null
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2012-2016 Alex Forencich 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...
37.644444
86
0.755018
from .agilent3000A import * class agilentDSOX3034A(agilent3000A): def __init__(self, *args, **kwargs): self.__dict__.setdefault('_instrument_id', 'DSO-X 3034A') super(agilentDSOX3034A, self).__init__(*args, **kwargs) self._analog_channel_count = 4 self._digit...
true
true
f72989e816d65be550aa2241f0ca3cd63ca452f2
494
py
Python
test.py
JiamingBai/InteractiveDataScience.github.io
c43b7bda50356a4b16b6804c3eb8bcfe33ce6b13
[ "MIT" ]
null
null
null
test.py
JiamingBai/InteractiveDataScience.github.io
c43b7bda50356a4b16b6804c3eb8bcfe33ce6b13
[ "MIT" ]
null
null
null
test.py
JiamingBai/InteractiveDataScience.github.io
c43b7bda50356a4b16b6804c3eb8bcfe33ce6b13
[ "MIT" ]
null
null
null
import sys import json import cgi fs = cgi.FieldStorage() sys.stdout.write("Content-Type: application/json") sys.stdout.write("\n") sys.stdout.write("\n") result = {} result['success'] = True result['message'] = "The command Completed Successfully" result['keys'] = ",".join(fs.keys()) d = {} for k in fs.keys(): ...
15.4375
56
0.672065
import sys import json import cgi fs = cgi.FieldStorage() sys.stdout.write("Content-Type: application/json") sys.stdout.write("\n") sys.stdout.write("\n") result = {} result['success'] = True result['message'] = "The command Completed Successfully" result['keys'] = ",".join(fs.keys()) d = {} for k in fs.keys(): ...
true
true
f72989fb32f8814dbb34e9d1777eb25d5a1ab37f
4,279
py
Python
bcbio/pipeline/merge.py
arvados/bcbio-nextgen
2a5cfa8c3a1d540bb2f2e66f51835042195cbc87
[ "MIT" ]
3
2015-11-18T07:17:54.000Z
2021-04-28T13:58:37.000Z
bcbio/pipeline/merge.py
yong27/bcbio-nextgen
9320479d8f21677b61ed1274b4da23d569c686ae
[ "MIT" ]
null
null
null
bcbio/pipeline/merge.py
yong27/bcbio-nextgen
9320479d8f21677b61ed1274b4da23d569c686ae
[ "MIT" ]
null
null
null
"""Handle multiple samples present on a single flowcell Merges samples located in multiple lanes on a flowcell. Unique sample names identify items to combine within a group. """ import os import shutil from bcbio import bam, utils from bcbio.distributed.transaction import file_transaction, tx_tmpdir from bcbio.pipeli...
49.183908
117
0.592662
import os import shutil from bcbio import bam, utils from bcbio.distributed.transaction import file_transaction, tx_tmpdir from bcbio.pipeline import config_utils from bcbio.provenance import do, system def combine_fastq_files(in_files, work_dir, config): if len(in_files) == 1: return in_files[0] else...
true
true
f7298bd1ea920b8cff4d35c6845a6988a31d944d
253
py
Python
wave/transformold/transform.py
jedhsu/wave
a05d8f4b0a96722bdc2f5a514646c7a44681982b
[ "Apache-2.0" ]
null
null
null
wave/transformold/transform.py
jedhsu/wave
a05d8f4b0a96722bdc2f5a514646c7a44681982b
[ "Apache-2.0" ]
null
null
null
wave/transformold/transform.py
jedhsu/wave
a05d8f4b0a96722bdc2f5a514646c7a44681982b
[ "Apache-2.0" ]
null
null
null
# from abc import ABCMeta, abstractmethod # from typing import Iterator # class Transform(metaclass=ABCMeta): # def __init__(self): # pass # @property # @abstractmethod # def waveform(self) -> Iterator[float]: # pass
18.071429
44
0.636364
true
true
f7298c3dae02b6d779bb5e0dde0e7ea1087b0d3e
2,309
py
Python
Module1/Day04/module1_day04_variables.py
puczilka/100DaysPython
95f761ae506b4175e96b87a43f7177dc3597e586
[ "MIT" ]
23
2019-05-31T18:00:26.000Z
2021-11-21T19:08:19.000Z
Module1/Day04/module1_day04_variables.py
btruck552/100DaysPython
1e45a10387da6d4ebdf8aa5fe13843a4509c8b62
[ "MIT" ]
null
null
null
Module1/Day04/module1_day04_variables.py
btruck552/100DaysPython
1e45a10387da6d4ebdf8aa5fe13843a4509c8b62
[ "MIT" ]
42
2019-05-31T17:54:28.000Z
2022-02-12T22:09:51.000Z
""" Author: CaptCorpMURICA Project: 100DaysPython File: module1_day04_variables.py Creation Date: 6/2/2019, 8:55 AM Description: Learn about using variables in python. """ # Variables need to start with a letter or an underscore. Numbers can be used in the variable name...
36.078125
120
0.706366
greeting = "Hello" _name = "General Kenobi." Greeting = "There" _bestLine_ep3_ = "You are a bold one." print(greeting + " " + Greeting + "\n\t" + _name + " " + _bestLine_ep3_) print("{} {}\n\t{} {}".format(greeting, Greeting, _name, _bestLine_ep3_)) released = 2005 print("Revenge of the Sith was released on Ma...
true
true
f7298cb548fa7c1de09bf4bf092c51b5d80b4b4f
14,552
py
Python
ansible/modules/cloud/amazon/lambda_event.py
EnjoyLifeFund/macHighSierra-py36-pkgs
5668b5785296b314ea1321057420bcd077dba9ea
[ "BSD-3-Clause", "BSD-2-Clause", "MIT" ]
1
2022-01-25T22:52:58.000Z
2022-01-25T22:52:58.000Z
ansible/modules/cloud/amazon/lambda_event.py
EnjoyLifeFund/Debian_py36_packages
1985d4c73fabd5f08f54b922e73a9306e09c77a5
[ "BSD-3-Clause", "BSD-2-Clause", "MIT" ]
null
null
null
ansible/modules/cloud/amazon/lambda_event.py
EnjoyLifeFund/Debian_py36_packages
1985d4c73fabd5f08f54b922e73a9306e09c77a5
[ "BSD-3-Clause", "BSD-2-Clause", "MIT" ]
null
null
null
#!/usr/bin/python # (c) 2016, Pierre Jodouin <pjodouin@virtualcomputing.solutions> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
34.24
134
0.628848
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: lambda_event short_description: Creates, updates or del...
true
true
f7298dd321960e183c2e94eec3d29c49fdb011bf
1,181
py
Python
setup.py
mishrasanskriti802/island-backup
6dd0b45ac9cb87418e05ccfeb1150657d8a8964b
[ "MIT" ]
17
2016-01-28T06:09:26.000Z
2020-01-19T08:37:01.000Z
setup.py
mishrasanskriti802/island-backup
6dd0b45ac9cb87418e05ccfeb1150657d8a8964b
[ "MIT" ]
28
2015-12-15T05:08:28.000Z
2017-04-20T02:34:27.000Z
setup.py
mishrasanskriti802/island-backup
6dd0b45ac9cb87418e05ccfeb1150657d8a8964b
[ "MIT" ]
7
2016-06-09T14:02:21.000Z
2020-10-01T13:55:29.000Z
from setuptools import setup, find_packages with open('README.rst', 'r', encoding='utf8') as f: readme = f.read() with open('requirements.txt','r',encoding='utf8') as f: requirements = f.readlines() version = __import__('island_backup').version setup( name='island_backup', version=version, desc...
26.244444
62
0.629975
from setuptools import setup, find_packages with open('README.rst', 'r', encoding='utf8') as f: readme = f.read() with open('requirements.txt','r',encoding='utf8') as f: requirements = f.readlines() version = __import__('island_backup').version setup( name='island_backup', version=version, desc...
true
true
f7298e2e8b7319492030a6159a8f000bb0cc80c2
9,886
py
Python
sphinx/util/i18n.py
rdt12/sphinx
830b3fbe2babcc8df33f767ce3a406b16c0cac1c
[ "BSD-2-Clause" ]
2
2021-11-29T04:16:41.000Z
2021-12-06T14:59:22.000Z
sphinx/util/i18n.py
Blendify/sphinx
dd00bade705c8cb661151aef9f7504c62cbb17ff
[ "BSD-2-Clause" ]
1
2021-10-16T06:34:21.000Z
2021-10-16T06:34:21.000Z
sphinx/util/i18n.py
Blendify/sphinx
dd00bade705c8cb661151aef9f7504c62cbb17ff
[ "BSD-2-Clause" ]
1
2021-10-24T01:44:26.000Z
2021-10-24T01:44:26.000Z
""" sphinx.util.i18n ~~~~~~~~~~~~~~~~ Builder superclass for all builders. :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import os import re from datetime import datetime, timezone from os import path from typing import TYPE_CHECKING,...
37.44697
95
0.606312
import os import re from datetime import datetime, timezone from os import path from typing import TYPE_CHECKING, Callable, Generator, List, NamedTuple, Optional, Tuple, Union import babel.dates from babel.messages.mofile import write_mo from babel.messages.pofile import read_po from sphinx.errors import SphinxError...
true
true
f7298e93853808c239027914d843e53976273ae0
804
py
Python
process_exec/parallel_pipe_io_base.py
sreramk/dag_process_exec
7f5493d44b65afa7b010cdc0081fc141d9339eb3
[ "Apache-2.0" ]
null
null
null
process_exec/parallel_pipe_io_base.py
sreramk/dag_process_exec
7f5493d44b65afa7b010cdc0081fc141d9339eb3
[ "Apache-2.0" ]
null
null
null
process_exec/parallel_pipe_io_base.py
sreramk/dag_process_exec
7f5493d44b65afa7b010cdc0081fc141d9339eb3
[ "Apache-2.0" ]
null
null
null
import abc class WriterBase(abc.ABC): @abc.abstractmethod def set_pipe(self, pipe): pass @abc.abstractmethod def parallel_write_end_loop(self) -> None: pass @abc.abstractmethod def is_running(self): pass @abc.abstractmethod def is_stopped(self): pass...
15.461538
46
0.61194
import abc class WriterBase(abc.ABC): @abc.abstractmethod def set_pipe(self, pipe): pass @abc.abstractmethod def parallel_write_end_loop(self) -> None: pass @abc.abstractmethod def is_running(self): pass @abc.abstractmethod def is_stopped(self): pass...
true
true
f7298fd9c7a6827bc9841172f616ef3715d70dfa
2,363
py
Python
src/muse-combineRoiMapsIter.py
CBICA/MUSE
edd01964078f957101130993899c7f4de13d48b6
[ "Unlicense" ]
null
null
null
src/muse-combineRoiMapsIter.py
CBICA/MUSE
edd01964078f957101130993899c7f4de13d48b6
[ "Unlicense" ]
1
2020-10-22T21:58:32.000Z
2020-12-24T18:09:43.000Z
src/muse-combineRoiMapsIter.py
CBICA/MUSE
edd01964078f957101130993899c7f4de13d48b6
[ "Unlicense" ]
1
2021-02-24T06:38:44.000Z
2021-02-24T06:38:44.000Z
#!/usr/bin/env python # # @file muse_combineRoiMapsIter.py # @brief Combine roi probability maps for a single subject # # Copyright (c) 2011, 2012 University of Pennsylvania. All rights reserved.<br /> # See http://www.cbica.upenn.edu/sbia/software/license.html or COPYING file. # # Contact: SBIA Group <sbia-software a...
22.084112
84
0.66314
true
true
f72990938ad2cb42f00c7cdb6eff613f89c9d0de
1,925
py
Python
empower/cli/lomm_lns_commands/list_lenddevs.py
ericbrinckhaus/empower-runtime-modified
ecd7c1e9f1c19a629abdcb5c55257377313246ea
[ "Apache-2.0" ]
null
null
null
empower/cli/lomm_lns_commands/list_lenddevs.py
ericbrinckhaus/empower-runtime-modified
ecd7c1e9f1c19a629abdcb5c55257377313246ea
[ "Apache-2.0" ]
null
null
null
empower/cli/lomm_lns_commands/list_lenddevs.py
ericbrinckhaus/empower-runtime-modified
ecd7c1e9f1c19a629abdcb5c55257377313246ea
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python3 # # # 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, # sof...
28.731343
77
0.657143
import argparse from empower.cli import command def pa_cmd(args, cmd): usage = "%s <options>" % command.USAGE.format(cmd) desc = command.DESCS[cmd] parser = argparse.ArgumentParser(usage=usage, description=desc) parser.add_argument( '-g', '--devEUI', help='show resul...
true
true
f7299320ac92f29ec4db9777da6d4d97ea370f59
603
py
Python
make_call.py
nfrumkin/ElMingle
6e9fa6bc4a4826188c9752212ec57b7b7a225b21
[ "MIT" ]
1
2019-11-17T00:44:08.000Z
2019-11-17T00:44:08.000Z
make_call.py
nfrumkin/ElMingle
6e9fa6bc4a4826188c9752212ec57b7b7a225b21
[ "MIT" ]
null
null
null
make_call.py
nfrumkin/ElMingle
6e9fa6bc4a4826188c9752212ec57b7b7a225b21
[ "MIT" ]
null
null
null
# Download the helper library from https://www.twilio.com/docs/python/install from twilio.rest import Client # Your Account Sid and Auth Token from twilio.com/console # DANGER! This is insecure. See http://twil.io/secure account_sid = 'ACc07d36f2bedb365988af5c81d578bfef' auth_token = 'd7698b135d26730bf84600c176d6815f...
33.5
77
0.658375
from twilio.rest import Client account_sid = 'ACc07d36f2bedb365988af5c81d578bfef' auth_token = 'd7698b135d26730bf84600c176d6815f' client = Client(account_sid, auth_token) call = client.calls.create( record=True, url='http://demo.twilio.com/docs/voice.xml', to='+1...
true
true
f7299343251025558429f8634c574058f7031345
1,529
py
Python
generator.py
y3sar/painter_gan
374fb91927ca584b4ef3fd8ba10922c7b5201780
[ "MIT" ]
1
2020-09-10T07:56:10.000Z
2020-09-10T07:56:10.000Z
generator.py
y3sar/painter_gan
374fb91927ca584b4ef3fd8ba10922c7b5201780
[ "MIT" ]
15
2020-09-26T00:22:47.000Z
2022-03-02T14:59:36.000Z
generator.py
y3sar/painter_gan
374fb91927ca584b4ef3fd8ba10922c7b5201780
[ "MIT" ]
null
null
null
import torch import torch.nn as nn from torchvision.transforms import ToTensor, ToPILImage class Generator(nn.Module): def __init__(self): super().__init__() self.conv_block = nn.Sequential( nn.ConvTranspose2d(100, 512, 4, 1, 0), ...
26.362069
74
0.35121
import torch import torch.nn as nn from torchvision.transforms import ToTensor, ToPILImage class Generator(nn.Module): def __init__(self): super().__init__() self.conv_block = nn.Sequential( nn.ConvTranspose2d(100, 512, 4, 1, 0), ...
true
true
f7299350b5f08db93723645ff2abf0821f03a950
8,346
py
Python
Engines/Engines.py
whitemike889/Machapi
8c6f4d4d9d788cc0b56643ef054124c04b7e2728
[ "Apache-2.0" ]
null
null
null
Engines/Engines.py
whitemike889/Machapi
8c6f4d4d9d788cc0b56643ef054124c04b7e2728
[ "Apache-2.0" ]
null
null
null
Engines/Engines.py
whitemike889/Machapi
8c6f4d4d9d788cc0b56643ef054124c04b7e2728
[ "Apache-2.0" ]
null
null
null
## @package Engines # The superior method to solving complex problems is by easily consumable and scalable design, not complex code. # # The engines package consists of virtual classes and methods that define the structure of the engine modules. # # New modules are installed simply by dropping a compliant engine module...
50.277108
120
0.711718
okay with future changes in the engine breaking the functionality of the module you are developing. # worthless bullshit and its evangelical adherents are mostly just eating each others' regurgitations instead of from abc import ABCMeta from abc import abstractmethod import configparser import requests s SessionSp...
true
true
f72994670ea9e8c9d9a4c64841e352b8c6248387
64
py
Python
Conteudo das Aulas/129/filho.py
cerberus707/lab-python
ebba3c9cde873d70d4bb61084f79ce30b7f9e047
[ "Apache-2.0" ]
null
null
null
Conteudo das Aulas/129/filho.py
cerberus707/lab-python
ebba3c9cde873d70d4bb61084f79ce30b7f9e047
[ "Apache-2.0" ]
null
null
null
Conteudo das Aulas/129/filho.py
cerberus707/lab-python
ebba3c9cde873d70d4bb61084f79ce30b7f9e047
[ "Apache-2.0" ]
null
null
null
import sys, os print("Ola do filho", os.getpid(), sys.argv[1])
16
47
0.65625
import sys, os print("Ola do filho", os.getpid(), sys.argv[1])
true
true
f7299518676a99f536019b7f897b01105167f5d1
1,028
py
Python
events/templatetags/append_get.py
yellowjaguar5/lnldb
dea7708f5e4e103ef6ef968c9f3a4deaa58861c5
[ "MIT" ]
5
2017-09-25T21:24:59.000Z
2021-12-18T17:08:13.000Z
events/templatetags/append_get.py
yellowjaguar5/lnldb
dea7708f5e4e103ef6ef968c9f3a4deaa58861c5
[ "MIT" ]
304
2015-03-24T17:44:22.000Z
2022-03-29T14:09:41.000Z
events/templatetags/append_get.py
yellowjaguar5/lnldb
dea7708f5e4e103ef6ef968c9f3a4deaa58861c5
[ "MIT" ]
10
2017-10-24T02:18:12.000Z
2021-09-20T20:40:25.000Z
from django import template register = template.Library() @register.simple_tag(takes_context=True) def append_to_get(context, replace=True, **kwargs): """ Adds/deletes arguments to the current GET value and returns a querystring containing it. @argument replace: If true, any existing argument ...
28.555556
60
0.642023
from django import template register = template.Library() @register.simple_tag(takes_context=True) def append_to_get(context, replace=True, **kwargs): updated = context['request'].GET.copy() if not replace: updated.update(kwargs) else: for arg, val in kwargs.items(): ...
true
true
f7299528177ca00d16a733958ceae2e9c52189ba
35,826
py
Python
tools/ReportConverter/ReportConverter.py
siemens/drace
2679067783b1d8f39e4c370cd72a7626ebf5f8e8
[ "MIT", "MIT-0", "BSD-3-Clause" ]
32
2019-02-19T11:37:14.000Z
2022-01-07T16:09:27.000Z
tools/ReportConverter/ReportConverter.py
siemens/drace
2679067783b1d8f39e4c370cd72a7626ebf5f8e8
[ "MIT", "MIT-0", "BSD-3-Clause" ]
86
2019-03-29T08:57:37.000Z
2021-06-30T16:13:06.000Z
tools/ReportConverter/ReportConverter.py
siemens/drace
2679067783b1d8f39e4c370cd72a7626ebf5f8e8
[ "MIT", "MIT-0", "BSD-3-Clause" ]
4
2019-04-16T18:35:02.000Z
2021-06-17T16:49:48.000Z
# # ReportConverter: A graphical report generator for DRace # # Copyright 2019 Siemens AG # # Authors: # <Philip Harr> <philip.harr@siemens.com> # # SPDX-License-Identifier: MIT # ## \package ReportConverter ## \brief Python XML to HTML report converter for the better visualization of drace result data import...
40.711364
181
0.577514
sys from subprocess import check_call, STDOUT, DEVNULL from functools import lru_cache try: import matplotlib import matplotlib.pyplot as plt from matplotlib.lines import Line2D noMatplotLib = False except ImportError: noMatplotLib = True print("Matplotlib is not installed.") if ge...
true
true
f72995c0706428d76b90433f3ac5c63e2b41e814
3,104
py
Python
setup.py
PhTrempe/pytest
47200c141a78f06e5d61e183f61c41ef464283ef
[ "MIT" ]
null
null
null
setup.py
PhTrempe/pytest
47200c141a78f06e5d61e183f61c41ef464283ef
[ "MIT" ]
1
2017-12-25T20:47:50.000Z
2017-12-25T20:47:50.000Z
setup.py
PhTrempe/pytest
47200c141a78f06e5d61e183f61c41ef464283ef
[ "MIT" ]
null
null
null
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.absp...
33.73913
79
0.670103
from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() setup( name='pytest', version='0.0.0.dev1', description...
true
true
f729963a85911f0729731988270b71623a046576
8,833
py
Python
core/utils.py
jlin/inventory
c098c98e570c3bf9fadfd811eb75e1213f6ea428
[ "BSD-3-Clause" ]
22
2015-01-16T01:36:32.000Z
2020-06-08T00:46:18.000Z
core/utils.py
jlin/inventory
c098c98e570c3bf9fadfd811eb75e1213f6ea428
[ "BSD-3-Clause" ]
8
2015-12-28T18:56:19.000Z
2019-04-01T17:33:48.000Z
core/utils.py
jlin/inventory
c098c98e570c3bf9fadfd811eb75e1213f6ea428
[ "BSD-3-Clause" ]
13
2015-01-13T20:56:22.000Z
2022-02-23T06:01:17.000Z
from django.db.models import Q from django.core.exceptions import ValidationError from settings.local import people_who_need_to_know_about_failures from settings.local import inventorys_email from email.mime.text import MIMEText import ipaddr import smtplib import re import urllib # http://dev.mysql.com/doc/refman/...
28.585761
78
0.540813
from django.db.models import Q from django.core.exceptions import ValidationError from settings.local import people_who_need_to_know_about_failures from settings.local import inventorys_email from email.mime.text import MIMEText import ipaddr import smtplib import re import urllib def locked_function(lock_name, ...
false
true
f729968b5fa200fe31945c3588835dee308235ac
343
py
Python
app/forms.py
budiryan/ScholarsNet
b6a9f3830c390a4420e361752f0187d8f955acfe
[ "MIT" ]
9
2017-06-08T12:05:03.000Z
2021-11-08T12:19:46.000Z
app/forms.py
budiryan/ScholarsNet
b6a9f3830c390a4420e361752f0187d8f955acfe
[ "MIT" ]
null
null
null
app/forms.py
budiryan/ScholarsNet
b6a9f3830c390a4420e361752f0187d8f955acfe
[ "MIT" ]
null
null
null
from wtforms import Form, TextField, SelectField from wtforms.validators import DataRequired class QueryForm(Form): search_query = TextField('', validators=[DataRequired()], render_kw={"placeholder": "Your query here"}) search_category = SelectField('Search for', choices=[('pa', 'Paper / Author'), ('p', 'Pape...
42.875
116
0.705539
from wtforms import Form, TextField, SelectField from wtforms.validators import DataRequired class QueryForm(Form): search_query = TextField('', validators=[DataRequired()], render_kw={"placeholder": "Your query here"}) search_category = SelectField('Search for', choices=[('pa', 'Paper / Author'), ('p', 'Pape...
true
true
f72996a5cdda64f19e82fe2f13168ab10ac0eae9
1,161
py
Python
test/functional/rpc_deprecated.py
republic-productions/finalcoin
7c0f335ded1e5c662034c822ca2c474b8e62778f
[ "MIT" ]
null
null
null
test/functional/rpc_deprecated.py
republic-productions/finalcoin
7c0f335ded1e5c662034c822ca2c474b8e62778f
[ "MIT" ]
null
null
null
test/functional/rpc_deprecated.py
republic-productions/finalcoin
7c0f335ded1e5c662034c822ca2c474b8e62778f
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # Copyright (c) 2017-2020 The Finalcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test deprecation of RPC calls.""" from test_framework.test_framework import FinalcoinTestFramework c...
38.7
117
0.683032
from test_framework.test_framework import FinalcoinTestFramework class DeprecatedRpcTest(FinalcoinTestFramework): def set_test_params(self): self.num_nodes = 2 self.setup_clean_chain = True self.extra_args = [[], ['-deprecatedrpc=bumpfee']] def run_test(self): ...
true
true
f7299797afece536fb210770399749d1dbdaad5d
888
py
Python
phraser.py
donama/phraseengine
de35cb54268aabe44a3c538823ce2141cc1be9ea
[ "Apache-2.0" ]
null
null
null
phraser.py
donama/phraseengine
de35cb54268aabe44a3c538823ce2141cc1be9ea
[ "Apache-2.0" ]
null
null
null
phraser.py
donama/phraseengine
de35cb54268aabe44a3c538823ce2141cc1be9ea
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python """ This scripts uses the phraseengine to process and generate noun phrases from documents """ from phraseengine import PhraseEngine from phraseengine.exceptions import PhraseEngineServiceException def run_engine(document): response = {} engine = PhraseEngine() try: engine.set...
25.371429
71
0.653153
""" This scripts uses the phraseengine to process and generate noun phrases from documents """ from phraseengine import PhraseEngine from phraseengine.exceptions import PhraseEngineServiceException def run_engine(document): response = {} engine = PhraseEngine() try: engine.set_document(document) ...
false
true
f72997edfbcf28fc6d5fa7753ddb6011179db888
13,463
py
Python
samples/openapi3/client/petstore/python/petstore_api/model/parent_pet.py
JigarJoshi/openapi-generator
785535b8d6881b358463994823abbda2b26ff42e
[ "Apache-2.0" ]
1
2022-01-03T04:40:07.000Z
2022-01-03T04:40:07.000Z
samples/openapi3/client/petstore/python/petstore_api/model/parent_pet.py
JigarJoshi/openapi-generator
785535b8d6881b358463994823abbda2b26ff42e
[ "Apache-2.0" ]
28
2021-04-07T07:38:36.000Z
2022-03-31T03:10:56.000Z
samples/openapi3/client/petstore/python/petstore_api/model/parent_pet.py
JigarJoshi/openapi-generator
785535b8d6881b358463994823abbda2b26ff42e
[ "Apache-2.0" ]
2
2021-11-03T10:07:15.000Z
2021-12-17T13:00:53.000Z
""" OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ import re # noq...
42.203762
174
0.581668
import re import sys from petstore_api.model_utils import ( ApiTypeError, ModelComposed, ModelNormal, ModelSimple, cached_property, change_keys_js_to_python, convert_js_args_to_python_args, date, datetime, file_type, none_type, validate_get_composed_info, Ope...
true
true
f72997f84b0fae8cdf9d5355a151756c3d7c8425
1,530
py
Python
test/test_sqlitedriver.py
ahplummer/jutestring
2cb1dfda0152cae4c94be55587f34480518218ca
[ "MIT" ]
1
2019-05-11T20:03:44.000Z
2019-05-11T20:03:44.000Z
test/test_sqlitedriver.py
ahplummer/jutestring
2cb1dfda0152cae4c94be55587f34480518218ca
[ "MIT" ]
null
null
null
test/test_sqlitedriver.py
ahplummer/jutestring
2cb1dfda0152cae4c94be55587f34480518218ca
[ "MIT" ]
null
null
null
import pytest, sys, os myPath = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, myPath + '/../src/') from sqlitedriver import sqliteclass dbname = 'test.db' shorturl = "shortdata" longurl = "longdata" @pytest.fixture(scope='module') def resource_setup(request): print('Setting up resources for testi...
30
62
0.711765
import pytest, sys, os myPath = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, myPath + '/../src/') from sqlitedriver import sqliteclass dbname = 'test.db' shorturl = "shortdata" longurl = "longdata" @pytest.fixture(scope='module') def resource_setup(request): print('Setting up resources for testi...
true
true
f72998baf379666c230be32adf84dd43e4101c26
4,709
py
Python
ShicimingjuCrawleAndDisplay/manages.py
zuojilei/ECommerceCrawlers
b92d8c48e4cfe514ef050f78e0a32f952cfef6a6
[ "MIT" ]
null
null
null
ShicimingjuCrawleAndDisplay/manages.py
zuojilei/ECommerceCrawlers
b92d8c48e4cfe514ef050f78e0a32f952cfef6a6
[ "MIT" ]
14
2021-03-31T19:34:14.000Z
2022-03-12T00:23:00.000Z
ShicimingjuCrawleAndDisplay/manages.py
zuojilei/ECommerceCrawlers
b92d8c48e4cfe514ef050f78e0a32f952cfef6a6
[ "MIT" ]
null
null
null
# -*- coding: UTF-8 -*- __author__ = 'Joynice' import queue import re import threading import requests from faker import Faker from flask_migrate import Migrate, MigrateCommand from flask_script import Manager from lxml import etree from .app import create_app from .exts import db from .models import Poem, Poet user...
39.241667
114
0.475048
__author__ = 'Joynice' import queue import re import threading import requests from faker import Faker from flask_migrate import Migrate, MigrateCommand from flask_script import Manager from lxml import etree from .app import create_app from .exts import db from .models import Poem, Poet user_agent = Faker('zh-CN')...
true
true
f7299913712ad38823cbff706b312ff773b30c29
19,889
py
Python
manila/utils.py
redhat-openstack/manila
bef43561b303a36d99849952ba8c408b19bafd02
[ "Apache-2.0" ]
null
null
null
manila/utils.py
redhat-openstack/manila
bef43561b303a36d99849952ba8c408b19bafd02
[ "Apache-2.0" ]
null
null
null
manila/utils.py
redhat-openstack/manila
bef43561b303a36d99849952ba8c408b19bafd02
[ "Apache-2.0" ]
null
null
null
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance wi...
32.983416
79
0.622052
import contextlib import errno import inspect import os import pyclbr import random import re import shutil import socket import sys import tempfile from eventlet import pools import netaddr from oslo_concurrency import lockutils from oslo_concurrency import processutils from oslo_config import cfg f...
true
true
f7299b8c93a212f361068d4db0ea7d318b67843a
17,636
py
Python
src/models/SGNN_EBM_models.py
chao1224/SGNN-EBM
bda4c486e8ecb9775b635757dbe1071878be7b8a
[ "MIT" ]
null
null
null
src/models/SGNN_EBM_models.py
chao1224/SGNN-EBM
bda4c486e8ecb9775b635757dbe1071878be7b8a
[ "MIT" ]
1
2022-03-25T01:47:18.000Z
2022-03-25T01:50:12.000Z
src/models/SGNN_EBM_models.py
chao1224/SGNN-EBM
bda4c486e8ecb9775b635757dbe1071878be7b8a
[ "MIT" ]
null
null
null
import torch from torch import nn import torch.nn.functional as F from torch_scatter import scatter_add class NCE_C_Parameter(torch.nn.Module): def __init__(self, N): super(NCE_C_Parameter, self).__init__() self.NCE_C = nn.Parameter(torch.zeros(N, requires_grad=True)) class GNN_EBM_Layer_01(torc...
37.845494
109
0.576435
import torch from torch import nn import torch.nn.functional as F from torch_scatter import scatter_add class NCE_C_Parameter(torch.nn.Module): def __init__(self, N): super(NCE_C_Parameter, self).__init__() self.NCE_C = nn.Parameter(torch.zeros(N, requires_grad=True)) class GNN_EBM_Layer_01(torc...
true
true
f7299b9017108db2507245642f537176097512d3
3,847
py
Python
calculate_t2.py
kathoma/AutomaticKneeMRISegmentation
72ea3fa96fa5de34461b5999814aa706360f4a79
[ "Apache-2.0" ]
7
2020-12-09T05:34:06.000Z
2022-03-17T10:14:24.000Z
calculate_t2.py
kathoma/AutomaticKneeMRISegmentation
72ea3fa96fa5de34461b5999814aa706360f4a79
[ "Apache-2.0" ]
8
2021-03-31T18:03:52.000Z
2022-02-09T23:54:21.000Z
calculate_t2.py
kathoma/AutomaticKneeMRISegmentation
72ea3fa96fa5de34461b5999814aa706360f4a79
[ "Apache-2.0" ]
1
2022-02-20T16:04:55.000Z
2022-02-20T16:04:55.000Z
from __future__ import print_function, division import sys sys.path.insert(0, 'lib') import numpy as np import random import scipy.io as sio import os import pandas as pd import scipy.ndimage as ndimage import math import os import scipy.linalg as la from joblib import Parallel, delayed from scipy.optimize import curv...
35.953271
102
0.512867
from __future__ import print_function, division import sys sys.path.insert(0, 'lib') import numpy as np import random import scipy.io as sio import os import pandas as pd import scipy.ndimage as ndimage import math import os import scipy.linalg as la from joblib import Parallel, delayed from scipy.optimize import curv...
true
true
f7299c8d741309a0fb151a29fea28020d2131a61
808
py
Python
somedjango/manage.py
dvaldivia/grpc-celery-fork-bug
421eca43daef9e138d53e6f095cf470b98c14f99
[ "MIT" ]
null
null
null
somedjango/manage.py
dvaldivia/grpc-celery-fork-bug
421eca43daef9e138d53e6f095cf470b98c14f99
[ "MIT" ]
null
null
null
somedjango/manage.py
dvaldivia/grpc-celery-fork-bug
421eca43daef9e138d53e6f095cf470b98c14f99
[ "MIT" ]
1
2019-03-14T04:09:43.000Z
2019-03-14T04:09:43.000Z
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "somedjango.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure that t...
35.130435
77
0.643564
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "somedjango.settings") try: from django.core.management import execute_from_command_line except ImportError: try: import django except ImportError:...
true
true
f7299d40298fb4401be8a4ad23a730983ca934ac
14,248
py
Python
src/longbow/scsplit/command.py
broadinstitute/annmas
79da783acf41e5aaca4a14ef991c9ab0aac3c59a
[ "BSD-3-Clause" ]
null
null
null
src/longbow/scsplit/command.py
broadinstitute/annmas
79da783acf41e5aaca4a14ef991c9ab0aac3c59a
[ "BSD-3-Clause" ]
12
2021-02-02T17:16:33.000Z
2021-03-15T20:31:28.000Z
src/longbow/scsplit/command.py
broadinstitute/annmas
79da783acf41e5aaca4a14ef991c9ab0aac3c59a
[ "BSD-3-Clause" ]
null
null
null
import logging import sys import itertools import time import click import click_log import tqdm import pysam import multiprocessing as mp from inspect import getframeinfo, currentframe, getdoc from ..utils import bam_utils from ..utils.model import LibraryModel from ..annotate.command import get_segments from ....
36.162437
123
0.629913
import logging import sys import itertools import time import click import click_log import tqdm import pysam import multiprocessing as mp from inspect import getframeinfo, currentframe, getdoc from ..utils import bam_utils from ..utils.model import LibraryModel from ..annotate.command import get_segments from ....
true
true