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 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c3990ef5c540d56a053816749da463b0e21a005 | 1,781 | py | Python | notebooks/relatorio.py | lbarosi/pylattes-lxml | 4de762f73a2086501ce06226ed04fb3c90fd9bd5 | [
"MIT"
] | null | null | null | notebooks/relatorio.py | lbarosi/pylattes-lxml | 4de762f73a2086501ce06226ed04fb3c90fd9bd5 | [
"MIT"
] | 1 | 2021-03-31T20:04:36.000Z | 2021-03-31T20:04:36.000Z | notebooks/relatorio.py | lbarosi/pylattes-lxml | 4de762f73a2086501ce06226ed04fb3c90fd9bd5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#!/usr/bin/env python
import os
import sys
import papermill as pm
from datetime import datetime as dt
import subprocess
import argparse
import warnings
warnings.filterwarnings("ignore")
def filename(nome):
inicio = dt.now().strftime('%d_%m_%Y_%M%S')
filename = 'RelatorioLattes-' + nome... | 26.191176 | 101 | 0.580573 |
import os
import sys
import papermill as pm
from datetime import datetime as dt
import subprocess
import argparse
import warnings
warnings.filterwarnings("ignore")
def filename(nome):
inicio = dt.now().strftime('%d_%m_%Y_%M%S')
filename = 'RelatorioLattes-' + nome + '_' + inicio + '.ipynb'
return filena... | true | true |
1c3991a4e576ccab340e3cc85f2ae2739e0b1392 | 370 | py | Python | template_project/settings.py | makspll/django-starter-template | f200d7c1626d74e0921cdfbced9040ee866ac2c1 | [
"MIT"
] | null | null | null | template_project/settings.py | makspll/django-starter-template | f200d7c1626d74e0921cdfbced9040ee866ac2c1 | [
"MIT"
] | 5 | 2021-03-30T14:21:46.000Z | 2021-09-22T19:41:59.000Z | template_project/settings.py | makspll/django-starter-template | f200d7c1626d74e0921cdfbced9040ee866ac2c1 | [
"MIT"
] | null | null | null | from split_settings.tools import optional, include
import os
ENV = os.environ.get("ENV_NAME",'dev')
BASE_SETTINGS = [
'components/common.py',
'components/languages.py',
'components/database.py',
'components/media.py',
'components/static.py',
'environments/{0}.py'.format(ENV),
optional('en... | 21.764706 | 50 | 0.691892 | from split_settings.tools import optional, include
import os
ENV = os.environ.get("ENV_NAME",'dev')
BASE_SETTINGS = [
'components/common.py',
'components/languages.py',
'components/database.py',
'components/media.py',
'components/static.py',
'environments/{0}.py'.format(ENV),
optional('en... | true | true |
1c3993eff7688207d56ccb8949d6ea2a04de9d4e | 908 | py | Python | setup.py | aabversteeg/simpleeval | 7999fd7d5c3928485b4633f5f93ab72931823fa5 | [
"MIT"
] | null | null | null | setup.py | aabversteeg/simpleeval | 7999fd7d5c3928485b4633f5f93ab72931823fa5 | [
"MIT"
] | null | null | null | setup.py | aabversteeg/simpleeval | 7999fd7d5c3928485b4633f5f93ab72931823fa5 | [
"MIT"
] | null | null | null | from setuptools import setup
__version__ = '0.9.5'
setup(
name='simpleeval',
py_modules=['simpleeval'],
version=__version__,
description='A simple, safe single expression evaluator library.',
long_description=open('README.rst', 'r').read(),
author='Daniel Fairhead',
author_email='danthedec... | 36.32 | 85 | 0.629956 | from setuptools import setup
__version__ = '0.9.5'
setup(
name='simpleeval',
py_modules=['simpleeval'],
version=__version__,
description='A simple, safe single expression evaluator library.',
long_description=open('README.rst', 'r').read(),
author='Daniel Fairhead',
author_email='danthedec... | true | true |
1c3994837f7bebf72235a21ddad66c5db7a1d511 | 877 | py | Python | setup.py | ExCiteS/geokey-airquality | 1c29351fa77a4ac1d834bbd1bb25b21ebb1dc57a | [
"MIT"
] | 1 | 2016-01-13T15:19:09.000Z | 2016-01-13T15:19:09.000Z | setup.py | ExCiteS/geokey-airquality | 1c29351fa77a4ac1d834bbd1bb25b21ebb1dc57a | [
"MIT"
] | 2 | 2015-12-08T14:33:07.000Z | 2018-09-20T10:01:07.000Z | setup.py | ExCiteS/geokey-airquality | 1c29351fa77a4ac1d834bbd1bb25b21ebb1dc57a | [
"MIT"
] | 1 | 2018-10-16T11:40:04.000Z | 2018-10-16T11:40:04.000Z | #!/usr/bin/env python
"""GeoKey extension for Air Quality functionality."""
from os.path import dirname, join
from setuptools import setup, find_packages
def read(file_name):
with open(join(dirname(__file__), file_name)) as file_object:
return file_object.read()
name = 'geokey-airquality'
version = __... | 27.40625 | 72 | 0.705815 |
from os.path import dirname, join
from setuptools import setup, find_packages
def read(file_name):
with open(join(dirname(__file__), file_name)) as file_object:
return file_object.read()
name = 'geokey-airquality'
version = __import__(name.replace('-', '_')).__version__
repository = join('https://git... | true | true |
1c3995166b14f0ac8c3c1dec2f8d8366704ebf20 | 3,141 | py | Python | setup.py | c-l-nguyen/pantab | b3602815232928e59ee85bae3f35cd204dd4f06d | [
"BSD-3-Clause"
] | 1 | 2020-10-12T13:35:56.000Z | 2020-10-12T13:35:56.000Z | setup.py | mhadi813/pantab | f5267c23fb06b9a7f0b7b03c98d67148c0e3058d | [
"BSD-3-Clause"
] | null | null | null | setup.py | mhadi813/pantab | f5267c23fb06b9a7f0b7b03c98d67148c0e3058d | [
"BSD-3-Clause"
] | null | null | null | import os
import sys
from setuptools import Extension, find_packages, setup
try:
from tableauhyperapi.impl.util import find_hyper_api_dll
except ImportError: # renamed in version 0.0.10309
from tableauhyperapi.impl.util import find_hyper_api_library as find_hyper_api_dll
here = os.path.abspath(os.path.dirn... | 32.381443 | 86 | 0.672079 | import os
import sys
from setuptools import Extension, find_packages, setup
try:
from tableauhyperapi.impl.util import find_hyper_api_dll
except ImportError:
from tableauhyperapi.impl.util import find_hyper_api_library as find_hyper_api_dll
here = os.path.abspath(os.path.dirname(__file__))
dll_path = find... | true | true |
1c3998313b8fbf3777d549c3a2945f1360c694e7 | 1,161 | py | Python | var/spack/repos/builtin/packages/libxfont2/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2015-10-04T02:17:46.000Z | 2018-02-07T18:23:00.000Z | var/spack/repos/builtin/packages/libxfont2/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 22 | 2017-08-01T22:45:10.000Z | 2022-03-10T07:46:31.000Z | var/spack/repos/builtin/packages/libxfont2/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 4 | 2016-06-10T17:57:39.000Z | 2018-09-11T04:59:38.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Libxfont2(AutotoolsPackage, XorgPackage):
"""libXfont provides the core of the legacy X11 ... | 38.7 | 95 | 0.727821 |
from spack import *
class Libxfont2(AutotoolsPackage, XorgPackage):
homepage = "https://cgit.freedesktop.org/xorg/lib/libXfont"
xorg_mirror_path = "lib/libXfont2-2.0.1.tar.gz"
version('2.0.1', sha256='381b6b385a69343df48a082523c856aed9042fbbc8ee0a6342fb502e4321230a')
depends_on('libfontenc')
... | true | true |
1c3998d4f906c41b8a647bc9aaa38e6d1ca78881 | 1,883 | py | Python | integration-tests/generate_data_coassembly_command.py | luispedro/SemiBin | 7a5c9c68bb29ec27b64d7b34ed88a2eab921314b | [
"MIT"
] | 25 | 2021-05-19T15:38:30.000Z | 2022-03-18T09:28:32.000Z | integration-tests/generate_data_coassembly_command.py | luispedro/SemiBin | 7a5c9c68bb29ec27b64d7b34ed88a2eab921314b | [
"MIT"
] | 39 | 2021-05-12T05:22:26.000Z | 2022-03-31T13:28:46.000Z | integration-tests/generate_data_coassembly_command.py | luispedro/SemiBin | 7a5c9c68bb29ec27b64d7b34ed88a2eab921314b | [
"MIT"
] | 5 | 2021-03-15T23:08:00.000Z | 2021-05-07T07:31:03.000Z | import os
import pandas as pd
import subprocess
### Input fa
subprocess.check_call('SemiBin generate_data_single -i test/coassembly_sample_data/input.fasta -o output_coassembly_fa -m 2500 --ratio 0.05 --ml-threshold 4000 -p 1 -b test/coassembly_sample_data/input.sorted*.bam', shell=True)
data = pd.read_csv('output_c... | 44.833333 | 232 | 0.774827 | import os
import pandas as pd
import subprocess
l('SemiBin generate_data_single -i test/coassembly_sample_data/input.fasta -o output_coassembly_fa -m 2500 --ratio 0.05 --ml-threshold 4000 -p 1 -b test/coassembly_sample_data/input.sorted*.bam', shell=True)
data = pd.read_csv('output_coassembly_fa/data.csv', index_col... | true | true |
1c3998dcd1f7fb374c19e7b1d43b9ea62225f6df | 711 | py | Python | leetcode/palindrome_number_without_string.py | abhik-93/python | db8dd0b8731f3687a5d0c7bf32b7ffe740569104 | [
"MIT"
] | null | null | null | leetcode/palindrome_number_without_string.py | abhik-93/python | db8dd0b8731f3687a5d0c7bf32b7ffe740569104 | [
"MIT"
] | null | null | null | leetcode/palindrome_number_without_string.py | abhik-93/python | db8dd0b8731f3687a5d0c7bf32b7ffe740569104 | [
"MIT"
] | null | null | null | class Solution(object):
def convertInttoList(self, n):
l = []
while n != 0:
l = [n % 10] + l
n = n // 10
return l
def isPalindrome(self, x):
if x <= 2**31 -1 and x>= -2**31:
if x>0:
x = Solution().convertInttoList(x)
... | 27.346154 | 80 | 0.524613 | class Solution(object):
def convertInttoList(self, n):
l = []
while n != 0:
l = [n % 10] + l
n = n // 10
return l
def isPalindrome(self, x):
if x <= 2**31 -1 and x>= -2**31:
if x>0:
x = Solution().convertInttoList(x)
... | true | true |
1c3998e6be14a17b2323d453ae57a027cf8058e9 | 1,494 | py | Python | classification/prepare_data.py | HuadingLing/astnn | 64fb02666245387d7aee80364ea4d421feb1594e | [
"MIT"
] | null | null | null | classification/prepare_data.py | HuadingLing/astnn | 64fb02666245387d7aee80364ea4d421feb1594e | [
"MIT"
] | null | null | null | classification/prepare_data.py | HuadingLing/astnn | 64fb02666245387d7aee80364ea4d421feb1594e | [
"MIT"
] | null | null | null | from pycparser import c_parser, c_ast
import pandas as pd
import os
import re
import sys
from gensim.models.word2vec import Word2Vec
import pickle
from tree import ASTNode, SingleNode
import numpy as np
def get_sequences(node, sequence):
current = SingleNode(node)
sequence.append(current.get_token())
for ... | 18.675 | 104 | 0.603079 | from pycparser import c_parser, c_ast
import pandas as pd
import os
import re
import sys
from gensim.models.word2vec import Word2Vec
import pickle
from tree import ASTNode, SingleNode
import numpy as np
def get_sequences(node, sequence):
current = SingleNode(node)
sequence.append(current.get_token())
for ... | true | true |
1c399a2d888171b25618f23f1c90aecc6fe52b0c | 308 | py | Python | agape/organizations/urls.py | codewiseio/django-agape | a63fc2cc63776c2b2cb16c7f6aee64f5783c3bba | [
"MIT"
] | null | null | null | agape/organizations/urls.py | codewiseio/django-agape | a63fc2cc63776c2b2cb16c7f6aee64f5783c3bba | [
"MIT"
] | null | null | null | agape/organizations/urls.py | codewiseio/django-agape | a63fc2cc63776c2b2cb16c7f6aee64f5783c3bba | [
"MIT"
] | null | null | null | from django.conf.urls import url, include
from .views import OrganizationViewSet
# build router
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register(r'organizations', OrganizationViewSet, base_name='organizations')
urlpatterns = [
url(r'^',include(router.urls)),
] | 25.666667 | 81 | 0.788961 | from django.conf.urls import url, include
from .views import OrganizationViewSet
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register(r'organizations', OrganizationViewSet, base_name='organizations')
urlpatterns = [
url(r'^',include(router.urls)),
] | true | true |
1c399c304ad15e29c7a808c06d887482964fccc3 | 712 | py | Python | easy_time_tracker/constants.py | btr1975/easy-time-tracker | 3889913844b41a6da55a8b1aa1721a9873349bf6 | [
"MIT"
] | null | null | null | easy_time_tracker/constants.py | btr1975/easy-time-tracker | 3889913844b41a6da55a8b1aa1721a9873349bf6 | [
"MIT"
] | null | null | null | easy_time_tracker/constants.py | btr1975/easy-time-tracker | 3889913844b41a6da55a8b1aa1721a9873349bf6 | [
"MIT"
] | null | null | null | """
Constants for easy_time_tracker
"""
import os
from pathlib import Path
# The absolute path to the easy-time-tracker directory
EASY_TIME_TRACKER_BASE_PATH = os.path.split(os.path.split(os.path.abspath(__file__))[0])[0]
# The name to use for the current record
EASY_TIME_TRACKER_CURRENT_RECORD = os.getenv('EASY_TIME_... | 47.466667 | 115 | 0.710674 | import os
from pathlib import Path
EASY_TIME_TRACKER_BASE_PATH = os.path.split(os.path.split(os.path.abspath(__file__))[0])[0]
EASY_TIME_TRACKER_CURRENT_RECORD = os.getenv('EASY_TIME_TRACKER_CURRENT_RECORD') or \
os.path.join(Path.home(), 'easy-time-tracker-data', 'current_record.j... | true | true |
1c399d3ece99d61b605cd8d1d1e3f9156903cc35 | 6,130 | py | Python | src/generative/modify_attribute.py | rajivmanivannan/facenet | 4a896201dba3f8caf64ba4d5004d60eaf9aefd78 | [
"MIT"
] | null | null | null | src/generative/modify_attribute.py | rajivmanivannan/facenet | 4a896201dba3f8caf64ba4d5004d60eaf9aefd78 | [
"MIT"
] | null | null | null | src/generative/modify_attribute.py | rajivmanivannan/facenet | 4a896201dba3f8caf64ba4d5004d60eaf9aefd78 | [
"MIT"
] | 1 | 2020-03-03T05:44:19.000Z | 2020-03-03T05:44:19.000Z | # MIT License
#
# Copyright (c) 2017 David Sandberg
#
# 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, me... | 42.867133 | 145 | 0.684502 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import sys
import argparse
import importlib
import facenet
import os
import numpy as np
import h5py
import math
from scipy import misc
def main(args):
img_m... | true | true |
1c399daeface1f28ecc2913fe550bc3ecf8af487 | 3,159 | py | Python | tests/bugs/core_1550_postfix_test.py | FirebirdSQL/firebird-qa | 96af2def7f905a06f178e2a80a2c8be4a4b44782 | [
"MIT"
] | 1 | 2022-02-05T11:37:13.000Z | 2022-02-05T11:37:13.000Z | tests/bugs/core_1550_postfix_test.py | FirebirdSQL/firebird-qa | 96af2def7f905a06f178e2a80a2c8be4a4b44782 | [
"MIT"
] | 1 | 2021-09-03T11:47:00.000Z | 2021-09-03T12:42:10.000Z | tests/bugs/core_1550_postfix_test.py | FirebirdSQL/firebird-qa | 96af2def7f905a06f178e2a80a2c8be4a4b44782 | [
"MIT"
] | 1 | 2021-06-30T14:14:16.000Z | 2021-06-30T14:14:16.000Z | #coding:utf-8
#
# id: bugs.core_1550_postfix
# title: Unnecessary index scan happens when the same index is mapped to both WHERE and ORDER BY clauses
# decription:
# http://sourceforge.net/p/firebird/code/60368
# Date: 2014-12-16 11:40:42 +0000 (Tue, 16 Dec 2014)
... | 30.085714 | 121 | 0.550174 |
import pytest
from firebird.qa import db_factory, isql_act, Action
substitutions_1 = []
init_script_1 = """"""
db_1 = db_factory(sql_dialect=3, init=init_script_1)
test_script_1 = """
-- sent to dimitr 30.09.14 at 22:09
set term ^;
execute block as
begin
execute state... | true | true |
1c399e484c6ee4793096c73639f63547f98ded20 | 774 | py | Python | accounts/permissions.py | mnpenchev/DocManSys_django_rest | 6b6a9be55d7bb1d44d887649aae69efbd000444d | [
"MIT"
] | null | null | null | accounts/permissions.py | mnpenchev/DocManSys_django_rest | 6b6a9be55d7bb1d44d887649aae69efbd000444d | [
"MIT"
] | null | null | null | accounts/permissions.py | mnpenchev/DocManSys_django_rest | 6b6a9be55d7bb1d44d887649aae69efbd000444d | [
"MIT"
] | null | null | null | from rest_framework import permissions
class UpdateOwnProfile(permissions.BasePermission):
""" allows user to update their own profile """
def has_object_permission(self, request, view, obj):
""" check if user is trying to edit their own proffile """
if request.method in permissions.SAFE_MET... | 32.25 | 69 | 0.674419 | from rest_framework import permissions
class UpdateOwnProfile(permissions.BasePermission):
def has_object_permission(self, request, view, obj):
if request.method in permissions.SAFE_METHODS:
return True
return obj.id == request.user.id
| true | true |
1c399f3f1011ac9707c0ce8570cb1153117e1986 | 2,083 | py | Python | scripts/data_convert/filter_queries.py | prateeksingh0001/FlexNeuART | ebc82ca4fe01436374c595db2429bc49fb9e1dd0 | [
"Apache-2.0"
] | null | null | null | scripts/data_convert/filter_queries.py | prateeksingh0001/FlexNeuART | ebc82ca4fe01436374c595db2429bc49fb9e1dd0 | [
"Apache-2.0"
] | null | null | null | scripts/data_convert/filter_queries.py | prateeksingh0001/FlexNeuART | ebc82ca4fe01436374c595db2429bc49fb9e1dd0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Filtering queries to exclude queries that might textually match queries from a set of sub-directories
import sys
import os
import json
import argparse
sys.path.append('.')
from scripts.data_convert.convert_common import FileWrapper, read_queries
from scripts.config import TEXT_FIELD_NAME, QUES... | 31.560606 | 111 | 0.707633 |
import sys
import os
import json
import argparse
sys.path.append('.')
from scripts.data_convert.convert_common import FileWrapper, read_queries
from scripts.config import TEXT_FIELD_NAME, QUESTION_FILE_JSON
parser = argparse.ArgumentParser(description='Filter queries to exclude queries from given sub-directories')... | true | true |
1c399fadb353613479b7f9eb7478ded5c5946060 | 3,460 | py | Python | src/db-up/azext_db_up/vendored_sdks/azure_mgmt_sql/sql/models/server.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 207 | 2017-11-29T06:59:41.000Z | 2022-03-31T10:00:53.000Z | src/db-up/azext_db_up/vendored_sdks/azure_mgmt_sql/sql/models/server.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 4,061 | 2017-10-27T23:19:56.000Z | 2022-03-31T23:18:30.000Z | src/db-up/azext_db_up/vendored_sdks/azure_mgmt_sql/sql/models/server.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 802 | 2017-10-11T17:36:26.000Z | 2022-03-31T22:24:32.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 39.770115 | 104 | 0.619942 |
from .tracked_resource import TrackedResource
class Server(TrackedResource):
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'location': {'required': True},
'kind': {'readonly': True},
'state': {'readonly... | true | true |
1c399ff53065a5193a230224651211ff389cc86d | 1,171 | py | Python | TUI/Inst/BOSS/TestData.py | sdss/snafui | 0793b036122755396f06f449080d9cdad7d508ec | [
"BSD-3-Clause"
] | 1 | 2018-03-07T02:47:36.000Z | 2018-03-07T02:47:36.000Z | TUI/Inst/BOSS/TestData.py | sdss/snafui | 0793b036122755396f06f449080d9cdad7d508ec | [
"BSD-3-Clause"
] | null | null | null | TUI/Inst/BOSS/TestData.py | sdss/snafui | 0793b036122755396f06f449080d9cdad7d508ec | [
"BSD-3-Clause"
] | null | null | null | import TUI.Base.TestDispatcher
testDispatcher = TUI.Base.TestDispatcher.TestDispatcher("boss", delay=1.0)
tuiModel = testDispatcher.tuiModel
ExposeMainDataList = (
"exposureState=IDLE, 0, 0",
"hardwareStatus=0x38",
"shutterStatus=0x1, 0x1",
"screenStatus=0x5, 0x5",
"motorPosition=5000, 4800, 5200,... | 20.54386 | 74 | 0.614859 | import TUI.Base.TestDispatcher
testDispatcher = TUI.Base.TestDispatcher.TestDispatcher("boss", delay=1.0)
tuiModel = testDispatcher.tuiModel
ExposeMainDataList = (
"exposureState=IDLE, 0, 0",
"hardwareStatus=0x38",
"shutterStatus=0x1, 0x1",
"screenStatus=0x5, 0x5",
"motorPosition=5000, 4800, 5200,... | true | true |
1c39a02fd23ef778076844212fc5039acb5837e0 | 1,902 | py | Python | mil_common/utils/mil_tools/mil_misc_tools/serial_tools.py | RishiKumarRay/mil | f3746a91e68aac713e86b380cdda8852ba826170 | [
"MIT"
] | 27 | 2020-02-17T21:54:09.000Z | 2022-03-18T17:49:23.000Z | mil_common/utils/mil_tools/mil_misc_tools/serial_tools.py | RishiKumarRay/mil | f3746a91e68aac713e86b380cdda8852ba826170 | [
"MIT"
] | 325 | 2019-09-11T14:13:56.000Z | 2022-03-31T00:38:30.000Z | mil_common/utils/mil_tools/mil_misc_tools/serial_tools.py | RishiKumarRay/mil | f3746a91e68aac713e86b380cdda8852ba826170 | [
"MIT"
] | 24 | 2019-09-16T00:29:45.000Z | 2022-03-06T10:56:38.000Z | #!/usr/bin/env python
import serial
def hexify(buff):
'''
Print a string displaying the bytes in hex format
example: hexify(my_packet) -> c0:14:09:48:45:4c:4c:4f:c1
'''
return ':'.join(b.encode('hex') for b in buff)
class NoopSerial(serial.Serial):
'''
Inherits from serial.Serial, doing ... | 21.133333 | 107 | 0.627234 |
import serial
def hexify(buff):
return ':'.join(b.encode('hex') for b in buff)
class NoopSerial(serial.Serial):
port = 'noop-serial'
def __init__(*args, **kwargs):
pass
def open(self):
pass
@property
def in_waiting(self):
return 0
@property
def out_waitin... | true | true |
1c39a0fcb46e2f61334de27052d82344b2c58d05 | 1,983 | py | Python | longest_common_subsequence_print_alt.py | tusharsadhwani/leetcode | a17a8a7587c5654f05fcd13ae7cdf47263ab2ea8 | [
"MIT"
] | 6 | 2021-05-21T01:10:42.000Z | 2021-12-16T16:12:30.000Z | longest_common_subsequence_print_alt.py | tusharsadhwani/leetcode | a17a8a7587c5654f05fcd13ae7cdf47263ab2ea8 | [
"MIT"
] | null | null | null | longest_common_subsequence_print_alt.py | tusharsadhwani/leetcode | a17a8a7587c5654f05fcd13ae7cdf47263ab2ea8 | [
"MIT"
] | null | null | null | from collections import defaultdict
# Printing the largest subsequence using the alt-Solution, without storing strings
class Solution:
def longestCommonSubsequence(self, text1: str, text2: str) -> str:
cache: defaultdict[int, defaultdict[int, int]] = defaultdict(lambda: defaultdict(int))
for inde... | 30.984375 | 94 | 0.520424 | from collections import defaultdict
class Solution:
def longestCommonSubsequence(self, text1: str, text2: str) -> str:
cache: defaultdict[int, defaultdict[int, int]] = defaultdict(lambda: defaultdict(int))
for index1, char1 in enumerate(text1, start=1):
for index2, char2 in enumerate... | true | true |
1c39a128187cb933b60c03ad0668631ab0287fb1 | 16,795 | py | Python | cspace/main/ui/Ui_MainWindow.py | jmcvetta/cspace | 13d6be86dfa3417ac5511b1b2c15d1050fe3701d | [
"RSA-MD",
"TCP-wrappers"
] | 28 | 2015-04-24T12:04:08.000Z | 2022-01-07T15:13:10.000Z | cspace/main/ui/Ui_MainWindow.py | Magnus167/cspace | 13d6be86dfa3417ac5511b1b2c15d1050fe3701d | [
"RSA-MD",
"TCP-wrappers"
] | 1 | 2015-12-09T10:21:59.000Z | 2015-12-16T05:38:55.000Z | cspace/main/ui/Ui_MainWindow.py | Magnus167/cspace | 13d6be86dfa3417ac5511b1b2c15d1050fe3701d | [
"RSA-MD",
"TCP-wrappers"
] | 18 | 2015-01-01T02:16:49.000Z | 2021-08-12T04:14:57.000Z | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'MainWindow.ui'
#
# Created: Mon Oct 09 13:21:16 2006
# by: PyQt4 UI code generator 4.0.1
#
# WARNING! All changes made in this file will be lost!
import sys
from PyQt4 import QtCore, QtGui
class Ui_MainWindow(object):
... | 55.612583 | 721 | 0.718488 |
import sys
from PyQt4 import QtCore, QtGui
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(QtCore.QSize(QtCore.QRect(0,0,283,376).size()).expandedTo(MainWindow.minimumSizeHint()))
MainWindow.setWindowIcon... | true | true |
1c39a329a1861e2a4b9086d9ce7bc0ccd9a2eb57 | 5,152 | py | Python | src/ebel_rest/manager/statistics.py | e-BE-L/ebel_rest | 67e62fe0d52eb9cd5dba333e2908e5746e4317e7 | [
"MIT"
] | 3 | 2020-04-22T11:16:43.000Z | 2021-09-28T13:49:18.000Z | src/ebel_rest/manager/statistics.py | e-BE-L/ebel_rest | 67e62fe0d52eb9cd5dba333e2908e5746e4317e7 | [
"MIT"
] | null | null | null | src/ebel_rest/manager/statistics.py | e-BE-L/ebel_rest | 67e62fe0d52eb9cd5dba333e2908e5746e4317e7 | [
"MIT"
] | null | null | null | from collections import Counter
import pandas as pd
from ebel_rest.manager.core import Statistics
from ebel_rest.manager import ss_functions
def summarize() -> Statistics:
"""Returns summary statistics on the graph."""
return Statistics().apply_api_function(ss_functions.BEL_STATISTICS_SUMMARIZE)
def publi... | 39.328244 | 116 | 0.722826 | from collections import Counter
import pandas as pd
from ebel_rest.manager.core import Statistics
from ebel_rest.manager import ss_functions
def summarize() -> Statistics:
return Statistics().apply_api_function(ss_functions.BEL_STATISTICS_SUMMARIZE)
def publication_by_year() -> Statistics:
return Statisti... | true | true |
1c39a57b6f5ec4a1121a1d80e025e2c081812e38 | 1,779 | py | Python | sdk/labservices/azure-mgmt-labservices/azure/mgmt/labservices/models/network_interface_py3.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/labservices/azure-mgmt-labservices/azure/mgmt/labservices/models/network_interface_py3.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 226 | 2019-07-24T07:57:21.000Z | 2019-10-15T01:07:24.000Z | sdk/labservices/azure-mgmt-labservices/azure/mgmt/labservices/models/network_interface_py3.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 2 | 2020-05-21T22:51:22.000Z | 2020-05-26T20:53:01.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 34.882353 | 76 | 0.609893 |
from msrest.serialization import Model
class NetworkInterface(Model):
_validation = {
'private_ip_address': {'readonly': True},
'ssh_authority': {'readonly': True},
'rdp_authority': {'readonly': True},
'username': {'readonly': True},
}
_attribute_map = {
... | true | true |
1c39a6a1da67e5ad4c9b2e539886f9b75b87bfe1 | 2,455 | py | Python | Chapter15/Using PostgreSQL in Python applications/sqlalchemy_orm.py | MLikeWater/Learning-PostgreSQL-11-Third-Edition | 6f4414c2a0edb1bc0e280ca4d1589b89b7205671 | [
"MIT"
] | 19 | 2019-01-30T14:12:27.000Z | 2021-10-05T19:45:42.000Z | Chapter15/Using PostgreSQL in Python applications/sqlalchemy_orm.py | PacktPublishing/Learning-PostgreSQL-11-Third-Edition | 134ad3efd3b1f3bd491daf1d145676e0977b9d8e | [
"MIT"
] | null | null | null | Chapter15/Using PostgreSQL in Python applications/sqlalchemy_orm.py | PacktPublishing/Learning-PostgreSQL-11-Third-Edition | 134ad3efd3b1f3bd491daf1d145676e0977b9d8e | [
"MIT"
] | 21 | 2018-11-20T11:44:50.000Z | 2022-01-19T21:19:38.000Z | #!/usr/bin/python3
from sqlalchemy import *
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, relationship
engine = create_engine(
"postgresql+pg8000://car_portal_app@localhost/car_portal",
echo=False)
Base = declarative_base()
Session = sessionmaker(bind=engine... | 29.939024 | 79 | 0.672912 |
from sqlalchemy import *
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, relationship
engine = create_engine(
"postgresql+pg8000://car_portal_app@localhost/car_portal",
echo=False)
Base = declarative_base()
Session = sessionmaker(bind=engine)
class Car_mode... | true | true |
1c39a6a43a52b34276fae2d57bc088da4f6d8c5e | 698 | py | Python | wangzhansen/20180409/20180409h4.py | python20180319howmework/homework | c826d7aa4c52f8d22f739feb134d20f0b2c217cd | [
"Apache-2.0"
] | null | null | null | wangzhansen/20180409/20180409h4.py | python20180319howmework/homework | c826d7aa4c52f8d22f739feb134d20f0b2c217cd | [
"Apache-2.0"
] | null | null | null | wangzhansen/20180409/20180409h4.py | python20180319howmework/homework | c826d7aa4c52f8d22f739feb134d20f0b2c217cd | [
"Apache-2.0"
] | null | null | null | '''
4.现有两个进程,1号进程向文件写入10个"hello" 2号进程向文件写入10个"world",两个进程并发执行
如何使得文件中的内容一定是"hellohellohellohellohello.....worldworldworld......."
'''
from multiprocessing import Process, Pool, Lock
import os
def newprocess(flname, mylock):
with mylock:
f = open(flname,"r+")
fistline = f.readline()
fistline... | 27.92 | 73 | 0.611748 | from multiprocessing import Process, Pool, Lock
import os
def newprocess(flname, mylock):
with mylock:
f = open(flname,"r+")
fistline = f.readline()
fistline = str("hello" * 10)
f.seek(0,0)
f.write(fistline)
f.close()
if __name__ == '__main__':
f = open("./yourp... | true | true |
1c39a74be9aad9519c7a6d386c62be44d4926b3c | 848 | py | Python | nessus/file.py | tharvik/nessus | 4551c319ac6cb3026ddb096a0f6f71f060a578ab | [
"CC0-1.0"
] | null | null | null | nessus/file.py | tharvik/nessus | 4551c319ac6cb3026ddb096a0f6f71f060a578ab | [
"CC0-1.0"
] | null | null | null | nessus/file.py | tharvik/nessus | 4551c319ac6cb3026ddb096a0f6f71f060a578ab | [
"CC0-1.0"
] | null | null | null | from uuid import uuid4
from nessus.base import LibNessusBase
class NessusFile:
def __init__(self, path: str) -> None:
self.path = path
class NessusRemoteFile:
def __init__(self, name: str) -> None:
self.name = name
class LibNessusFile(LibNessusBase):
def upload(self, nessus_file: Ness... | 26.5 | 73 | 0.615566 | from uuid import uuid4
from nessus.base import LibNessusBase
class NessusFile:
def __init__(self, path: str) -> None:
self.path = path
class NessusRemoteFile:
def __init__(self, name: str) -> None:
self.name = name
class LibNessusFile(LibNessusBase):
def upload(self, nessus_file: Ness... | true | true |
1c39a7d4ab1265740970543e029e1ae8f390e384 | 3,914 | py | Python | Lib/site-packages/pymongo/settings.py | inging44/python3 | fcd8d9d2ee54b46b757ecf34f284b4e60a43097a | [
"bzip2-1.0.6"
] | 32 | 2017-08-29T08:57:16.000Z | 2021-04-21T08:53:04.000Z | Lib/site-packages/pymongo/settings.py | inging44/python3 | fcd8d9d2ee54b46b757ecf34f284b4e60a43097a | [
"bzip2-1.0.6"
] | 108 | 2017-09-04T19:59:28.000Z | 2022-03-31T08:12:07.000Z | Lib/site-packages/pymongo/settings.py | inging44/python3 | fcd8d9d2ee54b46b757ecf34f284b4e60a43097a | [
"bzip2-1.0.6"
] | 14 | 2017-07-06T09:35:30.000Z | 2021-06-03T19:41:48.000Z | # Copyright 2014-2015 MongoDB, 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 writi... | 33.169492 | 73 | 0.686765 |
import threading
from bson.objectid import ObjectId
from pymongo import common, monitor, pool
from pymongo.common import LOCAL_THRESHOLD_MS, SERVER_SELECTION_TIMEOUT
from pymongo.errors import ConfigurationError
from pymongo.topology_description import TOPOLOGY_TYPE
from pymongo.pool import PoolOptions
... | true | true |
1c39a8d92caa68d04b7ab0b59f966fe8d002a086 | 4,049 | py | Python | mmdet/core/bbox/samplers/base_sampler.py | arthur801031/3d-multi-resolution-rcnn | 8e5454a72f8daa174bf3eabfa5964152f04ab287 | [
"Apache-2.0"
] | 16 | 2021-03-02T07:41:01.000Z | 2022-03-14T08:55:45.000Z | mmdet/core/bbox/samplers/base_sampler.py | arthur801031/3d-multi-resolution-rcnn | 8e5454a72f8daa174bf3eabfa5964152f04ab287 | [
"Apache-2.0"
] | 2 | 2022-01-06T20:54:13.000Z | 2022-02-24T03:50:51.000Z | mmdet/core/bbox/samplers/base_sampler.py | arthur801031/3d-multi-resolution-rcnn | 8e5454a72f8daa174bf3eabfa5964152f04ab287 | [
"Apache-2.0"
] | 2 | 2021-05-26T19:23:35.000Z | 2022-01-06T20:30:24.000Z | from abc import ABCMeta, abstractmethod
import torch
from .sampling_result import SamplingResult
class BaseSampler(metaclass=ABCMeta):
def __init__(self,
num,
pos_fraction,
neg_pos_ub=-1,
add_gt_as_proposals=True,
**kwargs):
... | 38.561905 | 136 | 0.602371 | from abc import ABCMeta, abstractmethod
import torch
from .sampling_result import SamplingResult
class BaseSampler(metaclass=ABCMeta):
def __init__(self,
num,
pos_fraction,
neg_pos_ub=-1,
add_gt_as_proposals=True,
**kwargs):
... | true | true |
1c39a9c1963840994365920d42980436d8d9a731 | 1,350 | py | Python | coverage/disposition.py | timofurrer/coveragepy | 72e9761ee79eb2f5b61b21a5427e07fff6acd400 | [
"Apache-2.0"
] | 2,254 | 2015-01-05T01:28:03.000Z | 2022-03-29T10:37:10.000Z | coverage/disposition.py | timofurrer/coveragepy | 72e9761ee79eb2f5b61b21a5427e07fff6acd400 | [
"Apache-2.0"
] | 707 | 2015-02-07T01:32:02.000Z | 2022-03-31T18:00:14.000Z | coverage/disposition.py | sitedata/coveragepy | e4f0f9ee71a1ade66b51ec53d0061f462e3838cb | [
"Apache-2.0"
] | 439 | 2015-01-16T15:06:08.000Z | 2022-03-30T06:19:12.000Z | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""Simple value objects for tracking what to do with files."""
class FileDisposition:
"""A simple value type for recording what to do with a file."""
pass... | 33.75 | 79 | 0.696296 |
class FileDisposition:
pass
def disposition_init(cls, original_filename):
disp = cls()
disp.original_filename = original_filename
disp.canonical_filename = original_filename
disp.source_filename = None
disp.trace = False
disp.reason = ""
disp.file_tracer = None
disp.has_dy... | true | true |
1c39aa0de256edb03c668ae411a19be0cd31aeec | 237,033 | py | Python | mypy/semanal.py | linw1995/mypy | 2c909125e6fdc7f8855ead6b0091fc2a878d4462 | [
"PSF-2.0"
] | null | null | null | mypy/semanal.py | linw1995/mypy | 2c909125e6fdc7f8855ead6b0091fc2a878d4462 | [
"PSF-2.0"
] | null | null | null | mypy/semanal.py | linw1995/mypy | 2c909125e6fdc7f8855ead6b0091fc2a878d4462 | [
"PSF-2.0"
] | 1 | 2022-01-31T13:24:43.000Z | 2022-01-31T13:24:43.000Z | """The semantic analyzer.
Bind names to definitions and do various other simple consistency
checks. Populate symbol tables. The semantic analyzer also detects
special forms which reuse generic syntax such as NamedTuple and
cast(). Multiple analysis iterations may be needed to analyze forward
references and import c... | 45.269862 | 99 | 0.590956 |
from contextlib import contextmanager
from typing import (
List, Dict, Set, Tuple, cast, TypeVar, Union, Optional, Callable, Iterator, Iterable
)
from typing_extensions import Final
from mypy.nodes import (
MypyFile, TypeInfo, Node, AssignmentStmt, FuncDef, OverloadedFuncDef,
ClassDef, Var, GDEF, FuncIte... | true | true |
1c39ac4dc7d7da37e6d7c8e1160c9f4d77f1d1c3 | 838 | py | Python | nova/scheduler/weights/software_mgmt.py | teresa-ho/stx-nova | 1f82323439da2449edbbaed2fe1c8414a550c86f | [
"Apache-2.0"
] | null | null | null | nova/scheduler/weights/software_mgmt.py | teresa-ho/stx-nova | 1f82323439da2449edbbaed2fe1c8414a550c86f | [
"Apache-2.0"
] | null | null | null | nova/scheduler/weights/software_mgmt.py | teresa-ho/stx-nova | 1f82323439da2449edbbaed2fe1c8414a550c86f | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2017 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
"""
SoftwareMgmtWeigher:
- Prefer hosts that are patch current while there remains other hosts that are
not current.
- Prefer hosts that are upgrades current while upgrades are in progress.
"""
from oslo_config import cfg
from no... | 27.933333 | 78 | 0.727924 |
from oslo_config import cfg
from nova.scheduler import weights
CONF = cfg.CONF
class SoftwareMgmtWeigher(weights.BaseHostWeigher):
minval = 0
def _weigh_object(self, host_state, weight_properties):
weight = 0.0
if host_state.patch_prefer:
weight += CONF.filter_scheduler.swm... | true | true |
1c39acce1d04c58907ed9581a977b8853da4ae7c | 3,007 | py | Python | huaweicloud-sdk-as/huaweicloudsdkas/v1/model/show_scaling_group_response.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | 1 | 2021-11-03T07:54:50.000Z | 2021-11-03T07:54:50.000Z | huaweicloud-sdk-as/huaweicloudsdkas/v1/model/show_scaling_group_response.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-as/huaweicloudsdkas/v1/model/show_scaling_group_response.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
import pprint
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
class ShowScalingGroupResponse(SdkResponse):
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (... | 27.587156 | 81 | 0.573994 |
import pprint
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
class ShowScalingGroupResponse(SdkResponse):
sensitive_list = []
openapi_types = {
'scaling_group': 'ScalingGroups'
}
attribute_map = {
'scaling_group': 'scaling_group'
}
def _... | true | true |
1c39ad49a85e32bd9502c82c73065a4afe118bda | 8,495 | py | Python | Python/site_dpm/sandbox.py | JohnReid/biopsy | 1eeb714ba5b53f2ecf776d865d32e2078cbc0338 | [
"MIT"
] | null | null | null | Python/site_dpm/sandbox.py | JohnReid/biopsy | 1eeb714ba5b53f2ecf776d865d32e2078cbc0338 | [
"MIT"
] | null | null | null | Python/site_dpm/sandbox.py | JohnReid/biopsy | 1eeb714ba5b53f2ecf776d865d32e2078cbc0338 | [
"MIT"
] | null | null | null | #
# Copyright John Reid 2008, 2009
#
"""
Code to test various things in a sandbox environment.
"""
import sys, csv, time
from gene_set_enrichment import kegg_and_inoh_gene_sets
if '__main__' == __name__:
for i in xrange(100):
print i
time.sleep(1)
raise ''
def genes_in_term(go_analysi... | 31.117216 | 155 | 0.60977 |
"""
Code to test various things in a sandbox environment.
"""
import sys, csv, time
from gene_set_enrichment import kegg_and_inoh_gene_sets
if '__main__' == __name__:
for i in xrange(100):
print i
time.sleep(1)
raise ''
def genes_in_term(go_analysis, term):
return set(r.gen... | false | true |
1c39addef70fc81489f275799f6061afc78af289 | 861 | py | Python | submissions/intro-heuristics/a.py | m-star18/atcoder | 08e475810516602fa088f87daf1eba590b4e07cc | [
"Unlicense"
] | 1 | 2021-05-10T01:16:28.000Z | 2021-05-10T01:16:28.000Z | submissions/intro-heuristics/a.py | m-star18/atcoder | 08e475810516602fa088f87daf1eba590b4e07cc | [
"Unlicense"
] | 3 | 2021-05-11T06:14:15.000Z | 2021-06-19T08:18:36.000Z | submissions/intro-heuristics/a.py | m-star18/atcoder | 08e475810516602fa088f87daf1eba590b4e07cc | [
"Unlicense"
] | null | null | null | def main():
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)
from copy import deepcopy
d = int(readline())
c = list(map(int, readline().split()))
s = [list(map(int, readline().split())... | 25.323529 | 62 | 0.475029 | def main():
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)
from copy import deepcopy
d = int(readline())
c = list(map(int, readline().split()))
s = [list(map(int, readline().split())... | true | true |
1c39adee80341aa646f0761cff680a6923e9d891 | 1,692 | py | Python | tests/pytests/integration/ssh/test_pillar.py | babs/salt | c536ea716d5308880b244e7980f4b659d86fc104 | [
"Apache-2.0"
] | 9,425 | 2015-01-01T05:59:24.000Z | 2022-03-31T20:44:05.000Z | tests/pytests/integration/ssh/test_pillar.py | babs/salt | c536ea716d5308880b244e7980f4b659d86fc104 | [
"Apache-2.0"
] | 33,507 | 2015-01-01T00:19:56.000Z | 2022-03-31T23:48:20.000Z | tests/pytests/integration/ssh/test_pillar.py | babs/salt | c536ea716d5308880b244e7980f4b659d86fc104 | [
"Apache-2.0"
] | 5,810 | 2015-01-01T19:11:45.000Z | 2022-03-31T02:37:20.000Z | import pytest
pytestmark = [
pytest.mark.skip_on_windows(reason="salt-ssh not available on Windows"),
]
@pytest.fixture(scope="module")
def pillar_tree(base_env_pillar_tree_root_dir):
top_file = """
base:
'localhost':
- basic
'127.0.0.1':
- basic
"""
basic_pillar_file ... | 24.171429 | 82 | 0.653664 | import pytest
pytestmark = [
pytest.mark.skip_on_windows(reason="salt-ssh not available on Windows"),
]
@pytest.fixture(scope="module")
def pillar_tree(base_env_pillar_tree_root_dir):
top_file = """
base:
'localhost':
- basic
'127.0.0.1':
- basic
"""
basic_pillar_file ... | true | true |
1c39adf53fcd5697c417989c6c11a8dc455d2458 | 1,571 | py | Python | src/raw/python/upload/upload_server.py | vietj/vertx-examples | 5725c83028c6da266e48c1635598bf5094cacd68 | [
"Apache-2.0"
] | 143 | 2015-01-13T15:32:09.000Z | 2020-09-27T20:37:13.000Z | src/raw/python/upload/upload_server.py | vietj/vertx-examples | 5725c83028c6da266e48c1635598bf5094cacd68 | [
"Apache-2.0"
] | 3 | 2015-04-24T15:38:49.000Z | 2015-08-20T15:06:15.000Z | src/raw/python/upload/upload_server.py | vietj/vertx-examples | 5725c83028c6da266e48c1635598bf5094cacd68 | [
"Apache-2.0"
] | 106 | 2015-01-04T12:00:58.000Z | 2020-04-22T11:52:05.000Z | # Copyright 2011 the original author or 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 a... | 29.092593 | 104 | 0.68746 |
import random
import string
from datetime import datetime
import vertx
from core.file_system import FileSystem
from core.streams import Pump
server = vertx.create_http_server()
fs = vertx.file_system()
@server.request_handler
def request_handler(req):
req.pause()
filename = ''
for i in ra... | false | true |
1c39ae3478a2d275b999096699a1f31a4a998cb7 | 9,008 | py | Python | pysnmp/proto/api/v1.py | spruning/pysnmp | 023b707f83bb1805dafdcd38ea5b1adfbf83d7e9 | [
"BSD-2-Clause"
] | null | null | null | pysnmp/proto/api/v1.py | spruning/pysnmp | 023b707f83bb1805dafdcd38ea5b1adfbf83d7e9 | [
"BSD-2-Clause"
] | null | null | null | pysnmp/proto/api/v1.py | spruning/pysnmp | 023b707f83bb1805dafdcd38ea5b1adfbf83d7e9 | [
"BSD-2-Clause"
] | null | null | null | #
# This file is part of pysnmp software.
#
# Copyright (c) 2005-2016, Ilya Etingof <ilya@glas.net>
# License: http://pysnmp.sf.net/license.html
#
from pyasn1.type import univ
from pysnmp.proto import rfc1155, rfc1157, error
from pysnmp import nextid
# Shortcuts to SNMP types
Integer = univ.Integer
OctetString = univ.... | 30.12709 | 111 | 0.658748 |
from pyasn1.type import univ
from pysnmp.proto import rfc1155, rfc1157, error
from pysnmp import nextid
Integer = univ.Integer
OctetString = univ.OctetString
Null = univ.Null
null = Null('')
ObjectIdentifier = univ.ObjectIdentifier
IpAddress = rfc1155.IpAddress
NetworkAddress = rfc1155.NetworkAddress
Counter =... | true | true |
1c39aeec153edc1e6962e2b55f5af78f7231ccd0 | 289 | py | Python | C+= language/c+=.py | rzhvn1/Homework-Ogogo | e7e5e48cf144f559a739a1acc7b19373034cda78 | [
"MIT"
] | null | null | null | C+= language/c+=.py | rzhvn1/Homework-Ogogo | e7e5e48cf144f559a739a1acc7b19373034cda78 | [
"MIT"
] | null | null | null | C+= language/c+=.py | rzhvn1/Homework-Ogogo | e7e5e48cf144f559a739a1acc7b19373034cda78 | [
"MIT"
] | null | null | null | num = int(input())
i = 0
while i < num:
count = 0
lst1 = list(map(int,input().split()))
a = lst1[0]
b = lst1[1]
n = lst1[2]
i += 1
while max(a,b) < n + 1:
if a < b:
a += b
else:
b += a
count += 1
print(count)
| 17 | 41 | 0.387543 | num = int(input())
i = 0
while i < num:
count = 0
lst1 = list(map(int,input().split()))
a = lst1[0]
b = lst1[1]
n = lst1[2]
i += 1
while max(a,b) < n + 1:
if a < b:
a += b
else:
b += a
count += 1
print(count)
| true | true |
1c39af69b80fed61354fb436e8fd71bdcf683c24 | 384 | py | Python | change.py | dongchirua/algorithms-101 | 4d25254e00c8003c6bba8d23dda6819771c6dec6 | [
"MIT"
] | null | null | null | change.py | dongchirua/algorithms-101 | 4d25254e00c8003c6bba8d23dda6819771c6dec6 | [
"MIT"
] | null | null | null | change.py | dongchirua/algorithms-101 | 4d25254e00c8003c6bba8d23dda6819771c6dec6 | [
"MIT"
] | null | null | null | # python2
import sys
def get_change(m, denominations=[1, 5, 10]):
result = 0
need = m
while len(denominations):
_d = denominations.pop()
ex = need // _d
if ex:
result += ex
need -= _d * ex
# write your code here
return result
if __name__ == '__main... | 18.285714 | 44 | 0.544271 |
import sys
def get_change(m, denominations=[1, 5, 10]):
result = 0
need = m
while len(denominations):
_d = denominations.pop()
ex = need // _d
if ex:
result += ex
need -= _d * ex
return result
if __name__ == '__main__':
n = int(sys.stdin.read... | true | true |
1c39b01bd0876f6004d3849aa2e645317e05b7c5 | 1,089 | py | Python | trading_strategies/01_线性回归.py | fadeawaylove/stock-trade-system | 133762e6459745fc6c818b43729c1ffff5b9c5ad | [
"Apache-2.0"
] | 3 | 2020-11-10T03:35:05.000Z | 2021-07-04T15:18:44.000Z | trading_strategies/01_线性回归.py | fadeawaylove/stock-trade-system | 133762e6459745fc6c818b43729c1ffff5b9c5ad | [
"Apache-2.0"
] | null | null | null | trading_strategies/01_线性回归.py | fadeawaylove/stock-trade-system | 133762e6459745fc6c818b43729c1ffff5b9c5ad | [
"Apache-2.0"
] | null | null | null | import pandas_datareader.data as web
import pandas as pd
import numpy as np
import datetime
import statsmodels.api as sm
from statsmodels import regression
import matplotlib.pyplot as plt
"""
Statsmodels是Python中一个强大的统计分析包,包含了回归分析、时间序列分析、假设检验等等的功能
"""
plt.rcParams['font.sans-serif'] = ['SimHei'] # 用来正常显示中文标签
plt.rcPa... | 25.325581 | 114 | 0.728191 | import pandas_datareader.data as web
import pandas as pd
import numpy as np
import datetime
import statsmodels.api as sm
from statsmodels import regression
import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif'] = ['SimHei']
plt.rcParams['axes.unicode_minus'] = False
df_stockload = web.DataReader("60079... | true | true |
1c39b121755a24fef045903cf06f39dea3bdc9bd | 2,499 | py | Python | lib/googlecloudsdk/core/console/style/text.py | kylewuolle/google-cloud-sdk | 75f09ebe779e99fdc3fd13b48621fe12bfaa11aa | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/core/console/style/text.py | kylewuolle/google-cloud-sdk | 75f09ebe779e99fdc3fd13b48621fe12bfaa11aa | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/core/console/style/text.py | kylewuolle/google-cloud-sdk | 75f09ebe779e99fdc3fd13b48621fe12bfaa11aa | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*- #
# Copyright 2018 Google Inc. 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 requir... | 28.078652 | 74 | 0.70108 |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import enum
class TextAttributes(object):
def __init__(self, format_str=None, color=None, attrs=None):
self._format_str = format_str
self._color = color
self._attrs = attrs or ... | true | true |
1c39b15409ff79a595f4ad11aa536b39a5c87464 | 18,652 | py | Python | summit/strategies/entmoot.py | dswigh/summit | a1cecdd41df8119005173b46ac45fb22472628d6 | [
"MIT"
] | 60 | 2020-09-10T00:00:03.000Z | 2022-03-08T10:45:02.000Z | summit/strategies/entmoot.py | dswigh/summit | a1cecdd41df8119005173b46ac45fb22472628d6 | [
"MIT"
] | 57 | 2020-09-07T11:06:15.000Z | 2022-02-16T16:30:48.000Z | summit/strategies/entmoot.py | dswigh/summit | a1cecdd41df8119005173b46ac45fb22472628d6 | [
"MIT"
] | 12 | 2020-09-07T12:43:19.000Z | 2022-02-26T09:58:01.000Z | from summit.strategies.base import Strategy
from summit.domain import *
from summit.utils.dataset import DataSet
import string
import numpy as np
import pandas as pd
class ENTMOOT(Strategy):
"""
Single-objective Bayesian optimization, using gradient-boosted trees
instead of Gaussian processes, via ENTMOO... | 38.939457 | 123 | 0.541122 | from summit.strategies.base import Strategy
from summit.domain import *
from summit.utils.dataset import DataSet
import string
import numpy as np
import pandas as pd
class ENTMOOT(Strategy):
def __init__(
self,
domain,
transform=None,
estimator_type=None,
std_estimator_ty... | true | true |
1c39b292b26a8cddc4fc1986b65f20b825c12457 | 3,858 | py | Python | tests/unit/benchmark/scenarios/networking/test_netperf_node.py | kkltcjk/1026 | c9926432e43602a5c00ee6134b2a8dec5f4a7e96 | [
"Apache-2.0"
] | null | null | null | tests/unit/benchmark/scenarios/networking/test_netperf_node.py | kkltcjk/1026 | c9926432e43602a5c00ee6134b2a8dec5f4a7e96 | [
"Apache-2.0"
] | null | null | null | tests/unit/benchmark/scenarios/networking/test_netperf_node.py | kkltcjk/1026 | c9926432e43602a5c00ee6134b2a8dec5f4a7e96 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
##############################################################################
# Copyright (c) 2015 Huawei Technologies Co.,Ltd and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompan... | 30.140625 | 78 | 0.581389 | true | true | |
1c39b414b0fdb99c1db936586f63ef8042de5f94 | 3,140 | py | Python | Django Server/smart_pot/settings.py | 5Volts/Smart-Pot | 0e1e23c65e40d02ea563c686f9d53ecbd991d710 | [
"MIT"
] | 2 | 2019-03-18T02:53:19.000Z | 2019-05-01T06:47:07.000Z | Django Server/smart_pot/settings.py | 5Volts/Smart-Pot | 0e1e23c65e40d02ea563c686f9d53ecbd991d710 | [
"MIT"
] | null | null | null | Django Server/smart_pot/settings.py | 5Volts/Smart-Pot | 0e1e23c65e40d02ea563c686f9d53ecbd991d710 | [
"MIT"
] | 1 | 2020-01-17T20:20:29.000Z | 2020-01-17T20:20:29.000Z | """
Django settings for smart_pot project.
Generated by 'django-admin startproject' using Django 2.1.5.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
... | 25.950413 | 91 | 0.69586 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '#b*$k($wsp$tw0uf(mx%$c@xj-0r8i!ydjo@pd(s)z861cst&h'
DEBUG = True
ALLOWED_HOSTS = ['10.0.0.178','tanrunen.hsd1.ca.comcast.net']
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django... | true | true |
1c39b4926af1f3f3265ab747f398e37edd4490d0 | 11,065 | py | Python | smartmon.py | chr4/node-exporter-textfile-collector-scripts | 23b0aa0d5b0db999795c752685b8b38d7a61e91a | [
"Apache-2.0"
] | 248 | 2019-08-05T11:31:01.000Z | 2022-03-30T05:59:53.000Z | smartmon.py | chr4/node-exporter-textfile-collector-scripts | 23b0aa0d5b0db999795c752685b8b38d7a61e91a | [
"Apache-2.0"
] | 72 | 2019-08-07T09:16:12.000Z | 2022-01-24T18:54:46.000Z | smartmon.py | chr4/node-exporter-textfile-collector-scripts | 23b0aa0d5b0db999795c752685b8b38d7a61e91a | [
"Apache-2.0"
] | 124 | 2019-08-04T09:45:55.000Z | 2022-03-17T00:40:13.000Z | #!/usr/bin/env python3
import argparse
import collections
import csv
import datetime
import decimal
import re
import shlex
import subprocess
import sys
device_info_re = re.compile(r'^(?P<k>[^:]+?)(?:(?:\sis|):)\s*(?P<v>.*)$')
ata_error_count_re = re.compile(
r'^Error (\d+) \[\d+\] occurred', re.MULTILINE)
self_t... | 28.227041 | 91 | 0.642657 |
import argparse
import collections
import csv
import datetime
import decimal
import re
import shlex
import subprocess
import sys
device_info_re = re.compile(r'^(?P<k>[^:]+?)(?:(?:\sis|):)\s*(?P<v>.*)$')
ata_error_count_re = re.compile(
r'^Error (\d+) \[\d+\] occurred', re.MULTILINE)
self_test_re = re.compile(r'... | true | true |
1c39b62f6f2c649c29dfa51dc505c3af2898db80 | 56,838 | py | Python | src/azure-cli/azure/cli/command_modules/acs/_help.py | chunyu3/azure-cli | 481df7ec3f42067bdf078692cb32e9a27baa6821 | [
"MIT"
] | null | null | null | src/azure-cli/azure/cli/command_modules/acs/_help.py | chunyu3/azure-cli | 481df7ec3f42067bdf078692cb32e9a27baa6821 | [
"MIT"
] | 1 | 2021-02-25T19:22:13.000Z | 2021-02-25T19:22:13.000Z | src/azure-cli/azure/cli/command_modules/acs/_help.py | chunyu3/azure-cli | 481df7ec3f42067bdf078692cb32e9a27baa6821 | [
"MIT"
] | 1 | 2021-08-10T02:08:51.000Z | 2021-08-10T02:08:51.000Z | # coding=utf-8
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------------------------... | 51.577132 | 337 | 0.732257 |
from knack.help_files import helps
helps['acs'] = """
type: group
short-summary: Manage Azure Container Services.
long-summary: |
ACS will be retired as a standalone service on January 31, 2020.
If you use the Kubernetes orchestrator, please migrate to AKS by January 31, 2020.
"""
helps['acs browse'... | true | true |
1c39b63189d497454d0be46622f33bef68588c43 | 4,451 | py | Python | nipyapi/nifi/models/processor_status_entity.py | Paul-Verardi/nipyapi | 7a709611d9cf30e4ce8943db4d4dd617f2f7c81c | [
"Apache-2.0"
] | null | null | null | nipyapi/nifi/models/processor_status_entity.py | Paul-Verardi/nipyapi | 7a709611d9cf30e4ce8943db4d4dd617f2f7c81c | [
"Apache-2.0"
] | 1 | 2018-11-13T21:01:33.000Z | 2018-11-13T21:01:33.000Z | nipyapi/nifi/models/processor_status_entity.py | Paul-Verardi/nipyapi | 7a709611d9cf30e4ce8943db4d4dd617f2f7c81c | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
NiFi Rest Api
The Rest Api provides programmatic access to command and control a NiFi instance in real time. Start and stop processors, monitor queues, query provenance data, and more. Each endpoint below includes a description, ... | 29.282895 | 479 | 0.577174 |
from pprint import pformat
from six import iteritems
import re
class ProcessorStatusEntity(object):
swagger_types = {
'processor_status': 'ProcessorStatusDTO',
'can_read': 'bool'
}
attribute_map = {
'processor_status': 'processorStatus',
'can_read': 'canRead'
}
... | true | true |
1c39b8723e21178c7dc9e88cd80aab540aecd383 | 13,923 | py | Python | sinergym/utils/callbacks.py | AlejandroCN7/sinergym | 4e89e478b5c939323e7ddf6a6ecf25a9a13251c6 | [
"MIT"
] | null | null | null | sinergym/utils/callbacks.py | AlejandroCN7/sinergym | 4e89e478b5c939323e7ddf6a6ecf25a9a13251c6 | [
"MIT"
] | null | null | null | sinergym/utils/callbacks.py | AlejandroCN7/sinergym | 4e89e478b5c939323e7ddf6a6ecf25a9a13251c6 | [
"MIT"
] | null | null | null | """Custom Callbacks for stable baselines 3 algorithms."""
import os
from typing import Optional, Union
import gym
import numpy as np
from stable_baselines3.common.callbacks import BaseCallback, EvalCallback
from stable_baselines3.common.env_util import is_wrapped
from stable_baselines3.common.vec_env import VecEnv, s... | 43.373832 | 147 | 0.606119 |
import os
from typing import Optional, Union
import gym
import numpy as np
from stable_baselines3.common.callbacks import BaseCallback, EvalCallback
from stable_baselines3.common.env_util import is_wrapped
from stable_baselines3.common.vec_env import VecEnv, sync_envs_normalization
from sinergym.utils.evaluation imp... | true | true |
1c39b9aca31c7993f8e67a738f983c9eb28d0bf7 | 1,205 | py | Python | models/block.py | uncleguanghui/bitcoin_toolkit | c5898d841201ccd3271adee43f7d116e6333e0d8 | [
"MIT"
] | null | null | null | models/block.py | uncleguanghui/bitcoin_toolkit | c5898d841201ccd3271adee43f7d116e6333e0d8 | [
"MIT"
] | 1 | 2020-10-12T01:52:50.000Z | 2021-06-22T10:29:10.000Z | models/block.py | uncleguanghui/bitcoin_toolkit | c5898d841201ccd3271adee43f7d116e6333e0d8 | [
"MIT"
] | 1 | 2021-03-26T15:18:26.000Z | 2021-03-26T15:18:26.000Z | from datetime import datetime
class Block:
def __init__(self,
block_hash: str,
*,
previous_hash: str = None,
height: int = None,
timestamp: datetime = None,
n_tx: int = None):
assert isinstance(block_hash... | 34.428571 | 94 | 0.575934 | from datetime import datetime
class Block:
def __init__(self,
block_hash: str,
*,
previous_hash: str = None,
height: int = None,
timestamp: datetime = None,
n_tx: int = None):
assert isinstance(block_hash... | true | true |
1c39ba30cf076499676c885c32fc3bc7af869d8a | 2,261 | py | Python | scripts/hunter/tracer.py | Duroktar/Wolf | c192d5c27eb2098e440f7726eb1bff40ed004db5 | [
"Apache-2.0"
] | 105 | 2018-02-07T22:07:47.000Z | 2022-03-31T18:16:47.000Z | scripts/hunter/tracer.py | Duroktar/Wolf | c192d5c27eb2098e440f7726eb1bff40ed004db5 | [
"Apache-2.0"
] | 57 | 2018-02-07T23:07:41.000Z | 2021-11-21T17:14:06.000Z | scripts/hunter/tracer.py | MalcomnM/Fox | f41e59305c1fb4c008f5e0d712e291525c2b39f2 | [
"Apache-2.0"
] | 10 | 2018-02-24T23:44:51.000Z | 2022-03-02T07:52:27.000Z | from __future__ import absolute_import
import sys
import threading
from .event import Event
class Tracer(object):
"""
Trace object.
"""
def __init__(self, threading_support=False):
self._handler = None
self._previous = None
self._threading_previous = None
self.threa... | 27.573171 | 115 | 0.57939 | from __future__ import absolute_import
import sys
import threading
from .event import Event
class Tracer(object):
def __init__(self, threading_support=False):
self._handler = None
self._previous = None
self._threading_previous = None
self.threading_support = threading_support
... | true | true |
1c39ba66fa608550e4cccc018cb87aabc2527ad6 | 1,705 | py | Python | tests/test_utils.py | suganthsundar/melano | 8e9dd57d3ce9945b18e64da6b0df30811018fbf0 | [
"MIT"
] | null | null | null | tests/test_utils.py | suganthsundar/melano | 8e9dd57d3ce9945b18e64da6b0df30811018fbf0 | [
"MIT"
] | null | null | null | tests/test_utils.py | suganthsundar/melano | 8e9dd57d3ce9945b18e64da6b0df30811018fbf0 | [
"MIT"
] | null | null | null | import nose
from melano.utils import (sort, group_by, count)
def test_utils_sort_single_key():
items = [dict(x=1), dict(x=4), dict(x=2)]
sorted_items = sort(items, 'x')
nose.tools.assert_list_equal(sorted_items, [dict(x=1), dict(x=2), dict(x=4)])
def test_utils_sort_multiple_keys():
items = [dict(x=... | 34.1 | 112 | 0.524927 | import nose
from melano.utils import (sort, group_by, count)
def test_utils_sort_single_key():
items = [dict(x=1), dict(x=4), dict(x=2)]
sorted_items = sort(items, 'x')
nose.tools.assert_list_equal(sorted_items, [dict(x=1), dict(x=2), dict(x=4)])
def test_utils_sort_multiple_keys():
items = [dict(x=... | true | true |
1c39bb0fc92c8274504c4a01918fd5834b1290c6 | 1,576 | py | Python | bindings/python/examples/feature_example.py | beckgom/wav2letter | 69ea72b2ea553d2792fa8a702ebe84fdb6b6f372 | [
"BSD-3-Clause"
] | 1 | 2019-06-25T03:29:55.000Z | 2019-06-25T03:29:55.000Z | bindings/python/examples/feature_example.py | beckgom/wav2letter | 69ea72b2ea553d2792fa8a702ebe84fdb6b6f372 | [
"BSD-3-Clause"
] | null | null | null | bindings/python/examples/feature_example.py | beckgom/wav2letter | 69ea72b2ea553d2792fa8a702ebe84fdb6b6f372 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# adapted from wav2letter/src/feature/test/MfccTest.cpp
import itertools as it
import os
import sys
from wav2letter.feature import FeatureParams, Mfcc
if len(sys.argv) != 2:
print(f"usage: {sys.argv[0]} feature_test_data_path", file=sys.stderr)
print(" (usually: <wav2letter_root>/sr... | 25.836066 | 85 | 0.687183 |
import itertools as it
import os
import sys
from wav2letter.feature import FeatureParams, Mfcc
if len(sys.argv) != 2:
print(f"usage: {sys.argv[0]} feature_test_data_path", file=sys.stderr)
print(" (usually: <wav2letter_root>/src/feature/test/data)", file=sys.stderr)
sys.exit(1)
data_path = sys.argv... | true | true |
1c39bb129b8916d3543e06f71819bd1661e4a778 | 592 | py | Python | gumroad_clone/products/migrations/0003_auto_20211223_1608.py | AlexanderTCHK/gumroad-clone | 39654243e581b918569772e410196557f71f6591 | [
"MIT"
] | 1 | 2022-01-22T13:43:30.000Z | 2022-01-22T13:43:30.000Z | gumroad_clone/products/migrations/0003_auto_20211223_1608.py | AlexanderTCHK/gumroad-clone | 39654243e581b918569772e410196557f71f6591 | [
"MIT"
] | null | null | null | gumroad_clone/products/migrations/0003_auto_20211223_1608.py | AlexanderTCHK/gumroad-clone | 39654243e581b918569772e410196557f71f6591 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.14 on 2021-12-23 10:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('products', '0002_product_user'),
]
operations = [
migrations.AddField(
model_name='product',
name='active',
... | 24.666667 | 108 | 0.592905 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('products', '0002_product_user'),
]
operations = [
migrations.AddField(
model_name='product',
name='active',
field=models.BooleanField(default=False),
... | true | true |
1c39bbc1bd2d09912707a6984ef94b6d42f347b5 | 1,397 | py | Python | src/litedesk/lib/airwatch/device.py | litedesk/litedesk-lib-airwatch | 19c47a50d606f966497a6e24fd892bca1bf11354 | [
"Apache-2.0"
] | 1 | 2016-12-22T07:10:45.000Z | 2016-12-22T07:10:45.000Z | src/litedesk/lib/airwatch/device.py | litedesk/litedesk-lib-airwatch | 19c47a50d606f966497a6e24fd892bca1bf11354 | [
"Apache-2.0"
] | null | null | null | src/litedesk/lib/airwatch/device.py | litedesk/litedesk-lib-airwatch | 19c47a50d606f966497a6e24fd892bca1bf11354 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014, Deutsche Telekom AG - Laboratories (T-Labs)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 32.488372 | 74 | 0.652112 |
from base import BaseObject
from app import App
class Device(BaseObject):
@classmethod
def search(cls, client, **kwargs):
endpoint = 'mdm/devices/search'
response = client.call_api('GET', endpoint, params=kwargs)
response.raise_for_status()
try:
retur... | true | true |
1c39bc31e2a7c8c1b35471d80affab37545856b8 | 2,134 | py | Python | phonenumbers/data/region_BH.py | ayushgoel/FixGoogleContacts | e49e58db6718bef8f95b6f767241605441c7fe41 | [
"MIT"
] | 2 | 2019-02-22T05:27:22.000Z | 2020-12-30T19:33:18.000Z | phonenumbers/data/region_BH.py | ayushgoel/FixGoogleContacts | e49e58db6718bef8f95b6f767241605441c7fe41 | [
"MIT"
] | null | null | null | phonenumbers/data/region_BH.py | ayushgoel/FixGoogleContacts | e49e58db6718bef8f95b6f767241605441c7fe41 | [
"MIT"
] | null | null | null | """Auto-generated file, do not edit by hand. BH metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_BH = PhoneMetadata(id='BH', country_code=973, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[136-9]\\d{7}', possible_number_pattern=... | 101.619048 | 246 | 0.741799 | from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_BH = PhoneMetadata(id='BH', country_code=973, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[136-9]\\d{7}', possible_number_pattern='\\d{8}'),
fixed_line=PhoneNumberDesc(national_number_pa... | true | true |
1c39bc742127d4a9e7c8c6db4eb2ca4162e43bb9 | 5,727 | py | Python | pontoon/sync/tests/__init__.py | nanopony/pontoon | ebd342922d04df2dfbbce23ac5a15ee1e71d50fe | [
"BSD-3-Clause"
] | null | null | null | pontoon/sync/tests/__init__.py | nanopony/pontoon | ebd342922d04df2dfbbce23ac5a15ee1e71d50fe | [
"BSD-3-Clause"
] | null | null | null | pontoon/sync/tests/__init__.py | nanopony/pontoon | ebd342922d04df2dfbbce23ac5a15ee1e71d50fe | [
"BSD-3-Clause"
] | null | null | null | import os.path
import factory
from mock import patch, PropertyMock
from pontoon.base.models import Project
from pontoon.base.tests import (
EntityFactory,
LocaleFactory,
ProjectFactory,
RepositoryFactory,
ResourceFactory,
TestCase,
TranslationFactory,
)
from pontoon.base.utils import aware... | 31.994413 | 93 | 0.654618 | import os.path
import factory
from mock import patch, PropertyMock
from pontoon.base.models import Project
from pontoon.base.tests import (
EntityFactory,
LocaleFactory,
ProjectFactory,
RepositoryFactory,
ResourceFactory,
TestCase,
TranslationFactory,
)
from pontoon.base.utils import aware... | true | true |
1c39bcc1055493300edcce4a7c74080af9c86f42 | 5,435 | py | Python | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/contact/tests.py | engineervix/cookiecutter-wagtail-vix | 6d0e33d3aebe75d25259c4c3bffea94d424d5522 | [
"MIT"
] | 8 | 2020-04-20T05:36:01.000Z | 2022-03-23T08:11:50.000Z | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/contact/tests.py | engineervix/cookiecutter-wagtail-vix | 6d0e33d3aebe75d25259c4c3bffea94d424d5522 | [
"MIT"
] | 165 | 2020-05-01T01:18:41.000Z | 2021-10-09T12:38:49.000Z | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/contact/tests.py | engineervix/cookiecutter-wagtail-vix | 6d0e33d3aebe75d25259c4c3bffea94d424d5522 | [
"MIT"
] | null | null | null | import pytest
from captcha.client import RecaptchaResponse
from django.apps import apps
from django.core import mail
from django.core.mail import BadHeaderError, send_mail
from wagtail.core.models import Page
from {{cookiecutter.project_slug}}.contact.apps import ContactConfig
from {{cookiecutter.project_slug}}.conta... | 31.057143 | 109 | 0.662374 | import pytest
from captcha.client import RecaptchaResponse
from django.apps import apps
from django.core import mail
from django.core.mail import BadHeaderError, send_mail
from wagtail.core.models import Page
from {{cookiecutter.project_slug}}.contact.apps import ContactConfig
from {{cookiecutter.project_slug}}.conta... | false | true |
1c39bd85b12944df9e3e4d4650fe72b4a9c113d5 | 211 | py | Python | Trivia.py | Plumbob/PythonDemos | fb008651ad72e5f07ded5da44a04ab996571fb4d | [
"Unlicense"
] | null | null | null | Trivia.py | Plumbob/PythonDemos | fb008651ad72e5f07ded5da44a04ab996571fb4d | [
"Unlicense"
] | null | null | null | Trivia.py | Plumbob/PythonDemos | fb008651ad72e5f07ded5da44a04ab996571fb4d | [
"Unlicense"
] | null | null | null |
def even_evens(some_list):
"""
Give a list 'some_list', return a list of only the even numbers from the
even indices of 'some_list'.
"""
return [x for x in some_list[::2] if x % 2 == 0]
| 17.583333 | 76 | 0.606635 |
def even_evens(some_list):
return [x for x in some_list[::2] if x % 2 == 0]
| true | true |
1c39bdaabf85888bdde2272e24f9b639e4b3bc26 | 4,042 | py | Python | digits/download_data/cifar10.py | dcmartin/digits | 4a16aef47226413eba232e268049678816281c7d | [
"BSD-3-Clause"
] | 1 | 2021-01-25T01:06:25.000Z | 2021-01-25T01:06:25.000Z | digits/download_data/cifar10.py | dcmartin/digits | 4a16aef47226413eba232e268049678816281c7d | [
"BSD-3-Clause"
] | null | null | null | digits/download_data/cifar10.py | dcmartin/digits | 4a16aef47226413eba232e268049678816281c7d | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved.
import pickle
import os
import tarfile
import PIL.Image
from .downloader import DataDownloader
class Cifar10Downloader(DataDownloader):
"""
See details about the CIFAR10 dataset here:
http://www.cs.toronto.edu/~kriz/cifar.html
"""... | 38.495238 | 113 | 0.567293 |
import pickle
import os
import tarfile
import PIL.Image
from .downloader import DataDownloader
class Cifar10Downloader(DataDownloader):
def urlList(self):
return [
'http://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz',
]
def uncompressData(self):
filename = 'cifar-... | true | true |
1c39bf2d260753f05acf235e773635b503489f9b | 328 | py | Python | core/urls.py | adankro/Mood-sensing-app | 9fe77a04c506d6bfb5f77cbd5c68d02a69758570 | [
"MIT"
] | null | null | null | core/urls.py | adankro/Mood-sensing-app | 9fe77a04c506d6bfb5f77cbd5c68d02a69758570 | [
"MIT"
] | 14 | 2020-02-11T23:12:48.000Z | 2022-03-11T23:29:00.000Z | core/urls.py | adankro/Mood-sensing-app | 9fe77a04c506d6bfb5f77cbd5c68d02a69758570 | [
"MIT"
] | 1 | 2020-07-06T03:29:57.000Z | 2020-07-06T03:29:57.000Z | from django.urls import path
from . import views
urlpatterns = [
path('Mood/', views.MoodView.as_view(), name='Mood-all'),
path('<int:user_id>', views.HappyPlacesView, name='HappyPlacesView'),
path('user/<int:userID>', views.stats, name='stats'),
#path('stats/<int:user_id>', stats, name="sta... | 29.818182 | 74 | 0.643293 | from django.urls import path
from . import views
urlpatterns = [
path('Mood/', views.MoodView.as_view(), name='Mood-all'),
path('<int:user_id>', views.HappyPlacesView, name='HappyPlacesView'),
path('user/<int:userID>', views.stats, name='stats'),
] | true | true |
1c39bfb5d105d684c875003b253f1ba0480ad5bc | 3,733 | py | Python | Tools/concat.py | ka10ryu1/keytouch_cam | a99fbb16d0c5054cf462602fb73c025924d77a8a | [
"MIT"
] | 7 | 2018-02-25T22:47:01.000Z | 2020-09-14T05:39:33.000Z | Tools/concat.py | ka10ryu1/human_delete | 042b0caacb5af31cfa9c71ae012d58e798777c8d | [
"MIT"
] | null | null | null | Tools/concat.py | ka10ryu1/human_delete | 042b0caacb5af31cfa9c71ae012d58e798777c8d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*-coding: utf-8 -*-
#
help = '複数の画像を任意の行列で結合する'
#
import os
import sys
import cv2
import argparse
import numpy as np
[sys.path.append(d) for d in ['./Tools/', '../Tools/'] if os.path.isdir(d)]
import func as F
import imgfunc as IMG
def command():
parser = argparse.ArgumentParser(descri... | 27.651852 | 82 | 0.584784 |
help = '複数の画像を任意の行列で結合する'
import os
import sys
import cv2
import argparse
import numpy as np
[sys.path.append(d) for d in ['./Tools/', '../Tools/'] if os.path.isdir(d)]
import func as F
import imgfunc as IMG
def command():
parser = argparse.ArgumentParser(description=help)
parser.add_argument('jpeg', na... | true | true |
1c39bfde332307ca3cad3187669e4c969cf0f51d | 320 | py | Python | clipSync/__init__.py | AravindVasudev/clip-sync | 8cf8c09687cbf1aa5db1fc95fd2e9a283b57e5ee | [
"MIT"
] | null | null | null | clipSync/__init__.py | AravindVasudev/clip-sync | 8cf8c09687cbf1aa5db1fc95fd2e9a283b57e5ee | [
"MIT"
] | null | null | null | clipSync/__init__.py | AravindVasudev/clip-sync | 8cf8c09687cbf1aa5db1fc95fd2e9a283b57e5ee | [
"MIT"
] | null | null | null | from flask import Flask
from flask_socketio import SocketIO
from tkinter import Tk
# App Instance
app = Flask(__name__)
app.config['SECRET_KEY'] = 'shamballa'
# SocketIO Init
socketio = SocketIO(app)
# tkinter window for reading clipboard
win = Tk()
win.withdraw()
from . import views
from . import clipboard_thread
| 17.777778 | 38 | 0.76875 | from flask import Flask
from flask_socketio import SocketIO
from tkinter import Tk
app = Flask(__name__)
app.config['SECRET_KEY'] = 'shamballa'
socketio = SocketIO(app)
win = Tk()
win.withdraw()
from . import views
from . import clipboard_thread
| true | true |
1c39c0426bd8361e249700059f1c06b48f11d7e8 | 41,711 | py | Python | nova/tests/unit/virt/libvirt/test_imagecache.py | nicholaskuechler/nova | ff412c3888b234eb123161cc4e6d0d0d69c0004e | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/virt/libvirt/test_imagecache.py | nicholaskuechler/nova | ff412c3888b234eb123161cc4e6d0d0d69c0004e | [
"Apache-2.0"
] | 5 | 2016-07-11T20:59:47.000Z | 2020-07-28T09:56:35.000Z | nova/tests/unit/virt/libvirt/test_imagecache.py | nicholaskuechler/nova | ff412c3888b234eb123161cc4e6d0d0d69c0004e | [
"Apache-2.0"
] | 3 | 2018-01-29T00:44:44.000Z | 2020-07-24T01:19:20.000Z | # Copyright 2012 Michael Still and Canonical Inc
# 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
#
# ... | 41.711 | 79 | 0.598068 |
import contextlib
import hashlib
import os
import time
import mock
from oslo_concurrency import processutils
from oslo_config import cfg
from oslo_log import formatters
from oslo_log import log as logging
from oslo_serialization import jsonutils
from oslo_utils import importutils
from six.moves import ... | true | true |
1c39c1888e907fdbe3085235d0ac84a0ebe35965 | 497 | py | Python | basicdevice/migrations/0002_status.py | dave-promulgare/Affinidi-Device | 5eb9ff08eed652066e102dd49aa9cb3c2d70fdbe | [
"Apache-2.0"
] | 1 | 2021-02-10T23:50:41.000Z | 2021-02-10T23:50:41.000Z | basicdevice/migrations/0002_status.py | dave-promulgare/Affinidi-Device | 5eb9ff08eed652066e102dd49aa9cb3c2d70fdbe | [
"Apache-2.0"
] | null | null | null | basicdevice/migrations/0002_status.py | dave-promulgare/Affinidi-Device | 5eb9ff08eed652066e102dd49aa9cb3c2d70fdbe | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.2.10 on 2021-02-02 21:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('basicdevice', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Status',
fields=[
('i... | 23.666667 | 114 | 0.567404 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('basicdevice', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Status',
fields=[
('id', models.AutoField(auto_created=True, primary_... | true | true |
1c39c36a39a1532ef2f99ac92d06f1d1552bc659 | 742 | py | Python | alipay/aop/api/response/AlipayMerchantItemFileUploadResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 1 | 2022-03-07T06:11:10.000Z | 2022-03-07T06:11:10.000Z | alipay/aop/api/response/AlipayMerchantItemFileUploadResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/AlipayMerchantItemFileUploadResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 1 | 2021-10-05T03:01:09.000Z | 2021-10-05T03:01:09.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayMerchantItemFileUploadResponse(AlipayResponse):
def __init__(self):
super(AlipayMerchantItemFileUploadResponse, self).__init__()
self._material_id = None
@... | 28.538462 | 109 | 0.725067 |
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayMerchantItemFileUploadResponse(AlipayResponse):
def __init__(self):
super(AlipayMerchantItemFileUploadResponse, self).__init__()
self._material_id = None
@property
def material_id(self):
... | true | true |
1c39c3b659c75e1d8cfc2b2b467ce2ec26bdd183 | 1,671 | py | Python | UpdateOpencv2.0/AllDetection2.0.py | sujitmandal/python | 9fbb1e5f58f9ff173874941dd2adb868088bf67a | [
"MIT"
] | 1 | 2019-04-10T15:43:16.000Z | 2019-04-10T15:43:16.000Z | UpdateOpencv2.0/AllDetection2.0.py | sujitmandal/python | 9fbb1e5f58f9ff173874941dd2adb868088bf67a | [
"MIT"
] | null | null | null | UpdateOpencv2.0/AllDetection2.0.py | sujitmandal/python | 9fbb1e5f58f9ff173874941dd2adb868088bf67a | [
"MIT"
] | null | null | null | import cv2
#Github: https://github.com/sujitmandal
#This programe is create by Sujit Mandal
"""
Github: https://github.com/sujitmandal
This programe is create by Sujit Mandal
LinkedIn : https://www.linkedin.com/in/sujit-mandal-91215013a/
Facebook : https://www.facebook.com/sujit.mandal.33671748
Twitter : https://twi... | 27.85 | 94 | 0.64991 | import cv2
face = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
eye = cv2.CascadeClassifier('haarcascade_eye.xml')
video = cv2.VideoCapture(0)
first_frame = None
while True:
check, frame = video.read()
print(frame)
faces = face.detectMultiScale(frame)
eyes = eye.detectMultiScale(... | true | true |
1c39c3dc873b6363195497dd6c13bdd0aecff7cd | 1,248 | py | Python | src/versioningit/hook.py | jenshnielsen/versioningit | b575e300ae2ea78e283254537cffd30135ae7fe6 | [
"MIT"
] | 17 | 2021-07-05T23:41:36.000Z | 2022-03-10T14:55:24.000Z | src/versioningit/hook.py | jenshnielsen/versioningit | b575e300ae2ea78e283254537cffd30135ae7fe6 | [
"MIT"
] | 20 | 2021-07-05T23:56:09.000Z | 2022-03-14T13:04:09.000Z | src/versioningit/hook.py | jenshnielsen/versioningit | b575e300ae2ea78e283254537cffd30135ae7fe6 | [
"MIT"
] | 4 | 2021-09-04T13:24:49.000Z | 2022-03-25T19:44:19.000Z | from pathlib import Path
from typing import Any
from .core import get_version
from .errors import NoTagError, NotSdistError, NotVersioningitError
from .logging import init_logging, log
def setuptools_finalizer(dist: Any) -> None:
"""
The entry point called by setuptools to retrieve the version for a project
... | 39 | 79 | 0.672276 | from pathlib import Path
from typing import Any
from .core import get_version
from .errors import NoTagError, NotSdistError, NotVersioningitError
from .logging import init_logging, log
def setuptools_finalizer(dist: Any) -> None:
init_logging()
# root of the source tree".
PROJECT_ROOT = Path().resolv... | true | true |
1c39c3e0a5de09df35a959cf57d62098a5fe12c1 | 1,971 | py | Python | backend/project/migrations/0001_initial.py | Tim6FTN/UKS | 3cf19f014cdc7845bf0b808b97c4e05dc49b062e | [
"MIT"
] | 1 | 2021-01-10T12:34:59.000Z | 2021-01-10T12:34:59.000Z | backend/project/migrations/0001_initial.py | Tim6FTN/UKS | 3cf19f014cdc7845bf0b808b97c4e05dc49b062e | [
"MIT"
] | 37 | 2021-01-07T22:31:25.000Z | 2021-02-20T10:59:46.000Z | backend/project/migrations/0001_initial.py | Tim6FTN/UKS | 3cf19f014cdc7845bf0b808b97c4e05dc49b062e | [
"MIT"
] | null | null | null | # Generated by Django 3.1.5 on 2021-02-20 09:18
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('repo... | 44.795455 | 141 | 0.621005 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('repository', '0001_initial'),
]
operations... | true | true |
1c39c4ad5cb383418629f41da5cebcb5e997f379 | 2,987 | py | Python | iqs_client/models/undefined_object.py | thomas-bc/mms-autocref | 1db6697f929a1c782c902923209389e337ec6961 | [
"Apache-2.0"
] | null | null | null | iqs_client/models/undefined_object.py | thomas-bc/mms-autocref | 1db6697f929a1c782c902923209389e337ec6961 | [
"Apache-2.0"
] | null | null | null | iqs_client/models/undefined_object.py | thomas-bc/mms-autocref | 1db6697f929a1c782c902923209389e337ec6961 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
IncQuery Server
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: 0.12.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class Undefi... | 26.433628 | 124 | 0.559759 |
import pprint
import re
import six
class UndefinedObject(object):
openapi_types = {
'unknown': 'str'
}
attribute_map = {
'unknown': 'unknown'
}
def __init__(self, unknown=None):
self._unknown = None
self.discriminator = None
if unknown is not N... | true | true |
1c39c6279e33098e6f563ad838b96d7935544f4f | 15,416 | py | Python | tests/helpers/test_dict.py | Centaurioun/PyFunceble | 59b809f3322118f7824195752c6015220738d4a0 | [
"Apache-2.0"
] | null | null | null | tests/helpers/test_dict.py | Centaurioun/PyFunceble | 59b809f3322118f7824195752c6015220738d4a0 | [
"Apache-2.0"
] | null | null | null | tests/helpers/test_dict.py | Centaurioun/PyFunceble | 59b809f3322118f7824195752c6015220738d4a0 | [
"Apache-2.0"
] | null | null | null | """
The tool to check the availability or syntax of domain, IP or URL.
::
██████╗ ██╗ ██╗███████╗██╗ ██╗███╗ ██╗ ██████╗███████╗██████╗ ██╗ ███████╗
██╔══██╗╚██╗ ██╔╝██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝██╔══██╗██║ ██╔════╝
██████╔╝ ╚████╔╝ █████╗ ██║ ██║██╔██╗ ██║██║ █████╗ █... | 27.528571 | 88 | 0.526207 |
import copy
import os
import tempfile
import unittest
from PyFunceble.helpers.dict import DictHelper
class TestDictHelper(unittest.TestCase):
def setUp(self) -> None:
self.test_subject = {
"Hello": "world",
"World": {"world": "hello"},
"funilrys": ["Fun", "Ilrys"],
... | true | true |
1c39c62bbe46fc73ad45448972754bd2cc90b8f4 | 2,976 | py | Python | scripts/test_retrieval_algorithms.py | liam-clink/pypret | c84e954efc12137c6b5ade4fae920d60a15d4875 | [
"MIT"
] | 36 | 2019-03-16T18:38:10.000Z | 2022-02-15T14:25:30.000Z | scripts/test_retrieval_algorithms.py | liam-clink/pypret | c84e954efc12137c6b5ade4fae920d60a15d4875 | [
"MIT"
] | 1 | 2019-06-24T21:32:14.000Z | 2019-07-03T12:46:28.000Z | scripts/test_retrieval_algorithms.py | liam-clink/pypret | c84e954efc12137c6b5ade4fae920d60a15d4875 | [
"MIT"
] | 12 | 2019-07-23T22:03:55.000Z | 2022-01-06T08:50:52.000Z | """ This script tests COPRA against a lot of different PNPS schemes
and compares it against PCGPA and ptychographic retrieval for SHG-FROG.
It reproduces the data of Fig. 4, 5 and 7 from [Geib2019]_.
Notes
-----
As we are using multiprocessing to speed up the parameter scan you may not be
able to run this script insi... | 38.153846 | 81 | 0.572581 | import path_helper
import pypret
from benchmarking import benchmark_retrieval, RetrievalResultPlot
from pathlib import Path
from concurrent import futures
configs = [
("shg-frog", "copra"),
("shg-frog", "pcgpa"),
("shg-frog", "pie"),
("pg-frog", "copra"),
("shg-tdp", "copra"),
("shg-dscan", "c... | true | true |
1c39c703ae95df60fc23f1e8f91243e265fca628 | 4,272 | py | Python | autopandas_v2/tests/engines.py | chyanju/autopandas | 16080ad12f0e8e7b0a614671aea1ed57b3fed7fe | [
"BSD-3-Clause"
] | 16 | 2019-08-13T02:49:44.000Z | 2022-02-08T03:14:34.000Z | autopandas_v2/tests/engines.py | chyanju/autopandas | 16080ad12f0e8e7b0a614671aea1ed57b3fed7fe | [
"BSD-3-Clause"
] | 2 | 2020-09-25T22:40:40.000Z | 2022-02-09T23:42:53.000Z | autopandas_v2/tests/engines.py | chyanju/autopandas | 16080ad12f0e8e7b0a614671aea1ed57b3fed7fe | [
"BSD-3-Clause"
] | 3 | 2021-07-06T10:30:36.000Z | 2022-01-11T23:21:31.000Z | import glob
import logging
import os
import unittest
from typing import List, Any
import pandas as pd
from autopandas_v2.generators.ml.networks.mocking.models import MockSelectModel, MockChainModel, MockSubsetsModel
from autopandas_v2.iospecs import IOSpec
from autopandas_v2.synthesis.search.engines.functions import ... | 33.637795 | 113 | 0.558755 | import glob
import logging
import os
import unittest
from typing import List, Any
import pandas as pd
from autopandas_v2.generators.ml.networks.mocking.models import MockSelectModel, MockChainModel, MockSubsetsModel
from autopandas_v2.iospecs import IOSpec
from autopandas_v2.synthesis.search.engines.functions import ... | true | true |
1c39c7226c0d97bf8a0631733cf56849f214b531 | 5,896 | py | Python | ask-sdk-model/ask_sdk_model/interfaces/alexa/presentation/apl/user_event.py | Signal-Kinetics/alexa-apis-for-python | abb8d3dce18a5510c48b215406ed36c024f01495 | [
"Apache-2.0"
] | 2 | 2021-10-30T06:52:48.000Z | 2021-11-16T12:34:16.000Z | ask-sdk-model/ask_sdk_model/interfaces/alexa/presentation/apl/user_event.py | Signal-Kinetics/alexa-apis-for-python | abb8d3dce18a5510c48b215406ed36c024f01495 | [
"Apache-2.0"
] | null | null | null | ask-sdk-model/ask_sdk_model/interfaces/alexa/presentation/apl/user_event.py | Signal-Kinetics/alexa-apis-for-python | abb8d3dce18a5510c48b215406ed36c024f01495 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file
# except in compliance with the License. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "lice... | 39.046358 | 182 | 0.627714 |
import pprint
import re
import six
import typing
from enum import Enum
from ask_sdk_model.request import Request
if typing.TYPE_CHECKING:
from typing import Dict, List, Optional, Union
from datetime import datetime
class UserEvent(Request):
deserialized_types = {
'object_type': ... | true | true |
1c39c75e116fe30ffafbf9832e70de19b45788e8 | 11,505 | py | Python | discovery-provider/integration_tests/queries/test_search.py | Tenderize/audius-protocol | aa15844e3f12812fe8aaa81e2cb6e5c5fa89ff51 | [
"Apache-2.0"
] | null | null | null | discovery-provider/integration_tests/queries/test_search.py | Tenderize/audius-protocol | aa15844e3f12812fe8aaa81e2cb6e5c5fa89ff51 | [
"Apache-2.0"
] | null | null | null | discovery-provider/integration_tests/queries/test_search.py | Tenderize/audius-protocol | aa15844e3f12812fe8aaa81e2cb6e5c5fa89ff51 | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
from src.models import Block, Follow, Playlist, Save, SaveType, Track, User, UserBalance
from src.queries.search_queries import (
playlist_search_query,
track_search_query,
user_search_query,
)
from src.tasks.index_aggregate_user import UPDATE_AGGREGATE_USER_QUERY
from src.uti... | 28.907035 | 88 | 0.54585 | from datetime import datetime
from src.models import Block, Follow, Playlist, Save, SaveType, Track, User, UserBalance
from src.queries.search_queries import (
playlist_search_query,
track_search_query,
user_search_query,
)
from src.tasks.index_aggregate_user import UPDATE_AGGREGATE_USER_QUERY
from src.uti... | true | true |
1c39c776ae095bb77e2c8b1c26d33151d9e9f281 | 138 | py | Python | Codewars/6kyu/write-number-in-expanded-form/Python/solution1.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | 7 | 2017-09-20T16:40:39.000Z | 2021-08-31T18:15:08.000Z | Codewars/6kyu/write-number-in-expanded-form/Python/solution1.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | null | null | null | Codewars/6kyu/write-number-in-expanded-form/Python/solution1.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | null | null | null | # Python - 3.6.0
expanded_form = lambda num: ' + '.join([s + '0' * (len(str(num)) - i - 1) for i, s in enumerate(str(num)) if s != '0'])
| 34.5 | 119 | 0.536232 |
expanded_form = lambda num: ' + '.join([s + '0' * (len(str(num)) - i - 1) for i, s in enumerate(str(num)) if s != '0'])
| true | true |
1c39ca5f5b2ce225491816f042cfead88503b22d | 4,299 | py | Python | lib/googlecloudsdk/command_lib/compute/tpus/util.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/command_lib/compute/tpus/util.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | 11 | 2020-02-29T02:51:12.000Z | 2022-03-30T23:20:08.000Z | lib/googlecloudsdk/command_lib/compute/tpus/util.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | 1 | 2020-07-24T18:47:35.000Z | 2020-07-24T18:47:35.000Z | # -*- coding: utf-8 -*- #
# Copyright 2017 Google LLC. 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 requir... | 36.12605 | 80 | 0.746453 |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from apitools.base.py import exceptions as apitools_exceptions
from googlecloudsdk.api_lib.services import exceptions
from googlecloudsdk.api_lib.services import peering
from googlecloudsdk.api... | true | true |
1c39cb12905b1cd1f69475bf120720cda699220e | 1,315 | py | Python | p1-stock-code/stock-code.py | cclai999/pyxl-stock | 3c0bb2f3e17f88770d16e9cb7171d56757a451b4 | [
"MIT"
] | null | null | null | p1-stock-code/stock-code.py | cclai999/pyxl-stock | 3c0bb2f3e17f88770d16e9cb7171d56757a451b4 | [
"MIT"
] | null | null | null | p1-stock-code/stock-code.py | cclai999/pyxl-stock | 3c0bb2f3e17f88770d16e9cb7171d56757a451b4 | [
"MIT"
] | 1 | 2020-12-27T01:55:19.000Z | 2020-12-27T01:55:19.000Z | import pandas as pd
from openpyxl import load_workbook
from tools import get_html_to_file
url1 = "https://isin.twse.com.tw/isin/class_main.jsp?owncode=&stockname=&isincode=&market=1&issuetype=1&industry_code=&Page=1&chklike=Y"
url2 = "https://isin.twse.com.tw/isin/class_main.jsp?owncode=&stockname=&isincode=&market=2... | 29.222222 | 136 | 0.710266 | import pandas as pd
from openpyxl import load_workbook
from tools import get_html_to_file
url1 = "https://isin.twse.com.tw/isin/class_main.jsp?owncode=&stockname=&isincode=&market=1&issuetype=1&industry_code=&Page=1&chklike=Y"
url2 = "https://isin.twse.com.tw/isin/class_main.jsp?owncode=&stockname=&isincode=&market=2... | true | true |
1c39cbb5e1345dbab2efda224099029126a685d6 | 1,959 | py | Python | spectrl/envs/finite_mdp.py | keyshor/high-nash | 3ac6e09c554ec94a227f3e76756983295860d665 | [
"MIT"
] | null | null | null | spectrl/envs/finite_mdp.py | keyshor/high-nash | 3ac6e09c554ec94a227f3e76756983295860d665 | [
"MIT"
] | null | null | null | spectrl/envs/finite_mdp.py | keyshor/high-nash | 3ac6e09c554ec94a227f3e76756983295860d665 | [
"MIT"
] | null | null | null | import gym
import numpy as np
class FiniteMDP(gym.Env):
'''
Finite Multi-agent MDPs
'''
def __init__(self, transitions, start_state, num_actions, max_steps=100, rewards={}):
'''
'transitions' is a dictionary mapping joint actions to transition matrices.
Eg:- transitions[(0... | 33.20339 | 90 | 0.60388 | import gym
import numpy as np
class FiniteMDP(gym.Env):
def __init__(self, transitions, start_state, num_actions, max_steps=100, rewards={}):
self.P = transitions
self.start_state = start_state
self.rewards = rewards
self.max_steps = max_steps
self.n = len(num_actions)
... | true | true |
1c39cc563fc605a827f88d7b504a38495a6f1f3d | 3,325 | py | Python | setup.py | nardi/iocursor | 11e88cec3efb8b94d4bde4a483572a5f135175a7 | [
"MIT"
] | 3 | 2021-06-01T16:53:15.000Z | 2022-02-14T07:02:53.000Z | setup.py | nardi/iocursor | 11e88cec3efb8b94d4bde4a483572a5f135175a7 | [
"MIT"
] | null | null | null | setup.py | nardi/iocursor | 11e88cec3efb8b94d4bde4a483572a5f135175a7 | [
"MIT"
] | 1 | 2021-07-01T16:35:14.000Z | 2021-07-01T16:35:14.000Z | #!/usr/bin/env python
# coding: utf-8
import configparser
import glob
import os
import sys
import setuptools
from distutils.command.clean import clean as _clean
from setuptools.command.build_ext import build_ext as _build_ext
from setuptools.command.sdist import sdist as _sdist
# --- `setup.py` commands ----------... | 28.913043 | 80 | 0.583459 |
import configparser
import glob
import os
import sys
import setuptools
from distutils.command.clean import clean as _clean
from setuptools.command.build_ext import build_ext as _build_ext
from setuptools.command.sdist import sdist as _sdist
class sdist(_sdist):
def run(self):
c = configpa... | true | true |
1c39cc6db1874258fd396af5c835ea5525aa73a3 | 4,354 | py | Python | doc/source/conf.py | 4383/tobiko | f8e6916db890021fa17ddbfc5e6007a25093c8cb | [
"Apache-2.0"
] | null | null | null | doc/source/conf.py | 4383/tobiko | f8e6916db890021fa17ddbfc5e6007a25093c8cb | [
"Apache-2.0"
] | null | null | null | doc/source/conf.py | 4383/tobiko | f8e6916db890021fa17ddbfc5e6007a25093c8cb | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Red Hat
#
# 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 ... | 32.014706 | 79 | 0.692696 |
import os
import sys
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
TOBIKO_DIR = os.path.abspath(os.path.join(BASE_DIR, "..", ".."))
sys.path.insert(0, TOBIKO_DIR)
project = 'Tobiko'
copyright = "2019, Red Hat"
author = "Tobiko's Team"
# The version info for the project you're docu... | true | true |
1c39cc78f7fc6d9dd231de1c9b2d6eebed2bd7ab | 3,627 | py | Python | official/cv/resnet/infer/ResNet152/sdk/main.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/resnet/infer/ResNet152/sdk/main.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/resnet/infer/ResNet152/sdk/main.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # coding=utf-8
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 34.542857 | 94 | 0.61759 |
import datetime
import json
import os
import sys
from StreamManagerApi import StreamManagerApi
from StreamManagerApi import MxDataInput
def run():
stream_manager_api = StreamManagerApi()
ret = stream_manager_api.InitManager()
if ret != 0:
print("Failed to init Stream manager,... | true | true |
1c39ccaa8632efa29bf1d6b281d47bd52b4b78c9 | 3,846 | py | Python | python/tvm/topi/cuda/searchsorted.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 4,640 | 2017-08-17T19:22:15.000Z | 2019-11-04T15:29:46.000Z | python/tvm/topi/cuda/searchsorted.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 3,022 | 2020-11-24T14:02:31.000Z | 2022-03-31T23:55:31.000Z | python/tvm/topi/cuda/searchsorted.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 1,352 | 2017-08-17T19:30:38.000Z | 2019-11-04T16:09:29.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 37.339806 | 93 | 0.658346 |
import tvm
from tvm import te
from .. import utils
from ..searchsorted import binary_search
def searchsorted(sorted_sequence, values, right, out_dtype="int64"):
def ir(sorted_sequence, values, indices):
ib = tvm.tir.ir_builder.create()
sorted_sequence_shape = sorted_sequence.shap... | true | true |
1c39cd8c4cf42ebac589fbb1076b1761f7dbaeff | 2,060 | py | Python | cardea/fhir/Reference.py | Hector-hedb12/Cardea | 75c75f343796555f08c4511d6427efd04261a105 | [
"MIT"
] | null | null | null | cardea/fhir/Reference.py | Hector-hedb12/Cardea | 75c75f343796555f08c4511d6427efd04261a105 | [
"MIT"
] | null | null | null | cardea/fhir/Reference.py | Hector-hedb12/Cardea | 75c75f343796555f08c4511d6427efd04261a105 | [
"MIT"
] | null | null | null | from .fhirbase import fhirbase
class Reference(fhirbase):
"""
A reference from one resource to another.
Attributes:
reference: A reference to a location at which the other resource is
found. The reference may be a relative reference, in which case it is
relative to the ser... | 39.615385 | 82 | 0.647087 | from .fhirbase import fhirbase
class Reference(fhirbase):
__name__ = 'Reference'
def __init__(self, dict_values=None):
self.reference = None
self.display = None
self.identifier = None
if dict_values:
self.set_attributes(dict_values)
... | true | true |
1c39d0ba68c5aa0475565e3a4ceea547d580d482 | 895 | py | Python | netqasm/examples/apps/three_nodes/app_charlie.py | Doomsk/netqasm | 5d6c6ad00c4e0f9ab0ec05518cfa827675f357e7 | [
"MIT"
] | null | null | null | netqasm/examples/apps/three_nodes/app_charlie.py | Doomsk/netqasm | 5d6c6ad00c4e0f9ab0ec05518cfa827675f357e7 | [
"MIT"
] | null | null | null | netqasm/examples/apps/three_nodes/app_charlie.py | Doomsk/netqasm | 5d6c6ad00c4e0f9ab0ec05518cfa827675f357e7 | [
"MIT"
] | null | null | null | from netqasm.logging.glob import get_netqasm_logger
from netqasm.sdk import EPRSocket
from netqasm.sdk.external import NetQASMConnection
logger = get_netqasm_logger()
def main(app_config):
epr_socket_alice = EPRSocket(
remote_app_name="alice", epr_socket_id=0, remote_epr_socket_id=1
)
epr_socket_... | 27.96875 | 72 | 0.69162 | from netqasm.logging.glob import get_netqasm_logger
from netqasm.sdk import EPRSocket
from netqasm.sdk.external import NetQASMConnection
logger = get_netqasm_logger()
def main(app_config):
epr_socket_alice = EPRSocket(
remote_app_name="alice", epr_socket_id=0, remote_epr_socket_id=1
)
epr_socket_... | true | true |
1c39d0c50c3baca0aa302babde060b258f61c9aa | 9,066 | py | Python | multimedia/south_migrations/0022_move_media.py | jbittel/django-multimedia | 4ddd5e6d9f4f680e2f4f68cc3616ced8f0fc2a43 | [
"BSD-3-Clause"
] | 19 | 2015-01-28T08:40:20.000Z | 2021-12-18T11:55:58.000Z | multimedia/south_migrations/0022_move_media.py | jbittel/django-multimedia | 4ddd5e6d9f4f680e2f4f68cc3616ced8f0fc2a43 | [
"BSD-3-Clause"
] | 2 | 2015-02-09T17:03:24.000Z | 2015-04-22T17:57:45.000Z | multimedia/south_migrations/0022_move_media.py | jbittel/django-multimedia | 4ddd5e6d9f4f680e2f4f68cc3616ced8f0fc2a43 | [
"BSD-3-Clause"
] | 4 | 2015-02-02T14:05:08.000Z | 2016-09-14T00:44:55.000Z | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
for audio in orm.Audio.objects.all():
old_profiles = audio.profiles.all()
... | 63.398601 | 195 | 0.539709 |
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
for audio in orm.Audio.objects.all():
old_profiles = audio.profiles.all()
media = orm... | true | true |
1c39d2ce35fa1d037a4d280d7d6f300feb05c36a | 23,359 | py | Python | armi/bookkeeping/memoryProfiler.py | bsculac/armi | 22399244a88e67fc09996981081f7d5aab7032b4 | [
"Apache-2.0"
] | null | null | null | armi/bookkeeping/memoryProfiler.py | bsculac/armi | 22399244a88e67fc09996981081f7d5aab7032b4 | [
"Apache-2.0"
] | null | null | null | armi/bookkeeping/memoryProfiler.py | bsculac/armi | 22399244a88e67fc09996981081f7d5aab7032b4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 TerraPower, 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 35.179217 | 115 | 0.593176 |
import gc
import logging
import tabulate
from typing import Optional
from armi import context
from armi import interfaces
from armi import mpiActions
from armi import runLog
from armi.reactor.composites import ArmiObject
try:
import psutil
_havePsutil = True
except ImportError:
runLog.... | true | true |
1c39d3c48cb80c4e4808e18b8ba1a690569e1369 | 2,070 | py | Python | gammapy/spectrum/tests/test_results.py | gabemery/gammapy | 99e5c5d38e4920dddd7bca41fb1539ccda8bea2d | [
"BSD-3-Clause"
] | null | null | null | gammapy/spectrum/tests/test_results.py | gabemery/gammapy | 99e5c5d38e4920dddd7bca41fb1539ccda8bea2d | [
"BSD-3-Clause"
] | null | null | null | gammapy/spectrum/tests/test_results.py | gabemery/gammapy | 99e5c5d38e4920dddd7bca41fb1539ccda8bea2d | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
import astropy.units as u
from ...utils.testing import assert_quantity_allclose
from ...utils.testing import requires_dependency, requires_data
from ..mod... | 39.807692 | 83 | 0.647343 |
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
import astropy.units as u
from ...utils.testing import assert_quantity_allclose
from ...utils.testing import requires_dependency, requires_data
from ..models import PowerLaw
from .. import SpectrumObservation, Spectru... | true | true |
1c39d3f944c9c5d2cf7faae8bf17a3e63cac88c4 | 3,703 | py | Python | models/layers/split_att_conv2d.py | HotaekHan/classification-pytorch | 41185301709280c78ce1e51e3c9bc5c4d23d6443 | [
"MIT"
] | 5 | 2020-11-19T02:03:55.000Z | 2021-07-13T12:26:05.000Z | models/layers/split_att_conv2d.py | HotaekHan/classification-pytorch | 41185301709280c78ce1e51e3c9bc5c4d23d6443 | [
"MIT"
] | 1 | 2020-11-23T13:21:20.000Z | 2020-12-01T11:45:09.000Z | models/layers/split_att_conv2d.py | HotaekHan/classification-pytorch | 41185301709280c78ce1e51e3c9bc5c4d23d6443 | [
"MIT"
] | 1 | 2021-07-13T13:04:16.000Z | 2021-07-13T13:04:16.000Z | """Split-Attention"""
import torch
from torch import nn
import torch.nn.functional as F
from torch.nn import Conv2d, Module, Linear, BatchNorm2d, ReLU
from torch.nn.modules.utils import _pair
__all__ = ['SplAtConv2d']
class SplAtConv2d(Module):
"""Split-Attention Conv2d
"""
def __init__(self, in_channels... | 36.303922 | 103 | 0.572239 |
import torch
from torch import nn
import torch.nn.functional as F
from torch.nn import Conv2d, Module, Linear, BatchNorm2d, ReLU
from torch.nn.modules.utils import _pair
__all__ = ['SplAtConv2d']
class SplAtConv2d(Module):
def __init__(self, in_channels, channels, kernel_size, stride=(1, 1), padding=(0, 0),
... | true | true |
1c39d450e97701185e55969fad7b43f942a77878 | 76 | py | Python | ABC038/ABC038f.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | ABC038/ABC038f.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | ABC038/ABC038f.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | #ABC038f
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
| 15.2 | 28 | 0.789474 |
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
| true | true |
1c39d47124c3ced2c1f626a08e83d57f514ab838 | 623 | py | Python | app/core/migrations/0004_auto_20190113_2046.py | jazziesf/scout-travel-api | 09cb599d869e0a67b94bc58803822774fa658c65 | [
"MIT"
] | null | null | null | app/core/migrations/0004_auto_20190113_2046.py | jazziesf/scout-travel-api | 09cb599d869e0a67b94bc58803822774fa658c65 | [
"MIT"
] | null | null | null | app/core/migrations/0004_auto_20190113_2046.py | jazziesf/scout-travel-api | 09cb599d869e0a67b94bc58803822774fa658c65 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.5 on 2019-01-13 20:46
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('core', '0003_pin_likes'),
]
operations = [
migrations.AddField(
model_name='pin',
name=... | 23.961538 | 86 | 0.585875 |
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('core', '0003_pin_likes'),
]
operations = [
migrations.AddField(
model_name='pin',
name='dish',
field=models.CharField(defa... | true | true |
1c39d5bf3f5bb26180c473498b62eef86a13aa48 | 3,077 | py | Python | src/conversor.py | xandao6/url-to-desktop | 750dc0db9717e0e50e3af3f2c1ac8fb7047cb375 | [
"MIT"
] | 1 | 2020-02-23T13:47:19.000Z | 2020-02-23T13:47:19.000Z | src/conversor.py | xandao6/url-to-desktop | 750dc0db9717e0e50e3af3f2c1ac8fb7047cb375 | [
"MIT"
] | null | null | null | src/conversor.py | xandao6/url-to-desktop | 750dc0db9717e0e50e3af3f2c1ac8fb7047cb375 | [
"MIT"
] | 1 | 2020-01-20T05:11:14.000Z | 2020-01-20T05:11:14.000Z | import os, shutil, fire
from typing import List, Optional
from pyfiglet import Figlet
def main(path: Optional[str] = None) -> None:
__print_logo('url - desktop')
fire.Fire(__convert)
def __convert(path: Optional[str] = None) -> None:
if path is None:
path = os.getcwd()
try:
url_list... | 29.028302 | 86 | 0.653884 | import os, shutil, fire
from typing import List, Optional
from pyfiglet import Figlet
def main(path: Optional[str] = None) -> None:
__print_logo('url - desktop')
fire.Fire(__convert)
def __convert(path: Optional[str] = None) -> None:
if path is None:
path = os.getcwd()
try:
url_list... | true | true |
1c39d5cea93358a6f1f58385273c38feaecd9d64 | 2,746 | py | Python | cogs/counting.py | rssnyder/discord-bot | 0430515abf49e94529c064574f23bf9d48fcf6e1 | [
"MIT"
] | 1 | 2022-03-31T20:30:55.000Z | 2022-03-31T20:30:55.000Z | cogs/counting.py | rssnyder/discord-bot | 0430515abf49e94529c064574f23bf9d48fcf6e1 | [
"MIT"
] | null | null | null | cogs/counting.py | rssnyder/discord-bot | 0430515abf49e94529c064574f23bf9d48fcf6e1 | [
"MIT"
] | null | null | null | from discord.ext import commands
class Counting(commands.Cog):
def __init__(self, client):
self.client = client
@commands.Cog.listener()
async def on_ready(self):
print('Counting cog ready')
@commands.Cog.listener()
async def on_message(self, message):
# Don't do this in... | 34.759494 | 125 | 0.557174 | from discord.ext import commands
class Counting(commands.Cog):
def __init__(self, client):
self.client = client
@commands.Cog.listener()
async def on_ready(self):
print('Counting cog ready')
@commands.Cog.listener()
async def on_message(self, message):
if not me... | true | true |
1c39d6ee5aa7792bea311f30b618e62f61c84356 | 1,476 | py | Python | python-examples/classical-mds-image.py | amazing89/mathtoolbox | 8904bb06ced2ac501594f9574ef1ba3454b8e38e | [
"MIT"
] | 1 | 2020-02-01T03:39:24.000Z | 2020-02-01T03:39:24.000Z | python-examples/classical-mds-image.py | amazing89/mathtoolbox | 8904bb06ced2ac501594f9574ef1ba3454b8e38e | [
"MIT"
] | null | null | null | python-examples/classical-mds-image.py | amazing89/mathtoolbox | 8904bb06ced2ac501594f9574ef1ba3454b8e38e | [
"MIT"
] | null | null | null | import pymathtoolbox
import numpy as np
import matplotlib.pyplot as plt
import os
import seaborn as sns
from PIL import Image
from scipy.spatial.distance import pdist, squareform
# Load an image
asset_dir_path = os.path.dirname(os.path.abspath(__file__)) + "/assets"
image = Image.open(asset_dir_path + "/autumn-leaves.... | 25.894737 | 72 | 0.732385 | import pymathtoolbox
import numpy as np
import matplotlib.pyplot as plt
import os
import seaborn as sns
from PIL import Image
from scipy.spatial.distance import pdist, squareform
asset_dir_path = os.path.dirname(os.path.abspath(__file__)) + "/assets"
image = Image.open(asset_dir_path + "/autumn-leaves.jpg")
resized_i... | true | true |
1c39d8b39e4b2b44f37d76664f9ffbf7dbb1a736 | 540 | py | Python | Python/Para Checker.py | bhupendpatil/Practice | 9663b3f41e359787cbbd04aedb3db3c605c6ec8e | [
"MIT"
] | 1 | 2020-12-23T06:22:29.000Z | 2020-12-23T06:22:29.000Z | Python/Para Checker.py | bhupendpatil/Practice | 9663b3f41e359787cbbd04aedb3db3c605c6ec8e | [
"MIT"
] | 8 | 2020-06-18T19:32:39.000Z | 2022-03-11T11:37:07.000Z | Python/Para Checker.py | bhupendpatil/Practice | 9663b3f41e359787cbbd04aedb3db3c605c6ec8e | [
"MIT"
] | 1 | 2021-01-19T00:16:34.000Z | 2021-01-19T00:16:34.000Z | from Properties import Stack
def par_checker(symbol_string):
s = Stack()
balanced = True
index = 0
while index < len(symbol_string) and balanced:
symbol = symbol_string[index]
if symbol=='(':
s.push(symbol)
else:
if s.is_empty():
balanced ... | 21.6 | 50 | 0.522222 | from Properties import Stack
def par_checker(symbol_string):
s = Stack()
balanced = True
index = 0
while index < len(symbol_string) and balanced:
symbol = symbol_string[index]
if symbol=='(':
s.push(symbol)
else:
if s.is_empty():
balanced ... | true | true |
1c39d8bec0f0297cd94594c0cd15fb0cea38d8c7 | 2,032 | py | Python | Code/venv/src/Account/admin.py | WebMetadataRetrieval/15-Web_Metadata_Retrieval | 96a9c8869ccc5429c4de9e97d37705bbb9e19c5b | [
"Apache-2.0"
] | null | null | null | Code/venv/src/Account/admin.py | WebMetadataRetrieval/15-Web_Metadata_Retrieval | 96a9c8869ccc5429c4de9e97d37705bbb9e19c5b | [
"Apache-2.0"
] | 38 | 2021-04-01T18:09:31.000Z | 2021-05-08T17:27:03.000Z | Code/venv/src/Account/admin.py | WebMetadataRetrieval/15-Web_Metadata_Retrieval | 96a9c8869ccc5429c4de9e97d37705bbb9e19c5b | [
"Apache-2.0"
] | 3 | 2021-04-16T07:25:11.000Z | 2022-01-29T10:24:33.000Z | from django.contrib import admin
from django import forms
from .models import UserAccount
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.forms import ReadOnlyPasswordHashField
from django.contrib.auth.models import Group
class UserCreationForm(forms.ModelForm):
password1 = forms.CharFie... | 29.449275 | 127 | 0.662402 | from django.contrib import admin
from django import forms
from .models import UserAccount
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.forms import ReadOnlyPasswordHashField
from django.contrib.auth.models import Group
class UserCreationForm(forms.ModelForm):
password1 = forms.CharFie... | true | true |
1c39d90848805f177260a317dc93179e49b0e348 | 846 | py | Python | test/test_cart_coupon.py | gstingy/uc_python_api | 9a0bd3f6e63f616586681518e44fe37c6bae2bba | [
"Apache-2.0"
] | null | null | null | test/test_cart_coupon.py | gstingy/uc_python_api | 9a0bd3f6e63f616586681518e44fe37c6bae2bba | [
"Apache-2.0"
] | null | null | null | test/test_cart_coupon.py | gstingy/uc_python_api | 9a0bd3f6e63f616586681518e44fe37c6bae2bba | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
UltraCart Rest API V2
UltraCart REST API Version 2
OpenAPI spec version: 2.0.0
Contact: support@ultracart.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
import unittest
import ultracart
f... | 18.8 | 79 | 0.680851 |
from __future__ import absolute_import
import os
import sys
import unittest
import ultracart
from ultracart.rest import ApiException
from ultracart.models.cart_coupon import CartCoupon
class TestCartCoupon(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test... | true | true |
1c39d9f362d75c3f11fa331666751886a38a5eeb | 1,930 | py | Python | Source/GridWorldDrivingDQNMain.py | claytonkanderson/SimplyRL | 3e808f519f174d081c80c04a8adba88cf93c9c9d | [
"MIT"
] | null | null | null | Source/GridWorldDrivingDQNMain.py | claytonkanderson/SimplyRL | 3e808f519f174d081c80c04a8adba88cf93c9c9d | [
"MIT"
] | null | null | null | Source/GridWorldDrivingDQNMain.py | claytonkanderson/SimplyRL | 3e808f519f174d081c80c04a8adba88cf93c9c9d | [
"MIT"
] | null | null | null | import numpy as np
import gym
from time import time
from keras.models import Sequential
from keras.layers import Dense, Activation, Flatten
from keras.optimizers import Adam
from keras.callbacks import TensorBoard
from rl.agents.dqn import DQNAgent
from rl.policy import BoltzmannQPolicy
from rl.memory import Sequenti... | 33.275862 | 109 | 0.774093 | import numpy as np
import gym
from time import time
from keras.models import Sequential
from keras.layers import Dense, Activation, Flatten
from keras.optimizers import Adam
from keras.callbacks import TensorBoard
from rl.agents.dqn import DQNAgent
from rl.policy import BoltzmannQPolicy
from rl.memory import Sequenti... | true | true |
1c39da935d7fec5f8dd0559596ea48273ebc07a6 | 3,864 | py | Python | src/SurvivalCalculator/calculator/views.py | computer-geek64/covid19-survival-calculator | c52879ca562220bdfd5634f3d83ed09df18ea771 | [
"MIT"
] | 3 | 2020-03-31T17:01:46.000Z | 2020-06-25T02:57:10.000Z | src/SurvivalCalculator/calculator/views.py | varunlakshmanan/covid19-survival-calculator | 33b447f8dc99ed5060a117b68b362403ec0b6e38 | [
"MIT"
] | null | null | null | src/SurvivalCalculator/calculator/views.py | varunlakshmanan/covid19-survival-calculator | 33b447f8dc99ed5060a117b68b362403ec0b6e38 | [
"MIT"
] | 2 | 2020-03-30T17:05:26.000Z | 2020-03-30T17:49:02.000Z | from django.shortcuts import render
from django.http import HttpResponse
import os
import sys
import json
import math
import numpy as np
import requests
import pandas as pd
from subprocess import Popen, PIPE
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
from data import dataset
from model... | 40.25 | 184 | 0.709886 | from django.shortcuts import render
from django.http import HttpResponse
import os
import sys
import json
import math
import numpy as np
import requests
import pandas as pd
from subprocess import Popen, PIPE
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
from data import dataset
from model... | true | true |
1c39db80e816be69da88de2b0f5d099c1655af9d | 75 | py | Python | tests/test_water.py | fladi/qraz | 7e2fb4b9dc1decb3f5aa390990c02091d4326ef8 | [
"BSD-2-Clause"
] | null | null | null | tests/test_water.py | fladi/qraz | 7e2fb4b9dc1decb3f5aa390990c02091d4326ef8 | [
"BSD-2-Clause"
] | null | null | null | tests/test_water.py | fladi/qraz | 7e2fb4b9dc1decb3f5aa390990c02091d4326ef8 | [
"BSD-2-Clause"
] | null | null | null |
import water
def test_main():
assert water # use your library here
| 10.714286 | 41 | 0.693333 |
import water
def test_main():
assert water
| true | true |
1c39dc85d475051c67b7ea6d510ba498bd7b66ba | 30,533 | py | Python | dual_annealing.py | website-fingerprinting/minipatch | 682d86c0eca5331a8c001e83003cf79b5d4b1a78 | [
"MIT"
] | null | null | null | dual_annealing.py | website-fingerprinting/minipatch | 682d86c0eca5331a8c001e83003cf79b5d4b1a78 | [
"MIT"
] | null | null | null | dual_annealing.py | website-fingerprinting/minipatch | 682d86c0eca5331a8c001e83003cf79b5d4b1a78 | [
"MIT"
] | null | null | null | # Dual Annealing implementation.
# Copyright (c) 2018 Sylvain Gubian <sylvain.gubian@pmi.com>,
# Yang Xiang <yang.xiang@pmi.com>
# Author: Sylvain Gubian, Yang Xiang, PMP S.A.
"""
A slight modification to Scipy's implementation of simulated annealing.
Fix bug in implementation of formula in p. 398 of reference [2] (li... | 43.125706 | 91 | 0.616219 |
from __future__ import division, print_function, absolute_import
import numpy as np
from scipy.optimize import OptimizeResult
from scipy.optimize import minimize
from scipy.special import gammaln
from scipy._lib._util import check_random_state
__all__ = ['dual_annealing']
class VisitingDistribution(object):
... | true | true |
1c39dccda5ab4c3452bd526b158464ab5404df36 | 3,169 | py | Python | splay_tree_trace.py | andribas404/splay_benchmark | 1ba2fe4d715b25db806c0b241c6adadd8d442a77 | [
"MIT"
] | null | null | null | splay_tree_trace.py | andribas404/splay_benchmark | 1ba2fe4d715b25db806c0b241c6adadd8d442a77 | [
"MIT"
] | null | null | null | splay_tree_trace.py | andribas404/splay_benchmark | 1ba2fe4d715b25db806c0b241c6adadd8d442a77 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Trace splay tree."""
import inspect
import logging
import os
import pygraphviz as pgv
from splay_tree_orig import SplayTree
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)
os.makedirs("graph", exist_ok=True)
def for_all_methods(decora... | 25.556452 | 144 | 0.577469 |
import inspect
import logging
import os
import pygraphviz as pgv
from splay_tree_orig import SplayTree
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)
os.makedirs("graph", exist_ok=True)
def for_all_methods(decorator):
def decorate(cls):
members = inspect.getmembers(cl... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.