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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fe5faeef8ee1634c0f11e3b81c2ab55c90744a4f | 1,239 | py | Python | tests/test_utils.py | cenyk1230/cogdl | fa1f74d5c3a15b5a52abfc7cd3f04dce4b7dbcce | [
"MIT"
] | 1,072 | 2019-08-02T05:46:21.000Z | 2022-03-31T07:51:53.000Z | tests/test_utils.py | cenyk1230/cogdl | fa1f74d5c3a15b5a52abfc7cd3f04dce4b7dbcce | [
"MIT"
] | 96 | 2019-08-05T17:27:22.000Z | 2022-03-03T08:36:57.000Z | tests/test_utils.py | cenyk1230/cogdl | fa1f74d5c3a15b5a52abfc7cd3f04dce4b7dbcce | [
"MIT"
] | 299 | 2019-08-08T07:33:10.000Z | 2022-03-31T09:30:07.000Z | from sklearn.metrics import f1_score
import torch
from cogdl.utils import build_args_from_dict
from cogdl.utils import accuracy, multiclass_f1, multilabel_f1, bce_with_logits_loss, cross_entropy_loss
if __name__ == "__main__":
test_build_args_from_dict()
| 31.769231 | 104 | 0.678773 | from sklearn.metrics import f1_score
import torch
from cogdl.utils import build_args_from_dict
from cogdl.utils import accuracy, multiclass_f1, multilabel_f1, bce_with_logits_loss, cross_entropy_loss
def test_build_args_from_dict():
dic = {"arg1": "value1", "arg2": 2, "arg3": 0.3}
args = build_args_from_dict(... | 930 | 0 | 46 |
c38a95aad8565a4d121edf838f6134f6a4a283f3 | 9,493 | py | Python | analogistics/supply_chain/P8_performance_assessment/wh_indexes.py | aletuf93/analogistics | c5f76910683bc3a1cc6f24799f0299232b4fc522 | [
"MIT"
] | null | null | null | analogistics/supply_chain/P8_performance_assessment/wh_indexes.py | aletuf93/analogistics | c5f76910683bc3a1cc6f24799f0299232b4fc522 | [
"MIT"
] | null | null | null | analogistics/supply_chain/P8_performance_assessment/wh_indexes.py | aletuf93/analogistics | c5f76910683bc3a1cc6f24799f0299232b4fc522 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from analogistics.statistics import time_series as ts
from analogistics.supply_chain.information_framework import movementfunctionfromInventory
from analogistics.explore import paretoDataframe
def calculatePopularity(movem... | 27.83871 | 107 | 0.651006 | # -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from analogistics.statistics import time_series as ts
from analogistics.supply_chain.information_framework import movementfunctionfromInventory
from analogistics.explore import paretoDataframe
def calculatePopularity(movem... | 0 | 0 | 0 |
871d15c7fed0e7ecb34d5e18a42a899c21404f83 | 202 | py | Python | data_collection/gazette/spiders/sc_forquilhinha.py | kaiocp/querido-diario | 86004049c6eee305e13066cf3607d30849bb099a | [
"MIT"
] | 454 | 2018-04-07T03:32:57.000Z | 2020-08-17T19:56:22.000Z | data_collection/gazette/spiders/sc_forquilhinha.py | kaiocp/querido-diario | 86004049c6eee305e13066cf3607d30849bb099a | [
"MIT"
] | 254 | 2020-08-18T14:09:43.000Z | 2022-03-28T11:30:51.000Z | data_collection/gazette/spiders/sc_forquilhinha.py | kaiocp/querido-diario | 86004049c6eee305e13066cf3607d30849bb099a | [
"MIT"
] | 183 | 2018-04-11T15:09:37.000Z | 2020-08-15T18:55:11.000Z | from gazette.spiders.base.fecam import FecamGazetteSpider
| 25.25 | 57 | 0.777228 | from gazette.spiders.base.fecam import FecamGazetteSpider
class ScForquilhinhaSpider(FecamGazetteSpider):
name = "sc_forquilhinha"
FECAM_QUERY = "cod_entidade:94"
TERRITORY_ID = "4205456"
| 0 | 120 | 23 |
7d2d81b868d78570f829b82f7e1a603d8f307c26 | 25,424 | py | Python | causallearn/score/LocalScoreFunction.py | softsys4ai/causal-config-labyrinth | 4f50f9ff15429b0ac6ad0a99fbe4cfdd17e360fc | [
"MIT"
] | 15 | 2022-01-20T12:35:35.000Z | 2022-03-24T16:25:24.000Z | causallearn/score/LocalScoreFunction.py | softsys4ai/unicorn | 4f50f9ff15429b0ac6ad0a99fbe4cfdd17e360fc | [
"MIT"
] | 14 | 2022-01-23T00:20:00.000Z | 2022-02-22T01:40:43.000Z | causallearn/score/LocalScoreFunction.py | softsys4ai/causal-config-labyrinth | 4f50f9ff15429b0ac6ad0a99fbe4cfdd17e360fc | [
"MIT"
] | 1 | 2022-02-23T08:59:24.000Z | 2022-02-23T08:59:24.000Z | import math
import pandas as pd
from causallearn.utils.ScoreUtils import *
def local_score_BIC(Data, i, PAi, parameters=None):
'''
Calculate the *negative* local score with BIC for the linear Gaussian continue data case
Parameters
----------
Data: ndarray, (sample, features)
i: current inde... | 40.484076 | 115 | 0.48411 | import math
import pandas as pd
from causallearn.utils.ScoreUtils import *
def local_score_BIC(Data, i, PAi, parameters=None):
'''
Calculate the *negative* local score with BIC for the linear Gaussian continue data case
Parameters
----------
Data: ndarray, (sample, features)
i: current inde... | 0 | 0 | 0 |
2c9f5d52f1b4861421709e07ade22be53a597029 | 4,882 | py | Python | src/data_generation/data_recorder.py | StanfordASL/NASA_ULI_Xplane_Simulator | 051fa492b650545442c790cf04a8cdb19632bd02 | [
"Apache-2.0"
] | 4 | 2021-06-28T19:13:58.000Z | 2021-12-10T03:10:38.000Z | src/data_generation/data_recorder.py | StanfordASL/NASA_ULI_Xplane_Simulator | 051fa492b650545442c790cf04a8cdb19632bd02 | [
"Apache-2.0"
] | null | null | null | src/data_generation/data_recorder.py | StanfordASL/NASA_ULI_Xplane_Simulator | 051fa492b650545442c790cf04a8cdb19632bd02 | [
"Apache-2.0"
] | 1 | 2021-05-25T20:52:11.000Z | 2021-05-25T20:52:11.000Z | import sys
import os
# make sure this is a system variable in your bashrc
NASA_ULI_ROOT_DIR = os.environ['NASA_ULI_ROOT_DIR']
XPC3_DIR = NASA_ULI_ROOT_DIR + '/src/'
sys.path.append(XPC3_DIR)
import numpy as np
import xpc3
import xpc3_helper
import time
import os
import mss
import cv2
import settings
screenShot = m... | 38.440945 | 134 | 0.630274 | import sys
import os
# make sure this is a system variable in your bashrc
NASA_ULI_ROOT_DIR = os.environ['NASA_ULI_ROOT_DIR']
XPC3_DIR = NASA_ULI_ROOT_DIR + '/src/'
sys.path.append(XPC3_DIR)
import numpy as np
import xpc3
import xpc3_helper
import time
import os
import mss
import cv2
import settings
screenShot = m... | 190 | 0 | 23 |
e9e8e3d3249ddc6a3c68b462aadd0cf70fd33c59 | 581 | py | Python | rsatest.py | PotatoDIY/rsamsg | 2e324b9fc37a6bfcd9edf06214def00818e44380 | [
"MIT"
] | null | null | null | rsatest.py | PotatoDIY/rsamsg | 2e324b9fc37a6bfcd9edf06214def00818e44380 | [
"MIT"
] | 1 | 2021-04-30T21:03:26.000Z | 2021-04-30T21:03:26.000Z | rsatest.py | PotatoDIY/rsamsg | 2e324b9fc37a6bfcd9edf06214def00818e44380 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
from rsamsg import *
#alice and bob
#alice_pubkey, alice_privkey=gen()
#bob_pubkey, bob_privkey=gen()
alice_pubkey = loadfile("keys/alice_pubkey")
alice_prikey = loadfile("keys/alice_prikey")
bob_pubkey = loadfile("keys/bob_pubkey")
bob_prikey = loadfile("keys/bob_prikey"... | 20.034483 | 77 | 0.748709 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
from rsamsg import *
#alice and bob
#alice_pubkey, alice_privkey=gen()
#bob_pubkey, bob_privkey=gen()
alice_pubkey = loadfile("keys/alice_pubkey")
alice_prikey = loadfile("keys/alice_prikey")
bob_pubkey = loadfile("keys/bob_pubkey")
bob_prikey = loadfile("keys/bob_prikey"... | 0 | 0 | 0 |
ab19dd13a41e5770195c38a79129d61c58d261cd | 3,338 | py | Python | scale/job/tasks/health_task.py | kaydoh/scale | 1b6a3b879ffe83e10d3b9d9074835a4c3bf476ee | [
"Apache-2.0"
] | 121 | 2015-11-18T18:15:33.000Z | 2022-03-10T01:55:00.000Z | scale/job/tasks/health_task.py | kaydoh/scale | 1b6a3b879ffe83e10d3b9d9074835a4c3bf476ee | [
"Apache-2.0"
] | 1,415 | 2015-12-23T23:36:04.000Z | 2022-01-07T14:10:09.000Z | scale/job/tasks/health_task.py | kaydoh/scale | 1b6a3b879ffe83e10d3b9d9074835a4c3bf476ee | [
"Apache-2.0"
] | 66 | 2015-12-03T20:38:56.000Z | 2020-07-27T15:28:11.000Z | """Defines the class for a node health check task"""
from __future__ import unicode_literals
import datetime
from django.conf import settings
from job.tasks.base_task import AtomicCounter
from job.tasks.node_task import NodeTask
from node.resources.node_resources import NodeResources
from node.resources.resource imp... | 40.216867 | 117 | 0.679449 | """Defines the class for a node health check task"""
from __future__ import unicode_literals
import datetime
from django.conf import settings
from job.tasks.base_task import AtomicCounter
from job.tasks.node_task import NodeTask
from node.resources.node_resources import NodeResources
from node.resources.resource imp... | 0 | 0 | 0 |
d997ece80f2c50ef76115ac62ab2023286b010bd | 11,486 | py | Python | bommerge/bommerge.py | sakoPO/bommerge | 88a3697ce03908053c9d7c52fd3f78db0ce52371 | [
"BSD-3-Clause"
] | null | null | null | bommerge/bommerge.py | sakoPO/bommerge | 88a3697ce03908053c9d7c52fd3f78db0ce52371 | [
"BSD-3-Clause"
] | null | null | null | bommerge/bommerge.py | sakoPO/bommerge | 88a3697ce03908053c9d7c52fd3f78db0ce52371 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
try:
from components import resistor
from components import capacitor
from components import voltage
from components import tolerance
except:
from bommerge.components import resistor
from bommerge.components import capacitor
from bommerge.components import voltage
... | 41.168459 | 133 | 0.610134 | #!/usr/bin/env python
try:
from components import resistor
from components import capacitor
from components import voltage
from components import tolerance
except:
from bommerge.components import resistor
from bommerge.components import capacitor
from bommerge.components import voltage
... | 10,434 | 33 | 329 |
d499107a5099731a8a38c060088fba35d321c56e | 6,764 | py | Python | fairseq/data/token_block_dataset.py | Ruil/fairseq | 5cd5c334631a2aca1d3cfaaaddeec1b56df9e0e4 | [
"BSD-3-Clause"
] | null | null | null | fairseq/data/token_block_dataset.py | Ruil/fairseq | 5cd5c334631a2aca1d3cfaaaddeec1b56df9e0e4 | [
"BSD-3-Clause"
] | null | null | null | fairseq/data/token_block_dataset.py | Ruil/fairseq | 5cd5c334631a2aca1d3cfaaaddeec1b56df9e0e4 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import math
import numpy as np
im... | 39.555556 | 101 | 0.567859 | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import math
import numpy as np
im... | 5,336 | 0 | 134 |
1bfa0533a1a96ae691f7676df2620d787c8e4bee | 358 | py | Python | scripts/a3_withdraw_matic.py | PatrickAlphaC/vrf_pizza | c39c03ea707234a814d3d57419111c8e049d87a9 | [
"MIT"
] | 9 | 2021-03-13T03:47:12.000Z | 2021-09-01T13:49:58.000Z | scripts/a3_withdraw_matic.py | PatrickAlphaC/vrf_pizza | c39c03ea707234a814d3d57419111c8e049d87a9 | [
"MIT"
] | 1 | 2021-03-07T21:32:55.000Z | 2021-03-29T00:34:22.000Z | scripts/a3_withdraw_matic.py | PatrickAlphaC/vrf_pizza | c39c03ea707234a814d3d57419111c8e049d87a9 | [
"MIT"
] | 1 | 2021-09-01T13:49:58.000Z | 2021-09-01T13:49:58.000Z | #!/usr/bin/python3
import os
from brownie import VRF_Pizza, VRF_Pizza_RNG, accounts, network, config, interface
STATIC_SEED = 123
| 27.538462 | 82 | 0.723464 | #!/usr/bin/python3
import os
from brownie import VRF_Pizza, VRF_Pizza_RNG, accounts, network, config, interface
STATIC_SEED = 123
def main():
dev = accounts.add(os.getenv(config['wallets']['from_key']))
# Get the most recent PriceFeed Object
vrf_pizza = VRF_Pizza[len(VRF_Pizza) - 1]
vrf_pizza.withdra... | 203 | 0 | 23 |
bc757e04afd30e67cca0d546bb738a5c4acbd1ce | 1,460 | py | Python | .venv/lib/python3.8/site-packages/vectorbt/utils/math.py | eo1989/VectorBTanalysis | bea3deaf2ee3fc114b308146f2af3e4f35f70197 | [
"MIT"
] | null | null | null | .venv/lib/python3.8/site-packages/vectorbt/utils/math.py | eo1989/VectorBTanalysis | bea3deaf2ee3fc114b308146f2af3e4f35f70197 | [
"MIT"
] | null | null | null | .venv/lib/python3.8/site-packages/vectorbt/utils/math.py | eo1989/VectorBTanalysis | bea3deaf2ee3fc114b308146f2af3e4f35f70197 | [
"MIT"
] | null | null | null | """Math utilities."""
import numpy as np
from numba import njit
rel_tol = 1e-10
abs_tol = 0.
def is_close(a, b, rel_tol=rel_tol, abs_tol=abs_tol):
"""Tell whether two values are approximately equal."""
if np.isnan(a) or np.isnan(b):
return False
if np.isinf(a) or np.isinf(b):
return Fals... | 27.54717 | 95 | 0.666438 | """Math utilities."""
import numpy as np
from numba import njit
rel_tol = 1e-10
abs_tol = 0.
def is_close(a, b, rel_tol=rel_tol, abs_tol=abs_tol):
"""Tell whether two values are approximately equal."""
if np.isnan(a) or np.isnan(b):
return False
if np.isinf(a) or np.isinf(b):
return Fals... | 0 | 0 | 0 |
d3ea9909cecbb0a14b18ea874848473f176f24e3 | 831 | py | Python | tsaotun/lib/Docker/Image/rm.py | qazbnm456/tsaotun | 70186faebd5303961d5996c758f7c9147c4439ba | [
"Apache-2.0"
] | 47 | 2017-01-15T08:33:46.000Z | 2022-02-11T22:37:48.000Z | tsaotun/lib/Docker/Image/rm.py | qazbnm456/dokcer | 70186faebd5303961d5996c758f7c9147c4439ba | [
"Apache-2.0"
] | null | null | null | tsaotun/lib/Docker/Image/rm.py | qazbnm456/dokcer | 70186faebd5303961d5996c758f7c9147c4439ba | [
"Apache-2.0"
] | 2 | 2017-01-16T13:10:22.000Z | 2019-03-28T17:05:04.000Z | """This module contains `docker image rm` class"""
from docker.errors import APIError
from .command import Command
class Rm(Command):
"""This class implements `docker image rm` command"""
name = "image rm"
require = []
| 24.441176 | 57 | 0.54994 | """This module contains `docker image rm` class"""
from docker.errors import APIError
from .command import Command
class Rm(Command):
"""This class implements `docker image rm` command"""
name = "image rm"
require = []
def __init__(self):
Command.__init__(self)
self.settings[self.n... | 514 | 0 | 81 |
d7272969a073a6a76d09365b16f3fbe62aad6ad2 | 22,050 | py | Python | vstools/readers.py | libyal/vstools | 3e8bb323c4f1b51ff0dc18654707ab44b6bb6cd5 | [
"Apache-2.0"
] | 3 | 2017-07-02T11:01:22.000Z | 2021-01-31T04:52:58.000Z | vstools/readers.py | libyal/vstools | 3e8bb323c4f1b51ff0dc18654707ab44b6bb6cd5 | [
"Apache-2.0"
] | 7 | 2017-06-30T08:09:34.000Z | 2018-03-22T07:29:51.000Z | vstools/readers.py | libyal/vstools | 3e8bb323c4f1b51ff0dc18654707ab44b6bb6cd5 | [
"Apache-2.0"
] | 1 | 2017-09-10T07:34:04.000Z | 2017-09-10T07:34:04.000Z | # -*- coding: utf-8 -*-
"""Project and solution file reader classes."""
import abc
import re
from vstools import resources
class FileReader(object):
"""File reader."""
def __init__(self, encoding='utf-8'):
"""Initializes a file reader.
Args:
encoding (str): encoding.
"""
super(FileReader... | 28.451613 | 80 | 0.651519 | # -*- coding: utf-8 -*-
"""Project and solution file reader classes."""
import abc
import re
from vstools import resources
class FileReader(object):
"""File reader."""
def __init__(self, encoding='utf-8'):
"""Initializes a file reader.
Args:
encoding (str): encoding.
"""
super(FileReader... | 0 | 0 | 0 |
9103dc90b43809f95c0f53e862bd0ec25567ff06 | 14,802 | py | Python | tests/test_cli.py | jhermann/pip-upgrader | ba8613d47cd91f1e1f4ae546c561eb030ba5ddf8 | [
"Apache-2.0"
] | null | null | null | tests/test_cli.py | jhermann/pip-upgrader | ba8613d47cd91f1e1f4ae546c561eb030ba5ddf8 | [
"Apache-2.0"
] | null | null | null | tests/test_cli.py | jhermann/pip-upgrader | ba8613d47cd91f1e1f4ae546c561eb030ba5ddf8 | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
from subprocess import PIPE, Popen as popen
from unittest import TestCase
import responses
from packaging.utils import canonicalize_name
from pip_upgrader import __version__ as VERSION
from pip_upgrader import cli
from pip_upgrader.packages_status_detector import PackagesStat... | 45.128049 | 119 | 0.657344 | from __future__ import unicode_literals
from subprocess import PIPE, Popen as popen
from unittest import TestCase
import responses
from packaging.utils import canonicalize_name
from pip_upgrader import __version__ as VERSION
from pip_upgrader import cli
from pip_upgrader.packages_status_detector import PackagesStat... | 11,349 | 2,642 | 120 |
3762dac387dc47cb0414df8d63924698e9c65760 | 559 | py | Python | code/wind-analysis/complete/wind-reducer-max.py | cssherry/ox-clo | 4c771048f8b02639c7ac9e3609b92f08a2a345c1 | [
"CC0-1.0"
] | null | null | null | code/wind-analysis/complete/wind-reducer-max.py | cssherry/ox-clo | 4c771048f8b02639c7ac9e3609b92f08a2a345c1 | [
"CC0-1.0"
] | null | null | null | code/wind-analysis/complete/wind-reducer-max.py | cssherry/ox-clo | 4c771048f8b02639c7ac9e3609b92f08a2a345c1 | [
"CC0-1.0"
] | null | null | null | #! /usr/bin/env python
import sys
speeds = dict()
# counts = dict()
# need this for extension
for line in sys.stdin:
try:
line = line.strip()
station, speed = line.split('\t')
speed = float(speed)
# Add code here to use the data
if station in speeds:
if speeds[station] < spee... | 17.46875 | 39 | 0.593918 | #! /usr/bin/env python
import sys
speeds = dict()
# counts = dict()
# need this for extension
for line in sys.stdin:
try:
line = line.strip()
station, speed = line.split('\t')
speed = float(speed)
# Add code here to use the data
if station in speeds:
if speeds[station] < spee... | 0 | 0 | 0 |
9e57b930e0dbd8dcbcf97bd5461976d81c31f4a1 | 25,064 | py | Python | pointnav_vo/vo/dataset/regression_geo_invariance_iter_dataset.py | rxlqn/PointNav-VO | 6f7672482a3f1628a3b11025709518ee166e812b | [
"Apache-2.0"
] | 25 | 2021-08-28T04:06:31.000Z | 2022-03-02T23:03:13.000Z | pointnav_vo/vo/dataset/regression_geo_invariance_iter_dataset.py | rxlqn/PointNav-VO | 6f7672482a3f1628a3b11025709518ee166e812b | [
"Apache-2.0"
] | 11 | 2021-10-01T07:03:11.000Z | 2022-03-26T02:28:44.000Z | pointnav_vo/vo/dataset/regression_geo_invariance_iter_dataset.py | rxlqn/PointNav-VO | 6f7672482a3f1628a3b11025709518ee166e812b | [
"Apache-2.0"
] | 5 | 2021-09-01T09:05:42.000Z | 2022-01-27T10:11:37.000Z | #! /usr/bin/env python
import os
import h5py
import random
import time
import copy
import numpy as np
from tqdm import tqdm
from collections import OrderedDict, defaultdict
import torch
import torch.nn as nn
from torch.utils.data import Dataset, IterableDataset
from habitat import logger
from habitat.utils.geometry_... | 38.56 | 148 | 0.615385 | #! /usr/bin/env python
import os
import h5py
import random
import time
import copy
import numpy as np
from tqdm import tqdm
from collections import OrderedDict, defaultdict
import torch
import torch.nn as nn
from torch.utils.data import Dataset, IterableDataset
from habitat import logger
from habitat.utils.geometry_... | 19,688 | 0 | 258 |
35e3ccc0677f04b0f9a898da83053bc4351ca28a | 699 | py | Python | mapillary_tools/uploader_utils.py | duckonomy/mapillary_tools | 6b9b20fb54e3a26510534f5fd788599c0790ecec | [
"BSD-2-Clause"
] | null | null | null | mapillary_tools/uploader_utils.py | duckonomy/mapillary_tools | 6b9b20fb54e3a26510534f5fd788599c0790ecec | [
"BSD-2-Clause"
] | null | null | null | mapillary_tools/uploader_utils.py | duckonomy/mapillary_tools | 6b9b20fb54e3a26510534f5fd788599c0790ecec | [
"BSD-2-Clause"
] | null | null | null | import os
| 31.772727 | 73 | 0.715308 | import os
def set_video_as_uploaded(video):
current_base_path = os.path.dirname(video)
new_base_path = os.path.join(current_base_path, "uploaded")
if not os.path.exists(new_base_path):
os.mkdir(new_base_path)
# Move video to uploaded folder
new_video_path = os.path.join(new_base_path,... | 666 | 0 | 23 |
651cd1831dd5eccc15391398626087e34c64f27c | 765 | py | Python | wordy/wordy.py | cmccandless/ExercismSolutions-python | d80bf441c842daa2eb446bdba9c03d3e8864ea58 | [
"MIT"
] | null | null | null | wordy/wordy.py | cmccandless/ExercismSolutions-python | d80bf441c842daa2eb446bdba9c03d3e8864ea58 | [
"MIT"
] | null | null | null | wordy/wordy.py | cmccandless/ExercismSolutions-python | d80bf441c842daa2eb446bdba9c03d3e8864ea58 | [
"MIT"
] | null | null | null | op = {
'plus': lambda x, y: x + y,
'minus': lambda x, y: x - y,
'multiplied': lambda x, y: x * y,
'divided': lambda x, y: x / y,
}
| 27.321429 | 54 | 0.439216 | op = {
'plus': lambda x, y: x + y,
'minus': lambda x, y: x - y,
'multiplied': lambda x, y: x * y,
'divided': lambda x, y: x / y,
}
def calculate(expr):
s = list(reversed(expr[:-1].split()[2:]))
r, o = (0, op['plus'])
while len(s) > 0:
x = s.pop()
try:
... | 585 | 0 | 25 |
44e56108a3dfaf1d288521f22b2e95d208b3b8e5 | 901 | py | Python | aiphysim/dataloading/koopman_dataset.py | perovai/deepkoopman | eb6de915f5ea1f20b47cb3a22a384f55c30f0558 | [
"MIT"
] | null | null | null | aiphysim/dataloading/koopman_dataset.py | perovai/deepkoopman | eb6de915f5ea1f20b47cb3a22a384f55c30f0558 | [
"MIT"
] | 10 | 2021-07-07T09:24:33.000Z | 2021-09-27T14:32:59.000Z | aiphysim/dataloading/koopman_dataset.py | perovai/deepkoopman | eb6de915f5ea1f20b47cb3a22a384f55c30f0558 | [
"MIT"
] | null | null | null | import numpy as np
import torch
from torch.utils.data import Dataset
| 29.064516 | 87 | 0.63707 | import numpy as np
import torch
from torch.utils.data import Dataset
class KoopmanDataset(Dataset):
def __init__(self, file_paths, sequence_length=51, limit=-1):
self.file_paths = file_paths
self.sequence_length = sequence_length
self.input_dim = None
self.data = []
for fi... | 692 | 9 | 130 |
e693c32dff9ada05fbab24b39e3c9417628ef392 | 3,718 | py | Python | tasks-deploy/code-lock/generate.py | irdkwmnsb/lkshl-ctf | e5c0200ddc8ba73df5f321b87b9763fb1bbaba57 | [
"MIT"
] | 3 | 2021-03-30T06:27:58.000Z | 2021-04-03T17:56:35.000Z | tasks-deploy/code-lock/generate.py | irdkwmnsb/lkshl-ctf | e5c0200ddc8ba73df5f321b87b9763fb1bbaba57 | [
"MIT"
] | null | null | null | tasks-deploy/code-lock/generate.py | irdkwmnsb/lkshl-ctf | e5c0200ddc8ba73df5f321b87b9763fb1bbaba57 | [
"MIT"
] | null | null | null | TASK_URL = "http://code-lock.ctf.sicamp.ru"
TITLE = "Кодовый замок"
STATEMENT_TEMPLATE = f'''
"Безопасность превыше всего" - сказал ваш приятель и поставил на входную дверь кодовый замок. Но теперь вам срочно нужно попасть к нему домой, а кода вы не знаете. Что же делать?
[{TASK_URL}/{{0}}]({TASK_URL}/{{0}})
'''
... | 265.571429 | 3,209 | 0.743679 | TASK_URL = "http://code-lock.ctf.sicamp.ru"
TITLE = "Кодовый замок"
STATEMENT_TEMPLATE = f'''
"Безопасность превыше всего" - сказал ваш приятель и поставил на входную дверь кодовый замок. Но теперь вам срочно нужно попасть к нему домой, а кода вы не знаете. Что же делать?
[{TASK_URL}/{{0}}]({TASK_URL}/{{0}})
'''
... | 160 | 0 | 25 |
80d96f5c5eee131c39bba40f38a78bb59c0e41f9 | 69 | py | Python | playbook/roles/jupyter/files/.ipyparallel/profile_mpi/ipengine_config.py | kemusiro/rpicluster-for-openmpi | fb27da339e8f13efdcc108a005a26e335527ade1 | [
"MIT"
] | null | null | null | playbook/roles/jupyter/files/.ipyparallel/profile_mpi/ipengine_config.py | kemusiro/rpicluster-for-openmpi | fb27da339e8f13efdcc108a005a26e335527ade1 | [
"MIT"
] | null | null | null | playbook/roles/jupyter/files/.ipyparallel/profile_mpi/ipengine_config.py | kemusiro/rpicluster-for-openmpi | fb27da339e8f13efdcc108a005a26e335527ade1 | [
"MIT"
] | null | null | null | c.IPEngineApp.wait_for_url_file = 30
c.RegistrationFactory.ip = '*'
| 17.25 | 36 | 0.768116 | c.IPEngineApp.wait_for_url_file = 30
c.RegistrationFactory.ip = '*'
| 0 | 0 | 0 |
f714c0f34fff9800c3a67b955f8cc23e9eeb99c8 | 9,027 | py | Python | emu/containers/docker_container.py | CONQ-Agency/android-emulator-container-scripts | 0d5f55ca938818486a2ad638b91464e952e87cf4 | [
"Apache-2.0"
] | null | null | null | emu/containers/docker_container.py | CONQ-Agency/android-emulator-container-scripts | 0d5f55ca938818486a2ad638b91464e952e87cf4 | [
"Apache-2.0"
] | 1 | 2021-06-15T11:59:58.000Z | 2021-06-16T12:08:38.000Z | emu/containers/docker_container.py | CONQ-Agency/android-emulator-container-scripts | 0d5f55ca938818486a2ad638b91464e952e87cf4 | [
"Apache-2.0"
] | 1 | 2021-05-12T14:08:12.000Z | 2021-05-12T14:08:12.000Z | # Copyright 2019 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 34.586207 | 107 | 0.583029 | # Copyright 2019 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 2,254 | 0 | 350 |
0ddf1e275961fe3e95a3ee2b91a70698817c2960 | 3,618 | py | Python | python/2020/day16.py | SylvainDe/aoc | b8a4609327831685ef94c9960350ff7bb5ace1a5 | [
"MIT"
] | null | null | null | python/2020/day16.py | SylvainDe/aoc | b8a4609327831685ef94c9960350ff7bb5ace1a5 | [
"MIT"
] | null | null | null | python/2020/day16.py | SylvainDe/aoc | b8a4609327831685ef94c9960350ff7bb5ace1a5 | [
"MIT"
] | null | null | null | # vi: set shiftwidth=4 tabstop=4 expandtab:
import datetime
import re
rules_re = re.compile(r"(?P<min>\d+)-(?P<max>\d+)")
if __name__ == "__main__":
begin = datetime.datetime.now()
run_tests()
get_solutions()
end = datetime.datetime.now()
print(end - begin)
| 28.046512 | 86 | 0.609729 | # vi: set shiftwidth=4 tabstop=4 expandtab:
import datetime
import re
rules_re = re.compile(r"(?P<min>\d+)-(?P<max>\d+)")
def get_rule_from_string(string):
name, values = string.split(": ")
return (name, [(int(mini), int(maxi)) for mini, maxi in rules_re.findall(values)])
def get_ticket_from_string(string)... | 3,097 | 0 | 230 |
a6e3a48eaa19202a70ac26f47f0ceced944359ba | 750 | py | Python | scripts/1_deploy_pokemon.py | abhicoder29/pokemon-nft | 29d517ac996c878558795cc135cd17828976c179 | [
"MIT"
] | 1 | 2021-12-30T07:58:20.000Z | 2021-12-30T07:58:20.000Z | scripts/1_deploy_pokemon.py | abhicoder29/pokemon-nft | 29d517ac996c878558795cc135cd17828976c179 | [
"MIT"
] | null | null | null | scripts/1_deploy_pokemon.py | abhicoder29/pokemon-nft | 29d517ac996c878558795cc135cd17828976c179 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
from brownie import Pokemon, accounts, network, config
from scripts.helpful_scripts import fund
import asyncio
import json
| 34.090909 | 108 | 0.684 | #!/usr/bin/python3
from brownie import Pokemon, accounts, network, config
from scripts.helpful_scripts import fund
import asyncio
import json
def main():
dev = accounts.add(config["wallets"]["from_key"])
print(network.show_active())
# publish_source = True if os.getenv("ETHERSCAN_TOKEN") else False # Curr... | 584 | 0 | 23 |
fe8d456a5fa9c6585a8f352262524692f6af0703 | 4,442 | py | Python | nets/mobilenet.py | bubbliiiing/arcface-tf2 | b2d6b1c10898689f0f4f6c952feefb3eb43b8e7d | [
"MIT"
] | 2 | 2022-03-08T03:49:14.000Z | 2022-03-08T09:42:29.000Z | nets/mobilenet.py | bubbliiiing/arcface-tf2 | b2d6b1c10898689f0f4f6c952feefb3eb43b8e7d | [
"MIT"
] | null | null | null | nets/mobilenet.py | bubbliiiing/arcface-tf2 | b2d6b1c10898689f0f4f6c952feefb3eb43b8e7d | [
"MIT"
] | 1 | 2022-03-16T01:51:20.000Z | 2022-03-16T01:51:20.000Z |
from tensorflow.keras import backend as K
from tensorflow.keras import initializers
from tensorflow.keras.layers import (Activation, BatchNormalization, Conv2D,
Dense, DepthwiseConv2D, Dropout, Flatten,
PReLU)
from tensorflow.keras.regularizers ... | 50.477273 | 119 | 0.660738 |
from tensorflow.keras import backend as K
from tensorflow.keras import initializers
from tensorflow.keras.layers import (Activation, BatchNormalization, Conv2D,
Dense, DepthwiseConv2D, Dropout, Flatten,
PReLU)
from tensorflow.keras.regularizers ... | 4,018 | 0 | 92 |
4f74195555db7ef71e27e1720160a87892b9d005 | 4,174 | py | Python | medkit/bases/base_dataset.py | XanderJC/medkit-learn | 13b06906f6d093c4978f52f1e8f06e998608faa3 | [
"Apache-2.0"
] | 14 | 2021-06-06T18:14:55.000Z | 2022-03-18T14:00:05.000Z | medkit/bases/base_dataset.py | vanderschaarlab/medkit-learn | a8bed6e7a76769f28abfadb3231f139cbfe44b49 | [
"Apache-2.0"
] | 1 | 2021-06-13T05:34:21.000Z | 2021-06-15T09:52:50.000Z | medkit/bases/base_dataset.py | vanderschaarlab/medkit-learn | a8bed6e7a76769f28abfadb3231f139cbfe44b49 | [
"Apache-2.0"
] | 1 | 2021-10-18T14:07:45.000Z | 2021-10-18T14:07:45.000Z | from .__head__ import *
class BaseDataset(torch.utils.data.Dataset):
"""
Base Dataset class to be passed to torch Dataloader so train functions can be unified.
Not particularly designed for end-user, but for pre-training models.
"""
def __len__(self):
"Total number of samples"
ret... | 34.213115 | 97 | 0.576186 | from .__head__ import *
class BaseDataset(torch.utils.data.Dataset):
"""
Base Dataset class to be passed to torch Dataloader so train functions can be unified.
Not particularly designed for end-user, but for pre-training models.
"""
def __init__(self):
super(BaseDataset, self).__init__()
... | 3,304 | 0 | 54 |
45a0b3e934efd1b716e4e65e5d9b8da1fcedcf16 | 1,313 | py | Python | colorthermoexample.py | majikpig/ubtech | 8d21f4b522e06f998bfdf3b1947db23bfc349e3d | [
"MIT"
] | null | null | null | colorthermoexample.py | majikpig/ubtech | 8d21f4b522e06f998bfdf3b1947db23bfc349e3d | [
"MIT"
] | null | null | null | colorthermoexample.py | majikpig/ubtech | 8d21f4b522e06f998bfdf3b1947db23bfc349e3d | [
"MIT"
] | 1 | 2019-03-23T16:08:30.000Z | 2019-03-23T16:08:30.000Z | import tempsensor
import time
import btnlib as btn
import ledlib as led
red = 80
orange = 75
yellow = 70
green = 65
blue = 60
purple = 55
while btn.isOn(btn.switch): #while the switch is on:
led.turn_on(led.white)
temp = tempsensor.tempF() #get the temp
print temp
if temp > red :
led.turn_on_all()
elif temp > ... | 20.84127 | 52 | 0.711348 | import tempsensor
import time
import btnlib as btn
import ledlib as led
red = 80
orange = 75
yellow = 70
green = 65
blue = 60
purple = 55
while btn.isOn(btn.switch): #while the switch is on:
led.turn_on(led.white)
temp = tempsensor.tempF() #get the temp
print temp
if temp > red :
led.turn_on_all()
elif temp > ... | 0 | 0 | 0 |
18792a2154e363e0b2b8ccacb226f0fb273783c3 | 723 | py | Python | sim_examples/inference_cnn_loadweight.py | thuime/XPEsim | ab97d4c3c5b32ce4804ca58ad0f0083bb9de11fc | [
"MIT"
] | 27 | 2018-04-17T02:39:57.000Z | 2022-03-25T13:51:14.000Z | sim_examples/inference_cnn_loadweight.py | Arvin-xd/XPEsim | ab97d4c3c5b32ce4804ca58ad0f0083bb9de11fc | [
"MIT"
] | 1 | 2018-12-13T17:58:20.000Z | 2021-04-15T15:32:04.000Z | sim_examples/inference_cnn_loadweight.py | Arvin-xd/XPEsim | ab97d4c3c5b32ce4804ca58ad0f0083bb9de11fc | [
"MIT"
] | 14 | 2018-04-17T02:40:17.000Z | 2021-12-24T22:11:40.000Z | import simulator
import numpy as np
'''
TODO Support CNN in the Hardware Evaluation
'''
weights_dir = "./data/mnist-lenet.npz"
image_dir = "./data/dataset/mnist/test.npy"
batch_size = 10 # The number of input picture
weights = np.load(weights_dir)['arr_0'].item()
data = np.load(image_dir)[:batch_size]
... | 22.59375 | 67 | 0.644537 | import simulator
import numpy as np
'''
TODO Support CNN in the Hardware Evaluation
'''
weights_dir = "./data/mnist-lenet.npz"
image_dir = "./data/dataset/mnist/test.npy"
batch_size = 10 # The number of input picture
weights = np.load(weights_dir)['arr_0'].item()
data = np.load(image_dir)[:batch_size]
... | 0 | 0 | 0 |
ae3ea7a76f6a45e67113e758d9604cf094c6cf81 | 1,468 | py | Python | 07_docker/marathon_tweets/tweet_collector/get_tweets.py | bfc782/spice_weasel | 7f2d7586ae485001a9b875b62d093fd04e28faa8 | [
"CC0-1.0"
] | null | null | null | 07_docker/marathon_tweets/tweet_collector/get_tweets.py | bfc782/spice_weasel | 7f2d7586ae485001a9b875b62d093fd04e28faa8 | [
"CC0-1.0"
] | null | null | null | 07_docker/marathon_tweets/tweet_collector/get_tweets.py | bfc782/spice_weasel | 7f2d7586ae485001a9b875b62d093fd04e28faa8 | [
"CC0-1.0"
] | null | null | null | #import config
import os
from tweepy import OAuthHandler, Stream
from tweepy.streaming import StreamListener
import json
import logging
import pymongo
import time
client = pymongo.MongoClient("mongodb")
db = client.tweets
time.sleep(10)
api_key = os.getenv('TWITTER_CONSUMER_API_KEY')
api_secret = os.getenv('TWITTER_... | 25.754386 | 90 | 0.681199 | #import config
import os
from tweepy import OAuthHandler, Stream
from tweepy.streaming import StreamListener
import json
import logging
import pymongo
import time
client = pymongo.MongoClient("mongodb")
db = client.tweets
time.sleep(10)
api_key = os.getenv('TWITTER_CONSUMER_API_KEY')
api_secret = os.getenv('TWITTER_... | 84 | 512 | 23 |
6cef8f5b03beb08dc2b0a1f5dceed760540264db | 859 | py | Python | Script Examples/example_py_script.py | snichola/Aurora | 3d38de87e9bb8affb309a0dd6f47c8479c5557be | [
"MIT"
] | null | null | null | Script Examples/example_py_script.py | snichola/Aurora | 3d38de87e9bb8affb309a0dd6f47c8479c5557be | [
"MIT"
] | null | null | null | Script Examples/example_py_script.py | snichola/Aurora | 3d38de87e9bb8affb309a0dd6f47c8479c5557be | [
"MIT"
] | null | null | null | import clr
clr.AddReference("Aurora")
clr.AddReference("System.Drawing")
from Aurora import Global
from Aurora.Settings import KeySequence
from Aurora.Devices import DeviceKeys
from Aurora.EffectsEngine import EffectLayer
from System.Drawing import Color
import System
array_device_keys = System.Array[DeviceKeys] | 37.347826 | 207 | 0.772992 | import clr
clr.AddReference("Aurora")
clr.AddReference("System.Drawing")
from Aurora import Global
from Aurora.Settings import KeySequence
from Aurora.Devices import DeviceKeys
from Aurora.EffectsEngine import EffectLayer
from System.Drawing import Color
import System
array_device_keys = System.Array[DeviceKeys]
cl... | 199 | 321 | 23 |
021ec52cf537b565b4e716e86143546f5b5a72a2 | 1,692 | py | Python | uninas/optimization/hpo/pymoo/mutation.py | cogsys-tuebingen/uninas | 06729b9cf517ec416fb798ae387c5bd9c3a278ac | [
"MIT"
] | 18 | 2020-11-22T16:03:08.000Z | 2022-03-15T12:11:46.000Z | uninas/optimization/hpo/pymoo/mutation.py | cogsys-tuebingen/uninas | 06729b9cf517ec416fb798ae387c5bd9c3a278ac | [
"MIT"
] | 2 | 2022-01-04T08:10:17.000Z | 2022-01-05T08:13:14.000Z | uninas/optimization/hpo/pymoo/mutation.py | cogsys-tuebingen/uninas | 06729b9cf517ec416fb798ae387c5bd9c3a278ac | [
"MIT"
] | 6 | 2021-03-08T07:08:52.000Z | 2022-02-24T12:00:43.000Z | from pymoo.model.mutation import Mutation
from pymoo.operators.mutation.no_mutation import NoMutation
from pymoo.operators.mutation.polynomial_mutation import PolynomialMutation
from pymoo.operators.integer_from_float_operator import IntegerFromFloatMutation
from uninas.utils.args import ArgsInterface, Argument, Namesp... | 35.25 | 94 | 0.706265 | from pymoo.model.mutation import Mutation
from pymoo.operators.mutation.no_mutation import NoMutation
from pymoo.operators.mutation.polynomial_mutation import PolynomialMutation
from pymoo.operators.integer_from_float_operator import IntegerFromFloatMutation
from uninas.utils.args import ArgsInterface, Argument, Namesp... | 475 | 66 | 75 |
c5b1a0e5bbf1b1c1c34ff6523e7d2c68a22c4255 | 1,077 | py | Python | list_files.py | diegomendesmoreno/stm8_standalone_programmer | 6f37d0416c91ff6ff90df3d197b359a41bb23705 | [
"MIT"
] | null | null | null | list_files.py | diegomendesmoreno/stm8_standalone_programmer | 6f37d0416c91ff6ff90df3d197b359a41bb23705 | [
"MIT"
] | null | null | null | list_files.py | diegomendesmoreno/stm8_standalone_programmer | 6f37d0416c91ff6ff90df3d197b359a41bb23705 | [
"MIT"
] | null | null | null | import os
if __name__ == "__main__":
file_list = FileList()
file_list.list_files()
print(file_list.num_files, "files listed")
for f in file_list.files:
print(f)
| 31.676471 | 59 | 0.508821 | import os
class FileList:
def __init__(self):
self.path = 'Bin/' # Search in the 'Bin' directory
self.files = []
self.num_files = 0
def list_files(self):
# r=root, d=directories, f = files
for r, d, f in os.walk(self.path):
for file in f:
i... | 819 | -6 | 76 |
950517294b314e4c36db0912d9df4efeae2545e1 | 7,534 | py | Python | cows/service/imps/csmlbackend/wfs_csmlstoredqueries.py | cedadev/cows | db9ed729c886b271ce85355b97e39243081e8246 | [
"BSD-2-Clause"
] | 2 | 2018-05-09T16:12:43.000Z | 2018-08-21T17:10:22.000Z | cows/service/imps/csmlbackend/wfs_csmlstoredqueries.py | cedadev/cows | db9ed729c886b271ce85355b97e39243081e8246 | [
"BSD-2-Clause"
] | null | null | null | cows/service/imps/csmlbackend/wfs_csmlstoredqueries.py | cedadev/cows | db9ed729c886b271ce85355b97e39243081e8246 | [
"BSD-2-Clause"
] | null | null | null | # BSD Licence
# Copyright (c) 2009, Science & Technology Facilities Council (STFC)
# All rights reserved.
#
# See the LICENSE file in the source distribution of this software for
# the full license text.
""" This module contains CSML WFS 2.0 stored query implementations.
To add a new stored query, write the functiona... | 50.226667 | 157 | 0.765729 | # BSD Licence
# Copyright (c) 2009, Science & Technology Facilities Council (STFC)
# All rights reserved.
#
# See the LICENSE file in the source distribution of this software for
# the full license text.
""" This module contains CSML WFS 2.0 stored query implementations.
To add a new stored query, write the functiona... | 5,914 | 16 | 263 |
5bf3053088af5e798861a4a5b0c9a40c7343b799 | 1,383 | py | Python | markov_chain/specialists.py | pesikj/DataAnalysisUsingPython | 00269a7a7b5388fbbdcf3ddadd951a80a07f9c3a | [
"MIT"
] | null | null | null | markov_chain/specialists.py | pesikj/DataAnalysisUsingPython | 00269a7a7b5388fbbdcf3ddadd951a80a07f9c3a | [
"MIT"
] | null | null | null | markov_chain/specialists.py | pesikj/DataAnalysisUsingPython | 00269a7a7b5388fbbdcf3ddadd951a80a07f9c3a | [
"MIT"
] | null | null | null | import numpy as np
from numpy.linalg import inv
from scipy.stats import binom
#a1 = failed
#a2 = passed
testPassingProbabilities = [0.7, 0.6, 0.8, 0.9]
noOfSpecialistsCurrent = [100, 70, 50, 60]
wantedSpecialists = 5
wantedWithProbability = 0.9
transitionMatrix = np.zeros((len(testPassingProbabilities) + 2, len(tes... | 34.575 | 107 | 0.748373 | import numpy as np
from numpy.linalg import inv
from scipy.stats import binom
#a1 = failed
#a2 = passed
testPassingProbabilities = [0.7, 0.6, 0.8, 0.9]
noOfSpecialistsCurrent = [100, 70, 50, 60]
wantedSpecialists = 5
wantedWithProbability = 0.9
transitionMatrix = np.zeros((len(testPassingProbabilities) + 2, len(tes... | 0 | 0 | 0 |
83de024d990b9741a3362c8d9bb1b9a580904364 | 14,833 | py | Python | eosfactory/shell/wallet.py | ephdtrg/eosfactory | 721843707cb277618142c6d9518e3f231cae3b79 | [
"MIT"
] | null | null | null | eosfactory/shell/wallet.py | ephdtrg/eosfactory | 721843707cb277618142c6d9518e3f231cae3b79 | [
"MIT"
] | null | null | null | eosfactory/shell/wallet.py | ephdtrg/eosfactory | 721843707cb277618142c6d9518e3f231cae3b79 | [
"MIT"
] | null | null | null | import os
import json
import inspect
import eosfactory.core.logger as logger
import eosfactory.core.errors as errors
import eosfactory.core.setup as setup
import eosfactory.core.interface as interface
import eosfactory.core.teos as teos
if setup.node_api == "cleos":
import eosfactory.core.cleos as cleos
elif setup... | 34.256351 | 103 | 0.523697 | import os
import json
import inspect
import eosfactory.core.logger as logger
import eosfactory.core.errors as errors
import eosfactory.core.setup as setup
import eosfactory.core.interface as interface
import eosfactory.core.teos as teos
if setup.node_api == "cleos":
import eosfactory.core.cleos as cleos
elif setup... | 4,932 | 0 | 265 |
9ff5a5ee62d2ada8f035ed015df587c46f476bb6 | 302 | py | Python | codes/Ex074.py | BelfortJoao/Curso-phyton01 | 79376233be228f39bf548f90b8d9bd5419ac067a | [
"MIT"
] | 3 | 2021-08-17T14:02:14.000Z | 2021-08-19T02:37:30.000Z | codes/Ex074.py | BelfortJoao/Curso-phyton01 | 79376233be228f39bf548f90b8d9bd5419ac067a | [
"MIT"
] | null | null | null | codes/Ex074.py | BelfortJoao/Curso-phyton01 | 79376233be228f39bf548f90b8d9bd5419ac067a | [
"MIT"
] | null | null | null | from random import randint
x = (randint(1, 10), randint(1, 10), randint(1, 10), randint(1, 10), randint(1, 10), randint(1, 10))
print('sorteei os numeros:', end='')
for n in x:
print(f'{n}', end=", ")
print(f"\nO maior valor na ordem foi {max(x)}")
print(f"\nO menor valor na ordem foi {min(x)}")
| 37.75 | 100 | 0.625828 | from random import randint
x = (randint(1, 10), randint(1, 10), randint(1, 10), randint(1, 10), randint(1, 10), randint(1, 10))
print('sorteei os numeros:', end='')
for n in x:
print(f'{n}', end=", ")
print(f"\nO maior valor na ordem foi {max(x)}")
print(f"\nO menor valor na ordem foi {min(x)}")
| 0 | 0 | 0 |
6c38fa0bd9e315dd1842c9792fab88a708b5c6cb | 15,911 | py | Python | extensions/mark_invoices.py | time-track-tool/time-track-tool | a1c280f32a7766e460c862633b748fa206256f24 | [
"MIT"
] | null | null | null | extensions/mark_invoices.py | time-track-tool/time-track-tool | a1c280f32a7766e460c862633b748fa206256f24 | [
"MIT"
] | 1 | 2019-07-03T13:32:38.000Z | 2019-07-03T13:32:38.000Z | extensions/mark_invoices.py | time-track-tool/time-track-tool | a1c280f32a7766e460c862633b748fa206256f24 | [
"MIT"
] | 1 | 2019-05-15T16:01:31.000Z | 2019-05-15T16:01:31.000Z | #! /usr/bin/python
# Copyright (C) 2005 Dr. Ralf Schlatterbeck Open Source Consulting.
# Reichergasse 131, A-3411 Weidling.
# Web: http://www.runtux.com Email: office@runtux.com
# All rights reserved
# ****************************************************************************
#
# This program is free software; you c... | 35.515625 | 80 | 0.539941 | #! /usr/bin/python
# Copyright (C) 2005 Dr. Ralf Schlatterbeck Open Source Consulting.
# Reichergasse 131, A-3411 Weidling.
# Web: http://www.runtux.com Email: office@runtux.com
# All rights reserved
# ****************************************************************************
#
# This program is free software; you c... | 5,128 | 7,965 | 358 |
91e13dc5dce4394facd41c473ef017637c7b7efb | 3,614 | py | Python | lib/market/market_quote.py | myron0330/metatrade | b0358ad3dce6ba50e4801b6af557d7883d8a5d9a | [
"MIT"
] | 1 | 2018-06-28T09:49:08.000Z | 2018-06-28T09:49:08.000Z | lib/market/market_quote.py | myron0330/metatrade | b0358ad3dce6ba50e4801b6af557d7883d8a5d9a | [
"MIT"
] | null | null | null | lib/market/market_quote.py | myron0330/metatrade | b0358ad3dce6ba50e4801b6af557d7883d8a5d9a | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
# **********************************************************************************#
# File:
# **********************************************************************************#
import time
from datetime import datetime
from utils.dict import CompositeDict
from utils.decorator import singl... | 34.75 | 101 | 0.522413 | # -*- coding: UTF-8 -*-
# **********************************************************************************#
# File:
# **********************************************************************************#
import time
from datetime import datetime
from utils.dict import CompositeDict
from utils.decorator import singl... | 192 | 2,472 | 22 |
e68c200f43159bf514afe9d579f8930fcb12c17b | 1,179 | py | Python | src/shapefiles/migrations/0001_initial.py | ro-hit81/reposit | 2d16ce6aaa565f5f659d8e370c888844a01f6030 | [
"bzip2-1.0.6"
] | null | null | null | src/shapefiles/migrations/0001_initial.py | ro-hit81/reposit | 2d16ce6aaa565f5f659d8e370c888844a01f6030 | [
"bzip2-1.0.6"
] | null | null | null | src/shapefiles/migrations/0001_initial.py | ro-hit81/reposit | 2d16ce6aaa565f5f659d8e370c888844a01f6030 | [
"bzip2-1.0.6"
] | null | null | null | # Generated by Django 2.2.1 on 2019-08-03 05:44
import django.contrib.gis.db.models.fields
from django.db import migrations, models
| 35.727273 | 114 | 0.579304 | # Generated by Django 2.2.1 on 2019-08-03 05:44
import django.contrib.gis.db.models.fields
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Parcel',
fields=... | 0 | 1,022 | 23 |
2aa5c07dd8585aedf7b1d130332630d71b1b552a | 3,068 | py | Python | sport.py | hexuustc/weixin_sport | 6b4ab18dc48c9fb97301d2f193746effc4988f74 | [
"MIT"
] | 1 | 2021-09-26T06:54:44.000Z | 2021-09-26T06:54:44.000Z | sport.py | hexuustc/weixin_sport | 6b4ab18dc48c9fb97301d2f193746effc4988f74 | [
"MIT"
] | null | null | null | sport.py | hexuustc/weixin_sport | 6b4ab18dc48c9fb97301d2f193746effc4988f74 | [
"MIT"
] | null | null | null | # encoding=utf8
import requests
import datetime
import pytz
import argparse
import random
import json
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='weixin auto sport script.')
parser.add_argument('user', help='your user name', type=str)
parser.add_argument('password', help='your ... | 35.674419 | 159 | 0.550847 | # encoding=utf8
import requests
import datetime
import pytz
import argparse
import random
import json
class Report(object):
def __init__(self, user, password):
self.user = user
self.password = password
def report(self):
url = "https://xzdx.xyz/x/ym/yzmb/api.php"
timenow = datet... | 2,314 | 0 | 76 |
9aca37e5b5791be898dfe5347b24154e7d5b9ccf | 1,634 | py | Python | aerisweather/responses/ObservationsSummaryDewPt.py | jkoelndorfer/aerisweather-python-sdk | ef37fe3132e87e7f86c2d1ba40a2ac2b7b4db604 | [
"MIT"
] | 5 | 2019-02-26T20:56:14.000Z | 2021-05-05T21:04:45.000Z | aerisweather/responses/ObservationsSummaryDewPt.py | jkoelndorfer/aerisweather-python-sdk | ef37fe3132e87e7f86c2d1ba40a2ac2b7b4db604 | [
"MIT"
] | 2 | 2021-03-02T00:35:42.000Z | 2021-03-03T17:07:37.000Z | aerisweather/responses/ObservationsSummaryDewPt.py | jkoelndorfer/aerisweather-python-sdk | ef37fe3132e87e7f86c2d1ba40a2ac2b7b4db604 | [
"MIT"
] | 8 | 2018-05-26T18:52:21.000Z | 2022-01-20T19:47:15.000Z |
class ObservationsSummaryDewPt:
""" Defines an object for the observations summary period temp data. """
dewpt = {}
def __init__(self, dewpt_json):
"""
Constructor - this takes an individual observations summary period's dewpoint json.
{
maxC": 5,
... | 28.172414 | 91 | 0.53672 |
class ObservationsSummaryDewPt:
""" Defines an object for the observations summary period temp data. """
dewpt = {}
def __init__(self, dewpt_json):
"""
Constructor - this takes an individual observations summary period's dewpoint json.
{
maxC": 5,
... | 0 | 0 | 0 |
ecf14aa3926e57d3af91bbd3bfcf4c68f37171a2 | 1,220 | py | Python | receivePage.py | jb55/lightning-qt | 34d6c990a74a5d6d8a10eb75a98d15a6c7eb1891 | [
"BSD-3-Clause-Clear"
] | 26 | 2019-05-15T17:35:58.000Z | 2019-05-25T11:59:45.000Z | receivePage.py | jb55/lightning-qt | 34d6c990a74a5d6d8a10eb75a98d15a6c7eb1891 | [
"BSD-3-Clause-Clear"
] | 16 | 2019-06-07T08:33:38.000Z | 2021-08-30T10:16:47.000Z | receivePage.py | jb55/lightning-qt | 34d6c990a74a5d6d8a10eb75a98d15a6c7eb1891 | [
"BSD-3-Clause-Clear"
] | 8 | 2019-06-12T13:29:14.000Z | 2021-04-01T21:28:03.000Z | from PyQt5.QtWidgets import QWidget
from forms.ui_receivePage import Ui_ReceivePage
class ReceivePage(QWidget, Ui_ReceivePage):
"""The page to generate bolt11 invoices"""
def clearForm(self):
"""Reset the form to the default values"""
self.spinValue.setValue(1)
self.lineLabel.setText(... | 34.857143 | 82 | 0.656557 | from PyQt5.QtWidgets import QWidget
from forms.ui_receivePage import Ui_ReceivePage
class ReceivePage(QWidget, Ui_ReceivePage):
"""The page to generate bolt11 invoices"""
def __init__(self, plugin):
super().__init__()
self.setupUi(self)
self.plugin = plugin
self.initUi()
d... | 111 | 0 | 26 |
f8eb53b19f7d0ed80f555946ddeb4af5858c61b4 | 2,698 | py | Python | web/wrpbg/pb_server.py | mccreery/sandbox | 43e81c7f908feedd8e1b6e28ee07870d02012f4c | [
"Unlicense"
] | 1 | 2020-06-11T21:19:25.000Z | 2020-06-11T21:19:25.000Z | web/wrpbg/pb_server.py | mccreery/sandbox | 43e81c7f908feedd8e1b6e28ee07870d02012f4c | [
"Unlicense"
] | null | null | null | web/wrpbg/pb_server.py | mccreery/sandbox | 43e81c7f908feedd8e1b6e28ee07870d02012f4c | [
"Unlicense"
] | 1 | 2020-06-11T21:19:26.000Z | 2020-06-11T21:19:26.000Z | import http.server, requests, json
username_cache = {}
whitelist = ("current.html", "runner64.png", "flags.min.css", "flags.png")
mimes = {
"html": "text/html",
"css": "text/css",
"png": "image/png",
"json": "application/jsonn"
}
PAGE_404 = """<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>404 N... | 27.252525 | 113 | 0.642328 | import http.server, requests, json
username_cache = {}
whitelist = ("current.html", "runner64.png", "flags.min.css", "flags.png")
mimes = {
"html": "text/html",
"css": "text/css",
"png": "image/png",
"json": "application/jsonn"
}
PAGE_404 = """<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>404 N... | 1,671 | 97 | 23 |
025a893749801984f1c46542201e277d879dc8b8 | 244 | py | Python | tottle/types/objects/login.py | muffleo/tottle | 69a5bdda879ab56d43505d517d3369a687c135a2 | [
"MIT"
] | 12 | 2020-09-06T15:31:34.000Z | 2021-02-27T20:30:34.000Z | tottle/types/objects/login.py | cyanlabs-org/tottle | 6cf02022ed7b445c9b5af475c6e854b91780d792 | [
"MIT"
] | 2 | 2021-04-13T06:43:42.000Z | 2021-07-07T20:52:39.000Z | tottle/types/objects/login.py | cyanlabs-org/tottle | 6cf02022ed7b445c9b5af475c6e854b91780d792 | [
"MIT"
] | 4 | 2020-09-12T03:09:25.000Z | 2021-03-22T08:52:04.000Z | from pydantic import BaseModel
from typing import Optional
| 24.4 | 47 | 0.741803 | from pydantic import BaseModel
from typing import Optional
class LoginUrl(BaseModel):
url: Optional[str] = None
forward_text: Optional[str] = None
bot_username: Optional[str] = None
request_write_access: Optional[bool] = None
| 0 | 161 | 23 |
750320b65b80fda001114fd35158b9000f594ba5 | 2,060 | py | Python | phuber/evaluator.py | dmizr/phuber | 3b70eadd9bd1420047ada743ff5604eda48d63ac | [
"MIT"
] | 12 | 2020-12-17T14:54:03.000Z | 2021-12-13T21:30:13.000Z | phuber/evaluator.py | dmizr/phuber | 3b70eadd9bd1420047ada743ff5604eda48d63ac | [
"MIT"
] | 5 | 2020-12-30T21:18:05.000Z | 2021-04-16T21:27:35.000Z | phuber/evaluator.py | dmizr/phuber | 3b70eadd9bd1420047ada743ff5604eda48d63ac | [
"MIT"
] | 7 | 2021-04-15T02:13:26.000Z | 2021-12-01T21:20:59.000Z | import logging
from typing import Optional
import torch
import tqdm
from torch.utils.data import DataLoader
from phuber.metrics import AccuracyMetric
class Evaluator:
"""Model evaluator
Args:
model: model to be evaluated
device: device on which to evaluate model
loader: dataloader o... | 23.678161 | 75 | 0.584466 | import logging
from typing import Optional
import torch
import tqdm
from torch.utils.data import DataLoader
from phuber.metrics import AccuracyMetric
class Evaluator:
"""Model evaluator
Args:
model: model to be evaluated
device: device on which to evaluate model
loader: dataloader o... | 742 | 0 | 54 |
8c562da3b379f70ca048f530b14ad2a31026c4c4 | 14,618 | py | Python | gpcsup/__init__.py | braedon/gpcsup | a20c9fbc7d5c0191a87553b8588757b1528fe655 | [
"MIT"
] | null | null | null | gpcsup/__init__.py | braedon/gpcsup | a20c9fbc7d5c0191a87553b8588757b1528fe655 | [
"MIT"
] | null | null | null | gpcsup/__init__.py | braedon/gpcsup | a20c9fbc7d5c0191a87553b8588757b1528fe655 | [
"MIT"
] | null | null | null | import functools
import idna
import logging
import re
import requests
import rfc3339
import time
from bottle import Bottle, request, response, static_file, template, redirect
from datetime import timedelta
from publicsuffixlist import PublicSuffixList
from requests_oauthlib import OAuth1
from urllib.parse import urlsp... | 36.636591 | 119 | 0.606718 | import functools
import idna
import logging
import re
import requests
import rfc3339
import time
from bottle import Bottle, request, response, static_file, template, redirect
from datetime import timedelta
from publicsuffixlist import PublicSuffixList
from requests_oauthlib import OAuth1
from urllib.parse import urlsp... | 12,017 | 0 | 187 |
60c96f5be72bddae518c87b5b2b4d754b4bd152e | 1,158 | py | Python | rhea/system/reset.py | mngr0/rhea | 9ad8d193f7f78f1d192af438568d45fb5a398c8c | [
"MIT"
] | null | null | null | rhea/system/reset.py | mngr0/rhea | 9ad8d193f7f78f1d192af438568d45fb5a398c8c | [
"MIT"
] | null | null | null | rhea/system/reset.py | mngr0/rhea | 9ad8d193f7f78f1d192af438568d45fb5a398c8c | [
"MIT"
] | null | null | null |
import myhdl
from myhdl import delay
| 33.085714 | 76 | 0.582902 |
import myhdl
from myhdl import delay
class Reset(myhdl.ResetSignal):
def __init__(self, val, active, async):
""" Reset signal
This is a thin wrapper around the myhdl.ResetSignal to
provide the generator ``pulse`` that is often used in
testbenches.
Arguments:
v... | 573 | 523 | 23 |
6b4c0e4b75266ca932765f704bc1f94c6b42332b | 8,005 | py | Python | frappe/database/query.py | juhiwue/frappe | 77f88af74e037dcca0bae3f3ef1e8cae7fb0f699 | [
"MIT"
] | null | null | null | frappe/database/query.py | juhiwue/frappe | 77f88af74e037dcca0bae3f3ef1e8cae7fb0f699 | [
"MIT"
] | null | null | null | frappe/database/query.py | juhiwue/frappe | 77f88af74e037dcca0bae3f3ef1e8cae7fb0f699 | [
"MIT"
] | null | null | null | import operator
import re
from typing import Any, Dict, List, Tuple, Union
import frappe
from frappe import _
from frappe.query_builder import Criterion, Field, Order
def like(key: str, value: str) -> frappe.qb:
"""Wrapper method for `LIKE`
Args:
key (str): field
value (str): criterion
Returns:
frappe.qb:... | 24.331307 | 101 | 0.672705 | import operator
import re
from typing import Any, Dict, List, Tuple, Union
import frappe
from frappe import _
from frappe.query_builder import Criterion, Field, Order
def like(key: str, value: str) -> frappe.qb:
"""Wrapper method for `LIKE`
Args:
key (str): field
value (str): criterion
Returns:
frappe.qb:... | 1,124 | 4,299 | 46 |
b32d432b5b14e98ef90fed8ac7f7c9ad1ef97f2b | 1,470 | py | Python | lib/exchange/upbit/adapter/post_orders_response_adapter.py | webclinic017/bitrush | 5d76c98a17bb830dba1bdd103475c120903ded90 | [
"MIT"
] | 1 | 2022-01-09T21:17:23.000Z | 2022-01-09T21:17:23.000Z | lib/exchange/upbit/adapter/post_orders_response_adapter.py | webclinic017/bitrush | 5d76c98a17bb830dba1bdd103475c120903ded90 | [
"MIT"
] | null | null | null | lib/exchange/upbit/adapter/post_orders_response_adapter.py | webclinic017/bitrush | 5d76c98a17bb830dba1bdd103475c120903ded90 | [
"MIT"
] | 1 | 2022-01-09T21:17:17.000Z | 2022-01-09T21:17:17.000Z | import json
from decimal import Decimal
from typing import Optional, Dict
from lib.exchange.upbit.model.post_orders_response import PostOrdersResponse
from lib.order.order import Order
from lib.order.order_type import OrderType
from lib.type import JsonString
| 28.823529 | 86 | 0.682993 | import json
from decimal import Decimal
from typing import Optional, Dict
from lib.exchange.upbit.model.post_orders_response import PostOrdersResponse
from lib.order.order import Order
from lib.order.order_type import OrderType
from lib.type import JsonString
class PostOrdersResponseAdapter(Order):
response: Pos... | 586 | 599 | 23 |
862cafed433a27c4c636e2ae6a6289b7ce389dab | 2,788 | py | Python | test/cut/test_cut_set_creation.py | pzelasko/lhotse | 41984467d2ead1dc69f418638b969e46f63308c7 | [
"Apache-2.0"
] | 64 | 2020-04-27T14:55:15.000Z | 2020-10-25T06:57:56.000Z | test/cut/test_cut_set_creation.py | pzelasko/lhotse | 41984467d2ead1dc69f418638b969e46f63308c7 | [
"Apache-2.0"
] | 85 | 2020-04-26T06:29:47.000Z | 2020-10-19T20:28:52.000Z | test/cut/test_cut_set_creation.py | pzelasko/lhotse | 41984467d2ead1dc69f418638b969e46f63308c7 | [
"Apache-2.0"
] | 17 | 2020-06-19T06:26:33.000Z | 2020-10-12T15:19:15.000Z | import pytest
from lhotse.cut import make_windowed_cuts_from_features
from lhotse.features import Features, FeatureSet
def features(rec_id, start, duration):
"""Helper method for fixture readability (specify only relevant attributes)."""
return Features(
recording_id=rec_id,
channels=0,
... | 34 | 83 | 0.641679 | import pytest
from lhotse.cut import make_windowed_cuts_from_features
from lhotse.features import Features, FeatureSet
def features(rec_id, start, duration):
"""Helper method for fixture readability (specify only relevant attributes)."""
return Features(
recording_id=rec_id,
channels=0,
... | 1,941 | 18 | 151 |
1cdf6f8a3f98fd2219e9f83b7c43e32f18d29505 | 3,608 | py | Python | torchdynamo/allowed_functions.py | frank-wei/torchdynamo | 26c4c1b593bebf4246e566749dade38254b59ffb | [
"BSD-3-Clause"
] | 40 | 2022-03-02T01:29:29.000Z | 2022-03-31T16:02:01.000Z | torchdynamo/allowed_functions.py | frank-wei/torchdynamo | 26c4c1b593bebf4246e566749dade38254b59ffb | [
"BSD-3-Clause"
] | 62 | 2022-03-11T00:12:37.000Z | 2022-03-31T20:04:27.000Z | torchdynamo/allowed_functions.py | frank-wei/torchdynamo | 26c4c1b593bebf4246e566749dade38254b59ffb | [
"BSD-3-Clause"
] | 4 | 2022-03-09T18:43:20.000Z | 2022-03-31T01:01:26.000Z | import builtins
import collections
import copy
import functools
import itertools
import math
import operator
import types
import warnings
from functools import lru_cache
import numpy
import torch
from . import config
@lru_cache(None)
@lru_cache(None)
def _allowed_function_ids():
"""
Walk torch.* and get t... | 26.925373 | 87 | 0.625277 | import builtins
import collections
import copy
import functools
import itertools
import math
import operator
import types
import warnings
from functools import lru_cache
import numpy
import torch
from . import config
@lru_cache(None)
def _disallowed_function_ids():
remove = [
True,
False,
... | 2,432 | 0 | 139 |
d10f5a7b45ca2a640954b3379de28abe47aa8a4b | 9,790 | py | Python | utils/cloze_mc_model.py | kenchan0226/control-sum-cmdp | 5181e8e0c9bf6bef48f66457e06d3f398f4a428a | [
"MIT"
] | 3 | 2021-08-10T02:31:24.000Z | 2021-12-28T09:34:01.000Z | utils/cloze_mc_model.py | kenchan0226/control-sum-cmdp | 5181e8e0c9bf6bef48f66457e06d3f398f4a428a | [
"MIT"
] | null | null | null | utils/cloze_mc_model.py | kenchan0226/control-sum-cmdp | 5181e8e0c9bf6bef48f66457e06d3f398f4a428a | [
"MIT"
] | 1 | 2021-12-02T15:53:22.000Z | 2021-12-02T15:53:22.000Z | from transformers import BertConfig, BertForSequenceClassification, BertTokenizer
import torch
import os
import json
import logging
MAX_CONTEXT_LEN = 120
if __name__ == "__main__":
cloze_model = ClozeMCModel("cuda:0")
split_dir="/mnt/sharedfolder/hpchan/datasets/cased-cnn-dailymail_coref/train"
with op... | 56.264368 | 187 | 0.71665 | from transformers import BertConfig, BertForSequenceClassification, BertTokenizer
import torch
import os
import json
import logging
MAX_CONTEXT_LEN = 120
class ClozeMCModel:
def __init__(self, device):
self.device = device
self.model_path = "saved_models/entity_cloze_mc_coref_cnn_remove_duplicat... | 5,642 | -2 | 130 |
145f855179547244441085eb5696c4ff8167f388 | 4,685 | py | Python | tests/hypothesis2_4_masks.py | davtoh/RRTools | 6dde2d4622719d9031bf21ffbf7723231a0e2003 | [
"BSD-3-Clause"
] | 1 | 2019-07-16T03:54:22.000Z | 2019-07-16T03:54:22.000Z | tests/hypothesis2_4_masks.py | davtoh/RRTools | 6dde2d4622719d9031bf21ffbf7723231a0e2003 | [
"BSD-3-Clause"
] | null | null | null | tests/hypothesis2_4_masks.py | davtoh/RRTools | 6dde2d4622719d9031bf21ffbf7723231a0e2003 | [
"BSD-3-Clause"
] | 1 | 2019-07-09T02:49:06.000Z | 2019-07-09T02:49:06.000Z | from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from builtins import range
from past.utils import old_div
from .tesisfunctions import Plotim,overlay,padVH
import cv2
import numpy as np
#from invariantMoments import centroid,invmoments,normalizedinvariantmome... | 32.534722 | 137 | 0.704803 | from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from builtins import range
from past.utils import old_div
from .tesisfunctions import Plotim,overlay,padVH
import cv2
import numpy as np
#from invariantMoments import centroid,invmoments,normalizedinvariantmome... | 0 | 0 | 0 |
8eb87ebacb5175749b25e51af42bb1da2f1af53b | 4,924 | py | Python | PyNewsletter.py | Diogo-Paulico/PyNewsletter | a8e4782e96a21fb436d020643083edb3008d0268 | [
"MIT"
] | 3 | 2021-02-16T11:40:23.000Z | 2021-02-27T20:03:42.000Z | PyNewsletter.py | Diogo-Paulico/PyNewsletter | a8e4782e96a21fb436d020643083edb3008d0268 | [
"MIT"
] | 1 | 2021-02-27T20:43:06.000Z | 2021-02-27T20:43:06.000Z | PyNewsletter.py | Diogo-Paulico/PyNewsletter | a8e4782e96a21fb436d020643083edb3008d0268 | [
"MIT"
] | null | null | null | import email, smtplib, ssl, sys, imaplib, email.header
import pandas as pd
from config import *
from email import encoders
from email.mime.base import MIMEBase
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
# Loads the csv file given by the CSV_FILE variable
# @return -> list of e... | 35.941606 | 152 | 0.667141 | import email, smtplib, ssl, sys, imaplib, email.header
import pandas as pd
from config import *
from email import encoders
from email.mime.base import MIMEBase
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
# Loads the csv file given by the CSV_FILE variable
# @return -> list of e... | 3,073 | 0 | 154 |
4aa1225b275666806c08c3f04e1756fc027da524 | 808 | py | Python | aoc15-2.py | UnrelatedString/advent-of-code-2021 | f802240ce01dc9e31f152915456aff2644b281e2 | [
"MIT"
] | null | null | null | aoc15-2.py | UnrelatedString/advent-of-code-2021 | f802240ce01dc9e31f152915456aff2644b281e2 | [
"MIT"
] | 1 | 2021-12-10T07:24:13.000Z | 2021-12-11T05:10:50.000Z | aoc15-2.py | UnrelatedString/advent-of-code-2021 | f802240ce01dc9e31f152915456aff2644b281e2 | [
"MIT"
] | null | null | null | import sys
from stuff import *
import heapq as hq
ls = lines()#chunks()#nums()
cs = {}
d = {}
for y,l in enumerate(ls):
for x,n in enumerate(l):
n = eval(n)
for Y in range(5):
for X in range(5):
c=complex(x+len(l)*X,y+len(ls)*Y)
cs[c] = (n-1+X+Y)%9+1
... | 21.837838 | 55 | 0.483911 | import sys
from stuff import *
import heapq as hq
ls = lines()#chunks()#nums()
cs = {}
d = {}
for y,l in enumerate(ls):
for x,n in enumerate(l):
n = eval(n)
for Y in range(5):
for X in range(5):
c=complex(x+len(l)*X,y+len(ls)*Y)
cs[c] = (n-1+X+Y)%9+1
... | 0 | 0 | 0 |
b9a14b5da4025ad529f64c2d622dcacffe4710d0 | 14,219 | py | Python | ee/tasks/test/test_calculate_cohort.py | msnitish/posthog | cb86113f568e72eedcb64b5fd00c313d21e72f90 | [
"MIT"
] | null | null | null | ee/tasks/test/test_calculate_cohort.py | msnitish/posthog | cb86113f568e72eedcb64b5fd00c313d21e72f90 | [
"MIT"
] | null | null | null | ee/tasks/test/test_calculate_cohort.py | msnitish/posthog | cb86113f568e72eedcb64b5fd00c313d21e72f90 | [
"MIT"
] | null | null | null | import json
import urllib.parse
from unittest.mock import patch
from uuid import uuid4
from freezegun import freeze_time
from ee.clickhouse.models.event import create_event
from ee.clickhouse.util import ClickhouseTestMixin
from posthog.client import sync_execute
from posthog.models.cohort import Cohort
from posthog.... | 39.279006 | 373 | 0.486673 | import json
import urllib.parse
from unittest.mock import patch
from uuid import uuid4
from freezegun import freeze_time
from ee.clickhouse.models.event import create_event
from ee.clickhouse.util import ClickhouseTestMixin
from posthog.client import sync_execute
from posthog.models.cohort import Cohort
from posthog.... | 13,078 | 561 | 69 |
ca605f86181c04b6e4c6071ff1fa0fae67e38c02 | 1,994 | py | Python | core/urls.py | jianxinwang/GenEsysV | 444b4685b603c3da5ac9d9265817cac98c33c97e | [
"BSD-3-Clause"
] | 14 | 2019-02-27T13:57:36.000Z | 2021-10-01T14:29:38.000Z | core/urls.py | jianxinwang/GenEsysV | 444b4685b603c3da5ac9d9265817cac98c33c97e | [
"BSD-3-Clause"
] | 11 | 2019-06-13T06:38:43.000Z | 2021-06-15T13:51:39.000Z | core/urls.py | jianxinwang/GenEsysV | 444b4685b603c3da5ac9d9265817cac98c33c97e | [
"BSD-3-Clause"
] | 5 | 2019-02-27T13:57:40.000Z | 2020-02-09T13:15:06.000Z | from django.urls import path
import core.views as core_views
urlpatterns = (
path('dataset-snippet/<int:study_id>',
core_views.DatasetSnippetView.as_view(), name='dataset-snippet'),
path('analysis-type-snippet/<int:dataset_id>',
core_views.AnalysisTypeSnippetView.as_view(), name='analysis-ty... | 73.851852 | 166 | 0.746239 | from django.urls import path
import core.views as core_views
urlpatterns = (
path('dataset-snippet/<int:study_id>',
core_views.DatasetSnippetView.as_view(), name='dataset-snippet'),
path('analysis-type-snippet/<int:dataset_id>',
core_views.AnalysisTypeSnippetView.as_view(), name='analysis-ty... | 0 | 0 | 0 |
fa98caab9a7b0286b7b7c07c740bcf0da51f0601 | 203 | py | Python | days/04-06-collections/D5/sorting.py | angersa/100daysofcode-with-python-course | 4b7a28604214a49faf243c543f67bc8dc3eab349 | [
"MIT"
] | null | null | null | days/04-06-collections/D5/sorting.py | angersa/100daysofcode-with-python-course | 4b7a28604214a49faf243c543f67bc8dc3eab349 | [
"MIT"
] | null | null | null | days/04-06-collections/D5/sorting.py | angersa/100daysofcode-with-python-course | 4b7a28604214a49faf243c543f67bc8dc3eab349 | [
"MIT"
] | null | null | null | disordered = {(10, 5): 'b', (3, 10): 'a', (5, 2): 'c'}
# sort keys, then get values from original - fast
sorted_list = sorted(disordered.items(), key=lambda x: x[0][1], reverse=True)
print(sorted_list) | 33.833333 | 77 | 0.640394 | disordered = {(10, 5): 'b', (3, 10): 'a', (5, 2): 'c'}
# sort keys, then get values from original - fast
sorted_list = sorted(disordered.items(), key=lambda x: x[0][1], reverse=True)
print(sorted_list) | 0 | 0 | 0 |
b5036c9d9c6977e05e22272804dea05480f37a6c | 8,284 | py | Python | ichnaea/api/locate/tests/test_result.py | mikiec84/ichnaea | ec223cefb788bb921c0e7f5f51bd3b20eae29edd | [
"Apache-2.0"
] | 348 | 2015-01-13T11:48:07.000Z | 2022-03-31T08:33:07.000Z | ichnaea/api/locate/tests/test_result.py | mikiec84/ichnaea | ec223cefb788bb921c0e7f5f51bd3b20eae29edd | [
"Apache-2.0"
] | 1,274 | 2015-01-02T18:15:56.000Z | 2022-03-23T15:29:08.000Z | ichnaea/api/locate/tests/test_result.py | mikiec84/ichnaea | ec223cefb788bb921c0e7f5f51bd3b20eae29edd | [
"Apache-2.0"
] | 149 | 2015-01-04T21:15:07.000Z | 2021-12-10T06:05:09.000Z | from ichnaea.api.locate.constants import DataAccuracy, DataSource
from ichnaea.api.locate.query import Query
from ichnaea.api.locate.result import (
Position,
PositionResultList,
Region,
RegionResultList,
Result,
ResultList,
)
from ichnaea.models import encode_mac
from ichnaea.tests.factories im... | 33.538462 | 83 | 0.601762 | from ichnaea.api.locate.constants import DataAccuracy, DataSource
from ichnaea.api.locate.query import Query
from ichnaea.api.locate.result import (
Position,
PositionResultList,
Region,
RegionResultList,
Result,
ResultList,
)
from ichnaea.models import encode_mac
from ichnaea.tests.factories im... | 7,023 | 52 | 861 |
d40d1402ab5ddaccc60f54e6b0bffbc87134f18a | 16,587 | py | Python | vcstools/beam_calc.py | cplee1/vcstools_chris_duplicate | e929e01d886e6ce8c113af3b02c2590b441daa03 | [
"AFL-3.0"
] | 5 | 2020-07-01T13:18:53.000Z | 2022-03-04T20:54:14.000Z | vcstools/beam_calc.py | cplee1/vcstools_chris_duplicate | e929e01d886e6ce8c113af3b02c2590b441daa03 | [
"AFL-3.0"
] | 44 | 2019-10-19T00:13:55.000Z | 2022-01-01T04:42:02.000Z | vcstools/beam_calc.py | cplee1/vcstools_chris_duplicate | e929e01d886e6ce8c113af3b02c2590b441daa03 | [
"AFL-3.0"
] | 6 | 2019-10-29T10:51:51.000Z | 2022-03-04T20:54:28.000Z | import os
import sys
import numpy as np
import math
#MWA scripts
from mwa_pb import primary_beam
from vcstools.pointing_utils import sex2deg
from vcstools.metadb_utils import mwa_alt_az_za, get_common_obs_metadata, getmeta
import logging
logger = logging.getLogger(__name__)
def pixel_area(ra_min, ra_max, dec_min, ... | 40.555012 | 115 | 0.5816 | import os
import sys
import numpy as np
import math
#MWA scripts
from mwa_pb import primary_beam
from vcstools.pointing_utils import sex2deg
from vcstools.metadb_utils import mwa_alt_az_za, get_common_obs_metadata, getmeta
import logging
logger = logging.getLogger(__name__)
def pixel_area(ra_min, ra_max, dec_min, ... | 719 | 0 | 46 |
be10b0d724e03294d196bc011b322a0131e5d9cc | 668 | py | Python | sample_list.py | xuanyuyt/libfacedetection | a2576ef7c5f35dd8bc64227b60948da8f4fd5d5e | [
"BSD-3-Clause"
] | null | null | null | sample_list.py | xuanyuyt/libfacedetection | a2576ef7c5f35dd8bc64227b60948da8f4fd5d5e | [
"BSD-3-Clause"
] | null | null | null | sample_list.py | xuanyuyt/libfacedetection | a2576ef7c5f35dd8bc64227b60948da8f4fd5d5e | [
"BSD-3-Clause"
] | null | null | null | # -*- coding=utf-8 -*-
import os
if __name__ == '__main__':
# ================================================================== #
# Select Sample List #
# ================================================================== #
output = open('ALL.txt', 'w')
... | 37.111111 | 90 | 0.378743 | # -*- coding=utf-8 -*-
import os
if __name__ == '__main__':
# ================================================================== #
# Select Sample List #
# ================================================================== #
output = open('ALL.txt', 'w')
... | 0 | 0 | 0 |
cea272597e7c5a179183dd81f275ae2984ba6975 | 1,675 | py | Python | superb/urls.py | gheyderov/E-commerce-website | 9a87e8e6658a69fb017bdc3b36d6dc5417e3124e | [
"MIT"
] | null | null | null | superb/urls.py | gheyderov/E-commerce-website | 9a87e8e6658a69fb017bdc3b36d6dc5417e3124e | [
"MIT"
] | null | null | null | superb/urls.py | gheyderov/E-commerce-website | 9a87e8e6658a69fb017bdc3b36d6dc5417e3124e | [
"MIT"
] | null | null | null | """superb URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... | 37.222222 | 84 | 0.699701 | """superb URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... | 0 | 0 | 0 |
e8aeb956c1e734978949a081f9e6a6d6823a2d71 | 164 | py | Python | src/__main__.py | cesarabelfigueroa/FileSystem | fcd42f62ee406dbaf3180b0c15903c196c885e4a | [
"MIT"
] | null | null | null | src/__main__.py | cesarabelfigueroa/FileSystem | fcd42f62ee406dbaf3180b0c15903c196c885e4a | [
"MIT"
] | null | null | null | src/__main__.py | cesarabelfigueroa/FileSystem | fcd42f62ee406dbaf3180b0c15903c196c885e4a | [
"MIT"
] | null | null | null | from classes.Shell import Shell
from classes.FileSystem import FileSystem
main() | 20.5 | 41 | 0.75 | from classes.Shell import Shell
from classes.FileSystem import FileSystem
def main():
shell = Shell("./disk/Disk.bin")
shell.createRoot()
shell.execute()
main() | 61 | 0 | 23 |
539793bf8d49e145d5788dcd14ff3f0d24bf7a75 | 74 | py | Python | amadeus/version.py | minjikarin/amadeus-python | 14a004912ee8c36ee4fd79651ea1b23afe6b2a6e | [
"MIT"
] | null | null | null | amadeus/version.py | minjikarin/amadeus-python | 14a004912ee8c36ee4fd79651ea1b23afe6b2a6e | [
"MIT"
] | null | null | null | amadeus/version.py | minjikarin/amadeus-python | 14a004912ee8c36ee4fd79651ea1b23afe6b2a6e | [
"MIT"
] | null | null | null | version_info = (5, 3, 1)
version = '.'.join(str(v) for v in version_info)
| 24.666667 | 48 | 0.648649 | version_info = (5, 3, 1)
version = '.'.join(str(v) for v in version_info)
| 0 | 0 | 0 |
9774458a9bbc1046d5b4bd5e8043fb960f7c9702 | 11,119 | py | Python | Tests/varLib/instancer/names_test.py | odidev/fonttools | 27b5f568f562971d7fbf64eeb027ea61e4939db4 | [
"Apache-2.0",
"MIT"
] | 2,705 | 2016-09-27T10:02:12.000Z | 2022-03-31T09:37:46.000Z | Tests/varLib/instancer/names_test.py | odidev/fonttools | 27b5f568f562971d7fbf64eeb027ea61e4939db4 | [
"Apache-2.0",
"MIT"
] | 1,599 | 2016-09-27T09:07:36.000Z | 2022-03-31T23:04:51.000Z | Tests/varLib/instancer/names_test.py | odidev/fonttools | 27b5f568f562971d7fbf64eeb027ea61e4939db4 | [
"Apache-2.0",
"MIT"
] | 352 | 2016-10-07T04:18:15.000Z | 2022-03-30T07:35:01.000Z | from fontTools.ttLib.tables import otTables
from fontTools.otlLib.builder import buildStatTable
from fontTools.varLib import instancer
import pytest
@pytest.mark.parametrize(
"limits, expected, isNonRIBBI",
[
# Regular
(
{"wght": 400},
{
(1, 3, 1, 0x4... | 34.424149 | 88 | 0.559133 | from fontTools.ttLib.tables import otTables
from fontTools.otlLib.builder import buildStatTable
from fontTools.varLib import instancer
import pytest
def test_pruningUnusedNames(varfont):
varNameIDs = instancer.names.getVariationNameIDs(varfont)
assert varNameIDs == set(range(256, 297 + 1))
fvar = varfo... | 6,104 | 0 | 250 |
516979c22c20cedc5cccce7806521c8edb663484 | 1,482 | py | Python | tests/migrations/0001_initial.py | ixc/wagtailstreamforms | 93bf352219608e803948cd28385566e0ca63fa7c | [
"MIT"
] | null | null | null | tests/migrations/0001_initial.py | ixc/wagtailstreamforms | 93bf352219608e803948cd28385566e0ca63fa7c | [
"MIT"
] | null | null | null | tests/migrations/0001_initial.py | ixc/wagtailstreamforms | 93bf352219608e803948cd28385566e0ca63fa7c | [
"MIT"
] | 1 | 2021-01-27T10:49:35.000Z | 2021-01-27T10:49:35.000Z | # Generated by Django 2.2.1 on 2019-05-17 19:15
from django.db import migrations, models
import django.db.models.deletion
import wagtailstreamforms.fields
| 34.465116 | 156 | 0.589069 | # Generated by Django 2.2.1 on 2019-05-17 19:15
from django.db import migrations, models
import django.db.models.deletion
import wagtailstreamforms.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
('wagtailstreamforms', '0001_initial'),
]
operations = [
... | 0 | 1,302 | 23 |
83ff131905fef6cb336a239bba7b3fdd20edf5cf | 492 | py | Python | PyRaMD/integrate/velocity_verlet.py | adodin/simple_MD | 93d725e6cb3de9901b44967d75e3db9d726b936a | [
"MIT"
] | null | null | null | PyRaMD/integrate/velocity_verlet.py | adodin/simple_MD | 93d725e6cb3de9901b44967d75e3db9d726b936a | [
"MIT"
] | 5 | 2020-03-11T20:32:25.000Z | 2020-03-12T00:43:06.000Z | PyRaMD/integrate/velocity_verlet.py | adodin/simple_MD | 93d725e6cb3de9901b44967d75e3db9d726b936a | [
"MIT"
] | null | null | null | # Velocity Verlet Integrator as a Functor containing the integrator specs
# Initializes Integrator with time step & force field | 32.8 | 73 | 0.603659 | # Velocity Verlet Integrator as a Functor containing the integrator specs
class VelocityVerlet:
# Initializes Integrator with time step & force field
def __init__(self, dt, force_field):
self.dt = dt
self.force_field = force_field
def __call__(self, x, v, m, *args, **kwargs):
a_1 ... | 284 | 0 | 76 |
e3bb77c5090710317d11e372d9d96a50cd00e5eb | 8,369 | py | Python | pyblockchain/blockchain.py | kadonoamino/python_blockchain | 2ef52bccc812f0f7c48e61256d125e196ad51bce | [
"MIT"
] | null | null | null | pyblockchain/blockchain.py | kadonoamino/python_blockchain | 2ef52bccc812f0f7c48e61256d125e196ad51bce | [
"MIT"
] | null | null | null | pyblockchain/blockchain.py | kadonoamino/python_blockchain | 2ef52bccc812f0f7c48e61256d125e196ad51bce | [
"MIT"
] | null | null | null | import contextlib
import hashlib
import json
import logging
import sys
import time
import threading
from ecdsa import NIST256p
from ecdsa import VerifyingKey
import requests
import utils
MINING_DIFFICULTY = 3
MINING_SENDER = 'THE BLOCKCHAIN'
MINING_REWARD = 1.0
MINING_TIMER_SEC = 20
BLOCKCHAIN_PORT_RANGE = (5000, 5... | 35.163866 | 79 | 0.602342 | import contextlib
import hashlib
import json
import logging
import sys
import time
import threading
from ecdsa import NIST256p
from ecdsa import VerifyingKey
import requests
import utils
MINING_DIFFICULTY = 3
MINING_SENDER = 'THE BLOCKCHAIN'
MINING_REWARD = 1.0
MINING_TIMER_SEC = 20
BLOCKCHAIN_PORT_RANGE = (5000, 5... | 7,413 | 4 | 455 |
58059077979675f58d0fbc442c579293c01a16d0 | 3,683 | py | Python | Arrows.py | OceanNuclear/ComplexAnalysis | 7adccc0d81ea1216e305d35e248e6d886c682e6c | [
"MIT"
] | null | null | null | Arrows.py | OceanNuclear/ComplexAnalysis | 7adccc0d81ea1216e305d35e248e6d886c682e6c | [
"MIT"
] | null | null | null | Arrows.py | OceanNuclear/ComplexAnalysis | 7adccc0d81ea1216e305d35e248e6d886c682e6c | [
"MIT"
] | null | null | null | #!/home/ocean/anaconda3/bin/python3
from numpy import cos, arccos, sin, arctan, tan, pi, sqrt, e; from numpy import array as ary; import numpy as np; tau = 2*pi
from matplotlib import pyplot as plt
import seaborn as sns
#uses arrows to plot where each point lands after being transformed by the function
LongComputationa... | 39.180851 | 147 | 0.684768 | #!/home/ocean/anaconda3/bin/python3
from numpy import cos, arccos, sin, arctan, tan, pi, sqrt, e; from numpy import array as ary; import numpy as np; tau = 2*pi
from matplotlib import pyplot as plt
import seaborn as sns
#uses arrows to plot where each point lands after being transformed by the function
LongComputationa... | 813 | 0 | 90 |
79b8a4167d43787a167e247f4ecbeea1783ea099 | 1,419 | py | Python | src/tests/utils/test_process_hooks.py | DmitryBurnaev/podcast-service | 53349a3f9aed22a8024d0c83380f9a02464962a3 | [
"MIT"
] | 5 | 2021-07-01T16:31:29.000Z | 2022-01-29T14:32:13.000Z | src/tests/utils/test_process_hooks.py | DmitryBurnaev/podcast-service | 53349a3f9aed22a8024d0c83380f9a02464962a3 | [
"MIT"
] | 45 | 2020-10-25T19:41:26.000Z | 2022-03-25T06:31:58.000Z | src/tests/utils/test_process_hooks.py | DmitryBurnaev/podcast-service | 53349a3f9aed22a8024d0c83380f9a02464962a3 | [
"MIT"
] | 1 | 2022-01-27T11:30:07.000Z | 2022-01-27T11:30:07.000Z | from core import settings
from modules.podcast.utils import episode_process_hook
from modules.podcast.models import EpisodeStatus
| 35.475 | 97 | 0.609584 | from core import settings
from modules.podcast.utils import episode_process_hook
from modules.podcast.models import EpisodeStatus
class TestEpisodeProcessHooks:
def test_call_hook__ok(self, mocked_redis):
mocked_redis.get.return_value = {"total_bytes": 1024}
episode_process_hook(
Episo... | 1,203 | 9 | 76 |
9c35893b27a1c1dbd31544a1f881eac44b0b9ec6 | 61 | py | Python | xomx/feature_selection/__init__.py | perrin-isir/xomx | 9ca0ad56c333ebf4444f38bd9fa59cdd4e533756 | [
"BSD-3-Clause"
] | 4 | 2021-12-16T21:34:32.000Z | 2021-12-22T09:25:53.000Z | xomx/feature_selection/__init__.py | perrin-isir/xomx | 9ca0ad56c333ebf4444f38bd9fa59cdd4e533756 | [
"BSD-3-Clause"
] | 2 | 2021-12-15T15:51:42.000Z | 2022-03-31T08:17:26.000Z | xomx/feature_selection/__init__.py | perrin-isir/xomx | 9ca0ad56c333ebf4444f38bd9fa59cdd4e533756 | [
"BSD-3-Clause"
] | 2 | 2021-12-14T16:50:39.000Z | 2022-03-14T09:27:51.000Z | from .RFEExtraTrees import RFEExtraTrees, load_RFEExtraTrees
| 30.5 | 60 | 0.885246 | from .RFEExtraTrees import RFEExtraTrees, load_RFEExtraTrees
| 0 | 0 | 0 |
5e3409be2e89ecf64071b4b6812018a6ca38c8c8 | 9,575 | py | Python | src/julia/pseudo_python_cli.py | dpinol/pyjulia | cec4bf0b0eac7e39cecd8f3e7882563062903d0f | [
"MIT"
] | 649 | 2016-09-09T07:38:19.000Z | 2022-03-28T04:30:55.000Z | src/julia/pseudo_python_cli.py | dpinol/pyjulia | cec4bf0b0eac7e39cecd8f3e7882563062903d0f | [
"MIT"
] | 362 | 2016-09-08T16:25:30.000Z | 2022-03-05T23:15:05.000Z | src/julia/pseudo_python_cli.py | dpinol/pyjulia | cec4bf0b0eac7e39cecd8f3e7882563062903d0f | [
"MIT"
] | 85 | 2016-11-08T09:32:44.000Z | 2022-03-03T13:10:37.000Z | """
Pseudo Python command line interface.
It tries to mimic a subset of Python CLI:
https://docs.python.org/3/using/cmdline.html
"""
from __future__ import absolute_import, print_function
import code
import copy
import runpy
import sys
import traceback
from collections import namedtuple
try:
from types import S... | 30.110063 | 85 | 0.552376 | """
Pseudo Python command line interface.
It tries to mimic a subset of Python CLI:
https://docs.python.org/3/using/cmdline.html
"""
from __future__ import absolute_import, print_function
import code
import copy
import runpy
import sys
import traceback
from collections import namedtuple
try:
from types import S... | 6,153 | 0 | 412 |
e39df32cb7e8758760f31753af692ff76943f2fa | 5,600 | py | Python | sppas/sppas/src/ui/wxgui/dialogs/trsinfodialog.py | mirfan899/MTTS | 3167b65f576abcc27a8767d24c274a04712bd948 | [
"MIT"
] | null | null | null | sppas/sppas/src/ui/wxgui/dialogs/trsinfodialog.py | mirfan899/MTTS | 3167b65f576abcc27a8767d24c274a04712bd948 | [
"MIT"
] | null | null | null | sppas/sppas/src/ui/wxgui/dialogs/trsinfodialog.py | mirfan899/MTTS | 3167b65f576abcc27a8767d24c274a04712bd948 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# ---------------------------------------------------------------------------
# ___ __ __ __ ___
# / | \ | \ | \ / Automatic
# \__ |__/ |__/ |___| \__ Annotation
# \ | | |... | 38.095238 | 136 | 0.563393 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# ---------------------------------------------------------------------------
# ___ __ __ __ ___
# / | \ | \ | \ / Automatic
# \__ |__/ |__/ |___| \__ Annotation
# \ | | |... | 2,480 | 0 | 216 |
b9df1422c289da33fd8f1fd710c8f912544cf226 | 14,741 | py | Python | utils/syn_functions.py | droidadroit/nasbot | f8d5d0ba8b77c37ebaa6cd2ab148a2633ff20207 | [
"MIT"
] | null | null | null | utils/syn_functions.py | droidadroit/nasbot | f8d5d0ba8b77c37ebaa6cd2ab148a2633ff20207 | [
"MIT"
] | null | null | null | utils/syn_functions.py | droidadroit/nasbot | f8d5d0ba8b77c37ebaa6cd2ab148a2633ff20207 | [
"MIT"
] | null | null | null | """
A collection of utilities for MF-GP Bandits.
-- kandasamy@cs.cmu.edu
"""
# pylint: disable=import-error
# pylint: disable=no-member
# pylint: disable=invalid-name
# pylint: disable=relative-import
# pylint: disable=super-on-old-class
import numpy as np
# Local imports
from ..opt.function_caller import get_euc_... | 42.976676 | 90 | 0.617462 | """
A collection of utilities for MF-GP Bandits.
-- kandasamy@cs.cmu.edu
"""
# pylint: disable=import-error
# pylint: disable=no-member
# pylint: disable=invalid-name
# pylint: disable=relative-import
# pylint: disable=super-on-old-class
import numpy as np
# Local imports
from ..opt.function_caller import get_euc_... | 0 | 0 | 0 |
93c3a0380c312370c881e10fbe697c1f82ff806e | 8,417 | py | Python | bindings/pydairlib/lcm/process_lcm_log.py | Brian-Acosta/dairlib | 88da55d6e4378b93a787f3587d08b8a60f2f03f0 | [
"BSD-3-Clause"
] | 32 | 2019-04-15T03:10:26.000Z | 2022-03-28T17:27:03.000Z | bindings/pydairlib/lcm/process_lcm_log.py | Brian-Acosta/dairlib | 88da55d6e4378b93a787f3587d08b8a60f2f03f0 | [
"BSD-3-Clause"
] | 157 | 2019-02-21T03:13:57.000Z | 2022-03-09T19:13:59.000Z | bindings/pydairlib/lcm/process_lcm_log.py | Brian-Acosta/dairlib | 88da55d6e4378b93a787f3587d08b8a60f2f03f0 | [
"BSD-3-Clause"
] | 22 | 2019-03-02T22:31:42.000Z | 2022-03-10T21:28:50.000Z | import dairlib
import drake
import numpy as np
# Class to easily convert list of lcmt_osc_tracking_data_t to numpy arrays
| 38.967593 | 116 | 0.667578 | import dairlib
import drake
import numpy as np
# Class to easily convert list of lcmt_osc_tracking_data_t to numpy arrays
class lcmt_osc_tracking_data_t:
def __init__(self):
self.t = []
self.y_dim = 0
self.name = ""
self.is_active = []
self.y = []
self.y_des = []
self.error_y = []
se... | 8,163 | 10 | 119 |
4893f6a866e8ab79f5abd9ffd38994d1c37af014 | 14,032 | py | Python | navigation_old.py | mferg00/soccer-robot-ai | e25b685304fe671a0cccc17d666e9d22dc53e806 | [
"Apache-2.0"
] | null | null | null | navigation_old.py | mferg00/soccer-robot-ai | e25b685304fe671a0cccc17d666e9d22dc53e806 | [
"Apache-2.0"
] | null | null | null | navigation_old.py | mferg00/soccer-robot-ai | e25b685304fe671a0cccc17d666e9d22dc53e806 | [
"Apache-2.0"
] | null | null | null | import RPi.GPIO as GPIO
from drive import Drive
from dribbler import Dribbler
from field import Field
from enum import Enum
from kicker import Kicker
import time
import numpy as np
#########
# ENUMS #
#
############
# FUNCTIONS
# these should be very generic
###########
# VARIABLES
# used for co... | 30.438178 | 153 | 0.553521 | import RPi.GPIO as GPIO
from drive import Drive
from dribbler import Dribbler
from field import Field
from enum import Enum
from kicker import Kicker
import time
import numpy as np
#########
# ENUMS #
#
class state(Enum):
none = 1
ball_search = 2
go_to_ball = 3
goal_search = 4
go... | 9,270 | 3,752 | 149 |
e8cc4bd94d2a885ce94833f097eea32502e6fb37 | 5,842 | py | Python | DataMining/weather/cylinders.py | navijo/FlOYBD | beb4fb32598e955ce3b47ad647452c15a87cfae8 | [
"MIT"
] | null | null | null | DataMining/weather/cylinders.py | navijo/FlOYBD | beb4fb32598e955ce3b47ad647452c15a87cfae8 | [
"MIT"
] | 7 | 2020-03-24T15:55:32.000Z | 2021-08-23T20:43:13.000Z | DataMining/weather/cylinders.py | navijo/FlOYBD | beb4fb32598e955ce3b47ad647452c15a87cfae8 | [
"MIT"
] | 3 | 2017-07-26T11:46:05.000Z | 2018-04-29T12:07:59.000Z | import simplekml
import json
from polycircles import polycircles
import time
from subprocess import call
'''
https://github.com/LiquidGalaxyLAB/ViewYourData/blob/master/VYD_Project/VYD/Utils/PresentationManager/cylinder_generator.py
https://developers.google.com/maps/documentation/geocoding/intro?h... | 40.853147 | 156 | 0.626498 | import simplekml
import json
from polycircles import polycircles
import time
from subprocess import call
class CylindersKml(object):
def __init__(self, name, data):
self.name = name
self.data = data
self.kml_var = simplekml.Kml()
def makeKML(self):
current_milli_... | 5,186 | 6 | 315 |
58700b1ab5a6bb83d87d663e865662eaab49e36a | 45,318 | py | Python | plugins/bot_cockroach.py | opq-osc/botoy-plugins | 8889942cfb5d44c94705b6841cbd821ed6ee6b4b | [
"MIT"
] | 20 | 2021-04-22T14:34:27.000Z | 2022-03-22T01:30:25.000Z | plugins/bot_cockroach.py | opq-osc/botoy-plugins | 8889942cfb5d44c94705b6841cbd821ed6ee6b4b | [
"MIT"
] | 1 | 2021-05-18T12:09:19.000Z | 2021-05-19T04:23:49.000Z | plugins/bot_cockroach.py | opq-osc/botoy-plugins | 8889942cfb5d44c94705b6841cbd821ed6ee6b4b | [
"MIT"
] | 4 | 2021-06-13T04:21:09.000Z | 2022-01-06T12:13:22.000Z | """
来点小强+{可选小强数量}
可以艾特一个人使用
"""
import base64
import random
from io import BytesIO
import httpx
from botoy import GroupMsg, S
from botoy import decorators as deco
from botoy.parser import group as gp
from PIL import Image
小强 = Image.open(
BytesIO(
base64.b64decode(
"""
iVBORw0KGgoAAAANSUhEUgA... | 69.082317 | 76 | 0.940553 | """
来点小强+{可选小强数量}
可以艾特一个人使用
"""
import base64
import random
from io import BytesIO
import httpx
from botoy import GroupMsg, S
from botoy import decorators as deco
from botoy.parser import group as gp
from PIL import Image
小强 = Image.open(
BytesIO(
base64.b64decode(
"""
iVBORw0KGgoAAAANSUhEUgA... | 1,395 | 0 | 68 |
7cef8e80ca6b2bbedf08d6f5a3faf512fb91050f | 777 | py | Python | pylabnet/hardware/interface/simple_p_gen.py | wi11dey/pylabnet | a6e3362f727c45aaa60e61496e858ae92e85574d | [
"MIT"
] | 10 | 2020-01-07T23:28:49.000Z | 2022-02-02T19:09:17.000Z | pylabnet/hardware/interface/simple_p_gen.py | wi11dey/pylabnet | a6e3362f727c45aaa60e61496e858ae92e85574d | [
"MIT"
] | 249 | 2019-12-28T19:38:49.000Z | 2022-03-28T16:45:32.000Z | pylabnet/hardware/interface/simple_p_gen.py | wi11dey/pylabnet | a6e3362f727c45aaa60e61496e858ae92e85574d | [
"MIT"
] | 5 | 2020-11-17T19:45:10.000Z | 2022-01-04T18:07:04.000Z | import abc
| 18.5 | 59 | 0.599743 | import abc
class SimplePGenInterface(abc.ABC):
@abc.abstractmethod
def activate_interface(self):
pass
@abc.abstractmethod
def write(self, pb_obj, step_adj=True):
pass
@abc.abstractmethod
def set_rep(self, rep_num):
pass
@abc.abstractmethod
def start(self):
... | 86 | 632 | 46 |
17cc2151cef7cb62503e1ee06869d1ee88e9b6bb | 1,113 | py | Python | docs/_examples/mesh-smoothing.py | yijiangh/compas | a9e86edf6b602f47ca051fccedcaa88a5e5d3600 | [
"MIT"
] | 1 | 2019-03-27T22:32:56.000Z | 2019-03-27T22:32:56.000Z | docs/_examples/mesh-smoothing.py | yijiangh/compas | a9e86edf6b602f47ca051fccedcaa88a5e5d3600 | [
"MIT"
] | null | null | null | docs/_examples/mesh-smoothing.py | yijiangh/compas | a9e86edf6b602f47ca051fccedcaa88a5e5d3600 | [
"MIT"
] | null | null | null | """Smooth a mesh.
"""
from compas.datastructures import Mesh
from compas.geometry import smooth_area
import compas_rhino
__author__ = ['Tom Van Mele', 'Matthias Rippmann']
__copyright__ = 'Copyright 2017, BRG - ETH Zurich',
__license__ = 'MIT'
__email__ = 'van.mele@arch.ethz.ch'
# select a... | 25.295455 | 78 | 0.698113 | """Smooth a mesh.
"""
from compas.datastructures import Mesh
from compas.geometry import smooth_area
import compas_rhino
__author__ = ['Tom Van Mele', 'Matthias Rippmann']
__copyright__ = 'Copyright 2017, BRG - ETH Zurich',
__license__ = 'MIT'
__email__ = 'van.mele@arch.ethz.ch'
# select a... | 0 | 0 | 0 |
e5c22083523c248ad1b2c6de86eb7566e358c791 | 7,922 | py | Python | tests/managers/event_log_tests.py | dvzrv/softlayer-python | 9a5f6c6981bcc370084537b4d1769383499ce90d | [
"MIT"
] | 126 | 2015-01-05T05:09:22.000Z | 2021-07-02T00:16:35.000Z | tests/managers/event_log_tests.py | dvzrv/softlayer-python | 9a5f6c6981bcc370084537b4d1769383499ce90d | [
"MIT"
] | 969 | 2015-01-05T15:55:31.000Z | 2022-03-31T19:55:20.000Z | tests/managers/event_log_tests.py | dvzrv/softlayer-python | 9a5f6c6981bcc370084537b4d1769383499ce90d | [
"MIT"
] | 176 | 2015-01-22T11:23:40.000Z | 2022-02-11T13:16:58.000Z | """
SoftLayer.tests.managers.event_log_tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:license: MIT, see LICENSE for more details.
"""
import SoftLayer
from SoftLayer import fixtures
from SoftLayer import testing
| 31.188976 | 99 | 0.454304 | """
SoftLayer.tests.managers.event_log_tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:license: MIT, see LICENSE for more details.
"""
import SoftLayer
from SoftLayer import fixtures
from SoftLayer import testing
class EventLogTests(testing.TestCase):
def set_up(self):
self.event_log = SoftLay... | 7,198 | 17 | 482 |
96b5c9d649f8f78abe33dffa08a7507737a3b4c1 | 397 | py | Python | sensors/MercurySwitchModule.py | akesiraju/raspberrypi | e8ae5e535a9953631ffa2d1e7de926c9dc19f961 | [
"MIT"
] | 2 | 2019-03-26T23:47:40.000Z | 2020-03-28T03:23:31.000Z | sensors/MercurySwitchModule.py | akesiraju/raspberrypi | e8ae5e535a9953631ffa2d1e7de926c9dc19f961 | [
"MIT"
] | 1 | 2019-03-27T10:59:14.000Z | 2019-03-27T10:59:14.000Z | sensors/MercurySwitchModule.py | akesiraju/raspberrypi | e8ae5e535a9953631ffa2d1e7de926c9dc19f961 | [
"MIT"
] | 1 | 2018-07-14T23:55:14.000Z | 2018-07-14T23:55:14.000Z | import RPi.GPIO as GPIO
import time
#When the mercury is contact, we get a signal on 21
pin = 21
light = 20
GPIO.setmode(GPIO.BCM)
GPIO.setup(pin, GPIO.IN)
GPIO.setup(light, GPIO.OUT)
while True:
if GPIO.input(pin):
print("contact")
GPIO.output(light, GPIO.HIGH)
else:
print("no conta... | 18.045455 | 51 | 0.647355 | import RPi.GPIO as GPIO
import time
#When the mercury is contact, we get a signal on 21
pin = 21
light = 20
GPIO.setmode(GPIO.BCM)
GPIO.setup(pin, GPIO.IN)
GPIO.setup(light, GPIO.OUT)
while True:
if GPIO.input(pin):
print("contact")
GPIO.output(light, GPIO.HIGH)
else:
print("no conta... | 0 | 0 | 0 |
d2714d988a8b9f099d118a01f597d6b3479b2a08 | 192 | py | Python | src/cmp/cool_lang/ast/integer_node.py | codestrange/cool-compiler-2020 | 30508965d75a1a1d1362d0b51bef8da3978fd0c2 | [
"MIT"
] | 3 | 2020-01-14T04:47:32.000Z | 2020-09-10T17:57:20.000Z | src/cmp/cool_lang/ast/integer_node.py | codestrange/cool-compiler-2020 | 30508965d75a1a1d1362d0b51bef8da3978fd0c2 | [
"MIT"
] | 5 | 2020-01-14T06:06:35.000Z | 2020-02-19T01:01:33.000Z | src/cmp/cool_lang/ast/integer_node.py | codestrange/cool-compiler-2020 | 30508965d75a1a1d1362d0b51bef8da3978fd0c2 | [
"MIT"
] | 3 | 2020-01-14T04:58:24.000Z | 2020-01-14T16:23:41.000Z | from .atomic_node import AtomicNode
| 27.428571 | 62 | 0.723958 | from .atomic_node import AtomicNode
class IntegerNode(AtomicNode):
def __init__(self, token: str, line: int, column: int):
super(IntegerNode, self).__init__(token, line, column)
| 97 | 9 | 49 |
076d01cdee74927f3950a2f36d0c2aa2fc2d6a1b | 106 | py | Python | dexp/cli/defaults.py | haesleinhuepf/dexp | 2ea84f3db323724588fac565fae56f0d522bc5ca | [
"BSD-3-Clause"
] | 16 | 2021-04-21T14:09:19.000Z | 2022-03-22T02:30:59.000Z | dexp/cli/defaults.py | haesleinhuepf/dexp | 2ea84f3db323724588fac565fae56f0d522bc5ca | [
"BSD-3-Clause"
] | 28 | 2021-04-15T17:43:08.000Z | 2022-03-29T16:08:35.000Z | dexp/cli/defaults.py | haesleinhuepf/dexp | 2ea84f3db323724588fac565fae56f0d522bc5ca | [
"BSD-3-Clause"
] | 3 | 2022-02-08T17:41:30.000Z | 2022-03-18T15:32:27.000Z | _default_store = "dir"
_default_clevel = 3
_default_codec = "zstd"
_default_workers_backend = "threading"
| 21.2 | 38 | 0.792453 | _default_store = "dir"
_default_clevel = 3
_default_codec = "zstd"
_default_workers_backend = "threading"
| 0 | 0 | 0 |
130a684460802de83781936238e59e5a10674077 | 110 | py | Python | docker/template/handlers/birthday.py | izi-global/izir | d1a4bfb5c082c3de1956402ef0280564014a3bd8 | [
"MIT"
] | null | null | null | docker/template/handlers/birthday.py | izi-global/izir | d1a4bfb5c082c3de1956402ef0280564014a3bd8 | [
"MIT"
] | 5 | 2021-03-18T21:01:05.000Z | 2022-03-11T23:29:48.000Z | docker/template/handlers/birthday.py | izi-global/izir | d1a4bfb5c082c3de1956402ef0280564014a3bd8 | [
"MIT"
] | null | null | null | import izi
@izi.get("/birthday")
| 15.714286 | 53 | 0.672727 | import izi
@izi.get("/birthday")
def home(name: str):
return "Happy Birthday, {name}".format(name=name)
| 53 | 0 | 22 |
b42e01b497eed8a4616e56359654df96530b2429 | 37,311 | py | Python | feersum_nlu/api/regex_entity_extractors_api.py | praekelt/feersum-nlu-api-wrappers | 6580e2bab2c8a764fe868a505330b3fee6029074 | [
"BSD-3-Clause"
] | 9 | 2017-10-10T12:24:23.000Z | 2021-08-18T14:07:51.000Z | feersum_nlu/api/regex_entity_extractors_api.py | praekelt/feersum-nlu-api-wrappers | 6580e2bab2c8a764fe868a505330b3fee6029074 | [
"BSD-3-Clause"
] | 1 | 2020-12-06T11:03:25.000Z | 2021-04-14T05:21:23.000Z | feersum_nlu/api/regex_entity_extractors_api.py | praekelt/feersum-nlu-api-wrappers | 6580e2bab2c8a764fe868a505330b3fee6029074 | [
"BSD-3-Clause"
] | 2 | 2019-02-12T08:26:06.000Z | 2022-02-01T09:39:47.000Z | # coding: utf-8
"""
FeersumNLU API
This is the HTTP API for Feersum NLU. See https://github.com/praekelt/feersum-nlu-api-wrappers for examples of how to use the API. # noqa: E501
OpenAPI spec version: 2.0.54.dev2
Contact: nlu@feersum.io
Generated by: https://github.com/swagger-api/swagger-codege... | 43.034602 | 180 | 0.637319 | # coding: utf-8
"""
FeersumNLU API
This is the HTTP API for Feersum NLU. See https://github.com/praekelt/feersum-nlu-api-wrappers for examples of how to use the API. # noqa: E501
OpenAPI spec version: 2.0.54.dev2
Contact: nlu@feersum.io
Generated by: https://github.com/swagger-api/swagger-codege... | 120 | 0 | 27 |
e232c85608e7357dcbea2b73496a2fb0667670b1 | 516 | py | Python | setup.py | bobjansen/django_fabv | cf8d1be8371c7574884f0405b6ca7f78a7c224b3 | [
"BSD-3-Clause"
] | 3 | 2015-05-18T13:49:36.000Z | 2015-05-18T14:37:32.000Z | setup.py | bobjansen/django_fabv | cf8d1be8371c7574884f0405b6ca7f78a7c224b3 | [
"BSD-3-Clause"
] | null | null | null | setup.py | bobjansen/django_fabv | cf8d1be8371c7574884f0405b6ca7f78a7c224b3 | [
"BSD-3-Clause"
] | null | null | null | try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup, find_packages
setup(
name = 'django_fabv',
version = '0.1.1',
url = 'https://pypi.python.org/pypi/django_fabv/0.1.0',
include_package_data=True,
packages=find_packages(),
license = '3... | 27.157895 | 59 | 0.680233 | try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup, find_packages
setup(
name = 'django_fabv',
version = '0.1.1',
url = 'https://pypi.python.org/pypi/django_fabv/0.1.0',
include_package_data=True,
packages=find_packages(),
license = '3... | 0 | 0 | 0 |
536290ee2514884e41f360d3529e625d5173f659 | 707 | py | Python | Ago-Dic-2018/Ernesto Vela/Practica1Parcial2/ocp2.py | Arbupa/DAS_Sistemas | 52263ab91436b2e5a24ce6f8493aaa2e2fe92fb1 | [
"MIT"
] | 41 | 2017-09-26T09:36:32.000Z | 2022-03-19T18:05:25.000Z | Ago-Dic-2018/Ernesto Vela/Practica1Parcial2/ocp2.py | Arbupa/DAS_Sistemas | 52263ab91436b2e5a24ce6f8493aaa2e2fe92fb1 | [
"MIT"
] | 67 | 2017-09-11T05:06:12.000Z | 2022-02-14T04:44:04.000Z | Ago-Dic-2018/Ernesto Vela/Practica1Parcial2/ocp2.py | Arbupa/DAS_Sistemas | 52263ab91436b2e5a24ce6f8493aaa2e2fe92fb1 | [
"MIT"
] | 210 | 2017-09-01T00:10:08.000Z | 2022-03-19T18:05:12.000Z |
programmer = Programmer()
tester = Tester()
project = ProjectManagement()
print(project.process(programmer))
print(project.process(tester))
#La clase ProjectManagment es la que se puede extender
#por eso la dejamos asi, ya que cumple con el principio
#Abierto/Cerrado
#(no le entendi muy bien)
| 19.638889 | 55 | 0.670438 | class Programmer:
def code(self):
return 'I am Coding!'
class Tester:
def test(self):
return 'I am Testing!'
class ProjectManagement:
def process(self, worker):
if isinstance(worker, Programmer):
return worker.code()
elif isinstance(worker, Tester):
r... | 266 | -9 | 149 |
89e3547e029cf9e6f7b297217cd7135285370c2d | 15,695 | py | Python | rock4/softtest/pad/hierarchy/driver.py | RockFeng0/rock4automation | a29270ab9fa4cdc79f6453971b7c7a21f01442b0 | [
"MIT"
] | 5 | 2018-09-25T05:49:49.000Z | 2021-12-30T11:06:09.000Z | rock4/softtest/pad/hierarchy/driver.py | RockFeng0/rock4automation | a29270ab9fa4cdc79f6453971b7c7a21f01442b0 | [
"MIT"
] | 3 | 2018-04-01T04:27:21.000Z | 2019-01-03T11:02:33.000Z | rock4/softtest/pad/hierarchy/driver.py | RockFeng0/rock4automation | a29270ab9fa4cdc79f6453971b7c7a21f01442b0 | [
"MIT"
] | 7 | 2018-09-25T05:49:51.000Z | 2021-12-30T11:06:11.000Z | # -*- encoding: utf-8 -*-
'''
Current module: mobile.monkeyrunner.driver
Rough version history:
v1.0 Original version to use
********************************************************************
@AUTHOR: Administrator-Bruce Luo(罗科峰)
MAIL: lkf20031988@163.com
RCS: rock4.softtest.pad.hi... | 33.680258 | 140 | 0.568652 | # -*- encoding: utf-8 -*-
'''
Current module: mobile.monkeyrunner.driver
Rough version history:
v1.0 Original version to use
********************************************************************
@AUTHOR: Administrator-Bruce Luo(罗科峰)
MAIL: lkf20031988@163.com
RCS: rock4.softtest.pad.hi... | 8,700 | 0 | 1,227 |
fa017755b8936f4b18dedb46a5a32403feb76580 | 452 | py | Python | app/api/v1/models/usermodels.py | kiruidavid/SendIT254 | ee14fdcd0964d18cc93312aec39987a0753e09f1 | [
"MIT"
] | null | null | null | app/api/v1/models/usermodels.py | kiruidavid/SendIT254 | ee14fdcd0964d18cc93312aec39987a0753e09f1 | [
"MIT"
] | null | null | null | app/api/v1/models/usermodels.py | kiruidavid/SendIT254 | ee14fdcd0964d18cc93312aec39987a0753e09f1 | [
"MIT"
] | null | null | null | users = []
| 13.294118 | 67 | 0.579646 | users = []
class Users(object):
def __init__(self):
self.db = users
def create_account(self, email, phone_number, user_name, password):
account = {
"user_id": str(len(users) + 1),
"email": email,
"phone_number": phone_number,
"user_name": user_name,
"password... | 333 | -1 | 97 |
a2064944d6fc7908c704e0375eec3db9c30f3880 | 2,787 | py | Python | core.py | vitus9988/arcalive_con_downloader | 5e1612ab015565f95da0dba68e302375fc827695 | [
"MIT"
] | null | null | null | core.py | vitus9988/arcalive_con_downloader | 5e1612ab015565f95da0dba68e302375fc827695 | [
"MIT"
] | null | null | null | core.py | vitus9988/arcalive_con_downloader | 5e1612ab015565f95da0dba68e302375fc827695 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from bs4 import BeautifulSoup
import requests
import urllib.request
from moviepy.video.io.VideoFileClip import VideoFileClip
import os
if __name__ == '__main__':
#main('https://arca.live/e/56?target=title&keyword=%EB%9D%BC%EC%98%A4&sort=rank&p=1')
con_download() | 30.626374 | 146 | 0.527449 | # -*- coding: utf-8 -*-
from bs4 import BeautifulSoup
import requests
import urllib.request
from moviepy.video.io.VideoFileClip import VideoFileClip
import os
def wc(url):
headers = {
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.... | 2,434 | 0 | 125 |
c82e1da6da58dbb8b151c18c5241dc8a78e80db8 | 5,215 | py | Python | core/commands/create_domain.py | M-Spencer-94/configNOW | 56828587253202089e77cfdfcf5329f2a7f09b3f | [
"PSF-2.0",
"Apache-2.0",
"MIT"
] | 3 | 2019-07-09T20:02:48.000Z | 2021-11-21T20:00:37.000Z | core/commands/create_domain.py | M-Spencer-94/configNOW | 56828587253202089e77cfdfcf5329f2a7f09b3f | [
"PSF-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | core/commands/create_domain.py | M-Spencer-94/configNOW | 56828587253202089e77cfdfcf5329f2a7f09b3f | [
"PSF-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | # ============================================================================
#
# Copyright (c) 2007-2010 Integral Technology Solutions Pty Ltd,
# All Rights Reserved.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL... | 42.398374 | 123 | 0.653883 | # ============================================================================
#
# Copyright (c) 2007-2010 Integral Technology Solutions Pty Ltd,
# All Rights Reserved.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL... | 3,646 | 0 | 23 |
c56c8fcafd417e7a3375947337c8289dd86cfdbd | 781 | py | Python | urlunquote.py | kmorwood/mrequests | 957b9a7496cb7514cb3c1270883f40e038a7e1ce | [
"MIT"
] | 5 | 2021-08-14T15:58:29.000Z | 2022-02-24T23:11:19.000Z | urlunquote.py | kmorwood/mrequests | 957b9a7496cb7514cb3c1270883f40e038a7e1ce | [
"MIT"
] | 2 | 2021-09-15T12:32:28.000Z | 2022-01-10T02:32:31.000Z | urlunquote.py | kmorwood/mrequests | 957b9a7496cb7514cb3c1270883f40e038a7e1ce | [
"MIT"
] | 1 | 2021-11-28T16:46:04.000Z | 2021-11-28T16:46:04.000Z | def unquote(string):
"""Decode and replace URL percent-escapes in string.
unquote('abc%20def') -> b'abc def'.
Note: If a string, not a bytes object, is passed, it is encoded as UTF-8.
This is only an issue if it contains unescaped non-ASCII characters, which
URIs should not.
"""
if no... | 22.970588 | 78 | 0.564661 | def unquote(string):
"""Decode and replace URL percent-escapes in string.
unquote('abc%20def') -> b'abc def'.
Note: If a string, not a bytes object, is passed, it is encoded as UTF-8.
This is only an issue if it contains unescaped non-ASCII characters, which
URIs should not.
"""
if no... | 0 | 0 | 0 |
2127d7f5da8e00b3ae835b2e11ef891db0f2c08f | 664 | py | Python | meeting_room_booking_service/app/models/meeting_room_reservation.py | cassioeskelsen/microservice_boilerplate | c2c09d93095cc87e54f70095e74f13a97458e7d9 | [
"Apache-2.0"
] | null | null | null | meeting_room_booking_service/app/models/meeting_room_reservation.py | cassioeskelsen/microservice_boilerplate | c2c09d93095cc87e54f70095e74f13a97458e7d9 | [
"Apache-2.0"
] | null | null | null | meeting_room_booking_service/app/models/meeting_room_reservation.py | cassioeskelsen/microservice_boilerplate | c2c09d93095cc87e54f70095e74f13a97458e7d9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from mongoengine import EmbeddedDocument, StringField, Document, EmailField, EmbeddedDocumentField, DateTimeField
| 26.56 | 113 | 0.680723 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from mongoengine import EmbeddedDocument, StringField, Document, EmailField, EmbeddedDocumentField, DateTimeField
class Room(EmbeddedDocument):
name = StringField()
class Employeer(EmbeddedDocument):
name = StringField()
class RoomReservation(Document):
... | 135 | 299 | 69 |
0d33a1a4d1cd0a62230fae875e71caf4206bae3e | 2,325 | py | Python | backend/app/core/cache.py | luccasPh/gobarber | 3bc84c5098b534352ef794428ffb7b937bd3bbd6 | [
"MIT"
] | 1 | 2021-05-05T15:43:25.000Z | 2021-05-05T15:43:25.000Z | backend/app/core/cache.py | luccasPh/gobarber | 3bc84c5098b534352ef794428ffb7b937bd3bbd6 | [
"MIT"
] | null | null | null | backend/app/core/cache.py | luccasPh/gobarber | 3bc84c5098b534352ef794428ffb7b937bd3bbd6 | [
"MIT"
] | null | null | null | from app.schemas.appointment import Appointment
import pickle
from redis import Redis
from typing import Any
from datetime import timedelta
from app.models.user import User as UserModel
from .config import settings
| 32.746479 | 75 | 0.588387 | from app.schemas.appointment import Appointment
import pickle
from redis import Redis
from typing import Any
from datetime import timedelta
from app.models.user import User as UserModel
from .config import settings
class RedisCache(Redis):
def __init__(self):
if(settings.REDIS_URL):
temp = sett... | 1,082 | 1,005 | 22 |
b2f1e5909e2fbd5772b468609d91bf3631253923 | 358 | py | Python | tests/test_common/test_nano.py | CraftSpider/SpiderTools | 4bf155feec7cb983e8d283d93552902ec85178a2 | [
"MIT"
] | 5 | 2019-10-14T13:50:02.000Z | 2021-09-23T18:48:27.000Z | tests/test_common/test_nano.py | CraftSpider/SpiderTools | 4bf155feec7cb983e8d283d93552902ec85178a2 | [
"MIT"
] | null | null | null | tests/test_common/test_nano.py | CraftSpider/SpiderTools | 4bf155feec7cb983e8d283d93552902ec85178a2 | [
"MIT"
] | null | null | null |
import spidertools.common.nano as nano
import os
| 22.375 | 65 | 0.701117 |
import spidertools.common.nano as nano
import os
async def test_nanoclient():
client = nano.NanoClient("talosbot", os.getenv("TALOS_PSWD"))
await client.init()
marcy = await client.get_user("marcyt")
projects = await marcy.get_projects()
user = await projects[0].get_user()
assert marcy == us... | 284 | 0 | 23 |
84a2f6fe3ad381cfe5315c1bfe35729e95a4a951 | 919 | py | Python | shpfixer/utils/precisionredux.py | francbartoli/ShapeFixer | dfb975cb4d10f0194eef1e7d5edef73bbac89d38 | [
"MIT"
] | null | null | null | shpfixer/utils/precisionredux.py | francbartoli/ShapeFixer | dfb975cb4d10f0194eef1e7d5edef73bbac89d38 | [
"MIT"
] | null | null | null | shpfixer/utils/precisionredux.py | francbartoli/ShapeFixer | dfb975cb4d10f0194eef1e7d5edef73bbac89d38 | [
"MIT"
] | null | null | null | from shapely.geometry import *
from utils import geomerremovertools
class PrecisionRedux(object):
"""Class PrecisionRedux for managing the precision of geometries
"""
class PrecisionReduxPoint(PrecisionRedux):
"""Derived class for Point"""
class PrecisionReduxMultiPoint(PrecisionRedux):
"""Derived class for Mul... | 19.978261 | 65 | 0.761697 | from shapely.geometry import *
from utils import geomerremovertools
class PrecisionRedux(object):
"""Class PrecisionRedux for managing the precision of geometries
"""
def __init__(self, arg):
super(PrecisionRedux, self).__init__()
self.arg = arg
def round():
pass
class PrecisionReduxPoint(PrecisionRedux... | 263 | 0 | 145 |
bdc017c5baa8abcf99007f79e8a9e29fed22cec4 | 1,077 | py | Python | python/reciept.py | AlexShukhman/smop-backend-PUBLIC | d0f54d963bc0a3860181213049f7f26851badcaa | [
"Apache-2.0"
] | null | null | null | python/reciept.py | AlexShukhman/smop-backend-PUBLIC | d0f54d963bc0a3860181213049f7f26851badcaa | [
"Apache-2.0"
] | null | null | null | python/reciept.py | AlexShukhman/smop-backend-PUBLIC | d0f54d963bc0a3860181213049f7f26851badcaa | [
"Apache-2.0"
] | null | null | null | import json, os, sys
from openpyxl import load_workbook
"""
This script is for creating receipts for Smop coders using data given from mongo
"""
if __name__ == '__main__':
main() | 25.046512 | 80 | 0.652739 | import json, os, sys
from openpyxl import load_workbook
"""
This script is for creating receipts for Smop coders using data given from mongo
"""
def readIn():
lines = sys.stdin.readlines()
return json.loads(lines[0])
def main():
lines = readIn()
#Ensure in correct directory
directory_name = './a... | 847 | 0 | 46 |
050cd1985aea466a75989d2e36e84cd9e064860b | 3,740 | py | Python | applications/welcome/controllers/meteoritepage.py | winmill2/CS-411-UFO-Meteorite-Finder | 8a3ae102a18df6a6f45fc425383dfa0facb61d13 | [
"BSD-3-Clause"
] | null | null | null | applications/welcome/controllers/meteoritepage.py | winmill2/CS-411-UFO-Meteorite-Finder | 8a3ae102a18df6a6f45fc425383dfa0facb61d13 | [
"BSD-3-Clause"
] | null | null | null | applications/welcome/controllers/meteoritepage.py | winmill2/CS-411-UFO-Meteorite-Finder | 8a3ae102a18df6a6f45fc425383dfa0facb61d13 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# try something like
if not session.met_index:
session.met_index = 0
if not session.met_sort:
session.met_sort = 'ID'
if not session.met_display_flash:
session.met_display_flash = 'No'
if not session.met_filter_cat:
session.met_filter_cat = 'ID'
session.met_filter_text = ... | 34 | 143 | 0.663636 | # -*- coding: utf-8 -*-
# try something like
if not session.met_index:
session.met_index = 0
if not session.met_sort:
session.met_sort = 'ID'
if not session.met_display_flash:
session.met_display_flash = 'No'
if not session.met_filter_cat:
session.met_filter_cat = 'ID'
session.met_filter_text = ... | 3,275 | 0 | 138 |
97a694e5b108ae18df8c6c74128996964290ff48 | 7,413 | py | Python | checks/drc_checks/magic/magic_gds_drc_check.py | efabless/google_mpw_precheck | b30e779ab0ff90e37e5c56795066a30804816e13 | [
"Apache-2.0"
] | 17 | 2020-11-13T12:24:28.000Z | 2021-09-03T08:47:15.000Z | checks/drc_checks/magic/magic_gds_drc_check.py | efabless/google_mpw_precheck | b30e779ab0ff90e37e5c56795066a30804816e13 | [
"Apache-2.0"
] | 22 | 2020-11-06T16:23:47.000Z | 2021-07-09T16:19:25.000Z | checks/drc_checks/magic/magic_gds_drc_check.py | efabless/google_mpw_precheck | b30e779ab0ff90e37e5c56795066a30804816e13 | [
"Apache-2.0"
] | 14 | 2020-11-13T12:24:33.000Z | 2021-08-13T03:14:30.000Z | import argparse
import gzip
import logging
import os
import re
import subprocess
from pathlib import Path
try:
from checks.drc_checks.magic.converters import magic_drc_to_rdb, magic_drc_to_tcl, magic_drc_to_tr_drc, tr2klayout
except ImportError:
from converters import magic_drc_to_rdb, magic_drc_to_tcl, magic_... | 47.825806 | 140 | 0.70835 | import argparse
import gzip
import logging
import os
import re
import subprocess
from pathlib import Path
try:
from checks.drc_checks.magic.converters import magic_drc_to_rdb, magic_drc_to_tcl, magic_drc_to_tr_drc, tr2klayout
except ImportError:
from converters import magic_drc_to_rdb, magic_drc_to_tcl, magic_... | 4,952 | 0 | 69 |