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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c4577df150e0de677cd366f5bf958d6cbeb0911 | 2,234 | py | Python | src/the_tale/the_tale/game/heroes/conf.py | Alacrate/the-tale | 43b211f3a99e93964e95abc20a8ed649a205ffcf | [
"BSD-3-Clause"
] | 85 | 2017-11-21T12:22:02.000Z | 2022-03-27T23:07:17.000Z | src/the_tale/the_tale/game/heroes/conf.py | Alacrate/the-tale | 43b211f3a99e93964e95abc20a8ed649a205ffcf | [
"BSD-3-Clause"
] | 545 | 2017-11-04T14:15:04.000Z | 2022-03-27T14:19:27.000Z | src/the_tale/the_tale/game/heroes/conf.py | Alacrate/the-tale | 43b211f3a99e93964e95abc20a8ed649a205ffcf | [
"BSD-3-Clause"
] | 45 | 2017-11-11T12:36:30.000Z | 2022-02-25T06:10:44.000Z |
import smart_imports
smart_imports.all()
NAME_REGEX = r'^[\-\ а-яА-Я«»\'ёЁ]+$' if not django_settings.TESTS_RUNNING else r'^[\-\ а-яА-Я«»\'\,ёЁ]+$'
settings = utils_app_settings.app_settings('HEROES',
USE_ABILITY_CHANCE=0.1,
MES... | 44.68 | 120 | 0.389884 |
import smart_imports
smart_imports.all()
NAME_REGEX = r'^[\-\ а-яА-Я«»\'ёЁ]+$' if not django_settings.TESTS_RUNNING else r'^[\-\ а-яА-Я«»\'\,ёЁ]+$'
settings = utils_app_settings.app_settings('HEROES',
USE_ABILITY_CHANCE=0.1,
MES... | true | true |
1c4579efb456751f3e85a187b14430807fac4cfc | 1,051 | py | Python | solutions/093.restore-ip-addresses/restore-ip-addresses.py | wangsongiam/leetcode | 96ff21bca1871816ae51fccb1fa13587b378dc50 | [
"MIT"
] | 3 | 2018-11-25T15:19:57.000Z | 2019-09-28T03:01:11.000Z | solutions/093.restore-ip-addresses/restore-ip-addresses.py | casprwang/leetcode | 96ff21bca1871816ae51fccb1fa13587b378dc50 | [
"MIT"
] | null | null | null | solutions/093.restore-ip-addresses/restore-ip-addresses.py | casprwang/leetcode | 96ff21bca1871816ae51fccb1fa13587b378dc50 | [
"MIT"
] | 3 | 2018-02-11T20:23:44.000Z | 2020-06-05T15:39:56.000Z | class Solution:
def restoreIpAddresses(self, s):
"""
:type s: str
:rtype: List[str]
"""
ret = []
def traverse(pos, cnt, tmp):
print(tmp)
nonlocal ret, s
if cnt == 0:
if not s[pos:]:
return
... | 26.948718 | 95 | 0.358706 | class Solution:
def restoreIpAddresses(self, s):
ret = []
def traverse(pos, cnt, tmp):
print(tmp)
nonlocal ret, s
if cnt == 0:
if not s[pos:]:
return
if len(s[pos:]) > 1 and s[pos:][0] == '0':
... | true | true |
1c457a9117673b494d492a9f4ab781bd3957996b | 1,632 | py | Python | Data Scientist Career Path/12. Foundations of Machine Learning Unsupervised Learning/2. KMeans++/1. intro.py | myarist/Codecademy | 2ba0f104bc67ab6ef0f8fb869aa12aa02f5f1efb | [
"MIT"
] | 23 | 2021-06-06T15:35:55.000Z | 2022-03-21T06:53:42.000Z | Data Scientist Career Path/12. Foundations of Machine Learning Unsupervised Learning/2. KMeans++/1. intro.py | shivaniverma1/Data-Scientist | f82939a411484311171465591455880c8e354750 | [
"MIT"
] | null | null | null | Data Scientist Career Path/12. Foundations of Machine Learning Unsupervised Learning/2. KMeans++/1. intro.py | shivaniverma1/Data-Scientist | f82939a411484311171465591455880c8e354750 | [
"MIT"
] | 9 | 2021-06-08T01:32:04.000Z | 2022-03-18T15:38:09.000Z | import codecademylib3_seaborn
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from sklearn.cluster import KMeans
import random
import timeit
mu = 1
std = 0.5
np.random.seed(100)
xs = np.append(np.append(np.append(np.random.normal(0.25,std,100), np.random.normal(0.75,std,100)), np.random.norma... | 27.2 | 164 | 0.712623 | import codecademylib3_seaborn
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from sklearn.cluster import KMeans
import random
import timeit
mu = 1
std = 0.5
np.random.seed(100)
xs = np.append(np.append(np.append(np.random.normal(0.25,std,100), np.random.normal(0.75,std,100)), np.random.norma... | true | true |
1c457b258f46e8b97aa913da1acea83fba03eaed | 944 | py | Python | rrpython/tests/types/test_str.py | afoolsbag/rrPython | cb4d376b7c02e39d4e88163f272456ebb9eeafc9 | [
"Unlicense"
] | null | null | null | rrpython/tests/types/test_str.py | afoolsbag/rrPython | cb4d376b7c02e39d4e88163f272456ebb9eeafc9 | [
"Unlicense"
] | null | null | null | rrpython/tests/types/test_str.py | afoolsbag/rrPython | cb4d376b7c02e39d4e88163f272456ebb9eeafc9 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
# coding: utf-8
r"""
字符串类型。
::
+-> Container: obj.__contains__(self, item) # item in obj
|
+-> Sized: obj.__len__(self) # len(obj)
|
+-> Iterable: obj.__iter__(self) # iter(obj)
|
+-> Collection
|
... | 23.02439 | 89 | 0.54661 |
__version__ = '2020.09.27'
__since__ = '2020.09.24'
__author__ = 'zhengrr'
__license__ = 'UNLICENSE'
from typing import Sequence
def test_issubclass() -> None:
assert issubclass(str, Sequence)
| true | true |
1c457bc8969abfb76d85c1df6226dd8f0956c564 | 13,447 | py | Python | lime/optics.py | binggu56/lime | 07f60c5105f0bedb11ac389fd671f4f1737a71fe | [
"MIT"
] | 4 | 2020-01-15T11:52:23.000Z | 2021-01-05T19:40:36.000Z | lime/optics.py | binggu56/lime | 07f60c5105f0bedb11ac389fd671f4f1737a71fe | [
"MIT"
] | null | null | null | lime/optics.py | binggu56/lime | 07f60c5105f0bedb11ac389fd671f4f1737a71fe | [
"MIT"
] | 3 | 2020-02-14T07:10:44.000Z | 2021-04-14T17:49:45.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 26 17:26:02 2019
@author: binggu
"""
import numpy as np
from scipy.sparse import lil_matrix, csr_matrix, kron, identity, linalg
from numpy import sqrt, exp, pi
import matplotlib.pyplot as plt
from lime.units import au2k, au2ev
from lime.fft import... | 22.791525 | 93 | 0.512605 |
import numpy as np
from scipy.sparse import lil_matrix, csr_matrix, kron, identity, linalg
from numpy import sqrt, exp, pi
import matplotlib.pyplot as plt
from lime.units import au2k, au2ev
from lime.fft import fft2
from lime.phys import rect, sinc, dag, interval
from lime.style import set_style, imshow
from numba i... | true | true |
1c457ce30654b4e60fe6ac59186a1c9d26859b54 | 10,225 | py | Python | glance_docker/glance/common/auth.py | tobegit3hub/dockerized-software | 3781bc1145b6fbb8d5fa2e2eaeaa3aa138a69632 | [
"Apache-2.0"
] | null | null | null | glance_docker/glance/common/auth.py | tobegit3hub/dockerized-software | 3781bc1145b6fbb8d5fa2e2eaeaa3aa138a69632 | [
"Apache-2.0"
] | null | null | null | glance_docker/glance/common/auth.py | tobegit3hub/dockerized-software | 3781bc1145b6fbb8d5fa2e2eaeaa3aa138a69632 | [
"Apache-2.0"
] | null | null | null | # Copyright 2011 OpenStack Foundation
# 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 requ... | 34.897611 | 79 | 0.603619 |
import httplib2
from oslo_log import log as logging
from oslo_serialization import jsonutils
from six.moves import range
import six.moves.urllib.parse as urlparse
from glance.common import exception
from glance import i18n
LOG = logging.getLogger(__name__)
_ = i18n._
class BaseStrategy(object):
def __init__(s... | true | true |
1c457cf430666778cca067fee9e66d2b156178b1 | 2,193 | py | Python | ropgenerator/exploit/syscall/SyscallLinuxX86.py | avltree9798/ropgenerator | c63c81f03e8653dc3911e21300c00003a4224f6a | [
"MIT"
] | 1 | 2021-01-07T13:16:19.000Z | 2021-01-07T13:16:19.000Z | ropgenerator/exploit/syscall/SyscallLinuxX86.py | avltree9798/ropgenerator | c63c81f03e8653dc3911e21300c00003a4224f6a | [
"MIT"
] | null | null | null | ropgenerator/exploit/syscall/SyscallLinuxX86.py | avltree9798/ropgenerator | c63c81f03e8653dc3911e21300c00003a4224f6a | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
# SycallLinuxX86 module: build syscalls for linux on X64
from ropgenerator.exploit.syscall.SyscallGeneric import Syscall, ArgType
from ropgenerator.core.Architecture import *
mprotect = Syscall('int', 'mprotect', \
[('void*', 'addr'),('size_t','len'),('int','prot')], [ArgType.INT, ArgTyp... | 37.810345 | 122 | 0.632011 |
from ropgenerator.exploit.syscall.SyscallGeneric import Syscall, ArgType
from ropgenerator.core.Architecture import *
mprotect = Syscall('int', 'mprotect', \
[('void*', 'addr'),('size_t','len'),('int','prot')], [ArgType.INT, ArgType.INT, ArgType.INT],\
[RegX86.EBX, RegX86.ECX, RegX86.EDX], [(RegX86.EAX, 0x7... | true | true |
1c457d19c80113b1224bc3ece869c3003a166dee | 690 | py | Python | molecule/default/tests/test_default.py | dhs-ncats/ansible-role-htop | a7848a00693e9e841e3546d879968704228b47a4 | [
"CC0-1.0"
] | null | null | null | molecule/default/tests/test_default.py | dhs-ncats/ansible-role-htop | a7848a00693e9e841e3546d879968704228b47a4 | [
"CC0-1.0"
] | null | null | null | molecule/default/tests/test_default.py | dhs-ncats/ansible-role-htop | a7848a00693e9e841e3546d879968704228b47a4 | [
"CC0-1.0"
] | null | null | null | """Module containing the tests for the default scenario."""
# Standard Python Libraries
import os
# Third-Party Libraries
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("all")
@pytest.mark.par... | 23.793103 | 63 | 0.731884 |
import os
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("all")
@pytest.mark.parametrize("pkg", ["htop"])
def test_packages(host, pkg):
package = host.package(pkg)
assert package.is_i... | true | true |
1c457edb6c9ecbc1d978023d080823ab44d6d1d2 | 560 | py | Python | integration/emulator/test.py | cvlabmiet/master-programming-example | 8a4a231ba2b72a93ae14da2c04e17b2ae3fc6651 | [
"MIT"
] | null | null | null | integration/emulator/test.py | cvlabmiet/master-programming-example | 8a4a231ba2b72a93ae14da2c04e17b2ae3fc6651 | [
"MIT"
] | null | null | null | integration/emulator/test.py | cvlabmiet/master-programming-example | 8a4a231ba2b72a93ae14da2c04e17b2ae3fc6651 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys, random, array
sys.dont_write_bytecode = True
from device import Pram, Lram
test_vector = list(range(0, 200))
random.shuffle(test_vector)
pram = Pram()
lram = Lram()
lram[:] = bytes(test_vector)
pram[:] = b'[u16:200:400]add(u8:0, u8:100)'
pram.run(lram)
view = memoryview(lram)[2... | 20.740741 | 73 | 0.664286 |
import sys, random, array
sys.dont_write_bytecode = True
from device import Pram, Lram
test_vector = list(range(0, 200))
random.shuffle(test_vector)
pram = Pram()
lram = Lram()
lram[:] = bytes(test_vector)
pram[:] = b'[u16:200:400]add(u8:0, u8:100)'
pram.run(lram)
view = memoryview(lram)[200:400].cast('H')
error... | true | true |
1c457f19469eb820eb88da2d97435a799d4d316b | 1,354 | py | Python | crslab/model/__init__.py | Xiaolong-Qi/CRSLab | d507378c86f4996727bf062482e1f224486d4533 | [
"MIT"
] | 1 | 2021-01-06T10:39:10.000Z | 2021-01-06T10:39:10.000Z | crslab/model/__init__.py | Xiaolong-Qi/CRSLab | d507378c86f4996727bf062482e1f224486d4533 | [
"MIT"
] | null | null | null | crslab/model/__init__.py | Xiaolong-Qi/CRSLab | d507378c86f4996727bf062482e1f224486d4533 | [
"MIT"
] | null | null | null | # @Time : 2020/11/22
# @Author : Kun Zhou
# @Email : francis_kun_zhou@163.com
# UPDATE:
# @Time : 2020/11/24, 2020/12/24
# @Author : Kun Zhou, Xiaolei Wang
# @Email : francis_kun_zhou@163.com, wxl1999@foxmail.com
from loguru import logger
from .conversation import *
from .kbrd import *
from .kgsf import *
from... | 27.08 | 91 | 0.6839 |
from loguru import logger
from .conversation import *
from .kbrd import *
from .kgsf import *
from .policy import *
from .recommendation import *
from .redial import *
from .tgredial import *
Model_register_table = {
'KGSF': KGSFModel,
'KBRD': KBRDModel,
'TGRec': TGRecModel,
'TGConv': TGConvModel,
... | true | true |
1c457faa9ac5bd092b0c88919dffda9a035f0f60 | 8,729 | py | Python | ckan_cloud_operator/providers/storage/minio/manager.py | mickeyrouash/ckan-cloud-operator | 10e38f13964af30fe57b07e8d8a3b7521ed69cc2 | [
"MIT"
] | null | null | null | ckan_cloud_operator/providers/storage/minio/manager.py | mickeyrouash/ckan-cloud-operator | 10e38f13964af30fe57b07e8d8a3b7521ed69cc2 | [
"MIT"
] | null | null | null | ckan_cloud_operator/providers/storage/minio/manager.py | mickeyrouash/ckan-cloud-operator | 10e38f13964af30fe57b07e8d8a3b7521ed69cc2 | [
"MIT"
] | null | null | null | #### standard provider code ####
# import the correct PROVIDER_SUBMODULE and PROVIDER_ID constants for your provider
from .constants import PROVIDER_ID
from ..constants import PROVIDER_SUBMODULE
# define common provider functions based on the constants
from ckan_cloud_operator.providers import manager as providers_ma... | 44.764103 | 273 | 0.680719 |
from .constants import PROVIDER_ID
from ..constants import PROVIDER_SUBMODULE
from ckan_cloud_operator.providers import manager as providers_manager
def _get_resource_name(suffix=None): return providers_manager.get_resource_name(PROVIDER_SUBMODULE, PROVIDER_ID, suffix=suffix)
def _get_resource_labels(for_deployment=F... | true | true |
1c4580a46e7319d59ea9439c79f77deb41aaa8c2 | 5,708 | py | Python | luigi/rpc.py | miku/luigi | 889ef2af64e2aa7d0cc65caef69a241ac91e5ff9 | [
"Apache-2.0"
] | 4 | 2017-03-21T20:01:19.000Z | 2022-03-29T16:31:41.000Z | luigi/rpc.py | miku/luigi | 889ef2af64e2aa7d0cc65caef69a241ac91e5ff9 | [
"Apache-2.0"
] | 9 | 2017-03-22T23:38:48.000Z | 2019-01-28T21:13:06.000Z | luigi/rpc.py | miku/luigi | 889ef2af64e2aa7d0cc65caef69a241ac91e5ff9 | [
"Apache-2.0"
] | 2 | 2015-05-04T22:46:20.000Z | 2016-07-14T17:58:57.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | 33.380117 | 104 | 0.653644 | import os
import json
import logging
import socket
import time
from luigi.six.moves.urllib.parse import urljoin, urlencode, urlparse
from luigi.six.moves.urllib.request import urlopen
from luigi.six.moves.urllib.error import URLError
from luigi import configuration
from luigi.scheduler import RPC_METHODS
HAS_UNIX_SO... | true | true |
1c4581505fbb614f1ce2848ca80ed21dafdc2751 | 1,094 | py | Python | quick_start.py | willin007/kucoin_sdk | a4967c9f684aa4917a4b9e668d43520307eb9d30 | [
"MIT"
] | null | null | null | quick_start.py | willin007/kucoin_sdk | a4967c9f684aa4917a4b9e668d43520307eb9d30 | [
"MIT"
] | null | null | null | quick_start.py | willin007/kucoin_sdk | a4967c9f684aa4917a4b9e668d43520307eb9d30 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2021/11/4 10:50 上午
# @Author : william.li
# @File : quick_start.py
# @Software: PyCharm
# MarketData
import asyncio
from kucoin.client import WsToken
from kucoin.ws_client import KucoinWsClient
async def main():
async def deal_msg(msg):
if ms... | 29.567568 | 82 | 0.652651 | import asyncio
from kucoin.client import WsToken
from kucoin.ws_client import KucoinWsClient
async def main():
async def deal_msg(msg):
if msg['topic'] == '/spotMarket/level2Depth5:BTC-USDT':
print(msg["data"])
elif msg['topic'] == '/spotMarket/level2Depth5:KCS-USDT':
print... | true | true |
1c45828c2da100de725a4b389922ca6abe3ce11d | 1,901 | py | Python | setup.py | cajfisher/vasppy | a460db14163b7db3bce54d754dd476c45a3ed85b | [
"MIT"
] | 28 | 2017-02-16T13:22:34.000Z | 2021-04-29T06:10:10.000Z | setup.py | cajfisher/vasppy | a460db14163b7db3bce54d754dd476c45a3ed85b | [
"MIT"
] | 15 | 2016-05-09T13:08:42.000Z | 2021-08-09T10:59:58.000Z | setup.py | cajfisher/vasppy | a460db14163b7db3bce54d754dd476c45a3ed85b | [
"MIT"
] | 25 | 2015-10-12T11:29:22.000Z | 2021-08-20T17:33:27.000Z | """
vasppy: Python utilities for working with VASP inputs and outputs.
"""
from setuptools import setup, find_packages
from vasppy.version import __version__ as VERSION
readme = 'README.md'
long_description = open(readme).read()
scripts = ['check_species',
'murnfit',
'vasp_summary',
... | 31.683333 | 88 | 0.538138 |
from setuptools import setup, find_packages
from vasppy.version import __version__ as VERSION
readme = 'README.md'
long_description = open(readme).read()
scripts = ['check_species',
'murnfit',
'vasp_summary',
'poscar_to_cif',
'potcar_spec',
'effective_mass',
... | true | true |
1c4582bb37d8bf82a9eadb8ac9e0bbddd1dde76a | 7,194 | py | Python | hack/boilerplate/boilerplate.py | moelsayed/kubeone | bec424b09d2d0cb5d97347469c947ab66c5c1d91 | [
"Apache-2.0"
] | 1 | 2020-02-13T17:46:28.000Z | 2020-02-13T17:46:28.000Z | hack/boilerplate/boilerplate.py | moelsayed/kubeone | bec424b09d2d0cb5d97347469c947ab66c5c1d91 | [
"Apache-2.0"
] | null | null | null | hack/boilerplate/boilerplate.py | moelsayed/kubeone | bec424b09d2d0cb5d97347469c947ab66c5c1d91 | [
"Apache-2.0"
] | 1 | 2020-05-06T15:33:38.000Z | 2020-05-06T15:33:38.000Z | #!/usr/bin/env python
# Copyright 2019 The KubeOne Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 29.604938 | 124 | 0.630108 |
from __future__ import print_function
import argparse
import datetime
import difflib
import glob
import os
import re
import sys
parser = argparse.ArgumentParser()
parser.add_argument(
"filenames",
help="list of files to check, all files if unspecified",
nargs='*')
rootdir = os.path.dirname(__file__) + ... | true | true |
1c45839120b9c193c462707af258c3c9bfffdfa3 | 568 | py | Python | tests/test_level1/test_visited.py | kianmeng/soupsieve | a8640aad6ae0476e6b62f4f15e12ad4efc7605c4 | [
"MIT"
] | 130 | 2018-12-27T06:00:32.000Z | 2022-03-29T05:47:18.000Z | tests/test_level1/test_visited.py | kianmeng/soupsieve | a8640aad6ae0476e6b62f4f15e12ad4efc7605c4 | [
"MIT"
] | 157 | 2018-12-07T07:44:15.000Z | 2022-02-05T16:20:08.000Z | tests/test_level1/test_visited.py | kianmeng/soupsieve | a8640aad6ae0476e6b62f4f15e12ad4efc7605c4 | [
"MIT"
] | 32 | 2018-12-31T03:11:55.000Z | 2022-03-06T09:06:43.000Z | """Test visited selectors."""
from .. import util
class TestVisited(util.TestCase):
"""Test visited selectors."""
def test_visited(self):
"""Test visited."""
markup = """
<div>
<p>Some text <span id="1" class="foo:bar:foobar"> in a paragraph</span>.
<a id="2" class="b... | 21.846154 | 80 | 0.482394 | from .. import util
class TestVisited(util.TestCase):
def test_visited(self):
markup = """
<div>
<p>Some text <span id="1" class="foo:bar:foobar"> in a paragraph</span>.
<a id="2" class="bar" href="http://google.com">Link</a>
<a id="3">Placeholder text.</a>
</p>
... | true | true |
1c4584ac1bc01ab917fbb00db92b230e45196a27 | 5,228 | py | Python | export.py | OleksandrBlack/safecoinnodes | 0021edc8e72e078fcd7bedb465292c96caeeb148 | [
"MIT"
] | null | null | null | export.py | OleksandrBlack/safecoinnodes | 0021edc8e72e078fcd7bedb465292c96caeeb148 | [
"MIT"
] | null | null | null | export.py | OleksandrBlack/safecoinnodes | 0021edc8e72e078fcd7bedb465292c96caeeb148 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# export.py - Exports enumerated data for reachable nodes into a JSON file.
#
# Copyright (c) Addy Yeow Chin Heng <ayeowch@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (th... | 32.271605 | 79 | 0.655318 |
import json
import logging
import os
import sys
import time
from binascii import hexlify, unhexlify
from ConfigParser import ConfigParser
from utils import new_redis_conn
REDIS_CONN = None
CONF = {}
def get_row(node):
node = eval(node)
address = node[0]
port = node[1]
services = node[-1]
... | true | true |
1c4584cb83547e7b831785c85e43413291a71a8c | 2,135 | py | Python | Stopwatch.py | arapawa/stopwatch-game | 5ee64e04a8dc15ead2dcd8a661105ae1c9087317 | [
"MIT"
] | null | null | null | Stopwatch.py | arapawa/stopwatch-game | 5ee64e04a8dc15ead2dcd8a661105ae1c9087317 | [
"MIT"
] | 1 | 2016-12-30T06:59:12.000Z | 2016-12-30T06:59:12.000Z | Stopwatch.py | arapawa/stopwatch-game | 5ee64e04a8dc15ead2dcd8a661105ae1c9087317 | [
"MIT"
] | null | null | null | # "Stopwatch: The Game"
# tenth of a second between every tick
# every time timer ticks, it will update a global variable by one
import simplegui
# define global variables
time = 0
success = 0
attempts = 0
counter = 0
# variable to ensure score can only be increased after stopwatch was running
stopwatch... | 26.036585 | 79 | 0.640281 |
import simplegui
time = 0
success = 0
attempts = 0
counter = 0
stopwatch_running = False
def format(t):
a_time = t // 600
b_time = ((t / 10) % 60) // 10
c_time = ((t / 10) % 60) % 10
d_time = t % 10
return str(a_time) + ":" + str(b_time) + str(c_time) + "." + str(d_time)
de... | true | true |
1c458641abbee4ca565c0de49e6620d72012ccb6 | 20,836 | py | Python | cripts/relationships/handlers.py | lakiw/cripts | 43f62891a3724e1ec60629887d97c421fb302163 | [
"MIT"
] | 2 | 2017-04-06T12:26:11.000Z | 2018-11-05T19:17:15.000Z | cripts/relationships/handlers.py | lakiw/cripts | 43f62891a3724e1ec60629887d97c421fb302163 | [
"MIT"
] | 9 | 2016-09-28T10:19:10.000Z | 2017-02-24T17:58:43.000Z | cripts/relationships/handlers.py | lakiw/cripts | 43f62891a3724e1ec60629887d97c421fb302163 | [
"MIT"
] | null | null | null | import datetime
from dateutil.parser import parse
from cripts.core.class_mapper import class_from_id
def get_relationships(obj=None, type_=None, id_=None, analyst=None):
"""
Get relationships for a top-level object.
:param obj: The top-level object to get relationships for.
:type obj: :class:`cripts... | 42.522449 | 95 | 0.578038 | import datetime
from dateutil.parser import parse
from cripts.core.class_mapper import class_from_id
def get_relationships(obj=None, type_=None, id_=None, analyst=None):
if obj:
return obj.sort_relationships("%s" % analyst, meta=True)
elif type_ and id_:
obj = class_from_id(type_, id_)
... | true | true |
1c45866e5a644fc50a8ed3659b45f9a0dee3b769 | 1,731 | py | Python | pytorch/skin_lesion_classification/plots.py | deephealthproject/use-case-pipelines | ea9c8aedfbc9084e1a5350f6f73def2578258c77 | [
"MIT"
] | 1 | 2020-05-20T16:57:11.000Z | 2020-05-20T16:57:11.000Z | pytorch/skin_lesion_classification/plots.py | deephealthproject/use-case-pipelines | ea9c8aedfbc9084e1a5350f6f73def2578258c77 | [
"MIT"
] | 5 | 2021-03-26T16:01:51.000Z | 2021-09-20T13:53:22.000Z | pytorch/skin_lesion_classification/plots.py | deephealthproject/use-case-pipelines | ea9c8aedfbc9084e1a5350f6f73def2578258c77 | [
"MIT"
] | 5 | 2020-05-18T09:44:03.000Z | 2020-11-29T12:58:28.000Z | import itertools
import matplotlib.pyplot as plt
import numpy as np
def plot_sequence(filename, sequences, legend=None):
"""Plots one or more sequences of values into a file
:param filename: output filename
:param sequences: (M x N) array-like structure containing M sequences of N values
:param lege... | 29.844828 | 85 | 0.617562 | import itertools
import matplotlib.pyplot as plt
import numpy as np
def plot_sequence(filename, sequences, legend=None):
fig = plt.figure()
for sequence in sequences:
plt.plot(range(len(sequence)), sequence)
if legend:
plt.legend(legend)
plt.savefig(filename)
plt.close(fig)
def ... | true | true |
1c4586bd66611dfec7cf8c2a805839086f354af2 | 232 | py | Python | lib/JumpScale/baselib/dnsman/dnsFactory.py | rudecs/jumpscale_core7 | 30c03f26f1cdad3edbb9d79d50fbada8acc974f5 | [
"Apache-2.0"
] | null | null | null | lib/JumpScale/baselib/dnsman/dnsFactory.py | rudecs/jumpscale_core7 | 30c03f26f1cdad3edbb9d79d50fbada8acc974f5 | [
"Apache-2.0"
] | 4 | 2016-08-25T12:08:39.000Z | 2018-04-12T12:36:01.000Z | lib/JumpScale/baselib/dnsman/dnsFactory.py | rudecs/jumpscale_core7 | 30c03f26f1cdad3edbb9d79d50fbada8acc974f5 | [
"Apache-2.0"
] | 3 | 2016-03-08T07:49:34.000Z | 2018-10-19T13:56:43.000Z | from bind import BindDNS
class DNSFactory(object):
def __init__(self):
self.bindObj = None
@property
def bind(self):
if not self.bindObj:
self.bindObj = BindDNS()
return self.bindObj | 21.090909 | 36 | 0.612069 | from bind import BindDNS
class DNSFactory(object):
def __init__(self):
self.bindObj = None
@property
def bind(self):
if not self.bindObj:
self.bindObj = BindDNS()
return self.bindObj | true | true |
1c45875f0c9405efffecbefbf3c272cc94cee782 | 7,536 | py | Python | main/cloudfoundry_client/v2/entities.py | subhash12/cf-python-client | c0ecbb8ec85040fc2f74b6c52e1f9a6c6c16c4b0 | [
"Apache-2.0"
] | null | null | null | main/cloudfoundry_client/v2/entities.py | subhash12/cf-python-client | c0ecbb8ec85040fc2f74b6c52e1f9a6c6c16c4b0 | [
"Apache-2.0"
] | null | null | null | main/cloudfoundry_client/v2/entities.py | subhash12/cf-python-client | c0ecbb8ec85040fc2f74b6c52e1f9a6c6c16c4b0 | [
"Apache-2.0"
] | null | null | null | from functools import partial, reduce
from typing import Callable, List, Tuple, Any, Optional, Generator, TYPE_CHECKING
from urllib.parse import quote
from requests import Response
from cloudfoundry_client.errors import InvalidEntity
from cloudfoundry_client.json_object import JsonObject
from cloudfoundry_client.reque... | 43.813953 | 129 | 0.625398 | from functools import partial, reduce
from typing import Callable, List, Tuple, Any, Optional, Generator, TYPE_CHECKING
from urllib.parse import quote
from requests import Response
from cloudfoundry_client.errors import InvalidEntity
from cloudfoundry_client.json_object import JsonObject
from cloudfoundry_client.reque... | true | true |
1c4587d7f261fcbda3642a50322883ae48f591a2 | 8,013 | py | Python | karton/config_extractor/config_extractor.py | kscieslinski/karton-config-extractor | c0eb0bddeed2b217abe517ca1b8a20e679506dba | [
"BSD-3-Clause"
] | null | null | null | karton/config_extractor/config_extractor.py | kscieslinski/karton-config-extractor | c0eb0bddeed2b217abe517ca1b8a20e679506dba | [
"BSD-3-Clause"
] | null | null | null | karton/config_extractor/config_extractor.py | kscieslinski/karton-config-extractor | c0eb0bddeed2b217abe517ca1b8a20e679506dba | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python3
import gc
import hashlib
import json
import os
import re
from karton.core import Config, Karton, Resource, Task
from karton.core.resource import ResourceBase
from malduck.extractor import ExtractManager, ExtractorModules
from .__version__ import __version__
class AnalysisExtractManager(ExtractMan... | 34.097872 | 85 | 0.539998 | import gc
import hashlib
import json
import os
import re
from karton.core import Config, Karton, Resource, Task
from karton.core.resource import ResourceBase
from malduck.extractor import ExtractManager, ExtractorModules
from .__version__ import __version__
class AnalysisExtractManager(ExtractManager):
def __i... | true | true |
1c458914cb33dd348d349ab2d97c4bf9208ef056 | 6,011 | py | Python | Code/PrepareTables/SelectedROICorrs_positionVar.py | cirmuw/functional-twin-analysis | b6730f09f2143d5372f1a90d5fac47e3385e54fb | [
"Apache-2.0"
] | null | null | null | Code/PrepareTables/SelectedROICorrs_positionVar.py | cirmuw/functional-twin-analysis | b6730f09f2143d5372f1a90d5fac47e3385e54fb | [
"Apache-2.0"
] | null | null | null | Code/PrepareTables/SelectedROICorrs_positionVar.py | cirmuw/functional-twin-analysis | b6730f09f2143d5372f1a90d5fac47e3385e54fb | [
"Apache-2.0"
] | null | null | null | #script to create tabels containig x, y and z coordinates of functionally corresponding vertices (position variability) for each twin, one table per vertex
#input:id of functionally corresponding vetices of each twin to reference
#output: tables with vertex position in each subject, one table per vetex
import numpy as ... | 38.044304 | 155 | 0.683081 | import numpy as np
import nibabel as nib
import pandas as pd
from glob import glob
import os, sys
currentdir = os.path.dirname(os.path.realpath(__file__))
parentdir = os.path.dirname(currentdir)
sys.path.append(parentdir)
import settings as s
import pickle
infile =s.HCP_information_sheet_path subjectpath1=s.HCPr... | true | true |
1c458bedfb80717a0139eb3f7187e74d5601bb56 | 477 | py | Python | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/basic/templatetags/form_tags.py | cubicuboctahedron/cookiecutter-django-wagtail | d7f668ce09ba2c4a3f98045ab8a6fcd286d36553 | [
"Apache-2.0"
] | null | null | null | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/basic/templatetags/form_tags.py | cubicuboctahedron/cookiecutter-django-wagtail | d7f668ce09ba2c4a3f98045ab8a6fcd286d36553 | [
"Apache-2.0"
] | null | null | null | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/basic/templatetags/form_tags.py | cubicuboctahedron/cookiecutter-django-wagtail | d7f668ce09ba2c4a3f98045ab8a6fcd286d36553 | [
"Apache-2.0"
] | 1 | 2020-04-07T10:07:07.000Z | 2020-04-07T10:07:07.000Z | from django import template
register = template.Library()
@register.filter(name='addcss')
def addcss(field, css):
return field.as_widget(attrs={"class":css})
@register.filter(name='add_attributes')
def add_attributes(field, css):
attrs = {}
definition = css.split(',')
for d in definition:
if ... | 21.681818 | 46 | 0.597484 | from django import template
register = template.Library()
@register.filter(name='addcss')
def addcss(field, css):
return field.as_widget(attrs={"class":css})
@register.filter(name='add_attributes')
def add_attributes(field, css):
attrs = {}
definition = css.split(',')
for d in definition:
if ... | true | true |
1c458c303d4a0d97db1662628a538701eb8cf2dd | 1,049 | py | Python | test/hlt/pytest/python/com/huawei/iotplatform/client/dto/BatchTaskCreateInDTO.py | yuanyi-thu/AIOT- | 27f67d98324593c4c6c66bbd5e2a4aa7b9a4ac1e | [
"BSD-3-Clause"
] | 128 | 2018-10-29T04:11:47.000Z | 2022-03-07T02:19:14.000Z | test/hlt/pytest/python/com/huawei/iotplatform/client/dto/BatchTaskCreateInDTO.py | yuanyi-thu/AIOT- | 27f67d98324593c4c6c66bbd5e2a4aa7b9a4ac1e | [
"BSD-3-Clause"
] | 40 | 2018-11-02T00:40:48.000Z | 2021-12-07T09:33:56.000Z | test/hlt/pytest/python/com/huawei/iotplatform/client/dto/BatchTaskCreateInDTO.py | yuanyi-thu/AIOT- | 27f67d98324593c4c6c66bbd5e2a4aa7b9a4ac1e | [
"BSD-3-Clause"
] | 118 | 2018-10-29T08:43:57.000Z | 2022-01-07T06:49:25.000Z | from com.huawei.iotplatform.client.dto.ObjectNode import ObjectNode
from com.huawei.iotplatform.client.dto.TagDTO2 import TagDTO2
class BatchTaskCreateInDTO(object):
tags = TagDTO2
param = ObjectNode
def __init__(self):
self.appId = None
self.taskName = None
self.taskType = None
... | 20.98 | 67 | 0.638704 | from com.huawei.iotplatform.client.dto.ObjectNode import ObjectNode
from com.huawei.iotplatform.client.dto.TagDTO2 import TagDTO2
class BatchTaskCreateInDTO(object):
tags = TagDTO2
param = ObjectNode
def __init__(self):
self.appId = None
self.taskName = None
self.taskType = None
... | true | true |
1c458e127c7a31bedae9e99bb85864dbcdac3092 | 20,718 | py | Python | nova/api/openstack/compute/legacy_v2/contrib/security_groups.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 5 | 2016-04-28T16:20:38.000Z | 2021-04-25T11:19:03.000Z | nova/api/openstack/compute/legacy_v2/contrib/security_groups.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | null | null | null | nova/api/openstack/compute/legacy_v2/contrib/security_groups.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 5 | 2020-04-08T20:24:45.000Z | 2020-10-05T19:02:13.000Z | # Copyright 2011 OpenStack Foundation
# Copyright 2012 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/l... | 40.863905 | 79 | 0.592383 |
import contextlib
from xml.dom import minidom
from oslo_log import log as logging
from oslo_serialization import jsonutils
import six
import webob
from webob import exc
from nova.api.openstack import common
from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova import compute
from n... | true | true |
1c458edcdd1b7f3f78cef784442634fe79c4c946 | 78 | py | Python | ass_17.py | Divyanshi0409/Python-Programs | 7fb8ab2159cc69de7168bf19f91325b9c7a908c7 | [
"MIT"
] | null | null | null | ass_17.py | Divyanshi0409/Python-Programs | 7fb8ab2159cc69de7168bf19f91325b9c7a908c7 | [
"MIT"
] | null | null | null | ass_17.py | Divyanshi0409/Python-Programs | 7fb8ab2159cc69de7168bf19f91325b9c7a908c7 | [
"MIT"
] | null | null | null | for i in range(50,81):
if i%2==0:
print(i)
else:
break | 15.6 | 22 | 0.448718 | for i in range(50,81):
if i%2==0:
print(i)
else:
break | true | true |
1c458f5175cf9bf35887e6e17a55a96733dcd698 | 2,954 | py | Python | pint/testing.py | fernandezc/pint | 37a61ede6fbd628c7dc160eb36278cf41c96484c | [
"BSD-3-Clause"
] | null | null | null | pint/testing.py | fernandezc/pint | 37a61ede6fbd628c7dc160eb36278cf41c96484c | [
"BSD-3-Clause"
] | null | null | null | pint/testing.py | fernandezc/pint | 37a61ede6fbd628c7dc160eb36278cf41c96484c | [
"BSD-3-Clause"
] | null | null | null | from __future__ import annotations
import math
import warnings
from numbers import Number
from . import Quantity
from .compat import ndarray
try:
import numpy as np
except ImportError:
np = None
def _get_comparable_magnitudes(first, second, msg):
if isinstance(first, Quantity) and isinstance(second, Qu... | 31.763441 | 78 | 0.618822 | from __future__ import annotations
import math
import warnings
from numbers import Number
from . import Quantity
from .compat import ndarray
try:
import numpy as np
except ImportError:
np = None
def _get_comparable_magnitudes(first, second, msg):
if isinstance(first, Quantity) and isinstance(second, Qu... | true | true |
1c458f9ed188a3d53e4a024d3cb10478bdd12173 | 4,733 | py | Python | sudoku/sudoku/gensudoku.py | PoojithRachakada/sudoku-django | 723de992821e54b63259c00fb949fdfa1e05ac04 | [
"MIT"
] | null | null | null | sudoku/sudoku/gensudoku.py | PoojithRachakada/sudoku-django | 723de992821e54b63259c00fb949fdfa1e05ac04 | [
"MIT"
] | 5 | 2020-12-31T09:42:57.000Z | 2021-01-05T13:59:14.000Z | sudoku/sudoku/gensudoku.py | PoojithRachakada/sudoku-django | 723de992821e54b63259c00fb949fdfa1e05ac04 | [
"MIT"
] | null | null | null | # pylint: disable=unused-variable
import os
import sys
from io import BytesIO, IOBase
import math
import itertools as ITER
from collections import defaultdict as D
from collections import Counter as CO
from collections import deque as Q
import threading
from functools import lru_cache, reduce
from functools ... | 27.358382 | 60 | 0.427002 | import os
import sys
from io import BytesIO, IOBase
import math
import itertools as ITER
from collections import defaultdict as D
from collections import Counter as CO
from collections import deque as Q
import threading
from functools import lru_cache, reduce
from functools import cmp_to_key as CMP
from bise... | true | true |
1c4590d51df3d7bf9eea558bb224c176d93b580d | 4,832 | py | Python | fastmot/utils/visualization.py | rafcy/FastMOT | 9aee101b1ac83a5fea8cece1f8cfda8030adb743 | [
"MIT"
] | null | null | null | fastmot/utils/visualization.py | rafcy/FastMOT | 9aee101b1ac83a5fea8cece1f8cfda8030adb743 | [
"MIT"
] | null | null | null | fastmot/utils/visualization.py | rafcy/FastMOT | 9aee101b1ac83a5fea8cece1f8cfda8030adb743 | [
"MIT"
] | null | null | null | import colorsys
import numpy as np
import cv2
GOLDEN_RATIO = 0.618033988749895
def draw_tracks(frame, tracks, show_flow=False, show_cov=False):
for track in tracks:
draw_bbox(frame, track.tlbr, get_color(track.trk_id), 2, str(track.trk_id))
if show_flow:
draw_feature_match(frame, tra... | 37.457364 | 95 | 0.627276 | import colorsys
import numpy as np
import cv2
GOLDEN_RATIO = 0.618033988749895
def draw_tracks(frame, tracks, show_flow=False, show_cov=False):
for track in tracks:
draw_bbox(frame, track.tlbr, get_color(track.trk_id), 2, str(track.trk_id))
if show_flow:
draw_feature_match(frame, tra... | true | true |
1c4591a6e22722c8a1760289f625d852a5960577 | 2,354 | py | Python | tests/io/simple_process.py | rajgiriUW/pyUSID | 064dcd81d9c42f4eb4782f0a41fd437b3f56f50c | [
"MIT"
] | 25 | 2018-07-11T21:43:56.000Z | 2021-11-17T11:40:00.000Z | tests/io/simple_process.py | rajgiriUW/pyUSID | 064dcd81d9c42f4eb4782f0a41fd437b3f56f50c | [
"MIT"
] | 62 | 2018-07-05T20:28:52.000Z | 2021-12-14T09:49:35.000Z | tests/io/simple_process.py | rajgiriUW/pyUSID | 064dcd81d9c42f4eb4782f0a41fd437b3f56f50c | [
"MIT"
] | 15 | 2019-03-27T22:28:47.000Z | 2021-01-03T20:23:42.000Z | """
Simple process class for purpose of testing.
Created on: Jul 19, 2019
Author: Emily Costa
"""
import h5py
from pyUSID.processing.process import Process
import numpy as np
from pyUSID import hdf_utils
import matplotlib.pyplot as plt
class SimpleProcess(Process):
def __init__(self, h5_main, verbose=True, **kwar... | 39.898305 | 149 | 0.666525 |
import h5py
from pyUSID.processing.process import Process
import numpy as np
from pyUSID import hdf_utils
import matplotlib.pyplot as plt
class SimpleProcess(Process):
def __init__(self, h5_main, verbose=True, **kwargs):
super(SimpleProcess, self).__init__(h5_main, verbose, **kwargs)
self.data = N... | true | true |
1c4591b85ef0cb783c72ba1b6a6beb97dbfb0aa3 | 2,482 | py | Python | pysnmp/CISCO-SCTP-CAPABILITY.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/CISCO-SCTP-CAPABILITY.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/CISCO-SCTP-CAPABILITY.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module CISCO-SCTP-CAPABILITY (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-SCTP-CAPABILITY
# Produced by pysmi-0.3.4 at Mon Apr 29 17:54:50 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (def... | 99.28 | 477 | 0.787671 | ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsIntersection, ValueSizeConstraint, SingleValueConstraint, ConstraintsUnion, ValueRangeConstraint = mibBuilder.impo... | true | true |
1c45922460b3274c214c472b39912156f5a9ae77 | 1,632 | py | Python | game/startMk2.py | Penniling/launchpad-dont-choose-the-wrong | 490e814a531168ae3b4cbbd0db89a9887b5d0bb3 | [
"MIT"
] | null | null | null | game/startMk2.py | Penniling/launchpad-dont-choose-the-wrong | 490e814a531168ae3b4cbbd0db89a9887b5d0bb3 | [
"MIT"
] | null | null | null | game/startMk2.py | Penniling/launchpad-dont-choose-the-wrong | 490e814a531168ae3b4cbbd0db89a9887b5d0bb3 | [
"MIT"
] | null | null | null | import LaunchpadMk2
import atexit
import os
import random
def on_exit():
os.system(f"python {os.getcwd()}/startMk2.py")
class Game:
def __init__(self):
self.n = int(input("Please choose a number of wrong pads: "))
self.lp = LaunchpadMk2.LaunchpadMk2()
self.lp.Reset()
self.lp.... | 26.754098 | 89 | 0.550858 | import LaunchpadMk2
import atexit
import os
import random
def on_exit():
os.system(f"python {os.getcwd()}/startMk2.py")
class Game:
def __init__(self):
self.n = int(input("Please choose a number of wrong pads: "))
self.lp = LaunchpadMk2.LaunchpadMk2()
self.lp.Reset()
self.lp.... | true | true |
1c4592dbfd3957588d06fd935ce4c485dc1377a0 | 7,268 | py | Python | pennylane/interfaces/batch/tensorflow.py | ral9000/pennylane | 0afbd155d044730af546c6d90cef9d01f931632d | [
"Apache-2.0"
] | 712 | 2020-07-29T03:46:52.000Z | 2022-03-27T11:21:51.000Z | pennylane/interfaces/batch/tensorflow.py | ral9000/pennylane | 0afbd155d044730af546c6d90cef9d01f931632d | [
"Apache-2.0"
] | 1,627 | 2020-07-28T13:07:58.000Z | 2022-03-31T21:47:29.000Z | pennylane/interfaces/batch/tensorflow.py | ral9000/pennylane | 0afbd155d044730af546c6d90cef9d01f931632d | [
"Apache-2.0"
] | 249 | 2020-07-29T03:26:18.000Z | 2022-03-31T19:59:48.000Z | # Copyright 2018-2021 Xanadu Quantum Technologies 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 applicabl... | 43.261905 | 100 | 0.569895 |
import numpy as np
import tensorflow as tf
from tensorflow.python.eager import context
import pennylane as qml
def _compute_vjp(dy, jacs):
vjps = []
for d, jac in zip(dy, jacs):
vjp = qml.gradients.compute_vjp(d, jac)
if not context.executing_eagerly():
... | true | true |
1c459309ba1a81398fc095a2ca8f6f6f4053e120 | 990 | py | Python | linkv_sdk/config/bindings/ffi.py | linkv-io/python2-sdk | 45699372ffcf6e3e745d870cfca004fc885ee15f | [
"Apache-2.0"
] | null | null | null | linkv_sdk/config/bindings/ffi.py | linkv-io/python2-sdk | 45699372ffcf6e3e745d870cfca004fc885ee15f | [
"Apache-2.0"
] | null | null | null | linkv_sdk/config/bindings/ffi.py | linkv-io/python2-sdk | 45699372ffcf6e3e745d870cfca004fc885ee15f | [
"Apache-2.0"
] | null | null | null | # -*- coding: UTF-8 -*-
import platform
import os
from requests import get
from tempfile import gettempdir
from ctypes import CDLL
def _platform_file(name):
ext = ''
if platform.uname()[0] == "Linux":
ext = 'so'
elif platform.uname()[0] == "Darwin":
ext = 'dylib'
elif platform.uname(... | 22 | 91 | 0.611111 |
import platform
import os
from requests import get
from tempfile import gettempdir
from ctypes import CDLL
def _platform_file(name):
ext = ''
if platform.uname()[0] == "Linux":
ext = 'so'
elif platform.uname()[0] == "Darwin":
ext = 'dylib'
elif platform.uname()[0] == "Windows":
... | true | true |
1c4595dae899b6160a00fb35d2139755cf007c2b | 2,254 | py | Python | backend/pyrogram/raw/functions/messages/get_attached_stickers.py | appheap/social-media-analyzer | 0f9da098bfb0b4f9eb38e0244aa3a168cf97d51c | [
"Apache-2.0"
] | 5 | 2021-09-11T22:01:15.000Z | 2022-03-16T21:33:42.000Z | backend/pyrogram/raw/functions/messages/get_attached_stickers.py | iamatlasss/social-media-analyzer | 429d1d2bbd8bfce80c50c5f8edda58f87ace668d | [
"Apache-2.0"
] | null | null | null | backend/pyrogram/raw/functions/messages/get_attached_stickers.py | iamatlasss/social-media-analyzer | 429d1d2bbd8bfce80c50c5f8edda58f87ace668d | [
"Apache-2.0"
] | 3 | 2022-01-18T11:06:22.000Z | 2022-02-26T13:39:28.000Z | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 31.305556 | 103 | 0.645519 |
from io import BytesIO
from pyrogram.raw.core.primitives import Int, Long, Int128, Int256, Bool, Bytes, String, Double, Vector
from pyrogram.raw.core import TLObject
from pyrogram import raw
from typing import List, Union, Any
class GetAttachedStickers(TLObject):
__slots__: List[str] = ["media"]
ID = 0x... | true | true |
1c459686e0c6196509dccaf4fcbecf5fdc393fc7 | 41,713 | py | Python | xform/models.py | alisonamerico/Django-XForm | ad2e96455307b57ef3c485a006db478fe4352a36 | [
"MIT"
] | 3 | 2019-07-25T14:46:14.000Z | 2020-12-14T22:43:46.000Z | xform/models.py | alisonamerico/Django-XForm | ad2e96455307b57ef3c485a006db478fe4352a36 | [
"MIT"
] | 4 | 2019-09-04T17:39:04.000Z | 2021-11-05T23:14:58.000Z | xform/models.py | alisonamerico/Django-XForm | ad2e96455307b57ef3c485a006db478fe4352a36 | [
"MIT"
] | 1 | 2021-11-05T23:05:48.000Z | 2021-11-05T23:05:48.000Z | import csv
import json
import mimetypes
import os
import random
import re
import requests
import xlrd
from contextlib import closing
from hashlib import md5
from io import BytesIO
from io import StringIO
from pyxform import SurveyElementBuilder
from pyxform.builder import create_survey_element_from_dict
from pyxfor... | 34.818865 | 96 | 0.601995 | import csv
import json
import mimetypes
import os
import random
import re
import requests
import xlrd
from contextlib import closing
from hashlib import md5
from io import BytesIO
from io import StringIO
from pyxform import SurveyElementBuilder
from pyxform.builder import create_survey_element_from_dict
from pyxfor... | true | true |
1c459720c843885a8386143a876fd1904e17dd73 | 3,345 | py | Python | leaderboard_service/leaderboard_service/settings.py | AVatch/leaderboard-service | 9b70e24866fe862ba5d71dc3404e123303325431 | [
"Apache-2.0"
] | 1 | 2016-02-25T22:50:22.000Z | 2016-02-25T22:50:22.000Z | leaderboard_service/leaderboard_service/settings.py | AVatch/leaderboard-service | 9b70e24866fe862ba5d71dc3404e123303325431 | [
"Apache-2.0"
] | null | null | null | leaderboard_service/leaderboard_service/settings.py | AVatch/leaderboard-service | 9b70e24866fe862ba5d71dc3404e123303325431 | [
"Apache-2.0"
] | null | null | null | """
Django settings for leaderboard_service project.
Generated by 'django-admin startproject' using Django 1.9.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
... | 26.338583 | 91 | 0.704933 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'y(9k(&i#f11*to()nc^qy9nnokkwg^d(7g1zk9^p8%4!@cz)td'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
CORE_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
... | true | true |
1c459747e39517110330c01929492f60ac06c5aa | 503 | py | Python | vqseg/wordseg_algorithms.py | janinerugayan/VectorQuantizedCPC | b4e9fe6aeebca3b792ab604a770e8c3e289a46a1 | [
"MIT"
] | null | null | null | vqseg/wordseg_algorithms.py | janinerugayan/VectorQuantizedCPC | b4e9fe6aeebca3b792ab604a770e8c3e289a46a1 | [
"MIT"
] | null | null | null | vqseg/wordseg_algorithms.py | janinerugayan/VectorQuantizedCPC | b4e9fe6aeebca3b792ab604a770e8c3e289a46a1 | [
"MIT"
] | null | null | null | """
Word segmentation algorithms.
Author: Herman Kamper
Contact: kamperh@gmail.com
Date: 2020
"""
from wordseg.algos import tp, puddle, dpseg, baseline, dibs, ag
import wordseg.algos
def ag(utterance_list, **kwargs):
return list(wordseg.algos.ag.segment(utterance_list, **kwargs))
def tp(utterance_list, **kwar... | 21.869565 | 70 | 0.745527 |
from wordseg.algos import tp, puddle, dpseg, baseline, dibs, ag
import wordseg.algos
def ag(utterance_list, **kwargs):
return list(wordseg.algos.ag.segment(utterance_list, **kwargs))
def tp(utterance_list, **kwargs):
return list(wordseg.algos.tp.segment(utterance_list, **kwargs))
def dpseg(utterance_list... | true | true |
1c45984c4c6ee38da52bda0420ddc998d5a7f5a2 | 2,024 | py | Python | tests/test_git.py | igorbernstein2/synthtool | 6b33cffb4301c3f05cc6976fff0022d98b47772f | [
"Apache-2.0"
] | null | null | null | tests/test_git.py | igorbernstein2/synthtool | 6b33cffb4301c3f05cc6976fff0022d98b47772f | [
"Apache-2.0"
] | null | null | null | tests/test_git.py | igorbernstein2/synthtool | 6b33cffb4301c3f05cc6976fff0022d98b47772f | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 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, ... | 28.914286 | 88 | 0.6917 |
from unittest import mock
import pytest
from synthtool.sources import git
def test_make_repo_clone_url(monkeypatch):
monkeypatch.setattr(git, "USE_SSH", True)
assert (
git.make_repo_clone_url("theacodes/nox") == "git@github.com:theacodes/nox.git"
)
def test_make_repo_clone_url_https(monkeypat... | true | true |
1c45988afdd14740a571c6b781a72451a6d25636 | 3,162 | py | Python | dispel4py/seismo/obspy_stream.py | AndreiFrunze/wrangler | 076a07de00fc966dcf18ca6b6a6e804be5245ed9 | [
"Apache-2.0"
] | 2 | 2017-09-07T04:33:18.000Z | 2019-01-07T13:32:15.000Z | dispel4py/seismo/obspy_stream.py | AndreiFrunze/wrangler | 076a07de00fc966dcf18ca6b6a6e804be5245ed9 | [
"Apache-2.0"
] | 2 | 2016-10-06T13:07:05.000Z | 2017-12-20T09:47:08.000Z | dispel4py/seismo/obspy_stream.py | AndreiFrunze/wrangler | 076a07de00fc966dcf18ca6b6a6e804be5245ed9 | [
"Apache-2.0"
] | 5 | 2016-09-01T08:38:20.000Z | 2018-08-28T12:08:39.000Z | from dispel4py.seismo.seismo import SeismoPE
import traceback
INPUT_NAME = 'input'
OUTPUT_NAME = 'output'
class ObspyStreamPE(SeismoPE):
'''
A SeismoPE that calls a function to process an input stream.
'''
def __init__(self):
SeismoPE.__init__(self)
def setCompute(self, compute_f... | 34.747253 | 141 | 0.624921 | from dispel4py.seismo.seismo import SeismoPE
import traceback
INPUT_NAME = 'input'
OUTPUT_NAME = 'output'
class ObspyStreamPE(SeismoPE):
def __init__(self):
SeismoPE.__init__(self)
def setCompute(self, compute_fn, params={}):
self.compute_fn = compute_fn, dict(params)
de... | true | true |
1c4598e6f314bfee7c1a31680ad93afaa47b3067 | 4,132 | py | Python | plugins/samanage/komand_samanage/actions/list_users/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 46 | 2019-06-05T20:47:58.000Z | 2022-03-29T10:18:01.000Z | plugins/samanage/komand_samanage/actions/list_users/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 386 | 2019-06-07T20:20:39.000Z | 2022-03-30T17:35:01.000Z | plugins/samanage/komand_samanage/actions/list_users/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 43 | 2019-07-09T14:13:58.000Z | 2022-03-28T12:04:46.000Z | import komand
from .schema import ListUsersInput, ListUsersOutput
# Custom imports below
class ListUsers(komand.Action):
def __init__(self):
super(self.__class__, self).__init__(
name="list_users",
description="List all users",
input=ListUsersInput(),
outpu... | 41.32 | 100 | 0.393272 | import komand
from .schema import ListUsersInput, ListUsersOutput
class ListUsers(komand.Action):
def __init__(self):
super(self.__class__, self).__init__(
name="list_users",
description="List all users",
input=ListUsersInput(),
output=ListUsersOutput(),
... | true | true |
1c4598f31962fb4914c01183dfd2b5367f20731a | 136 | py | Python | al_phonebook/types.py | vtrvtr/al_phonebook | 7bcdb7fa0323c873c523036da99b4b1616c0e00e | [
"MIT"
] | null | null | null | al_phonebook/types.py | vtrvtr/al_phonebook | 7bcdb7fa0323c873c523036da99b4b1616c0e00e | [
"MIT"
] | 1 | 2022-01-17T14:45:50.000Z | 2022-01-17T14:45:51.000Z | al_phonebook/types.py | vtrvtr/al_phonebook | 7bcdb7fa0323c873c523036da99b4b1616c0e00e | [
"MIT"
] | null | null | null | from typing import Any, Union
import os
DictItem = dict[str, Any]
OptionalDictItem = DictItem | None
PathLike = Union[os.PathLike, str] | 22.666667 | 34 | 0.764706 | from typing import Any, Union
import os
DictItem = dict[str, Any]
OptionalDictItem = DictItem | None
PathLike = Union[os.PathLike, str] | true | true |
1c459b1eb973ce00d988425faa2a536d4bd861cd | 744 | py | Python | dm_control/composer/constants.py | h8907283/dm_control | fe4449606742a7b8bec81930790b98244cddc538 | [
"Apache-2.0"
] | 2,863 | 2018-01-03T01:38:52.000Z | 2022-03-30T09:49:50.000Z | dm_control/composer/constants.py | krakhit/dm_control | 4e1a35595124742015ae0c7a829e099a5aa100f5 | [
"Apache-2.0"
] | 266 | 2018-01-03T16:00:04.000Z | 2022-03-26T15:45:48.000Z | dm_control/composer/constants.py | krakhit/dm_control | 4e1a35595124742015ae0c7a829e099a5aa100f5 | [
"Apache-2.0"
] | 580 | 2018-01-03T03:17:27.000Z | 2022-03-31T19:29:32.000Z | # Copyright 2018 The dm_control Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 37.2 | 78 | 0.681452 |
SENSOR_SITES_GROUP = 4
| true | true |
1c459b5a3be59498565c981523bb698670abd0ef | 255 | py | Python | manage.py | justsostephen/track | b1749f7db664d76fab0c501c23f0d0705cc95fce | [
"MIT"
] | null | null | null | manage.py | justsostephen/track | b1749f7db664d76fab0c501c23f0d0705cc95fce | [
"MIT"
] | null | null | null | manage.py | justsostephen/track | b1749f7db664d76fab0c501c23f0d0705cc95fce | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "stockcontrol.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| 23.181818 | 76 | 0.776471 | import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "stockcontrol.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| true | true |
1c459b9e9ba258120e841df624eb7641c3121e90 | 4,297 | py | Python | aiograph/utils/html.py | fakegit/aiograph | a00aacebb04c1e743055ba524b978a06027e31ed | [
"MIT"
] | 45 | 2018-05-05T12:31:43.000Z | 2022-03-23T11:20:03.000Z | aiographfix/utils/html.py | Yyonging/aiograph | 78d291f9e1157720c949e336a9aa2711ad707285 | [
"MIT"
] | 6 | 2019-03-04T11:23:49.000Z | 2022-03-30T11:25:46.000Z | aiographfix/utils/html.py | Yyonging/aiograph | 78d291f9e1157720c949e336a9aa2711ad707285 | [
"MIT"
] | 16 | 2019-02-22T19:10:19.000Z | 2021-09-15T22:12:55.000Z | from html import escape
from html.entities import name2codepoint
from html.parser import HTMLParser
from typing import List, Union
import attr
from ..types import NodeElement
ALLOWED_TAGS = [
'a', 'aside', 'b', 'blockquote', 'br', 'code', 'em', 'figcaption', 'figure',
'h3', 'h4', 'hr', 'i', 'iframe', 'img', ... | 25.577381 | 89 | 0.594601 | from html import escape
from html.entities import name2codepoint
from html.parser import HTMLParser
from typing import List, Union
import attr
from ..types import NodeElement
ALLOWED_TAGS = [
'a', 'aside', 'b', 'blockquote', 'br', 'code', 'em', 'figcaption', 'figure',
'h3', 'h4', 'hr', 'i', 'iframe', 'img', ... | true | true |
1c459cb9695ce51149e5eae19d31908ca788d5d5 | 6,562 | py | Python | seq2seq/tasks/decode_text.py | chunfengh/seq2seq | cc6e1a15f523c2ead809d48b1f6eebbeb94e3f0b | [
"Apache-2.0"
] | null | null | null | seq2seq/tasks/decode_text.py | chunfengh/seq2seq | cc6e1a15f523c2ead809d48b1f6eebbeb94e3f0b | [
"Apache-2.0"
] | null | null | null | seq2seq/tasks/decode_text.py | chunfengh/seq2seq | cc6e1a15f523c2ead809d48b1f6eebbeb94e3f0b | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 34.536842 | 77 | 0.704358 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import functools
from pydoc import locate
import numpy as np
import tensorflow as tf
from tensorflow import gfile
from seq2seq.tasks.inference_task import InferenceTa... | true | true |
1c459cbafa7959829a0eb6b44a0612c737b7663e | 782 | py | Python | jorldy/config/m_dqn/cartpole.py | Kyushik/JORLDY | 6a24a2195e5e87ade157ee53f631af2221f0a188 | [
"Apache-2.0"
] | 300 | 2021-11-03T07:06:34.000Z | 2022-03-24T02:23:56.000Z | jorldy/config/m_dqn/cartpole.py | Kyushik/JORLDY | 6a24a2195e5e87ade157ee53f631af2221f0a188 | [
"Apache-2.0"
] | 37 | 2021-11-04T04:31:07.000Z | 2022-03-30T01:40:49.000Z | jorldy/config/m_dqn/cartpole.py | Kyushik/JORLDY | 6a24a2195e5e87ade157ee53f631af2221f0a188 | [
"Apache-2.0"
] | 45 | 2021-11-03T08:05:56.000Z | 2022-03-24T08:35:05.000Z | ### Munchausen DQN CartPole Config ###
env = {
"name": "cartpole",
"action_type": "discrete",
"render": False,
}
agent = {
"name": "m_dqn",
"network": "discrete_q_network",
"gamma": 0.99,
"epsilon_init": 1.0,
"epsilon_min": 0.01,
"explore_ratio": 0.2,
"buffer_size": 50000,
... | 18.186047 | 38 | 0.553708 |
env = {
"name": "cartpole",
"action_type": "discrete",
"render": False,
}
agent = {
"name": "m_dqn",
"network": "discrete_q_network",
"gamma": 0.99,
"epsilon_init": 1.0,
"epsilon_min": 0.01,
"explore_ratio": 0.2,
"buffer_size": 50000,
"batch_size": 32,
"start_train_step... | true | true |
1c459d4fd01576a1d2a19cab06b15dcefae8bd24 | 336 | py | Python | setup.py | ippee/py_init | 0d997ec5ddaee95ef71562f14542e74f40e88646 | [
"CC0-1.0"
] | null | null | null | setup.py | ippee/py_init | 0d997ec5ddaee95ef71562f14542e74f40e88646 | [
"CC0-1.0"
] | null | null | null | setup.py | ippee/py_init | 0d997ec5ddaee95ef71562f14542e74f40e88646 | [
"CC0-1.0"
] | null | null | null | # coding: UTF-8
from setuptools import setup
install_requires = []
packages = []
setup(
name='',
version='0.1.0',
license='',
description='',
author='you',
author_email='',
url='',
packages=packages,
install_requires=install_requires,
setup_requires=['pytest-runner'],
tests_require=['pytest', ... | 15.272727 | 40 | 0.660714 |
from setuptools import setup
install_requires = []
packages = []
setup(
name='',
version='0.1.0',
license='',
description='',
author='you',
author_email='',
url='',
packages=packages,
install_requires=install_requires,
setup_requires=['pytest-runner'],
tests_require=['pytest', "pytest-cov"]
)
| true | true |
1c459d5ed4db13f7e8ef93008315c97790ecb9b7 | 5,618 | py | Python | commitizen/commands/init.py | christian-hawk/commitizen | 5c0dd546866f2bd2ab6b4ecd27035441b7b4692b | [
"MIT"
] | null | null | null | commitizen/commands/init.py | christian-hawk/commitizen | 5c0dd546866f2bd2ab6b4ecd27035441b7b4692b | [
"MIT"
] | null | null | null | commitizen/commands/init.py | christian-hawk/commitizen | 5c0dd546866f2bd2ab6b4ecd27035441b7b4692b | [
"MIT"
] | null | null | null | import os
import questionary
import yaml
from packaging.version import Version
from commitizen import cmd, factory, out
from commitizen.__version__ import __version__
from commitizen.config import BaseConfig, TomlConfig
from commitizen.cz import registry
from commitizen.defaults import config_files
from commitizen.ex... | 36.245161 | 92 | 0.58455 | import os
import questionary
import yaml
from packaging.version import Version
from commitizen import cmd, factory, out
from commitizen.__version__ import __version__
from commitizen.config import BaseConfig, TomlConfig
from commitizen.cz import registry
from commitizen.defaults import config_files
from commitizen.ex... | true | true |
1c459db6c393559c2cd965467577c6bdcb250d28 | 1,090 | py | Python | hpc-historias-clinicas/fojas_quirurgicas/migrations/0005_auto_20150505_0101.py | btenaglia/hpc-historias-clinicas | 649d8660381381b1c591667760c122d73071d5ec | [
"BSD-3-Clause"
] | null | null | null | hpc-historias-clinicas/fojas_quirurgicas/migrations/0005_auto_20150505_0101.py | btenaglia/hpc-historias-clinicas | 649d8660381381b1c591667760c122d73071d5ec | [
"BSD-3-Clause"
] | null | null | null | hpc-historias-clinicas/fojas_quirurgicas/migrations/0005_auto_20150505_0101.py | btenaglia/hpc-historias-clinicas | 649d8660381381b1c591667760c122d73071d5ec | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
class Migration(migrations.Migration):
dependencies = [
('fojas_quirurgicas', '0004_auto_20150504_2120'),
]
operations = [
migrations.AlterField(
model_na... | 32.058824 | 137 | 0.612844 | from __future__ import unicode_literals
from django.db import models, migrations
import datetime
class Migration(migrations.Migration):
dependencies = [
('fojas_quirurgicas', '0004_auto_20150504_2120'),
]
operations = [
migrations.AlterField(
model_name='fojasquirurgicas',
... | true | true |
1c459dbc87ad166cc650a1298f694761c0c2d4ae | 14,998 | py | Python | utils.py | RachithP/rpg_public_dronet | 244b44c6d321e77cfe326071f8413ea1f7e438cb | [
"MIT"
] | null | null | null | utils.py | RachithP/rpg_public_dronet | 244b44c6d321e77cfe326071f8413ea1f7e438cb | [
"MIT"
] | null | null | null | utils.py | RachithP/rpg_public_dronet | 244b44c6d321e77cfe326071f8413ea1f7e438cb | [
"MIT"
] | 1 | 2019-12-10T02:48:20.000Z | 2019-12-10T02:48:20.000Z | import re
import os
import numpy as np
import tensorflow as tf
import json
import time
from keras import backend as K
from keras.preprocessing.image import Iterator
from keras.preprocessing.image import ImageDataGenerator
from keras.utils.generic_utils import Progbar
from keras.models import model_from_json
import img... | 35.206573 | 96 | 0.595146 | import re
import os
import numpy as np
import tensorflow as tf
import json
import time
from keras import backend as K
from keras.preprocessing.image import Iterator
from keras.preprocessing.image import ImageDataGenerator
from keras.utils.generic_utils import Progbar
from keras.models import model_from_json
import img... | true | true |
1c459f2b6ff309defaa99622a9e67444b25d1a67 | 309 | py | Python | testing_8709/main.py | akvrdata/testing_8709 | b9987a6a14d582a062f08d9de13f9b46f38989b1 | [
"MIT"
] | null | null | null | testing_8709/main.py | akvrdata/testing_8709 | b9987a6a14d582a062f08d9de13f9b46f38989b1 | [
"MIT"
] | null | null | null | testing_8709/main.py | akvrdata/testing_8709 | b9987a6a14d582a062f08d9de13f9b46f38989b1 | [
"MIT"
] | null | null | null | import sys
import click
@click.command()
@click.option('--count',default=1,help='Number of prints required')
@click.option('--name',help='name to print')
def hello(count,name):
'''Click Cli testing'''
for x in range(count):
click.echo('Hello %s' %name)
if __name__ == '__main__':
hello() | 23.769231 | 67 | 0.653722 | import sys
import click
@click.command()
@click.option('--count',default=1,help='Number of prints required')
@click.option('--name',help='name to print')
def hello(count,name):
for x in range(count):
click.echo('Hello %s' %name)
if __name__ == '__main__':
hello() | true | true |
1c459f2e63f5d6cbc44f6b3304bb888e1f9f90a0 | 3,711 | py | Python | bauh/api/http.py | Flash1232/bauh | 6f65556c05ae272c1dbbd557c7f80a606658eb56 | [
"Zlib"
] | 507 | 2019-08-12T16:15:55.000Z | 2022-03-28T15:49:39.000Z | bauh/api/http.py | Flash1232/bauh | 6f65556c05ae272c1dbbd557c7f80a606658eb56 | [
"Zlib"
] | 176 | 2019-08-14T02:35:21.000Z | 2022-03-31T21:43:56.000Z | bauh/api/http.py | Flash1232/bauh | 6f65556c05ae272c1dbbd557c7f80a606658eb56 | [
"Zlib"
] | 57 | 2019-09-02T04:09:22.000Z | 2022-03-21T21:37:16.000Z | import logging
import time
import traceback
from typing import Optional
import requests
import yaml
from bauh.commons import system
class HttpClient:
def __init__(self, logger: logging.Logger, max_attempts: int = 2, timeout: int = 30, sleep: float = 0.5):
self.max_attempts = max_attempts
self.s... | 35.009434 | 207 | 0.565346 | import logging
import time
import traceback
from typing import Optional
import requests
import yaml
from bauh.commons import system
class HttpClient:
def __init__(self, logger: logging.Logger, max_attempts: int = 2, timeout: int = 30, sleep: float = 0.5):
self.max_attempts = max_attempts
self.s... | true | true |
1c459fbfb4d5f376b961ba213a2581525628f906 | 398 | py | Python | accounts/migrations/0002_account_points.py | ebar0n/palermo-coin | 63dc14fce31fbeae50ec7ebf5ea97efbb1ec18fd | [
"MIT"
] | null | null | null | accounts/migrations/0002_account_points.py | ebar0n/palermo-coin | 63dc14fce31fbeae50ec7ebf5ea97efbb1ec18fd | [
"MIT"
] | 15 | 2019-05-13T23:40:06.000Z | 2022-03-11T23:39:57.000Z | accounts/migrations/0002_account_points.py | ebar0n/leviatan-backend | 63dc14fce31fbeae50ec7ebf5ea97efbb1ec18fd | [
"MIT"
] | null | null | null | # Generated by Django 2.1.7 on 2019-03-07 07:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='account',
name='points',
f... | 20.947368 | 73 | 0.603015 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='account',
name='points',
field=models.PositiveIntegerField(default=0, edit... | true | true |
1c45a0ca7dda5396a87bdbca7a0a71105cce95b6 | 1,359 | py | Python | python2/timeout.py | SLongofono/Python-Misc | c6c2735f65b7f06e31996140c2921315b1a6cf9e | [
"MIT"
] | 2 | 2017-07-24T17:46:13.000Z | 2017-12-09T16:00:40.000Z | python2/timeout.py | SLongofono/Python-Misc | c6c2735f65b7f06e31996140c2921315b1a6cf9e | [
"MIT"
] | null | null | null | python2/timeout.py | SLongofono/Python-Misc | c6c2735f65b7f06e31996140c2921315b1a6cf9e | [
"MIT"
] | 1 | 2018-09-18T15:18:47.000Z | 2018-09-18T15:18:47.000Z | def timed_func(f, args=(), kwargs=None, timeout=30, default=None, errormsg="Timeout error"):
# Since kwargs are mutable, assume they don't exist via optional arguments. If they do in fact exist,
# they will exist in this context and be assigned. Otherwise, set to an empty dict and proceed.
kwargs = kwargs or {}
i... | 28.3125 | 103 | 0.734364 | def timed_func(f, args=(), kwargs=None, timeout=30, default=None, errormsg="Timeout error"):
# they will exist in this context and be assigned. Otherwise, set to an empty dict and proceed.
kwargs = kwargs or {}
import signal
class TimeoutError(Exception):
pass
def timeout_handler(signum, frame):
raise Timeo... | true | true |
1c45a0f0a16e4c957d53072ae53309de03cc22ef | 6,090 | py | Python | docs/conf.py | open-datastudio/datastudio | 5055579adf969ad6d7491454b30ab2fedbaaa067 | [
"MIT"
] | 10 | 2020-06-23T13:45:44.000Z | 2021-11-04T13:31:43.000Z | docs/conf.py | open-datastudio/datastudio | 5055579adf969ad6d7491454b30ab2fedbaaa067 | [
"MIT"
] | 1 | 2020-06-23T23:15:10.000Z | 2020-08-11T04:41:25.000Z | docs/conf.py | open-datastudio/datastudio | 5055579adf969ad6d7491454b30ab2fedbaaa067 | [
"MIT"
] | 2 | 2021-11-20T21:24:36.000Z | 2022-01-05T03:35:32.000Z | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... | 31.71875 | 93 | 0.663054 |
project = u'Open Data Studio'
copyright = u'Open Data Studio Authors'
author = u'Open Data Studio Authors'
version = u''
release = u''
extensions = [
'sphinx.ext.autosectionlabel',
'aafigure.sphinxext'
]
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
language = None
exclu... | true | true |
1c45a10a9ddde743dce9b343e4d18f568bb05e72 | 3,531 | py | Python | python/paddle/fluid/tests/unittests/dist_mnist.py | hshen14/Paddle | 0962be9c800d29e0804fc3135163bdfba1564c61 | [
"Apache-2.0"
] | 2 | 2019-04-03T05:36:17.000Z | 2020-04-29T03:38:54.000Z | python/paddle/fluid/tests/unittests/dist_mnist.py | hshen14/Paddle | 0962be9c800d29e0804fc3135163bdfba1564c61 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/dist_mnist.py | hshen14/Paddle | 0962be9c800d29e0804fc3135163bdfba1564c61 | [
"Apache-2.0"
] | 3 | 2019-01-07T06:50:29.000Z | 2019-03-13T08:48:23.000Z | # Copyright (c) 2018 PaddlePaddle 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 app... | 32.394495 | 89 | 0.687624 |
from __future__ import print_function
import numpy as np
import argparse
import time
import math
import paddle
import paddle.fluid as fluid
import paddle.fluid.profiler as profiler
from paddle.fluid import core
import unittest
from multiprocessing import Process
import os
import signal
from functools import reduce
f... | true | true |
1c45a12fb0bf22d70b2259e645866d62d1c2fa9f | 5,240 | py | Python | tests/test_cli.py | steffenschumacher/NIPAP | 200ec08ce02ba9f782b276510bc7bb23b20d7570 | [
"MIT"
] | 1 | 2018-12-07T15:59:27.000Z | 2018-12-07T15:59:27.000Z | tests/test_cli.py | steffenschumacher/NIPAP | 200ec08ce02ba9f782b276510bc7bb23b20d7570 | [
"MIT"
] | 1 | 2021-07-24T14:44:10.000Z | 2021-07-24T14:44:10.000Z | tests/test_cli.py | steffenschumacher/NIPAP | 200ec08ce02ba9f782b276510bc7bb23b20d7570 | [
"MIT"
] | 1 | 2020-05-27T15:28:03.000Z | 2020-05-27T15:28:03.000Z | #!/usr/bin/env python
# vim: et :
import logging
import unittest
import sys
sys.path.append('../nipap/')
from nipap.backend import Nipap
from nipap.authlib import SqliteAuth
from nipap.nipapconfig import NipapConfig
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
log_format = "%(levelname)-8s %(message)s... | 29.438202 | 140 | 0.55687 |
import logging
import unittest
import sys
sys.path.append('../nipap/')
from nipap.backend import Nipap
from nipap.authlib import SqliteAuth
from nipap.nipapconfig import NipapConfig
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
log_format = "%(levelname)-8s %(message)s"
import xmlrpclib
server_url = ... | true | true |
1c45a18a21fd6fbd0b288b2271b398a0ed9f080d | 12,540 | py | Python | napari/_qt/widgets/qt_viewer_dock_widget.py | Mishrasubha/napari | c4d1038fc3ed30dc228949cbdedf12826ec2efc2 | [
"BSD-3-Clause"
] | null | null | null | napari/_qt/widgets/qt_viewer_dock_widget.py | Mishrasubha/napari | c4d1038fc3ed30dc228949cbdedf12826ec2efc2 | [
"BSD-3-Clause"
] | 3 | 2020-11-14T08:35:18.000Z | 2021-07-26T10:06:32.000Z | napari/_qt/widgets/qt_viewer_dock_widget.py | Mishrasubha/napari | c4d1038fc3ed30dc228949cbdedf12826ec2efc2 | [
"BSD-3-Clause"
] | null | null | null | import warnings
from functools import reduce
from itertools import count
from operator import ior
from typing import List, Optional
from qtpy.QtCore import Qt
from qtpy.QtWidgets import (
QDockWidget,
QFrame,
QHBoxLayout,
QLabel,
QPushButton,
QSizePolicy,
QVBoxLayout,
QWidget,
)
from .... | 35.12605 | 213 | 0.596332 | import warnings
from functools import reduce
from itertools import count
from operator import ior
from typing import List, Optional
from qtpy.QtCore import Qt
from qtpy.QtWidgets import (
QDockWidget,
QFrame,
QHBoxLayout,
QLabel,
QPushButton,
QSizePolicy,
QVBoxLayout,
QWidget,
)
from .... | true | true |
1c45a1a090a13d50476e4eb2e61b77dfeabe3a7e | 22,311 | py | Python | test/functional/importmulti.py | DeepPool/test | c6d99f019667ea4bf51139adff2a98d46c0015ed | [
"MIT"
] | null | null | null | test/functional/importmulti.py | DeepPool/test | c6d99f019667ea4bf51139adff2a98d46c0015ed | [
"MIT"
] | null | null | null | test/functional/importmulti.py | DeepPool/test | c6d99f019667ea4bf51139adff2a98d46c0015ed | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the importmulti RPC."""
from test_framework.test_framework import DietBitcoinTestFramework
from te... | 48.084052 | 137 | 0.631841 | from test_framework.test_framework import DietBitcoinTestFramework
from test_framework.util import *
class ImportMultiTest (DietBitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 2
self.setup_clean_chain = True
def setup_network(self):
self.setup_nodes()
def run_te... | true | true |
1c45a2de98069c080d2cca90e61524a21453a51c | 1,957 | py | Python | examples/get-started/play_mp3/example_test.py | kigor302/esp-adf | 7feaf6c4b23d2a06850f96c302eebb814516239c | [
"MIT-0"
] | 12 | 2021-04-15T14:15:27.000Z | 2022-01-17T03:40:35.000Z | examples/get-started/play_mp3/example_test.py | Tianxiaomo/esp-adf | fae539c3035b2c041f49c5b01cdc4c99038595b0 | [
"MIT-0"
] | 2 | 2021-04-03T22:00:11.000Z | 2021-10-03T18:27:39.000Z | examples/get-started/play_mp3/example_test.py | Tianxiaomo/esp-adf | fae539c3035b2c041f49c5b01cdc4c99038595b0 | [
"MIT-0"
] | 4 | 2021-06-22T10:08:07.000Z | 2021-11-17T23:21:04.000Z | import os
import sys
# this is a test case written with tiny-test-fw.
# to run test cases outside tiny-test-fw,
# we need to set environment variable `TEST_FW_PATH`,
# then get and insert `TEST_FW_PATH` to sys path before import FW module
test_fw_path = os.getenv("TEST_FW_PATH")
if test_fw_path and test_fw_path not i... | 39.938776 | 114 | 0.748084 | import os
import sys
test_fw_path = os.getenv("TEST_FW_PATH")
if test_fw_path and test_fw_path not in sys.path:
sys.path.insert(0, test_fw_path)
auto_test_path = os.getenv("AUTO_TEST_PATH")
if auto_test_path and auto_test_path not in sys.path:
sys.path.insert(0, auto_test_path)
import TinyFW
import NormalPr... | true | true |
1c45a4aba3bdd23727ad80971a816dcd80684560 | 2,390 | py | Python | lib/util.py | ks-tec/Hydroponic | d9347f82698841d85c0a45908e8671b36c50ffce | [
"MIT"
] | 1 | 2021-05-27T13:32:45.000Z | 2021-05-27T13:32:45.000Z | lib/util.py | ks-tec/Hydroponic | d9347f82698841d85c0a45908e8671b36c50ffce | [
"MIT"
] | null | null | null | lib/util.py | ks-tec/Hydroponic | d9347f82698841d85c0a45908e8671b36c50ffce | [
"MIT"
] | null | null | null | # MicroPython utility methods.
#
# Copyright (c) 2020 ks-tec
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the "Software"),
# to dealin the Software without restriction, including without limitation
# the rights to use, copy, modi... | 35.147059 | 82 | 0.684519 |
def strtobool(value):
if type(value) is not str and value not in [0, 1]:
raise TypeError("The type of parameter value must be string.")
ret_value = None
if value.lower() in ["false", "f", "no", "n", "off", "0"] or value == 0:
ret_value = False
elif value.lower() in ["true", "t", "yes", "y", "on", "1"... | true | true |
1c45a56482a78277a224da1cf5efdb87161f30b9 | 626 | py | Python | manage.py | agamgn/django-Tourism | ee8fae54981d135cbd7ddaf9131eb77ea7b2fb8a | [
"MIT"
] | 9 | 2019-06-30T06:34:22.000Z | 2021-11-09T17:21:16.000Z | manage.py | agamgn/django-Tourism | ee8fae54981d135cbd7ddaf9131eb77ea7b2fb8a | [
"MIT"
] | 14 | 2019-12-22T02:04:18.000Z | 2022-03-11T23:44:38.000Z | manage.py | agamgn/django-Tourism | ee8fae54981d135cbd7ddaf9131eb77ea7b2fb8a | [
"MIT"
] | 3 | 2019-06-30T06:35:57.000Z | 2019-12-18T03:42:43.000Z | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'treval.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportE... | 28.454545 | 73 | 0.682109 | import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'treval.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
1c45a58e90e653de1bb431003c78566d25a7d67b | 57,074 | py | Python | improver/ensemble_copula_coupling/ensemble_copula_coupling.py | VictoriaLouiseS/improver | 86470bff973e21fbd5f24e26047871ad3bc2f3db | [
"BSD-3-Clause"
] | null | null | null | improver/ensemble_copula_coupling/ensemble_copula_coupling.py | VictoriaLouiseS/improver | 86470bff973e21fbd5f24e26047871ad3bc2f3db | [
"BSD-3-Clause"
] | 3 | 2020-04-25T12:55:42.000Z | 2020-07-23T11:50:46.000Z | improver/ensemble_copula_coupling/ensemble_copula_coupling.py | Kat-90/improver | a5c31be3430df429ae38e7c16e267fcbc2af1858 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2020 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... | 42.816204 | 102 | 0.644286 | import warnings
import iris
import numpy as np
from iris.exceptions import CoordinateNotFoundError, InvalidCubeError
from scipy import stats
from improver import BasePlugin
from improver.calibration.utilities import convert_cube_data_to_2d
from improver.ensemble_copula_coupling.utilities import (
choose_set_of_pe... | true | true |
1c45a614492dc6ca48e3d950527282f5ff9aa377 | 784 | py | Python | examples/dagster_examples/intro_tutorial/config.py | bambielli-flex/dagster | 30b75ba7c62fc536bc827f177c1dc6ba20f5ae20 | [
"Apache-2.0"
] | null | null | null | examples/dagster_examples/intro_tutorial/config.py | bambielli-flex/dagster | 30b75ba7c62fc536bc827f177c1dc6ba20f5ae20 | [
"Apache-2.0"
] | null | null | null | examples/dagster_examples/intro_tutorial/config.py | bambielli-flex/dagster | 30b75ba7c62fc536bc827f177c1dc6ba20f5ae20 | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
# py27 compat
from dagster import Field, PipelineDefinition, execute_pipeline, solid, types
@solid(config_field=Field(types.String, is_optional=True, default_value='en-us'))
def configurable_hello(context):
if len(context.solid_config) >= 3 and context.solid_config[:3] == 'haw':
return ... | 31.36 | 98 | 0.714286 |
from dagster import Field, PipelineDefinition, execute_pipeline, solid, types
@solid(config_field=Field(types.String, is_optional=True, default_value='en-us'))
def configurable_hello(context):
if len(context.solid_config) >= 3 and context.solid_config[:3] == 'haw':
return 'Aloha honua!'
elif len(cont... | true | true |
1c45a68d0192fabe44b1195622b98bb7d5868d24 | 3,238 | py | Python | kaplot/astro/wcsgrid.py | maartenbreddels/kaplot | 305026209f8026094d54373e14541f4f039501d5 | [
"MIT"
] | null | null | null | kaplot/astro/wcsgrid.py | maartenbreddels/kaplot | 305026209f8026094d54373e14541f4f039501d5 | [
"MIT"
] | null | null | null | kaplot/astro/wcsgrid.py | maartenbreddels/kaplot | 305026209f8026094d54373e14541f4f039501d5 | [
"MIT"
] | null | null | null | from kaplot.objects import PlotObject
import numarray
import kaplot
import kaplot.context
import kaplot.vector
class WcsGrid(PlotObject):
def __init__(self, xticks, yticks, projection, longitudeoffset, lock=True, context=None, **kwargs):
PlotObject.__init__(self, lock=False, context=kaplot.context.mergeDicts(contex... | 30.261682 | 100 | 0.647931 | from kaplot.objects import PlotObject
import numarray
import kaplot
import kaplot.context
import kaplot.vector
class WcsGrid(PlotObject):
def __init__(self, xticks, yticks, projection, longitudeoffset, lock=True, context=None, **kwargs):
PlotObject.__init__(self, lock=False, context=kaplot.context.mergeDicts(contex... | true | true |
1c45a7a78535500c62f6eb5fd46da6f909d578fb | 1,034 | py | Python | manage.py | manuelen12/test_sale | 1d199fcfca8361edf704e0bb138a07e7d924f327 | [
"MIT"
] | null | null | null | manage.py | manuelen12/test_sale | 1d199fcfca8361edf704e0bb138a07e7d924f327 | [
"MIT"
] | null | null | null | manage.py | manuelen12/test_sale | 1d199fcfca8361edf704e0bb138a07e7d924f327 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings.local')
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure tha... | 34.466667 | 77 | 0.658607 | import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings.local')
try:
from django.core.management import execute_from_command_line
except ImportError:
try:
import django except ImportError:... | true | true |
1c45a7b3b9bd4e9eca083311a86129a50d7c738e | 189 | py | Python | tests/web_platform/CSS2/normal_flow/test_block_in_inline_insert_014_nosplit_ref.py | fletchgraham/colosseum | 77be4896ee52b8f5956a3d77b5f2ccd2c8608e8f | [
"BSD-3-Clause"
] | null | null | null | tests/web_platform/CSS2/normal_flow/test_block_in_inline_insert_014_nosplit_ref.py | fletchgraham/colosseum | 77be4896ee52b8f5956a3d77b5f2ccd2c8608e8f | [
"BSD-3-Clause"
] | null | null | null | tests/web_platform/CSS2/normal_flow/test_block_in_inline_insert_014_nosplit_ref.py | fletchgraham/colosseum | 77be4896ee52b8f5956a3d77b5f2ccd2c8608e8f | [
"BSD-3-Clause"
] | 1 | 2020-01-16T01:56:41.000Z | 2020-01-16T01:56:41.000Z | from tests.utils import W3CTestCase
class TestBlockInInlineInsert014NosplitRef(W3CTestCase):
vars().update(W3CTestCase.find_tests(__file__, 'block-in-inline-insert-014-nosplit-ref'))
| 31.5 | 93 | 0.814815 | from tests.utils import W3CTestCase
class TestBlockInInlineInsert014NosplitRef(W3CTestCase):
vars().update(W3CTestCase.find_tests(__file__, 'block-in-inline-insert-014-nosplit-ref'))
| true | true |
1c45a859a5271dffa80a1d5cc1763cd482c9913a | 2,912 | py | Python | test/integration_tests/test_roles.py | poldracklab/bids-core | b87a1ef2d3e1c5a79a98c0f0ba82b1b2634bce0e | [
"MIT"
] | 1 | 2016-03-09T01:24:02.000Z | 2016-03-09T01:24:02.000Z | test/integration_tests/test_roles.py | poldracklab/bids-core | b87a1ef2d3e1c5a79a98c0f0ba82b1b2634bce0e | [
"MIT"
] | 15 | 2016-02-17T19:11:32.000Z | 2018-04-12T23:33:06.000Z | test/integration_tests/test_roles.py | poldracklab/bids-core | b87a1ef2d3e1c5a79a98c0f0ba82b1b2634bce0e | [
"MIT"
] | 4 | 2017-04-05T17:34:59.000Z | 2018-01-22T01:40:51.000Z | import requests
import os
import json
import time
from nose.tools import with_setup
base_url = 'http://localhost:8080/api'
adm_user = 'test@user.com'
user = 'other@user.com'
test_data = type('',(object,),{})()
def setup_db():
global session
session = requests.Session()
# all the requests will be performe... | 25.321739 | 71 | 0.595467 | import requests
import os
import json
import time
from nose.tools import with_setup
base_url = 'http://localhost:8080/api'
adm_user = 'test@user.com'
user = 'other@user.com'
test_data = type('',(object,),{})()
def setup_db():
global session
session = requests.Session()
session.params = {
'use... | true | true |
1c45a92868008d359499e2e83998919eb99a0158 | 5,916 | py | Python | sdk/python/pulumi_azure_native/migrate/latest/group.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/migrate/latest/group.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/migrate/latest/group.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 42.869565 | 333 | 0.644523 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
__all__ = ['Group']
warnings.warn("""The 'latest' version is deprecated. Please migrate to the resource in the top-level module: 'azure-native:migra... | true | true |
1c45a98c9736d722678cfe3cb4948c956cd7f2d7 | 6,212 | py | Python | tempest/api/object_storage/test_container_sync.py | azorge/tempest | 549dfc93fb7e3d6d8566064a60a6069deae5c8eb | [
"Apache-2.0"
] | 1 | 2021-05-21T08:24:02.000Z | 2021-05-21T08:24:02.000Z | tempest/api/object_storage/test_container_sync.py | azorge/tempest | 549dfc93fb7e3d6d8566064a60a6069deae5c8eb | [
"Apache-2.0"
] | null | null | null | tempest/api/object_storage/test_container_sync.py | azorge/tempest | 549dfc93fb7e3d6d8566064a60a6069deae5c8eb | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 OpenStack Foundation
# 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 requ... | 41.413333 | 79 | 0.650193 |
import time
from six.moves.urllib import parse as urlparse
import testtools
from tempest.api.object_storage import base
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest import test
CONF = config.CONF
class ContainerSyncTest(base.BaseObjec... | true | true |
1c45ab721c9d7842215f9675276f0e2745f79bac | 14,462 | py | Python | external/workload-automation/wa/framework/signal.py | qais-yousef/lisa | 8343e26bf0565589928a69ccbe67b1be03403db7 | [
"Apache-2.0"
] | 1 | 2020-11-30T16:14:02.000Z | 2020-11-30T16:14:02.000Z | external/workload-automation/wa/framework/signal.py | qais-yousef/lisa | 8343e26bf0565589928a69ccbe67b1be03403db7 | [
"Apache-2.0"
] | null | null | null | external/workload-automation/wa/framework/signal.py | qais-yousef/lisa | 8343e26bf0565589928a69ccbe67b1be03403db7 | [
"Apache-2.0"
] | 1 | 2020-10-09T11:40:00.000Z | 2020-10-09T11:40:00.000Z | # Copyright 2013-2018 ARM Limited
#
# 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 w... | 42.163265 | 118 | 0.691675 |
import sys
import logging
from contextlib import contextmanager
import wrapt
from louie import dispatcher
from wa.utils.types import prioritylist, enum
logger = logging.getLogger('signal')
class Signal(object):
def __init__(self, name, description='no description', invert_priority=False):
self.nam... | true | true |
1c45ac250287c61459664f4104f27b4fea00e83d | 61 | py | Python | language-python-test/test/features/comprehensions/set_comprehension.py | wbadart/language-python | 6c048c215ff7fe4a5d5cc36ba3c17a666af74821 | [
"BSD-3-Clause"
] | null | null | null | language-python-test/test/features/comprehensions/set_comprehension.py | wbadart/language-python | 6c048c215ff7fe4a5d5cc36ba3c17a666af74821 | [
"BSD-3-Clause"
] | null | null | null | language-python-test/test/features/comprehensions/set_comprehension.py | wbadart/language-python | 6c048c215ff7fe4a5d5cc36ba3c17a666af74821 | [
"BSD-3-Clause"
] | null | null | null | { x + y for x in [1,2,3] if x > 1 for y in [4,5,6] if y < 6}
| 30.5 | 60 | 0.459016 | { x + y for x in [1,2,3] if x > 1 for y in [4,5,6] if y < 6}
| true | true |
1c45ad4927dd2f22598e965b4d772bbae5f47434 | 1,172 | py | Python | tests/api/ils/eitems/test_eitems_crud.py | NRodriguezcuellar/invenio-app-ils | 144a25a6c56330b214c6fd0b832220fa71f2e68a | [
"MIT"
] | 41 | 2018-09-04T13:00:46.000Z | 2022-03-24T20:45:56.000Z | tests/api/ils/eitems/test_eitems_crud.py | NRodriguezcuellar/invenio-app-ils | 144a25a6c56330b214c6fd0b832220fa71f2e68a | [
"MIT"
] | 720 | 2017-03-10T08:02:41.000Z | 2022-01-14T15:36:37.000Z | tests/api/ils/eitems/test_eitems_crud.py | NRodriguezcuellar/invenio-app-ils | 144a25a6c56330b214c6fd0b832220fa71f2e68a | [
"MIT"
] | 54 | 2017-03-09T16:05:29.000Z | 2022-03-17T08:34:51.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2021 CERN.
#
# Invenio-Circulation is free software; you can redistribute it and/or modify
# it under the terms of the MIT License; see LICENSE file for more details.
"""Tests eitems CRUD."""
import pytest
from invenio_app_ils.eitems.api import EItem
from invenio_app_ils.err... | 27.904762 | 77 | 0.669795 |
import pytest
from invenio_app_ils.eitems.api import EItem
from invenio_app_ils.errors import DocumentNotFoundError
def test_eitem_refs(app, testdata):
eitem = EItem.create(
dict(
pid="eitemid-99",
document_pid="docid-1",
created_by=dict(type="script", value="demo"),... | true | true |
1c45ad5c3147af9dff358391d91445cf2f8d76bf | 3,131 | py | Python | from_cpython/Lib/test/test_normalization.py | aisk/pyston | ac69cfef0621dbc8901175e84fa2b5cb5781a646 | [
"BSD-2-Clause",
"Apache-2.0"
] | 9 | 2015-04-15T10:58:49.000Z | 2018-09-24T09:11:33.000Z | Lib/test/test_normalization.py | odsod/cpython-internals-course | 55fffca28e83ac0f30029c60113a3110451dfa08 | [
"PSF-2.0"
] | 2 | 2020-02-17T22:31:09.000Z | 2020-02-18T04:31:55.000Z | Lib/test/test_normalization.py | odsod/cpython-internals-course | 55fffca28e83ac0f30029c60113a3110451dfa08 | [
"PSF-2.0"
] | 9 | 2015-03-13T18:27:27.000Z | 2018-12-03T15:38:51.000Z | from test.test_support import run_unittest, open_urlresource
import unittest
from httplib import HTTPException
import sys
import os
from unicodedata import normalize, unidata_version
TESTDATAFILE = "NormalizationTest.txt"
TESTDATAURL = "http://www.unicode.org/Public/" + unidata_version + "/ucd/" + TESTDATAFILE
def c... | 30.398058 | 89 | 0.516448 | from test.test_support import run_unittest, open_urlresource
import unittest
from httplib import HTTPException
import sys
import os
from unicodedata import normalize, unidata_version
TESTDATAFILE = "NormalizationTest.txt"
TESTDATAURL = "http://www.unicode.org/Public/" + unidata_version + "/ucd/" + TESTDATAFILE
def c... | true | true |
1c45af1163ca30e3f1de7ee012519613a5a4350b | 66,206 | py | Python | test/test_datasets.py | CellEight/vision | e8dded4c05ee403633529cef2e09bf94b07f6170 | [
"BSD-3-Clause"
] | 1 | 2021-04-12T09:42:25.000Z | 2021-04-12T09:42:25.000Z | test/test_datasets.py | mvpzhangqiu/vision | e8dded4c05ee403633529cef2e09bf94b07f6170 | [
"BSD-3-Clause"
] | null | null | null | test/test_datasets.py | mvpzhangqiu/vision | e8dded4c05ee403633529cef2e09bf94b07f6170 | [
"BSD-3-Clause"
] | null | null | null | import contextlib
import sys
import os
import unittest
from unittest import mock
import numpy as np
import PIL
from PIL import Image
from torch._utils_internal import get_file_path_2
import torchvision
from torchvision.datasets import utils
from common_utils import get_tmp_dir
from fakedata_generation import svhn_root,... | 37.983936 | 136 | 0.634142 | import contextlib
import sys
import os
import unittest
from unittest import mock
import numpy as np
import PIL
from PIL import Image
from torch._utils_internal import get_file_path_2
import torchvision
from torchvision.datasets import utils
from common_utils import get_tmp_dir
from fakedata_generation import svhn_root,... | true | true |
1c45af2d6128c89098abeaec9ca933517547a304 | 2,864 | py | Python | tests/functional/test_email_address.py | AutumnalDream/tartiflette-plugin-scalars | 2c73b20eac93b364a97b2192956e5fd4034ec35a | [
"MIT"
] | 8 | 2019-10-02T12:47:15.000Z | 2021-12-15T14:29:37.000Z | tests/functional/test_email_address.py | AutumnalDream/tartiflette-plugin-scalars | 2c73b20eac93b364a97b2192956e5fd4034ec35a | [
"MIT"
] | 109 | 2019-09-19T13:37:43.000Z | 2022-03-28T07:08:50.000Z | tests/functional/test_email_address.py | AutumnalDream/tartiflette-plugin-scalars | 2c73b20eac93b364a97b2192956e5fd4034ec35a | [
"MIT"
] | 4 | 2019-10-26T19:57:20.000Z | 2021-06-24T14:32:37.000Z | import pytest
from tartiflette import Resolver, create_engine
@pytest.mark.asyncio
async def test_email_address_ok():
@Resolver("Query.email", schema_name="test_email_address_ok")
async def email_resolver(*_args, **_kwargs):
return "alice.girardguittard@dm.com"
sdl = """
type Query {
... | 25.571429 | 80 | 0.623953 | import pytest
from tartiflette import Resolver, create_engine
@pytest.mark.asyncio
async def test_email_address_ok():
@Resolver("Query.email", schema_name="test_email_address_ok")
async def email_resolver(*_args, **_kwargs):
return "alice.girardguittard@dm.com"
sdl = """
type Query {
... | true | true |
1c45af5f2860e383958cbd656df2e212b922f313 | 3,327 | py | Python | tests/parse/test_parse_reference.py | wbknez/breakdb | f783820425c8cb70d8caedc6f5839a72de7c945e | [
"Apache-2.0"
] | 1 | 2020-02-03T18:31:20.000Z | 2020-02-03T18:31:20.000Z | tests/parse/test_parse_reference.py | wbknez/breakdb | f783820425c8cb70d8caedc6f5839a72de7c945e | [
"Apache-2.0"
] | null | null | null | tests/parse/test_parse_reference.py | wbknez/breakdb | f783820425c8cb70d8caedc6f5839a72de7c945e | [
"Apache-2.0"
] | null | null | null | """
Contains unit tests to ensure that all functions involved in parsing DICOM
references work as intended.
"""
import pytest
from breakdb.parse import has_reference, parse_reference
from breakdb.tag import ReferenceTag, get_tag_at, MalformedSequence, \
MissingSequence, MissingTag
from tests.helpers.tag import mat... | 32.940594 | 82 | 0.62098 | import pytest
from breakdb.parse import has_reference, parse_reference
from breakdb.tag import ReferenceTag, get_tag_at, MalformedSequence, \
MissingSequence, MissingTag
from tests.helpers.tag import match
class TestParseReference:
def test_has_reference_is_false_when_reference_is_missing(self,
... | true | true |
1c45b05c5d250ea77c37d28b3bab75d2b9cf9824 | 143,725 | py | Python | corehq/apps/accounting/models.py | satyaakam/commcare-hq | 233f255ff20ab3a16013e9fdfdb9c1dcf632e415 | [
"BSD-3-Clause"
] | null | null | null | corehq/apps/accounting/models.py | satyaakam/commcare-hq | 233f255ff20ab3a16013e9fdfdb9c1dcf632e415 | [
"BSD-3-Clause"
] | null | null | null | corehq/apps/accounting/models.py | satyaakam/commcare-hq | 233f255ff20ab3a16013e9fdfdb9c1dcf632e415 | [
"BSD-3-Clause"
] | null | null | null | import datetime
import itertools
from decimal import Decimal
from io import BytesIO
from tempfile import NamedTemporaryFile
from django.conf import settings
from django.contrib.postgres.fields import ArrayField
from django.core.exceptions import ValidationError
from django.core.validators import MaxValueValidator, Min... | 38.552843 | 115 | 0.641621 | import datetime
import itertools
from decimal import Decimal
from io import BytesIO
from tempfile import NamedTemporaryFile
from django.conf import settings
from django.contrib.postgres.fields import ArrayField
from django.core.exceptions import ValidationError
from django.core.validators import MaxValueValidator, Min... | true | true |
1c45b1afd70b4b9e6a45db74c842c66174c7a49a | 2,103 | py | Python | guild/main_bootstrap.py | wheatdog/guildai | 817cf179d0b6910d3d4fca522045a8139aef6c9e | [
"Apache-2.0"
] | null | null | null | guild/main_bootstrap.py | wheatdog/guildai | 817cf179d0b6910d3d4fca522045a8139aef6c9e | [
"Apache-2.0"
] | null | null | null | guild/main_bootstrap.py | wheatdog/guildai | 817cf179d0b6910d3d4fca522045a8139aef6c9e | [
"Apache-2.0"
] | null | null | null | # Copyright 2017-2020 TensorHub, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 29.619718 | 75 | 0.701854 |
from __future__ import absolute_import
from __future__ import division
import os
import sys
def main():
ensure_external_path()
import guild.main
guild.main.main()
def ensure_external_path():
path = _external_libs_path()
if path not in sys.path:
sys.path.insert(0, path)
def _externa... | true | true |
1c45b1e58aee7713ff142e357f97c11aaa11ed05 | 1,246 | py | Python | discord/utils.py | rf20008/nextcord | 48ae815f226e9f7f2f4076c68b6589563144d67b | [
"MIT"
] | null | null | null | discord/utils.py | rf20008/nextcord | 48ae815f226e9f7f2f4076c68b6589563144d67b | [
"MIT"
] | null | null | null | discord/utils.py | rf20008/nextcord | 48ae815f226e9f7f2f4076c68b6589563144d67b | [
"MIT"
] | null | null | null | """
The MIT License (MIT)
Copyright (c) 2021-present tag-epic
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merg... | 47.923077 | 76 | 0.804173 |
from nextcord.utils import *
from nextcord.utils import MISSING, DISCORD_EPOCH
| true | true |
1c45b20896b287eedc789388d42830cf74be6fa6 | 25,192 | py | Python | trac/admin/web_ui.py | mikiec84/trac | d51a7119b9fcb9061d7fe135c7d648fa671555dd | [
"BSD-3-Clause"
] | null | null | null | trac/admin/web_ui.py | mikiec84/trac | d51a7119b9fcb9061d7fe135c7d648fa671555dd | [
"BSD-3-Clause"
] | null | null | null | trac/admin/web_ui.py | mikiec84/trac | d51a7119b9fcb9061d7fe135c7d648fa671555dd | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2020 Edgewall Software
# Copyright (C) 2005 Jonas Borgström <jonas@edgewall.com>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://... | 41.230769 | 79 | 0.551286 |
import os
import pkg_resources
import re
import shutil
from functools import partial
from trac import log
from trac.admin.api import IAdminPanelProvider
from trac.core import *
from trac.loader import get_plugin_info
from trac.log import LOG_LEVELS, LOG_LEVEL_ALIASES, LOG_LEVEL_ALIASES_MAP
from trac.perm import IPerm... | true | true |
1c45b215becc81148e7aeae262a82262f980a51d | 2,641 | py | Python | render.py | araistrick/camera_pan_renderer | 900c6c064ac7d2b460087a16be49204276679e04 | [
"BSD-3-Clause"
] | 2 | 2021-10-15T22:49:05.000Z | 2022-02-28T20:26:53.000Z | render.py | araistrick/camera_pan_renderer | 900c6c064ac7d2b460087a16be49204276679e04 | [
"BSD-3-Clause"
] | null | null | null | render.py | araistrick/camera_pan_renderer | 900c6c064ac7d2b460087a16be49204276679e04 | [
"BSD-3-Clause"
] | null | null | null | import os
import argparse
from pathlib import Path
import bpy
import numpy as np
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
def use_cuda():
bpy.context.preferences.addons["cycles"].preferences.compute_device_type = "CUDA"
print(bpy.context.preferences.addons["cycl... | 33.43038 | 95 | 0.710716 | import os
import argparse
from pathlib import Path
import bpy
import numpy as np
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
def use_cuda():
bpy.context.preferences.addons["cycles"].preferences.compute_device_type = "CUDA"
print(bpy.context.preferences.addons["cycl... | true | true |
1c45b269ee0360c0a0e853445b9985838bcb82f4 | 1,210 | py | Python | examples/tutorials/pong/steps/step4/main.py | xinmingzhang/kivy | 86b6e19d8a02788fe8850b690bcecdff848f3c4e | [
"MIT"
] | 9 | 2016-09-03T07:20:01.000Z | 2020-05-21T14:44:48.000Z | examples/tutorials/pong/steps/step4/main.py | xinmingzhang/kivy | 86b6e19d8a02788fe8850b690bcecdff848f3c4e | [
"MIT"
] | 1 | 2017-05-30T20:45:15.000Z | 2017-05-30T20:45:15.000Z | examples/tutorials/pong/steps/step4/main.py | xinmingzhang/kivy | 86b6e19d8a02788fe8850b690bcecdff848f3c4e | [
"MIT"
] | 4 | 2016-09-10T15:27:54.000Z | 2020-03-27T22:05:31.000Z | from kivy.app import App
from kivy.uix.widget import Widget
from kivy.properties import NumericProperty, ReferenceListProperty,\
ObjectProperty
from kivy.vector import Vector
from kivy.clock import Clock
from random import randint
class PongBall(Widget):
velocity_x = NumericProperty(0)
velocity_y = Numeri... | 25.208333 | 68 | 0.65124 | from kivy.app import App
from kivy.uix.widget import Widget
from kivy.properties import NumericProperty, ReferenceListProperty,\
ObjectProperty
from kivy.vector import Vector
from kivy.clock import Clock
from random import randint
class PongBall(Widget):
velocity_x = NumericProperty(0)
velocity_y = Numeri... | true | true |
1c45b360ed6e478c667bfe1ca7f4f430632593d1 | 10,978 | py | Python | packages/python/plotly/plotly/validators/_candlestick.py | c-chaitanya/plotly.py | 7bda89c77559747e67fb1608bf9309e97505a4f2 | [
"MIT"
] | 7 | 2021-09-29T09:46:36.000Z | 2022-03-24T08:30:41.000Z | packages/python/plotly/plotly/validators/_candlestick.py | c-chaitanya/plotly.py | 7bda89c77559747e67fb1608bf9309e97505a4f2 | [
"MIT"
] | 1 | 2021-09-30T16:56:21.000Z | 2021-10-15T09:14:12.000Z | packages/python/plotly/plotly/validators/_candlestick.py | c-chaitanya/plotly.py | 7bda89c77559747e67fb1608bf9309e97505a4f2 | [
"MIT"
] | 1 | 2021-09-29T22:34:05.000Z | 2021-09-29T22:34:05.000Z | import _plotly_utils.basevalidators
class CandlestickValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="candlestick", parent_name="", **kwargs):
super(CandlestickValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | 46.12605 | 76 | 0.538167 | import _plotly_utils.basevalidators
class CandlestickValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="candlestick", parent_name="", **kwargs):
super(CandlestickValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | true | true |
1c45b39ba990a7c522df62adb4f9bedffe167392 | 60,426 | py | Python | pandas/core/internals/managers.py | joybhallaa/pandas | 1779155552631a30d4bb176dec70b8cc477defd7 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2 | 2022-02-02T02:05:28.000Z | 2022-02-02T02:09:37.000Z | pandas/core/internals/managers.py | north-star-saj/pandas | fc9fdba6592bdb5d0d1147ce4d65639acd897565 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/core/internals/managers.py | north-star-saj/pandas | fc9fdba6592bdb5d0d1147ce4d65639acd897565 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2020-10-28T03:32:40.000Z | 2020-10-28T03:32:40.000Z | from __future__ import annotations
from collections import defaultdict
import itertools
from typing import (
Any,
Callable,
DefaultDict,
Dict,
Hashable,
List,
Optional,
Sequence,
Tuple,
TypeVar,
Union,
)
import warnings
import numpy as np
from pandas._libs import internals... | 32.175719 | 88 | 0.574389 | from __future__ import annotations
from collections import defaultdict
import itertools
from typing import (
Any,
Callable,
DefaultDict,
Dict,
Hashable,
List,
Optional,
Sequence,
Tuple,
TypeVar,
Union,
)
import warnings
import numpy as np
from pandas._libs import internals... | true | true |
1c45b3d5de333d6534be0122ea89da552988ca0c | 601 | py | Python | tests/changes/api/test_build_mark_seen.py | bowlofstew/changes | ebd393520e0fdb07c240a8d4e8747281b6186e28 | [
"Apache-2.0"
] | 1 | 2015-11-08T13:00:44.000Z | 2015-11-08T13:00:44.000Z | tests/changes/api/test_build_mark_seen.py | alex/changes | 69a17b4c639e7082a75d037384ccb68ead3a0b4b | [
"Apache-2.0"
] | null | null | null | tests/changes/api/test_build_mark_seen.py | alex/changes | 69a17b4c639e7082a75d037384ccb68ead3a0b4b | [
"Apache-2.0"
] | null | null | null | from changes.models import BuildSeen
from changes.testutils import APITestCase
class BuildMarkSeenTest(APITestCase):
def test_simple(self):
project = self.create_project()
build = self.create_build(project=project)
self.login_default()
path = '/api/0/builds/{0}/mark_seen/'.format... | 26.130435 | 66 | 0.648918 | from changes.models import BuildSeen
from changes.testutils import APITestCase
class BuildMarkSeenTest(APITestCase):
def test_simple(self):
project = self.create_project()
build = self.create_build(project=project)
self.login_default()
path = '/api/0/builds/{0}/mark_seen/'.format... | true | true |
1c45b4011172fbf7f667e12379db8e0b37a73ae8 | 644 | py | Python | WebFilm/urls.py | marekbaranowski98/WebFilm | 5d78bb9518070c195feffc2181735b93be019ca0 | [
"MIT"
] | null | null | null | WebFilm/urls.py | marekbaranowski98/WebFilm | 5d78bb9518070c195feffc2181735b93be019ca0 | [
"MIT"
] | null | null | null | WebFilm/urls.py | marekbaranowski98/WebFilm | 5d78bb9518070c195feffc2181735b93be019ca0 | [
"MIT"
] | null | null | null | """WebFilm URL Configuration
path docs/ loads url from apps docs
path / loads url from apps frontend
path api/users/ loads url from apps users
path api/photos loads url from app photos
path api/movies loads url from app movies
"""
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
... | 30.666667 | 58 | 0.692547 | from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('docs/', include('docs.urls')),
path('api/users/', include('users.urls')),
path('api/photos/', include('photos.urls')),
path('api/movies/', include('movies.urls')),
path(... | true | true |
1c45b4b0875ea7d446dba15109b8e98b5d4bdaab | 3,439 | py | Python | libqtile/widget/windowname.py | Bauthe/qtile | 569c4d9aaad1dbd912435648f5f814e084de8365 | [
"MIT"
] | null | null | null | libqtile/widget/windowname.py | Bauthe/qtile | 569c4d9aaad1dbd912435648f5f814e084de8365 | [
"MIT"
] | null | null | null | libqtile/widget/windowname.py | Bauthe/qtile | 569c4d9aaad1dbd912435648f5f814e084de8365 | [
"MIT"
] | null | null | null | # Copyright (c) 2008, 2010 Aldo Cortesi
# Copyright (c) 2010 matt
# Copyright (c) 2011 Mounier Florian
# Copyright (c) 2012 Tim Neumann
# Copyright (c) 2013 Craig Barnes
# Copyright (c) 2014 Sean Vig
# Copyright (c) 2014 Tycho Andersen
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# o... | 40.458824 | 102 | 0.662402 |
from libqtile import bar, hook, pangocffi
from libqtile.widget import base
class WindowName(base._TextBox):
orientations = base.ORIENTATION_HORIZONTAL
defaults = [
('for_current_screen', False, 'instead of this bars screen use currently active screen'),
('empty_group_string', ' ', 'string to ... | true | true |
1c45b8317ee2fbfb8197eed5bc2187f391f7f3ad | 3,634 | py | Python | root/settings.py | henrid3v/pocket-man | d0e7f44674db877b3e658ee7fc8b0fddf79bfcc8 | [
"MIT"
] | null | null | null | root/settings.py | henrid3v/pocket-man | d0e7f44674db877b3e658ee7fc8b0fddf79bfcc8 | [
"MIT"
] | 1 | 2020-11-28T21:27:01.000Z | 2020-11-28T21:29:32.000Z | root/settings.py | shadowcompiler/pocket-man | d0e7f44674db877b3e658ee7fc8b0fddf79bfcc8 | [
"MIT"
] | null | null | null | """
Django settings for root project.
Generated by 'django-admin startproject' using Django 3.0.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
import ... | 26.720588 | 91 | 0.705559 |
import os
import environ
env = environ.Env()
environ.Env.read_env()
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = os.environ.get('SECRET_KEY')
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
... | true | true |
1c45b92429dcb84d7d15f647c4e3472f81ee716b | 4,819 | py | Python | pychron/lasers/tasks/panes/uv.py | ASUPychron/pychron | dfe551bdeb4ff8b8ba5cdea0edab336025e8cc76 | [
"Apache-2.0"
] | 31 | 2016-03-07T02:38:17.000Z | 2022-02-14T18:23:43.000Z | pychron/lasers/tasks/panes/uv.py | ASUPychron/pychron | dfe551bdeb4ff8b8ba5cdea0edab336025e8cc76 | [
"Apache-2.0"
] | 1,626 | 2015-01-07T04:52:35.000Z | 2022-03-25T19:15:59.000Z | pychron/lasers/tasks/panes/uv.py | UIllinoisHALPychron/pychron | f21b79f4592a9fb9dc9a4cb2e4e943a3885ededc | [
"Apache-2.0"
] | 26 | 2015-05-23T00:10:06.000Z | 2022-03-07T16:51:57.000Z | # ===============================================================================
# Copyright 2013 Jake Ross
#
# 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/licens... | 31.292208 | 87 | 0.529155 |
from __future__ import absolute_import
from pyface.tasks.traits_dock_pane import TraitsDockPane
from traitsui.api import (
View,
Item,
VGroup,
HGroup,
spring,
UItem,
ButtonEditor,
Group,
EnumEditor,
)
from pychron.core.ui.led_editor import LEDEditor
from pychron.core.ui.qt.referenc... | true | true |
1c45b960408ef5e1ab38b4817737225fd34b5a9f | 575 | py | Python | test/test_ncbi.py | Daniel-Davies/pytaxize | 446990c0f64c8360f1ee65fa7beaeb2410f6213d | [
"MIT"
] | 21 | 2015-02-23T19:41:09.000Z | 2020-11-04T15:11:20.000Z | test/test_ncbi.py | Daniel-Davies/pytaxize | 446990c0f64c8360f1ee65fa7beaeb2410f6213d | [
"MIT"
] | 56 | 2015-01-12T09:05:10.000Z | 2020-09-24T01:48:10.000Z | test/test_ncbi.py | Daniel-Davies/pytaxize | 446990c0f64c8360f1ee65fa7beaeb2410f6213d | [
"MIT"
] | 21 | 2015-01-12T08:45:02.000Z | 2020-09-10T01:01:43.000Z | import os
from nose.tools import *
import unittest
import vcr
from pytaxize import ncbi
class NcbiTest(unittest.TestCase):
@vcr.use_cassette("test/vcr_cassettes/ncbi_search.yml", filter_query_parameters=['api_key'])
def test_ncbi_search(self):
"ncbi.search"
x = ncbi.search(sci_com = "Apis")
... | 30.263158 | 96 | 0.61913 | import os
from nose.tools import *
import unittest
import vcr
from pytaxize import ncbi
class NcbiTest(unittest.TestCase):
@vcr.use_cassette("test/vcr_cassettes/ncbi_search.yml", filter_query_parameters=['api_key'])
def test_ncbi_search(self):
x = ncbi.search(sci_com = "Apis")
assert type(x) =... | true | true |
1c45ba8f50be8960f823fac0995df7dfaa1215e0 | 218 | py | Python | models/__init__.py | netotz/p-dispersion-problem | 123a6110dbf64d19a221da545c0590f7efc500dc | [
"MIT"
] | 1 | 2021-09-23T06:31:47.000Z | 2021-09-23T06:31:47.000Z | models/__init__.py | binary-hideout/p-dispersion-problem | 123a6110dbf64d19a221da545c0590f7efc500dc | [
"MIT"
] | 1 | 2021-08-31T15:15:08.000Z | 2021-08-31T15:15:08.000Z | models/__init__.py | netotz/p-dispersion-problem | 123a6110dbf64d19a221da545c0590f7efc500dc | [
"MIT"
] | 1 | 2020-05-19T04:46:47.000Z | 2020-05-19T04:46:47.000Z | '''
Package that contains the models of the project.
These models are the classes of Point and PDPInstance.
'''
# package level imports
from .point import Point
from .pdp_instance import PDPInstance, Matrix, Solution
| 24.222222 | 55 | 0.784404 |
from .point import Point
from .pdp_instance import PDPInstance, Matrix, Solution
| true | true |
1c45bafe765f80375e19d84146bad5379603a450 | 356 | py | Python | Interviews/HUAWEI/19/1.py | cnsteven/online-judge | 60ee841a97e2bc0dc9c7b23fe5daa186898ab8b7 | [
"MIT"
] | 1 | 2019-05-04T10:28:32.000Z | 2019-05-04T10:28:32.000Z | Interviews/HUAWEI/19/1.py | cnsteven/online-judge | 60ee841a97e2bc0dc9c7b23fe5daa186898ab8b7 | [
"MIT"
] | null | null | null | Interviews/HUAWEI/19/1.py | cnsteven/online-judge | 60ee841a97e2bc0dc9c7b23fe5daa186898ab8b7 | [
"MIT"
] | 3 | 2020-12-31T04:36:38.000Z | 2021-07-25T07:39:31.000Z | import math
n = list(map(int, input().split()))
length = len(n)
dp = [math.inf] * length
for i in range(1, int(length / 2)):
step = 1
idx = i
while idx < length:
dp[idx] = min(dp[idx], step)
idx = idx + n[idx]
step += 1
if dp[length - 1] == math.inf:
print(-1)... | 17.8 | 37 | 0.491573 | import math
n = list(map(int, input().split()))
length = len(n)
dp = [math.inf] * length
for i in range(1, int(length / 2)):
step = 1
idx = i
while idx < length:
dp[idx] = min(dp[idx], step)
idx = idx + n[idx]
step += 1
if dp[length - 1] == math.inf:
print(-1)... | true | true |
1c45bb098fd540b0ca4ce20913c1c1b808e0ae7b | 1,204 | py | Python | tutorial/proxy.py | maksimKorzh/fresh-proxy-list | e9ed2821a8445430aa30252c01b618892093f5ed | [
"MIT"
] | 7 | 2019-05-24T15:08:25.000Z | 2020-06-08T07:51:33.000Z | tutorial/proxy.py | maksimKorzh/fresh-proxy-list | e9ed2821a8445430aa30252c01b618892093f5ed | [
"MIT"
] | null | null | null | tutorial/proxy.py | maksimKorzh/fresh-proxy-list | e9ed2821a8445430aa30252c01b618892093f5ed | [
"MIT"
] | 5 | 2019-11-19T23:00:57.000Z | 2021-12-22T04:01:31.000Z | import requests
from bs4 import BeautifulSoup
proxyList = []
response = requests.get('https://free-proxy-list.net/')
bs = BeautifulSoup(response.text, 'lxml')
table = bs.find('table')
rows = table.find_all('tr')
count = 0
for row in rows:
ip = row.contents[0].text
port = row.contents[1].text
anonym = r... | 27.363636 | 91 | 0.508306 | import requests
from bs4 import BeautifulSoup
proxyList = []
response = requests.get('https://free-proxy-list.net/')
bs = BeautifulSoup(response.text, 'lxml')
table = bs.find('table')
rows = table.find_all('tr')
count = 0
for row in rows:
ip = row.contents[0].text
port = row.contents[1].text
anonym = r... | true | true |
1c45bb97d6036108335eeb9c5089a59bb600968e | 8,237 | py | Python | bluzelle/codec/crud/KeyValue_pb2.py | hhio618/bluezelle-py | c38a07458a36305457680196e8c47372008db5ab | [
"MIT"
] | 3 | 2021-08-19T10:09:29.000Z | 2022-01-05T14:19:59.000Z | bluzelle/codec/crud/KeyValue_pb2.py | hhio618/bluzelle-py | c38a07458a36305457680196e8c47372008db5ab | [
"MIT"
] | null | null | null | bluzelle/codec/crud/KeyValue_pb2.py | hhio618/bluzelle-py | c38a07458a36305457680196e8c47372008db5ab | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: crud/KeyValue.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.p... | 30.507407 | 489 | 0.618308 | from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default()
from bluzelle.codec.crud import lease_pb2 as crud_dot_lease... | true | true |
1c45bbaba79b9d8c2de84555e39251039007bf90 | 2,727 | py | Python | crypto/hard1/service/server.py | AnyKeyShik/CTF_Code | 32ff5dce6452dbea09eff0a4db7ad603efe4027d | [
"Apache-2.0"
] | null | null | null | crypto/hard1/service/server.py | AnyKeyShik/CTF_Code | 32ff5dce6452dbea09eff0a4db7ad603efe4027d | [
"Apache-2.0"
] | null | null | null | crypto/hard1/service/server.py | AnyKeyShik/CTF_Code | 32ff5dce6452dbea09eff0a4db7ad603efe4027d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from random import randint
from math import pow
def gcd(a, b):
if a < b:
return gcd(b, a)
elif a % b == 0:
return b;
else:
return gcd(b, a % b)
def gen_key(modulo):
key = randint(pow(10, 20), modulo)
while gcd(modulo, key) !... | 23.110169 | 305 | 0.574624 |
from random import randint
from math import pow
def gcd(a, b):
if a < b:
return gcd(b, a)
elif a % b == 0:
return b;
else:
return gcd(b, a % b)
def gen_key(modulo):
key = randint(pow(10, 20), modulo)
while gcd(modulo, key) != 1:
key = randint(pow(10, 20), modulo)... | true | true |
1c45bd5ae57fb300ba5e328a5611c8d8c5854181 | 1,330 | py | Python | tests/test_data/test_sciense.py | el/elizabeth | dc82cd9d2bb230acdb2f1a49bc16b1c3d12077ff | [
"MIT"
] | null | null | null | tests/test_data/test_sciense.py | el/elizabeth | dc82cd9d2bb230acdb2f1a49bc16b1c3d12077ff | [
"MIT"
] | null | null | null | tests/test_data/test_sciense.py | el/elizabeth | dc82cd9d2bb230acdb2f1a49bc16b1c3d12077ff | [
"MIT"
] | 1 | 2019-12-27T19:34:17.000Z | 2019-12-27T19:34:17.000Z | # -*- coding: utf-8 -*-
import re
from unittest import TestCase
from elizabeth import Science
import elizabeth.core.interdata as common
from tests.test_data import DummyCase
from ._patterns import STR_REGEX
class ScienceBaseTest(TestCase):
def setUp(self):
self.science = Science()
def tearDown(self... | 30.227273 | 77 | 0.695489 |
import re
from unittest import TestCase
from elizabeth import Science
import elizabeth.core.interdata as common
from tests.test_data import DummyCase
from ._patterns import STR_REGEX
class ScienceBaseTest(TestCase):
def setUp(self):
self.science = Science()
def tearDown(self):
del self.scie... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.