hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f70a111ad3d409ffefa00c4d03e4c96bc4459064 | 2,136 | py | Python | qa/rpc-tests/getchaintips.py | mirzaei-ce/core-moselbit | 7e8e723109f22b0fddfa227692b9492f48d12d7c | [
"MIT"
] | null | null | null | qa/rpc-tests/getchaintips.py | mirzaei-ce/core-moselbit | 7e8e723109f22b0fddfa227692b9492f48d12d7c | [
"MIT"
] | null | null | null | qa/rpc-tests/getchaintips.py | mirzaei-ce/core-moselbit | 7e8e723109f22b0fddfa227692b9492f48d12d7c | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Exercise the getchaintips API. We introduce a network split, work
# on chains of different lengths, an... | 35.6 | 70 | 0.643727 |
from test_framework.test_framework import MoselbitTestFramework
from test_framework.util import assert_equal
class GetChainTipsTest (MoselbitTestFramework):
def run_test (self):
MoselbitTestFramework.run_test (self)
tips = self.nodes[0].getchaintips ()
assert_equal (len (tips), 1... | true | true |
f70a125670f78eacba803b405bf1888af7478244 | 853 | py | Python | aitlas/transforms/classification.py | tiendzung-le/aitlas | 4725693a5c073cc80a617fb9bab5a1557c3c3270 | [
"MIT"
] | 32 | 2020-12-04T19:48:19.000Z | 2022-03-16T18:18:05.000Z | aitlas/transforms/classification.py | likyoo/aitlas | 1c365e055c18e349e41670a4137c4d2b88671af9 | [
"MIT"
] | 2 | 2021-04-11T17:09:14.000Z | 2021-05-14T13:22:41.000Z | aitlas/transforms/classification.py | likyoo/aitlas | 1c365e055c18e349e41670a4137c4d2b88671af9 | [
"MIT"
] | 8 | 2021-04-06T22:06:27.000Z | 2022-01-30T06:01:39.000Z | from torchvision import transforms
from ..base import BaseTransforms
class ResizeCenterCropFlipHVToTensor(BaseTransforms):
def __call__(self, sample):
data_transforms = transforms.Compose([
transforms.ToPILImage(),
transforms.Resize(256),
transforms.CenterCro... | 28.433333 | 54 | 0.620164 | from torchvision import transforms
from ..base import BaseTransforms
class ResizeCenterCropFlipHVToTensor(BaseTransforms):
def __call__(self, sample):
data_transforms = transforms.Compose([
transforms.ToPILImage(),
transforms.Resize(256),
transforms.CenterCro... | true | true |
f70a13330f3cce522d7d897373b4d306174ba6ee | 1,393 | py | Python | treefrog/setup.py | oberhamsi/FrameworkBenchmarks | 660a66d51a9aad10b43c0660208fb13c098121af | [
"BSD-3-Clause"
] | 4 | 2015-01-22T02:13:03.000Z | 2018-06-13T12:02:46.000Z | frameworks/C++/treefrog/setup.py | ratpack/FrameworkBenchmarks | 81604309e46e382fe2ffb7970a87d728f20c8be6 | [
"BSD-3-Clause"
] | null | null | null | frameworks/C++/treefrog/setup.py | ratpack/FrameworkBenchmarks | 81604309e46e382fe2ffb7970a87d728f20c8be6 | [
"BSD-3-Clause"
] | null | null | null |
import subprocess
import sys
import setup_util
from os.path import expanduser
home = expanduser("~")
##############
# start(args)
##############
def start(args, logfile, errfile):
setup_util.replace_text("treefrog/config/database.ini", "HostName=.*", "HostName=" + args.database_host)
setup_util.replace_text("tre... | 35.717949 | 126 | 0.703518 |
import subprocess
import sys
import setup_util
from os.path import expanduser
home = expanduser("~")
onfig/application.ini", "MultiProcessingModule=.*", "MultiProcessingModule=hybrid")
try:
subprocess.check_call("qmake -r CONFIG+=release", shell=True, cwd="treefrog", stderr=errfile, stdout=logfile... | true | true |
f70a13567965eaf01adcb5afda46bb9ab109f32e | 1,339 | py | Python | tests/int_pro_surveys.py | wfarah/frbpoppy | e575c49e6b4a69015a66d3f38a3459e0ffe4eb05 | [
"MIT"
] | null | null | null | tests/int_pro_surveys.py | wfarah/frbpoppy | e575c49e6b4a69015a66d3f38a3459e0ffe4eb05 | [
"MIT"
] | null | null | null | tests/int_pro_surveys.py | wfarah/frbpoppy | e575c49e6b4a69015a66d3f38a3459e0ffe4eb05 | [
"MIT"
] | null | null | null | """Plot intensity profile of theoretical beam patterns."""
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import binned_statistic as bstat
from frbpoppy.survey import Survey
OBSERVATORIES = [('parkes', 'htru'),
('apertif', 'apertif')]
n = int(1e6)
for obs in OBSERVATORIES:
... | 26.254902 | 71 | 0.612397 | import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import binned_statistic as bstat
from frbpoppy.survey import Survey
OBSERVATORIES = [('parkes', 'htru'),
('apertif', 'apertif')]
n = int(1e6)
for obs in OBSERVATORIES:
survey = obs[1]
pattern = obs[0]
s = Survey(surve... | true | true |
f70a13ae6569d81bdfa4c8e185bdd5411b6c5afb | 273 | py | Python | sciwing/modules/__init__.py | sean-dingxu/sciwing | 75eca1ea43be165eab20cf8bd81bbc19cecda74c | [
"MIT"
] | 50 | 2019-09-13T10:32:29.000Z | 2022-02-14T16:52:53.000Z | sciwing/modules/__init__.py | sean-dingxu/sciwing | 75eca1ea43be165eab20cf8bd81bbc19cecda74c | [
"MIT"
] | 31 | 2019-09-03T11:06:03.000Z | 2021-08-20T14:57:09.000Z | sciwing/modules/__init__.py | sean-dingxu/sciwing | 75eca1ea43be165eab20cf8bd81bbc19cecda74c | [
"MIT"
] | 9 | 2019-09-16T03:25:15.000Z | 2021-05-11T10:28:25.000Z | from sciwing.modules.embedders import *
from sciwing.modules.bow_encoder import BOW_Encoder
from sciwing.modules.lstm2vecencoder import LSTM2VecEncoder
from sciwing.modules.lstm2seqencoder import Lstm2SeqEncoder
from sciwing.modules.charlstm_encoder import CharLSTMEncoder
| 45.5 | 60 | 0.886447 | from sciwing.modules.embedders import *
from sciwing.modules.bow_encoder import BOW_Encoder
from sciwing.modules.lstm2vecencoder import LSTM2VecEncoder
from sciwing.modules.lstm2seqencoder import Lstm2SeqEncoder
from sciwing.modules.charlstm_encoder import CharLSTMEncoder
| true | true |
f70a14c8089f951f793cbbb534fcff9da041bd68 | 5,154 | py | Python | automation/services/watchdog/metrics.py | adong-corp/mina | 4d2678444f3c2457f203bdf9b8ae0d6a9202ccfc | [
"Apache-2.0"
] | 1 | 2021-03-29T18:24:14.000Z | 2021-03-29T18:24:14.000Z | automation/services/watchdog/metrics.py | adong-corp/mina | 4d2678444f3c2457f203bdf9b8ae0d6a9202ccfc | [
"Apache-2.0"
] | null | null | null | automation/services/watchdog/metrics.py | adong-corp/mina | 4d2678444f3c2457f203bdf9b8ae0d6a9202ccfc | [
"Apache-2.0"
] | 1 | 2021-12-18T20:29:13.000Z | 2021-12-18T20:29:13.000Z |
import itertools
import datetime
import util
import asyncio
import random
import os
import sys
import traceback
import subprocess
import time
import json
import urllib.request
import ast
from google.cloud import storage
# ========================================================================
def collect_cluster_c... | 34.13245 | 140 | 0.658324 |
import itertools
import datetime
import util
import asyncio
import random
import os
import sys
import traceback
import subprocess
import time
import json
import urllib.request
import ast
from google.cloud import storage
def collect_cluster_crashes(v1, namespace, cluster_crashes):
print('collecting cluster crashe... | true | true |
f70a14e8b52c68a0c9a1982722017841cbfaa1df | 4,343 | py | Python | tests/test_tags.py | nomadixinc/django-money | 2c04749110c78978d4f12fe42d8f28a7bc9014dd | [
"BSD-3-Clause"
] | null | null | null | tests/test_tags.py | nomadixinc/django-money | 2c04749110c78978d4f12fe42d8f28a7bc9014dd | [
"BSD-3-Clause"
] | null | null | null | tests/test_tags.py | nomadixinc/django-money | 2c04749110c78978d4f12fe42d8f28a7bc9014dd | [
"BSD-3-Clause"
] | 2 | 2019-08-29T04:51:29.000Z | 2019-09-25T08:46:27.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.template import Context, Template, TemplateSyntaxError
from django.utils.translation import override
import pytest
from djmoney.models.fields import MoneyPatched
from djmoney.templatetags.djmoney import MoneyLocalizeNode
from moneyed import ... | 28.953333 | 96 | 0.521529 |
from __future__ import unicode_literals
from django.template import Context, Template, TemplateSyntaxError
from django.utils.translation import override
import pytest
from djmoney.models.fields import MoneyPatched
from djmoney.templatetags.djmoney import MoneyLocalizeNode
from moneyed import Money
def render(temp... | true | true |
f70a153b88783e9a6e3e8721963f8b862849cdcb | 70 | py | Python | rlutils/pytorch/__init__.py | vermouth1992/rlutils | a326373b9e39dbf147c6c4261b82a688d4dc3e78 | [
"Apache-2.0"
] | null | null | null | rlutils/pytorch/__init__.py | vermouth1992/rlutils | a326373b9e39dbf147c6c4261b82a688d4dc3e78 | [
"Apache-2.0"
] | null | null | null | rlutils/pytorch/__init__.py | vermouth1992/rlutils | a326373b9e39dbf147c6c4261b82a688d4dc3e78 | [
"Apache-2.0"
] | null | null | null | from . import distributions
from . import functional
from . import nn
| 17.5 | 27 | 0.785714 | from . import distributions
from . import functional
from . import nn
| true | true |
f70a16364238c5a4f7f1a12687bc6b9e07edc599 | 970 | py | Python | Searching and Sorting/Merge sort/Python/merge_sort.py | Subrato-oid/cs-algorithms | 4a04fe49f513c439b641a8e4e783a98cd99dc909 | [
"MIT"
] | 239 | 2019-10-07T11:01:56.000Z | 2022-01-27T19:08:55.000Z | Searching and Sorting/Merge sort/Python/merge_sort.py | ashfreakingoyal/cs-algorithms | 08f5aba5c3379e17d03b899fc36efcdccebd181c | [
"MIT"
] | 176 | 2019-10-07T06:59:49.000Z | 2020-09-30T08:16:22.000Z | Searching and Sorting/Merge sort/Python/merge_sort.py | ashfreakingoyal/cs-algorithms | 08f5aba5c3379e17d03b899fc36efcdccebd181c | [
"MIT"
] | 441 | 2019-10-07T07:34:08.000Z | 2022-03-15T07:19:58.000Z | def mergesort(items):
if len(items) <= 1:
return items
mid = len(items) // 2
left = items[:mid]
right = items[mid:]
left = mergesort(left)
right = mergesort(right)
return merge(left, right)
def merge(left, right):
merged = []
left_index = 0
right_index... | 25.526316 | 62 | 0.587629 | def mergesort(items):
if len(items) <= 1:
return items
mid = len(items) // 2
left = items[:mid]
right = items[mid:]
left = mergesort(left)
right = mergesort(right)
return merge(left, right)
def merge(left, right):
merged = []
left_index = 0
right_index... | true | true |
f70a168c3c1ea13d7bafe7bef9dcf39a28e655b8 | 151 | py | Python | dependencies/bluebird-master/examples/followers.py | munyolec/Impact-of-Covid-19-on-Food-and-Air-Quality-in-Africa | fb5762b8a759aa5bc368edd6ea3ac714af853b1e | [
"MIT"
] | 2 | 2020-10-22T16:19:34.000Z | 2020-12-19T15:51:00.000Z | dependencies/bluebird-master/examples/followers.py | munyolec/Impact-of-Covid-19-on-Food-and-Air-Quality-in-Africa | fb5762b8a759aa5bc368edd6ea3ac714af853b1e | [
"MIT"
] | null | null | null | dependencies/bluebird-master/examples/followers.py | munyolec/Impact-of-Covid-19-on-Food-and-Air-Quality-in-Africa | fb5762b8a759aa5bc368edd6ea3ac714af853b1e | [
"MIT"
] | 6 | 2020-09-28T07:31:29.000Z | 2020-09-29T10:51:50.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from bluebird import BlueBird
for username in BlueBird().get_followers('brunn3is'):
print(username) | 21.571429 | 53 | 0.701987 |
from bluebird import BlueBird
for username in BlueBird().get_followers('brunn3is'):
print(username) | true | true |
f70a176b0b06930bded82cfc3477e7bf3ca21f6b | 18,419 | py | Python | rancher.py | xl82602/xl | 79c48d121f669ae0d95861f24e5efd58dd16de0c | [
"MIT"
] | null | null | null | rancher.py | xl82602/xl | 79c48d121f669ae0d95861f24e5efd58dd16de0c | [
"MIT"
] | null | null | null | rancher.py | xl82602/xl | 79c48d121f669ae0d95861f24e5efd58dd16de0c | [
"MIT"
] | null | null | null | # !/usr/bin/env python
import re
import requests
import collections
import hashlib
import os
import json
import time
def _prefix(cmd):
prefix = os.path.basename(cmd.replace('-', '_'))
for i in ['.pyc', '.py', '-cli', '-tool', '-util']:
prefix = prefix.replace(i, '')
return prefix.upper()
PREFI... | 29.998371 | 79 | 0.525761 |
import re
import requests
import collections
import hashlib
import os
import json
import time
def _prefix(cmd):
prefix = os.path.basename(cmd.replace('-', '_'))
for i in ['.pyc', '.py', '-cli', '-tool', '-util']:
prefix = prefix.replace(i, '')
return prefix.upper()
PREFIX = _prefix(__file__)
... | true | true |
f70a179b3eddf190eaaa58dc66330aea22ba5acb | 2,292 | py | Python | MaxiNet/Frontend/distriopt_.py | Giuseppe1992/MaxiNet | fffb5ca383afb7f7f22de0646cced7f0182b86b5 | [
"MIT"
] | null | null | null | MaxiNet/Frontend/distriopt_.py | Giuseppe1992/MaxiNet | fffb5ca383afb7f7f22de0646cced7f0182b86b5 | [
"MIT"
] | null | null | null | MaxiNet/Frontend/distriopt_.py | Giuseppe1992/MaxiNet | fffb5ca383afb7f7f22de0646cced7f0182b86b5 | [
"MIT"
] | null | null | null | import json
import os
from mininet.topo import Topo
import subprocess
class Mapper(object):
def __init__(self, topo, physical_network_file, mapper):
self.topo = topo
self.physical_network_file = physical_network_file
self.mapper = mapper
self.topo_file = self.create_topo_file(topo... | 36.380952 | 152 | 0.609511 | import json
import os
from mininet.topo import Topo
import subprocess
class Mapper(object):
def __init__(self, topo, physical_network_file, mapper):
self.topo = topo
self.physical_network_file = physical_network_file
self.mapper = mapper
self.topo_file = self.create_topo_file(topo... | true | true |
f70a17dff3a5f42dca4df45b96d57c4d84470ded | 11,913 | py | Python | code/python/TimeSeriesAPIforDigitalPortals/v3/fds/sdk/TimeSeriesAPIforDigitalPortals/model/inline_response2001.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 6 | 2022-02-07T16:34:18.000Z | 2022-03-30T08:04:57.000Z | code/python/TimeSeriesAPIforDigitalPortals/v3/fds/sdk/TimeSeriesAPIforDigitalPortals/model/inline_response2001.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 2 | 2022-02-07T05:25:57.000Z | 2022-03-07T14:18:04.000Z | code/python/TimeSeriesAPIforDigitalPortals/v3/fds/sdk/TimeSeriesAPIforDigitalPortals/model/inline_response2001.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | null | null | null | """
Time Series API For Digital Portals
Time series data, end-of-day or intraday, tick-by-tick or subsampled. Additional vendor-specific endpoints provide a modified interface for seamless integration with the ChartIQ chart library. # noqa: E501
The version of the OpenAPI document: 2
Generated by: ht... | 44.451493 | 210 | 0.583816 |
import re
import sys
from fds.sdk.TimeSeriesAPIforDigitalPortals.model_utils import (
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_... | true | true |
f70a182da31175046edd04dfca877dac25580027 | 323 | py | Python | testes_basicos.py | renzon/pypraticot2 | 530c422ac0fd482e491db46cdf250145e0c22f60 | [
"MIT"
] | 1 | 2017-07-16T00:16:31.000Z | 2017-07-16T00:16:31.000Z | testes_basicos.py | renzon/pypraticot2 | 530c422ac0fd482e491db46cdf250145e0c22f60 | [
"MIT"
] | null | null | null | testes_basicos.py | renzon/pypraticot2 | 530c422ac0fd482e491db46cdf250145e0c22f60 | [
"MIT"
] | null | null | null | import unittest
def soma(param, param1):
return param + param1
class BasicoTests(unittest.TestCase):
def test_soma(self):
resultado = soma(1, 2)
self.assertEqual(3, resultado)
resultado = soma(3, 2)
self.assertEqual(5, resultado)
if __name__ == '__main__':
unittest.main... | 17.944444 | 38 | 0.640867 | import unittest
def soma(param, param1):
return param + param1
class BasicoTests(unittest.TestCase):
def test_soma(self):
resultado = soma(1, 2)
self.assertEqual(3, resultado)
resultado = soma(3, 2)
self.assertEqual(5, resultado)
if __name__ == '__main__':
unittest.main... | true | true |
f70a187b86345725dacfb36b83a3c8c5937c9f30 | 8,106 | py | Python | tests/test_colour_specification_box.py | feature-engineer/glymur | 660b593ab7bfbb3036de5d15c3ecb43bef3bf919 | [
"MIT"
] | 41 | 2015-04-06T21:36:55.000Z | 2022-02-03T09:41:42.000Z | tests/test_colour_specification_box.py | feature-engineer/glymur | 660b593ab7bfbb3036de5d15c3ecb43bef3bf919 | [
"MIT"
] | 244 | 2015-01-01T03:41:54.000Z | 2022-03-24T14:07:33.000Z | tests/test_colour_specification_box.py | feature-engineer/glymur | 660b593ab7bfbb3036de5d15c3ecb43bef3bf919 | [
"MIT"
] | 21 | 2015-03-06T12:57:27.000Z | 2022-03-02T16:00:54.000Z | # -*- coding: utf-8 -*-
"""
Test suite specifically targeting ICC profiles
"""
# Standard library imports ...
from datetime import datetime
try:
import importlib.resources as ir
except ImportError: # pragma: no cover
# before 3.7
import importlib_resources as ir
import struct
import tempfile
import unit... | 37.878505 | 79 | 0.632618 |
from datetime import datetime
try:
import importlib.resources as ir
except ImportError:
import importlib_resources as ir
import struct
import tempfile
import unittest
import warnings
import numpy as np
import glymur
from glymur import Jp2k
from glymur._iccprofile import _ICCProfile
from glymur.jp2... | true | true |
f70a18b901a7364101fce9a3ef3981bb6655bbe2 | 11,412 | py | Python | bls_py/keys.py | zebra-lucky/python-bls | f1adb3d57997bf67820dd62eb355a9cd1a82eb4d | [
"Apache-2.0"
] | 3 | 2020-07-25T00:37:31.000Z | 2020-08-24T11:42:17.000Z | bls_py/keys.py | zebra-lucky/python-bls | f1adb3d57997bf67820dd62eb355a9cd1a82eb4d | [
"Apache-2.0"
] | null | null | null | bls_py/keys.py | zebra-lucky/python-bls | f1adb3d57997bf67820dd62eb355a9cd1a82eb4d | [
"Apache-2.0"
] | 1 | 2019-12-09T09:02:05.000Z | 2019-12-09T09:02:05.000Z | import sys
from copy import deepcopy
from random import SystemRandom
from .aggregation_info import AggregationInfo
from .ec import (AffinePoint, JacobianPoint, default_ec, generator_Fq,
hash_to_point_Fq2, hash_to_point_prehashed_Fq2, y_for_x)
from .fields import Fq
from .signature import Signature
fro... | 34.167665 | 88 | 0.616106 | import sys
from copy import deepcopy
from random import SystemRandom
from .aggregation_info import AggregationInfo
from .ec import (AffinePoint, JacobianPoint, default_ec, generator_Fq,
hash_to_point_Fq2, hash_to_point_prehashed_Fq2, y_for_x)
from .fields import Fq
from .signature import Signature
fro... | true | true |
f70a195622f84b2586afb783102fe8933f5e550b | 3,683 | py | Python | scripts/module/preparation/phastcons_score_list.py | Naoto-Imamachi/MIRAGE | 448d7f2b62f0830c0abd3eb1435d16baffc5d3f9 | [
"MIT"
] | 3 | 2017-01-16T03:31:38.000Z | 2021-01-04T16:00:59.000Z | scripts/module/preparation/phastcons_score_list.py | Imamachi-n/MIRAGE | 448d7f2b62f0830c0abd3eb1435d16baffc5d3f9 | [
"MIT"
] | null | null | null | scripts/module/preparation/phastcons_score_list.py | Imamachi-n/MIRAGE | 448d7f2b62f0830c0abd3eb1435d16baffc5d3f9 | [
"MIT"
] | null | null | null | #!usr/bin/env python
import sys
import re
import shelve
from parameter.common_parameters import common_parameters
import utils.setting_utils as utils
utils.now_time("phastcons_score_list script starting...")
p = utils.Bunch(common_parameters)
def main():
utils.now_time("Input_file: " + p.phastcons_sc... | 42.825581 | 204 | 0.55987 |
import sys
import re
import shelve
from parameter.common_parameters import common_parameters
import utils.setting_utils as utils
utils.now_time("phastcons_score_list script starting...")
p = utils.Bunch(common_parameters)
def main():
utils.now_time("Input_file: " + p.phastcons_score_list_db_input)
... | true | true |
f70a19951b85ac6ffcb76c0f7122a6358303f1e6 | 4,620 | py | Python | docs/conf.py | UltronAI/habitat-sim | f8fd41a56b9ad2cbc4781d2a16291ca83ce91964 | [
"MIT"
] | 1,457 | 2019-02-21T21:42:41.000Z | 2022-03-29T13:34:28.000Z | docs/conf.py | UltronAI/habitat-sim | f8fd41a56b9ad2cbc4781d2a16291ca83ce91964 | [
"MIT"
] | 1,131 | 2019-02-27T16:14:06.000Z | 2022-03-31T15:41:24.000Z | docs/conf.py | UltronAI/habitat-sim | f8fd41a56b9ad2cbc4781d2a16291ca83ce91964 | [
"MIT"
] | 316 | 2019-02-26T22:45:38.000Z | 2022-03-26T04:55:32.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import re
import sys
# TODO make this less brittle
sys.path = [
os.path.join(os.path.dirname(__file__), "../"),
# os.path.jo... | 29.615385 | 140 | 0.640043 |
import os
import re
import sys
sys.path = [
os.path.join(os.path.dirname(__file__), "../"),
] + sys.path
import habitat_sim
habitat_sim.logging.HabitatSimFormatter.formatStack.__doc__ = ""
habitat_sim.registry = type(habitat_sim.registry)
habitat_sim.utils.__all__.remove("quat_from_angle_axis")
ha... | true | true |
f70a19f51fc1e4929dfce84168119a5e0a81eef7 | 15,349 | py | Python | tests/components/monoprice/test_media_player.py | pdbogen/home-assistant | e602de55ac09be9ab8cbb354519a1b1b57fbe362 | [
"Apache-2.0"
] | 2 | 2022-01-24T18:59:56.000Z | 2022-02-04T22:12:48.000Z | tests/components/monoprice/test_media_player.py | pdbogen/home-assistant | e602de55ac09be9ab8cbb354519a1b1b57fbe362 | [
"Apache-2.0"
] | 5 | 2021-02-08T20:55:25.000Z | 2022-03-12T00:51:18.000Z | tests/components/monoprice/test_media_player.py | pdbogen/home-assistant | e602de55ac09be9ab8cbb354519a1b1b57fbe362 | [
"Apache-2.0"
] | 1 | 2020-05-18T09:13:52.000Z | 2020-05-18T09:13:52.000Z | """The tests for Monoprice Media player platform."""
from collections import defaultdict
from serial import SerialException
from homeassistant.components.media_player.const import (
ATTR_INPUT_SOURCE,
ATTR_INPUT_SOURCE_LIST,
ATTR_MEDIA_VOLUME_LEVEL,
DOMAIN as MEDIA_PLAYER_DOMAIN,
SERVICE_SELECT_SO... | 31.844398 | 88 | 0.704671 | from collections import defaultdict
from serial import SerialException
from homeassistant.components.media_player.const import (
ATTR_INPUT_SOURCE,
ATTR_INPUT_SOURCE_LIST,
ATTR_MEDIA_VOLUME_LEVEL,
DOMAIN as MEDIA_PLAYER_DOMAIN,
SERVICE_SELECT_SOURCE,
SUPPORT_SELECT_SOURCE,
SUPPORT_TURN_OFF... | true | true |
f70a1a3d6be3176f87e56f1573e0f4b1076b23a5 | 496 | py | Python | pythontutorials/books/AutomateTheBoringStuff/Ch05/P2_characterCount.py | JoseALermaIII/python-tutorials | 9d6cb78beec0bb55e27c49da1217317ba4d5f4fc | [
"MIT"
] | 2 | 2017-04-20T02:57:19.000Z | 2018-10-12T20:15:47.000Z | pythontutorials/books/AutomateTheBoringStuff/Ch05/P2_characterCount.py | JoseALermaIII/python-tutorials | 9d6cb78beec0bb55e27c49da1217317ba4d5f4fc | [
"MIT"
] | 8 | 2021-03-18T21:50:16.000Z | 2022-03-11T23:38:01.000Z | pythontutorials/books/AutomateTheBoringStuff/Ch05/P2_characterCount.py | JoseALermaIII/python-tutorials | 9d6cb78beec0bb55e27c49da1217317ba4d5f4fc | [
"MIT"
] | 3 | 2018-08-30T20:30:50.000Z | 2022-01-18T13:40:51.000Z | """Character count
This program counts how often each character appears in a string.
"""
def main():
message = 'It was a bright cold day in April, and the clocks were striking thirteen.'
"""str: Message to count characters."""
count = {}
"""dict: Characters as keys and counts as values."""
... | 20.666667 | 89 | 0.637097 |
def main():
message = 'It was a bright cold day in April, and the clocks were striking thirteen.'
count = {}
for character in message:
count.setdefault(character, 0)
count[character] = count[character] + 1
print(count)
if __name__ == '__main__':
main()
| true | true |
f70a1cb6f5e5200cbb6e0cabbea4fdcec0c9ec6c | 1,914 | py | Python | roberta/scripts/convert_bert_text_classification_from_huggingface_to_uer.py | LiRunyi2001/cnSoftBei | 72b90033ade1e926d3fb23621f5c67fa8eec9bb4 | [
"MIT"
] | 1 | 2021-11-29T08:33:00.000Z | 2021-11-29T08:33:00.000Z | roberta/scripts/convert_bert_text_classification_from_huggingface_to_uer.py | LiRunyi2001/cnSoftBei | 72b90033ade1e926d3fb23621f5c67fa8eec9bb4 | [
"MIT"
] | null | null | null | roberta/scripts/convert_bert_text_classification_from_huggingface_to_uer.py | LiRunyi2001/cnSoftBei | 72b90033ade1e926d3fb23621f5c67fa8eec9bb4 | [
"MIT"
] | null | null | null | import sys
import os
import torch
import argparse
import collections
uer_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
sys.path.insert(0, uer_dir)
from scripts.convert_bert_from_huggingface_to_uer import convert_bert_transformer_encoder_from_huggingface_to_uer
parser = argparse.ArgumentParser(... | 47.85 | 223 | 0.795716 | import sys
import os
import torch
import argparse
import collections
uer_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
sys.path.insert(0, uer_dir)
from scripts.convert_bert_from_huggingface_to_uer import convert_bert_transformer_encoder_from_huggingface_to_uer
parser = argparse.ArgumentParser(... | true | true |
f70a1cef52c255401bc34e7dbbce792978be7289 | 69,597 | py | Python | sdk/lusid/api/data_types_api.py | finbourne/lusid-sdk-python-generated-preview | 9c36c953e8149443a4390ed7f0c04d01211401b6 | [
"MIT"
] | null | null | null | sdk/lusid/api/data_types_api.py | finbourne/lusid-sdk-python-generated-preview | 9c36c953e8149443a4390ed7f0c04d01211401b6 | [
"MIT"
] | null | null | null | sdk/lusid/api/data_types_api.py | finbourne/lusid-sdk-python-generated-preview | 9c36c953e8149443a4390ed7f0c04d01211401b6 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
LUSID API
FINBOURNE Technology # noqa: E501
The version of the OpenAPI document: 0.11.4425
Contact: info@finbourne.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility lib... | 54.930545 | 409 | 0.61415 |
from __future__ import absolute_import
import re
import six
from lusid.api_client import ApiClient
from lusid.exceptions import (
ApiTypeError,
ApiValueError
)
class DataTypesApi(object):
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
... | true | true |
f70a1da1cd39a3e99fe038d88d3e890621cfe100 | 4,950 | py | Python | napari/utils/progress.py | kolibril13/napari | b39647d94e587f0255b0d4cc3087855e160a8929 | [
"BSD-3-Clause"
] | null | null | null | napari/utils/progress.py | kolibril13/napari | b39647d94e587f0255b0d4cc3087855e160a8929 | [
"BSD-3-Clause"
] | null | null | null | napari/utils/progress.py | kolibril13/napari | b39647d94e587f0255b0d4cc3087855e160a8929 | [
"BSD-3-Clause"
] | null | null | null | import inspect
from typing import Iterable, Optional
from tqdm import tqdm
from ..utils.translations import trans
_tqdm_kwargs = {
p.name
for p in inspect.signature(tqdm.__init__).parameters.values()
if p.kind is not inspect.Parameter.VAR_KEYWORD and p.name != "self"
}
class progress(tqdm):
"""This... | 28.612717 | 76 | 0.571111 | import inspect
from typing import Iterable, Optional
from tqdm import tqdm
from ..utils.translations import trans
_tqdm_kwargs = {
p.name
for p in inspect.signature(tqdm.__init__).parameters.values()
if p.kind is not inspect.Parameter.VAR_KEYWORD and p.name != "self"
}
class progress(tqdm):
monito... | true | true |
f70a1dbc606d62d87076fc535271675c9725e00f | 579 | py | Python | macronizer_cores/errors/routes.py | triethuynh2301/macronizer-project | b4cd234de603abc8f588c143ac1fdf56063390c5 | [
"MIT"
] | null | null | null | macronizer_cores/errors/routes.py | triethuynh2301/macronizer-project | b4cd234de603abc8f588c143ac1fdf56063390c5 | [
"MIT"
] | null | null | null | macronizer_cores/errors/routes.py | triethuynh2301/macronizer-project | b4cd234de603abc8f588c143ac1fdf56063390c5 | [
"MIT"
] | null | null | null | from flask import Blueprint, render_template
from macronizer_cores import db
# create error blueprint
errors = Blueprint('errors', __name__)
# SECTION - routes
# NOTE - app_errorhandler() is a method inherited from Blueprint that is equivalent to errorhandler() inherited from flask
@errors.app_errorhandler(404)
def... | 25.173913 | 122 | 0.759931 | from flask import Blueprint, render_template
from macronizer_cores import db
errors = Blueprint('errors', __name__)
@errors.app_errorhandler(404)
def page_not_found(e):
return render_template('errors/404.html'), 404
@errors.app_errorhandler(500)
def internal_server_error(e):
db.session.rollback()
ret... | true | true |
f70a1df778a417b37e29bcfcd5700440004d378c | 3,448 | py | Python | src/api/bkuser_core/categories/migrations/0010_auto_20210803_1026.py | trueware/bk-user | 8c633e0a3821beb839ed120c4514c5733e675862 | [
"MIT"
] | null | null | null | src/api/bkuser_core/categories/migrations/0010_auto_20210803_1026.py | trueware/bk-user | 8c633e0a3821beb839ed120c4514c5733e675862 | [
"MIT"
] | null | null | null | src/api/bkuser_core/categories/migrations/0010_auto_20210803_1026.py | trueware/bk-user | 8c633e0a3821beb839ed120c4514c5733e675862 | [
"MIT"
] | 1 | 2021-12-31T06:48:41.000Z | 2021-12-31T06:48:41.000Z | # -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-用户管理(Bk-User) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the Lic... | 52.242424 | 220 | 0.632251 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('categories', '0009_auto_20210413_1702'),
]
operations = [
migrations.CreateModel(
name='SyncProgress',
fields=[
(... | true | true |
f70a1e8de15b92057b4e7a95a2e6ed9b32905846 | 38,568 | py | Python | dev/Tools/build/waf-1.7.13/waflib/Task.py | raghnarx/lumberyard | 1c52b941dcb7d94341fcf21275fe71ff67173ada | [
"AML"
] | 8 | 2019-10-07T16:33:47.000Z | 2020-12-07T03:59:58.000Z | dev/Tools/build/waf-1.7.13/waflib/Task.py | 29e7e280-0d1c-4bba-98fe-f7cd3ca7500a/lumberyard | 1c52b941dcb7d94341fcf21275fe71ff67173ada | [
"AML"
] | null | null | null | dev/Tools/build/waf-1.7.13/waflib/Task.py | 29e7e280-0d1c-4bba-98fe-f7cd3ca7500a/lumberyard | 1c52b941dcb7d94341fcf21275fe71ff67173ada | [
"AML"
] | 4 | 2019-08-05T07:25:46.000Z | 2020-12-07T05:12:55.000Z | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2005-2010 (ita)
"""
Tasks represent atomic operations such as processes.
"""
import os, shutil, re, tempfile, time, pprint
from waflib import Context, Utils, Logs, Errors
from binascii import hexlify
# task states
NOT_RUN = 0
"""The task was not executed yet"""
... | 28.675093 | 153 | 0.673538 |
import os, shutil, re, tempfile, time, pprint
from waflib import Context, Utils, Logs, Errors
from binascii import hexlify
NOT_RUN = 0
MISSING = 1
CRASHED = 2
EXCEPTION = 3
SKIPPED = 8
SUCCESS = 9
ASK_LATER = -1
SKIP_ME = -2
RUN_ME = -3
COMPILE_TEMPLATE_SHELL = '''
def f(tsk):
env = tsk.env
gen = tsk.... | true | true |
f70a1f7c570d346ca9264fc6af83f1d197354756 | 2,526 | py | Python | foampy/tests/test_dictionaries.py | petebachant/foamPy | ff74ab13f982b31e8ef0d1f379425db08f03924c | [
"MIT"
] | 8 | 2017-11-22T03:37:32.000Z | 2021-11-23T08:57:15.000Z | foampy/tests/test_dictionaries.py | Carlopasquinucci/foamPy | ff74ab13f982b31e8ef0d1f379425db08f03924c | [
"MIT"
] | 45 | 2015-02-11T23:09:59.000Z | 2017-07-24T22:24:31.000Z | foampy/tests/test_dictionaries.py | Carlopasquinucci/foamPy | ff74ab13f982b31e8ef0d1f379425db08f03924c | [
"MIT"
] | 7 | 2015-05-05T21:41:54.000Z | 2020-09-30T14:29:54.000Z | """Tests for the `dictionaries` module."""
from __future__ import division, print_function, absolute_import
import foampy
from foampy.dictionaries import *
def test_replace_value():
"""Test the `replace_value` function."""
print("\nTesting dictionaries.replace_value")
orig = read_single_line_value(dictna... | 48.576923 | 99 | 0.407759 |
from __future__ import division, print_function, absolute_import
import foampy
from foampy.dictionaries import *
def test_replace_value():
print("\nTesting dictionaries.replace_value")
orig = read_single_line_value(dictname="blockMeshDict",
keyword="convertToMeters",
... | true | true |
f70a1f932d120296d5c3e1b50f097d31b797cbbf | 1,957 | py | Python | Python/Templates/Web/ProjectTemplates/Python/Web/WorkerRoleProject/worker.py | awesome-archive/PTVS | c0cd34196ddf53b4ca755d72da5351f4e2ffdfb9 | [
"Apache-2.0"
] | 1 | 2019-06-05T19:16:49.000Z | 2019-06-05T19:16:49.000Z | Python/Templates/Web/ProjectTemplates/Python/Web/WorkerRoleProject/worker.py | willv84/PTVS | 42b834efec9dd1510dc83cdec28c93ee3110b5f2 | [
"Apache-2.0"
] | 2 | 2019-06-05T18:13:41.000Z | 2019-06-05T20:13:16.000Z | Python/Templates/Web/ProjectTemplates/Python/Web/WorkerRoleProject/worker.py | RaymonGulati1/PTVS | ee1d09f2a94be4e21016f7579205bb65ec82c616 | [
"Apache-2.0"
] | 2 | 2018-03-02T19:55:14.000Z | 2019-02-14T22:37:28.000Z | import os
from time import sleep
#
# The azure library provides access to services made available by the
# Microsoft Azure platform, such as storage and messaging.
#
# See https://go.microsoft.com/fwlink/?linkid=254360 for documentation and
# example code.
#
from azure.servicebus import ServiceBusService
from azure.s... | 34.946429 | 87 | 0.771589 | import os
from time import sleep
from azure.servicebus import ServiceBusService
from azure.storage import CloudStorageAccount
STORAGE_ACCOUNT_NAME = '__paste_your_storage_account_name_here__'
STORAGE_ACCOUNT_KEY = '__paste_your_storage_key_here__'
if os.environ.get('EMULATED', '').lower() == 'true':
... | true | true |
f70a2161483120e67364fec4846701e21f94c6f8 | 1,509 | py | Python | mmdet/models/bbox_heads/mgan_head.py | zjplab/Pedestron | 07e1a2cee82b57e1584b0c744f5b44f1ae92be73 | [
"Apache-2.0"
] | null | null | null | mmdet/models/bbox_heads/mgan_head.py | zjplab/Pedestron | 07e1a2cee82b57e1584b0c744f5b44f1ae92be73 | [
"Apache-2.0"
] | null | null | null | mmdet/models/bbox_heads/mgan_head.py | zjplab/Pedestron | 07e1a2cee82b57e1584b0c744f5b44f1ae92be73 | [
"Apache-2.0"
] | null | null | null | import torch.nn as nn
from ..registry import HEADS
from ..utils import ConvModule
from mmdetection.core import auto_fp16
@HEADS.register_module
class MGANHead(nn.Module):
def __init__(self,
num_convs=2,
roi_feat_size=7,
in_channels=512,
conv_ou... | 28.471698 | 71 | 0.55666 | import torch.nn as nn
from ..registry import HEADS
from ..utils import ConvModule
from mmdetection.core import auto_fp16
@HEADS.register_module
class MGANHead(nn.Module):
def __init__(self,
num_convs=2,
roi_feat_size=7,
in_channels=512,
conv_ou... | true | true |
f70a218a22117f560b2fb24add1cdcdeacc100ed | 273 | py | Python | weread/redisTool.py | songjiang951130/JD-Coin | 03e2183435e6e8e4cf109fa7286d15cf5f6933da | [
"Apache-2.0"
] | 5 | 2019-08-01T10:35:48.000Z | 2019-12-15T02:58:01.000Z | weread/redisTool.py | songjiang951130/JD-Coin | 03e2183435e6e8e4cf109fa7286d15cf5f6933da | [
"Apache-2.0"
] | 1 | 2020-01-21T08:38:24.000Z | 2020-01-21T08:38:24.000Z | weread/redisTool.py | songjiang951130/JD-Coin | 03e2183435e6e8e4cf109fa7286d15cf5f6933da | [
"Apache-2.0"
] | 7 | 2019-08-28T11:36:15.000Z | 2022-01-16T14:55:41.000Z | import redis
host = '127.0.0.1'
port = 6379
client = redis.Redis(host=host, port=port)
client.set("redis", "value111", None, 1000)
print(str(client.get("redis")))
if client.get("redis1") != None and len(client.get("redis1")) > 0:
print("sss")
else:
print("no")
| 18.2 | 66 | 0.641026 | import redis
host = '127.0.0.1'
port = 6379
client = redis.Redis(host=host, port=port)
client.set("redis", "value111", None, 1000)
print(str(client.get("redis")))
if client.get("redis1") != None and len(client.get("redis1")) > 0:
print("sss")
else:
print("no")
| true | true |
f70a21ed38d44e8d3f866d610001a211b803b1ce | 7,189 | py | Python | src/onegov/election_day/path.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/path.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/path.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.ballot import Ballot
from onegov.ballot import BallotCollection
from onegov.ballot import Candidate
from onegov.ballot import CandidateCollection
from onegov.ballot import Election
from onegov.ballot import ElectionCollection
from onegov.ballot import ElectionCompound
from onegov.ballot import ElectionCompo... | 23.340909 | 78 | 0.717346 | from onegov.ballot import Ballot
from onegov.ballot import BallotCollection
from onegov.ballot import Candidate
from onegov.ballot import CandidateCollection
from onegov.ballot import Election
from onegov.ballot import ElectionCollection
from onegov.ballot import ElectionCompound
from onegov.ballot import ElectionCompo... | true | true |
f70a220499257b977fc553bef7627d7bfd552431 | 31,854 | py | Python | selfdrive/controls/controlsd.py | jauderho/openpilot | 9720dbe9b94a409d1540ec624b1deb29a5f37c8b | [
"MIT"
] | null | null | null | selfdrive/controls/controlsd.py | jauderho/openpilot | 9720dbe9b94a409d1540ec624b1deb29a5f37c8b | [
"MIT"
] | 65 | 2021-06-28T21:29:20.000Z | 2021-09-16T21:19:17.000Z | selfdrive/controls/controlsd.py | jauderho/openpilot | 9720dbe9b94a409d1540ec624b1deb29a5f37c8b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import math
from numbers import Number
from cereal import car, log
from common.numpy_fast import clip
from common.realtime import sec_since_boot, config_realtime_process, Priority, Ratekeeper, DT_CTRL
from common.profiler import Profiler
from common.params import Params, put_nonblockin... | 42.134921 | 154 | 0.706567 |
import os
import math
from numbers import Number
from cereal import car, log
from common.numpy_fast import clip
from common.realtime import sec_since_boot, config_realtime_process, Priority, Ratekeeper, DT_CTRL
from common.profiler import Profiler
from common.params import Params, put_nonblocking
import cereal.messag... | true | true |
f70a23e92e05e9cf9eeb8ad1955f0041146b7b6f | 169 | py | Python | 78_pr9_06.py | AmreshTripathy/Python | e86420fef7f52da393be5b50ac2f13bddfeb3306 | [
"Apache-2.0"
] | 4 | 2021-05-27T05:06:09.000Z | 2021-06-12T17:12:47.000Z | 78_pr9_06.py | AmreshTripathy/Python | e86420fef7f52da393be5b50ac2f13bddfeb3306 | [
"Apache-2.0"
] | null | null | null | 78_pr9_06.py | AmreshTripathy/Python | e86420fef7f52da393be5b50ac2f13bddfeb3306 | [
"Apache-2.0"
] | null | null | null | with open('log.txt') as f:
text = f.read().lower()
if ('python' in text):
print ('Yes, Python is present')
else:
print ('No, Python is not present')
| 21.125 | 40 | 0.573964 | with open('log.txt') as f:
text = f.read().lower()
if ('python' in text):
print ('Yes, Python is present')
else:
print ('No, Python is not present')
| true | true |
f70a243e4446ed30e1ab6f3bb466a27d6919e8aa | 9,213 | py | Python | game_demos/trials.py | LocoBunny04/Vroom-Vroom-BTS-Edition | 6432ad6dc2578bb060543dbe91a6dafbd3a8bd52 | [
"MIT"
] | null | null | null | game_demos/trials.py | LocoBunny04/Vroom-Vroom-BTS-Edition | 6432ad6dc2578bb060543dbe91a6dafbd3a8bd52 | [
"MIT"
] | null | null | null | game_demos/trials.py | LocoBunny04/Vroom-Vroom-BTS-Edition | 6432ad6dc2578bb060543dbe91a6dafbd3a8bd52 | [
"MIT"
] | null | null | null | from PIL import Image, ImageTk
import random as rand
import turtle as trtl
# import required module
from playsound import playsound
import tkinter.messagebox
from pynput.keyboard import Key, Listener
import glob
#import prgm_image
# prgm_image_list = []
# for filename in glob.glob('/Users/khaase/Desktop/VroomFold/prgm_... | 24.437666 | 177 | 0.629762 | from PIL import Image, ImageTk
import random as rand
import turtle as trtl
from playsound import playsound
import tkinter.messagebox
from pynput.keyboard import Key, Listener
import glob
Screen()
si = trtl.Turtle()
caller = trtl.Turtle()
st = trtl.Turtle()
rSt = trtl.Turtle()
user = trtl.Turtle()
point = trtl.Turtl... | true | true |
f70a25425109eb80765b11c658857ded6d821f1e | 7,576 | py | Python | weather_sp/splitter_pipeline/file_splitters.py | shriekdj/weather-tools | 882b832a3ae7fdaff432cfec5915e94919bd4262 | [
"Apache-2.0"
] | null | null | null | weather_sp/splitter_pipeline/file_splitters.py | shriekdj/weather-tools | 882b832a3ae7fdaff432cfec5915e94919bd4262 | [
"Apache-2.0"
] | null | null | null | weather_sp/splitter_pipeline/file_splitters.py | shriekdj/weather-tools | 882b832a3ae7fdaff432cfec5915e94919bd4262 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 38.653061 | 117 | 0.619192 |
import abc
import logging
import shutil
import tempfile
import typing as t
from contextlib import contextmanager
import apache_beam.metrics as metrics
import netCDF4 as nc
import pygrib
from apache_beam.io.filesystems import FileSystems
from .file_name_utils import OutFileInfo
logger = logging.getLogge... | true | true |
f70a259508b1b45d8cb1c78e697950e6b5a3fd78 | 11,877 | py | Python | bionic/datatypes.py | square/bionic | 357da8e2806996427e0aa6efd08f7ea8c5198f9b | [
"Apache-2.0"
] | 98 | 2019-08-29T21:38:44.000Z | 2022-01-26T04:59:57.000Z | bionic/datatypes.py | square/bionic | 357da8e2806996427e0aa6efd08f7ea8c5198f9b | [
"Apache-2.0"
] | 143 | 2019-09-11T15:32:17.000Z | 2021-06-08T21:48:30.000Z | bionic/datatypes.py | square/bionic | 357da8e2806996427e0aa6efd08f7ea8c5198f9b | [
"Apache-2.0"
] | 20 | 2019-09-13T18:13:03.000Z | 2021-12-03T19:51:01.000Z | """
Contains various data structures used by Bionic's infrastructure.
"""
import attr
from .utils.misc import ImmutableSequence, ImmutableMapping
@attr.s(frozen=True)
class EntityDefinition:
"""
Describes the immutable properties of an entity. These properties generally have
to do with the entity's "con... | 31.337731 | 93 | 0.66473 |
import attr
from .utils.misc import ImmutableSequence, ImmutableMapping
@attr.s(frozen=True)
class EntityDefinition:
name = attr.ib()
protocol = attr.ib()
doc = attr.ib()
optional_should_memoize = attr.ib()
optional_should_persist = attr.ib()
needs_caching = attr.ib(default=False)
@attr.s... | true | true |
f70a25b71d5f45ade2f220d3d461d927e22f6bd6 | 677 | py | Python | rqt_ocare/scripts/capture_image.py | SiChiTong/ros_ocare_nav | 5df256ae9f398cb05f3d0d8c9be124fed5fc2c26 | [
"Apache-2.0"
] | null | null | null | rqt_ocare/scripts/capture_image.py | SiChiTong/ros_ocare_nav | 5df256ae9f398cb05f3d0d8c9be124fed5fc2c26 | [
"Apache-2.0"
] | null | null | null | rqt_ocare/scripts/capture_image.py | SiChiTong/ros_ocare_nav | 5df256ae9f398cb05f3d0d8c9be124fed5fc2c26 | [
"Apache-2.0"
] | 1 | 2018-08-17T03:31:44.000Z | 2018-08-17T03:31:44.000Z | import paramiko
from time import localtime, strftime
# Create a ssh client
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect('ocare', username='taiwanet', password='qwe7891')
file_name = strftime("/home/taiwanet/capture_image/%Y%m%d_%H%M%S.jpg", localtime())
st... | 28.208333 | 211 | 0.731167 | import paramiko
from time import localtime, strftime
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect('ocare', username='taiwanet', password='qwe7891')
file_name = strftime("/home/taiwanet/capture_image/%Y%m%d_%H%M%S.jpg", localtime())
stdin, stdout, stderr =... | true | true |
f70a26b73ab91ee81563001d95d271815374a2a3 | 29,966 | py | Python | HotSpotMap.py | bucaps/HotSpotMap | 655d83d98316acbf9328519850268f548ae44af4 | [
"MIT"
] | null | null | null | HotSpotMap.py | bucaps/HotSpotMap | 655d83d98316acbf9328519850268f548ae44af4 | [
"MIT"
] | null | null | null | HotSpotMap.py | bucaps/HotSpotMap | 655d83d98316acbf9328519850268f548ae44af4 | [
"MIT"
] | null | null | null | # HotSpotMap: A python based temperature (thermal) map generation
# tool for HotSpot-6.0 (http://lava.cs.virginia.edu/HotSpot/)
# This tool uses python's turtle library
#
# Author: Gaurav Kothari (gkothar1@binghamton.edu) Copyright 2021
#
# This tool generates:
# 1) Floor-plan image (using floor-plan file)
# 2) Thermal... | 31.743644 | 194 | 0.553961 |
#
# Author: Gaurav Kothari (gkothar1@binghamton.edu) Copyright 2021
#
# This tool generates:
# 1) Floor-plan image (using floor-plan file)
# 2) Thermal map (using floor-plan file and steady temperature file)
# 3) Fine grained thermal map (using floor-plan file and grid steady temperature file)
#
# Supports 2D and 3D... | true | true |
f70a26e07705cfcdd4b9700935899358780391f1 | 2,001 | py | Python | setup.py | felixfire/LiteWQL | 8b47d1617041f1e9505bdbee713536a13a3ef88e | [
"Apache-2.0"
] | null | null | null | setup.py | felixfire/LiteWQL | 8b47d1617041f1e9505bdbee713536a13a3ef88e | [
"Apache-2.0"
] | null | null | null | setup.py | felixfire/LiteWQL | 8b47d1617041f1e9505bdbee713536a13a3ef88e | [
"Apache-2.0"
] | null | null | null | import os
from setuptools import setup, find_packages
def read(fn):
path = os.path.join(os.path.dirname(__file__), fn)
try:
file = open(path, encoding='utf-8')
except TypeError:
file = open(path)
return file.read()
setup(
name='litewql',
version=__import__('litewql').VERSION,... | 35.732143 | 72 | 0.575212 | import os
from setuptools import setup, find_packages
def read(fn):
path = os.path.join(os.path.dirname(__file__), fn)
try:
file = open(path, encoding='utf-8')
except TypeError:
file = open(path)
return file.read()
setup(
name='litewql',
version=__import__('litewql').VERSION,... | true | true |
f70a27ec88c165e9fe3b4e47800e5ac9b23f1af0 | 18,393 | py | Python | pythonProject1/venv/Lib/site-packages/jsonlint/validators.py | mjtomlinson/CNE330_Python_1_Final_Project | 05020806860937ef37b9a0ad2e27de4897a606de | [
"CC0-1.0"
] | null | null | null | pythonProject1/venv/Lib/site-packages/jsonlint/validators.py | mjtomlinson/CNE330_Python_1_Final_Project | 05020806860937ef37b9a0ad2e27de4897a606de | [
"CC0-1.0"
] | null | null | null | pythonProject1/venv/Lib/site-packages/jsonlint/validators.py | mjtomlinson/CNE330_Python_1_Final_Project | 05020806860937ef37b9a0ad2e27de4897a606de | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
import uuid
from jsonlint.compat import string_types, text_type
__all__ = (
'DataRequired', 'data_required', 'Email', 'email', 'EqualTo', 'equal_to',
'IPAddress', 'ip_address', 'InputRequired', 'input_required', 'Length',
'length',... | 33.810662 | 122 | 0.610558 |
from __future__ import unicode_literals
import re
import uuid
from jsonlint.compat import string_types, text_type
__all__ = (
'DataRequired', 'data_required', 'Email', 'email', 'EqualTo', 'equal_to',
'IPAddress', 'ip_address', 'InputRequired', 'input_required', 'Length',
'length', 'NumberRange', 'number... | true | true |
f70a284e5edac34ac2e87eccb11a9a4ed65666e9 | 7,722 | py | Python | sdk/keyvault/azure-keyvault-keys/tests/test_samples_keys.py | anuchandy/azure-sdk-for-python | 589b9890554ebf261aa2184e8f1c6507f01a207c | [
"MIT"
] | null | null | null | sdk/keyvault/azure-keyvault-keys/tests/test_samples_keys.py | anuchandy/azure-sdk-for-python | 589b9890554ebf261aa2184e8f1c6507f01a207c | [
"MIT"
] | null | null | null | sdk/keyvault/azure-keyvault-keys/tests/test_samples_keys.py | anuchandy/azure-sdk-for-python | 589b9890554ebf261aa2184e8f1c6507f01a207c | [
"MIT"
] | null | null | null | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
from __future__ import print_function
import functools
import hashlib
import os
from azure.core.exceptions import ResourceNotFoundError
from devtools_testutils import R... | 31.909091 | 115 | 0.662264 |
from __future__ import print_function
import functools
import hashlib
import os
from azure.core.exceptions import ResourceNotFoundError
from devtools_testutils import ResourceGroupPreparer, KeyVaultPreparer
from keys_preparer import VaultClientPreparer
from keys_test_case import KeyVaultTestCase
def print(*args)... | true | true |
f70a286e808fcd8fa7820662a35bec224fa63036 | 6,751 | py | Python | selection/truncated/chi.py | Xiaoying-Tian/selective-inference | a20c5ad3f527beb709d5b8d7301016640738b092 | [
"BSD-3-Clause"
] | null | null | null | selection/truncated/chi.py | Xiaoying-Tian/selective-inference | a20c5ad3f527beb709d5b8d7301016640738b092 | [
"BSD-3-Clause"
] | null | null | null | selection/truncated/chi.py | Xiaoying-Tian/selective-inference | a20c5ad3f527beb709d5b8d7301016640738b092 | [
"BSD-3-Clause"
] | 1 | 2019-07-13T04:14:12.000Z | 2019-07-13T04:14:12.000Z | """
This module implements the class `truncated_chi2` which
performs (conditional) UMPU tests for Gaussians
restricted to a set of intervals.
"""
import numpy as np
import mpmath as mp
from scipy.stats import chi, chi2
from .base import truncated, find_root
class truncated_chi(truncated):
"""
>>> from inte... | 23.359862 | 63 | 0.483484 | import numpy as np
import mpmath as mp
from scipy.stats import chi, chi2
from .base import truncated, find_root
class truncated_chi(truncated):
def __init__(self, I, k, scale = 1.):
self._k = k
self._scale = scale
truncated.__init__(self, I)
def _cdf_notTruncated(self, a, b, dps):
... | true | true |
f70a2a25224545676e5b981a65f639ab405c76b0 | 595 | py | Python | pwny/commands/generic/upload.py | EntySec/Pwny | d6a8a5edee171dcd3bf3ea1ec49b0ffb03d38531 | [
"MIT"
] | 7 | 2021-11-12T23:14:19.000Z | 2022-01-16T21:27:42.000Z | pwny/commands/generic/upload.py | YurinDoctrine/Pwny | 1c89a1a2a574c28cf92b5817b3d5dfb3dd4032be | [
"MIT"
] | null | null | null | pwny/commands/generic/upload.py | YurinDoctrine/Pwny | 1c89a1a2a574c28cf92b5817b3d5dfb3dd4032be | [
"MIT"
] | 7 | 2021-11-10T16:52:57.000Z | 2022-02-09T17:11:57.000Z | #!/usr/bin/env python3
#
# This command requires HatSploit: https://hatsploit.netlify.app
# Current source: https://github.com/EntySec/HatSploit
#
from hatsploit.lib.command import Command
class HatSploitCommand(Command):
details = {
'Category': "transfer",
'Name': "upload",
'Authors': [... | 23.8 | 64 | 0.608403 |
from hatsploit.lib.command import Command
class HatSploitCommand(Command):
details = {
'Category': "transfer",
'Name': "upload",
'Authors': [
'Ivan Nikolsky (enty8080) - command developer'
],
'Description': "Upload local file.",
'Usage': "upload <... | true | true |
f70a2b0e9261046b6a2a3a6a7ffdf762b0fb67a7 | 1,618 | py | Python | mlp_uk_learning.py | lujiammy/coronavirus-machine-learning | 4af16b1c51a89a81206262b50a9bcf4d9b679853 | [
"BSD-3-Clause"
] | null | null | null | mlp_uk_learning.py | lujiammy/coronavirus-machine-learning | 4af16b1c51a89a81206262b50a9bcf4d9b679853 | [
"BSD-3-Clause"
] | null | null | null | mlp_uk_learning.py | lujiammy/coronavirus-machine-learning | 4af16b1c51a89a81206262b50a9bcf4d9b679853 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
np.random.seed(1337)
from keras.models import Sequential
from keras.layers import Dense
import matplotlib.pyplot as plt
model = Sequential()
model.add(Dense(units=50, input_dim=1, activation='relu'))
model.add(Dense(units=50, activation='relu'))
model.add(Dense(units=1, activation='sigmoid'))
model... | 27.423729 | 72 | 0.776885 | import numpy as np
np.random.seed(1337)
from keras.models import Sequential
from keras.layers import Dense
import matplotlib.pyplot as plt
model = Sequential()
model.add(Dense(units=50, input_dim=1, activation='relu'))
model.add(Dense(units=50, activation='relu'))
model.add(Dense(units=1, activation='sigmoid'))
model... | true | true |
f70a2b37f6f06bf07a52a01197f2deb18fbace0e | 6,051 | py | Python | diplom_test/main.py | CrackedSTone/algorithm-detects-liver-pathology | d52d08e4e6931b3502f083f20d6332f7b6839a3b | [
"Apache-2.0"
] | 8 | 2019-04-09T07:11:26.000Z | 2020-02-27T16:51:26.000Z | diplom_test/main.py | il-yanko/algorithm-detects-liver-pathology | d52d08e4e6931b3502f083f20d6332f7b6839a3b | [
"Apache-2.0"
] | null | null | null | diplom_test/main.py | il-yanko/algorithm-detects-liver-pathology | d52d08e4e6931b3502f083f20d6332f7b6839a3b | [
"Apache-2.0"
] | 2 | 2019-04-04T07:13:02.000Z | 2020-02-06T04:58:34.000Z | #!/usr/bin/python3
# -*- coding: utf-8 -*-
from PyQt5.uic import loadUi
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
#from matplotlib.backends.backend_qt5agg import (NavigationToolbar2QT as NavigationToolbar)
import matplotlib.image as mpimg
import sys
import radiomics_single a... | 44.492647 | 135 | 0.653611 |
from PyQt5.uic import loadUi
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
import matplotlib.image as mpimg
import sys
import radiomics_single as rs
qtCreatorFile = "design/diplom.ui"
class MatplotlibWidget(QMainWindow):
def __init__(self):
QMainWindow.__init... | true | true |
f70a2b644457fe1530f88e063abd293d2c32dfdb | 10,084 | py | Python | tests/asp/cautious/hamiltonian.test.04.asp.gringo.cautious.asp.test.py | bernardocuteri/wasp | 05c8f961776dbdbf7afbf905ee00fc262eba51ad | [
"Apache-2.0"
] | 19 | 2015-12-03T08:53:45.000Z | 2022-03-31T02:09:43.000Z | tests/asp/cautious/hamiltonian.test.04.asp.gringo.cautious.asp.test.py | bernardocuteri/wasp | 05c8f961776dbdbf7afbf905ee00fc262eba51ad | [
"Apache-2.0"
] | 80 | 2017-11-25T07:57:32.000Z | 2018-06-10T19:03:30.000Z | tests/asp/cautious/hamiltonian.test.04.asp.gringo.cautious.asp.test.py | bernardocuteri/wasp | 05c8f961776dbdbf7afbf905ee00fc262eba51ad | [
"Apache-2.0"
] | 6 | 2015-01-15T07:51:48.000Z | 2020-06-18T14:47:48.000Z | input = """
1 2 0 0
1 3 0 0
1 4 0 0
1 5 0 0
1 6 0 0
1 7 0 0
1 8 0 0
1 9 0 0
1 10 0 0
1 11 0 0
1 12 0 0
1 13 0 0
1 14 0 0
1 15 0 0
1 16 0 0
1 17 0 0
1 18 0 0
1 19 0 0
1 20 0 0
1 21 0 0
1 22 0 0
1 23 0 0
1 24 0 0
1 25 0 0
1 26 0 0
1 27 0 0
1 28 0 0
1 29 0 0
1 30 0 0
1 31 0 0
1 32 0 0
1 33 0 0
1 34 0 0
1 35 0 0
1 36 0 0
1... | 15.050746 | 666 | 0.615728 | input = """
1 2 0 0
1 3 0 0
1 4 0 0
1 5 0 0
1 6 0 0
1 7 0 0
1 8 0 0
1 9 0 0
1 10 0 0
1 11 0 0
1 12 0 0
1 13 0 0
1 14 0 0
1 15 0 0
1 16 0 0
1 17 0 0
1 18 0 0
1 19 0 0
1 20 0 0
1 21 0 0
1 22 0 0
1 23 0 0
1 24 0 0
1 25 0 0
1 26 0 0
1 27 0 0
1 28 0 0
1 29 0 0
1 30 0 0
1 31 0 0
1 32 0 0
1 33 0 0
1 34 0 0
1 35 0 0
1 36 0 0
1... | true | true |
f70a2bc707361296f106a19a66ca8ea96965d277 | 5,861 | py | Python | favs_v1.py | dostarora97/Twitter-Fav-Media-Scraper | 3fba8d0f882e4b75726beeffdcf069e57544a931 | [
"MIT"
] | null | null | null | favs_v1.py | dostarora97/Twitter-Fav-Media-Scraper | 3fba8d0f882e4b75726beeffdcf069e57544a931 | [
"MIT"
] | null | null | null | favs_v1.py | dostarora97/Twitter-Fav-Media-Scraper | 3fba8d0f882e4b75726beeffdcf069e57544a931 | [
"MIT"
] | null | null | null | import json, base64, requests
from jinja2 import Environment, FileSystemLoader
from pathlib import Path
import webbrowser
import tweepy
import sys
class Twitter:
def __init__(self, auth, Bearer_Token=None):
self.auth = auth
self.Bearer_Token = Bearer_Token
if self.auth is None:
... | 35.737805 | 103 | 0.576693 | import json, base64, requests
from jinja2 import Environment, FileSystemLoader
from pathlib import Path
import webbrowser
import tweepy
import sys
class Twitter:
def __init__(self, auth, Bearer_Token=None):
self.auth = auth
self.Bearer_Token = Bearer_Token
if self.auth is None:
... | true | true |
f70a2d293516b125f2a84d6c3115ac2d0c17eb1b | 20,126 | py | Python | homeassistant/components/group/__init__.py | veresspeter/home-assistant | a3c22c6eec2c77a28a8fa859e899984269708666 | [
"Apache-2.0"
] | 2 | 2018-02-14T07:29:46.000Z | 2018-02-20T08:15:51.000Z | homeassistant/components/group/__init__.py | veresspeter/home-assistant | a3c22c6eec2c77a28a8fa859e899984269708666 | [
"Apache-2.0"
] | 3 | 2021-09-08T03:43:17.000Z | 2022-03-12T01:01:30.000Z | homeassistant/components/group/__init__.py | veresspeter/home-assistant | a3c22c6eec2c77a28a8fa859e899984269708666 | [
"Apache-2.0"
] | 1 | 2020-04-12T17:17:42.000Z | 2020-04-12T17:17:42.000Z | """
Provide the functionality to group entities.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/group/
"""
import asyncio
import logging
import voluptuous as vol
from homeassistant import core as ha
from homeassistant.const import (
ATTR_ENTITY_ID... | 30.915515 | 79 | 0.626851 | import asyncio
import logging
import voluptuous as vol
from homeassistant import core as ha
from homeassistant.const import (
ATTR_ENTITY_ID, CONF_ICON, CONF_NAME, STATE_CLOSED, STATE_HOME,
STATE_NOT_HOME, STATE_OFF, STATE_ON, STATE_OPEN, STATE_LOCKED,
STATE_UNLOCKED, STATE_OK, STATE_PROBLEM, STATE_UNKNOW... | true | true |
f70a2e7f346ccb9b2190e341229230510a747e62 | 15,142 | py | Python | openstack_dashboard/dashboards/project/firewalls/tables.py | timpricecatalyst/horizon | 8279ae0ed464e62e1c91e78341342160f8a07172 | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/dashboards/project/firewalls/tables.py | timpricecatalyst/horizon | 8279ae0ed464e62e1c91e78341342160f8a07172 | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/dashboards/project/firewalls/tables.py | timpricecatalyst/horizon | 8279ae0ed464e62e1c91e78341342160f8a07172 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013, Big Switch Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 37.112745 | 78 | 0.58975 |
import logging
from django.core.urlresolvers import reverse
from django.template import defaultfilters as filters
from django.utils.translation import pgettext_lazy
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ungettext_lazy
from horizon import exceptions
... | true | true |
f70a2ff0fe97cee77266ee49f1205c3ffb0ee1ba | 11,290 | py | Python | strategies/hitoshi.py | Jbuxofplenty/quant | 2ef24012963e9ead6193e0f421c63fb009c78f80 | [
"MIT"
] | null | null | null | strategies/hitoshi.py | Jbuxofplenty/quant | 2ef24012963e9ead6193e0f421c63fb009c78f80 | [
"MIT"
] | null | null | null | strategies/hitoshi.py | Jbuxofplenty/quant | 2ef24012963e9ead6193e0f421c63fb009c78f80 | [
"MIT"
] | null | null | null | from zipline.pipeline import Pipeline
from zipline.api import attach_pipeline, pipeline_output
from zipline.pipeline.data.equity_pricing import USEquityPricing
from zipline.pipeline.data import morningstar
from zipline.pipeline.factors import SimpleMovingAverage, AverageDollarVolume
from zipline.pipeline.filters.mornin... | 31.713483 | 88 | 0.628787 | from zipline.pipeline import Pipeline
from zipline.api import attach_pipeline, pipeline_output
from zipline.pipeline.data.equity_pricing import USEquityPricing
from zipline.pipeline.data import morningstar
from zipline.pipeline.factors import SimpleMovingAverage, AverageDollarVolume
from zipline.pipeline.filters.mornin... | true | true |
f70a302ee61e2a2b81f906bd03d8d41979bc5a07 | 476 | py | Python | client/graphics_settings.py | V1ad0S/splendor-game | 2ea0af6b76decc30573f3f90953b28e6eafd1a00 | [
"BSD-2-Clause"
] | null | null | null | client/graphics_settings.py | V1ad0S/splendor-game | 2ea0af6b76decc30573f3f90953b28e6eafd1a00 | [
"BSD-2-Clause"
] | null | null | null | client/graphics_settings.py | V1ad0S/splendor-game | 2ea0af6b76decc30573f3f90953b28e6eafd1a00 | [
"BSD-2-Clause"
] | null | null | null | FPS = 10
SCREEN_SIZE = (1200, 800)
CARDFIELD_COORDS = [(230, 120), (700, 520)]
BANK_COORDS = [(970, 160), (70, 350)]
BACKGROUND = (140, 122, 230)
WHITE = (255, 255, 255)
GREY = (128, 128, 128)
GREEN = (0, 128, 0)
YELLOW = (180, 180, 0)
BLACK = (0, 0, 0)
COLORS = {
"1": [(53, 59, 72), (47, 54, 64),],
"2": [(245... | 26.444444 | 44 | 0.493697 | FPS = 10
SCREEN_SIZE = (1200, 800)
CARDFIELD_COORDS = [(230, 120), (700, 520)]
BANK_COORDS = [(970, 160), (70, 350)]
BACKGROUND = (140, 122, 230)
WHITE = (255, 255, 255)
GREY = (128, 128, 128)
GREEN = (0, 128, 0)
YELLOW = (180, 180, 0)
BLACK = (0, 0, 0)
COLORS = {
"1": [(53, 59, 72), (47, 54, 64),],
"2": [(245... | true | true |
f70a3034af8425987ad286b9f46e1099208fe785 | 7,746 | py | Python | tests/libs/io_peripherals/test_spi.py | izm51/obniz-python-sdk | 40a738b5fe2c0a415cdc09f46d28c143982bfb07 | [
"MIT"
] | 11 | 2019-03-22T12:02:11.000Z | 2021-01-21T04:57:18.000Z | tests/libs/io_peripherals/test_spi.py | izm51/obniz-python-sdk | 40a738b5fe2c0a415cdc09f46d28c143982bfb07 | [
"MIT"
] | 5 | 2019-03-02T08:28:25.000Z | 2021-02-02T22:06:37.000Z | tests/libs/io_peripherals/test_spi.py | izm51/obniz-python-sdk | 40a738b5fe2c0a415cdc09f46d28c143982bfb07 | [
"MIT"
] | 3 | 2019-07-20T06:55:09.000Z | 2019-12-04T05:05:00.000Z | from time import sleep
import pytest
from ...utils import assert_finished, assert_send, receive_json
class TestPeripheralSPI:
def test_start(self, obniz):
obniz.spi0.start(
{"clk": 0, "frequency": 1000000, "miso": 2, "mode": "master", "mosi": 1}
)
assert_send(obniz, [{"io0":... | 34.274336 | 95 | 0.449781 | from time import sleep
import pytest
from ...utils import assert_finished, assert_send, receive_json
class TestPeripheralSPI:
def test_start(self, obniz):
obniz.spi0.start(
{"clk": 0, "frequency": 1000000, "miso": 2, "mode": "master", "mosi": 1}
)
assert_send(obniz, [{"io0":... | true | true |
f70a32b071692b6617364de30b9da8d0250e8356 | 10,584 | py | Python | data/src/transform.py | cytopia/metrics-server-prom | 3777ba9357bf14538f7608d4a2b877b7d50960a0 | [
"MIT"
] | 25 | 2018-08-20T03:29:45.000Z | 2021-05-23T15:52:38.000Z | data/src/transform.py | LINK-HOPE/metrics-server-prom | 3777ba9357bf14538f7608d4a2b877b7d50960a0 | [
"MIT"
] | 4 | 2019-03-01T03:09:16.000Z | 2020-01-18T14:24:46.000Z | data/src/transform.py | LINK-HOPE/metrics-server-prom | 3777ba9357bf14538f7608d4a2b877b7d50960a0 | [
"MIT"
] | 7 | 2018-08-20T12:45:31.000Z | 2019-12-04T02:16:14.000Z | # -*- coding: utf-8 -*-
'''
Auther: cytopia
License: MIT
Transformer for kubernetes-incubator/metrics-server from json
into Prometheus readable format.
'''
import os
import json
import re
import time
import requests
import subprocess
from flask import Flask
from flask import Response
'''
Globals that specify at wh... | 31.406528 | 112 | 0.590231 |
import os
import json
import re
import time
import requests
import subprocess
from flask import Flask
from flask import Response
PROXY = 'http://127.0.0.1:8080'
URL_NODES = PROXY + '/apis/metrics.k8s.io/v1beta1/nodes'
URL_PODS = PROXY + '/apis/metrics.k8s.io/v1beta1/pods'
def shell_exec(command):
bash = o... | true | true |
f70a33367f3433244e2fb21596526fdea288e07e | 1,454 | py | Python | projects/g3h2-cc/src/get_places_web_api.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | projects/g3h2-cc/src/get_places_web_api.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | projects/g3h2-cc/src/get_places_web_api.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | from flask import Flask, request
from hbase_manager import HBaseRecord
import json
from flask_cors import CORS
app = Flask(__name__)
CORS(app)
@app.route('/')
@app.route('/test')
@app.route('/hello')
def hello():
return 'Hello World!'
@app.route('/get_places', methods=['GET', 'POST'])
def get_places():
if ... | 26.925926 | 75 | 0.597662 | from flask import Flask, request
from hbase_manager import HBaseRecord
import json
from flask_cors import CORS
app = Flask(__name__)
CORS(app)
@app.route('/')
@app.route('/test')
@app.route('/hello')
def hello():
return 'Hello World!'
@app.route('/get_places', methods=['GET', 'POST'])
def get_places():
if ... | true | true |
f70a3389e6b510962dd2e9884d65750d6c632971 | 16 | py | Python | projects/aio-pika/test.py | fleimgruber/python | 2e735762c73651cffc027ca850b2a58d87d54b49 | [
"Unlicense"
] | 25 | 2021-10-30T19:54:59.000Z | 2022-03-29T06:11:02.000Z | projects/aio-pika/test.py | fleimgruber/python | 2e735762c73651cffc027ca850b2a58d87d54b49 | [
"Unlicense"
] | 21 | 2021-10-19T01:09:38.000Z | 2022-03-24T16:08:53.000Z | projects/aio-pika/test.py | fleimgruber/python | 2e735762c73651cffc027ca850b2a58d87d54b49 | [
"Unlicense"
] | 3 | 2022-01-25T20:25:13.000Z | 2022-03-08T02:58:50.000Z | import aio_pika
| 8 | 15 | 0.875 | import aio_pika
| true | true |
f70a34b972e266ad9d856336955145e38c0df274 | 5,389 | py | Python | Tests/ML/test_config_helpers.py | csiebler/InnerEye-DeepLearning | e33ec7518803347629b786f64786409e1e2e1be5 | [
"MIT"
] | null | null | null | Tests/ML/test_config_helpers.py | csiebler/InnerEye-DeepLearning | e33ec7518803347629b786f64786409e1e2e1be5 | [
"MIT"
] | null | null | null | Tests/ML/test_config_helpers.py | csiebler/InnerEye-DeepLearning | e33ec7518803347629b786f64786409e1e2e1be5 | [
"MIT"
] | null | null | null | # ------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# -------------------------------------------------------------------... | 43.813008 | 116 | 0.656523 |
from typing import List, Optional
import pytest
import torch
from InnerEye.ML.common import ModelExecutionMode
from InnerEye.ML.config import SegmentationModelBase, equally_weighted_classes
from InnerEye.ML.models.architectures.base_model import BaseSegmentationModel
from Tests.ML.configs.DummyModel import DummyM... | true | true |
f70a350d94c8f84c2a1a642e7372f88ae185dfa0 | 363 | py | Python | todos/admin.py | DanylovAlex1/TodoList | 8b8d9b1ee3f76759acab6bcbbc5d491606a17d9e | [
"MIT"
] | null | null | null | todos/admin.py | DanylovAlex1/TodoList | 8b8d9b1ee3f76759acab6bcbbc5d491606a17d9e | [
"MIT"
] | 5 | 2021-03-30T14:16:11.000Z | 2021-09-22T19:31:29.000Z | todos/admin.py | DanylovAlex1/TodoList | 8b8d9b1ee3f76759acab6bcbbc5d491606a17d9e | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Board,TodoList
@admin.register(Board)
class BoardAdmin(admin.ModelAdmin):
search_fields = ['title']
list_display = ('title',)
@admin.register(TodoList)
class TodoAdmin(admin.ModelAdmin):
search_fields = ['title','created']
list_display = ('title',... | 21.352941 | 39 | 0.702479 | from django.contrib import admin
from .models import Board,TodoList
@admin.register(Board)
class BoardAdmin(admin.ModelAdmin):
search_fields = ['title']
list_display = ('title',)
@admin.register(TodoList)
class TodoAdmin(admin.ModelAdmin):
search_fields = ['title','created']
list_display = ('title',... | true | true |
f70a351b09d4a490b7e6481dfa8c3e12bdd186e9 | 685 | py | Python | DBCalls/urls.py | EdgarBodiaj/EMT-Storage | 90c7b42b43c5925bcbb1941412efe0b15fb446f0 | [
"MIT"
] | null | null | null | DBCalls/urls.py | EdgarBodiaj/EMT-Storage | 90c7b42b43c5925bcbb1941412efe0b15fb446f0 | [
"MIT"
] | null | null | null | DBCalls/urls.py | EdgarBodiaj/EMT-Storage | 90c7b42b43c5925bcbb1941412efe0b15fb446f0 | [
"MIT"
] | null | null | null | from django.urls import path
from DBCalls.views import CollectionView, ExhibitView, ModuleView, QuestionView
urlpatterns = [
path('Questions/<str:qID>', QuestionView.as_view(), name='questionview'),
path('Questions/', QuestionView.as_view(), name='questionview'),
path('Modules/<str:mID>', ModuleView.as_vie... | 52.692308 | 79 | 0.706569 | from django.urls import path
from DBCalls.views import CollectionView, ExhibitView, ModuleView, QuestionView
urlpatterns = [
path('Questions/<str:qID>', QuestionView.as_view(), name='questionview'),
path('Questions/', QuestionView.as_view(), name='questionview'),
path('Modules/<str:mID>', ModuleView.as_vie... | true | true |
f70a366b486949f8b542768f83c5593f35c86520 | 735 | py | Python | pytglib/api/functions/cancel_upload_file.py | iTeam-co/pytglib | e5e75e0a85f89b77762209b32a61b0a883c0ae61 | [
"MIT"
] | 6 | 2019-10-30T08:57:27.000Z | 2021-02-08T14:17:43.000Z | pytglib/api/functions/cancel_upload_file.py | iTeam-co/python-telegram | e5e75e0a85f89b77762209b32a61b0a883c0ae61 | [
"MIT"
] | 1 | 2021-08-19T05:44:10.000Z | 2021-08-19T07:14:56.000Z | pytglib/api/functions/cancel_upload_file.py | iTeam-co/python-telegram | e5e75e0a85f89b77762209b32a61b0a883c0ae61 | [
"MIT"
] | 5 | 2019-12-04T05:30:39.000Z | 2021-05-21T18:23:32.000Z |
from ..utils import Object
class CancelUploadFile(Object):
"""
Stops the uploading of a file. Supported only for files uploaded by using uploadFile. For other files the behavior is undefined
Attributes:
ID (:obj:`str`): ``CancelUploadFile``
Args:
file_id (:obj:`int`):
... | 22.272727 | 132 | 0.614966 |
from ..utils import Object
class CancelUploadFile(Object):
ID = "cancelUploadFile"
def __init__(self, file_id, extra=None, **kwargs):
self.extra = extra
self.file_id = file_id
@staticmethod
def read(q: dict, *args) -> "CancelUploadFile":
file_id = q.get('file_id')
... | true | true |
f70a38fcf4fc8f443b09e280076b04f3e02c71ef | 1,359 | py | Python | var/spack/repos/builtin/packages/cblas/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-10T13:47:48.000Z | 2019-04-17T13:05:17.000Z | var/spack/repos/builtin/packages/cblas/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 32 | 2020-12-15T17:29:20.000Z | 2022-03-21T15:08:31.000Z | var/spack/repos/builtin/packages/cblas/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2021-04-07T18:27:09.000Z | 2022-03-31T22:52:38.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Cblas(Package):
"""The BLAS (Basic Linear Algebra Subprograms) are routines that
pr... | 33.975 | 100 | 0.647535 |
from spack import *
class Cblas(Package):
homepage = "http://www.netlib.org/blas/_cblas/"
version('2015-06-06', sha256='0f6354fd67fabd909baf57ced2ef84e962db58fae126e4f41b21dd4fec60a2a3',
url='http://www.netlib.org/blas/blast-forum/cblas.tgz')
depends_on('blas')
parallel = Fals... | true | true |
f70a3adb0d09aaaa54de4dcfc4ac9602759c5e44 | 8,766 | py | Python | src/oauth/views.py | ResearchHub/ResearchHub-Backend-Open | d36dca33afae2d442690694bb2ab17180d84bcd3 | [
"MIT"
] | 18 | 2021-05-20T13:20:16.000Z | 2022-02-11T02:40:18.000Z | src/oauth/views.py | ResearchHub/ResearchHub-Backend-Open | d36dca33afae2d442690694bb2ab17180d84bcd3 | [
"MIT"
] | 109 | 2021-05-21T20:14:23.000Z | 2022-03-31T20:56:10.000Z | src/oauth/views.py | ResearchHub/ResearchHub-Backend-Open | d36dca33afae2d442690694bb2ab17180d84bcd3 | [
"MIT"
] | 4 | 2021-05-17T13:47:53.000Z | 2022-02-12T10:48:21.000Z | import requests
from allauth.socialaccount.helpers import render_authentication_error
from allauth.socialaccount.models import SocialLogin, SocialAccount
from allauth.socialaccount.providers.base import ProviderException
from allauth.socialaccount.providers.google.views import GoogleOAuth2Adapter
from allauth.socialac... | 32.708955 | 77 | 0.671344 | import requests
from allauth.socialaccount.helpers import render_authentication_error
from allauth.socialaccount.models import SocialLogin, SocialAccount
from allauth.socialaccount.providers.base import ProviderException
from allauth.socialaccount.providers.google.views import GoogleOAuth2Adapter
from allauth.socialac... | true | true |
f70a3b29166669d3eedb262309f7bbc995dcd9f8 | 5,438 | py | Python | httphoneypot/tcp_handler.py | muratti66/python-honeypots | ce3d4f8dcb36c29e6fab00bd8a93ba2de0dfc108 | [
"MIT"
] | null | null | null | httphoneypot/tcp_handler.py | muratti66/python-honeypots | ce3d4f8dcb36c29e6fab00bd8a93ba2de0dfc108 | [
"MIT"
] | 1 | 2021-09-18T00:11:46.000Z | 2021-09-18T00:13:04.000Z | httphoneypot/tcp_handler.py | muratti66/python-honeypots | ce3d4f8dcb36c29e6fab00bd8a93ba2de0dfc108 | [
"MIT"
] | 1 | 2021-05-06T21:11:27.000Z | 2021-05-06T21:11:27.000Z | import socket # Networking support
import time # Current time
from library import id_generate
host = None
port = None
log_th = None
conf_th = None
header_th = None
command_w_th = None
data_w_th = None
class HTTPServer:
def __init__(self):
global host, port, log_th, conf_th, header_th, command_w_th, da... | 39.405797 | 113 | 0.610886 | import socket
import time
from library import id_generate
host = None
port = None
log_th = None
conf_th = None
header_th = None
command_w_th = None
data_w_th = None
class HTTPServer:
def __init__(self):
global host, port, log_th, conf_th, header_th, command_w_th, data_w_th
self.host = host
... | true | true |
f70a3b7d8b4bc2d328e9192f92e41eb807c618df | 1,328 | py | Python | dwellingplace/tests/test_models_utils.py | dwelling-place/xlsx-merger | fa2343a3acbf3fc7f8b76b30f6ccbc7dc03282ed | [
"MIT"
] | null | null | null | dwellingplace/tests/test_models_utils.py | dwelling-place/xlsx-merger | fa2343a3acbf3fc7f8b76b30f6ccbc7dc03282ed | [
"MIT"
] | 56 | 2016-11-05T01:55:22.000Z | 2016-11-07T00:30:10.000Z | dwellingplace/tests/test_models_utils.py | dwelling-place/xlsx-merger | fa2343a3acbf3fc7f8b76b30f6ccbc7dc03282ed | [
"MIT"
] | 2 | 2016-11-05T13:42:53.000Z | 2016-11-05T13:59:09.000Z | # pylint: disable=unused-argument,unused-variable,expression-not-assigned
import os
from datetime import datetime
import pytest
from expecter import expect
import xlrd
from dwellingplace.models._utils import parse_xlsx_into_dicts, get_value
DATA = os.path.join(os.path.dirname(__file__), "data")
def test_load():
... | 25.538462 | 73 | 0.614458 |
import os
from datetime import datetime
import pytest
from expecter import expect
import xlrd
from dwellingplace.models._utils import parse_xlsx_into_dicts, get_value
DATA = os.path.join(os.path.dirname(__file__), "data")
def test_load():
xl = xlrd.open_workbook(os.path.join(DATA, 'sample.xlsx'))
output ... | true | true |
f70a3c094cf154b93d675ca8458f3581ca522c8f | 2,286 | py | Python | tests/test_cdkitchen.py | thomascaillier/recipe-scrapers | 564940c0a588bb34455af499754b1be46d690c7b | [
"MIT"
] | 1 | 2021-02-07T17:48:09.000Z | 2021-02-07T17:48:09.000Z | tests/test_cdkitchen.py | thomascaillier/recipe-scrapers | 564940c0a588bb34455af499754b1be46d690c7b | [
"MIT"
] | null | null | null | tests/test_cdkitchen.py | thomascaillier/recipe-scrapers | 564940c0a588bb34455af499754b1be46d690c7b | [
"MIT"
] | null | null | null | from tests import ScraperTest
from recipe_scrapers.cdkitchen import CdKitchen
class TestCdKitchen(ScraperTest):
scraper_class = CdKitchen
def test_host(self):
self.assertEqual("cdkitchen.com", self.harvester_class.host())
def test_canonical_url(self):
self.assertEqual(
... | 41.563636 | 548 | 0.635171 | from tests import ScraperTest
from recipe_scrapers.cdkitchen import CdKitchen
class TestCdKitchen(ScraperTest):
scraper_class = CdKitchen
def test_host(self):
self.assertEqual("cdkitchen.com", self.harvester_class.host())
def test_canonical_url(self):
self.assertEqual(
... | true | true |
f70a3c5c50783abc4ba51130c8dd1408e60f7f6c | 157 | py | Python | boa3_test/test_sc/list_test/AppendAnyValue.py | hal0x2328/neo3-boa | 6825a3533384cb01660773050719402a9703065b | [
"Apache-2.0"
] | 25 | 2020-07-22T19:37:43.000Z | 2022-03-08T03:23:55.000Z | boa3_test/test_sc/list_test/AppendAnyValue.py | hal0x2328/neo3-boa | 6825a3533384cb01660773050719402a9703065b | [
"Apache-2.0"
] | 419 | 2020-04-23T17:48:14.000Z | 2022-03-31T13:17:45.000Z | boa3_test/test_sc/list_test/AppendAnyValue.py | hal0x2328/neo3-boa | 6825a3533384cb01660773050719402a9703065b | [
"Apache-2.0"
] | 15 | 2020-05-21T21:54:24.000Z | 2021-11-18T06:17:24.000Z | from typing import Any, List
from boa3.builtin import public
@public
def Main() -> List[Any]:
a: List[Any] = [1, 2, 3]
a.append('4')
return a
| 14.272727 | 31 | 0.611465 | from typing import Any, List
from boa3.builtin import public
@public
def Main() -> List[Any]:
a: List[Any] = [1, 2, 3]
a.append('4')
return a
| true | true |
f70a3f7b6707ea59fcb33953a4b50ce4c44c13b1 | 1,245 | py | Python | discordbot/economy/currencies.py | elan17/GamestonkTerminal | f958f8275dc15ffaf30c1f0652f5b033725b7f10 | [
"MIT"
] | 1,835 | 2021-05-09T02:55:06.000Z | 2022-03-29T12:37:05.000Z | discordbot/economy/currencies.py | elan17/GamestonkTerminal | f958f8275dc15ffaf30c1f0652f5b033725b7f10 | [
"MIT"
] | 569 | 2021-05-09T15:59:41.000Z | 2022-03-29T12:25:16.000Z | discordbot/economy/currencies.py | elan17/GamestonkTerminal | f958f8275dc15ffaf30c1f0652f5b033725b7f10 | [
"MIT"
] | 268 | 2021-05-10T21:46:50.000Z | 2022-03-28T09:18:38.000Z | import discord
from gamestonk_terminal.economy import wsj_model
import discordbot.config_discordbot as cfg
from discordbot.run_discordbot import logger
async def currencies_command(ctx):
"""Currencies overview [Wall St. Journal]"""
try:
# Retrieve data
df_data = wsj_model.global_currencies(... | 24.9 | 72 | 0.583936 | import discord
from gamestonk_terminal.economy import wsj_model
import discordbot.config_discordbot as cfg
from discordbot.run_discordbot import logger
async def currencies_command(ctx):
try:
df_data = wsj_model.global_currencies()
if cfg.DEBUG:
logger.debug(df_da... | true | true |
f70a3fdda0f1ba058b58e70b31982a27c4121cac | 1,039 | py | Python | magnumclient/v1/stats_shell.py | gyliu513/python-magnumclient | c0d368360831cd29affa47e77eba4e81e4c6f0f8 | [
"Apache-2.0"
] | 29 | 2015-04-17T12:06:04.000Z | 2019-05-03T06:27:17.000Z | magnumclient/v1/stats_shell.py | gyliu513/python-magnumclient | c0d368360831cd29affa47e77eba4e81e4c6f0f8 | [
"Apache-2.0"
] | 2 | 2016-01-19T14:45:58.000Z | 2016-11-17T16:30:18.000Z | magnumclient/v1/stats_shell.py | gyliu513/python-magnumclient | c0d368360831cd29affa47e77eba4e81e4c6f0f8 | [
"Apache-2.0"
] | 26 | 2015-08-17T19:28:56.000Z | 2020-07-10T08:12:07.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 34.633333 | 78 | 0.696824 |
from magnumclient.common import cliutils as utils
from magnumclient.i18n import _
@utils.arg('--project-id',
required=False,
metavar='<project-id>',
help=_('Project ID'))
@utils.deprecated(utils.MAGNUM_CLIENT_DEPRECATION_WARNING)
def do_stats_list(cs, args):
opts = {
... | true | true |
f70a413c4399a3a45411b582acef1ae95872414b | 4,704 | py | Python | save_features.py | Codelegant92/STC-ProtoNet | f3e77bb1b363b0338cda6f1701bfabe0cd3accbe | [
"MIT"
] | null | null | null | save_features.py | Codelegant92/STC-ProtoNet | f3e77bb1b363b0338cda6f1701bfabe0cd3accbe | [
"MIT"
] | null | null | null | save_features.py | Codelegant92/STC-ProtoNet | f3e77bb1b363b0338cda6f1701bfabe0cd3accbe | [
"MIT"
] | null | null | null | import numpy as np
import torch
from torch.autograd import Variable
import os
import glob
import h5py
import configs
import backbone
from data.datamgr import SimpleDataManager
from methods.baselinetrain import BaselineTrain
from methods.baselinefinetune import BaselineFinetune
from methods.protonet import ProtoNet
fro... | 39.864407 | 191 | 0.6554 | import numpy as np
import torch
from torch.autograd import Variable
import os
import glob
import h5py
import configs
import backbone
from data.datamgr import SimpleDataManager
from methods.baselinetrain import BaselineTrain
from methods.baselinefinetune import BaselineFinetune
from methods.protonet import ProtoNet
fro... | true | true |
f70a42127de469f4bdda2525a0f76c5003a06eef | 10,055 | py | Python | contrib/spendfrom/spendfrom.py | wargo32/NewYorkCoin | f057bd7649ea2512aab427bb3f3cdd014de68fa1 | [
"MIT"
] | 2 | 2018-02-07T15:48:59.000Z | 2022-02-15T23:16:17.000Z | contrib/spendfrom/spendfrom.py | wargo32/NewYorkCoin | f057bd7649ea2512aab427bb3f3cdd014de68fa1 | [
"MIT"
] | null | null | null | contrib/spendfrom/spendfrom.py | wargo32/NewYorkCoin | f057bd7649ea2512aab427bb3f3cdd014de68fa1 | [
"MIT"
] | 3 | 2015-01-26T17:07:07.000Z | 2022-02-15T23:19:06.000Z | #!/usr/bin/env python
#
# Use the raw transactions API to spend bitcoins received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a bitcoind or Bit... | 37.518657 | 111 | 0.632322 |
mport *
import getpass
import math
import os
import os.path
import platform
import sys
import time
from jsonrpc import ServiceProxy, json
BASE_FEE=Decimal("0.001")
def check_json_precision():
n = Decimal("20000000.00000003")
satoshis = int(json.loads(json.dumps(float(n)))*1.0e8)
if satoshis != 20000... | true | true |
f70a42ac70d545eee6852b70f3027dbfa760d2d2 | 1,054 | py | Python | unicodeit/export_data.py | TWolczanski/unicodeit | 0c5e616d8dd494db3f9b7dcb3981b47da79d4f80 | [
"LPPL-1.3c",
"MIT"
] | null | null | null | unicodeit/export_data.py | TWolczanski/unicodeit | 0c5e616d8dd494db3f9b7dcb3981b47da79d4f80 | [
"LPPL-1.3c",
"MIT"
] | null | null | null | unicodeit/export_data.py | TWolczanski/unicodeit | 0c5e616d8dd494db3f9b7dcb3981b47da79d4f80 | [
"LPPL-1.3c",
"MIT"
] | null | null | null | import sys
from .data import REPLACEMENTS, COMBININGMARKS, SUBSUPERSCRIPTS
if __name__ == "__main__":
outname = 'ts_src/data.ts'
if len(sys.argv) == 2:
outname = sys.argv[1]
with open(outname, 'w') as f:
f.write('// autogenerated with python -m unicodeit.export_data\n\n')
f.writ... | 31.939394 | 81 | 0.468691 | import sys
from .data import REPLACEMENTS, COMBININGMARKS, SUBSUPERSCRIPTS
if __name__ == "__main__":
outname = 'ts_src/data.ts'
if len(sys.argv) == 2:
outname = sys.argv[1]
with open(outname, 'w') as f:
f.write('// autogenerated with python -m unicodeit.export_data\n\n')
f.writ... | true | true |
f70a42c5e95c543c5c1c2d154ee73266e8144626 | 1,415 | py | Python | tests/pkplatform_test.py | radiasoft/pykern | bf5946e20d77d13ceab387c33ac75c59b6579de6 | [
"Apache-2.0"
] | 8 | 2016-10-26T13:23:44.000Z | 2022-03-02T22:03:01.000Z | tests/pkplatform_test.py | radiasoft/pykern | bf5946e20d77d13ceab387c33ac75c59b6579de6 | [
"Apache-2.0"
] | 124 | 2016-03-01T15:32:54.000Z | 2022-03-31T17:42:40.000Z | tests/pkplatform_test.py | radiasoft/pykern | bf5946e20d77d13ceab387c33ac75c59b6579de6 | [
"Apache-2.0"
] | 10 | 2015-05-09T14:17:36.000Z | 2020-02-10T18:42:53.000Z | # -*- coding: utf-8 -*-
u"""pytest for `pykern.pkplatform`
:copyright: Copyright (c) 2015 Bivio Software, Inc. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
import pytest
def test_conformance1():
"""Verify the p... | 33.690476 | 73 | 0.671378 |
from __future__ import absolute_import, division, print_function
import pytest
def test_conformance1():
import re
import sys
import platform
from pykern import pkplatform
if platform.system() == 'Linux':
assert pkplatform.is_linux()
assert pkplatform.is_unix()
assert not p... | true | true |
f70a43d947ac006e0f9243ec8a817607c8cc6d8c | 61,521 | py | Python | skyportal/tests/api/test_photometry.py | LSSTDESC/skyportal | 1a433aae67b26ffd3516e65e0fdbf866b4751486 | [
"BSD-3-Clause"
] | null | null | null | skyportal/tests/api/test_photometry.py | LSSTDESC/skyportal | 1a433aae67b26ffd3516e65e0fdbf866b4751486 | [
"BSD-3-Clause"
] | null | null | null | skyportal/tests/api/test_photometry.py | LSSTDESC/skyportal | 1a433aae67b26ffd3516e65e0fdbf866b4751486 | [
"BSD-3-Clause"
] | null | null | null | import math
import numpy as np
import sncosmo
from baselayer.app.env import load_env
from skyportal.models import DBSession, Token
from skyportal.tests import api
_, cfg = load_env()
PHOT_DETECTION_THRESHOLD = cfg["misc.photometry_detection_threshold_nsigma"]
def test_token_user_post_get_photometry_data(
uploa... | 28.117459 | 106 | 0.508087 | import math
import numpy as np
import sncosmo
from baselayer.app.env import load_env
from skyportal.models import DBSession, Token
from skyportal.tests import api
_, cfg = load_env()
PHOT_DETECTION_THRESHOLD = cfg["misc.photometry_detection_threshold_nsigma"]
def test_token_user_post_get_photometry_data(
uploa... | true | true |
f70a4532147a8e522aa5d500dd931c3e3804b846 | 573 | py | Python | 61. Rotate List.py | XinchaoGou/MyLeetCode | bba0ab077374f7da2cb1a990266bc59fa7ddf23c | [
"MIT"
] | null | null | null | 61. Rotate List.py | XinchaoGou/MyLeetCode | bba0ab077374f7da2cb1a990266bc59fa7ddf23c | [
"MIT"
] | null | null | null | 61. Rotate List.py | XinchaoGou/MyLeetCode | bba0ab077374f7da2cb1a990266bc59fa7ddf23c | [
"MIT"
] | null | null | null | # Definition for singly-linked list.
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
def rotateRight(self, head: ListNode, k: int) -> ListNode:
if not (head and head.next and k) :
return head
fast = head
cnt = 1
whi... | 26.045455 | 62 | 0.518325 |
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
def rotateRight(self, head: ListNode, k: int) -> ListNode:
if not (head and head.next and k) :
return head
fast = head
cnt = 1
while fast.next:
fast = fas... | true | true |
f70a459630f112b441d070f0a66321d5095da078 | 524 | py | Python | src/python/pants/backend/python/tasks2/select_interpreter.py | oseemann/pants | 628c83d5ab2706b0f64d69568c57a718ec7c5e2a | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/python/tasks2/select_interpreter.py | oseemann/pants | 628c83d5ab2706b0f64d69568c57a718ec7c5e2a | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/python/tasks2/select_interpreter.py | oseemann/pants | 628c83d5ab2706b0f64d69568c57a718ec7c5e2a | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.backend.p... | 34.933333 | 93 | 0.780534 |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.backend.python.tasks import SelectInterpreter
from pants.base.deprecated import deprecated_module
deprecated_module('1.7.0.dev0', 'Use pants.backend.p... | true | true |
f70a46062b1e1e15ef57f684873bcfe3c44c06da | 1,117 | py | Python | sources/table-maker.py | Nemo-Nowane/math-tools | b3518a309ec9cb137ff3e48e0384172243cf0a5f | [
"MIT"
] | 2 | 2019-11-12T16:47:57.000Z | 2019-11-12T16:47:59.000Z | sources/table-maker.py | Nemo-Nowane/math-tools | b3518a309ec9cb137ff3e48e0384172243cf0a5f | [
"MIT"
] | null | null | null | sources/table-maker.py | Nemo-Nowane/math-tools | b3518a309ec9cb137ff3e48e0384172243cf0a5f | [
"MIT"
] | null | null | null | import sys #For CLI input
from decimal import Decimal, getcontext
"""I wanted to avoid importing this module but, the floats were messing up like
>>> 1-0.8
0.19999999999999996
So, I used it. Round function could helped. But using that produce -0.000, which seemed unaesthetic to me."""
getcontext().prec= 3 #Useless, si... | 38.517241 | 137 | 0.666965 | import sys
from decimal import Decimal, getcontext
getcontext().prec= 3
inputlist = list(map(float,sys.argv[1:]))
u = inputlist.pop(-3)
v = inputlist.pop(-2)
s = inputlist.pop(-1)
def table (start, end, step, coefficient_list):
y = 0
xlist=[]
fxlist=[]
x = start
while start<= x and x<= end:
for... | true | true |
f70a4626dec6d64168d77420b7c15b1bac91957f | 2,549 | py | Python | src/adventofcode2020/solutions/day02.py | RoelAdriaans/adventofcode2020 | e111c9fee52da6866f7b8b09a7e9c0fea8cc043e | [
"MIT"
] | 2 | 2020-12-01T07:58:31.000Z | 2020-12-02T10:27:07.000Z | src/adventofcode2020/solutions/day02.py | RoelAdriaans/adventofcode2020 | e111c9fee52da6866f7b8b09a7e9c0fea8cc043e | [
"MIT"
] | 57 | 2020-12-04T15:58:46.000Z | 2022-03-31T04:08:01.000Z | src/adventofcode2020/solutions/day02.py | RoelAdriaans/adventofcode2020 | e111c9fee52da6866f7b8b09a7e9c0fea8cc043e | [
"MIT"
] | null | null | null | import re
from typing import NamedTuple
from adventofcode2020.utils.abstract import FileReaderSolution
class PassPol(NamedTuple):
at_least: int
at_most: int
letter: str
password: str
class Day02:
@staticmethod
def split(input_password) -> PassPol:
"""
Input `7-9 r: rrrkrrrrr... | 28.640449 | 88 | 0.587681 | import re
from typing import NamedTuple
from adventofcode2020.utils.abstract import FileReaderSolution
class PassPol(NamedTuple):
at_least: int
at_most: int
letter: str
password: str
class Day02:
@staticmethod
def split(input_password) -> PassPol:
results = re.match(r"(\d*)-(\d*) (.... | true | true |
f70a4652ff4811a1690ee2590252d416d5140e59 | 253 | py | Python | Ex02.py | RODRIGOKTK/Python-exercicios | f7985f2c277aae8b158bdeea4f2493febaaf06c5 | [
"Unlicense"
] | null | null | null | Ex02.py | RODRIGOKTK/Python-exercicios | f7985f2c277aae8b158bdeea4f2493febaaf06c5 | [
"Unlicense"
] | null | null | null | Ex02.py | RODRIGOKTK/Python-exercicios | f7985f2c277aae8b158bdeea4f2493febaaf06c5 | [
"Unlicense"
] | null | null | null | # Escreva um programa que leia um valor em metros e o exiba convertido em milímetros
n1=int(input('Coloque o(s) valor(es): '))
print ('O valor em metros: ', n1)
print ('O valore em centimetros: ', n1 * 100)
print ('O valor em milimetros: ', n1*1000) | 50.6 | 85 | 0.687747 |
n1=int(input('Coloque o(s) valor(es): '))
print ('O valor em metros: ', n1)
print ('O valore em centimetros: ', n1 * 100)
print ('O valor em milimetros: ', n1*1000) | true | true |
f70a469dab614ac4ee0bb8cf077e95026dc130fb | 3,201 | py | Python | mars/services/cluster/worker/locator.py | hxri/mars | f7864f00911883b94800b63856f0e57648d3d9b4 | [
"Apache-2.0"
] | 2,413 | 2018-12-06T09:37:11.000Z | 2022-03-30T15:47:39.000Z | mars/services/cluster/worker/locator.py | hxri/mars | f7864f00911883b94800b63856f0e57648d3d9b4 | [
"Apache-2.0"
] | 1,335 | 2018-12-07T03:06:18.000Z | 2022-03-31T11:45:57.000Z | mars/services/cluster/worker/locator.py | hxri/mars | f7864f00911883b94800b63856f0e57648d3d9b4 | [
"Apache-2.0"
] | 329 | 2018-12-07T03:12:41.000Z | 2022-03-29T21:49:57.000Z | # Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 38.566265 | 85 | 0.663855 |
import logging
from typing import List
from .... import oscar as mo
from ..core import NodeRole, NodeStatus
from ..locator import SupervisorLocatorActor
logger = logging.getLogger(__name__)
class WorkerSupervisorLocatorActor(SupervisorLocatorActor):
_node_role = NodeRole.WORKER
def __init__(s... | true | true |
f70a497308aed482c7aaf58eb8e46ae4b8a07125 | 1,869 | py | Python | feature_extraction/other_features.py | smolendawid/ubaar-competition | 28de972d6beb13343c537fc030101be672a852a3 | [
"Apache-2.0"
] | null | null | null | feature_extraction/other_features.py | smolendawid/ubaar-competition | 28de972d6beb13343c537fc030101be672a852a3 | [
"Apache-2.0"
] | null | null | null | feature_extraction/other_features.py | smolendawid/ubaar-competition | 28de972d6beb13343c537fc030101be672a852a3 | [
"Apache-2.0"
] | null | null | null | import pandas as pd
from sklearn.preprocessing import LabelEncoder
def categorical_features(data, features):
features['vehicleType'] = data['vehicleType']
features['vehicleOption'] = data['vehicleOption']
features['vehicleTypeOption'] = [a + '_' + b for a, b in zip(data['vehicleType'].values,
... | 39.765957 | 101 | 0.657036 | import pandas as pd
from sklearn.preprocessing import LabelEncoder
def categorical_features(data, features):
features['vehicleType'] = data['vehicleType']
features['vehicleOption'] = data['vehicleOption']
features['vehicleTypeOption'] = [a + '_' + b for a, b in zip(data['vehicleType'].values,
... | true | true |
f70a4a0a16f7da68ca08d7e7084d6510f50b54c1 | 324 | py | Python | pirates/minigame/DistributedLockAI.py | Willy5s/Pirates-Online-Rewritten | 7434cf98d9b7c837d57c181e5dabd02ddf98acb7 | [
"BSD-3-Clause"
] | 81 | 2018-04-08T18:14:24.000Z | 2022-01-11T07:22:15.000Z | pirates/minigame/DistributedLockAI.py | Willy5s/Pirates-Online-Rewritten | 7434cf98d9b7c837d57c181e5dabd02ddf98acb7 | [
"BSD-3-Clause"
] | 4 | 2018-09-13T20:41:22.000Z | 2022-01-08T06:57:00.000Z | pirates/minigame/DistributedLockAI.py | Willy5s/Pirates-Online-Rewritten | 7434cf98d9b7c837d57c181e5dabd02ddf98acb7 | [
"BSD-3-Clause"
] | 26 | 2018-05-26T12:49:27.000Z | 2021-09-11T09:11:59.000Z | from direct.distributed.DistributedObjectAI import DistributedObjectAI
from direct.directnotify import DirectNotifyGlobal
class DistributedLockAI(DistributedObjectAI):
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedLockAI')
def __init__(self, air):
DistributedObjectAI.__init__(self, ... | 40.5 | 77 | 0.82716 | from direct.distributed.DistributedObjectAI import DistributedObjectAI
from direct.directnotify import DirectNotifyGlobal
class DistributedLockAI(DistributedObjectAI):
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedLockAI')
def __init__(self, air):
DistributedObjectAI.__init__(self, ... | true | true |
f70a4a6c1279c72c79f69db92d9b3c7c9e801c66 | 258,530 | py | Python | instances/passenger_demand/pas-20210422-1717-int4e-1/60.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null | instances/passenger_demand/pas-20210422-1717-int4e-1/60.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null | instances/passenger_demand/pas-20210422-1717-int4e-1/60.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null |
"""
PASSENGERS
"""
numPassengers = 7667
passenger_arriving = (
(2, 0, 1, 3, 1, 1, 2, 1, 0, 1, 0, 0, 0, 3, 1, 3, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0), # 0
(2, 2, 4, 2, 0, 1, 0, 1, 2, 0, 0, 1, 0, 4, 6, 1, 2, 3, 0, 1, 1, 1, 0, 0, 0, 0), # 1
(2, 2, 3, 3, 0, 2, 0, 1, 1, 0, 1, 0, 0, 2, 1, 4, 2, 2, 0, 3, 1, 1, 0, 0, 1, 0), #... | 276.502674 | 500 | 0.76976 |
numPassengers = 7667
passenger_arriving = (
(2, 0, 1, 3, 1, 1, 2, 1, 0, 1, 0, 0, 0, 3, 1, 3, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0),
(2, 2, 4, 2, 0, 1, 0, 1, 2, 0, 0, 1, 0, 4, 6, 1, 2, 3, 0, 1, 1, 1, 0, 0, 0, 0),
(2, 2, 3, 3, 0, 2, 0, 1, 1, 0, 1, 0, 0, 2, 1, 4, 2, 2, 0, 3, 1, 1, 0, 0, 1, 0),
(6, 1, 2, 1, 3, 1, 0, 1, 2... | true | true |
f70a4ac2929e2a599d2d671f614c03a61a104b68 | 1,788 | py | Python | tests/parsers/plist_plugins/spotlight_volume.py | nflexfo/plaso | 5da7aa51c39b593773687fdf20a93ba35fc492b4 | [
"Apache-2.0"
] | 1 | 2020-12-04T10:26:34.000Z | 2020-12-04T10:26:34.000Z | tests/parsers/plist_plugins/spotlight_volume.py | nflexfo/plaso | 5da7aa51c39b593773687fdf20a93ba35fc492b4 | [
"Apache-2.0"
] | null | null | null | tests/parsers/plist_plugins/spotlight_volume.py | nflexfo/plaso | 5da7aa51c39b593773687fdf20a93ba35fc492b4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the Spotlight Volume configuration plist plugin."""
from __future__ import unicode_literals
import unittest
from plaso.parsers.plist_plugins import spotlight_volume
from tests.parsers.plist_plugins import test_lib
class SpotlightVolumePluginTest(test_lib... | 31.928571 | 73 | 0.748881 |
from __future__ import unicode_literals
import unittest
from plaso.parsers.plist_plugins import spotlight_volume
from tests.parsers.plist_plugins import test_lib
class SpotlightVolumePluginTest(test_lib.PlistPluginTestCase):
def testProcess(self):
plist_name = 'VolumeConfiguration.plist'
plugin = sp... | true | true |
f70a4acf2ec4271147663a6bc4e1d881de4e042a | 508 | py | Python | mapbox_tilesets/errors.py | bozdoz/tilesets-cli | 05a00bf7ec9e88bc123ffc3833ff4fd47e6bb1f9 | [
"BSD-2-Clause"
] | null | null | null | mapbox_tilesets/errors.py | bozdoz/tilesets-cli | 05a00bf7ec9e88bc123ffc3833ff4fd47e6bb1f9 | [
"BSD-2-Clause"
] | null | null | null | mapbox_tilesets/errors.py | bozdoz/tilesets-cli | 05a00bf7ec9e88bc123ffc3833ff4fd47e6bb1f9 | [
"BSD-2-Clause"
] | null | null | null | """Error handling for the tilesets CLI"""
class TilesetsError(Exception):
"""Base Tilesets error
Deriving errors from this base isolates module development
problems from Python usage problems.
"""
exit_code = 1
def __init__(self, message):
"""Error constructor
Parameters
... | 20.32 | 62 | 0.610236 |
class TilesetsError(Exception):
exit_code = 1
def __init__(self, message):
self.message = message
class TilesetNameError(TilesetsError):
| true | true |
f70a4b45aadb056434a71d7ec721b0fdf2efa485 | 6,084 | py | Python | webdriver/tests/find_elements_from_shadow_root/find.py | jimmywarting/wpt | 75d80fa43c763935dff59b3c6b21f4dffa9b03b7 | [
"BSD-3-Clause"
] | 3 | 2015-11-18T06:24:23.000Z | 2017-05-21T13:55:56.000Z | webdriver/tests/find_elements_from_shadow_root/find.py | jimmywarting/wpt | 75d80fa43c763935dff59b3c6b21f4dffa9b03b7 | [
"BSD-3-Clause"
] | 153 | 2021-01-28T16:58:19.000Z | 2022-03-30T22:15:57.000Z | webdriver/tests/find_elements_from_shadow_root/find.py | almajlis/wpt | a1d4dd189a5bdca857845b374946b8002c41d199 | [
"BSD-3-Clause"
] | 4 | 2018-11-09T00:04:40.000Z | 2022-01-21T00:22:19.000Z | import pytest
from webdriver.transport import Response
from tests.support.asserts import assert_error, assert_same_element, assert_success
def find_elements(session, shadow_id, using, value):
return session.transport.send(
"POST", "session/{session_id}/shadow/{shadow_id}/elements".format(
se... | 41.958621 | 101 | 0.668146 | import pytest
from webdriver.transport import Response
from tests.support.asserts import assert_error, assert_same_element, assert_success
def find_elements(session, shadow_id, using, value):
return session.transport.send(
"POST", "session/{session_id}/shadow/{shadow_id}/elements".format(
se... | true | true |
f70a4bdbeaf0914b6cd41aaeb149332620257846 | 1,129 | py | Python | localnet/delegate.py | moneyhoardermike/MHG.Network | 7c1ef4b4d17223d91b613b4f96b100248bd45a74 | [
"Apache-2.0"
] | 1 | 2022-03-27T20:20:54.000Z | 2022-03-27T20:20:54.000Z | localnet/delegate.py | moneyhoardermike/MHG.Network | 7c1ef4b4d17223d91b613b4f96b100248bd45a74 | [
"Apache-2.0"
] | null | null | null | localnet/delegate.py | moneyhoardermike/MHG.Network | 7c1ef4b4d17223d91b613b4f96b100248bd45a74 | [
"Apache-2.0"
] | null | null | null | import sys
import subprocess
import yaml
if len(sys.argv) != 4:
print('usage: delegate.py [val1_stake] [val2_stake] [val3_stake]')
exit(0)
# Load config
confFile = open('./conf.yml')
conf = yaml.safe_load(confFile)
def delegate_cmd(valNumber, amount):
cmd = ["spnd", "tx", "staking", "delegate"]
cmd.a... | 22.137255 | 70 | 0.631532 | import sys
import subprocess
import yaml
if len(sys.argv) != 4:
print('usage: delegate.py [val1_stake] [val2_stake] [val3_stake]')
exit(0)
confFile = open('./conf.yml')
conf = yaml.safe_load(confFile)
def delegate_cmd(valNumber, amount):
cmd = ["spnd", "tx", "staking", "delegate"]
cmd.append(conf['v... | true | true |
f70a4cfab56b4aac1796dc8a0daf25899daa7761 | 589 | py | Python | TianJiPlanBackend/core/utils.py | weridolin/tianji-plan | b98a49d92ee2a365095f9e15f4231f5178aca1c0 | [
"Apache-2.0"
] | null | null | null | TianJiPlanBackend/core/utils.py | weridolin/tianji-plan | b98a49d92ee2a365095f9e15f4231f5178aca1c0 | [
"Apache-2.0"
] | null | null | null | TianJiPlanBackend/core/utils.py | weridolin/tianji-plan | b98a49d92ee2a365095f9e15f4231f5178aca1c0 | [
"Apache-2.0"
] | 1 | 2021-12-07T11:45:13.000Z | 2021-12-07T11:45:13.000Z | '''
Description:
email: 359066432@qq.com
Author: lhj
software: vscode
Date: 2021-09-19 17:28:48
platform: windows 10
LastEditors: lhj
LastEditTime: 2021-09-20 20:01:05
'''
from dataclasses import dataclass
@dataclass
class UserBriefInfo(object):
user_id:str
user_name:str
@classmethod
def from_user(c... | 19.633333 | 59 | 0.704584 |
from dataclasses import dataclass
@dataclass
class UserBriefInfo(object):
user_id:str
user_name:str
@classmethod
def from_user(cls,user):
return cls(user_id=user.id,user_name=user.username)
@property
def cache_permission_key(self):
return f"user:{self.user_name}:permissions"
... | true | true |
f70a4d8c027af9c7d598f7510fa3b661626b62ff | 4,113 | py | Python | inkscape_control.py | pkumath/datastructure | 0b440b59af73ed73c575df5cd1c67946aa510dba | [
"MIT"
] | 4 | 2020-05-19T05:38:37.000Z | 2020-05-27T04:14:17.000Z | inkscape_control.py | pkumath/datastructure | 0b440b59af73ed73c575df5cd1c67946aa510dba | [
"MIT"
] | null | null | null | inkscape_control.py | pkumath/datastructure | 0b440b59af73ed73c575df5cd1c67946aa510dba | [
"MIT"
] | 1 | 2020-05-19T05:41:53.000Z | 2020-05-19T05:41:53.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import paste
import subprocess
from multiprocessing import Process
from pathlib import Path
import tkinter.messagebox as messagebox
from shutil import copy
from appdirs import user_config_dir
import logging as log
from globe import Globe as globe
from util impo... | 32.132813 | 155 | 0.653538 |
import os
import paste
import subprocess
from multiprocessing import Process
from pathlib import Path
import tkinter.messagebox as messagebox
from shutil import copy
from appdirs import user_config_dir
import logging as log
from globe import Globe as globe
from util import StrUtil as strutil
import workspace
SYSTE... | true | true |
f70a4e0537f64d4f57d9c31c05f6e8dab7dea946 | 26,170 | py | Python | tensorflow/python/data/experimental/ops/batching.py | nicolasoyharcabal/tensorflow | 0d3b58cfe91c6b865a14701345d7a84ce949c0e3 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/data/experimental/ops/batching.py | nicolasoyharcabal/tensorflow | 0d3b58cfe91c6b865a14701345d7a84ce949c0e3 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/data/experimental/ops/batching.py | nicolasoyharcabal/tensorflow | 0d3b58cfe91c6b865a14701345d7a84ce949c0e3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 39.893293 | 104 | 0.713068 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.data.experimental.ops import get_single_element
from tensorflow.python.data.experimental.ops import grouping
from tensorflow.python.data.ops import datas... | true | true |
f70a4e811c901d0c029f84d9ed26ad4bb9ede94d | 2,022 | py | Python | src/compas_rv2/ui/Rhino/RV2/dev/RV2force_modify_vertices_cmd.py | selinabitting/compas-RV2 | 0884cc00d09c8f4a75eb2b97614105e4c8bfd818 | [
"MIT"
] | 34 | 2020-04-27T13:54:38.000Z | 2022-01-17T19:16:27.000Z | src/compas_rv2/ui/Rhino/RV2/dev/RV2force_modify_vertices_cmd.py | selinabitting/compas-RV2 | 0884cc00d09c8f4a75eb2b97614105e4c8bfd818 | [
"MIT"
] | 306 | 2020-04-27T12:00:54.000Z | 2022-03-23T22:28:54.000Z | src/compas_rv2/ui/Rhino/RV2/dev/RV2force_modify_vertices_cmd.py | selinabitting/compas-RV2 | 0884cc00d09c8f4a75eb2b97614105e4c8bfd818 | [
"MIT"
] | 11 | 2020-06-30T08:23:40.000Z | 2022-02-01T20:47:39.000Z | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from compas.utilities import flatten
import compas_rhino
from compas_rv2.rhino import get_scene
from compas_rv2.rhino import rv2_undo
from compas_rv2.rhino import rv2_error
# from compas_rv2.rhino import Modif... | 27.69863 | 116 | 0.611276 | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from compas.utilities import flatten
import compas_rhino
from compas_rv2.rhino import get_scene
from compas_rv2.rhino import rv2_undo
from compas_rv2.rhino import rv2_error
__commandname__ = "RV2force_modif... | true | true |
f70a4f99ed17d4e51bbbcf86b20403048c13eea3 | 491 | py | Python | tests/system/test_base.py | live-wire/terminalbeat | c85b86d6b118beb52b1e4d037c1984f36a1e5935 | [
"Apache-2.0"
] | 8 | 2019-01-14T14:49:09.000Z | 2020-07-24T18:32:06.000Z | tests/system/test_base.py | live-wire/terminalbeat | c85b86d6b118beb52b1e4d037c1984f36a1e5935 | [
"Apache-2.0"
] | 1 | 2019-11-26T22:32:53.000Z | 2019-11-28T03:11:30.000Z | tests/system/test_base.py | live-wire/terminalbeat | c85b86d6b118beb52b1e4d037c1984f36a1e5935 | [
"Apache-2.0"
] | 1 | 2019-09-01T05:47:58.000Z | 2019-09-01T05:47:58.000Z | from terminalbeat import BaseTest
import os
class Test(BaseTest):
def test_base(self):
"""
Basic test with exiting Terminalbeat normally
"""
self.render_config_template(
path=os.path.abspath(self.working_dir) + "/log/*"
)
terminalbeat_proc = self.star... | 24.55 | 77 | 0.641548 | from terminalbeat import BaseTest
import os
class Test(BaseTest):
def test_base(self):
self.render_config_template(
path=os.path.abspath(self.working_dir) + "/log/*"
)
terminalbeat_proc = self.start_beat()
self.wait_until(lambda: self.log_contains("terminalbeat is ru... | true | true |
f70a517cef671f469725873b87a9a185709dbe5b | 9,021 | py | Python | saleor/credit/models.py | glosoftgroup/KahawaHardware | 893e94246583addf41c3bb0d58d2ce6bcd233c4f | [
"BSD-3-Clause"
] | null | null | null | saleor/credit/models.py | glosoftgroup/KahawaHardware | 893e94246583addf41c3bb0d58d2ce6bcd233c4f | [
"BSD-3-Clause"
] | null | null | null | saleor/credit/models.py | glosoftgroup/KahawaHardware | 893e94246583addf41c3bb0d58d2ce6bcd233c4f | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
from decimal import Decimal
from django.conf import settings
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from django.db.models import Sum
from django.utils.encoding import python_2_unicode_compatible
from django.utils.tim... | 41.004545 | 121 | 0.687729 | from __future__ import unicode_literals
from decimal import Decimal
from django.conf import settings
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from django.db.models import Sum
from django.utils.encoding import python_2_unicode_compatible
from django.utils.tim... | true | true |
f70a5222663a3702e2a5dc5e9d2718c5d92ef525 | 629 | py | Python | solve.py | LeoQuote/power-flow-python | 7382c116d3b2583fa3d8406d58290aa3ba91db7c | [
"MIT"
] | 3 | 2015-11-05T08:11:02.000Z | 2021-05-07T13:44:53.000Z | solve.py | LeoQuote/power-flow-python | 7382c116d3b2583fa3d8406d58290aa3ba91db7c | [
"MIT"
] | null | null | null | solve.py | LeoQuote/power-flow-python | 7382c116d3b2583fa3d8406d58290aa3ba91db7c | [
"MIT"
] | null | null | null | for j in range(y_bus_size - 1, -1, -1):
f=[]
f += [0] * j
h=f.copy()
f += [1]
for i in range(j + 1, y_bus_size):
f += [0]
for k in range(j, i):
# print(j,i,k)
# 临时变量temp,存储l f 的乘积
f[i] -= facter_table[k, i] * f[k]
# print(f)
for i in range(... | 27.347826 | 59 | 0.430843 | for j in range(y_bus_size - 1, -1, -1):
f=[]
f += [0] * j
h=f.copy()
f += [1]
for i in range(j + 1, y_bus_size):
f += [0]
for k in range(j, i):
f[i] -= facter_table[k, i] * f[k]
for i in range(j, y_bus_size):
h += [f[i] * facter_... | true | true |
f70a52490eb88a7e170aead0a106cbf79e90a6dd | 461 | py | Python | env/Lib/site-packages/plotly/validators/scattergl/marker/colorbar/_tickprefix.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | env/Lib/site-packages/plotly/validators/scattergl/marker/colorbar/_tickprefix.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | env/Lib/site-packages/plotly/validators/scattergl/marker/colorbar/_tickprefix.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import _plotly_utils.basevalidators
class TickprefixValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="tickprefix",
parent_name="scattergl.marker.colorbar",
**kwargs
):
super(TickprefixValidator, self).__init__(
plotly_... | 27.117647 | 72 | 0.633406 | import _plotly_utils.basevalidators
class TickprefixValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="tickprefix",
parent_name="scattergl.marker.colorbar",
**kwargs
):
super(TickprefixValidator, self).__init__(
plotly_... | true | true |
f70a529f71d485b581dd3d7d9dad29024325cffa | 1,391 | py | Python | tests/features/steps/call_steps.py | candango/taskio | cd9687dc7facfea45f45631f44f21075c14e4a7b | [
"Apache-2.0"
] | null | null | null | tests/features/steps/call_steps.py | candango/taskio | cd9687dc7facfea45f45631f44f21075c14e4a7b | [
"Apache-2.0"
] | 9 | 2020-02-13T03:16:18.000Z | 2022-03-24T05:14:43.000Z | tests/features/steps/call_steps.py | candango/taskio | cd9687dc7facfea45f45631f44f21075c14e4a7b | [
"Apache-2.0"
] | 1 | 2019-10-09T14:52:56.000Z | 2019-10-09T14:52:56.000Z | # -*- coding: UTF-8 -*-
#
# Copyright 2019-2022 Flávio Gonçalves Garcia
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 37.594595 | 77 | 0.777858 |
from behave import given, when, then
from taskio.process import TaskioLoader
from behave.api.async_step import async_run_until_complete
from tests import PROJECT_ROOT
import sys
@when("{command} is called from {program} program")
def step_is_called_from_program(context, command, program):
program_... | true | true |
f70a52a9a23a725b7c77f7cc457a46c90b493435 | 196 | py | Python | sphinx/source/docs/user_guide/source_examples/charts_histogram_values_field_arg.py | quasiben/bokeh | 738343bd18c851dfd1fdc82cf35fe3eb4cdfd475 | [
"BSD-3-Clause"
] | 1 | 2017-08-02T23:12:03.000Z | 2017-08-02T23:12:03.000Z | sphinx/source/docs/user_guide/source_examples/charts_histogram_values_field_arg.py | evidation-health/bokeh | 2c580d93419033b962d36e3c46d7606cc2f24606 | [
"BSD-3-Clause"
] | null | null | null | sphinx/source/docs/user_guide/source_examples/charts_histogram_values_field_arg.py | evidation-health/bokeh | 2c580d93419033b962d36e3c46d7606cc2f24606 | [
"BSD-3-Clause"
] | null | null | null |
from bokeh.charts import Histogram, output_file, show
from bokeh.sampledata.autompg import autompg as df
p = Histogram(df, 'hp', title="HP Distribution")
output_file("histogram.html",)
show(p) | 21.777778 | 53 | 0.765306 |
from bokeh.charts import Histogram, output_file, show
from bokeh.sampledata.autompg import autompg as df
p = Histogram(df, 'hp', title="HP Distribution")
output_file("histogram.html",)
show(p) | true | true |
f70a52f93364ea4968332dac6b553bf9463c313f | 778 | py | Python | src/token.py | AsmusAB/wrap-tz-contracts | 8b93a63507e5f8e5ce816ceb7fe0cbaf5e83f6e7 | [
"MIT"
] | 1 | 2021-12-11T17:14:31.000Z | 2021-12-11T17:14:31.000Z | src/token.py | AsmusAB/wrap-tz-contracts | 8b93a63507e5f8e5ce816ceb7fe0cbaf5e83f6e7 | [
"MIT"
] | 4 | 2021-02-26T08:02:11.000Z | 2021-06-23T20:27:39.000Z | src/token.py | AsmusAB/wrap-tz-contracts | 8b93a63507e5f8e5ce816ceb7fe0cbaf5e83f6e7 | [
"MIT"
] | 6 | 2021-04-13T07:34:52.000Z | 2022-03-09T04:29:47.000Z | from pytezos import PyTezosClient
class Token(object):
def __init__(self, client: PyTezosClient):
self.client = client
def set_admin(self, contract_id, new_admin):
print(f"Setting fa2 admin on {contract_id} to {new_admin}")
call = self.set_admin_call(contract_id, new_admin)
r... | 31.12 | 67 | 0.64653 | from pytezos import PyTezosClient
class Token(object):
def __init__(self, client: PyTezosClient):
self.client = client
def set_admin(self, contract_id, new_admin):
print(f"Setting fa2 admin on {contract_id} to {new_admin}")
call = self.set_admin_call(contract_id, new_admin)
r... | true | true |
f70a53626db7b46409330eca5f315ce54d9032aa | 8,161 | py | Python | Scripts/DvdListFiles.py | ogamespec/dolwin-python | c5dade6a9fc1dd716d85a839a4ce967a65011292 | [
"CC0-1.0"
] | 2 | 2020-10-16T09:49:22.000Z | 2020-11-18T01:11:58.000Z | Scripts/DvdListFiles.py | ogamespec/dolwin-python | c5dade6a9fc1dd716d85a839a4ce967a65011292 | [
"CC0-1.0"
] | null | null | null | Scripts/DvdListFiles.py | ogamespec/dolwin-python | c5dade6a9fc1dd716d85a839a4ce967a65011292 | [
"CC0-1.0"
] | null | null | null | '''
Parse the FST of the current disk and list the files
Example:
MountIso c:/isos/ac.gcm (mount existing GCM)
% DvdListFiles
'''
def do_command(dolwin, args):
# Check if any DVD is mounted (real GCM image or DolphinSDK virtual disk)
mounted = False
res = dolwin.ExecuteWi... | 31.754864 | 173 | 0.620635 | def do_command(dolwin, args):
mounted = False
res = dolwin.ExecuteWithResult ("DvdInfo 1")
for i in res["result"]:
if type(i) == str:
mounted = i != ""
if not mounted:
print ("DVD is not mounted")
return
DVD_BB2_OFFSET = 0x0420
DV... | true | true |
f70a53838caca2eaa018cef84eeb42f6e4dd002b | 223 | py | Python | exer2/multiply.py | JekyllAndHyde8999/Git-Tutorials-AIDC | 5747e05980c82fd3a22dc3102bcede79079842f9 | [
"MIT"
] | null | null | null | exer2/multiply.py | JekyllAndHyde8999/Git-Tutorials-AIDC | 5747e05980c82fd3a22dc3102bcede79079842f9 | [
"MIT"
] | null | null | null | exer2/multiply.py | JekyllAndHyde8999/Git-Tutorials-AIDC | 5747e05980c82fd3a22dc3102bcede79079842f9 | [
"MIT"
] | null | null | null | # The objective of this program is to multiply two input numbers
def multiply(*args):
a = args
res = 1
for ele in a:
res *= ele
return res
a1=int(input())
a2=int(input())
print(multiply(a1,a2))
| 13.9375 | 64 | 0.61435 |
def multiply(*args):
a = args
res = 1
for ele in a:
res *= ele
return res
a1=int(input())
a2=int(input())
print(multiply(a1,a2))
| true | true |
f70a5395c3923da0f06930099407d0b2dd77e18e | 1,322 | py | Python | h/layouts.py | gnott/h | 77a0452b8196f7efb97d4a400ce7583062d620e6 | [
"MIT"
] | null | null | null | h/layouts.py | gnott/h | 77a0452b8196f7efb97d4a400ce7583062d620e6 | [
"MIT"
] | null | null | null | h/layouts.py | gnott/h | 77a0452b8196f7efb97d4a400ce7583062d620e6 | [
"MIT"
] | null | null | null | from pyramid_layout.layout import layout_config
@layout_config(template='h:templates/base.pt')
class BaseLayout(object):
csp = None
inline_webfont = True
requirements = (('app', None),)
def __init__(self, context, request):
self.context = context
self.request = request
self.fo... | 27.541667 | 68 | 0.666415 | from pyramid_layout.layout import layout_config
@layout_config(template='h:templates/base.pt')
class BaseLayout(object):
csp = None
inline_webfont = True
requirements = (('app', None),)
def __init__(self, context, request):
self.context = context
self.request = request
self.fo... | true | true |
f70a53bcae60ac2df6c5fb334f3698dce45cc9af | 819 | py | Python | test/prophet_model.py | jsonbruce/MTSAnomalyDetection | 94e1b3177f8260804a4f9079ce7358f984521471 | [
"Apache-2.0"
] | 28 | 2017-09-10T01:45:40.000Z | 2021-12-02T11:57:48.000Z | test/prophet_model.py | maxsxu/MTSAnomalyDetection | 94e1b3177f8260804a4f9079ce7358f984521471 | [
"Apache-2.0"
] | 3 | 2019-05-28T08:29:20.000Z | 2019-08-29T20:58:56.000Z | test/prophet_model.py | maxsxu/MTSAnomalyDetection | 94e1b3177f8260804a4f9079ce7358f984521471 | [
"Apache-2.0"
] | 14 | 2017-11-28T10:32:59.000Z | 2021-07-01T12:49:45.000Z | #!/usr/bin/env python
# coding=utf-8
# Created by max on 17-5-4.
import os
import sys
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from fbprophet import Prophet
from pandas import Series, DataFrame
DATA_FILE = "dataset/data0.csv"
def main(args):
data = pd.read_csv(DATA_FILE, parse_d... | 20.475 | 74 | 0.680098 |
import os
import sys
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from fbprophet import Prophet
from pandas import Series, DataFrame
DATA_FILE = "dataset/data0.csv"
def main(args):
data = pd.read_csv(DATA_FILE, parse_dates=True, index_col='timestamp')
data['ds'] = data.... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.