hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
872444167ede318f2615a3163f3e50610c67b32d | 18,222 | py | Python | passglm/data.py | bccho/pass-glm | 4ad14dd043532419dc413c509672b54d1eb8d516 | [
"MIT"
] | null | null | null | passglm/data.py | bccho/pass-glm | 4ad14dd043532419dc413c509672b54d1eb8d516 | [
"MIT"
] | null | null | null | passglm/data.py | bccho/pass-glm | 4ad14dd043532419dc413c509672b54d1eb8d516 | [
"MIT"
] | null | null | null | # Authors: Jonathan Huggins <jhuggins@mit.edu>
# Trevor Campbell <tdjc@mit.edu>
from __future__ import absolute_import, print_function
import sys
import csv
import hashlib
import pickle
from warnings import warn
import numpy as np
import numpy.random as npr
import scipy.sparse as sp
import sklearn.datasets... | 32.539286 | 83 | 0.573922 | # Authors: Jonathan Huggins <jhuggins@mit.edu>
# Trevor Campbell <tdjc@mit.edu>
from __future__ import absolute_import, print_function
import sys
import csv
import hashlib
import pickle
from warnings import warn
import numpy as np
import numpy.random as npr
import scipy.sparse as sp
import sklearn.datasets... | 2,840 | 0 | 184 |
d99dd7e522294f090a9fa1d9c4391cc83cffcaf6 | 2,776 | py | Python | test_settings.py | holvi/django-waffle | 46442854e7eb76959c684037e92c4a4fb925cf0c | [
"BSD-3-Clause"
] | null | null | null | test_settings.py | holvi/django-waffle | 46442854e7eb76959c684037e92c4a4fb925cf0c | [
"BSD-3-Clause"
] | 4 | 2016-06-17T06:24:55.000Z | 2022-01-04T14:50:00.000Z | test_settings.py | holvi/django-waffle | 46442854e7eb76959c684037e92c4a4fb925cf0c | [
"BSD-3-Clause"
] | 2 | 2016-03-08T07:51:34.000Z | 2019-06-19T12:52:22.000Z | import os
import django
from distutils.version import StrictVersion
DJANGO_VERSION = StrictVersion(django.get_version())
# Make filepaths relative to settings.
ROOT = os.path.dirname(os.path.abspath(__file__))
path = lambda *a: os.path.join(ROOT, *a)
DEBUG = True
TEST_RUNNER = 'django.test.runner.DiscoverRunner'
J... | 25.009009 | 78 | 0.631484 | import os
import django
from distutils.version import StrictVersion
DJANGO_VERSION = StrictVersion(django.get_version())
# Make filepaths relative to settings.
ROOT = os.path.dirname(os.path.abspath(__file__))
path = lambda *a: os.path.join(ROOT, *a)
DEBUG = True
TEST_RUNNER = 'django.test.runner.DiscoverRunner'
J... | 0 | 0 | 0 |
edac1439062883480f7c1b6aaac384f6716d8bc2 | 2,443 | py | Python | apphub/image_classification/lenet_mnist/tensorflow/lenet_mnist.py | vbvg2008/fastestimator-future | dbf7d597d1f97140f837345f6b06f1773d4fa299 | [
"Apache-1.1"
] | null | null | null | apphub/image_classification/lenet_mnist/tensorflow/lenet_mnist.py | vbvg2008/fastestimator-future | dbf7d597d1f97140f837345f6b06f1773d4fa299 | [
"Apache-1.1"
] | null | null | null | apphub/image_classification/lenet_mnist/tensorflow/lenet_mnist.py | vbvg2008/fastestimator-future | dbf7d597d1f97140f837345f6b06f1773d4fa299 | [
"Apache-1.1"
] | null | null | null | """This example showcase FastEstimator usage for tensorflow users. In this file, we use tf.dataset as data input.
"""
import numpy as np
import tensorflow as tf
from tensorflow.python.keras import Sequential, layers
import fastestimator as fe
from fastestimator.op.tensorop.loss import CrossEntropy
from fastestimator.o... | 35.405797 | 115 | 0.639787 | """This example showcase FastEstimator usage for tensorflow users. In this file, we use tf.dataset as data input.
"""
import numpy as np
import tensorflow as tf
from tensorflow.python.keras import Sequential, layers
import fastestimator as fe
from fastestimator.op.tensorop.loss import CrossEntropy
from fastestimator.o... | 1,875 | 0 | 92 |
8264cd116ef797f808fc0878529023592ab0d01d | 1,267 | py | Python | CalliopeAPI/decode_labels.py | RoZvEr/Calliope | 4ef5a71f0d2788508d6fef00ee98932e27b85105 | [
"MIT"
] | 1 | 2020-06-11T11:02:03.000Z | 2020-06-11T11:02:03.000Z | CalliopeAPI/decode_labels.py | RoZvEr/Calliope | 4ef5a71f0d2788508d6fef00ee98932e27b85105 | [
"MIT"
] | null | null | null | CalliopeAPI/decode_labels.py | RoZvEr/Calliope | 4ef5a71f0d2788508d6fef00ee98932e27b85105 | [
"MIT"
] | 1 | 2020-10-12T06:25:42.000Z | 2020-10-12T06:25:42.000Z | from tensorflow.keras.applications import InceptionV3
from tensorflow.keras.applications.imagenet_utils import preprocess_input, decode_predictions
import numpy as np
from tensorflow import keras
from matplotlib import pyplot as plt
from tensorflow.keras.preprocessing import image
from tensorflow.keras import Input
fro... | 28.795455 | 93 | 0.764799 | from tensorflow.keras.applications import InceptionV3
from tensorflow.keras.applications.imagenet_utils import preprocess_input, decode_predictions
import numpy as np
from tensorflow import keras
from matplotlib import pyplot as plt
from tensorflow.keras.preprocessing import image
from tensorflow.keras import Input
fro... | 77 | 0 | 23 |
a6e51f3033941c14b71a08068bf7b30507da8fc4 | 695 | py | Python | docker/random_secret.py | davewalker5/NatureRecorderPy | 53b3c2a589986f91bc78999f40a6dc55f61afe36 | [
"MIT"
] | null | null | null | docker/random_secret.py | davewalker5/NatureRecorderPy | 53b3c2a589986f91bc78999f40a6dc55f61afe36 | [
"MIT"
] | null | null | null | docker/random_secret.py | davewalker5/NatureRecorderPy | 53b3c2a589986f91bc78999f40a6dc55f61afe36 | [
"MIT"
] | null | null | null | import os
import sys
def get_project_path():
"""
Return the path to the project root folder
:return: The path to the project root folder
"""
return os.path.dirname(os.path.dirname(__file__))
def set_web_app_secret():
"""
Replace the secret key in the web application Python source file
... | 21.060606 | 68 | 0.6 | import os
import sys
def get_project_path():
"""
Return the path to the project root folder
:return: The path to the project root folder
"""
return os.path.dirname(os.path.dirname(__file__))
def set_web_app_secret():
"""
Replace the secret key in the web application Python source file
... | 0 | 0 | 0 |
6229ff03ea610788af9d49dae4964428e3f65918 | 2,978 | py | Python | resources/lib/service.py | fatshotty/kodi.simple.vocal.service | a4676b8df403034481c7d02ee927b64e63d0ea42 | [
"Apache-2.0"
] | null | null | null | resources/lib/service.py | fatshotty/kodi.simple.vocal.service | a4676b8df403034481c7d02ee927b64e63d0ea42 | [
"Apache-2.0"
] | null | null | null | resources/lib/service.py | fatshotty/kodi.simple.vocal.service | a4676b8df403034481c7d02ee927b64e63d0ea42 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from resources.lib import kodiutils
from resources.lib import kodilogging
from resources.lib.messenger.socketclient import SockClient as SocketClient
import logging
import time
import xbmc
import xbmcaddon
from resources.lib.actions import execute
ADDON = xbmcaddon.Addon()
logg... | 30.387755 | 157 | 0.658496 | # -*- coding: utf-8 -*-
from resources.lib import kodiutils
from resources.lib import kodilogging
from resources.lib.messenger.socketclient import SockClient as SocketClient
import logging
import time
import xbmc
import xbmcaddon
from resources.lib.actions import execute
ADDON = xbmcaddon.Addon()
logg... | 2,448 | 0 | 150 |
cdf2573b00d17bc3a744d21d10c588b5f6b6c208 | 3,999 | py | Python | player.py | Ming-desu/POKEMING | 2def3b47e7c08b71885f14944bffe105a63cc12a | [
"MIT"
] | null | null | null | player.py | Ming-desu/POKEMING | 2def3b47e7c08b71885f14944bffe105a63cc12a | [
"MIT"
] | null | null | null | player.py | Ming-desu/POKEMING | 2def3b47e7c08b71885f14944bffe105a63cc12a | [
"MIT"
] | null | null | null | import random
from inventory import Inventory
from skill import Skill
from utility import Utility
# POKEMING - GON'NA CATCH 'EM ALL
# -- A simple hack 'n slash game in console
# -- This class is handles all player related things
# Default Constructor
# This prints the player's current stats
#... | 41.226804 | 132 | 0.615904 | import random
from inventory import Inventory
from skill import Skill
from utility import Utility
# POKEMING - GON'NA CATCH 'EM ALL
# -- A simple hack 'n slash game in console
# -- This class is handles all player related things
class Player:
# Default Constructor
def __init__(self):
# Publi... | 2,653 | -8 | 265 |
f67bf9264ba8ea478956a636d641726ab2253966 | 1,932 | py | Python | client demo/python/client.py | ConanYu/CrawlService | 35af986f7d7360f2e7a6bdc02c2836e3c7cb4094 | [
"MIT"
] | 1 | 2021-10-19T01:14:19.000Z | 2021-10-19T01:14:19.000Z | client demo/python/client.py | ConanYu/CrawlService | 35af986f7d7360f2e7a6bdc02c2836e3c7cb4094 | [
"MIT"
] | 1 | 2022-03-04T04:17:13.000Z | 2022-03-04T04:17:13.000Z | client demo/python/client.py | ConanYu/CrawlService | 35af986f7d7360f2e7a6bdc02c2836e3c7cb4094 | [
"MIT"
] | 1 | 2021-06-05T09:17:10.000Z | 2021-06-05T09:17:10.000Z | import time
import grpc
import threading
from crawl_service import crawl_service_pb2
from crawl_service import crawl_service_pb2_grpc
if __name__ == '__main__':
start_new_thread(f, 'codeforces', 'ConanYu')
start_new_thread(f, 'codeforces', 'ConanYu')
start_new_thread(f, 'codeforces', 'ConanYu')
st... | 30.666667 | 86 | 0.659938 | import time
import grpc
import threading
from crawl_service import crawl_service_pb2
from crawl_service import crawl_service_pb2_grpc
def start_new_thread(func, *args, **kwargs):
class MyThead(threading.Thread):
def __init__(self):
super().__init__()
self.setDaemon(False)
... | 1,171 | 0 | 92 |
71f51f6bfca2916922e19760b83e5bc05244f4b1 | 465 | py | Python | dftparse/wien2k/scf2_parser.py | CitrineInformatics/dft-parser | 539fbdafe4d6c6c6aa2434fdf93206d012f75dfc | [
"Apache-2.0"
] | 1 | 2021-04-10T13:09:30.000Z | 2021-04-10T13:09:30.000Z | dftparse/wien2k/scf2_parser.py | CitrineInformatics/dft-parser | 539fbdafe4d6c6c6aa2434fdf93206d012f75dfc | [
"Apache-2.0"
] | 1 | 2021-01-16T01:05:30.000Z | 2021-01-16T01:05:30.000Z | dftparse/wien2k/scf2_parser.py | CitrineInformatics/dft-parser | 539fbdafe4d6c6c6aa2434fdf93206d012f75dfc | [
"Apache-2.0"
] | null | null | null | from ..core import BlockParser
base_rules = [
(lambda x: ":GAP (global)" in x, _parse_bandgap)
]
class Scf2Parser(BlockParser):
"""Parser for Wien2k's .scf2 file"""
| 19.375 | 52 | 0.608602 | from ..core import BlockParser
def _parse_bandgap(line, lines):
bandgap = float(line.split()[6])
return {
'band gap': bandgap,
'band gap units': "eV"
}
base_rules = [
(lambda x: ":GAP (global)" in x, _parse_bandgap)
]
class Scf2Parser(BlockParser):
"""Parser for Wien2k's .scf2 ... | 237 | 0 | 50 |
6956e46dc35096b15353d8f7265d6a463913c523 | 157 | py | Python | pdtimeout/__init__.py | hugo-quantmetry/pandas-timeout | bc7e94afa1e533b7cd1472f455587436fea30855 | [
"Apache-2.0"
] | 2 | 2019-11-11T17:51:59.000Z | 2021-03-26T10:00:43.000Z | pdtimeout/__init__.py | hugo-quantmetry/pandas-timeout | bc7e94afa1e533b7cd1472f455587436fea30855 | [
"Apache-2.0"
] | null | null | null | pdtimeout/__init__.py | hugo-quantmetry/pandas-timeout | bc7e94afa1e533b7cd1472f455587436fea30855 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Top-level package for pdtimeout."""
__author__ = """Hugo Perrier"""
__email__ = 'hperrier@quantmetry.com'
__version__ = '0.1.0'
| 19.625 | 38 | 0.649682 | # -*- coding: utf-8 -*-
"""Top-level package for pdtimeout."""
__author__ = """Hugo Perrier"""
__email__ = 'hperrier@quantmetry.com'
__version__ = '0.1.0'
| 0 | 0 | 0 |
2c1c949ef37005780640391e2f7ed9a5ed3c4b38 | 6,015 | py | Python | lib/modules/SQLMapInjector/__init__.py | mukeran/dinlas | bab6149fd69f3c12fd67ad03281b59182054fad6 | [
"MIT"
] | 2 | 2019-11-28T09:59:34.000Z | 2019-12-10T05:29:00.000Z | lib/modules/SQLMapInjector/__init__.py | mukeran/dinlas | bab6149fd69f3c12fd67ad03281b59182054fad6 | [
"MIT"
] | null | null | null | lib/modules/SQLMapInjector/__init__.py | mukeran/dinlas | bab6149fd69f3c12fd67ad03281b59182054fad6 | [
"MIT"
] | null | null | null | # coding:utf-8
import time
from urllib import parse
import logging
from .SQLMap import SQLMap, CONTENT_STATUS, CONTENT_TYPE
DEFAULT_LEVEL = 1
| 38.557692 | 117 | 0.510557 | # coding:utf-8
import time
from urllib import parse
import logging
from .SQLMap import SQLMap, CONTENT_STATUS, CONTENT_TYPE
DEFAULT_LEVEL = 1
class SQLMapInjector:
def __init__(self, results, reports, **kwargs):
report = {'title': 'SQL Injection',
'overview': 'SQL injection vulnerabil... | 4,840 | 1,006 | 23 |
8725538a4a9284d4995693fbf51f7fae28d0ee58 | 1,920 | py | Python | models/hofm.py | nusdbsystem/ARM-Net | cafda2654b67ec51aeb8834d1995711f918db811 | [
"Apache-2.0"
] | 42 | 2021-06-30T12:36:43.000Z | 2022-03-22T17:14:05.000Z | models/hofm.py | nusdbsystem/ARM-Net | cafda2654b67ec51aeb8834d1995711f918db811 | [
"Apache-2.0"
] | null | null | null | models/hofm.py | nusdbsystem/ARM-Net | cafda2654b67ec51aeb8834d1995711f918db811 | [
"Apache-2.0"
] | 9 | 2021-07-01T07:40:50.000Z | 2022-03-21T09:18:10.000Z | import torch
from models.layers import Embedding, Linear, FactorizationMachine
class HOFMModel(torch.nn.Module):
"""
Model: Higher-Order Factorization Machines
Ref: M Blondel, et al. Higher-Order Factorization Machines, 2016.
"""
def forward(self, x):
"""
:param x: {'ids': Lo... | 35.555556 | 82 | 0.526563 | import torch
from models.layers import Embedding, Linear, FactorizationMachine
class AnovaKernel(torch.nn.Module):
def __init__(self, order):
super().__init__()
self.order = order
def forward(self, x):
"""
:param x: FloatTensor B*F*E
"""
bsz, nfiled, nemb = x.s... | 506 | 575 | 50 |
97f49bfaccfe12bd9aa576beff581a747854924c | 544 | py | Python | 1348A Phoenix and Balance.py | YasirAhmad-EccentriX/CodeForces | d004b4d1b52a360ac6c06870e0a237345771e32c | [
"MIT"
] | 1 | 2021-01-29T16:30:09.000Z | 2021-01-29T16:30:09.000Z | 1348A Phoenix and Balance.py | YasirAhmad-EccentriX/CodeForces | d004b4d1b52a360ac6c06870e0a237345771e32c | [
"MIT"
] | null | null | null | 1348A Phoenix and Balance.py | YasirAhmad-EccentriX/CodeForces | d004b4d1b52a360ac6c06870e0a237345771e32c | [
"MIT"
] | null | null | null | for _ in range(int(input())):
n=int(input())
L=[2**(i+1) for i in range(n)] #I want an extra 1 @l[0] to make it less
w=[0,0]
L=[2**(i+1) for i in range(n)]
L[n//2 -1],L[-1]=L[-1],L[n//2 -1]
for i in range(n):
if i<(n//2):
w[0]+=L[i]
else:
w[1]+=... | 25.904762 | 76 | 0.420956 | for _ in range(int(input())):
n=int(input())
L=[2**(i+1) for i in range(n)] #I want an extra 1 @l[0] to make it less
w=[0,0]
L=[2**(i+1) for i in range(n)]
L[n//2 -1],L[-1]=L[-1],L[n//2 -1]
for i in range(n):
if i<(n//2):
w[0]+=L[i]
else:
w[1]+=... | 0 | 0 | 0 |
27ab4f6c00384f70c7dbad3e059681c17765dd37 | 6,649 | py | Python | util/angular_generator.py | mohrobati/react2angular | 2d73b0a6582f5bf8eef7b887c92e13a471eef125 | [
"MIT"
] | null | null | null | util/angular_generator.py | mohrobati/react2angular | 2d73b0a6582f5bf8eef7b887c92e13a471eef125 | [
"MIT"
] | null | null | null | util/angular_generator.py | mohrobati/react2angular | 2d73b0a6582f5bf8eef7b887c92e13a471eef125 | [
"MIT"
] | null | null | null | import esprima
import glob
import os
from copy import deepcopy
| 48.532847 | 140 | 0.575425 | import esprima
import glob
import os
from copy import deepcopy
class AngularGenerator:
def __init__(self):
self.appModuleHeader = """import { NgModule } from '@angular/core';\nimport { BrowserModule } from '@angular/platform-browser';\n"""
self.appModuleFooter = """
],
imports: [
... | 6,344 | 2 | 239 |
bb37d42cef6fca003899ed07db9ebc425625699d | 849 | py | Python | arekit/common/folding/nofold.py | nicolay-r/AREk | 19c39ec0dc9a17464cade03b9c4da0c6d1d21191 | [
"MIT"
] | 18 | 2019-12-14T18:43:11.000Z | 2022-03-21T05:55:36.000Z | arekit/common/folding/nofold.py | nicolay-r/AREk | 19c39ec0dc9a17464cade03b9c4da0c6d1d21191 | [
"MIT"
] | 284 | 2020-08-08T20:52:44.000Z | 2022-03-31T05:26:20.000Z | arekit/common/folding/nofold.py | nicolay-r/AREk | 19c39ec0dc9a17464cade03b9c4da0c6d1d21191 | [
"MIT"
] | 1 | 2021-08-07T13:17:43.000Z | 2021-08-07T13:17:43.000Z | from arekit.common.folding.base import BaseDataFolding
class NoFolding(BaseDataFolding):
""" The case of absent folding in experiment.
"""
@property
def get_current_state(self):
""" Returns in order to be compatible with cv-based experiment format.
"""
return "0"
| 30.321429 | 102 | 0.652532 | from arekit.common.folding.base import BaseDataFolding
class NoFolding(BaseDataFolding):
""" The case of absent folding in experiment.
"""
def __init__(self, doc_ids_to_fold, supported_data_types):
if len(supported_data_types) > 1:
raise NotImplementedError("Experiments with such amou... | 461 | 0 | 80 |
17a8f2bfba5059763f22ff7512e75cf2117b306d | 1,176 | py | Python | pushpy_examples/client/web/c_module.py | briangu/push-examples | 3acf00d9f63523010ee3b70f3117d1be686c3335 | [
"MIT"
] | null | null | null | pushpy_examples/client/web/c_module.py | briangu/push-examples | 3acf00d9f63523010ee3b70f3117d1be686c3335 | [
"MIT"
] | null | null | null | pushpy_examples/client/web/c_module.py | briangu/push-examples | 3acf00d9f63523010ee3b70f3117d1be686c3335 | [
"MIT"
] | null | null | null | import tornado.web
from pushpy_examples.client.ex_push_manager import ExamplePushManager
from client.simple_interpreter import Interpreter, Adder, Multiplier
m = ExamplePushManager()
m.connect()
repl_code_store = m.repl_code_store()
repl_code_store.update({
"interpreter.Interpreter": Interpreter,
"interpret... | 30.153846 | 109 | 0.684524 | import tornado.web
from pushpy_examples.client.ex_push_manager import ExamplePushManager
from client.simple_interpreter import Interpreter, Adder, Multiplier
m = ExamplePushManager()
m.connect()
repl_code_store = m.repl_code_store()
repl_code_store.update({
"interpreter.Interpreter": Interpreter,
"interpret... | 529 | 25 | 48 |
c01980284e1fbdf9e095dced754b4ee3129e556e | 6,427 | py | Python | scheduler-bot.py | alexdiem/odp-scheduler | 440ce83d5b2416722218aff265df1e49aba3a714 | [
"MIT"
] | null | null | null | scheduler-bot.py | alexdiem/odp-scheduler | 440ce83d5b2416722218aff265df1e49aba3a714 | [
"MIT"
] | null | null | null | scheduler-bot.py | alexdiem/odp-scheduler | 440ce83d5b2416722218aff265df1e49aba3a714 | [
"MIT"
] | null | null | null | import json
import logger
import os
import random
from datetime import date
from dotenv import load_dotenv
from sys import exit
import discord
from discord.ext import commands, tasks
from discord.utils import get
log = logger.setup_applevel_logger(file_name = 'app_debug.log')
load_dotenv()
TOKEN = os.getenv('DISC... | 27.702586 | 87 | 0.641046 | import json
import logger
import os
import random
from datetime import date
from dotenv import load_dotenv
from sys import exit
import discord
from discord.ext import commands, tasks
from discord.utils import get
log = logger.setup_applevel_logger(file_name = 'app_debug.log')
load_dotenv()
TOKEN = os.getenv('DISC... | 0 | 0 | 0 |
6a9980ccddb6716529146982c0896ecad8ea967a | 4,833 | py | Python | aperturedb/ImageDownloader.py | aperture-data/aperturedb-python | 186ae09a474df8e2d90ecdc7ba81e81879cef3ea | [
"Apache-2.0"
] | 1 | 2022-01-12T17:46:20.000Z | 2022-01-12T17:46:20.000Z | aperturedb/ImageDownloader.py | aperture-data/aperturedb-python | 186ae09a474df8e2d90ecdc7ba81e81879cef3ea | [
"Apache-2.0"
] | 11 | 2021-07-14T16:54:05.000Z | 2022-03-30T14:34:34.000Z | aperturedb/ImageDownloader.py | aperture-data/aperturedb-python | 186ae09a474df8e2d90ecdc7ba81e81879cef3ea | [
"Apache-2.0"
] | null | null | null | import time
import requests
import os
from os import path
import cv2
import numpy as np
from aperturedb import ParallelLoader
from aperturedb import CSVParser
from aperturedb import ProgressBar
HEADER_PATH = "filename"
HEADER_URL = "url"
class ImageDownloaderCSV(CSVParser.CSVParser):
'''
ApertureDB Im... | 27.617143 | 93 | 0.564039 | import time
import requests
import os
from os import path
import cv2
import numpy as np
from aperturedb import ParallelLoader
from aperturedb import CSVParser
from aperturedb import ProgressBar
HEADER_PATH = "filename"
HEADER_URL = "url"
class ImageDownloaderCSV(CSVParser.CSVParser):
'''
ApertureDB Im... | 4,026 | 32 | 266 |
5e2b0bf1820fcac8822e91fbca28bbd5f5522477 | 2,541 | py | Python | tests/test_spawner/test_env_vars.py | gzcf/polyaxon | 77ac8838c6444a36541e6c28aba7ae42de392fee | [
"MIT"
] | null | null | null | tests/test_spawner/test_env_vars.py | gzcf/polyaxon | 77ac8838c6444a36541e6c28aba7ae42de392fee | [
"MIT"
] | null | null | null | tests/test_spawner/test_env_vars.py | gzcf/polyaxon | 77ac8838c6444a36541e6c28aba7ae42de392fee | [
"MIT"
] | null | null | null | from unittest import TestCase
from unittest.mock import MagicMock
import pytest
from kubernetes import client
from libs.api import API_KEY_NAME
from scheduler.spawners.templates.env_vars import (
get_env_var,
get_from_app_secret,
get_resources_env_vars,
get_service_env_vars
)
@pytest.mark.spawner_m... | 36.826087 | 81 | 0.653286 | from unittest import TestCase
from unittest.mock import MagicMock
import pytest
from kubernetes import client
from libs.api import API_KEY_NAME
from scheduler.spawners.templates.env_vars import (
get_env_var,
get_from_app_secret,
get_resources_env_vars,
get_service_env_vars
)
@pytest.mark.spawner_m... | 2,081 | 7 | 129 |
21747df07c549e19382c22288039d178658f37f2 | 656 | py | Python | artssat/utils/plots.py | simonpf/pARTS | b4d9f4c2ceac594273c5589e44fe6a3a4f8d7028 | [
"MIT"
] | 3 | 2020-09-02T08:20:42.000Z | 2020-12-18T17:19:38.000Z | artssat/utils/plots.py | simonpf/pARTS | b4d9f4c2ceac594273c5589e44fe6a3a4f8d7028 | [
"MIT"
] | null | null | null | artssat/utils/plots.py | simonpf/pARTS | b4d9f4c2ceac594273c5589e44fe6a3a4f8d7028 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
sns.reset_orig()
| 25.230769 | 66 | 0.53811 | import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
sns.reset_orig()
def plot_psds(x, y, z, dz = None, chs = 0, ax = None):
if ax is None:
ax = plt.gca()
n = y.shape[1]
pal = sns.cubehelix_palette(n, start = chs)
if dz is None:
dz = np.diff(z).mean() / 8.0
... | 543 | 0 | 23 |
12d931fb7f1b8dc76f52075e42fed7c7e04ddcf6 | 1,601 | py | Python | custom_components/xplora_watch/entity.py | Ludy87/xplora_watch | 85050d1bec061d7e6d11dd63e36fbddb296a0c12 | [
"MIT"
] | 7 | 2022-01-17T10:07:44.000Z | 2022-03-29T17:33:23.000Z | custom_components/xplora_watch/entity.py | Ludy87/xplora_watch | 85050d1bec061d7e6d11dd63e36fbddb296a0c12 | [
"MIT"
] | 17 | 2022-01-14T13:22:06.000Z | 2022-03-31T15:43:23.000Z | custom_components/xplora_watch/entity.py | Ludy87/xplora_watch | 85050d1bec061d7e6d11dd63e36fbddb296a0c12 | [
"MIT"
] | 4 | 2022-01-16T08:46:42.000Z | 2022-02-04T12:29:07.000Z | """Entity Xplora® Watch."""
from __future__ import annotations
import logging
from datetime import timedelta
from typing import Any, Dict
from homeassistant.components.switch import SwitchEntity
from homeassistant.helpers.restore_state import RestoreEntity
from .helper import XploraUpdateTime
from pyxplora_api imp... | 29.648148 | 72 | 0.637726 | """Entity Xplora® Watch."""
from __future__ import annotations
import logging
from datetime import timedelta
from typing import Any, Dict
from homeassistant.components.switch import SwitchEntity
from homeassistant.helpers.restore_state import RestoreEntity
from .helper import XploraUpdateTime
from pyxplora_api imp... | 670 | 518 | 23 |
d4b4eb82d35cd281ad2c2012dc1cb465e3c69183 | 14,389 | py | Python | tests/apptrace/events_test.py | gaocegege/treadmill | 04325d319c0ee912c066f07b88b674e84485f154 | [
"Apache-2.0"
] | 2 | 2017-03-20T07:13:33.000Z | 2017-05-03T03:39:53.000Z | tests/apptrace/events_test.py | gaocegege/treadmill | 04325d319c0ee912c066f07b88b674e84485f154 | [
"Apache-2.0"
] | 12 | 2017-07-10T07:04:06.000Z | 2017-07-26T09:32:54.000Z | tests/apptrace/events_test.py | gaocegege/treadmill | 04325d319c0ee912c066f07b88b674e84485f154 | [
"Apache-2.0"
] | 2 | 2017-05-04T11:25:32.000Z | 2017-07-11T09:10:01.000Z | """
Unit test for Treadmill apptrace events module.
"""
import unittest
import mock
from treadmill.apptrace import events
class AppTraceEventsTest(unittest.TestCase):
"""Test all event classes operations.
"""
@mock.patch('treadmill.apptrace.events.AbortedTraceEvent.from_data',
mock.Moc... | 28.493069 | 75 | 0.420738 | """
Unit test for Treadmill apptrace events module.
"""
import unittest
import mock
from treadmill.apptrace import events
class AppTraceEventsTest(unittest.TestCase):
"""Test all event classes operations.
"""
@mock.patch('treadmill.apptrace.events.AbortedTraceEvent.from_data',
mock.Moc... | 0 | 0 | 0 |
8afd7dfb3a0429d776c6f9286411c593352a5aeb | 1,382 | py | Python | texext/tests/test_custom_plotdirective.py | ddeka2910/texext | 2e99f513b188468c9ec356a0ea1fe0622c5caab2 | [
"BSD-2-Clause"
] | 4 | 2015-10-10T05:12:58.000Z | 2020-06-26T11:54:34.000Z | texext/tests/test_custom_plotdirective.py | ddeka2910/texext | 2e99f513b188468c9ec356a0ea1fe0622c5caab2 | [
"BSD-2-Clause"
] | 10 | 2018-04-16T23:06:04.000Z | 2021-02-19T23:53:56.000Z | texext/tests/test_custom_plotdirective.py | ddeka2910/texext | 2e99f513b188468c9ec356a0ea1fe0622c5caab2 | [
"BSD-2-Clause"
] | 5 | 2019-10-23T21:14:31.000Z | 2020-12-11T16:11:16.000Z | """ Tests for plotdirective build using sphinx extensions
Test ability to combine plot_directive with mathcode
"""
from os.path import dirname, join as pjoin
import re
import sphinx
SPHINX_1p8 = sphinx.version_info[:2] >= (1, 8)
from sphinxtesters import PageBuilder
from texext.tests.test_plotdirective import EXP_... | 30.043478 | 74 | 0.692475 | """ Tests for plotdirective build using sphinx extensions
Test ability to combine plot_directive with mathcode
"""
from os.path import dirname, join as pjoin
import re
import sphinx
SPHINX_1p8 = sphinx.version_info[:2] >= (1, 8)
from sphinxtesters import PageBuilder
from texext.tests.test_plotdirective import EXP_... | 787 | 186 | 23 |
8d2a862b1850a0c56f325abe1d1cac2277162762 | 800 | py | Python | src/sprites/grouping.py | mgear2/undervoid | 6c91a5786d29d766223831190952fd90ddc6a1e8 | [
"MIT"
] | 1 | 2020-08-29T06:41:03.000Z | 2020-08-29T06:41:03.000Z | src/sprites/grouping.py | mgear2/undervoid | 6c91a5786d29d766223831190952fd90ddc6a1e8 | [
"MIT"
] | 10 | 2019-07-15T05:15:38.000Z | 2020-11-25T03:14:03.000Z | src/sprites/grouping.py | mgear2/undervoid | 6c91a5786d29d766223831190952fd90ddc6a1e8 | [
"MIT"
] | 1 | 2020-11-22T08:25:26.000Z | 2020-11-22T08:25:26.000Z | # Copyright (c) 2020
# [This program is licensed under the "MIT License"]
# Please see the file LICENSE in the source
# distribution of this software for license terms.
import pygame as pg
| 33.333333 | 53 | 0.64875 | # Copyright (c) 2020
# [This program is licensed under the "MIT License"]
# Please see the file LICENSE in the source
# distribution of this software for license terms.
import pygame as pg
class Grouping:
def __init__(self):
self.all_sprites = pg.sprite.LayeredUpdates()
self.legs_sprite = pg.spri... | 566 | -6 | 49 |
99b51af7c93df2be5b309b548a2ceb77eedf5aaa | 2,090 | py | Python | aroma/tests/test_features.py | matthewcarlucci/aroma | 51664dcc01caef42124e11bc3c334078fed749a3 | [
"Apache-2.0"
] | 5 | 2021-08-31T17:36:59.000Z | 2021-12-13T04:51:56.000Z | aroma/tests/test_features.py | matthewcarlucci/aroma | 51664dcc01caef42124e11bc3c334078fed749a3 | [
"Apache-2.0"
] | 33 | 2020-11-10T15:50:41.000Z | 2021-01-15T17:10:46.000Z | aroma/tests/test_features.py | matthewcarlucci/aroma | 51664dcc01caef42124e11bc3c334078fed749a3 | [
"Apache-2.0"
] | 6 | 2021-02-09T22:39:43.000Z | 2021-12-08T15:13:17.000Z | """Tests for the features module."""
import numpy as np
from aroma import features
def test_feature_time_series(mel_mix, mc, max_correls):
"""Test the feature_time_series feature against pre-calculated values."""
np.random.seed(1)
# Read mel_mix
mel_mix = np.loadtxt(mel_mix)
# Run feature_time_s... | 27.866667 | 88 | 0.709569 | """Tests for the features module."""
import numpy as np
from aroma import features
def test_feature_time_series(mel_mix, mc, max_correls):
"""Test the feature_time_series feature against pre-calculated values."""
np.random.seed(1)
# Read mel_mix
mel_mix = np.loadtxt(mel_mix)
# Run feature_time_s... | 0 | 0 | 0 |
10267abea5abb4d14f2499ec05f13ead7e1b752b | 8,263 | py | Python | tests/animations/test_spinners.py | jhonatan-lopes/alive-progress | 3c5cc00e8b29e1813480292a2f5bb2d6414f2932 | [
"MIT"
] | 1 | 2022-02-09T08:20:50.000Z | 2022-02-09T08:20:50.000Z | tests/animations/test_spinners.py | DanteRARA/alive-progress | 8a9d246787a8c65b2bf1722a5ab30eddfb5c8d33 | [
"MIT"
] | null | null | null | tests/animations/test_spinners.py | DanteRARA/alive-progress | 8a9d246787a8c65b2bf1722a5ab30eddfb5c8d33 | [
"MIT"
] | null | null | null | import pytest
from alive_progress.animations.spinners import alongside_spinner_factory, \
bouncing_spinner_factory, delayed_spinner_factory, frame_spinner_factory, \
scrolling_spinner_factory, sequential_spinner_factory
from alive_progress.utils.cells import join_cells
@pytest.mark.parametrize('frames, expec... | 54.361842 | 95 | 0.471863 | import pytest
from alive_progress.animations.spinners import alongside_spinner_factory, \
bouncing_spinner_factory, delayed_spinner_factory, frame_spinner_factory, \
scrolling_spinner_factory, sequential_spinner_factory
from alive_progress.utils.cells import join_cells
@pytest.mark.parametrize('frames, expec... | 2,644 | 0 | 198 |
9501241ca2ec8a93143bf2872026829d759bcb38 | 4,938 | py | Python | static/jmeter/libs/zpjUtils.py | huqiliang/yapi | 775205457c5ef92531f3b3fd7480ad62a1746f52 | [
"Apache-2.0"
] | null | null | null | static/jmeter/libs/zpjUtils.py | huqiliang/yapi | 775205457c5ef92531f3b3fd7480ad62a1746f52 | [
"Apache-2.0"
] | null | null | null | static/jmeter/libs/zpjUtils.py | huqiliang/yapi | 775205457c5ef92531f3b3fd7480ad62a1746f52 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import logging
import datetime
import smtplib
import os
import subprocess
class ZpjUtils(object):
'''
一个工具类
'''
def __init__(self):
'''
Constructor
'''
begin_work_time = datetime.datetime.now()
smtp = None
... | 33.821918 | 133 | 0.518631 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import logging
import datetime
import smtplib
import os
import subprocess
class ZpjUtils(object):
'''
一个工具类
'''
def __init__(self):
'''
Constructor
'''
begin_work_time = datetime.datetime.now()
smtp = None
... | 4,285 | 0 | 228 |
04223732d716dc0152494f443b0133702feca9d3 | 1,133 | py | Python | scriptable/ast/expression/concat_expression.py | c7nw3r/scriptable | b285d865da41774c8321ebf51f5a468ef1c92402 | [
"Apache-2.0"
] | null | null | null | scriptable/ast/expression/concat_expression.py | c7nw3r/scriptable | b285d865da41774c8321ebf51f5a468ef1c92402 | [
"Apache-2.0"
] | null | null | null | scriptable/ast/expression/concat_expression.py | c7nw3r/scriptable | b285d865da41774c8321ebf51f5a468ef1c92402 | [
"Apache-2.0"
] | null | null | null | from typing import Union, List
from scriptable.api import AST
from scriptable.api.ast_binding import ASTBinding
DataType = Union[int, float]
| 29.815789 | 86 | 0.630185 | from typing import Union, List
from scriptable.api import AST
from scriptable.api.ast_binding import ASTBinding
DataType = Union[int, float]
class ConcatExpression(AST[str]):
def __init__(self, branch: List[AST]):
self.operand_stack = [branch[x] for x in range(0, len(branch), 2)]
self.operator_s... | 829 | 137 | 23 |
f3e306054f7264645b0dd28832dc9b6f41c24dd9 | 1,604 | py | Python | goal_tracker/__init__.py | kaloyan-marinov/goal-tracker | 91dbdfab44912c3690f71d0fac197864c56bcce2 | [
"MIT"
] | null | null | null | goal_tracker/__init__.py | kaloyan-marinov/goal-tracker | 91dbdfab44912c3690f71d0fac197864c56bcce2 | [
"MIT"
] | null | null | null | goal_tracker/__init__.py | kaloyan-marinov/goal-tracker | 91dbdfab44912c3690f71d0fac197864c56bcce2 | [
"MIT"
] | null | null | null | import os
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from config import config
# Create instances of necessary Flask extensions.
db = SQLAlchemy()
migrate = Migrate()
# Import the models s... | 30.846154 | 93 | 0.743142 | import os
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from config import config
# Create instances of necessary Flask extensions.
db = SQLAlchemy()
migrate = Migrate()
# Import the models s... | 1,184 | 0 | 23 |
a5eee884f0ad6b513aab63d677e2f3fb20324a62 | 3,576 | py | Python | testing/components/functions/function_evaluation_test.py | JeremiasKnoblauch/MXFusion | af6223e9636b055d029d136dd7ae023b210b4560 | [
"Apache-2.0"
] | 2 | 2019-05-31T09:50:47.000Z | 2021-03-06T09:38:47.000Z | testing/components/functions/function_evaluation_test.py | JeremiasKnoblauch/MXFusion | af6223e9636b055d029d136dd7ae023b210b4560 | [
"Apache-2.0"
] | null | null | null | testing/components/functions/function_evaluation_test.py | JeremiasKnoblauch/MXFusion | af6223e9636b055d029d136dd7ae023b210b4560 | [
"Apache-2.0"
] | 1 | 2019-05-30T09:39:46.000Z | 2019-05-30T09:39:46.000Z | # Copyright 2018 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://www.apache.org/licenses/LICENSE-2.0
#
# or in th... | 44.148148 | 99 | 0.590884 | # Copyright 2018 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://www.apache.org/licenses/LICENSE-2.0
#
# or in th... | 1,979 | 711 | 22 |
a2817df3a138e0f2a7e0d54aff30a42f28c91d0a | 42,649 | py | Python | synthetic-data-generator/hello/data_generator.py | skyu0221/660-iot | d31f973c93871bfa8122f1b83364d0147d402e9e | [
"Apache-2.0"
] | null | null | null | synthetic-data-generator/hello/data_generator.py | skyu0221/660-iot | d31f973c93871bfa8122f1b83364d0147d402e9e | [
"Apache-2.0"
] | 8 | 2021-03-19T01:36:06.000Z | 2022-03-12T00:22:43.000Z | synthetic-data-generator/hello/data_generator.py | skyu0221/660-iot | d31f973c93871bfa8122f1b83364d0147d402e9e | [
"Apache-2.0"
] | null | null | null | import numpy as np
from datetime import datetime, timedelta
import json
import os
start_work = 9 * 60 * 60 # Work start from 9:00. unit: second
end_work = 17 * 60 * 60 # Work end at 17:00. unit: second
daily_report = 16 * 60 * 60 # Daily progress report at 16:00, in meeting room
daily_report_mean = 15 * 60 # Daily... | 58.184175 | 137 | 0.445778 | import numpy as np
from datetime import datetime, timedelta
import json
import os
start_work = 9 * 60 * 60 # Work start from 9:00. unit: second
end_work = 17 * 60 * 60 # Work end at 17:00. unit: second
daily_report = 16 * 60 * 60 # Daily progress report at 16:00, in meeting room
daily_report_mean = 15 * 60 # Daily... | 33,625 | 2,776 | 372 |
51925404b642feba98f6462a0b576d07f825f428 | 5,994 | py | Python | analysis/evalHyperWords.py | tlranda/FULL-W2V | 66189559387ec1d94e1f489942159874785c4c05 | [
"Apache-2.0"
] | null | null | null | analysis/evalHyperWords.py | tlranda/FULL-W2V | 66189559387ec1d94e1f489942159874785c4c05 | [
"Apache-2.0"
] | null | null | null | analysis/evalHyperWords.py | tlranda/FULL-W2V | 66189559387ec1d94e1f489942159874785c4c05 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
from os import path
import sys, subprocess, argparse
parser = argparse.ArgumentParser(description='Automates the process of evaluating a word embedding.')
parser.add_argument('file', type=str, help='Word embedding file.')
parser.add_argument('-skip-regen', '--skip-regen', action='store_false', ... | 47.19685 | 184 | 0.702703 | #!/usr/bin/env python3
from os import path
import sys, subprocess, argparse
parser = argparse.ArgumentParser(description='Automates the process of evaluating a word embedding.')
parser.add_argument('file', type=str, help='Word embedding file.')
parser.add_argument('-skip-regen', '--skip-regen', action='store_false', ... | 0 | 0 | 0 |
d097bc591f4b95b5d080c39a0bdd791b5d42748d | 6,713 | py | Python | module1-introduction-to-sql/rpg_queries1.py | bs3537/DS-Unit-3-Sprint-2-SQL-and-Databases | 7020d2a957bf7fcb150228ce9926dc9d59e252f0 | [
"MIT"
] | null | null | null | module1-introduction-to-sql/rpg_queries1.py | bs3537/DS-Unit-3-Sprint-2-SQL-and-Databases | 7020d2a957bf7fcb150228ce9926dc9d59e252f0 | [
"MIT"
] | null | null | null | module1-introduction-to-sql/rpg_queries1.py | bs3537/DS-Unit-3-Sprint-2-SQL-and-Databases | 7020d2a957bf7fcb150228ce9926dc9d59e252f0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""rpg_queries.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1ufwd5h-epfNkHGiNJTkFTDQsbupk24Ld
"""
#How many total characters are there?
import sqlite3
conn = sqlite3.connect('rpg_db.sqlite3')
curs = conn.cursor()
#How... | 34.425641 | 90 | 0.768807 | # -*- coding: utf-8 -*-
"""rpg_queries.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1ufwd5h-epfNkHGiNJTkFTDQsbupk24Ld
"""
#How many total characters are there?
import sqlite3
conn = sqlite3.connect('rpg_db.sqlite3')
curs = conn.cursor()
#How... | 0 | 0 | 0 |
7fefb6f60e2cc185f3cede33e1e7a8d888d88ccb | 6,011 | py | Python | pmdarima/arima/approx.py | Juanlu001/pmdarima | e504247e9a8900e848e7cbf38ef67d179881a644 | [
"MIT"
] | null | null | null | pmdarima/arima/approx.py | Juanlu001/pmdarima | e504247e9a8900e848e7cbf38ef67d179881a644 | [
"MIT"
] | null | null | null | pmdarima/arima/approx.py | Juanlu001/pmdarima | e504247e9a8900e848e7cbf38ef67d179881a644 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Author: Taylor Smith <taylor.smith@alkaline-ml.com>
#
# R approx function
from __future__ import absolute_import
from sklearn.utils.validation import check_array, column_or_1d
import numpy as np
from ..utils.array import c
from ..utils import get_callable
from ..compat.numpy import DTYPE
... | 32.317204 | 79 | 0.618865 | # -*- coding: utf-8 -*-
#
# Author: Taylor Smith <taylor.smith@alkaline-ml.com>
#
# R approx function
from __future__ import absolute_import
from sklearn.utils.validation import check_array, column_or_1d
import numpy as np
from ..utils.array import c
from ..utils import get_callable
from ..compat.numpy import DTYPE
... | 109 | 0 | 34 |
2c7fe0e587563e12e640e93436de71b423c3ba01 | 337 | py | Python | model/model.py | madtyn/mvcPython | 7377bc5e4eec058ff098b850159971f4830c0488 | [
"MIT"
] | null | null | null | model/model.py | madtyn/mvcPython | 7377bc5e4eec058ff098b850159971f4830c0488 | [
"MIT"
] | null | null | null | model/model.py | madtyn/mvcPython | 7377bc5e4eec058ff098b850159971f4830c0488 | [
"MIT"
] | null | null | null | from pathlib import Path
from common.observer import Observable
if __name__ == '__main__':
m = Model()
test_path = Path.home().resolve()
m.collect_metrics(str(test_path), [str(Path('.').resolve())], 'test.json')
| 22.466667 | 78 | 0.655786 | from pathlib import Path
from common.observer import Observable
class Model(Observable):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
if __name__ == '__main__':
m = Model()
test_path = Path.home().resolve()
m.collect_metrics(str(test_path), [str(Path('.').resolve()... | 57 | 3 | 49 |
497b14452dfa29906a0b0faa661efbca15094cbc | 859 | py | Python | {{cookiecutter.service_name}}/{{cookiecutter.service_slug}}/schemas.py | zeel-dev/zebuker-cookiecutter | 31d25321b6dca8e3207f60da907e5a7996860308 | [
"BSD-2-Clause"
] | null | null | null | {{cookiecutter.service_name}}/{{cookiecutter.service_slug}}/schemas.py | zeel-dev/zebuker-cookiecutter | 31d25321b6dca8e3207f60da907e5a7996860308 | [
"BSD-2-Clause"
] | null | null | null | {{cookiecutter.service_name}}/{{cookiecutter.service_slug}}/schemas.py | zeel-dev/zebuker-cookiecutter | 31d25321b6dca8e3207f60da907e5a7996860308 | [
"BSD-2-Clause"
] | null | null | null | """Schemas linked to the database models"""
import re
from marshmallow import post_dump
from marshmallow_sqlalchemy import ModelSchema
class BaseSchema(ModelSchema):
"""
Custom base schema class that serializes datetime strings without the
timezone offset.
"""
@post_dump
def strip_timezone_of... | 30.678571 | 79 | 0.575087 | """Schemas linked to the database models"""
import re
from marshmallow import post_dump
from marshmallow_sqlalchemy import ModelSchema
class BaseSchema(ModelSchema):
"""
Custom base schema class that serializes datetime strings without the
timezone offset.
"""
def __init__(self, strict=True, **kw... | 87 | 0 | 27 |
69957d6ab0eb1f7ead9b6b0190af524dec2bfe3a | 53 | py | Python | data/__init__.py | SparkJiao/pytorch-transformers-template | c64d55f346534b204ac35e814db03221a0856d84 | [
"MIT"
] | 1 | 2022-03-04T08:27:52.000Z | 2022-03-04T08:27:52.000Z | data/__init__.py | SparkJiao/pytorch-transformers-template | c64d55f346534b204ac35e814db03221a0856d84 | [
"MIT"
] | null | null | null | data/__init__.py | SparkJiao/pytorch-transformers-template | c64d55f346534b204ac35e814db03221a0856d84 | [
"MIT"
] | null | null | null | """
Write your own datasets under this directory.
""" | 17.666667 | 45 | 0.716981 | """
Write your own datasets under this directory.
""" | 0 | 0 | 0 |
03ff9706fddfab3e358c77794e9b1dc5caf1ec05 | 9,470 | py | Python | python/mpopt/qap/solver.py | vislearn/libmpopt | 11c9e99bedc7fb5dd2e11bff69c60d4ce974f525 | [
"MIT"
] | 1 | 2021-03-23T06:45:42.000Z | 2021-03-23T06:45:42.000Z | python/mpopt/qap/solver.py | vislearn/libmpopt | 11c9e99bedc7fb5dd2e11bff69c60d4ce974f525 | [
"MIT"
] | 1 | 2022-01-18T03:17:09.000Z | 2022-01-18T03:17:09.000Z | python/mpopt/qap/solver.py | vislearn/libmpopt | 11c9e99bedc7fb5dd2e11bff69c60d4ce974f525 | [
"MIT"
] | 2 | 2021-03-03T14:01:52.000Z | 2022-01-18T02:45:55.000Z | from ..common.solver import BaseSolver, DEFAULT_BATCH_SIZE, DEFAULT_MAX_BATCHES
from . import libmpopt_qap as lib
from . primals import Primals
import numpy
DEFAULT_GREEDY_GENERATIONS = 10
INFINITY_COST = 1e99
| 41.902655 | 139 | 0.67434 | from ..common.solver import BaseSolver, DEFAULT_BATCH_SIZE, DEFAULT_MAX_BATCHES
from . import libmpopt_qap as lib
from . primals import Primals
import numpy
DEFAULT_GREEDY_GENERATIONS = 10
INFINITY_COST = 1e99
class ModelDecomposition:
def __init__(self, model, with_uniqueness, unary_side='left'):
"""... | 3,053 | 5,979 | 219 |
460f16294e073ca7bce6d7e13f69f59127b2bdb9 | 6,969 | py | Python | kitsune/notifications/api.py | AndrewDVXI/kitsune | 84bd4fa60346681c3fc5a03b0b1540fd1335cee2 | [
"BSD-3-Clause"
] | 929 | 2015-01-04T08:08:51.000Z | 2022-03-31T06:20:44.000Z | kitsune/notifications/api.py | hafixo/kitsune | d7756872e16590eea1c6adaeb5bc78f83414d753 | [
"BSD-3-Clause"
] | 1,751 | 2015-01-02T00:04:37.000Z | 2022-03-31T10:24:30.000Z | kitsune/notifications/api.py | hixio-mh/kitsune | d7756872e16590eea1c6adaeb5bc78f83414d753 | [
"BSD-3-Clause"
] | 605 | 2015-01-01T14:08:36.000Z | 2022-03-28T15:39:45.000Z | from django import forms
from django.db.models import Q
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
import django_filters
from actstream.models import Action
from rest_framework import serializers, viewsets, permissions, mixins, status
from rest_framework.deco... | 31.391892 | 94 | 0.667384 | from django import forms
from django.db.models import Q
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
import django_filters
from actstream.models import Action
from rest_framework import serializers, viewsets, permissions, mixins, status
from rest_framework.deco... | 1,306 | 4,624 | 211 |
212c2bff91064b6f0d6c65cfcbed0e0e93656577 | 2,016 | py | Python | homeassistant/util/async_.py | itewk/home-assistant | 769cf19052f8c9ef374d8ba8ae7705ccc7bf4cf4 | [
"Apache-2.0"
] | 23 | 2017-11-15T21:03:53.000Z | 2021-03-29T21:33:48.000Z | homeassistant/util/async_.py | itewk/home-assistant | 769cf19052f8c9ef374d8ba8ae7705ccc7bf4cf4 | [
"Apache-2.0"
] | 9 | 2022-01-27T06:32:10.000Z | 2022-03-31T07:07:51.000Z | homeassistant/util/async_.py | itewk/home-assistant | 769cf19052f8c9ef374d8ba8ae7705ccc7bf4cf4 | [
"Apache-2.0"
] | 10 | 2018-01-01T00:12:51.000Z | 2021-12-21T23:08:05.000Z | """Asyncio backports for Python 3.6 compatibility."""
from asyncio import coroutines, ensure_future
from asyncio.events import AbstractEventLoop
import concurrent.futures
import logging
import threading
from typing import Any, Callable, Coroutine
_LOGGER = logging.getLogger(__name__)
def fire_coroutine_threadsafe(co... | 34.758621 | 80 | 0.699405 | """Asyncio backports for Python 3.6 compatibility."""
from asyncio import coroutines, ensure_future
from asyncio.events import AbstractEventLoop
import concurrent.futures
import logging
import threading
from typing import Any, Callable, Coroutine
_LOGGER = logging.getLogger(__name__)
def fire_coroutine_threadsafe(co... | 0 | 0 | 0 |
e1dd7ede6c94f72ccac6e9c9d45c7d3d3ef460e1 | 376 | py | Python | tests/test_hangman.py | daryavasilyeva/hangman | d0f1eaca4764c70ee9f5977bc4bdeca3c0ed67c2 | [
"MIT"
] | null | null | null | tests/test_hangman.py | daryavasilyeva/hangman | d0f1eaca4764c70ee9f5977bc4bdeca3c0ed67c2 | [
"MIT"
] | null | null | null | tests/test_hangman.py | daryavasilyeva/hangman | d0f1eaca4764c70ee9f5977bc4bdeca3c0ed67c2 | [
"MIT"
] | null | null | null | """Tests"""
from hangman import check_letter, reveal_letter, print_result
def test_check_letter():
"""check_letter"""
assert check_letter("world", "a") == 0
def test_reveal_letter():
"""reveal_letter"""
assert reveal_letter("te", ['*', 'e'], "t") == ['t', 'e']
def test_print_result():
"""test ... | 20.888889 | 61 | 0.62234 | """Tests"""
from hangman import check_letter, reveal_letter, print_result
def test_check_letter():
"""check_letter"""
assert check_letter("world", "a") == 0
def test_reveal_letter():
"""reveal_letter"""
assert reveal_letter("te", ['*', 'e'], "t") == ['t', 'e']
def test_print_result():
"""test ... | 0 | 0 | 0 |
2498fa119bb7a0d039236056c6f620bb91e0ce55 | 6,570 | py | Python | code/deepdetect/py/train_hard_negative.py | omidroshani/DeepDIA | 2af96056a62a49ff6ff10b6e176f0fba3f495843 | [
"BSD-3-Clause"
] | 25 | 2020-01-09T18:30:57.000Z | 2021-12-25T20:09:40.000Z | code/deepdetect/py/train_hard_negative.py | omidroshani/DeepDIA | 2af96056a62a49ff6ff10b6e176f0fba3f495843 | [
"BSD-3-Clause"
] | 2 | 2020-10-19T14:28:41.000Z | 2021-11-15T18:46:15.000Z | code/deepdetect/py/train_hard_negative.py | omidroshani/DeepDIA | 2af96056a62a49ff6ff10b6e176f0fba3f495843 | [
"BSD-3-Clause"
] | 14 | 2020-01-24T14:44:46.000Z | 2022-02-24T12:37:33.000Z | # coding: utf-8
from __future__ import print_function
import numpy as np
import pandas as pd
import os
import json
import re
from pep_detectability import PeptideDetectabilityTrainer
from pep_detectability import PeptideDetectabilityPredictor
working_dir = '.'
filenames_positive = [
f for f in os.... | 34.397906 | 96 | 0.624201 | # coding: utf-8
from __future__ import print_function
import numpy as np
import pandas as pd
import os
import json
import re
from pep_detectability import PeptideDetectabilityTrainer
from pep_detectability import PeptideDetectabilityPredictor
def load_data(file):
with open(file, 'r') as f:
data = pd.read... | 2,410 | 0 | 115 |
9e0c31f3ec48056ceb415af9faf04e77f34f0cd0 | 48 | py | Python | tests/data_loader/__init__.py | usert5432/lstm_ee | 342ed4f5245311924d6a06b38c4f28eac77778e9 | [
"MIT"
] | 3 | 2020-06-04T17:00:26.000Z | 2022-02-22T16:56:09.000Z | tests/data_loader/__init__.py | usert5432/lstm_ee | 342ed4f5245311924d6a06b38c4f28eac77778e9 | [
"MIT"
] | null | null | null | tests/data_loader/__init__.py | usert5432/lstm_ee | 342ed4f5245311924d6a06b38c4f28eac77778e9 | [
"MIT"
] | 1 | 2021-01-17T04:19:41.000Z | 2021-01-17T04:19:41.000Z | """Various `lstm_ee.data.data_loader` tests"""
| 16 | 46 | 0.708333 | """Various `lstm_ee.data.data_loader` tests"""
| 0 | 0 | 0 |
5d203c9d71c48c60eb3ec646a3694c4aec573963 | 1,218 | py | Python | companies/migrations/0004_companynamechange.py | Valuehorizon/valuehorizon-companies | 5366e230da69ee30fcdc1bf4beddc99310f6b767 | [
"MIT"
] | 1 | 2015-09-28T17:11:12.000Z | 2015-09-28T17:11:12.000Z | companies/migrations/0004_companynamechange.py | Valuehorizon/valuehorizon-companies | 5366e230da69ee30fcdc1bf4beddc99310f6b767 | [
"MIT"
] | 4 | 2020-02-11T22:59:54.000Z | 2021-06-10T17:55:15.000Z | companies/migrations/0004_companynamechange.py | Valuehorizon/valuehorizon-companies | 5366e230da69ee30fcdc1bf4beddc99310f6b767 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
| 36.909091 | 146 | 0.559934 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('companies', '0003_auto_20150526_1255'),
]
operations = [
migrations.CreateModel(
name='CompanyNameChange',
... | 0 | 1,088 | 23 |
29fa2e9e8a9f4bead992c5e3ca0253fe77c94c60 | 566 | py | Python | python/0104.py | garywei944/LeetCode | 77453b6e3329f3309ad61fe578cb7b608317ba1b | [
"MIT"
] | null | null | null | python/0104.py | garywei944/LeetCode | 77453b6e3329f3309ad61fe578cb7b608317ba1b | [
"MIT"
] | null | null | null | python/0104.py | garywei944/LeetCode | 77453b6e3329f3309ad61fe578cb7b608317ba1b | [
"MIT"
] | null | null | null | from leetcode_tester import Tester
from src.binary_tree import TreeNode, null
from typing import Optional, List
if __name__ == '__main__':
solution = Solution()
test = Tester(solution.maxDepth)
test.addTest(
TreeNode.from_list([3, 9, 20, null, null, 15, 7]), 3
)
test.addTest(
Tr... | 22.64 | 67 | 0.628975 | from leetcode_tester import Tester
from src.binary_tree import TreeNode, null
from typing import Optional, List
class Solution:
def maxDepth(self, root: Optional[TreeNode]) -> int:
if root is None:
return 0
return max(map(self.maxDepth, (root.left, root.right))) + 1
if __name__ == '... | 145 | -6 | 49 |
b06e5af1cd883a14debdabe2995244bde009957c | 279 | py | Python | seshat/reviewer/views/reviewers.py | deadlylaid/seshat | 7bc98187c6a8bbc6884edee56e605257526406af | [
"MIT"
] | 2 | 2019-11-20T04:21:00.000Z | 2021-06-11T04:02:37.000Z | seshat/reviewer/views/reviewers.py | deadlylaid/seshat | 7bc98187c6a8bbc6884edee56e605257526406af | [
"MIT"
] | 1 | 2019-10-03T06:03:49.000Z | 2019-10-03T06:03:49.000Z | seshat/reviewer/views/reviewers.py | deadlylaid/seshat | 7bc98187c6a8bbc6884edee56e605257526406af | [
"MIT"
] | null | null | null | from django.contrib.auth.mixins import LoginRequiredMixin
from django.views.generic import ListView
from reviewer.models import Reviewer
| 27.9 | 57 | 0.795699 | from django.contrib.auth.mixins import LoginRequiredMixin
from django.views.generic import ListView
from reviewer.models import Reviewer
class ReviewerListView(LoginRequiredMixin, ListView):
login_url = 'login'
model = Reviewer
template_name = 'reviewer/list.html'
| 0 | 118 | 23 |
6c023fb1f27e6d7a5b2543f14e1f14e2952ae907 | 34,866 | py | Python | src/CKANData.py | bdolor/bcdc2bcdc | 7802e75d6595f89a80765b331b06f59122e5a866 | [
"Apache-2.0"
] | null | null | null | src/CKANData.py | bdolor/bcdc2bcdc | 7802e75d6595f89a80765b331b06f59122e5a866 | [
"Apache-2.0"
] | null | null | null | src/CKANData.py | bdolor/bcdc2bcdc | 7802e75d6595f89a80765b331b06f59122e5a866 | [
"Apache-2.0"
] | null | null | null | """CKAN module is a wrapper around API calls. All of these methods will return
raw json objects. The JSON that is returned can be used to construct CKANData
objects.
CKANData objects can be compared with one another. They will use the
CKANTransform methods to identify fields that should and should not be
used to co... | 41.507143 | 117 | 0.64246 | """CKAN module is a wrapper around API calls. All of these methods will return
raw json objects. The JSON that is returned can be used to construct CKANData
objects.
CKANData objects can be compared with one another. They will use the
CKANTransform methods to identify fields that should and should not be
used to co... | 6,169 | 7,180 | 693 |
a716982e7f05cf8e2d5c8a7553f150a6cba86c7d | 969 | py | Python | devicedata/management/commands/provider_find.py | MPIB/Lagerregal | 3c950dffcf4fa164008c5a304c4839bc282a3388 | [
"BSD-3-Clause"
] | 24 | 2017-03-19T16:17:37.000Z | 2021-11-07T15:35:33.000Z | devicedata/management/commands/provider_find.py | MPIB/Lagerregal | 3c950dffcf4fa164008c5a304c4839bc282a3388 | [
"BSD-3-Clause"
] | 117 | 2016-04-19T12:35:10.000Z | 2022-02-22T13:19:05.000Z | devicedata/management/commands/provider_find.py | MPIB/Lagerregal | 3c950dffcf4fa164008c5a304c4839bc282a3388 | [
"BSD-3-Clause"
] | 11 | 2017-08-08T12:11:39.000Z | 2021-12-08T05:34:06.000Z | from django.core.management import BaseCommand
from devicedata.generic import _get_provider
from devices.models import Device
| 35.888889 | 97 | 0.639835 | from django.core.management import BaseCommand
from devicedata.generic import _get_provider
from devices.models import Device
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument('device_ids', nargs='*', type=int)
def handle(self, *args, **options):
if "device_id... | 758 | 6 | 77 |
3b63cd4e1e16948b5cafa357994d2747e7cf0d6c | 2,458 | py | Python | packages/mccomponents/python/mccomponents/sample/phonon/obsolete/register_LinearlyInterpolatedDOS.py | mcvine/mcvine | 42232534b0c6af729628009bed165cd7d833789d | [
"BSD-3-Clause"
] | 5 | 2017-01-16T03:59:47.000Z | 2020-06-23T02:54:19.000Z | packages/mccomponents/python/mccomponents/sample/phonon/obsolete/register_LinearlyInterpolatedDOS.py | mcvine/mcvine | 42232534b0c6af729628009bed165cd7d833789d | [
"BSD-3-Clause"
] | 293 | 2015-10-29T17:45:52.000Z | 2022-01-07T16:31:09.000Z | packages/mccomponents/python/mccomponents/sample/phonon/obsolete/register_LinearlyInterpolatedDOS.py | mcvine/mcvine | 42232534b0c6af729628009bed165cd7d833789d | [
"BSD-3-Clause"
] | 1 | 2019-05-25T00:53:31.000Z | 2019-05-25T00:53:31.000Z | #!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Jiao Lin
# California Institute of Technology
# (C) 2007 All Rights Reserved
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... | 26.430108 | 81 | 0.616355 | #!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Jiao Lin
# California Institute of Technology
# (C) 2007 All Rights Reserved
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... | 848 | 202 | 66 |
7fccc3ed20ff70caf1f3b1b885d87d0a061db7f8 | 549 | py | Python | python/stringio_user.py | seckcoder/lang-learn | 1e0d6f412bbd7f89b1af00293fd907ddb3c1b571 | [
"Unlicense"
] | 1 | 2017-10-14T04:23:45.000Z | 2017-10-14T04:23:45.000Z | python/stringio_user.py | seckcoder/lang-learn | 1e0d6f412bbd7f89b1af00293fd907ddb3c1b571 | [
"Unlicense"
] | null | null | null | python/stringio_user.py | seckcoder/lang-learn | 1e0d6f412bbd7f89b1af00293fd907ddb3c1b571 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
#-*- coding=utf-8 -*-
#
# Copyright 2012 Jike Inc. All Rights Reserved.
# Author: liwei@jike.com
from StringIO import StringIO
file = '/etc/passwd'
lines = open(file, 'r').readlines()
text = open(file, 'r').read()
f = StringIO()
for line in lines[:-2]:
f.writelines(line)
f.writelines(lines[-2... | 21.96 | 47 | 0.655738 | #!/usr/bin/env python
#-*- coding=utf-8 -*-
#
# Copyright 2012 Jike Inc. All Rights Reserved.
# Author: liwei@jike.com
from StringIO import StringIO
file = '/etc/passwd'
lines = open(file, 'r').readlines()
text = open(file, 'r').read()
f = StringIO()
for line in lines[:-2]:
f.writelines(line)
f.writelines(lines[-2... | 0 | 0 | 0 |
17ca753f935c10af5ae4ce9a89cd6e2d15fc1486 | 441 | py | Python | stockserver.py | cnu/zeromq-talk | b090ed8be7e7ea6a1c71664e052e2ba91587f9ef | [
"MIT"
] | 2 | 2016-02-09T17:41:55.000Z | 2020-11-02T15:37:01.000Z | stockserver.py | cnu/zeromq-talk | b090ed8be7e7ea6a1c71664e052e2ba91587f9ef | [
"MIT"
] | null | null | null | stockserver.py | cnu/zeromq-talk | b090ed8be7e7ea6a1c71664e052e2ba91587f9ef | [
"MIT"
] | null | null | null | #
# Stock Ticker server
# Binds PUB socket to tcp://*:5556
# Publishes random stock updates
#
import zmq
import time
import random
context = zmq.Context()
socket = context.socket(zmq.PUB)
socket.bind("tcp://*:5556")
scrips = ['AAPL', 'GOOG', 'MSFT', 'AMZN']
while True:
scrip = random.choice(scrips)
pri... | 19.173913 | 41 | 0.641723 | #
# Stock Ticker server
# Binds PUB socket to tcp://*:5556
# Publishes random stock updates
#
import zmq
import time
import random
context = zmq.Context()
socket = context.socket(zmq.PUB)
socket.bind("tcp://*:5556")
scrips = ['AAPL', 'GOOG', 'MSFT', 'AMZN']
while True:
scrip = random.choice(scrips)
pri... | 0 | 0 | 0 |
4251f1c6adc55b7041994a2cbbc15c3c8fc6f74d | 22,510 | py | Python | wampnado/messages.py | rexlunae/tornwamp | 881538c6ae7909e06a15a838a0d84ebb94a2aed2 | [
"Apache-2.0"
] | null | null | null | wampnado/messages.py | rexlunae/tornwamp | 881538c6ae7909e06a15a838a0d84ebb94a2aed2 | [
"Apache-2.0"
] | null | null | null | wampnado/messages.py | rexlunae/tornwamp | 881538c6ae7909e06a15a838a0d84ebb94a2aed2 | [
"Apache-2.0"
] | null | null | null | """
WAMP messages definitions and serializers.
Compatible with WAMP Document Revision: RC3, 2014/08/25, available at:
https://github.com/tavendo/WAMP/blob/master/spec/basic.md
"""
import json
import msgpack
import uuid
from copy import deepcopy
from enum import IntEnum, Enum
from io import BytesIO
from base64 import ... | 33.447251 | 143 | 0.649445 | """
WAMP messages definitions and serializers.
Compatible with WAMP Document Revision: RC3, 2014/08/25, available at:
https://github.com/tavendo/WAMP/blob/master/spec/basic.md
"""
import json
import msgpack
import uuid
from copy import deepcopy
from enum import IntEnum, Enum
from io import BytesIO
from base64 import ... | 9,304 | 0 | 662 |
b981440ef6dd9840fe7b1f1f885870c5756d942a | 6,285 | py | Python | instagram/bind.py | bearprada/instagram-tag-monitor | 3cad22d9abd3b44c9c8714bb1c3cb41a3c876c5f | [
"MIT"
] | 2 | 2015-12-19T08:04:28.000Z | 2017-07-28T10:25:12.000Z | instagram/bind.py | bearprada/instagram-tag-monitor | 3cad22d9abd3b44c9c8714bb1c3cb41a3c876c5f | [
"MIT"
] | null | null | null | instagram/bind.py | bearprada/instagram-tag-monitor | 3cad22d9abd3b44c9c8714bb1c3cb41a3c876c5f | [
"MIT"
] | null | null | null | import urllib
from oauth2 import OAuth2Request
import re
from json_import import simplejson
re_path_template = re.compile('{\w+}')
| 40.811688 | 128 | 0.555449 | import urllib
from oauth2 import OAuth2Request
import re
from json_import import simplejson
re_path_template = re.compile('{\w+}')
def encode_string(value):
return value.encode('utf-8') \
if isinstance(value, unicode) else str(value)
class InstagramClientError(Exception):
def __init... | 5,919 | 31 | 199 |
07c776590fbaaa6dfaf168c37f9d45306a336f43 | 1,142 | py | Python | cleaning_ex/cleaner.py | cltrudeau/codingnomads | 2a13f36186a5d0fc85ea54690e621b7ba9e2041e | [
"MIT"
] | 1 | 2020-05-06T17:34:33.000Z | 2020-05-06T17:34:33.000Z | cleaning_ex/cleaner.py | cltrudeau/codingnomads | 2a13f36186a5d0fc85ea54690e621b7ba9e2041e | [
"MIT"
] | 5 | 2021-03-31T19:46:09.000Z | 2021-09-22T19:34:02.000Z | cleaning_ex/cleaner.py | cltrudeau/codingnomads | 2a13f36186a5d0fc85ea54690e621b7ba9e2041e | [
"MIT"
] | 1 | 2020-06-04T20:58:21.000Z | 2020-06-04T20:58:21.000Z | #!/usr/bin/env python
from pathlib import Path
import unicodedata
output = []
filename = Path(__file__).parent.resolve() / "data/books.tsv"
with open(filename) as handle:
lines = handle.readlines()
# lines will contain a row for each line in the file
# Loop through lines and do data scrubbing, put each result ... | 22.84 | 69 | 0.590193 | #!/usr/bin/env python
from pathlib import Path
import unicodedata
output = []
filename = Path(__file__).parent.resolve() / "data/books.tsv"
with open(filename) as handle:
lines = handle.readlines()
# lines will contain a row for each line in the file
# Loop through lines and do data scrubbing, put each result ... | 0 | 0 | 0 |
0b2cf5747c8d26ddf32a96fbcf1bcecd26618ae5 | 417 | py | Python | reference_solutions/upload_bin.py | yahoo/hardware-hackme-1 | d7acbf36854b088a34419f9697f64aaf0e3be83c | [
"MIT"
] | 4 | 2020-04-17T20:22:15.000Z | 2020-05-02T15:04:41.000Z | reference_solutions/upload_bin.py | yahoo/hardware-hackme-1 | d7acbf36854b088a34419f9697f64aaf0e3be83c | [
"MIT"
] | null | null | null | reference_solutions/upload_bin.py | yahoo/hardware-hackme-1 | d7acbf36854b088a34419f9697f64aaf0e3be83c | [
"MIT"
] | 1 | 2020-05-04T01:32:05.000Z | 2020-05-04T01:32:05.000Z | #!/usr/bin/env python3
# Copyright 2020, Verizon Media
# Licensed under the terms of the MIT license. See LICENSE file in project root for terms.
import binascii
import serial
import subprocess
import sys
in_serport = sys.argv[1]
in_fn = sys.argv[2]
with open(in_fn, 'rb') as f:
payload = f.read()
ser = serial.Ser... | 18.954545 | 90 | 0.721823 | #!/usr/bin/env python3
# Copyright 2020, Verizon Media
# Licensed under the terms of the MIT license. See LICENSE file in project root for terms.
import binascii
import serial
import subprocess
import sys
in_serport = sys.argv[1]
in_fn = sys.argv[2]
with open(in_fn, 'rb') as f:
payload = f.read()
ser = serial.Ser... | 0 | 0 | 0 |
87ed6e9506b6c62eb792dd5aa392831ff1405747 | 172 | py | Python | main.py | ArKits/Tuberc | 2506f6141c68e24ac2f2371362faef87876e8a53 | [
"MIT"
] | 1 | 2018-02-11T08:41:04.000Z | 2018-02-11T08:41:04.000Z | main.py | ArKits/tuberc | 2506f6141c68e24ac2f2371362faef87876e8a53 | [
"MIT"
] | null | null | null | main.py | ArKits/tuberc | 2506f6141c68e24ac2f2371362faef87876e8a53 | [
"MIT"
] | null | null | null | from app import app, db
from app.models import User, Channel
@app.shell_context_processor | 28.666667 | 55 | 0.738372 | from app import app, db
from app.models import User, Channel
@app.shell_context_processor
def make_shell_context():
return {'db': db, 'User': User, 'Channel': Channel} | 60 | 0 | 22 |
e7ecca1e60e9ec1066dc078308487bb237b3ca10 | 7,846 | py | Python | skills_ml/job_postings/corpora/__init__.py | bhagyaramgpo/skills-ml | be520fc2a2f88bff756d25e57c3378a465a1dcb2 | [
"MIT"
] | 147 | 2016-12-05T19:45:05.000Z | 2022-02-17T03:03:28.000Z | skills_ml/job_postings/corpora/__init__.py | bhagyaramgpo/skills-ml | be520fc2a2f88bff756d25e57c3378a465a1dcb2 | [
"MIT"
] | 390 | 2016-12-02T03:11:13.000Z | 2022-03-28T22:08:20.000Z | skills_ml/job_postings/corpora/__init__.py | bhagyaramgpo/skills-ml | be520fc2a2f88bff756d25e57c3378a465a1dcb2 | [
"MIT"
] | 66 | 2017-12-14T16:33:24.000Z | 2022-02-17T03:03:31.000Z | from random import randint
from skills_ml.algorithms.nlp import clean_html, clean_str, lowercase_strip_punc, word_tokenize, sentence_tokenize, section_extract, strip_bullets_from_line
from gensim.models.doc2vec import TaggedDocument
from skills_utils.common import safe_get
class CorpusCreator(object):
"""
... | 39.034826 | 156 | 0.686974 | from random import randint
from skills_ml.algorithms.nlp import clean_html, clean_str, lowercase_strip_punc, word_tokenize, sentence_tokenize, section_extract, strip_bullets_from_line
from gensim.models.doc2vec import TaggedDocument
from skills_utils.common import safe_get
class CorpusCreator(object):
"""
... | 3,845 | 0 | 533 |
52777aa0752ed891ab623cd6d0d931391f0f9e8a | 9,901 | py | Python | gym_bot_app/models.py | talorabr/RashatzimBot | 3d56ecd77c8cc8cf78310e4675f68a4ca3b1616e | [
"Apache-2.0"
] | null | null | null | gym_bot_app/models.py | talorabr/RashatzimBot | 3d56ecd77c8cc8cf78310e4675f68a4ca3b1616e | [
"Apache-2.0"
] | null | null | null | gym_bot_app/models.py | talorabr/RashatzimBot | 3d56ecd77c8cc8cf78310e4675f68a4ca3b1616e | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
from __future__ import unicode_literals
from datetime import datetime, timedelta
from mongoengine import (Document,
ListField,
StringField,
BooleanField,
DateTimeField,
Embedd... | 36.003636 | 125 | 0.6061 | # encoding: utf-8
from __future__ import unicode_literals
from datetime import datetime, timedelta
from mongoengine import (Document,
ListField,
StringField,
BooleanField,
DateTimeField,
Embedd... | 2,530 | 6,661 | 115 |
7416069b1655abcb7b4ce4fa39b10a99ec5fc400 | 1,244 | py | Python | src/tictactoe/gui/View.py | dawidcdv/tictactoe | d42016ce7765bba8d1852e82de4e08648ce4d62a | [
"MIT"
] | null | null | null | src/tictactoe/gui/View.py | dawidcdv/tictactoe | d42016ce7765bba8d1852e82de4e08648ce4d62a | [
"MIT"
] | null | null | null | src/tictactoe/gui/View.py | dawidcdv/tictactoe | d42016ce7765bba8d1852e82de4e08648ce4d62a | [
"MIT"
] | null | null | null | from tkinter import Button, messagebox
from abc import ABCMeta, abstractmethod
from src.tictactoe.game.Board import Board
| 31.897436 | 87 | 0.607717 | from tkinter import Button, messagebox
from abc import ABCMeta, abstractmethod
from src.tictactoe.game.Board import Board
class View:
class Controller:
__metaclass__ = ABCMeta
@abstractmethod
def select(self, position : int): raise NotImplementedError
def __init__(self, tk, control... | 862 | 235 | 23 |
1484137076d74041a15c64db005d71834958165e | 404 | py | Python | more_than_basics/builtins/builtins.py | xames3/python_tuts_v2 | 666d23743d617a33de9782dadcd06a97494b3823 | [
"Apache-2.0"
] | null | null | null | more_than_basics/builtins/builtins.py | xames3/python_tuts_v2 | 666d23743d617a33de9782dadcd06a97494b3823 | [
"Apache-2.0"
] | null | null | null | more_than_basics/builtins/builtins.py | xames3/python_tuts_v2 | 666d23743d617a33de9782dadcd06a97494b3823 | [
"Apache-2.0"
] | null | null | null | # List of Builtins referred from here: https://docs.python.org/3/library/functions.html
# xa = oct(10)
import os
import glob
# print(xa, (type(xa)), sep="\n")
xa = ["xa", "pranali", "srushti", "shailesh", "nimesh"]
xa = [idx.upper() for idx in xa]
# ya = xa.copy()
# za = []
# for idx in xa:
# za.append(idx.upper... | 17.565217 | 87 | 0.616337 | # List of Builtins referred from here: https://docs.python.org/3/library/functions.html
# xa = oct(10)
import os
import glob
# print(xa, (type(xa)), sep="\n")
xa = ["xa", "pranali", "srushti", "shailesh", "nimesh"]
xa = [idx.upper() for idx in xa]
# ya = xa.copy()
# za = []
# for idx in xa:
# za.append(idx.upper... | 0 | 0 | 0 |
65c9d0d6f453e2e5695efe48fee0cf0b1d9c2adc | 7,188 | py | Python | cogs/Offices.py | seanrowland101/Ayesha-2.0 | 4f3c2ca9fff37559fa07d1138d3df5c9a33a838b | [
"MIT"
] | null | null | null | cogs/Offices.py | seanrowland101/Ayesha-2.0 | 4f3c2ca9fff37559fa07d1138d3df5c9a33a838b | [
"MIT"
] | null | null | null | cogs/Offices.py | seanrowland101/Ayesha-2.0 | 4f3c2ca9fff37559fa07d1138d3df5c9a33a838b | [
"MIT"
] | null | null | null | import discord
from discord.commands.commands import Option, OptionChoice
from discord.commands.context import ApplicationContext
from discord.ext import commands, pages
from discord.ext.commands import BucketType, cooldown
import asyncio
import random
import schedule
from Utilities import AssociationObje... | 43.041916 | 90 | 0.536867 | import discord
from discord.commands.commands import Option, OptionChoice
from discord.commands.context import ApplicationContext
from discord.ext import commands, pages
from discord.ext.commands import BucketType, cooldown
import asyncio
import random
import schedule
from Utilities import AssociationObje... | 3,365 | 0 | 80 |
44c2fe335e43cc6f717f5b780437fc4c47a6dd18 | 3,700 | py | Python | tushare_trader/__init__.py | gorf/tushare-trader | 7502e11acb509f481041445e69e2f6960b3fba0d | [
"BSD-3-Clause"
] | 1 | 2020-07-12T02:40:11.000Z | 2020-07-12T02:40:11.000Z | tushare_trader/__init__.py | gorf/tushare-trader | 7502e11acb509f481041445e69e2f6960b3fba0d | [
"BSD-3-Clause"
] | 3 | 2020-07-12T01:13:17.000Z | 2021-03-31T19:16:04.000Z | tushare_trader/__init__.py | gorf/tushare-trader | 7502e11acb509f481041445e69e2f6960b3fba0d | [
"BSD-3-Clause"
] | null | null | null | __version__ = '0.7.7'
__author__ = 'Jimmy Liu'
"""
for trading data
"""
from tushare_trader.stock.trading import (get_hist_data, get_tick_data,
get_today_all, get_realtime_quotes,
get_h_data, get_today_ticks,
... | 33.035714 | 95 | 0.536216 | __version__ = '0.7.7'
__author__ = 'Jimmy Liu'
"""
for trading data
"""
from tushare_trader.stock.trading import (get_hist_data, get_tick_data,
get_today_all, get_realtime_quotes,
get_h_data, get_today_ticks,
... | 0 | 0 | 0 |
ad79a8d3eee9a3a57784a6474509d0a1b53512b5 | 222 | py | Python | menus/admin.py | hbolzan/django-sql-to-rest | 008f2d726fc7b758e45d24eb2e32ae605f194947 | [
"BSD-2-Clause"
] | 1 | 2019-03-06T19:46:18.000Z | 2019-03-06T19:46:18.000Z | menus/admin.py | hbolzan/django-sql-to-rest | 008f2d726fc7b758e45d24eb2e32ae605f194947 | [
"BSD-2-Clause"
] | 2 | 2020-06-05T19:41:06.000Z | 2021-06-10T21:05:53.000Z | menus/admin.py | hbolzan/django-sql-to-rest | 008f2d726fc7b758e45d24eb2e32ae605f194947 | [
"BSD-2-Clause"
] | null | null | null | from django.contrib import admin
from django_mptt_admin.admin import DjangoMpttAdmin
from menus.models import SystemMenu
admin.site.register(SystemMenu, SystemMenuAdmin)
| 22.2 | 51 | 0.842342 | from django.contrib import admin
from django_mptt_admin.admin import DjangoMpttAdmin
from menus.models import SystemMenu
class SystemMenuAdmin(DjangoMpttAdmin):
pass
admin.site.register(SystemMenu, SystemMenuAdmin)
| 0 | 27 | 23 |
7da8a3e5f21fcbab4d59bff10ca9fcf193fdd4ce | 591 | py | Python | 21312312.py | zhangbo2008/chineseOCR-latest | 8eeb7d4bdf1bf460a3b8190d21507639db4c77f3 | [
"MIT"
] | 8 | 2019-10-29T07:56:04.000Z | 2020-11-27T07:44:25.000Z | 21312312.py | zhangbo2008/chineseOCR-latest | 8eeb7d4bdf1bf460a3b8190d21507639db4c77f3 | [
"MIT"
] | null | null | null | 21312312.py | zhangbo2008/chineseOCR-latest | 8eeb7d4bdf1bf460a3b8190d21507639db4c77f3 | [
"MIT"
] | 1 | 2020-11-03T12:45:27.000Z | 2020-11-03T12:45:27.000Z | ##
import requests
tmp2='http://pics5.baidu.com/feed/38dbb6fd5266d0164f8e49cdd24aa40234fa3522.jpeg?token=c2cbcc6f929b40eb8881ceb4746c0e8c&s=1994CB1452725B94340248850300F0AB'
print(tmp2)
r = requests.get(tmp2)
with open('tmp.jpg', 'wb') as f:
f.write(r.content)
##
print("1111111111")
print("1111111111")
print("11111... | 22.730769 | 154 | 0.763113 | ##
import requests
tmp2='http://pics5.baidu.com/feed/38dbb6fd5266d0164f8e49cdd24aa40234fa3522.jpeg?token=c2cbcc6f929b40eb8881ceb4746c0e8c&s=1994CB1452725B94340248850300F0AB'
print(tmp2)
r = requests.get(tmp2)
with open('tmp.jpg', 'wb') as f:
f.write(r.content)
##
print("1111111111")
print("1111111111")
print("11111... | 0 | 0 | 0 |
c683ff8f817eb532dbd2635547cbcb925c679a26 | 37,972 | py | Python | watex/utils/tricks.py | WEgeophysics/watex | 21616ce35372a095c3dd624f82a5282b15cb2c91 | [
"MIT"
] | 3 | 2021-06-19T02:16:46.000Z | 2021-07-16T15:56:49.000Z | watex/utils/tricks.py | WEgeophysics/watex | 21616ce35372a095c3dd624f82a5282b15cb2c91 | [
"MIT"
] | null | null | null | watex/utils/tricks.py | WEgeophysics/watex | 21616ce35372a095c3dd624f82a5282b15cb2c91 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
===============================================================================
Copyright (c) 2021 Kouadio K. Laurent
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 wi... | 34.804766 | 95 | 0.559939 | # -*- coding: utf-8 -*-
"""
===============================================================================
Copyright (c) 2021 Kouadio K. Laurent
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 wi... | 0 | 0 | 0 |
ce8d96eab0af3942faea6af37906f7c4d05ffc12 | 278 | py | Python | test/sources/base.py | snallapa/mod_updater | 783ddf09da9d3909ce3d466f148218dbc51e29c9 | [
"MIT"
] | null | null | null | test/sources/base.py | snallapa/mod_updater | 783ddf09da9d3909ce3d466f148218dbc51e29c9 | [
"MIT"
] | 1 | 2021-05-15T20:08:33.000Z | 2021-05-22T21:19:41.000Z | test/sources/base.py | snallapa/mod_updater | 783ddf09da9d3909ce3d466f148218dbc51e29c9 | [
"MIT"
] | null | null | null | import unittest
import os
import shutil
| 25.272727 | 90 | 0.73741 | import unittest
import os
import shutil
class SourceTest(unittest.TestCase):
TEST_MODS_FOLDER = "test_mods"
def tearDown(self):
if os.path.exists(self.TEST_MODS_FOLDER) and os.path.isdir(self.TEST_MODS_FOLDER):
shutil.rmtree(self.TEST_MODS_FOLDER)
| 138 | 77 | 23 |
26b2299fc736855cc6f266946d8b6050b00ab180 | 23,051 | py | Python | QConnectBase/connection_base.py | test-fullautomation/robotframework-qconnect-base | b8a6b5bc89907f2a7f6cd69460f11bde496526bd | [
"Apache-2.0"
] | 1 | 2021-12-22T01:50:48.000Z | 2021-12-22T01:50:48.000Z | QConnectBase/connection_base.py | test-fullautomation/robotframework-qconnect-base | b8a6b5bc89907f2a7f6cd69460f11bde496526bd | [
"Apache-2.0"
] | 4 | 2022-02-08T12:24:42.000Z | 2022-03-28T13:07:43.000Z | QConnectBase/connection_base.py | test-fullautomation/robotframework-qconnect-base | b8a6b5bc89907f2a7f6cd69460f11bde496526bd | [
"Apache-2.0"
] | 1 | 2022-02-15T05:38:30.000Z | 2022-02-15T05:38:30.000Z | # Copyright 2020-2022 Robert Bosch Car Multimedia GmbH
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 35.463077 | 169 | 0.623747 | # Copyright 2020-2022 Robert Bosch Car Multimedia GmbH
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 515 | 20 | 73 |
34a9ec4fa2a33c1935b23d1582d87f9965cee308 | 40 | py | Python | app/commands/__init__.py | accordeiro/flask-skeleton | 71e2b6849a8dd95235bea8ffca274f844c069510 | [
"MIT"
] | 1 | 2015-06-24T14:04:40.000Z | 2015-06-24T14:04:40.000Z | app/commands/__init__.py | accordeiro/flask-skeleton | 71e2b6849a8dd95235bea8ffca274f844c069510 | [
"MIT"
] | null | null | null | app/commands/__init__.py | accordeiro/flask-skeleton | 71e2b6849a8dd95235bea8ffca274f844c069510 | [
"MIT"
] | null | null | null | from app.commands.create_admin import *
| 20 | 39 | 0.825 | from app.commands.create_admin import *
| 0 | 0 | 0 |
eca95506898e351c5ddca551279a45512721dfa1 | 715 | py | Python | pyconde/events/models.py | EuroPython/djep | afcccbdda483e5f6962ac97f0dc4c4c5ea67fd21 | [
"BSD-3-Clause"
] | 5 | 2015-01-02T14:33:14.000Z | 2021-08-03T10:19:07.000Z | pyconde/events/models.py | EuroPython/djep | afcccbdda483e5f6962ac97f0dc4c4c5ea67fd21 | [
"BSD-3-Clause"
] | null | null | null | pyconde/events/models.py | EuroPython/djep | afcccbdda483e5f6962ac97f0dc4c4c5ea67fd21 | [
"BSD-3-Clause"
] | 3 | 2015-08-30T09:45:03.000Z | 2017-04-08T12:15:22.000Z | from django.db import models
from django.utils.translation import ugettext_lazy as _
from pyconde.conference.models import Conference, CurrentConferenceManager
| 34.047619 | 76 | 0.714685 | from django.db import models
from django.utils.translation import ugettext_lazy as _
from pyconde.conference.models import Conference, CurrentConferenceManager
class Event(models.Model):
conference = models.ForeignKey(Conference, verbose_name=_("Conference"))
title = models.CharField(_("Title"), max_length=2... | 0 | 530 | 23 |
6cfa6cf4a8e279382f2f497f00619a53aa3c0534 | 2,527 | py | Python | xcode_build/xcode_build.py | 12star9/Python-Tools | dd5f1564670240f4b053355418669b274028e1a7 | [
"MIT"
] | 19 | 2018-08-24T08:03:12.000Z | 2021-05-17T08:12:29.000Z | xcode_build/xcode_build.py | 12star9/Python-Tools | dd5f1564670240f4b053355418669b274028e1a7 | [
"MIT"
] | 3 | 2021-03-19T01:47:04.000Z | 2022-01-13T01:23:02.000Z | xcode_build/xcode_build.py | 12star9/Python-Tools | dd5f1564670240f4b053355418669b274028e1a7 | [
"MIT"
] | 6 | 2019-07-07T16:51:12.000Z | 2021-05-20T06:31:27.000Z | # -*- coding: utf-8 -*-
import optparse
import os
import sys
import getpass
import json
import hashlib
import smtplib
import commands
import subprocess
import shutil
# import appicon_generate
from xcode_build_module import XCodeBuild
#主函数
current_work_path=os.getcwd()
projecttest_path=current_work_path+"/project_test... | 30.445783 | 224 | 0.67313 | # -*- coding: utf-8 -*-
import optparse
import os
import sys
import getpass
import json
import hashlib
import smtplib
import commands
import subprocess
import shutil
# import appicon_generate
from xcode_build_module import XCodeBuild
#主函数
def main():
# print buildArchivePath('project_test')
# return
# prin... | 1,580 | 0 | 45 |
0bf8ac14dd00049d22a2e0dc026034c8c1c67517 | 19,107 | py | Python | src/flags.py | kor-solidarity/screeps_python | 18479c00c2284eeddc583ad55e3ae9f9fc3e09ff | [
"MIT"
] | null | null | null | src/flags.py | kor-solidarity/screeps_python | 18479c00c2284eeddc583ad55e3ae9f9fc3e09ff | [
"MIT"
] | null | null | null | src/flags.py | kor-solidarity/screeps_python | 18479c00c2284eeddc583ad55e3ae9f9fc3e09ff | [
"MIT"
] | null | null | null | from defs import *
import random
import miscellaneous
import pathfinding
from _custom_constants import *
from structure_display import *
__pragma__('noalias', 'name')
__pragma__('noalias', 'undefined')
__pragma__('noalias', 'Infinity')
__pragma__('noalias', 'keys')
__pragma__('noalias', 'get')
__pragma__('noalias', 's... | 43.425 | 115 | 0.479615 | from defs import *
import random
import miscellaneous
import pathfinding
from _custom_constants import *
from structure_display import *
__pragma__('noalias', 'name')
__pragma__('noalias', 'undefined')
__pragma__('noalias', 'Infinity')
__pragma__('noalias', 'keys')
__pragma__('noalias', 'get')
__pragma__('noalias', 's... | 20,307 | 0 | 23 |
0f1ac96711ae26dda8377bc5d76c3872eea1afb7 | 7,311 | py | Python | kgtk/cli/remove_columns.py | shashank73744/kgtk | e8b45e35e97cbe788edeaf0962742e48b24e309c | [
"MIT"
] | null | null | null | kgtk/cli/remove_columns.py | shashank73744/kgtk | e8b45e35e97cbe788edeaf0962742e48b24e309c | [
"MIT"
] | null | null | null | kgtk/cli/remove_columns.py | shashank73744/kgtk | e8b45e35e97cbe788edeaf0962742e48b24e309c | [
"MIT"
] | null | null | null | """
Remove columns from a KGTK file.
"""
from argparse import Namespace, SUPPRESS
import typing
from kgtk.cli_argparse import KGTKArgumentParser, KGTKFiles
def add_arguments_extended(parser: KGTKArgumentParser, parsed_shared_args: Namespace):
"""
Parse arguments
Args:
parser (argparse.ArgumentPar... | 41.073034 | 153 | 0.616879 | """
Remove columns from a KGTK file.
"""
from argparse import Namespace, SUPPRESS
import typing
from kgtk.cli_argparse import KGTKArgumentParser, KGTKFiles
def parser():
return {
'help': 'Remove columns from a KGTK file.',
'description': 'Remove specific columns from a KGTK file.'
}
def add_... | 5,429 | 0 | 46 |
cf5c88ac7ec5d660e56f6f172e6ee872ace993e3 | 589 | py | Python | init_all.py | Frankkie/Thesis-Project-IF-Game | e44cc2f7ce19bbfa04de3a4fee959651024b276b | [
"MIT"
] | 1 | 2021-06-12T22:54:24.000Z | 2021-06-12T22:54:24.000Z | init_all.py | Frankkie/Thesis-Project-IF-Game | e44cc2f7ce19bbfa04de3a4fee959651024b276b | [
"MIT"
] | null | null | null | init_all.py | Frankkie/Thesis-Project-IF-Game | e44cc2f7ce19bbfa04de3a4fee959651024b276b | [
"MIT"
] | null | null | null | """
"""
from display import Display
from load import Loader
from game import Game
class Initializer:
"""
The class that handles the program before a game is launched.
"""
| 17.848485 | 65 | 0.619694 | """
"""
from display import Display
from load import Loader
from game import Game
class Initializer:
"""
The class that handles the program before a game is launched.
"""
def __init__(self):
self.display = Display(None)
self.loader = None
self.game = None
def load_game... | 343 | 0 | 54 |
1f57911b5e44b1ab4f8fa09702e065453ebc8590 | 3,666 | py | Python | bobinler.py | enderyilmazz/ElektronikKomponentKayitKontrolSistemi | 0a5219aa8d6d729b7a240176bc02770681eaf6fe | [
"MIT"
] | 1 | 2021-12-02T10:55:41.000Z | 2021-12-02T10:55:41.000Z | bobinler.py | enderyilmazz/ElektronikKomponentKayitKontrolSistemi | 0a5219aa8d6d729b7a240176bc02770681eaf6fe | [
"MIT"
] | null | null | null | bobinler.py | enderyilmazz/ElektronikKomponentKayitKontrolSistemi | 0a5219aa8d6d729b7a240176bc02770681eaf6fe | [
"MIT"
] | null | null | null | #171602012 - Ender Yılmaz
#Bilişim Sistemleri Mühendisliği
#Elektronik Komponent Kayıt Kontrol Sistemi
from PyQt5 import QtCore, QtGui, QtWidgets | 53.130435 | 99 | 0.688762 | #171602012 - Ender Yılmaz
#Bilişim Sistemleri Mühendisliği
#Elektronik Komponent Kayıt Kontrol Sistemi
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_bobinler(object):
def setupUi(self, bobinler):
bobinler.setObjectName("bobinler")
bobinler.resize(293, 190)
icon = QtGui.QIcon()
... | 3,446 | 5 | 76 |
204a60b80807dd098d39cbc5d789117dabc04f40 | 555 | py | Python | src/timeatlas/models/NN/util.py | fredmontet/timeatlas | 9a439a913ef9a8a1ef9833b42e5fb4e988d7e35e | [
"MIT"
] | 10 | 2020-08-25T09:23:02.000Z | 2021-01-12T14:00:35.000Z | src/timeatlas/models/NN/util.py | fredmontet/timeatlas | 9a439a913ef9a8a1ef9833b42e5fb4e988d7e35e | [
"MIT"
] | 140 | 2020-06-30T11:59:47.000Z | 2021-08-23T20:58:43.000Z | src/timeatlas/models/NN/util.py | fredmontet/timeatlas | 9a439a913ef9a8a1ef9833b42e5fb4e988d7e35e | [
"MIT"
] | null | null | null | import numpy as np
def chunkify(tsd, seq_len):
"""
Splits a TimeSeriesDataset into chunks of length seq_len
Args:
tsd: TimeSeriesDataset object
seq_len: length of the subsequences to return
Returns: numpy arrays with chunks of size seq_len
"""
x, y = [], []
for s in tsd... | 21.346154 | 60 | 0.569369 | import numpy as np
def chunkify(tsd, seq_len):
"""
Splits a TimeSeriesDataset into chunks of length seq_len
Args:
tsd: TimeSeriesDataset object
seq_len: length of the subsequences to return
Returns: numpy arrays with chunks of size seq_len
"""
x, y = [], []
for s in tsd... | 0 | 0 | 0 |
5adb499c490f3f509aec32ba50dc8a30ee53dbe1 | 861 | py | Python | leon_utils/clime.py | Leonerist/YoloX-Track-Plate_Recognition-MoreModules | fde4a001c0088d4bfe7a027f31040e732ec8b519 | [
"Apache-2.0"
] | 7 | 2022-03-12T09:09:44.000Z | 2022-03-20T05:19:23.000Z | leon_utils/clime.py | Leonerist/YoloX-Track-Plate_Recognition-MoreModules | fde4a001c0088d4bfe7a027f31040e732ec8b519 | [
"Apache-2.0"
] | null | null | null | leon_utils/clime.py | Leonerist/YoloX-Track-Plate_Recognition-MoreModules | fde4a001c0088d4bfe7a027f31040e732ec8b519 | [
"Apache-2.0"
] | null | null | null | import cv2
import uuid
import os
# tar为目标车牌号的后4位
| 25.323529 | 61 | 0.541231 | import cv2
import uuid
import os
def pic_save(tar_num,pic,root):
root = os.path.join(root,'clime_pics')
file_name = os.path.join(root,tar_num)
if not os.path.exists(file_name ):
os.mkdir(file_name)
ran = uuid.uuid4().hex
pic_name = os.path.join(file_name , '{}.jpg'.format(ran))
cv2.imw... | 787 | 0 | 45 |
d33b7ffbe95fb1679388cf5f2d1ef3c68a73def9 | 183 | py | Python | xudo/commands/__init__.py | Ostralyan/xudo | d4ab6ee01fef52e8799ff3e6a76234351620447e | [
"MIT"
] | 3 | 2017-04-05T17:30:13.000Z | 2018-09-18T02:14:40.000Z | xudo/commands/__init__.py | Ostralyan/xudo | d4ab6ee01fef52e8799ff3e6a76234351620447e | [
"MIT"
] | null | null | null | xudo/commands/__init__.py | Ostralyan/xudo | d4ab6ee01fef52e8799ff3e6a76234351620447e | [
"MIT"
] | 2 | 2017-05-30T17:42:31.000Z | 2017-12-14T20:14:31.000Z | from .logs import *
from .pull import *
from .build import *
from .clean import *
from .prune import *
from .test import *
from .watch import *
from .jooq import *
from .dbpw import * | 20.333333 | 20 | 0.710383 | from .logs import *
from .pull import *
from .build import *
from .clean import *
from .prune import *
from .test import *
from .watch import *
from .jooq import *
from .dbpw import * | 0 | 0 | 0 |
eafe07d9b54c8a2808bc734ee1b880f491578b49 | 1,861 | py | Python | douban/douban/settings.py | ziyiyizi/crawl_web | 191b0839d9d095adccd8c2ab893d35c54dfc4053 | [
"Apache-2.0"
] | 11 | 2016-08-01T09:28:23.000Z | 2021-11-08T08:45:54.000Z | douban/douban/settings.py | ziyiyizi/crawl_web | 191b0839d9d095adccd8c2ab893d35c54dfc4053 | [
"Apache-2.0"
] | null | null | null | douban/douban/settings.py | ziyiyizi/crawl_web | 191b0839d9d095adccd8c2ab893d35c54dfc4053 | [
"Apache-2.0"
] | 4 | 2016-09-09T04:45:39.000Z | 2019-10-29T06:34:39.000Z | # -*- coding: utf-8 -*-
# Scrapy settings for douban project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/latest/... | 33.232143 | 80 | 0.785599 | # -*- coding: utf-8 -*-
# Scrapy settings for douban project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/latest/... | 0 | 0 | 0 |
db1ca0e3ea0fb2786dbc481f81b1c276be13cf33 | 613 | py | Python | parrainage/app/management/commands/create_initial_admin_user.py | ronnix/parrainage | cc5a94b1dd7c5654ff35312c60930e06d327103d | [
"MIT"
] | 1 | 2022-02-20T02:37:07.000Z | 2022-02-20T02:37:07.000Z | parrainage/app/management/commands/create_initial_admin_user.py | ronnix/parrainage | cc5a94b1dd7c5654ff35312c60930e06d327103d | [
"MIT"
] | 41 | 2022-02-17T09:50:08.000Z | 2022-03-09T07:53:25.000Z | parrainage/app/management/commands/create_initial_admin_user.py | ronnix/parrainage | cc5a94b1dd7c5654ff35312c60930e06d327103d | [
"MIT"
] | null | null | null | import os
from django.core.management.base import BaseCommand
from django.contrib.auth import get_user_model
| 26.652174 | 88 | 0.683524 | import os
from django.core.management.base import BaseCommand
from django.contrib.auth import get_user_model
class Command(BaseCommand):
help = "Créer un utilisateur admin initial"
def handle(self, *args, **options):
User = get_user_model()
if User.objects.exists():
return
... | 398 | 82 | 23 |
54b127d16e206063b8d9142f1e864c12d75bf507 | 46,092 | py | Python | astroquery/esa/jwst/tests/test_jwsttap.py | mfisherlevine/astroquery | cda88ef18b308563e86ee79bcc78e4ac59874df1 | [
"BSD-3-Clause"
] | null | null | null | astroquery/esa/jwst/tests/test_jwsttap.py | mfisherlevine/astroquery | cda88ef18b308563e86ee79bcc78e4ac59874df1 | [
"BSD-3-Clause"
] | null | null | null | astroquery/esa/jwst/tests/test_jwsttap.py | mfisherlevine/astroquery | cda88ef18b308563e86ee79bcc78e4ac59874df1 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
===============
eJWST TAP tests
===============
European Space Astronomy Centre (ESAC)
European Space Agency (ESA)
"""
import os
import shutil
from unittest.mock import MagicMock
import astropy.units as u
import numpy as np
import pytest
from astrop... | 43.897143 | 115 | 0.595266 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
===============
eJWST TAP tests
===============
European Space Astronomy Centre (ESAC)
European Space Agency (ESA)
"""
import os
import shutil
from unittest.mock import MagicMock
import astropy.units as u
import numpy as np
import pytest
from astrop... | 44,042 | 669 | 181 |
90b56e9072ff77759975646cfa3e82041694b2d4 | 737 | py | Python | docs/conf.py | ShantamShorewala/aizynthfinder | 6b15d5846558b14c4ce3c353727d9d676af7f6fb | [
"MIT"
] | null | null | null | docs/conf.py | ShantamShorewala/aizynthfinder | 6b15d5846558b14c4ce3c353727d9d676af7f6fb | [
"MIT"
] | null | null | null | docs/conf.py | ShantamShorewala/aizynthfinder | 6b15d5846558b14c4ce3c353727d9d676af7f6fb | [
"MIT"
] | null | null | null | import os
import sys
sys.path.insert(0, os.path.abspath("."))
project = "aizynthfinder"
copyright = "2020-2022, Molecular AI group"
author = "Molecular AI group"
release = "3.3.0"
# This make sure that the cli_help.txt file is properly formated
with open("cli_help.txt", "r") as fileobj:
lines = fileobj.read().sp... | 25.413793 | 86 | 0.694708 | import os
import sys
sys.path.insert(0, os.path.abspath("."))
project = "aizynthfinder"
copyright = "2020-2022, Molecular AI group"
author = "Molecular AI group"
release = "3.3.0"
# This make sure that the cli_help.txt file is properly formated
with open("cli_help.txt", "r") as fileobj:
lines = fileobj.read().sp... | 0 | 0 | 0 |
c41bc50ee88e3138d6b8c2fd1482bb7a081971bc | 2,351 | py | Python | main.py | johangenis/day-18-start | 1d479505b0bb3223e6e8032303669d9f9d0c076c | [
"MIT"
] | null | null | null | main.py | johangenis/day-18-start | 1d479505b0bb3223e6e8032303669d9f9d0c076c | [
"MIT"
] | null | null | null | main.py | johangenis/day-18-start | 1d479505b0bb3223e6e8032303669d9f9d0c076c | [
"MIT"
] | null | null | null | import _tkinter
from turtle import Turtle, Screen
import random
tim = Turtle()
tim.shape("turtle")
tim.color("red")
tim.speed("fastest")
# r = random.random()
# b = random.random()
# g = random.random()
# rgb = (random.random(), random.random(), random.random())
draw_spirograph(5)
# for shape_sides_n in range(3,... | 20.991071 | 65 | 0.612505 | import _tkinter
from turtle import Turtle, Screen
import random
tim = Turtle()
tim.shape("turtle")
tim.color("red")
tim.speed("fastest")
# r = random.random()
# b = random.random()
# g = random.random()
# rgb = (random.random(), random.random(), random.random())
def draw_shapes(num_sides):
angle = 360/num_sides
... | 1,588 | 0 | 207 |
2b1e1131e827c40ddcb55389af6b293ec4f32cb1 | 2,715 | py | Python | ml/jointclassifier/joint_args.py | DavidThe4sian/marvin | 1dddd8cdb8be55d3b553df1b2cf89e8b6b0538b6 | [
"MIT"
] | 4 | 2021-05-14T02:23:52.000Z | 2021-12-28T10:33:18.000Z | ml/jointclassifier/joint_args.py | DavidThe4sian/marvin | 1dddd8cdb8be55d3b553df1b2cf89e8b6b0538b6 | [
"MIT"
] | null | null | null | ml/jointclassifier/joint_args.py | DavidThe4sian/marvin | 1dddd8cdb8be55d3b553df1b2cf89e8b6b0538b6 | [
"MIT"
] | 3 | 2021-05-31T06:38:59.000Z | 2021-09-29T02:44:22.000Z | from dataclasses import dataclass, field
from typing import Optional
from transformers import (
TrainingArguments
)
@dataclass
class ModelArguments:
"""
Arguments pertaining to which model/config/tokenizer we are going to fine-tune, or train from scratch.
"""
model_nick: Optional[str] = field... | 27.989691 | 124 | 0.622468 | from dataclasses import dataclass, field
from typing import Optional
from transformers import (
TrainingArguments
)
@dataclass
class ModelArguments:
"""
Arguments pertaining to which model/config/tokenizer we are going to fine-tune, or train from scratch.
"""
model_nick: Optional[str] = field... | 0 | 0 | 0 |
89af48b3ab87b7d65ea88b68ffd8b3bf3ae91a67 | 226 | py | Python | example/JKBrickworks/1701_printer/print_space.py | HomeIT4all/micropython-ev3dev | fd59b55eb840d6e83a1e78d76a363af12c6d7f81 | [
"MIT"
] | 6 | 2019-04-16T08:32:38.000Z | 2021-09-27T12:18:46.000Z | example/JKBrickworks/1701_printer/print_space.py | HomeIT4all/micropython-ev3dev | fd59b55eb840d6e83a1e78d76a363af12c6d7f81 | [
"MIT"
] | null | null | null | example/JKBrickworks/1701_printer/print_space.py | HomeIT4all/micropython-ev3dev | fd59b55eb840d6e83a1e78d76a363af12c6d7f81 | [
"MIT"
] | 3 | 2019-12-22T16:13:38.000Z | 2021-09-27T12:19:04.000Z |
from project import motor
from project import variables
# My Blocks
from lower_pen import lower_pen
from lift_pen import lift_pen
| 17.384615 | 39 | 0.756637 |
from project import motor
from project import variables
# My Blocks
from lower_pen import lower_pen
from lift_pen import lift_pen
def print_space(size):
seg4 = variables['Seg4']
motor['A'].on_for_degrees(25, seg4)
| 70 | 0 | 23 |
12811944daf601d9b30ebfd6544d6de22d011f0a | 6,181 | py | Python | adminfind.py | blackXploits/AdminFind2 | 6222de245116b0fb77521ed54449a86a73a3f1d3 | [
"MIT"
] | null | null | null | adminfind.py | blackXploits/AdminFind2 | 6222de245116b0fb77521ed54449a86a73a3f1d3 | [
"MIT"
] | null | null | null | adminfind.py | blackXploits/AdminFind2 | 6222de245116b0fb77521ed54449a86a73a3f1d3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: BlackXploits
# Telegram: @BlackXploits
# Please don't delete this COPYRIGHT
import argparse
import subprocess
import signal
import Queue
import time
from threading import Thread, Lock
from sys import argv, stdout
from os import getpid, kill
w = '\033[0m'
y = ... | 31.535714 | 184 | 0.626759 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: BlackXploits
# Telegram: @BlackXploits
# Please don't delete this COPYRIGHT
import argparse
import subprocess
import signal
import Queue
import time
from threading import Thread, Lock
from sys import argv, stdout
from os import getpid, kill
w = '\033[0m'
y = ... | 2,913 | -9 | 265 |
8ac760cb94d7eff35d38268345a0ee40b72f61bd | 249 | py | Python | Day 2/OutPut.py | Soundarya0/30-Days-of-Code | c7b34826c96eaef97a4e4c2dd9e8a30a9daaf990 | [
"MIT"
] | null | null | null | Day 2/OutPut.py | Soundarya0/30-Days-of-Code | c7b34826c96eaef97a4e4c2dd9e8a30a9daaf990 | [
"MIT"
] | null | null | null | Day 2/OutPut.py | Soundarya0/30-Days-of-Code | c7b34826c96eaef97a4e4c2dd9e8a30a9daaf990 | [
"MIT"
] | null | null | null | Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 23:11:46) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>>=======30 Days of Code/Day 2/Operators.py ======
12.00
20
8
15
>>>
| 24.9 | 95 | 0.606426 | Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 23:11:46) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>>=======30 Days of Code/Day 2/Operators.py ======
12.00
20
8
15
>>>
| 0 | 0 | 0 |
e674cdc55fcf16b081aab4e42eb70a114f2254ff | 61,641 | py | Python | tensorflow_probability/python/internal/distribution_util_test.py | RogerFrigola/probability | cfb507b7ede2c1ba753bffc5ea827b9c97c37bdc | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/internal/distribution_util_test.py | RogerFrigola/probability | cfb507b7ede2c1ba753bffc5ea827b9c97c37bdc | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/internal/distribution_util_test.py | RogerFrigola/probability | cfb507b7ede2c1ba753bffc5ea827b9c97c37bdc | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 36.259412 | 80 | 0.633507 | # Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 52,649 | 4,422 | 2,527 |
409adb4c2876471e91efadcd006af57a80bddfb1 | 839 | py | Python | jobs/urls.py | mkimartinez/Lyfey | 8a27ef7fea92146f043c68c7ef5ee3672014c3fc | [
"MIT"
] | null | null | null | jobs/urls.py | mkimartinez/Lyfey | 8a27ef7fea92146f043c68c7ef5ee3672014c3fc | [
"MIT"
] | null | null | null | jobs/urls.py | mkimartinez/Lyfey | 8a27ef7fea92146f043c68c7ef5ee3672014c3fc | [
"MIT"
] | null | null | null | from django.conf.urls import url
from django.contrib.staticfiles import views as static_views
from django.conf.urls.static import static
from django.conf import settings
import jobs.views as views
from django.views.generic import ListView,DetailView
from jobs.models import Job
from rest_framework.urlpatterns import for... | 39.952381 | 79 | 0.705602 | from django.conf.urls import url
from django.contrib.staticfiles import views as static_views
from django.conf.urls.static import static
from django.conf import settings
import jobs.views as views
from django.views.generic import ListView,DetailView
from jobs.models import Job
from rest_framework.urlpatterns import for... | 0 | 0 | 0 |
924962304e469d47a501a8bfc37a4a68f7833772 | 3,253 | py | Python | 2018/day15/combat.py | scrubskip/adventofcode2018 | 8149908d1239759597fda575432cf3ec99019dc0 | [
"Apache-2.0"
] | null | null | null | 2018/day15/combat.py | scrubskip/adventofcode2018 | 8149908d1239759597fda575432cf3ec99019dc0 | [
"Apache-2.0"
] | null | null | null | 2018/day15/combat.py | scrubskip/adventofcode2018 | 8149908d1239759597fda575432cf3ec99019dc0 | [
"Apache-2.0"
] | null | null | null |
# Sorts y coordinate first, then x.
if __name__ == "__main__":
main()
| 29.844037 | 89 | 0.57178 |
def main():
pass
# Sorts y coordinate first, then x.
def POSITION_COMPARATOR(x): return (x[1], x[0])
class Board:
def __init__(self):
self.state = []
self.width = -1
self.units = []
def add_row(self, row):
self.state.append(row)
if (self.width == -1):
... | 2,204 | 878 | 91 |
dcae4afdf4101782c5dc6dab3ba349f227806355 | 1,564 | py | Python | ironmq-alert-pagerduty.py | OnBeep/ironmq-alert-pagerduty | 13e0fb906d494ec156069051731bf71d5c1ad257 | [
"Apache-2.0"
] | 1 | 2015-01-26T19:41:56.000Z | 2015-01-26T19:41:56.000Z | ironmq-alert-pagerduty.py | OnBeep/ironmq-alert-pagerduty | 13e0fb906d494ec156069051731bf71d5c1ad257 | [
"Apache-2.0"
] | null | null | null | ironmq-alert-pagerduty.py | OnBeep/ironmq-alert-pagerduty | 13e0fb906d494ec156069051731bf71d5c1ad257 | [
"Apache-2.0"
] | null | null | null | import argparse
import json
import pprint
import pygerduty
import time
import yaml
parser = argparse.ArgumentParser(description="Simple argument parser")
parser.add_argument("-config", type=str, required=False,
help="The location of a file containing a JSON payload.")
parser.add_argument("-payload", type=str, ... | 30.076923 | 70 | 0.702685 | import argparse
import json
import pprint
import pygerduty
import time
import yaml
parser = argparse.ArgumentParser(description="Simple argument parser")
parser.add_argument("-config", type=str, required=False,
help="The location of a file containing a JSON payload.")
parser.add_argument("-payload", type=str, ... | 0 | 0 | 0 |
3ea59de0c0a271acba84f58574d3a231f8250293 | 776 | py | Python | day02/main.py | Floozutter/aoc-2021-python | 29f670d5026d4fe834efccdfedc362052549896b | [
"Unlicense"
] | null | null | null | day02/main.py | Floozutter/aoc-2021-python | 29f670d5026d4fe834efccdfedc362052549896b | [
"Unlicense"
] | null | null | null | day02/main.py | Floozutter/aoc-2021-python | 29f670d5026d4fe834efccdfedc362052549896b | [
"Unlicense"
] | null | null | null | INPUTPATH = "input.txt"
#INPUTPATH = "input-test.txt"
with open(INPUTPATH) as ifile:
raw = ifile.read()
commands = tuple(map(parse_command, raw.strip().split("\n")))
h = d = 0
for word, n in commands:
match word:
case "forward":
h += n
case "down":
d += n
case "u... | 20.972973 | 61 | 0.483247 | INPUTPATH = "input.txt"
#INPUTPATH = "input-test.txt"
with open(INPUTPATH) as ifile:
raw = ifile.read()
def parse_command(line: str) -> tuple[str, int]:
word, n = line.split()
return word, int(n)
commands = tuple(map(parse_command, raw.strip().split("\n")))
h = d = 0
for word, n in commands:
match wor... | 78 | 0 | 23 |
f0a75dd3ab42a6474f2b5a90b908b179edc5d010 | 971 | py | Python | source/scripts/python/ducktype/source/ducktype.py | lights0123/core | 85b4cf004280f64c144a7111236a03021e39fdf9 | [
"Apache-2.0"
] | 1 | 2021-03-12T11:07:19.000Z | 2021-03-12T11:07:19.000Z | source/scripts/python/ducktype/source/ducktype.py | lights0123/core | 85b4cf004280f64c144a7111236a03021e39fdf9 | [
"Apache-2.0"
] | null | null | null | source/scripts/python/ducktype/source/ducktype.py | lights0123/core | 85b4cf004280f64c144a7111236a03021e39fdf9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
| 22.068182 | 44 | 0.608651 | #!/usr/bin/env python3
def multiply(left, right):
result = left * right;
print(left, ' * ', right, ' = ', result);
return result;
def divide(left, right):
if right != 0.0:
result = left / right;
print(left, ' / ', right, ' = ', result);
else:
print('Invalid right operand: ', right);
return result;
def su... | 764 | 0 | 184 |
97f22bfa35408db0c6a4b26c331d672aa870f000 | 439 | py | Python | tests/core/usage/audit_usage_test.py | paulo-sampaio/detect-secrets | 73ffbc35a72cb316d9e1842cc131b6098cf3c36a | [
"Apache-2.0"
] | 2,212 | 2018-04-03T20:58:42.000Z | 2022-03-31T17:58:38.000Z | tests/core/usage/audit_usage_test.py | paulo-sampaio/detect-secrets | 73ffbc35a72cb316d9e1842cc131b6098cf3c36a | [
"Apache-2.0"
] | 354 | 2018-04-03T16:29:55.000Z | 2022-03-31T18:26:26.000Z | tests/core/usage/audit_usage_test.py | paulo-sampaio/detect-secrets | 73ffbc35a72cb316d9e1842cc131b6098cf3c36a | [
"Apache-2.0"
] | 298 | 2018-04-02T19:35:15.000Z | 2022-03-28T04:52:14.000Z | import pytest
from detect_secrets.core.usage import ParserBuilder
@pytest.fixture
| 23.105263 | 55 | 0.740319 | import pytest
from detect_secrets.core.usage import ParserBuilder
@pytest.fixture
def parser():
return ParserBuilder().add_console_use_arguments()
def test_normal_mode_requires_single_file(parser):
with pytest.raises(SystemExit):
parser.parse_args(['audit', 'fileA', 'fileB'])
def test_diff_mode_r... | 284 | 0 | 68 |
6c5e94ad965376f9d4defe5b2bf499a9b31d9ca1 | 6,938 | py | Python | extraction.py | davarbri/jpegForensics | 66f20b861655481c4575430858977a80afddff65 | [
"CC0-1.0"
] | null | null | null | extraction.py | davarbri/jpegForensics | 66f20b861655481c4575430858977a80afddff65 | [
"CC0-1.0"
] | null | null | null | extraction.py | davarbri/jpegForensics | 66f20b861655481c4575430858977a80afddff65 | [
"CC0-1.0"
] | null | null | null | # !/usr/bin/python3
# David Arboledas Brihuega
# November 2021
#
# ------------------------------------------------------
# This script is called by extractForensicJPEG to get
# all the forensic data embebed in the jpeg files
# --------------------------------------------------------
# import sys
import binascii
impor... | 34.346535 | 79 | 0.53488 | # !/usr/bin/python3
# David Arboledas Brihuega
# November 2021
#
# ------------------------------------------------------
# This script is called by extractForensicJPEG to get
# all the forensic data embebed in the jpeg files
# --------------------------------------------------------
# import sys
import binascii
impor... | 6,088 | 0 | 146 |
d967be55e6cb52da3762f78abab30bc03ed2c8b0 | 391 | py | Python | blogs/migrations/0033_emailer_notification_text.py | daaawx/bearblog | 5e01e4443c632ff53b918cf8a0d3b1c648b352fe | [
"MIT"
] | 657 | 2020-05-26T16:16:07.000Z | 2022-03-26T22:35:01.000Z | blogs/migrations/0033_emailer_notification_text.py | daaawx/bearblog | 5e01e4443c632ff53b918cf8a0d3b1c648b352fe | [
"MIT"
] | 107 | 2020-05-26T17:45:04.000Z | 2022-03-17T08:24:00.000Z | blogs/migrations/0033_emailer_notification_text.py | daaawx/bearblog | 5e01e4443c632ff53b918cf8a0d3b1c648b352fe | [
"MIT"
] | 42 | 2020-05-26T23:57:58.000Z | 2022-03-15T04:20:26.000Z | # Generated by Django 3.0.7 on 2021-04-08 09:51
from django.db import migrations, models
| 20.578947 | 47 | 0.603581 | # Generated by Django 3.0.7 on 2021-04-08 09:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blogs', '0032_auto_20210408_0927'),
]
operations = [
migrations.AddField(
model_name='emailer',
name='notification_t... | 0 | 277 | 23 |
1bd66f574eb18045fc6794bdbca4cfae4cb4f514 | 2,388 | py | Python | src/server.py | maxalex301/toolchains | 0e8a5021e17d9ef36cf82a920f712446f5964a75 | [
"MIT"
] | null | null | null | src/server.py | maxalex301/toolchains | 0e8a5021e17d9ef36cf82a920f712446f5964a75 | [
"MIT"
] | null | null | null | src/server.py | maxalex301/toolchains | 0e8a5021e17d9ef36cf82a920f712446f5964a75 | [
"MIT"
] | null | null | null | import subprocess
from functools import reduce
| 29.481481 | 98 | 0.550251 | import subprocess
from functools import reduce
def escape(args):
result = []
for a in args:
if ' ' in a:
result.append("'{}'".format(a))
else:
result.append(a)
return result
class Server:
def __init__(self, host, port, user):
self.user = user
sel... | 1,924 | -8 | 423 |
e375caa94d739899aaba48b2a38229c7a7c23855 | 13,044 | py | Python | src/tenants/models.py | litedesk/litedesk-webserver-provision | 1576b9d3e5e2e64d1136d276767c2710cfb1938f | [
"Apache-2.0"
] | 1 | 2016-01-18T08:19:22.000Z | 2016-01-18T08:19:22.000Z | src/tenants/models.py | litedesk/litedesk-webserver-provision | 1576b9d3e5e2e64d1136d276767c2710cfb1938f | [
"Apache-2.0"
] | null | null | null | src/tenants/models.py | litedesk/litedesk-webserver-provision | 1576b9d3e5e2e64d1136d276767c2710cfb1938f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2014, Deutsche Telekom AG - Laboratories (T-Labs)
#
# 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/lice... | 33.880519 | 96 | 0.66797 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2014, Deutsche Telekom AG - Laboratories (T-Labs)
#
# 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/lice... | 6,875 | 4,093 | 161 |
12b095adb60425a8605df3b0b9f6a57257c592e1 | 5,067 | py | Python | seaworthy/containers/rabbitmq.py | praekeltfoundation/seaworthy | 6f10a19b45d4ea1dc3bd0553cc4d0438696c079c | [
"BSD-3-Clause"
] | 31 | 2017-11-21T12:21:31.000Z | 2021-11-16T11:50:42.000Z | seaworthy/containers/rabbitmq.py | praekeltfoundation/seaworthy | 6f10a19b45d4ea1dc3bd0553cc4d0438696c079c | [
"BSD-3-Clause"
] | 91 | 2017-08-16T14:24:52.000Z | 2020-01-16T10:13:52.000Z | seaworthy/containers/rabbitmq.py | praekeltfoundation/seaworthy | 6f10a19b45d4ea1dc3bd0553cc4d0438696c079c | [
"BSD-3-Clause"
] | 3 | 2018-10-13T07:56:02.000Z | 2019-02-14T12:29:53.000Z | """
RabbitMQ container definition.
"""
from seaworthy.definitions import ContainerDefinition
from seaworthy.utils import output_lines
class RabbitMQContainer(ContainerDefinition):
"""
RabbitMQ container definition.
.. todo::
Write more docs.
"""
# There seems to be a weird interaction b... | 34.006711 | 78 | 0.594632 | """
RabbitMQ container definition.
"""
from seaworthy.definitions import ContainerDefinition
from seaworthy.utils import output_lines
def _parse_rabbitmq_user(user_line):
user, tags = user_line.split('\t', 1)
tags = tags.strip('[]').split(', ')
return (user, tags)
class RabbitMQContainer(ContainerDefin... | 121 | 0 | 23 |
b9fca280646e6e89fc5b84533dc2566e7941b0bd | 9,410 | py | Python | Lib/gds/burp/api.py | mwielgoszewski/jython-burp-api | 002383f7acc5fb237e3804fe5bd2aa2950a0240d | [
"0BSD"
] | 134 | 2015-01-21T14:22:42.000Z | 2021-09-02T10:52:43.000Z | Lib/gds/burp/api.py | d453d2/burp-jython-console | 3cec3200ede2da0f1cdbf935efc340f073c07ea2 | [
"0BSD"
] | 7 | 2015-01-19T16:54:45.000Z | 2018-10-10T15:10:13.000Z | Lib/gds/burp/api.py | d453d2/burp-jython-console | 3cec3200ede2da0f1cdbf935efc340f073c07ea2 | [
"0BSD"
] | 29 | 2015-02-13T14:08:23.000Z | 2021-12-17T03:17:40.000Z | # -*- coding: utf-8 -*-
'''
gds.burp.api
~~~~~~~~~~~~
This module implements the Jython Burp Plugin API.
Plugins written in Jython can implement the interfaces in this
package in order to register for various methods exposed by
Burp Extender.
'''
from .core import Interface
__all__ = [
'INewScanIssueHandler',
... | 27.595308 | 71 | 0.679809 | # -*- coding: utf-8 -*-
'''
gds.burp.api
~~~~~~~~~~~~
This module implements the Jython Burp Plugin API.
Plugins written in Jython can implement the interfaces in this
package in order to register for various methods exposed by
Burp Extender.
'''
from .core import Interface
__all__ = [
'INewScanIssueHandler',
... | 0 | 0 | 0 |
f08ef18d930caa30a2711dbb9e63e39d48e1c32a | 498 | py | Python | SinGAN/tasks/train.py | cbosoft/SinGAN | c3c950ddf59ae57e4685adc555f5cb4723bd7e78 | [
"MIT"
] | null | null | null | SinGAN/tasks/train.py | cbosoft/SinGAN | c3c950ddf59ae57e4685adc555f5cb4723bd7e78 | [
"MIT"
] | null | null | null | SinGAN/tasks/train.py | cbosoft/SinGAN | c3c950ddf59ae57e4685adc555f5cb4723bd7e78 | [
"MIT"
] | null | null | null | from SinGAN.training import train
from SinGAN.util import read_image, adjust_scales_to_image
| 26.210526 | 59 | 0.660643 | from SinGAN.training import train
from SinGAN.util import read_image, adjust_scales_to_image
def run_task_train(cfg):
# Read training image
real = read_image(cfg.training.image, cfg)
adjust_scales_to_image(real, cfg)
# Data store for training params/weights
data = Gs, Zs, reals, noise_a... | 377 | 0 | 24 |