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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c3221aae6ede31defc7380c964dc41d657f7f66 | 15,720 | py | Python | sdk/python/lib/pulumi/output.py | geekflyer/pulumi | ea8ababc87fba54c86cf378b45531b34bdbcf488 | [
"Apache-2.0"
] | null | null | null | sdk/python/lib/pulumi/output.py | geekflyer/pulumi | ea8ababc87fba54c86cf378b45531b34bdbcf488 | [
"Apache-2.0"
] | null | null | null | sdk/python/lib/pulumi/output.py | geekflyer/pulumi | ea8ababc87fba54c86cf378b45531b34bdbcf488 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016-2018, Pulumi 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 applicable law or agreed t... | 42.833787 | 120 | 0.6493 |
import asyncio
from functools import reduce
from inspect import isawaitable
from typing import (
TypeVar,
Generic,
Set,
Callable,
Awaitable,
Union,
cast,
Mapping,
Any,
List,
Optional,
TYPE_CHECKING
)
from . import runtime
from .runtime import known_types
fro... | true | true |
1c3221b1423884c0752522c0a00db79476896656 | 305 | py | Python | Testprogramm1.py | bogdanevropin/euler_project_tasks | 0a5470ce125112e54d15eddb580f201d13ead8af | [
"MIT"
] | null | null | null | Testprogramm1.py | bogdanevropin/euler_project_tasks | 0a5470ce125112e54d15eddb580f201d13ead8af | [
"MIT"
] | null | null | null | Testprogramm1.py | bogdanevropin/euler_project_tasks | 0a5470ce125112e54d15eddb580f201d13ead8af | [
"MIT"
] | null | null | null | from collections import namedtuple
class Point:
def __init__(self, x, y):
self.x = x
self.y = y
def __eq__(self, other):
return self.x == other.x and self.y == other.y
namedtuple("Point", ["x", "y"])
p1 = Point(x=1, y=2)
p2 = Point(x=1, y=2)
print(p1 == p2) | 21.785714 | 55 | 0.547541 | from collections import namedtuple
class Point:
def __init__(self, x, y):
self.x = x
self.y = y
def __eq__(self, other):
return self.x == other.x and self.y == other.y
namedtuple("Point", ["x", "y"])
p1 = Point(x=1, y=2)
p2 = Point(x=1, y=2)
print(p1 == p2) | true | true |
1c32229d98353ca496267864784a5724cba819aa | 2,620 | py | Python | python/isomorphicGraph.py | quasarbright/quasarbright.github.io | 942710adf4a2531d033023a6f750efeddf3e9050 | [
"MIT"
] | 1 | 2021-01-23T13:50:34.000Z | 2021-01-23T13:50:34.000Z | python/isomorphicGraph.py | quasarbright/quasarbright.github.io | 942710adf4a2531d033023a6f750efeddf3e9050 | [
"MIT"
] | 40 | 2018-02-19T19:37:24.000Z | 2022-03-25T18:34:22.000Z | python/isomorphicGraph.py | quasarbright/quasarbright.github.io | 942710adf4a2531d033023a6f750efeddf3e9050 | [
"MIT"
] | 1 | 2018-12-07T03:07:21.000Z | 2018-12-07T03:07:21.000Z | from mylib.graph import *
from mylib.lexicographic import allPerms
import unittest
# black widow shape isometric to square, not isometric to complete-ish graph
# 1 2
# 3 4
# black widow cycle
G1 = DiGraph()
G1.add_node(1, 2, 3, 4)
G1.set_edge(1, 2)
G1.set_edge(2, 3)
G1.set_edge(3, 4)
G1.set_edge(4, 1)
# square cycle
G... | 28.791209 | 114 | 0.632824 | from mylib.graph import *
from mylib.lexicographic import allPerms
import unittest
G1 = DiGraph()
G1.add_node(1, 2, 3, 4)
G1.set_edge(1, 2)
G1.set_edge(2, 3)
G1.set_edge(3, 4)
G1.set_edge(4, 1)
G2 = DiGraph()
G2.add_node(1, 2, 3, 4)
G2.set_edge(1, 2)
G2.set_edge(2, 4)
G2.set_edge(4, 3)
G2.set_edge(3, 1)
G3 = DiG... | true | true |
1c32237ec1440617631c2e2acb5b09c97e6cdc5c | 162 | py | Python | sandbox/bisect_test.py | battez/python-data-mining-platform | 977e68b6e78be6dc5b4d680ad2789ba54ebe47e1 | [
"BSD-3-Clause"
] | 6 | 2015-02-11T04:25:36.000Z | 2021-04-22T05:03:34.000Z | sandbox/bisect_test.py | battez/python-data-mining-platform | 977e68b6e78be6dc5b4d680ad2789ba54ebe47e1 | [
"BSD-3-Clause"
] | null | null | null | sandbox/bisect_test.py | battez/python-data-mining-platform | 977e68b6e78be6dc5b4d680ad2789ba54ebe47e1 | [
"BSD-3-Clause"
] | 4 | 2015-02-09T03:58:52.000Z | 2018-06-02T09:02:55.000Z | import bisect
a = [1,3,5,5,7,9]
x = bisect.bisect_left(a, 6, 2, 4)
print x
x = bisect.bisect_left(a, 7, 2, 4)
print x
x = bisect.bisect_left(a, 5, 2, 4)
print x
| 16.2 | 34 | 0.635802 | import bisect
a = [1,3,5,5,7,9]
x = bisect.bisect_left(a, 6, 2, 4)
print x
x = bisect.bisect_left(a, 7, 2, 4)
print x
x = bisect.bisect_left(a, 5, 2, 4)
print x
| false | true |
1c3223d8a0512ae4da1b50c7e86aec30f1708775 | 30,072 | py | Python | airflow/providers/google/cloud/hooks/tasks.py | gtossou/airflow | 0314a3a218f864f78ec260cc66134e7acae34bc5 | [
"Apache-2.0"
] | 79 | 2021-10-15T07:32:27.000Z | 2022-03-28T04:10:19.000Z | airflow/providers/google/cloud/hooks/tasks.py | gtossou/airflow | 0314a3a218f864f78ec260cc66134e7acae34bc5 | [
"Apache-2.0"
] | 153 | 2021-10-15T05:23:46.000Z | 2022-02-23T06:07:10.000Z | airflow/providers/google/cloud/hooks/tasks.py | gtossou/airflow | 0314a3a218f864f78ec260cc66134e7acae34bc5 | [
"Apache-2.0"
] | 23 | 2021-10-15T02:36:37.000Z | 2022-03-17T02:59:27.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 44.485207 | 110 | 0.649874 |
from typing import Dict, List, Optional, Sequence, Tuple, Union
from google.api_core.retry import Retry
from google.cloud.tasks_v2 import CloudTasksClient, enums
from google.cloud.tasks_v2.types import FieldMask, Queue, Task
from airflow.exceptions import AirflowException
from airflow.providers.goog... | true | true |
1c322545bc207fa9edba4b2993b4a25a2b58c14c | 1,515 | py | Python | app/utils/redis.py | edementyev/wakeupbot | 975b95efe6845589046cf185da241a4aa255caf7 | [
"MIT"
] | 1 | 2020-10-07T12:09:21.000Z | 2020-10-07T12:09:21.000Z | app/utils/redis.py | edementyev/wakeupbot | 975b95efe6845589046cf185da241a4aa255caf7 | [
"MIT"
] | 7 | 2020-12-07T09:11:01.000Z | 2022-03-02T18:15:01.000Z | app/utils/redis.py | edementyev/wakeupbot | 975b95efe6845589046cf185da241a4aa255caf7 | [
"MIT"
] | null | null | null | from typing import Optional
import aioredis
from aiogram import Dispatcher
from aiogram.contrib.fsm_storage.redis import RedisStorage2
from aiogram.utils.executor import Executor
from loguru import logger
from app import config
class BaseRedis:
def __init__(self, host: str, port: int = 6379, db: int = 0):
... | 24.836066 | 70 | 0.679208 | from typing import Optional
import aioredis
from aiogram import Dispatcher
from aiogram.contrib.fsm_storage.redis import RedisStorage2
from aiogram.utils.executor import Executor
from loguru import logger
from app import config
class BaseRedis:
def __init__(self, host: str, port: int = 6379, db: int = 0):
... | true | true |
1c3225b3313a077ec9edb0f0627a95ed553ca984 | 567 | py | Python | saved_exp_results/FDST-VGG16/FDST.py | Linfeng-Lee/IIM | c63bf8b023ccc6750e178112662972f721dcabe1 | [
"MIT"
] | 81 | 2020-12-10T02:38:03.000Z | 2022-03-23T04:27:39.000Z | saved_exp_results/FDST-VGG16/FDST.py | Linfeng-Lee/IIM | c63bf8b023ccc6750e178112662972f721dcabe1 | [
"MIT"
] | 29 | 2020-12-15T09:07:00.000Z | 2022-03-22T10:00:28.000Z | saved_exp_results/FDST-VGG16/FDST.py | Linfeng-Lee/IIM | c63bf8b023ccc6750e178112662972f721dcabe1 | [
"MIT"
] | 24 | 2020-12-14T02:05:16.000Z | 2022-03-10T01:26:54.000Z | from easydict import EasyDict as edict
# init
__C_FDST = edict()
cfg_data = __C_FDST
__C_FDST.TRAIN_SIZE = (512,1024)
__C_FDST.DATA_PATH = '../ProcessedData/FDST/'
__C_FDST.TRAIN_LST = 'train.txt'
__C_FDST.VAL_LST = 'val.txt'
__C_FDST.VAL4EVAL = 'val_gt_loc.txt'
__C_FDST.MEAN_STD = (
[0.452016860247, 0.447249... | 19.551724 | 53 | 0.738977 | from easydict import EasyDict as edict
__C_FDST = edict()
cfg_data = __C_FDST
__C_FDST.TRAIN_SIZE = (512,1024)
__C_FDST.DATA_PATH = '../ProcessedData/FDST/'
__C_FDST.TRAIN_LST = 'train.txt'
__C_FDST.VAL_LST = 'val.txt'
__C_FDST.VAL4EVAL = 'val_gt_loc.txt'
__C_FDST.MEAN_STD = (
[0.452016860247, 0.447249650955... | true | true |
1c3225f23e9c55d2dfc2a0e985897c13e7e998d6 | 7,486 | py | Python | venv/Lib/site-packages/pandas/core/array_algos/putmask.py | arnoyu-hub/COMP0016miemie | 59af664dcf190eab4f93cefb8471908717415fea | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pandas/core/array_algos/putmask.py | arnoyu-hub/COMP0016miemie | 59af664dcf190eab4f93cefb8471908717415fea | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pandas/core/array_algos/putmask.py | arnoyu-hub/COMP0016miemie | 59af664dcf190eab4f93cefb8471908717415fea | [
"MIT"
] | null | null | null | """
EA-compatible analogue to to np.putmask
"""
from __future__ import annotations
from typing import Any
import warnings
import numpy as np
from pandas._libs import lib
from pandas._typing import ArrayLike
from pandas.core.dtypes.cast import (
convert_scalar_for_putitemlike,
find_common_type... | 33.123894 | 89 | 0.608068 | from __future__ import annotations
from typing import Any
import warnings
import numpy as np
from pandas._libs import lib
from pandas._typing import ArrayLike
from pandas.core.dtypes.cast import (
convert_scalar_for_putitemlike,
find_common_type,
infer_dtype_from,
)
from pandas.core.dtype... | true | true |
1c322636747515cc2ef81e9f89448dbce5406621 | 9,800 | py | Python | snpit/core.py | thobalose/snpit | cbc649ae40104ac5ba482504503f6964f3adddbe | [
"MIT"
] | null | null | null | snpit/core.py | thobalose/snpit | cbc649ae40104ac5ba482504503f6964f3adddbe | [
"MIT"
] | null | null | null | snpit/core.py | thobalose/snpit | cbc649ae40104ac5ba482504503f6964f3adddbe | [
"MIT"
] | null | null | null | #! /usr/bin/env python
import pkg_resources, codecs, csv
import operator
# PyVCF
import vcf
import gzip
#BioPython
from Bio import SeqIO
class snpit(object):
"""
The snpit class is designed to take a VCF file and return the most likely lineage based on Sam Lipworth's SNP-IT.
The methods have been separ... | 38.431373 | 202 | 0.632041 |
import pkg_resources, codecs, csv
import operator
import vcf
import gzip
from Bio import SeqIO
class snpit(object):
def __init__(self,input_file=None,threshold=10):
self.threshold=threshold
resource_path = '/'.join(('..','lib', 'library.csv'))
utf8_reader = code... | true | true |
1c32263ecd08ba9dac7a6b97477f8842ccbd58ca | 1,122 | py | Python | src/plot_perfomance.py | hoaaoh/Audio2Vec | 96711c2300646ce10878113fa0d506d703db96d7 | [
"Apache-2.0"
] | 11 | 2018-02-16T03:52:17.000Z | 2020-04-07T17:05:50.000Z | src/plot_perfomance.py | hoaaoh/Audio2Vec | 96711c2300646ce10878113fa0d506d703db96d7 | [
"Apache-2.0"
] | 2 | 2018-05-26T16:27:59.000Z | 2019-10-10T14:32:20.000Z | src/plot_perfomance.py | hoaaoh/Audio2Vec | 96711c2300646ce10878113fa0d506d703db96d7 | [
"Apache-2.0"
] | 4 | 2017-11-16T17:54:38.000Z | 2020-04-17T08:45:43.000Z | #!/usr/bin/env python3
import argparse
import matplotlib.pyplot as plt
import numpy as np
from scipy.interpolate import spline
def main():
AE_small_list = [ 0.730, 0.685, 0.737, 0.693, 0.881, 0.713 ]
AE_large_list = [ 0.234, 0.307, 0.400, 0.323, 0.317, 0.233 ]
### m = [ 3, 6, 10, 15, 21, 26 ] ###
NE_sm... | 33 | 67 | 0.628342 |
import argparse
import matplotlib.pyplot as plt
import numpy as np
from scipy.interpolate import spline
def main():
AE_small_list = [ 0.730, 0.685, 0.737, 0.693, 0.881, 0.713 ]
AE_large_list = [ 0.234, 0.307, 0.400, 0.323, 0.317, 0.233 ]
list = [ 0.100, 0.158, 0.169, 0.150, 0.092, ]
dim = [100, 200,... | true | true |
1c3226c3f306914b538a7d1693092840ae2779b2 | 2,449 | py | Python | huaweicloud-sdk-dds/huaweicloudsdkdds/v3/model/create_database_user_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-dds/huaweicloudsdkdds/v3/model/create_database_user_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-dds/huaweicloudsdkdds/v3/model/create_database_user_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 CreateDatabaseUserResponse(SdkResponse):
"""
Attributes:
openapi_types (dict): The key is attribute name
... | 28.476744 | 79 | 0.553695 |
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class CreateDatabaseUserResponse(SdkResponse):
sensitive_list = []
openapi_types = {
}
attribute_map = {
}
def __init__(self):
... | true | true |
1c322804c158f7cadde9987b27a14b5122158323 | 129 | py | Python | Messages/Error.py | BrinzaBezrukoff/Local-Chat | 38eeb5d1226abde5662138c9f865005f47198767 | [
"BSD-3-Clause"
] | 2 | 2018-07-16T13:54:14.000Z | 2021-12-23T17:42:19.000Z | Messages/Error.py | BrinzaBezrukoff/Local-Chat | 38eeb5d1226abde5662138c9f865005f47198767 | [
"BSD-3-Clause"
] | null | null | null | Messages/Error.py | BrinzaBezrukoff/Local-Chat | 38eeb5d1226abde5662138c9f865005f47198767 | [
"BSD-3-Clause"
] | null | null | null | from Messages.Message import Message
class Error (Message):
def get_text(self):
return "ERROR: " + self.text
| 18.428571 | 37 | 0.643411 | from Messages.Message import Message
class Error (Message):
def get_text(self):
return "ERROR: " + self.text
| true | true |
1c32285bb36c63cc482fd1dec3c43e23ead76a16 | 272 | py | Python | raiden/tests/unit/test_pending_locks.py | tirkarthi/raiden | dbd03ddda039332b54ec0c02d81cbe1100bc8028 | [
"MIT"
] | 2,101 | 2016-06-01T11:31:49.000Z | 2022-03-27T20:13:19.000Z | raiden/tests/unit/test_pending_locks.py | tirkarthi/raiden | dbd03ddda039332b54ec0c02d81cbe1100bc8028 | [
"MIT"
] | 5,291 | 2016-06-01T18:14:04.000Z | 2022-03-31T11:19:09.000Z | raiden/tests/unit/test_pending_locks.py | tirkarthi/raiden | dbd03ddda039332b54ec0c02d81cbe1100bc8028 | [
"MIT"
] | 484 | 2016-06-01T18:21:06.000Z | 2022-03-22T10:29:45.000Z | from raiden.constants import LOCKSROOT_OF_NO_LOCKS
from raiden.transfer.channel import compute_locksroot
from raiden.transfer.state import PendingLocksState
def test_empty():
locks = PendingLocksState([])
assert compute_locksroot(locks) == LOCKSROOT_OF_NO_LOCKS
| 30.222222 | 60 | 0.823529 | from raiden.constants import LOCKSROOT_OF_NO_LOCKS
from raiden.transfer.channel import compute_locksroot
from raiden.transfer.state import PendingLocksState
def test_empty():
locks = PendingLocksState([])
assert compute_locksroot(locks) == LOCKSROOT_OF_NO_LOCKS
| true | true |
1c32299f692ecef5a68d233b2b08cb4a2622bb34 | 3,817 | py | Python | Yukki/YukkiUtilities/tgcallsrun/video.py | xsyn1100/YukkiMusic-Old | 92400708b6d796f83fc6c59130176605b050e9ab | [
"MIT"
] | null | null | null | Yukki/YukkiUtilities/tgcallsrun/video.py | xsyn1100/YukkiMusic-Old | 92400708b6d796f83fc6c59130176605b050e9ab | [
"MIT"
] | null | null | null | Yukki/YukkiUtilities/tgcallsrun/video.py | xsyn1100/YukkiMusic-Old | 92400708b6d796f83fc6c59130176605b050e9ab | [
"MIT"
] | null | null | null | from pyrogram.raw.base import Update
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
from pytgcalls.types import Update
from pytgcalls.types.input_stream import AudioPiped, AudioVideoPiped
from pytgcalls.types.input_stream.quality import (
HighQualityAudio,
HighQualityVideo,
LowQuality... | 29.137405 | 100 | 0.544931 | from pyrogram.raw.base import Update
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
from pytgcalls.types import Update
from pytgcalls.types.input_stream import AudioPiped, AudioVideoPiped
from pytgcalls.types.input_stream.quality import (
HighQualityAudio,
HighQualityVideo,
LowQuality... | true | true |
1c322a07c3235785aa972338b81421c0efb35565 | 5,290 | py | Python | dsalgo/heap.py | dragonman164/dsalgo | 7abcc03e59afeab20e4c5dfd72bb9216bce15a54 | [
"MIT"
] | 11 | 2020-09-20T12:27:33.000Z | 2022-02-02T07:14:06.000Z | dsalgo/heap.py | nisheksharma/dsalgo | 97cd3fd44fefc5321136e98eca4537c959e39285 | [
"MIT"
] | 67 | 2020-09-25T04:39:00.000Z | 2021-10-15T05:58:31.000Z | dsalgo/heap.py | nisheksharma/dsalgo | 97cd3fd44fefc5321136e98eca4537c959e39285 | [
"MIT"
] | 43 | 2020-09-25T05:57:49.000Z | 2021-10-02T20:28:15.000Z | class Heap:
def __init__(self, type='min'):
"""
Create a Heap object
Args :
type : type of Heap ('min' or 'max') default-'min'
"""
self.size = None
self.Heap = [0]
self.type = type
__all__ = ['parent', 'leftChild', 'rightChild', 'display',
... | 31.676647 | 78 | 0.465217 | class Heap:
def __init__(self, type='min'):
self.size = None
self.Heap = [0]
self.type = type
__all__ = ['parent', 'leftChild', 'rightChild', 'display',
'isLeaf', 'root', 'insert', 'delete', 'to_list']
def parent(self, pos):
if((pos - 1) // 2) >= 0:
... | true | true |
1c322a9fe35005b570619852ca2e5613452f96e4 | 1,251 | py | Python | api/activities/migrations/0002_auto_20220305_1715.py | edmon1024/activities-api | e41ab6d5dbb7eba38effe353e88d75699a713f76 | [
"MIT"
] | null | null | null | api/activities/migrations/0002_auto_20220305_1715.py | edmon1024/activities-api | e41ab6d5dbb7eba38effe353e88d75699a713f76 | [
"MIT"
] | null | null | null | api/activities/migrations/0002_auto_20220305_1715.py | edmon1024/activities-api | e41ab6d5dbb7eba38effe353e88d75699a713f76 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2022-03-05 23:15
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('activities', '0001_initial'),
]
operations = [
migrations.AlterField(
... | 30.512195 | 85 | 0.597922 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('activities', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='activity',
name='created_at',
... | true | true |
1c322b3a952fb67fcf60a3fa4678b96e32e86725 | 8,886 | py | Python | 12_tf_obj_1/lib/calculate_map.py | Boltuzamaki/Monk_Object_Detection | baf113ef6db8b531d0ef6413538e49d422163a20 | [
"Apache-2.0"
] | 549 | 2020-01-02T05:14:57.000Z | 2022-03-29T18:34:12.000Z | 12_tf_obj_1/lib/calculate_map.py | Boltuzamaki/Monk_Object_Detection | baf113ef6db8b531d0ef6413538e49d422163a20 | [
"Apache-2.0"
] | 98 | 2020-01-21T09:41:30.000Z | 2022-03-12T00:53:06.000Z | 12_tf_obj_1/lib/calculate_map.py | Boltuzamaki/Monk_Object_Detection | baf113ef6db8b531d0ef6413538e49d422163a20 | [
"Apache-2.0"
] | 233 | 2020-01-18T03:46:27.000Z | 2022-03-19T03:17:47.000Z | # Code from - https://github.com/Cartucho/mAP
import glob
import json
import os
import shutil
import operator
import sys
import argparse
import math
import matplotlib.pyplot as plt
import numpy as np
def log_average_miss_rate(prec, rec, num_images):
"""
log-average miss rate:
Calculated by ... | 32.911111 | 123 | 0.603759 |
import glob
import json
import os
import shutil
import operator
import sys
import argparse
import math
import matplotlib.pyplot as plt
import numpy as np
def log_average_miss_rate(prec, rec, num_images):
if prec.size == 0:
lamr = 0
mr = 1
fppi = 0
return lamr, mr, fppi
... | true | true |
1c322bb27857c36f63ac501a96730df8cd2d72c3 | 877 | py | Python | alien_invasion/alien.py | MRNIU/PythonCrashCourse | c3aadf34a862d47fbe2dbf790b07a2439b225649 | [
"MIT"
] | null | null | null | alien_invasion/alien.py | MRNIU/PythonCrashCourse | c3aadf34a862d47fbe2dbf790b07a2439b225649 | [
"MIT"
] | null | null | null | alien_invasion/alien.py | MRNIU/PythonCrashCourse | c3aadf34a862d47fbe2dbf790b07a2439b225649 | [
"MIT"
] | null | null | null | import pygame
from pygame.sprite import Sprite
class Alien(Sprite):
def __init__(self, ai_settings, screen):
super().__init__()
self.screen = screen
self.ai_settings=ai_settings
self.image=pygame.image.load('images/alien.bmp')
self.rect=self.image.get_rect()
self.r... | 27.40625 | 90 | 0.623717 | import pygame
from pygame.sprite import Sprite
class Alien(Sprite):
def __init__(self, ai_settings, screen):
super().__init__()
self.screen = screen
self.ai_settings=ai_settings
self.image=pygame.image.load('images/alien.bmp')
self.rect=self.image.get_rect()
self.r... | true | true |
1c322d07c5fc9d23baf1e23a47c7e7a71abd791c | 801 | py | Python | src/paper/task_paper.py | maxxxbb/replication_ar2018 | 5c3da961664af0ff5a2d2b6f6a2baa3271cf2a57 | [
"MIT"
] | null | null | null | src/paper/task_paper.py | maxxxbb/replication_ar2018 | 5c3da961664af0ff5a2d2b6f6a2baa3271cf2a57 | [
"MIT"
] | null | null | null | src/paper/task_paper.py | maxxxbb/replication_ar2018 | 5c3da961664af0ff5a2d2b6f6a2baa3271cf2a57 | [
"MIT"
] | null | null | null | import shutil
import pytask
from src.config import BLD
from src.config import ROOT
from src.config import SRC
documents = ["replication_paper"]
@pytask.mark.latex(
[
"--pdf",
"--interaction=nonstopmode",
"--synctex=1",
"--cd",
"--quiet",
"--shell-escape",
]
... | 18.627907 | 78 | 0.594257 | import shutil
import pytask
from src.config import BLD
from src.config import ROOT
from src.config import SRC
documents = ["replication_paper"]
@pytask.mark.latex(
[
"--pdf",
"--interaction=nonstopmode",
"--synctex=1",
"--cd",
"--quiet",
"--shell-escape",
]
... | true | true |
1c322d7fa0ce60f6ed26d7df0b2f10a6f07d44e5 | 3,322 | py | Python | features/steps/ps_platform_throttle_report_msg.py | PolySync/core-python-api | a753863eca820954f5b8f7502c38c5a7d8db5a15 | [
"MIT"
] | null | null | null | features/steps/ps_platform_throttle_report_msg.py | PolySync/core-python-api | a753863eca820954f5b8f7502c38c5a7d8db5a15 | [
"MIT"
] | null | null | null | features/steps/ps_platform_throttle_report_msg.py | PolySync/core-python-api | a753863eca820954f5b8f7502c38c5a7d8db5a15 | [
"MIT"
] | 2 | 2018-07-22T21:07:23.000Z | 2019-03-09T14:31:09.000Z | # WARNING: Auto-generated file. Any changes are subject to being overwritten
# by setup.py build script.
#!/usr/bin/python
import time
from behave import given
from behave import when
from behave import then
from hamcrest import assert_that, equal_to
try:
import polysync.node as ps_node
from polysync.data_mod... | 34.968421 | 161 | 0.792595 |
import time
from behave import given
from behave import when
from behave import then
from hamcrest import assert_that, equal_to
try:
import polysync.node as ps_node
from polysync.data_model.types import Py_ps_platform_throttle_report_msg
from polysync.data_model._internal.compare import ps_platform_thr... | true | true |
1c322d85258eb1b6d3e37e446ed35edfbd6a3ba7 | 24,617 | py | Python | plugins/trezor/qt_generic.py | lionzeye/reddelectrum | e39497aee08b08bed89efa10072d17fb1e37920c | [
"MIT"
] | null | null | null | plugins/trezor/qt_generic.py | lionzeye/reddelectrum | e39497aee08b08bed89efa10072d17fb1e37920c | [
"MIT"
] | null | null | null | plugins/trezor/qt_generic.py | lionzeye/reddelectrum | e39497aee08b08bed89efa10072d17fb1e37920c | [
"MIT"
] | null | null | null | from functools import partial
import threading
from PyQt4.Qt import Qt
from PyQt4.Qt import QGridLayout, QInputDialog, QPushButton
from PyQt4.Qt import QVBoxLayout, QLabel, SIGNAL
from reddelectrum_gui.qt.util import *
from .plugin import TIM_NEW, TIM_RECOVER, TIM_MNEMONIC
from ..hw_wallet.qt import QtHandlerBase, QtP... | 41.794567 | 81 | 0.613966 | from functools import partial
import threading
from PyQt4.Qt import Qt
from PyQt4.Qt import QGridLayout, QInputDialog, QPushButton
from PyQt4.Qt import QVBoxLayout, QLabel, SIGNAL
from reddelectrum_gui.qt.util import *
from .plugin import TIM_NEW, TIM_RECOVER, TIM_MNEMONIC
from ..hw_wallet.qt import QtHandlerBase, QtP... | true | true |
1c322e67190af7fee7a252a4111c49a37fc343b6 | 1,301 | py | Python | PythonSkripts/bisection.py | NMarkgraf/Quantitative-Methoden-der-W-Informatik | 0b0be8d832eadce774a01047cd978f9599d29ca5 | [
"CC0-1.0"
] | null | null | null | PythonSkripts/bisection.py | NMarkgraf/Quantitative-Methoden-der-W-Informatik | 0b0be8d832eadce774a01047cd978f9599d29ca5 | [
"CC0-1.0"
] | null | null | null | PythonSkripts/bisection.py | NMarkgraf/Quantitative-Methoden-der-W-Informatik | 0b0be8d832eadce774a01047cd978f9599d29ca5 | [
"CC0-1.0"
] | null | null | null | # ========================================================================
# Bisection-Verfahren in Python Rev. 2.0 (13. Apr. 2020)
# =============================-------------------------------------------
# (C)opyleft in 2020 by N. Markgraf (nmarkgraf@hotmail.com)
#
# ================================... | 29.568182 | 74 | 0.420446 |
from math import exp, fabs
def print_iter_info(i, a, b, c, f):
print(f'Iter. {i}: a={a:.8F} f(a)={f(a):.8F} c=(a+b)/2={c:.8F} '
f'f(c)={f(c):.8F} b={b:.8F} f(b)={f(b):.8F}')
def bisection(f, a, b, max_iter=1000, epsilon=0.0001):
if f(a) * f(b) > 0:
raise ArithmeticError("Das Produkt... | true | true |
1c322e8d00d4637a3069f21b0e334e01caf84026 | 1,763 | py | Python | reviews/admin.py | shockflash/reviews | f6cf2727e56f190e48f08d5da7932ff9d7b12936 | [
"BSD-3-Clause"
] | 1 | 2015-03-01T10:39:22.000Z | 2015-03-01T10:39:22.000Z | reviews/admin.py | shockflash/reviews | f6cf2727e56f190e48f08d5da7932ff9d7b12936 | [
"BSD-3-Clause"
] | null | null | null | reviews/admin.py | shockflash/reviews | f6cf2727e56f190e48f08d5da7932ff9d7b12936 | [
"BSD-3-Clause"
] | null | null | null | from django.core import urlresolvers
from django.utils.translation import ugettext as _
from django.contrib import admin
from reviews.models import Review, ReviewSegment, Category, CategorySegment
class ReviewSegmentInline(admin.TabularInline):
model = ReviewSegment
""" no manual alteration of the segments am... | 32.648148 | 136 | 0.711855 | from django.core import urlresolvers
from django.utils.translation import ugettext as _
from django.contrib import admin
from reviews.models import Review, ReviewSegment, Category, CategorySegment
class ReviewSegmentInline(admin.TabularInline):
model = ReviewSegment
extra = 0
can_delete = False
max_n... | true | true |
1c322f42afa522705e697dc4fdb80e5c9139a56a | 57,767 | py | Python | sensortoolkit/evaluation_objs/_sensor_eval.py | USEPA/sensortoolkit | a9da32fd4df492154c6e4cc570011d14e933ee83 | [
"MIT"
] | 2 | 2022-02-25T21:59:04.000Z | 2022-03-01T19:37:38.000Z | sensortoolkit/evaluation_objs/_sensor_eval.py | USEPA/sensortoolkit | a9da32fd4df492154c6e4cc570011d14e933ee83 | [
"MIT"
] | null | null | null | sensortoolkit/evaluation_objs/_sensor_eval.py | USEPA/sensortoolkit | a9da32fd4df492154c6e4cc570011d14e933ee83 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Top-level analysis module for the ``sensortoolkit`` library.
Contains the front-facing ``SensorEvaluation`` class for conducting analysis
of sensor data.
===============================================================================
@Author:
| Samuel Frederick, NSSC Contractor (ORAU)... | 45.846825 | 103 | 0.540741 |
import math
import json
import sys
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import sensortoolkit.calculate
import sensortoolkit.datetime_utils
import sensortoolkit.deploy
import sensortoolkit.lib_utils
import sensortoolkit.model
import sensortoolkit.param
import sensortoolkit.pl... | true | true |
1c322f8ba391c2cbf93916a02b75024c2161394f | 3,085 | py | Python | maskrcnn_benchmark/data/transforms/transforms.py | zhilinghuang/maskrcnn-benchmark | 1127bdd368613f320f7b113320e62994c0baa216 | [
"MIT"
] | 54 | 2020-06-14T15:45:01.000Z | 2022-03-26T07:25:46.000Z | maskrcnn_benchmark/data/transforms/transforms.py | zhilinghuang/maskrcnn-benchmark | 1127bdd368613f320f7b113320e62994c0baa216 | [
"MIT"
] | 25 | 2019-05-21T02:20:27.000Z | 2019-09-13T14:56:17.000Z | maskrcnn_benchmark/data/transforms/transforms.py | zhilinghuang/maskrcnn-benchmark | 1127bdd368613f320f7b113320e62994c0baa216 | [
"MIT"
] | 41 | 2019-09-03T06:51:59.000Z | 2022-01-18T02:40:57.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import random
import torch
import torchvision
from torchvision.transforms import functional as F
class Compose(object):
def __init__(self, transforms):
self.transforms = transforms
def __call__(self, image, target):
for ... | 28.302752 | 83 | 0.57893 |
import random
import torch
import torchvision
from torchvision.transforms import functional as F
class Compose(object):
def __init__(self, transforms):
self.transforms = transforms
def __call__(self, image, target):
for t in self.transforms:
image, target = t(image, target)
... | true | true |
1c322fe79d5d09617c72e056b0c23609d1c7f199 | 1,920 | py | Python | thor/orbits/gibbs.py | KatKiker/thor | ffc8ab3fbaa8af046f531e8111907a891998d14b | [
"BSD-3-Clause"
] | 11 | 2019-08-22T18:37:09.000Z | 2022-02-28T22:49:25.000Z | thor/orbits/gibbs.py | KatKiker/thor | ffc8ab3fbaa8af046f531e8111907a891998d14b | [
"BSD-3-Clause"
] | 57 | 2019-08-20T19:57:14.000Z | 2021-09-16T20:54:59.000Z | thor/orbits/gibbs.py | KatKiker/thor | ffc8ab3fbaa8af046f531e8111907a891998d14b | [
"BSD-3-Clause"
] | 7 | 2021-02-09T21:28:43.000Z | 2022-02-01T08:55:29.000Z | import numpy as np
from ..constants import Constants as c
__all__ = ["calcGibbs"]
MU = c.MU
def calcGibbs(r1, r2, r3):
"""
Calculates the velocity vector at the location of the second position vector (r2) using the
Gibbs method.
.. math::
\vec{D} = \vec{r}_1 \times \vec{r}_2 + \vec{r}_2 \... | 30.47619 | 120 | 0.585417 | import numpy as np
from ..constants import Constants as c
__all__ = ["calcGibbs"]
MU = c.MU
def calcGibbs(r1, r2, r3):
r1_mag = np.linalg.norm(r1)
r2_mag = np.linalg.norm(r2)
r3_mag = np.linalg.norm(r3)
Z12 = np.cross(r1, r2)
Z23 = np.cross(r2, r3)
Z31 = np.cross(r3, r1)
coplanarity = n... | true | true |
1c3230602dc6ce8125868679fb1c35533fbc07f4 | 264 | py | Python | Exercise-1/Q15_diffNum.py | abhay-lal/18CSC207J-APP | 79a955a99837e6d41c89cb1a9e84eb0230c0fa7b | [
"MIT"
] | null | null | null | Exercise-1/Q15_diffNum.py | abhay-lal/18CSC207J-APP | 79a955a99837e6d41c89cb1a9e84eb0230c0fa7b | [
"MIT"
] | null | null | null | Exercise-1/Q15_diffNum.py | abhay-lal/18CSC207J-APP | 79a955a99837e6d41c89cb1a9e84eb0230c0fa7b | [
"MIT"
] | null | null | null | def check(arr):
for num in arr:
if num in arr[arr.index(num)+1:]:
return False
return True
numbers = list(map(int, input("Enter the numbers: ").split()))
if (check(numbers)):
print("Different")
else:
print("Not Different") | 22 | 62 | 0.590909 | def check(arr):
for num in arr:
if num in arr[arr.index(num)+1:]:
return False
return True
numbers = list(map(int, input("Enter the numbers: ").split()))
if (check(numbers)):
print("Different")
else:
print("Not Different") | true | true |
1c3233bbc704222b68e2f5e756163b08e3d8050e | 1,698 | py | Python | Oblig3/eval_on_test.py | fabiorodp/IN5550_Neural_Methods_in_Natural_Language_Processing | 4d3b2ed56b56e016413ae1544e19ad2a2c0ef047 | [
"MIT"
] | null | null | null | Oblig3/eval_on_test.py | fabiorodp/IN5550_Neural_Methods_in_Natural_Language_Processing | 4d3b2ed56b56e016413ae1544e19ad2a2c0ef047 | [
"MIT"
] | null | null | null | Oblig3/eval_on_test.py | fabiorodp/IN5550_Neural_Methods_in_Natural_Language_Processing | 4d3b2ed56b56e016413ae1544e19ad2a2c0ef047 | [
"MIT"
] | null | null | null | #! python3
# coding: utf-8
from argparse import ArgumentParser
from conllu import parse
from ner_eval import Evaluator
def f1(precision, recall, eps=1e-7):
score = 2 * (precision * recall) / (precision + recall + eps)
return score
if __name__ == "__main__":
parser = ArgumentParser()
parser.add_argu... | 28.3 | 80 | 0.617786 |
from argparse import ArgumentParser
from conllu import parse
from ner_eval import Evaluator
def f1(precision, recall, eps=1e-7):
score = 2 * (precision * recall) / (precision + recall + eps)
return score
if __name__ == "__main__":
parser = ArgumentParser()
parser.add_argument(
"--predicti... | true | true |
1c323454c7cfcd8d98b8fce09c225ab1b6acb53f | 161 | py | Python | main.py | AKSHITA-SRIVASTAVA/PhotoOrganiser | f00490219bd05ff977669f30b88afe708e182d9a | [
"MIT"
] | null | null | null | main.py | AKSHITA-SRIVASTAVA/PhotoOrganiser | f00490219bd05ff977669f30b88afe708e182d9a | [
"MIT"
] | null | null | null | main.py | AKSHITA-SRIVASTAVA/PhotoOrganiser | f00490219bd05ff977669f30b88afe708e182d9a | [
"MIT"
] | null | null | null | import os
cwd = os.getcwd()
os.chdir(cwd+'/images')
cwd = os.getcwd()
file_list = os.listdir(cwd)
for i in range(len(file_list)):
print(file_list[i])
| 11.5 | 31 | 0.652174 | import os
cwd = os.getcwd()
os.chdir(cwd+'/images')
cwd = os.getcwd()
file_list = os.listdir(cwd)
for i in range(len(file_list)):
print(file_list[i])
| true | true |
1c32349232bd3da9067aafed3d454e41f9ef4bee | 7,628 | py | Python | test/core/028-dynamic-hierarchy-b/workflow.py | spxiwh/pegasus | ebe3e205ae34c1721c540465712da557979c7437 | [
"Apache-2.0"
] | null | null | null | test/core/028-dynamic-hierarchy-b/workflow.py | spxiwh/pegasus | ebe3e205ae34c1721c540465712da557979c7437 | [
"Apache-2.0"
] | null | null | null | test/core/028-dynamic-hierarchy-b/workflow.py | spxiwh/pegasus | ebe3e205ae34c1721c540465712da557979c7437 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import logging
from pathlib import Path
from Pegasus.api import *
logging.basicConfig(level=logging.DEBUG)
TOP_DIR = Path(__file__).resolve().parent
# --- Properties ---------------------------------------------------------------
# properties that will be used by both the outer workflow and ... | 39.937173 | 138 | 0.613529 |
import logging
from pathlib import Path
from Pegasus.api import *
logging.basicConfig(level=logging.DEBUG)
TOP_DIR = Path(__file__).resolve().parent
props = Properties()
props["pegasus.dir.storage.deep"] = "false"
props["pegasus.condor.logs.symlink"] = "false"
props["pegasus.data.configuration"] = "condorio"
pro... | true | true |
1c3234ec71ed87182691177575f951332dc73e55 | 26,635 | py | Python | pysystests/app/rest_client_tasks.py | couchbaselabs/testrunner-bharath | 96af90070da2140cc11c549db7403f5ea3b76d34 | [
"Apache-2.0"
] | 1 | 2020-08-31T18:51:45.000Z | 2020-08-31T18:51:45.000Z | pysystests/app/rest_client_tasks.py | couchbaselabs/testrunner-bharath | 96af90070da2140cc11c549db7403f5ea3b76d34 | [
"Apache-2.0"
] | null | null | null | pysystests/app/rest_client_tasks.py | couchbaselabs/testrunner-bharath | 96af90070da2140cc11c549db7403f5ea3b76d34 | [
"Apache-2.0"
] | 2 | 2020-07-24T07:12:01.000Z | 2022-03-17T23:43:28.000Z | ##!/usr/bin/env python
"""
rest tasks
"""
import base64
import sys
sys.path=["../lib"] + sys.path
from membase.api.rest_client import RestConnection
from remote.remote_util import RemoteMachineShellConnection
from couchbase_helper.document import View
from app.celery import celery
import app
import testcfg as cfg
im... | 36.139756 | 180 | 0.602966 | t sys
sys.path=["../lib"] + sys.path
from membase.api.rest_client import RestConnection
from remote.remote_util import RemoteMachineShellConnection
from couchbase_helper.document import View
from app.celery import celery
import app
import testcfg as cfg
import json
import time
import random
import eventlet
from eventle... | true | true |
1c3235090113f2ffd6c9298c078e8540cb1f7cfb | 12,039 | py | Python | retinaface/inference.py | markyong97/retinafacetest | b72317d682c9e17492f5418073073e63c4ce2ce2 | [
"MIT"
] | null | null | null | retinaface/inference.py | markyong97/retinafacetest | b72317d682c9e17492f5418073073e63c4ce2ce2 | [
"MIT"
] | null | null | null | retinaface/inference.py | markyong97/retinafacetest | b72317d682c9e17492f5418073073e63c4ce2ce2 | [
"MIT"
] | null | null | null | import argparse
import json
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple, Union
import albumentations as albu
import cv2
import numpy as np
import torch
import torch.nn.parallel
import torch.utils.data
import torch.utils.data.distributed
import yaml
from albumentations.core.serializatio... | 35.937313 | 116 | 0.627212 | import argparse
import json
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple, Union
import albumentations as albu
import cv2
import numpy as np
import torch
import torch.nn.parallel
import torch.utils.data
import torch.utils.data.distributed
import yaml
from albumentations.core.serializatio... | true | true |
1c32366e0506e618798d03ee9041626145d5f87a | 259,512 | py | Python | xarray/tests/test_dataset.py | pentschev/xarray | de6144c0e8c8fc316cfc412a2057af4d1a04edfd | [
"CC-BY-4.0",
"PSF-2.0",
"BSD-2-Clause",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | xarray/tests/test_dataset.py | pentschev/xarray | de6144c0e8c8fc316cfc412a2057af4d1a04edfd | [
"CC-BY-4.0",
"PSF-2.0",
"BSD-2-Clause",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | xarray/tests/test_dataset.py | pentschev/xarray | de6144c0e8c8fc316cfc412a2057af4d1a04edfd | [
"CC-BY-4.0",
"PSF-2.0",
"BSD-2-Clause",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | import pickle
import sys
import warnings
from copy import copy, deepcopy
from io import StringIO
from textwrap import dedent
import numpy as np
import pandas as pd
import pytest
from pandas.core.computation.ops import UndefinedVariableError
from pandas.core.indexes.datetimes import DatetimeIndex
from pandas.tseries.fr... | 36.285235 | 102 | 0.539239 | import pickle
import sys
import warnings
from copy import copy, deepcopy
from io import StringIO
from textwrap import dedent
import numpy as np
import pandas as pd
import pytest
from pandas.core.computation.ops import UndefinedVariableError
from pandas.core.indexes.datetimes import DatetimeIndex
from pandas.tseries.fr... | true | true |
1c32367f3d8a1f38a3cb8556d0680446dbad020c | 6,747 | py | Python | numpy/_pytesttester.py | lgeiger/numpy | be8ab91f789c3b688d707940016b4c2d262913e9 | [
"BSD-3-Clause"
] | 1 | 2020-07-01T03:50:43.000Z | 2020-07-01T03:50:43.000Z | numpy/_pytesttester.py | lgeiger/numpy | be8ab91f789c3b688d707940016b4c2d262913e9 | [
"BSD-3-Clause"
] | 24 | 2021-05-03T11:31:55.000Z | 2021-08-02T11:23:24.000Z | numpy/_pytesttester.py | lgeiger/numpy | be8ab91f789c3b688d707940016b4c2d262913e9 | [
"BSD-3-Clause"
] | 2 | 2021-08-16T05:10:04.000Z | 2022-01-15T09:10:09.000Z | """
Pytest test running.
This module implements the ``test()`` function for NumPy modules. The usual
boiler plate for doing that is to put the following in the module
``__init__.py`` file::
from numpy._pytesttester import PytestTester
test = PytestTester(__name__).test
del PytestTester
Warnings filterin... | 31.381395 | 79 | 0.610345 | import sys
import os
__all__ = ['PytestTester']
def _show_numpy_info():
from numpy.core._multiarray_umath import (
__cpu_features__, __cpu_baseline__, __cpu_dispatch__
)
import numpy as np
print("NumPy version %s" % np.__version__)
relaxed_strides = np.ones((10, 1), order="C").flags.f_c... | true | true |
1c32368041c5844409ff9001a9d04b7307f13cd4 | 2,791 | py | Python | firebase_admin/firestore.py | AFFOA/firebase-admin-python | bf783c313348f4c48f2b8c9bd5df52d617051989 | [
"Apache-2.0"
] | 4 | 2018-02-25T22:18:33.000Z | 2021-02-03T05:00:43.000Z | firebase_admin/firestore.py | AFFOA/firebase-admin-python | bf783c313348f4c48f2b8c9bd5df52d617051989 | [
"Apache-2.0"
] | 1 | 2018-08-15T01:05:59.000Z | 2018-08-15T01:05:59.000Z | firebase_admin/firestore.py | AFFOA/firebase-admin-python | bf783c313348f4c48f2b8c9bd5df52d617051989 | [
"Apache-2.0"
] | 1 | 2019-04-09T06:18:41.000Z | 2019-04-09T06:18:41.000Z | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 36.246753 | 97 | 0.707273 |
try:
from google.cloud import firestore
existing = globals().keys()
for key, value in firestore.__dict__.items():
if not key.startswith('_') and key not in existing:
globals()[key] = value
except ImportError:
raise ImportError('Failed to import the Cloud Firestore lib... | true | true |
1c32372afbcc3b4faf98b67746dbab2cc0047a83 | 11,057 | py | Python | evolution/evaluator.py | vfcosta/coegan-trained | 44174e68909d9c03bf2e4b7e4c7a48237a560183 | [
"MIT"
] | null | null | null | evolution/evaluator.py | vfcosta/coegan-trained | 44174e68909d9c03bf2e4b7e4c7a48237a560183 | [
"MIT"
] | null | null | null | evolution/evaluator.py | vfcosta/coegan-trained | 44174e68909d9c03bf2e4b7e4c7a48237a560183 | [
"MIT"
] | 1 | 2021-06-11T16:52:55.000Z | 2021-06-11T16:52:55.000Z | import util.tools as tools
from util import config
import torch
import logging
import numpy as np
from evolution.population import Population
logger = logging.getLogger(__name__)
class Evaluator:
def __init__(self, train_loader, validation_loader):
self.train_loader = train_loader
self.validatio... | 49.142222 | 138 | 0.600344 | import util.tools as tools
from util import config
import torch
import logging
import numpy as np
from evolution.population import Population
logger = logging.getLogger(__name__)
class Evaluator:
def __init__(self, train_loader, validation_loader):
self.train_loader = train_loader
self.validatio... | true | true |
1c3237e26b246d2c6c4ee775f1496398da1f6b77 | 1,643 | py | Python | ooobuild/lo/ucb/x_content_provider_supplier.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/ucb/x_content_provider_supplier.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/ucb/x_content_provider_supplier.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http: // www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 34.957447 | 150 | 0.752891 |
import typing
from abc import abstractmethod
from ..uno.x_interface import XInterface as XInterface_8f010a43
if typing.TYPE_CHECKING:
from .x_content_provider import XContentProvider as XContentProvider_d4150cc0
class XContentProviderSupplier(XInterface_8f010a43):
__ooo_ns__: str = 'com.sun... | true | true |
1c323835a274c50d8c2e101b6752aae91a3e1698 | 988 | py | Python | tools/mturk/aws_credentials.py | brendel-group/causal-understanding-via-visualizations | 3cd1a30f4305c48b1a715da5f62a552d803fb933 | [
"MIT"
] | 6 | 2021-06-30T11:10:48.000Z | 2022-01-14T11:36:14.000Z | tools/mturk/aws_credentials.py | brendel-group/causal-understanding-via-visualizations | 3cd1a30f4305c48b1a715da5f62a552d803fb933 | [
"MIT"
] | null | null | null | tools/mturk/aws_credentials.py | brendel-group/causal-understanding-via-visualizations | 3cd1a30f4305c48b1a715da5f62a552d803fb933 | [
"MIT"
] | null | null | null | """Loads the credentials needed to access AWS"""
import os
class AWSCredentials:
"""
Access AWS credentials.
"""
__loaded = False
@staticmethod
def aws_secret_access_key():
AWSCredentials._load_data()
return AWSCredentials.__aws_secret_access_key
@staticmethod
def a... | 25.333333 | 83 | 0.634615 |
import os
class AWSCredentials:
__loaded = False
@staticmethod
def aws_secret_access_key():
AWSCredentials._load_data()
return AWSCredentials.__aws_secret_access_key
@staticmethod
def aws_access_key_id():
AWSCredentials._load_data()
return AWSCredentials.__aws_a... | true | true |
1c3238a93189fc6466b61699e891244a53b23a8e | 484 | py | Python | src/database/addingData.py | inpritamkundu/python | 27e404493cd436106cdf493a81e4f074f5d5ab96 | [
"MIT"
] | null | null | null | src/database/addingData.py | inpritamkundu/python | 27e404493cd436106cdf493a81e4f074f5d5ab96 | [
"MIT"
] | null | null | null | src/database/addingData.py | inpritamkundu/python | 27e404493cd436106cdf493a81e4f074f5d5ab96 | [
"MIT"
] | null | null | null | import psycopg2
connection = psycopg2.connect(dbname="postgres", user="postgres",
password="mithukundu60@", host="localhost", port="5432")
print("connection established")
# Creating cursor
cursor = connection.cursor()
# Serial is used for generating sequence automatically
cursor.execute(... | 30.25 | 86 | 0.71281 | import psycopg2
connection = psycopg2.connect(dbname="postgres", user="postgres",
password="mithukundu60@", host="localhost", port="5432")
print("connection established")
cursor = connection.cursor()
cursor.execute(
'''INSERT INTO student(NAME,ADDRESS,AGE) VALUES('santosh','garwa',... | true | true |
1c3238feee54598fe31e2521fe3f2e69ed774933 | 11,664 | py | Python | HadoopConnect/bin/clusters_handler.py | mshensg/hadoop-connect-for-splunk | 14afd1eb83753d6e1f95dcae49a27e3002070bbe | [
"Apache-2.0"
] | 1 | 2021-11-09T07:33:42.000Z | 2021-11-09T07:33:42.000Z | HadoopConnect/bin/clusters_handler.py | mshensg/hadoop-connect-for-splunk | 14afd1eb83753d6e1f95dcae49a27e3002070bbe | [
"Apache-2.0"
] | 2 | 2021-09-02T23:48:40.000Z | 2021-11-09T07:35:27.000Z | HadoopConnect/bin/clusters_handler.py | mshensg/hadoop-connect-for-splunk | 14afd1eb83753d6e1f95dcae49a27e3002070bbe | [
"Apache-2.0"
] | 2 | 2021-03-15T20:34:58.000Z | 2022-03-27T09:49:26.000Z | import os
import splunk.admin as admin
from clusters import *
from delegating_handler import DelegatingRestHandler
import constants
from errors import *
import util
required_args = ['uri'] # required on create
optional_args = ['namenode_http_port', 'hadoop_home', 'java_home', 'kerberos_principal', 'kerberos_service_p... | 46.285714 | 164 | 0.61154 | import os
import splunk.admin as admin
from clusters import *
from delegating_handler import DelegatingRestHandler
import constants
from errors import *
import util
required_args = ['uri']
optional_args = ['namenode_http_port', 'hadoop_home', 'java_home', 'kerberos_principal', 'kerberos_service_principal', 'ha', 'hd... | true | true |
1c32398e7095398e8602f7d3c4d6512bd57639ff | 6,977 | py | Python | 21_autoencoder.py | juniwang/tensorflow-hw | 212223b2ea4ffe4f91e7ce2b55ba4f9c6797f767 | [
"MIT"
] | null | null | null | 21_autoencoder.py | juniwang/tensorflow-hw | 212223b2ea4ffe4f91e7ce2b55ba4f9c6797f767 | [
"MIT"
] | null | null | null | 21_autoencoder.py | juniwang/tensorflow-hw | 212223b2ea4ffe4f91e7ce2b55ba4f9c6797f767 | [
"MIT"
] | null | null | null | from __future__ import division, print_function, absolute_import
# disable warnings which are just informing you if you build TensorFlow from source it can be faster on your machine.
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
# Import ... | 36.721053 | 117 | 0.656443 | from __future__ import division, print_function, absolute_import
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("/tmp/data/", one_hot=False)
... | true | true |
1c3239fb6450e7070cf99ff189993812fcfcd3d4 | 7,664 | py | Python | sqlcouch/models.py | dimagi/sqlcouch | ff264740d223185d80e0bf8ea11f6f3c8f3d7e7b | [
"BSD-3-Clause"
] | 1 | 2016-03-01T10:20:20.000Z | 2016-03-01T10:20:20.000Z | sqlcouch/models.py | dimagi/sqlcouch | ff264740d223185d80e0bf8ea11f6f3c8f3d7e7b | [
"BSD-3-Clause"
] | null | null | null | sqlcouch/models.py | dimagi/sqlcouch | ff264740d223185d80e0bf8ea11f6f3c8f3d7e7b | [
"BSD-3-Clause"
] | null | null | null | import base64
from couchdbkit import Database, ResourceNotFound, resource
from couchdbkit.ext.django.schema import Document
from django.db import models, transaction
import json
import uuid
from couchdbkit.exceptions import ResourceConflict
class SQLDocDB(Database):
def delete_doc(self, doc, **params):
fo... | 34.214286 | 78 | 0.594207 | import base64
from couchdbkit import Database, ResourceNotFound, resource
from couchdbkit.ext.django.schema import Document
from django.db import models, transaction
import json
import uuid
from couchdbkit.exceptions import ResourceConflict
class SQLDocDB(Database):
def delete_doc(self, doc, **params):
fo... | true | true |
1c323ad2feb1f7eec6edfed83be15809e4df3fed | 970 | py | Python | Data Manipulation with Pandas/reindexing_methods.py | zack28/TakenMind-Internship | 7fb7c1c0b255ee233f18fd9ab4fa76a9b2c992d7 | [
"MIT"
] | 4 | 2019-07-05T22:28:21.000Z | 2021-11-08T12:45:15.000Z | Data Manipulation with Pandas/reindexing_methods.py | zack28/TakenMind-Internship | 7fb7c1c0b255ee233f18fd9ab4fa76a9b2c992d7 | [
"MIT"
] | null | null | null | Data Manipulation with Pandas/reindexing_methods.py | zack28/TakenMind-Internship | 7fb7c1c0b255ee233f18fd9ab4fa76a9b2c992d7 | [
"MIT"
] | 5 | 2020-07-23T18:15:33.000Z | 2021-09-14T14:34:40.000Z | import numpy as np
import pandas as pd
from pandas import Series,DataFrame
from numpy.random import randn
#create a new series
s1=Series([1,2,3,4],index=['e','f','g','h'])
print(s1)
#creating new indexes using reindex
s2=s1.reindex(['e','f','g','h','i','j'])
print(s2)
#using fill value
s2=s2.reindex(... | 24.25 | 101 | 0.605155 | import numpy as np
import pandas as pd
from pandas import Series,DataFrame
from numpy.random import randn
s1=Series([1,2,3,4],index=['e','f','g','h'])
print(s1)
s2=s1.reindex(['e','f','g','h','i','j'])
print(s2)
s2=s2.reindex(['e','f','g','h','i','j','k'],fill_value=10)
print(s2)
cars=Series(['A... | true | true |
1c323b3ab9ea1bba0d26414302fd4c5c78be2980 | 1,454 | py | Python | src/streamlink/plugins/mrtmk.py | hymer-up/streamlink | f09bf6e04cddc78eceb9ded655f716ef3ee4b84f | [
"BSD-2-Clause"
] | 5 | 2019-07-26T17:03:26.000Z | 2020-10-17T23:23:43.000Z | src/streamlink/plugins/mrtmk.py | hymer-up/streamlink | f09bf6e04cddc78eceb9ded655f716ef3ee4b84f | [
"BSD-2-Clause"
] | 9 | 2018-01-14T15:20:23.000Z | 2021-03-08T20:29:51.000Z | src/streamlink/plugins/mrtmk.py | hymer-up/streamlink | f09bf6e04cddc78eceb9ded655f716ef3ee4b84f | [
"BSD-2-Clause"
] | 4 | 2018-01-14T13:27:25.000Z | 2021-11-15T22:28:30.000Z | import logging
import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import validate
from streamlink.stream import HLSStream
log = logging.getLogger(__name__)
class MRTmk(Plugin):
url_re = re.compile(r"""https?://play.mrt.com.mk/(live|play)/""")
file_re = re.compile(r"""(?P<url>https?://... | 29.673469 | 99 | 0.589409 | import logging
import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import validate
from streamlink.stream import HLSStream
log = logging.getLogger(__name__)
class MRTmk(Plugin):
url_re = re.compile(r"""https?://play.mrt.com.mk/(live|play)/""")
file_re = re.compile(r"""(?P<url>https?://... | true | true |
1c323be4d60185e31f821e471d54bc21e0f55f33 | 3,604 | py | Python | python/pb/envoy/type/matcher/path_pb2.py | adriangb/enterprise-client | 5d50b457425b0c6d08415b0d986fa9151b792151 | [
"Apache-2.0"
] | null | null | null | python/pb/envoy/type/matcher/path_pb2.py | adriangb/enterprise-client | 5d50b457425b0c6d08415b0d986fa9151b792151 | [
"Apache-2.0"
] | null | null | null | python/pb/envoy/type/matcher/path_pb2.py | adriangb/enterprise-client | 5d50b457425b0c6d08415b0d986fa9151b792151 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: envoy/type/matcher/path.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
fro... | 41.425287 | 473 | 0.791065 |
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default()
from envoy.type.matcher import string_pb2 as envoy_dot_t... | true | true |
1c323c0e31e11baddab9c8e810045324e97e9a2d | 25,490 | py | Python | neurst/tasks/cross_modal_translation.py | ReneeYe/XSTNet | c5e508aed878d13fea790caee71db1ce77619465 | [
"Apache-2.0"
] | 16 | 2021-06-22T02:36:32.000Z | 2022-03-27T23:07:55.000Z | neurst/tasks/cross_modal_translation.py | ReneeYe/XSTNet | c5e508aed878d13fea790caee71db1ce77619465 | [
"Apache-2.0"
] | 1 | 2022-03-12T13:28:23.000Z | 2022-03-12T13:28:23.000Z | neurst/tasks/cross_modal_translation.py | ReneeYe/XSTNet | c5e508aed878d13fea790caee71db1ce77619465 | [
"Apache-2.0"
] | 3 | 2021-08-03T12:49:35.000Z | 2021-09-02T03:58:18.000Z | # Copyright 2020 ByteDance Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 50.475248 | 131 | 0.60255 |
from typing import Tuple
import numpy as np
import tensorflow as tf
from absl import logging
import neurst.data.dataset_utils as dataset_utils
from neurst.data.data_pipelines import DataPipeline, build_data_pipeline
from neurst.data.data_pipelines.tagged_text_data_pipeline import TaggedTextDataPipeline
fr... | true | true |
1c323c3fc4e3462da91c1c2ee4031a1da2a11473 | 126 | py | Python | week06_1/static_demo/myproject/myapp/models.py | wasit7/cs459_django2018 | 77c09712ac5328d9bba285c000d25d86dbc363b1 | [
"BSD-2-Clause"
] | 4 | 2018-01-17T06:51:24.000Z | 2019-05-01T15:45:17.000Z | week06_1/static_demo/myproject/myapp/models.py | wasit7/cs459_django2018 | 77c09712ac5328d9bba285c000d25d86dbc363b1 | [
"BSD-2-Clause"
] | null | null | null | week06_1/static_demo/myproject/myapp/models.py | wasit7/cs459_django2018 | 77c09712ac5328d9bba285c000d25d86dbc363b1 | [
"BSD-2-Clause"
] | 3 | 2018-04-04T06:54:08.000Z | 2019-03-06T02:31:16.000Z | from django.db import models
# Create your models here.
class Car(models.Model):
image = models.ImageField(upload_to='cars') | 25.2 | 44 | 0.769841 | from django.db import models
class Car(models.Model):
image = models.ImageField(upload_to='cars') | true | true |
1c323c7ad0cf673c86820e22a1ccf3368afdf661 | 6,276 | py | Python | nuqql_matrixd/server.py | hwipl/nuqql-matrixd | 8120ec8bf5a3818726ad2b30f23f9f05fb37c9ec | [
"MIT"
] | null | null | null | nuqql_matrixd/server.py | hwipl/nuqql-matrixd | 8120ec8bf5a3818726ad2b30f23f9f05fb37c9ec | [
"MIT"
] | null | null | null | nuqql_matrixd/server.py | hwipl/nuqql-matrixd | 8120ec8bf5a3818726ad2b30f23f9f05fb37c9ec | [
"MIT"
] | null | null | null | """
matrixd backend server
"""
import html
import re
from typing import TYPE_CHECKING, Dict, Optional, Tuple
# nuqq-based imports
from nuqql_based.based import Based
from nuqql_based.callback import Callback
from nuqql_based.message import Message
# matrixd imports
from nuqql_matrixd.client import BackendClient
fro... | 31.857868 | 79 | 0.578235 |
import html
import re
from typing import TYPE_CHECKING, Dict, Optional, Tuple
from nuqql_based.based import Based
from nuqql_based.callback import Callback
from nuqql_based.message import Message
from nuqql_matrixd.client import BackendClient
from nuqql_matrixd.matrix import unescape_name
if TYPE_CHECKING:
... | true | true |
1c323c889b5ddf67e0a8df74329016f418433b1a | 45,065 | py | Python | api_gateway/models.py | navigateconsulting/va-grievance-redressal | b5a6f28fa0bbaa2c10eb6e6cb553a7407e1027d4 | [
"Apache-2.0"
] | null | null | null | api_gateway/models.py | navigateconsulting/va-grievance-redressal | b5a6f28fa0bbaa2c10eb6e6cb553a7407e1027d4 | [
"Apache-2.0"
] | 1 | 2021-03-10T04:00:41.000Z | 2021-03-10T04:00:41.000Z | api_gateway/models.py | navigateconsulting/va-grievance-redressal | b5a6f28fa0bbaa2c10eb6e6cb553a7407e1027d4 | [
"Apache-2.0"
] | null | null | null | from bson.json_util import dumps
import json
from bson.objectid import ObjectId
from database import ConDatabase
from config import CONFIG
'''motor Mongo Db connection '''
db = ConDatabase.connect()
# noinspection PyMethodMayBeStatic
class RasaConversations:
async def get_conversations(self, sender_id):
... | 42.474081 | 147 | 0.614601 | from bson.json_util import dumps
import json
from bson.objectid import ObjectId
from database import ConDatabase
from config import CONFIG
db = ConDatabase.connect()
class RasaConversations:
async def get_conversations(self, sender_id):
print("Pulling tracker data for a conversation")
result... | true | true |
1c323c9f15f60e34c87878009a5d35a895398644 | 12,879 | py | Python | mark_scripts/topicsandcollocations/eval.py | syhw/contextual_word_segmentation | 401ce2030db814783b9447534006d6b7387527e4 | [
"MIT"
] | 2 | 2016-06-29T10:32:49.000Z | 2020-11-17T20:18:43.000Z | mark_scripts/topicsandcollocations/eval.py | syhw/contextual_word_segmentation | 401ce2030db814783b9447534006d6b7387527e4 | [
"MIT"
] | null | null | null | mark_scripts/topicsandcollocations/eval.py | syhw/contextual_word_segmentation | 401ce2030db814783b9447534006d6b7387527e4 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
usage = """%prog -- evaluate word segmentation
Version of 14th February 2010
(c) Mark Johnson
usage: %prog [options]
"""
import lx, tb
import optparse, re, sys
def tree_words(tree, score_cat_rex, ignore_terminal_rex):
def visit(node, wordssofar, segssofar):
"... | 43.073579 | 133 | 0.59135 |
usage = """%prog -- evaluate word segmentation
Version of 14th February 2010
(c) Mark Johnson
usage: %prog [options]
"""
import lx, tb
import optparse, re, sys
def tree_words(tree, score_cat_rex, ignore_terminal_rex):
def visit(node, wordssofar, segssofar):
"""Does a preorder visit... | false | true |
1c323d974d565283fe3537ebf68aa347c5a46301 | 13,147 | py | Python | Utils.py | AGDCservices/Ghidra-Scripts | 4b891cb5bc1593e398652be50f27001964575bf9 | [
"Apache-2.0"
] | 38 | 2020-04-09T18:25:52.000Z | 2022-03-22T23:51:58.000Z | Ghidra-Scripts/Utils.py | paulveillard/cybersecurity-networking | 097fda0bb22baf0610ca274cf65af324908b53ce | [
"Apache-2.0"
] | null | null | null | Ghidra-Scripts/Utils.py | paulveillard/cybersecurity-networking | 097fda0bb22baf0610ca274cf65af324908b53ce | [
"Apache-2.0"
] | 2 | 2022-01-31T10:53:53.000Z | 2022-02-25T17:55:27.000Z | from __main__ import *
'''
Utility module of common helper functions used
in building Ghidra scripts
Contained function prototypes below:
Get_Bytes_List(targetEa, nLen)
Get_Bytes_String(targetEa, nLen)
Get_Ascii_String(targetEa)
Get_Call_Xrefs_To(targetEa)
Get_Prev_Target_Instruction(cu... | 35.822888 | 141 | 0.633376 | from __main__ import *
def Get_Bytes_List(targetEa, nLen):
signedList = list(getBytes(targetEa, nLen))
unsignedList = []
for curByte in signedList:
if curByte < 0:
uByte = (0xff - abs(curByte) + 1)
else:
uByte= curByte
unsignedList.append(uByte)... | true | true |
1c323dd44e1673bf9dd42ec3a02856b6ac02b476 | 14,959 | py | Python | tests/integration_tests/tests/agent_tests/test_plugin_update.py | ilan-WS/cloudify-manager | 510d8a277c848db351f38fc5b264806b2cb36d0b | [
"Apache-2.0"
] | null | null | null | tests/integration_tests/tests/agent_tests/test_plugin_update.py | ilan-WS/cloudify-manager | 510d8a277c848db351f38fc5b264806b2cb36d0b | [
"Apache-2.0"
] | 2 | 2021-05-31T15:12:21.000Z | 2021-05-31T19:03:05.000Z | tests/integration_tests/tests/agent_tests/test_plugin_update.py | ilan-WS/cloudify-manager | 510d8a277c848db351f38fc5b264806b2cb36d0b | [
"Apache-2.0"
] | null | null | null | ########
# Copyright (c) 2016 GigaSpaces Technologies 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/LICENSE-2.0
#
# Unless... | 37.775253 | 79 | 0.652584 | ort uuid
import shutil
import pytest
from functools import wraps
import integration_tests_plugins
from manager_rest.plugins_update.constants import STATES
from integration_tests import AgentTestWithPlugins
from integration_tests.tests.utils import (
get_resource as resource,
wait_for_blueprint_upload,
wa... | true | true |
1c323dd5c55b25237b61591ef9e174f70d4ac376 | 717 | py | Python | tests/project/ethpm/test_release_package.py | ActorForth/brownie | ef0d5af3bb48edcd11abf985626fc99dbc577c7d | [
"MIT"
] | 1,595 | 2020-06-01T19:41:53.000Z | 2022-03-31T16:09:54.000Z | tests/project/ethpm/test_release_package.py | ActorForth/brownie | ef0d5af3bb48edcd11abf985626fc99dbc577c7d | [
"MIT"
] | 532 | 2020-05-30T12:06:17.000Z | 2022-03-31T22:33:41.000Z | tests/project/ethpm/test_release_package.py | ActorForth/brownie | ef0d5af3bb48edcd11abf985626fc99dbc577c7d | [
"MIT"
] | 303 | 2020-06-17T00:38:34.000Z | 2022-03-31T10:59:48.000Z | #!/usr/bin/python3
from brownie.project import ethpm
ETHPM_CONFIG = {
"package_name": "testpackage",
"version": "1.0.0",
"settings": {"deployment_networks": False, "include_dependencies": False},
}
def test_release_package(dep_project, accounts):
registry = dep_project.PackageRegistry.deploy({"from"... | 34.142857 | 85 | 0.716876 |
from brownie.project import ethpm
ETHPM_CONFIG = {
"package_name": "testpackage",
"version": "1.0.0",
"settings": {"deployment_networks": False, "include_dependencies": False},
}
def test_release_package(dep_project, accounts):
registry = dep_project.PackageRegistry.deploy({"from": accounts[0]})
... | true | true |
1c32403f57f0bfce2a895a27800a35689f7f3a13 | 13,264 | py | Python | client/buck.py | HybridDeveloper/pyre-check | 48d1f8bbf19003417e64950561c786e28af1251a | [
"MIT"
] | null | null | null | client/buck.py | HybridDeveloper/pyre-check | 48d1f8bbf19003417e64950561c786e28af1251a | [
"MIT"
] | null | null | null | client/buck.py | HybridDeveloper/pyre-check | 48d1f8bbf19003417e64950561c786e28af1251a | [
"MIT"
] | null | null | null | # Copyright 2004-present Facebook. All rights reserved.
import functools
import glob
import json
import logging
import os
import subprocess
import sys
import tempfile
import threading
from collections import namedtuple
from json.decoder import JSONDecodeError
from logging import Logger
from typing import Dict, Iterab... | 35.370667 | 88 | 0.592355 |
import functools
import glob
import json
import logging
import os
import subprocess
import sys
import tempfile
import threading
from collections import namedtuple
from json.decoder import JSONDecodeError
from logging import Logger
from typing import Dict, Iterable, List, NamedTuple, Optional, Set, Tuple
from .filesy... | true | true |
1c3240a9ef8ce71b19868e80a1044a5fad11c103 | 15,393 | py | Python | train_tar_visda.py | Albert0147/G-SFDA | a927c67afd71152090d5415142fe8dec9330eeec | [
"MIT"
] | 50 | 2021-07-25T23:58:13.000Z | 2022-03-24T06:01:19.000Z | train_tar_visda.py | davidpengiupui/G-SFDA | 6ded750224266cd4cdb100a7fcedfa95688d22da | [
"MIT"
] | 10 | 2021-08-10T07:14:29.000Z | 2022-02-11T15:51:53.000Z | train_tar_visda.py | davidpengiupui/G-SFDA | 6ded750224266cd4cdb100a7fcedfa95688d22da | [
"MIT"
] | 9 | 2021-08-11T06:48:39.000Z | 2022-03-03T06:14:41.000Z | import argparse
import os, sys
import os.path as osp
import torchvision
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from torchvision import transforms
import network, loss
from torch.utils.data import DataLoader
from data_list import ImageList, ImageList_idx
import random, pdb, mat... | 37.181159 | 116 | 0.535438 | import argparse
import os, sys
import os.path as osp
import torchvision
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from torchvision import transforms
import network, loss
from torch.utils.data import DataLoader
from data_list import ImageList, ImageList_idx
import random, pdb, mat... | true | true |
1c3240f5219e381a34891036fae6c23256494899 | 1,255 | py | Python | qlworkbench/ui/event_manager.py | threkk/software-construction | ddabf113b8a58b9e6f6fc2d4c6539df1a38c010a | [
"MIT"
] | null | null | null | qlworkbench/ui/event_manager.py | threkk/software-construction | ddabf113b8a58b9e6f6fc2d4c6539df1a38c010a | [
"MIT"
] | 7 | 2017-04-22T14:51:38.000Z | 2017-12-10T18:51:36.000Z | qlworkbench/ui/event_manager.py | threkk/software-construction | ddabf113b8a58b9e6f6fc2d4c6539df1a38c010a | [
"MIT"
] | 1 | 2017-12-10T18:51:06.000Z | 2017-12-10T18:51:06.000Z | # -*- coding: utf-8 -*-
"""
This module defines a simple event manager that works on a basis of publishers
and subscribers. This is used in combination with the class `ui.context` to
update the values of the variables when they change.
"""
class EventManager(object):
"""
Simple event manager based on the bull... | 35.857143 | 78 | 0.67012 |
class EventManager(object):
def __init__(self, updater):
self._subscriptions = {}
self.updater = updater
def get_publishers(self):
return self._subscriptions.keys()
def subscribe(self, subscriber, publisher):
if publisher in self._subscriptions:
self._subscri... | true | true |
1c32419673cc54be598a53cc174e927a74ba172d | 3,866 | py | Python | sdk/identity/azure-identity/azure/identity/aio/_credentials/imds.py | rnestler/azure-sdk-for-python | 3d9c14789a5f468b3a1c8b57575e54cbdad708eb | [
"MIT"
] | null | null | null | sdk/identity/azure-identity/azure/identity/aio/_credentials/imds.py | rnestler/azure-sdk-for-python | 3d9c14789a5f468b3a1c8b57575e54cbdad708eb | [
"MIT"
] | null | null | null | sdk/identity/azure-identity/azure/identity/aio/_credentials/imds.py | rnestler/azure-sdk-for-python | 3d9c14789a5f468b3a1c8b57575e54cbdad708eb | [
"MIT"
] | null | null | null | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import os
from typing import TYPE_CHECKING
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError
from ... import CredentialUnavailableError
fr... | 46.578313 | 112 | 0.667874 |
import os
from typing import TYPE_CHECKING
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError
from ... import CredentialUnavailableError
from ..._constants import EnvironmentVariables
from .._internal import AsyncContextManager
from .._internal.get_token_mixin import GetTokenMixin
from... | true | true |
1c3241db512ddaf8a597300f679ee9b33bd2b0ae | 3,087 | py | Python | superviselySDK/help/jupyterlab_scripts/src/backup/project_inference.py | nicehuster/mmdetection-supervisely-person-datasets | ff1b57e16a71378510571dbb9cebfdb712656927 | [
"Apache-2.0"
] | 40 | 2019-05-05T08:08:18.000Z | 2021-10-17T00:07:58.000Z | superviselySDK/help/jupyterlab_scripts/src/backup/project_inference.py | nicehuster/mmdetection-supervisely-person-datasets | ff1b57e16a71378510571dbb9cebfdb712656927 | [
"Apache-2.0"
] | 8 | 2019-06-13T06:00:08.000Z | 2021-07-24T05:25:33.000Z | superviselySDK/help/jupyterlab_scripts/src/backup/project_inference.py | nicehuster/mmdetection-supervisely-person-datasets | ff1b57e16a71378510571dbb9cebfdb712656927 | [
"Apache-2.0"
] | 6 | 2019-07-30T06:36:27.000Z | 2021-06-03T11:57:36.000Z | # coding: utf-8
import time
from tqdm import tqdm
import supervisely_lib as sly
address = 'http://192.168.1.69:5555'
token = 'YGPDnuBkhFmcQ7VNzSEjhgavjg4eFR4Eq1C3jIY4HgV3SQq2JgkXCNtgZy1Fu2ftd4IKui8DsjrdtXjB853cMtBevpSJqFDYiaG1A5qphlH6fFiYYmcVZ5fMR8dDrt5l'
team_name = 'dima'
workspace_name = 'work'
agent_name = 'dima_a... | 35.482759 | 138 | 0.761905 |
import time
from tqdm import tqdm
import supervisely_lib as sly
address = 'http://192.168.1.69:5555'
token = 'YGPDnuBkhFmcQ7VNzSEjhgavjg4eFR4Eq1C3jIY4HgV3SQq2JgkXCNtgZy1Fu2ftd4IKui8DsjrdtXjB853cMtBevpSJqFDYiaG1A5qphlH6fFiYYmcVZ5fMR8dDrt5l'
team_name = 'dima'
workspace_name = 'work'
agent_name = 'dima_agent'
model_nam... | true | true |
1c32429d69f754630b0a41d165f55b96ba9cb260 | 43,256 | py | Python | python/ccxt/async/cointiger.py | ccmtx/ccxt | 6547eada2be724e6645a7afd22732822e7978936 | [
"MIT"
] | 1 | 2020-09-03T04:10:19.000Z | 2020-09-03T04:10:19.000Z | python/ccxt/async/cointiger.py | ccmtx/ccxt | 6547eada2be724e6645a7afd22732822e7978936 | [
"MIT"
] | null | null | null | python/ccxt/async/cointiger.py | ccmtx/ccxt | 6547eada2be724e6645a7afd22732822e7978936 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async.huobipro import huobipro
# -----------------------------------------------------------------------------
try:
basestr... | 76.02109 | 420 | 0.51935 |
pro import huobipro
try:
basestring
except NameError:
basestring = str
import hashlib
import json
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import InsufficientFunds
from ccxt.base.errors import InvalidOrder
from ccxt.base.errors i... | false | true |
1c32444a262755d1f0837b4dccf7b218ba34597b | 3,247 | py | Python | python/TypeHandlers.py | rsejaa/oracle-db-examples | 8b91baf801e9a67b357f38f187f103824f70d310 | [
"Apache-2.0"
] | 4 | 2019-10-26T06:21:32.000Z | 2021-02-15T15:28:02.000Z | python/TypeHandlers.py | rsejaa/oracle-db-examples | 8b91baf801e9a67b357f38f187f103824f70d310 | [
"Apache-2.0"
] | null | null | null | python/TypeHandlers.py | rsejaa/oracle-db-examples | 8b91baf801e9a67b357f38f187f103824f70d310 | [
"Apache-2.0"
] | 5 | 2019-10-26T06:21:31.000Z | 2022-03-10T12:47:13.000Z | #------------------------------------------------------------------------------
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
#
# Portions Copyright 2007-2015, Anthony Tuininga. All rights reserved.
#
# Portions Copyright 2001-2007, Computronix (Canada) Ltd., Edmonton, Alberta,
# Canada... | 33.822917 | 79 | 0.642439 |
from __future__ import print_function
import cx_Oracle
import datetime
import SampleEnv
con = cx_Oracle.connect(SampleEnv.GetMainConnectString())
objType = con.gettype("UDT_BUILDING")
class Building(object):
def __init__(self, buildingId, description, numFloors, dateBuilt):
self.buil... | true | true |
1c3245ac2a6e13af8b1c8775f8d82b178321ba8f | 10,263 | py | Python | Day33_Transfer_learning_Multiclass_classification/assignment3_pythonformat.py | activatedbonkers/100-Days-of-Code-Challenge | a1a376e5373d8fc5fda5df4004115760aa92bfda | [
"MIT"
] | 8 | 2020-07-12T22:45:30.000Z | 2021-06-01T10:44:28.000Z | Day33_Transfer_learning_Multiclass_classification/assignment3_pythonformat.py | activatedbonkers/100-Days-of-Code-Challenge | a1a376e5373d8fc5fda5df4004115760aa92bfda | [
"MIT"
] | null | null | null | Day33_Transfer_learning_Multiclass_classification/assignment3_pythonformat.py | activatedbonkers/100-Days-of-Code-Challenge | a1a376e5373d8fc5fda5df4004115760aa92bfda | [
"MIT"
] | 6 | 2020-06-29T18:36:27.000Z | 2022-01-16T21:18:03.000Z | #!/usr/bin/env python
# coding: utf-8
# In[28]:
# ATTENTION: Please do not alter any of the provided code in the exercise. Only add your own code where indicated
# ATTENTION: Please do not add or remove any cells in the exercise. The grader will check specific cells based on the cell position.
# ATTENTION: Please us... | 36.393617 | 179 | 0.614343 |
import os
import tensorflow as tf
from tensorflow.keras import layers
from tensorflow.keras import Model
from os import getcwd
path_inception = f"{getcwd()}/../tmp2/inception_v3_weights_tf_dim_ordering_tf_kernels_notop.h5"
from tensorflow.keras.applications.inception_v3 import InceptionV3
local_weig... | true | true |
1c3246003698d71f80462f458c37d5f898f28798 | 2,481 | py | Python | tests/unit/model_selection/test_time_splitter.py | betatim/hcrystalball | 693b9b406f05afa23cfc4647c43260166a7076fe | [
"MIT"
] | null | null | null | tests/unit/model_selection/test_time_splitter.py | betatim/hcrystalball | 693b9b406f05afa23cfc4647c43260166a7076fe | [
"MIT"
] | null | null | null | tests/unit/model_selection/test_time_splitter.py | betatim/hcrystalball | 693b9b406f05afa23cfc4647c43260166a7076fe | [
"MIT"
] | null | null | null | import pytest
import types
import numpy as np
from hcrystalball.model_selection import FinerTimeSplit
@pytest.mark.parametrize(
"ts_data, expected_error",
[
("series", None),
("series_with_NaN", None),
("series_with_Inf", None),
("series_with_name", None),
("series_with... | 37.029851 | 109 | 0.622733 | import pytest
import types
import numpy as np
from hcrystalball.model_selection import FinerTimeSplit
@pytest.mark.parametrize(
"ts_data, expected_error",
[
("series", None),
("series_with_NaN", None),
("series_with_Inf", None),
("series_with_name", None),
("series_with... | true | true |
1c324767b609766f14f0328cf7c1effc49be065a | 5,067 | py | Python | geoprisma/core/proxies/proxy.py | groupe-conseil-nutshimit-nippour/django-geoprisma | 4732fdb8a0684eb4d7fd50aa43e11b454ee71d08 | [
"BSD-3-Clause"
] | null | null | null | geoprisma/core/proxies/proxy.py | groupe-conseil-nutshimit-nippour/django-geoprisma | 4732fdb8a0684eb4d7fd50aa43e11b454ee71d08 | [
"BSD-3-Clause"
] | 5 | 2020-02-12T00:23:17.000Z | 2021-12-13T19:46:33.000Z | geoprisma/core/proxies/proxy.py | groupe-conseil-nutshimit-nippour/django-geoprisma | 4732fdb8a0684eb4d7fd50aa43e11b454ee71d08 | [
"BSD-3-Clause"
] | null | null | null | import urllib
import requests
from geoprisma.utils import isAuthorized
from geoprisma.models import Resource, Datastore
from django.contrib.auth.models import User
class Proxy(object):
"""
Class Proxy de base.
Tout les autres proxy herite de cette classe.
"""
CRUD_CREATE = "create"
CRUD_READ... | 29.982249 | 105 | 0.606671 | import urllib
import requests
from geoprisma.utils import isAuthorized
from geoprisma.models import Resource, Datastore
from django.contrib.auth.models import User
class Proxy(object):
CRUD_CREATE = "create"
CRUD_READ = "read"
CRUD_UPDATE = "update"
CRUD_DELETE = "delete"
def __init__(self, serv... | true | true |
1c3247a0889f339178ae9f87828ca4db9cc9425f | 2,017 | py | Python | profiler/tests/test_metrics_use_case.py | Hydrospheredata/hydro-profiler | bca177f8d71d9d8c93091f9a9fdf9a337582e194 | [
"Apache-2.0"
] | null | null | null | profiler/tests/test_metrics_use_case.py | Hydrospheredata/hydro-profiler | bca177f8d71d9d8c93091f9a9fdf9a337582e194 | [
"Apache-2.0"
] | 14 | 2021-11-22T18:07:28.000Z | 2022-01-14T08:51:45.000Z | profiler/tests/test_metrics_use_case.py | Hydrospheredata/hydro-profiler | bca177f8d71d9d8c93091f9a9fdf9a337582e194 | [
"Apache-2.0"
] | 1 | 2021-11-19T11:16:50.000Z | 2021-11-19T11:16:50.000Z | from datetime import datetime
import logging
import pandas as pd
from profiler.use_cases.aggregation_use_case import AggregationUseCase
from profiler.use_cases.metrics_use_case import MetricsUseCase
from profiler.use_cases.overall_reports_use_case import OverallReportsUseCase
from profiler.use_cases.report_use_case im... | 33.065574 | 85 | 0.71294 | from datetime import datetime
import logging
import pandas as pd
from profiler.use_cases.aggregation_use_case import AggregationUseCase
from profiler.use_cases.metrics_use_case import MetricsUseCase
from profiler.use_cases.overall_reports_use_case import OverallReportsUseCase
from profiler.use_cases.report_use_case im... | true | true |
1c324880a6a23d41039b545031dffb2f396c642f | 640 | py | Python | pokebot/bots/utils.py | nacharya114/pokebot | b9028c86c5ee58178f348c75c39225f7b55507aa | [
"MIT"
] | 1 | 2020-05-20T04:52:24.000Z | 2020-05-20T04:52:24.000Z | pokebot/bots/utils.py | nacharya114/pokebot | b9028c86c5ee58178f348c75c39225f7b55507aa | [
"MIT"
] | null | null | null | pokebot/bots/utils.py | nacharya114/pokebot | b9028c86c5ee58178f348c75c39225f7b55507aa | [
"MIT"
] | null | null | null | #########################
# Author: Neil Acharya
#
# Helper Functions
#########################
def teampreview_performance(mon_a, mon_b):
# We evaluate the performance on mon_a against mon_b as its type advantage
a_on_b = b_on_a = -np.inf
for type_ in mon_a.types:
if type_:
... | 33.684211 | 79 | 0.604688 | true | true | |
1c3248f3bf60c84c3eccf88a80508685e532ac42 | 110,825 | py | Python | python/pyarrow/tests/test_parquet.py | maxburke/arrow | 344ed4bed675c4913db5cc7b17d0e6cc57ea55c4 | [
"Apache-2.0"
] | 1 | 2019-12-27T14:15:07.000Z | 2019-12-27T14:15:07.000Z | python/pyarrow/tests/test_parquet.py | maxburke/arrow | 344ed4bed675c4913db5cc7b17d0e6cc57ea55c4 | [
"Apache-2.0"
] | null | null | null | python/pyarrow/tests/test_parquet.py | maxburke/arrow | 344ed4bed675c4913db5cc7b17d0e6cc57ea55c4 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "... | 32.471433 | 79 | 0.62808 |
from collections import OrderedDict
import datetime
import decimal
import io
import json
import os
import six
import pickle
import pytest
import numpy as np
import pyarrow as pa
from pyarrow.compat import guid, u, BytesIO, unichar, PY2
from pyarrow.pandas_compat import _pandas_api
from pyarrow.tests... | true | true |
1c32496c17e9581c86d34b7887b8f58526c8d8c6 | 8,188 | py | Python | txaws/client/discover/tests/test_command.py | antisvin/txAWS | 752fb1ac243b56f8eef8b5773faf7dc475e0a2d3 | [
"MIT"
] | null | null | null | txaws/client/discover/tests/test_command.py | antisvin/txAWS | 752fb1ac243b56f8eef8b5773faf7dc475e0a2d3 | [
"MIT"
] | null | null | null | txaws/client/discover/tests/test_command.py | antisvin/txAWS | 752fb1ac243b56f8eef8b5773faf7dc475e0a2d3 | [
"MIT"
] | null | null | null | # Copyright (C) 2010 Jamu Kakar <jkakar@kakar.ca>
# Licenced under the txaws licence available at /LICENSE in the txaws source.
"""Unit tests for L{Command}."""
from cStringIO import StringIO
from twisted.internet.defer import succeed, fail
from twisted.web.error import Error
from txaws.client.discover.command impo... | 39.941463 | 79 | 0.541402 |
from cStringIO import StringIO
from twisted.internet.defer import succeed, fail
from twisted.web.error import Error
from txaws.client.discover.command import Command
from txaws.ec2.client import Query
from txaws.testing.base import TXAWSTestCase
class FakeHTTPClient(object):
def __init__(self, status, url)... | true | true |
1c32498b312c0dafb9282c89fa7abd0d5bad2428 | 5,246 | py | Python | src/wip/gesture_sensor.py | dooley-ch/microbit-grove | e25213de74d982b8ab49412e6f8b2dbe205ca932 | [
"MIT"
] | null | null | null | src/wip/gesture_sensor.py | dooley-ch/microbit-grove | e25213de74d982b8ab49412e6f8b2dbe205ca932 | [
"MIT"
] | null | null | null | src/wip/gesture_sensor.py | dooley-ch/microbit-grove | e25213de74d982b8ab49412e6f8b2dbe205ca932 | [
"MIT"
] | null | null | null | # ------------------------------------------------------------------------------------------
# Copyright James A. Dooley 2021.
#
# Distributed under the MIT License.
# (See accompanying file license.md file or copy at http://opensource.org/licenses/MIT)
#
# --------------------------------------------------------------... | 24.514019 | 92 | 0.548227 |
from microbit import sleep, i2c, display, button_b
_DEFAULT_ADDRESS = 0x73
_PAJ_BANK_SELECT = 0xEF
_PAJ_SUSPEND = 0x03
_PAJ_INT_FLAG1_MASK = 0x41
_PAJ_INT_FLAG2_MASK = 0x42
_PAJ_INT_FLAG1 = 0x43
_PAJ_INT_FLAG2 = 0x44
_PAJ_STATE = 0x45
_PAJ_PS_HIGH_THR... | true | true |
1c3249f151b296b7c4243a282c5dc5d6d62b2a3c | 3,282 | py | Python | core/controllers/practice_sessions.py | alexewu/oppia | 57c3c660ab7974835ec068d7c7f5ce5b5f1f25ae | [
"Apache-2.0"
] | null | null | null | core/controllers/practice_sessions.py | alexewu/oppia | 57c3c660ab7974835ec068d7c7f5ce5b5f1f25ae | [
"Apache-2.0"
] | null | null | null | core/controllers/practice_sessions.py | alexewu/oppia | 57c3c660ab7974835ec068d7c7f5ce5b5f1f25ae | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 36.466667 | 80 | 0.71816 |
from constants import constants
from core.controllers import acl_decorators
from core.controllers import base
from core.domain import dependency_registry
from core.domain import interaction_registry
from core.domain import obj_services
from core.domain import topic_services
import feconf
import jinja2
... | true | true |
1c324a0f97c8047fe482e12b573d06c176522100 | 1,319 | py | Python | reconcile/test/test_aws_iam_keys.py | bhushanthakur93/qontract-reconcile | fd8eea9f92d353224113955d08e3592864e37df8 | [
"Apache-2.0"
] | null | null | null | reconcile/test/test_aws_iam_keys.py | bhushanthakur93/qontract-reconcile | fd8eea9f92d353224113955d08e3592864e37df8 | [
"Apache-2.0"
] | null | null | null | reconcile/test/test_aws_iam_keys.py | bhushanthakur93/qontract-reconcile | fd8eea9f92d353224113955d08e3592864e37df8 | [
"Apache-2.0"
] | null | null | null | from unittest import TestCase
import reconcile.aws_iam_keys as integ
class TestSupportFunctions(TestCase):
def test_filter_accounts_with_account_name(self):
a = {"name": "a", "deleteKeys": ["AKIA"]}
b = {"name": "b", "deleteKeys": ["AKIA"]}
accounts = [a, b]
filtered = integ.filter... | 37.685714 | 61 | 0.595906 | from unittest import TestCase
import reconcile.aws_iam_keys as integ
class TestSupportFunctions(TestCase):
def test_filter_accounts_with_account_name(self):
a = {"name": "a", "deleteKeys": ["AKIA"]}
b = {"name": "b", "deleteKeys": ["AKIA"]}
accounts = [a, b]
filtered = integ.filter... | true | true |
1c324b9156101cf95bb2610012f39493cc8a3eb8 | 4,633 | py | Python | fastapi/encoders.py | facundojmaero/fastapi | a6897963d5ff2c836313c3b69fc6062051c07a63 | [
"MIT"
] | 1 | 2021-05-28T11:08:43.000Z | 2021-05-28T11:08:43.000Z | fastapi/encoders.py | ycd/fastapi | 848e7f27ed8018e280d40e223a99b9d9e3689734 | [
"MIT"
] | null | null | null | fastapi/encoders.py | ycd/fastapi | 848e7f27ed8018e280d40e223a99b9d9e3689734 | [
"MIT"
] | null | null | null | from collections import defaultdict
from enum import Enum
from pathlib import PurePath
from types import GeneratorType
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union
from pydantic import BaseModel
from pydantic.json import ENCODERS_BY_TYPE
SetIntStr = Set[Union[int, str]]
DictIntStrAny = Di... | 33.817518 | 81 | 0.599611 | from collections import defaultdict
from enum import Enum
from pathlib import PurePath
from types import GeneratorType
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union
from pydantic import BaseModel
from pydantic.json import ENCODERS_BY_TYPE
SetIntStr = Set[Union[int, str]]
DictIntStrAny = Di... | true | true |
1c324c21a8f61bee306884a09b43f1be586eddb5 | 1,721 | py | Python | apps/challenges/migrations/0028_zip_configuration_models_for_challenge_creation.py | ChrsMark/EvalAI | d70163a2465a5d69e818a342ae75f6b0a8eb4cea | [
"BSD-3-Clause"
] | 3 | 2019-02-24T10:57:09.000Z | 2019-02-24T16:49:32.000Z | apps/challenges/migrations/0028_zip_configuration_models_for_challenge_creation.py | ChrsMark/EvalAI | d70163a2465a5d69e818a342ae75f6b0a8eb4cea | [
"BSD-3-Clause"
] | 4 | 2021-06-08T23:45:35.000Z | 2022-01-13T03:32:04.000Z | apps/challenges/migrations/0028_zip_configuration_models_for_challenge_creation.py | ChrsMark/EvalAI | d70163a2465a5d69e818a342ae75f6b0a8eb4cea | [
"BSD-3-Clause"
] | 1 | 2020-01-15T17:27:02.000Z | 2020-01-15T17:27:02.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2017-06-11 18:40
from __future__ import unicode_literals
import base.utils
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations... | 46.513514 | 151 | 0.669959 |
from __future__ import unicode_literals
import base.utils
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('challenges',... | true | true |
1c324e592c8d6f9d0243b4c45d7a67cd6472be33 | 1,771 | py | Python | lektor_markdown_header_anchors.py | emmapeel2/lektor-markdown-header-anchors | cba9fcbd3b5e5644bb1766d041a31a803fc9d09c | [
"BSD-3-Clause"
] | 14 | 2015-12-24T23:29:13.000Z | 2019-12-15T23:28:53.000Z | lektor_markdown_header_anchors.py | emmapeel2/lektor-markdown-header-anchors | cba9fcbd3b5e5644bb1766d041a31a803fc9d09c | [
"BSD-3-Clause"
] | 11 | 2016-01-26T17:21:56.000Z | 2020-03-29T19:39:02.000Z | lektor_markdown_header_anchors.py | emmapeel2/lektor-markdown-header-anchors | cba9fcbd3b5e5644bb1766d041a31a803fc9d09c | [
"BSD-3-Clause"
] | 12 | 2016-01-12T19:00:22.000Z | 2021-03-05T13:18:52.000Z | from lektor.pluginsystem import Plugin
import uuid
from lektor.utils import slugify
from markupsafe import Markup
from collections import namedtuple
TocEntry = namedtuple('TocEntry', ['anchor', 'title', 'children'])
class MarkdownHeaderAnchorsPlugin(Plugin):
name = 'Markdown Header Anchors'
description = u'... | 35.42 | 95 | 0.561265 | from lektor.pluginsystem import Plugin
import uuid
from lektor.utils import slugify
from markupsafe import Markup
from collections import namedtuple
TocEntry = namedtuple('TocEntry', ['anchor', 'title', 'children'])
class MarkdownHeaderAnchorsPlugin(Plugin):
name = 'Markdown Header Anchors'
description = u'... | true | true |
1c324eca209fb748e1712badce0c2051a7528294 | 135,834 | py | Python | mne/viz/_brain/_brain.py | dddd1007/mne-python | 844d53c866bbea932dd6c89ab444bb7f882f0b6f | [
"BSD-3-Clause"
] | null | null | null | mne/viz/_brain/_brain.py | dddd1007/mne-python | 844d53c866bbea932dd6c89ab444bb7f882f0b6f | [
"BSD-3-Clause"
] | null | null | null | mne/viz/_brain/_brain.py | dddd1007/mne-python | 844d53c866bbea932dd6c89ab444bb7f882f0b6f | [
"BSD-3-Clause"
] | null | null | null | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Eric Larson <larson.eric.d@gmail.com>
# Oleh Kozynets <ok7mailbox@gmail.com>
# Guillaume Favelier <guillaume.favelier@gmail.com>
# jona-sassenhagen <jona.sassenhagen@gmail.com>
# Joan Massich <mailsik@gmail.com>
#... | 39.93943 | 79 | 0.540483 |
import contextlib
from functools import partial
from io import BytesIO
import os
import os.path as op
import sys
import time
import copy
import traceback
import warnings
import numpy as np
from collections import OrderedDict
from .colormap import calculate_lut
from .surface import _Surface
from .view import ... | true | true |
1c324ee8763179a0da8952250323994620a39714 | 1,184 | py | Python | dnaSequence/test_strandsAreNotEmpty.py | ankitsumitg/python-projects | 34a3df6fcd8544bf83aa9f3d47ec160e3838b1d1 | [
"MIT"
] | 1 | 2021-03-22T20:45:06.000Z | 2021-03-22T20:45:06.000Z | dnaSequence/test_strandsAreNotEmpty.py | ankitsumitg/python-projects | 34a3df6fcd8544bf83aa9f3d47ec160e3838b1d1 | [
"MIT"
] | null | null | null | dnaSequence/test_strandsAreNotEmpty.py | ankitsumitg/python-projects | 34a3df6fcd8544bf83aa9f3d47ec160e3838b1d1 | [
"MIT"
] | null | null | null | """
Do Not Edit this file. You may and are encouraged to look at it for reference.
"""
import unittest
import dnaSequencing
class TestStrandsAreNotEmpty(unittest.TestCase):
def test001_strandsAreNotEmptyExists(self):
self.assertTrue('strandsAreNotEmpty' in dir(dnaSequencing),
'Func... | 38.193548 | 110 | 0.727196 |
import unittest
import dnaSequencing
class TestStrandsAreNotEmpty(unittest.TestCase):
def test001_strandsAreNotEmptyExists(self):
self.assertTrue('strandsAreNotEmpty' in dir(dnaSequencing),
'Function "strandsAreNotEmpty" was not defined, check your spelling')
def test002_neith... | true | true |
1c324fde2fbe67a02bf54c8152defdcf78ac4408 | 4,082 | py | Python | iconparse.py | avuko/iconparse | 6a5895a26f8a7a43bc365dcadadf53a697f9576d | [
"BSD-3-Clause"
] | null | null | null | iconparse.py | avuko/iconparse | 6a5895a26f8a7a43bc365dcadadf53a697f9576d | [
"BSD-3-Clause"
] | null | null | null | iconparse.py | avuko/iconparse | 6a5895a26f8a7a43bc365dcadadf53a697f9576d | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import binascii
import sys
import array
# Simple tool to analyse .ico files
# bit = 1, byte = 8, WORD = 16bits, DWORD = 32bits
# 2 hex chars = 1 byte, 8 bits
BYTE = 2
WORD = 4
DWORD = 8
# ICONDIR
# I'll define values as (length in hex chars, default value, name)
# WORD: Reserved (must be 0)
i... | 32.396825 | 75 | 0.632778 |
import binascii
import sys
import array
BYTE = 2
WORD = 4
DWORD = 8
# WORD: Reserved (must be 0)
idReserved = {'size': WORD, 'offset': 0, 'name': 'idReserved'}
# WORD: Resource Type (1 for icons)
idType = {'size': WORD, 'offset': 4, 'name': 'idType'}
# WORD: How many images?
idCount = {'size': WORD, 'offset... | true | true |
1c32514c028b0480632a4b1f7b56d532e08a2464 | 37,613 | py | Python | tests/core/tests/query.py | AGoodId/django-haystack | 7e366e39fecf25035490f9512044061c41c72ae4 | [
"BSD-3-Clause"
] | null | null | null | tests/core/tests/query.py | AGoodId/django-haystack | 7e366e39fecf25035490f9512044061c41c72ae4 | [
"BSD-3-Clause"
] | null | null | null | tests/core/tests/query.py | AGoodId/django-haystack | 7e366e39fecf25035490f9512044061c41c72ae4 | [
"BSD-3-Clause"
] | 1 | 2021-12-20T15:35:48.000Z | 2021-12-20T15:35:48.000Z | # -*- coding: utf-8 -*-
import datetime
from django.conf import settings
from django.test import TestCase
from haystack import connections, connection_router, reset_search_queries
from haystack.backends import SQ, BaseSearchQuery
from haystack.exceptions import FacetingError
from haystack import indexes
from haystack.m... | 42.261798 | 893 | 0.656236 |
import datetime
from django.conf import settings
from django.test import TestCase
from haystack import connections, connection_router, reset_search_queries
from haystack.backends import SQ, BaseSearchQuery
from haystack.exceptions import FacetingError
from haystack import indexes
from haystack.models import SearchResu... | false | true |
1c3251d213c147a8fb1ad8acb142a4cfc355d157 | 3,889 | py | Python | homeassistant/components/unifi/unifi_entity_base.py | andersop91/core | 0e0ef0aa17073609eae7c974cf4c73306b7c414b | [
"Apache-2.0"
] | 4 | 2021-07-11T09:11:00.000Z | 2022-02-27T14:43:50.000Z | homeassistant/components/unifi/unifi_entity_base.py | andersop91/core | 0e0ef0aa17073609eae7c974cf4c73306b7c414b | [
"Apache-2.0"
] | 277 | 2021-10-04T06:39:33.000Z | 2021-12-28T22:04:17.000Z | homeassistant/components/unifi/unifi_entity_base.py | andersop91/core | 0e0ef0aa17073609eae7c974cf4c73306b7c414b | [
"Apache-2.0"
] | 1 | 2022-01-12T22:14:01.000Z | 2022-01-12T22:14:01.000Z | """Base class for UniFi Network entities."""
import logging
from typing import Any
from homeassistant.core import callback
from homeassistant.helpers import device_registry as dr, entity_registry as er
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity import Entity... | 34.114035 | 107 | 0.645153 | import logging
from typing import Any
from homeassistant.core import callback
from homeassistant.helpers import device_registry as dr, entity_registry as er
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity import Entity
_LOGGER = logging.getLogger(__name__)
cla... | true | true |
1c32520c22a2a5d88be5c4198d83d778a6ecaf6c | 9,924 | py | Python | train.py | tuq820/efficientdet_with_landmark | 438d92168e5bb91d9ea9bd4b5c743ef41f936fde | [
"MIT"
] | 1 | 2020-07-31T10:04:37.000Z | 2020-07-31T10:04:37.000Z | train.py | tuq820/efficientdet_with_landmark | 438d92168e5bb91d9ea9bd4b5c743ef41f936fde | [
"MIT"
] | null | null | null | train.py | tuq820/efficientdet_with_landmark | 438d92168e5bb91d9ea9bd4b5c743ef41f936fde | [
"MIT"
] | null | null | null | import os
import argparse
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from torchvision import transforms
from src.dataset import CocoDataset, Resizer, Normalizer, Augmenter, collater, MaJiaDataset
from src.model import EfficientDet
from tensorboardX import SummaryWriter
import shutil
impo... | 46.373832 | 170 | 0.600665 | import os
import argparse
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from torchvision import transforms
from src.dataset import CocoDataset, Resizer, Normalizer, Augmenter, collater, MaJiaDataset
from src.model import EfficientDet
from tensorboardX import SummaryWriter
import shutil
impo... | true | true |
1c325323701cb44627dc1661086e7493475551ce | 8,447 | py | Python | Releases/update-versions.py | Ramesik/firebase-ios-sdk | d8bb9b39300277c45859554d9b6f664c2dc6e7ca | [
"Apache-2.0"
] | null | null | null | Releases/update-versions.py | Ramesik/firebase-ios-sdk | d8bb9b39300277c45859554d9b6f664c2dc6e7ca | [
"Apache-2.0"
] | null | null | null | Releases/update-versions.py | Ramesik/firebase-ios-sdk | d8bb9b39300277c45859554d9b6f664c2dc6e7ca | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright 2018 Google
#
# 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 ... | 31.755639 | 80 | 0.66059 |
"""update-versions.py creates a release branch and commit with version updates.
With the required --version parameter, this script will update all files in
the repo based on the versions in Releases/Manifests/{version}.json.
It will create a release branch, push and tag the updates, and push the
updat... | false | true |
1c3253acb209ec239f44675e6e1fdabe60dfb69e | 8,615 | py | Python | qiskit/circuit/library/__init__.py | saktar-unr/qiskit-terra | e3c4e76957f40ad447e471e64dc101fed418752b | [
"Apache-2.0"
] | null | null | null | qiskit/circuit/library/__init__.py | saktar-unr/qiskit-terra | e3c4e76957f40ad447e471e64dc101fed418752b | [
"Apache-2.0"
] | null | null | null | qiskit/circuit/library/__init__.py | saktar-unr/qiskit-terra | e3c4e76957f40ad447e471e64dc101fed418752b | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 19.988399 | 99 | 0.710157 |
from .standard_gates import *
from .templates import *
from ..barrier import Barrier
from ..measure import Measure
from ..reset import Reset
from .blueprintcircuit import BlueprintCircuit
from .generalized_gates import (
Diagonal,
MCMT,
MCMTVChain,
Permutation,
GMS,
MSGate,
GR,... | true | true |
1c3254b922526c41d4c73273574c98047e8491d8 | 770 | py | Python | Django_Project/apps/oauth/utils.py | yasugsh/Django_Project | de5f5cc9244cc2763dafe7597e5e2efef8342c8a | [
"MIT"
] | null | null | null | Django_Project/apps/oauth/utils.py | yasugsh/Django_Project | de5f5cc9244cc2763dafe7597e5e2efef8342c8a | [
"MIT"
] | null | null | null | Django_Project/apps/oauth/utils.py | yasugsh/Django_Project | de5f5cc9244cc2763dafe7597e5e2efef8342c8a | [
"MIT"
] | null | null | null | from itsdangerous import TimedJSONWebSignatureSerializer as Serializer, BadData
from django.conf import settings
from . import constants
def generate_openid_signature(openid):
"""
对openid进行签名
:param openid: 扫码QQ的openid
:return: 加密后的openid
"""
serializer = Serializer(settings.SECRET_KEY, expi... | 26.551724 | 91 | 0.736364 | from itsdangerous import TimedJSONWebSignatureSerializer as Serializer, BadData
from django.conf import settings
from . import constants
def generate_openid_signature(openid):
serializer = Serializer(settings.SECRET_KEY, expires_in=constants.ACCESS_TOKEN_EXPIRES)
data = {'openid': openid}
token_openid =... | true | true |
1c325586cdeb67523fc28455208f5f446e7a0214 | 37,261 | py | Python | theano/tensor/extra_ops.py | mayunpeng/Theano | c74da33de3768e231ffa0d92d9d11667a2a5aedb | [
"BSD-3-Clause"
] | 1 | 2021-07-01T02:51:08.000Z | 2021-07-01T02:51:08.000Z | theano/tensor/extra_ops.py | mayunpeng/Theano | c74da33de3768e231ffa0d92d9d11667a2a5aedb | [
"BSD-3-Clause"
] | null | null | null | theano/tensor/extra_ops.py | mayunpeng/Theano | c74da33de3768e231ffa0d92d9d11667a2a5aedb | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import numpy
import warnings
from six.moves import xrange
import theano
from theano.tensor import basic
from theano.tensor import nlinalg # noqa
from theano import gof, scalar
from theano.gradient import DisconnectedType
tensor = basic
class CpuContiguous(theano.Op):
"""
Check to see if t... | 33.997263 | 146 | 0.565524 | import numpy as np
import numpy
import warnings
from six.moves import xrange
import theano
from theano.tensor import basic
from theano.tensor import nlinalg
from theano import gof, scalar
from theano.gradient import DisconnectedType
tensor = basic
class CpuContiguous(theano.Op):
__props__ = ()
view_map = {... | true | true |
1c32567adbefc7506d550909f7d41a6db6224a31 | 2,226 | py | Python | skills_ml/algorithms/sampling/methods.py | maneeshdisodia/skills-ml | 194b262aa5bad1af381d1f63f8b327cf96523950 | [
"MIT"
] | null | null | null | skills_ml/algorithms/sampling/methods.py | maneeshdisodia/skills-ml | 194b262aa5bad1af381d1f63f8b327cf96523950 | [
"MIT"
] | null | null | null | skills_ml/algorithms/sampling/methods.py | maneeshdisodia/skills-ml | 194b262aa5bad1af381d1f63f8b327cf96523950 | [
"MIT"
] | null | null | null | """Generic sampling methods"""
import numpy as np
import heapq as hq
import random
def reservoir(it, k):
"""Reservoir sampling with Random Sort from a job posting iterator
Randomly choosing a sample of k items from a streaming iterator. Using random sort to implement the algorithm.
Basically, it's assigni... | 35.903226 | 119 | 0.623989 | import numpy as np
import heapq as hq
import random
def reservoir(it, k):
it = iter(it)
result = []
for i, datum in enumerate(it):
if i < k:
result.append(datum)
else:
j = random.randint(0, i-1)
if j < k:
result[j] = datum
while len(re... | true | true |
1c32588266235dc67fa6e996a30f2750797e9832 | 876 | py | Python | setup.py | RockefellerArchiveCenter/rac_aspace | 02546e5d618a6b9c2e2edba35383a457cba9321b | [
"MIT"
] | null | null | null | setup.py | RockefellerArchiveCenter/rac_aspace | 02546e5d618a6b9c2e2edba35383a457cba9321b | [
"MIT"
] | 74 | 2020-01-14T14:55:51.000Z | 2021-02-18T21:13:29.000Z | setup.py | RockefellerArchiveCenter/rac_aspace | 02546e5d618a6b9c2e2edba35383a457cba9321b | [
"MIT"
] | 2 | 2020-03-28T21:19:21.000Z | 2022-02-11T20:05:33.000Z | from setuptools import setup, find_packages
with open("README.md", "r") as fh:
long_description = fh.read()
setup(name='rac-aspace',
version='0.0.1',
description='Helpers for using the ArchivesSpace API using ArchivesSnake',
long_description=long_description,
long_description_content_type=... | 35.04 | 80 | 0.590183 | from setuptools import setup, find_packages
with open("README.md", "r") as fh:
long_description = fh.read()
setup(name='rac-aspace',
version='0.0.1',
description='Helpers for using the ArchivesSpace API using ArchivesSnake',
long_description=long_description,
long_description_content_type=... | true | true |
1c32595e7fc90ce0ff461cb9decddd85e1c9ac69 | 3,437 | py | Python | localstack/services/cloudformation/models/logs.py | Madajevas/localstack | 85c712e50d45183b9703c682de02d5114c50c47c | [
"Apache-2.0"
] | 1 | 2022-01-21T17:14:52.000Z | 2022-01-21T17:14:52.000Z | localstack/services/cloudformation/models/logs.py | Madajevas/localstack | 85c712e50d45183b9703c682de02d5114c50c47c | [
"Apache-2.0"
] | null | null | null | localstack/services/cloudformation/models/logs.py | Madajevas/localstack | 85c712e50d45183b9703c682de02d5114c50c47c | [
"Apache-2.0"
] | null | null | null | from localstack.services.cloudformation.deployment_utils import generate_default_name
from localstack.services.cloudformation.service_models import GenericBaseModel
from localstack.utils.aws import aws_stack
class LogsLogGroup(GenericBaseModel):
@staticmethod
def cloudformation_type():
return "AWS::Lo... | 38.188889 | 109 | 0.614489 | from localstack.services.cloudformation.deployment_utils import generate_default_name
from localstack.services.cloudformation.service_models import GenericBaseModel
from localstack.utils.aws import aws_stack
class LogsLogGroup(GenericBaseModel):
@staticmethod
def cloudformation_type():
return "AWS::Lo... | true | true |
1c3259d8c771687eaa9decad30eae1e02850aa05 | 251 | py | Python | class9/e2/mytest/simple.py | ktbyers/pynet_wantonik | 601bce26142b6741202c2bdafb9e0d0cec1b3c78 | [
"Apache-2.0"
] | 2 | 2017-05-11T12:05:15.000Z | 2021-07-15T18:13:19.000Z | class9/e2/mytest/simple.py | ktbyers/pynet_wantonik | 601bce26142b6741202c2bdafb9e0d0cec1b3c78 | [
"Apache-2.0"
] | null | null | null | class9/e2/mytest/simple.py | ktbyers/pynet_wantonik | 601bce26142b6741202c2bdafb9e0d0cec1b3c78 | [
"Apache-2.0"
] | 1 | 2017-05-11T12:05:18.000Z | 2017-05-11T12:05:18.000Z | #!/usr/bin/env python
'''Excercise_2 - class9 - Reusable Code'''
def func2():
'''func2 to print simple statement'''
print 'Excercise_2 from class9 - simple.py'
if __name__ == "__main__":
print 'This is main program from simple.py file.'
| 25.1 | 53 | 0.673307 |
'''Excercise_2 - class9 - Reusable Code'''
def func2():
'''func2 to print simple statement'''
print 'Excercise_2 from class9 - simple.py'
if __name__ == "__main__":
print 'This is main program from simple.py file.'
| false | true |
1c325ab77c0bd73ccd79c55ec7eed5d45e95eb30 | 4,024 | py | Python | unit_tests/database/ArkDBMySQLTest.py | fangzhouwang/ArkLibPy | e14051eda859ba31887eeb501c27c9d7bf5865c8 | [
"MIT"
] | null | null | null | unit_tests/database/ArkDBMySQLTest.py | fangzhouwang/ArkLibPy | e14051eda859ba31887eeb501c27c9d7bf5865c8 | [
"MIT"
] | null | null | null | unit_tests/database/ArkDBMySQLTest.py | fangzhouwang/ArkLibPy | e14051eda859ba31887eeb501c27c9d7bf5865c8 | [
"MIT"
] | null | null | null | import unittest
from arklibpy.database.ArkDBMySQL import *
from os import path
class ArkDBMySQLTestCase(unittest.TestCase):
def setUp(self):
here = path.abspath(path.dirname(__file__))
self.db_ = ArkDBMySQL(db_config_file=path.join(here, 'db_config_local_tester.txt'))
self.table_ = "test_t... | 49.073171 | 111 | 0.631213 | import unittest
from arklibpy.database.ArkDBMySQL import *
from os import path
class ArkDBMySQLTestCase(unittest.TestCase):
def setUp(self):
here = path.abspath(path.dirname(__file__))
self.db_ = ArkDBMySQL(db_config_file=path.join(here, 'db_config_local_tester.txt'))
self.table_ = "test_t... | true | true |
1c325b46e0e840265cc762067f4583887f37c485 | 993 | py | Python | DataStructures/RingBufferQueue.py | sshh12/SchoolCode | 2b16f0e15d325e01194ce0388bf87eb813ed43e8 | [
"MIT"
] | 5 | 2017-09-26T19:36:51.000Z | 2020-10-01T16:59:07.000Z | DataStructures/RingBufferQueue.py | sshh12/SchoolCode | 2b16f0e15d325e01194ce0388bf87eb813ed43e8 | [
"MIT"
] | 18 | 2017-07-16T20:26:50.000Z | 2018-10-05T20:15:24.000Z | DataStructures/RingBufferQueue.py | sshh12/SchoolCode | 2b16f0e15d325e01194ce0388bf87eb813ed43e8 | [
"MIT"
] | 1 | 2019-04-22T17:38:46.000Z | 2019-04-22T17:38:46.000Z |
class RingBufferQueue:
def __init__(self, size=10):
self.items = [None] * size
self.size = size
self.write_index = 0
self.used = 0
def add(self, item):
if self.used != self.size:
self.items[self.write_index] = item
self.write_index = (self.w... | 16.278689 | 83 | 0.507553 |
class RingBufferQueue:
def __init__(self, size=10):
self.items = [None] * size
self.size = size
self.write_index = 0
self.used = 0
def add(self, item):
if self.used != self.size:
self.items[self.write_index] = item
self.write_index = (self.w... | true | true |
1c325c3597200d10e7f99e53b52661105c29c73c | 382 | py | Python | setup.py | riamf/depsPlot | 0d08e407928301580fbed780b3b22d72222678ad | [
"MIT"
] | null | null | null | setup.py | riamf/depsPlot | 0d08e407928301580fbed780b3b22d72222678ad | [
"MIT"
] | null | null | null | setup.py | riamf/depsPlot | 0d08e407928301580fbed780b3b22d72222678ad | [
"MIT"
] | null | null | null | from setuptools import setup
setup(name='depsPlot',
version='0.1',
description='wip',
url='#',
author='riamf',
author_email='riamf2@gmail.com',
license='MIT',
py_modules=['depsPlot'],
install_requires=[
'Click'
],
entry_points='''
[console_s... | 20.105263 | 38 | 0.536649 | from setuptools import setup
setup(name='depsPlot',
version='0.1',
description='wip',
url='#',
author='riamf',
author_email='riamf2@gmail.com',
license='MIT',
py_modules=['depsPlot'],
install_requires=[
'Click'
],
entry_points='''
[console_s... | true | true |
1c325d919da9763ec1636137e18e475fa5bb6c66 | 2,562 | py | Python | blackswan/pythonanattribution.py | bird-house/blackswan | 5f1f20423874315f5e8eea2cf7302f9d0c05adae | [
"BSD-3-Clause"
] | null | null | null | blackswan/pythonanattribution.py | bird-house/blackswan | 5f1f20423874315f5e8eea2cf7302f9d0c05adae | [
"BSD-3-Clause"
] | 4 | 2018-05-07T16:47:47.000Z | 2019-01-21T13:07:17.000Z | blackswan/pythonanattribution.py | bird-house/blackswan | 5f1f20423874315f5e8eea2cf7302f9d0c05adae | [
"BSD-3-Clause"
] | 2 | 2018-07-10T12:58:55.000Z | 2021-02-13T01:10:52.000Z | # import logging
# LOGGER = logging.getLogger("PYWPS")
import pandas
import random
import numpy as np
def analogs_generator(anafile, yfile, nsim=20):
"""
Simulates nsim values of the variable y using analogues for all the dates present in the file anafile
:param anafile: path to a file with the resu... | 42.7 | 115 | 0.673302 |
import pandas
import random
import numpy as np
def analogs_generator(anafile, yfile, nsim=20):
def weight_analogues(date):
dist = disttable.loc[[date], :].transpose()
date = anatable.loc[[date], :].transpose()
weights = pandas.concat([date.reset_index(drop=True), dist.reset_index(drop=... | true | true |
1c325dbf3e312be52259971858d330435aa51739 | 314 | py | Python | DailyProgrammer/20120221B.py | DayGitH/Python-Challenges | bc32f1332a92fcc2dfa6f5ea4d95f8a8d64c3edf | [
"MIT"
] | 2 | 2020-12-23T18:59:22.000Z | 2021-04-14T13:16:09.000Z | DailyProgrammer/20120221B.py | DayGitH/Python-Challenges | bc32f1332a92fcc2dfa6f5ea4d95f8a8d64c3edf | [
"MIT"
] | null | null | null | DailyProgrammer/20120221B.py | DayGitH/Python-Challenges | bc32f1332a92fcc2dfa6f5ea4d95f8a8d64c3edf | [
"MIT"
] | null | null | null | """
Create a program that will take any string and write it out to a text file, reversed.
input: "hello!"
output: "!olleh"
"""
with open('20120221B.txt', 'w') as f:
f.write(input('Enter string: ')[::-1])
print('DONE')
# found better version
# open('20120221B.txt', 'w').write(input('Enter string: ')[::-1])
| 22.428571 | 85 | 0.640127 |
with open('20120221B.txt', 'w') as f:
f.write(input('Enter string: ')[::-1])
print('DONE')
| true | true |
1c325dcde86abd941f521a970dca3c0e0fb1358e | 407 | py | Python | python/gauss-quadrature.py | simnalamburt/snippets | 8ba4cfcb1305d2b82ea892e3305613eeb7ba382b | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 31 | 2016-01-27T07:03:25.000Z | 2022-02-25T07:59:11.000Z | python/gauss-quadrature.py | simnalamburt/snippets | 8ba4cfcb1305d2b82ea892e3305613eeb7ba382b | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2015-01-26T01:27:21.000Z | 2015-01-30T16:16:30.000Z | python/gauss-quadrature.py | simnalamburt/snippets | 8ba4cfcb1305d2b82ea892e3305613eeb7ba382b | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 3 | 2017-02-07T04:17:56.000Z | 2020-06-12T05:01:31.000Z | from decimal import Decimal
from collections.abc import Callable
from math import exp
def gauss_quadrature_3(f: Callable[[Decimal], Decimal]) -> Decimal:
return (
f(Decimal('-0.77459_66692')) * 5/9 +
f(Decimal(0)) * 8/9 +
f(Decimal('+0.77459_66692')) * 5/9
)
print(gauss_quadrature_3(la... | 27.133333 | 67 | 0.646192 | from decimal import Decimal
from collections.abc import Callable
from math import exp
def gauss_quadrature_3(f: Callable[[Decimal], Decimal]) -> Decimal:
return (
f(Decimal('-0.77459_66692')) * 5/9 +
f(Decimal(0)) * 8/9 +
f(Decimal('+0.77459_66692')) * 5/9
)
print(gauss_quadrature_3(la... | true | true |
1c325e83840db2256a5d7fb7eccfe98a622b5b16 | 1,264 | py | Python | var/spack/repos/builtin/packages/tppred/package.py | robertsawko/spack | 135cf4835f5b646c4aaa0e2eb5552c80fc3a5ce8 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2019-11-28T10:14:14.000Z | 2019-11-28T10:14:14.000Z | var/spack/repos/builtin/packages/tppred/package.py | robertsawko/spack | 135cf4835f5b646c4aaa0e2eb5552c80fc3a5ce8 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/tppred/package.py | robertsawko/spack | 135cf4835f5b646c4aaa0e2eb5552c80fc3a5ce8 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2017-01-21T17:19:32.000Z | 2017-01-21T17:19:32.000Z | # 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)
from spack import *
class Tppred(Package):
"""TPPRED is a software package for the prediction of mitochondrial
... | 35.111111 | 93 | 0.692247 |
from spack import *
class Tppred(Package):
homepage = "https://tppred2.biocomp.unibo.it/tppred2/default/software"
url = "http://biocomp.unibo.it/savojard/tppred2.tar.gz"
version('2.0', sha256='0e180d5ce1f0bccfdbc3dbf9981b3fbe2101c85491c58c58c88856861688a4f5')
depends_on('python@2.7:2.999'... | true | true |
1c325eae2a9218b0ab9a136d882f7cf4e24c96eb | 3,916 | py | Python | util/send_gmail.py | navidkhoshavi/marss.cacheLineData | e1e27386f4a1be9698f434c67653580d74c02ea3 | [
"Xnet",
"X11"
] | null | null | null | util/send_gmail.py | navidkhoshavi/marss.cacheLineData | e1e27386f4a1be9698f434c67653580d74c02ea3 | [
"Xnet",
"X11"
] | null | null | null | util/send_gmail.py | navidkhoshavi/marss.cacheLineData | e1e27386f4a1be9698f434c67653580d74c02ea3 | [
"Xnet",
"X11"
] | null | null | null | #!/usr/bin/python -W ignore::DeprecationWarning
# this script will generate send an email to notify you when a simulation
# finishes. It is meant to be used by adding
# -execute-after-kill "python util/send_gmail.py"
# to your simconfig file.
#
# To use this script, please follow the instructions below (using the ... | 32.633333 | 140 | 0.758172 |
# recording the data into the xoauth.txt file
import smtplib
from email.mime.image import MIMEImage
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
import base64
from xoauth import *
import random
import os
import socket
import config
def instructions(xoauth_txt_path):... | false | true |
1c325fed87fbaa63dee2d08b90932038e5391f92 | 473 | py | Python | 9.11/tor/model_lstm_crf/config.py | JIAQING-XIE/Google_NLP_DL | 45f45e8cbca695ad079af58790edd0619783b0c2 | [
"MIT"
] | null | null | null | 9.11/tor/model_lstm_crf/config.py | JIAQING-XIE/Google_NLP_DL | 45f45e8cbca695ad079af58790edd0619783b0c2 | [
"MIT"
] | null | null | null | 9.11/tor/model_lstm_crf/config.py | JIAQING-XIE/Google_NLP_DL | 45f45e8cbca695ad079af58790edd0619783b0c2 | [
"MIT"
] | null | null | null | batch_size = 8
learning_rate = 0.001
decay_rate = 0.05
seed = 1314159
np_seed = 7894
embedding_size = 300
classfy_number = 13
dropout = 0.5
lstm_hidding_dim = 50
max_length = 83
labels_dict = {
'O':0,'B-POS':1,'I-POS':2,'E-POS':3,'S-POS':4,'B-NEG':5,'I-NEG':6,'E-NEG':7,'S-NEG':8,'B-NEU':9,
'I-NEU':10,'E-NEU':1... | 29.5625 | 118 | 0.610994 | batch_size = 8
learning_rate = 0.001
decay_rate = 0.05
seed = 1314159
np_seed = 7894
embedding_size = 300
classfy_number = 13
dropout = 0.5
lstm_hidding_dim = 50
max_length = 83
labels_dict = {
'O':0,'B-POS':1,'I-POS':2,'E-POS':3,'S-POS':4,'B-NEG':5,'I-NEG':6,'E-NEG':7,'S-NEG':8,'B-NEU':9,
'I-NEU':10,'E-NEU':1... | true | true |
1c32608743780b5486438bd3700e3575a16a1d5a | 8,789 | py | Python | kohtaaminen/kohtaaminen.py | sthagen/kohtaaminen | ce0784ccd8be109164d63f2b5dcea128bd6f4534 | [
"MIT"
] | 1 | 2021-11-13T10:57:55.000Z | 2021-11-13T10:57:55.000Z | kohtaaminen/kohtaaminen.py | sthagen/kohtaaminen | ce0784ccd8be109164d63f2b5dcea128bd6f4534 | [
"MIT"
] | 4 | 2021-11-14T15:12:06.000Z | 2021-11-30T13:54:47.000Z | kohtaaminen/kohtaaminen.py | sthagen/kohtaaminen | ce0784ccd8be109164d63f2b5dcea128bd6f4534 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# pylint: disable=expression-not-assigned,line-too-long
"""Meeting, rendezvous, confluence (Finnish kohtaaminen) mark up, down, and up again. API."""
import itertools
import os
import pathlib
import re
import shutil
import sys
import tempfile
import zipfile
from typing import List, Optional, Tup... | 38.718062 | 119 | 0.544203 |
import itertools
import os
import pathlib
import re
import shutil
import sys
import tempfile
import zipfile
from typing import List, Optional, Tuple, Union
import mdformat
import pypandoc
DEBUG_VAR = 'KOHTAAMINEN_DEBUG'
DEBUG = os.getenv(DEBUG_VAR)
ENCODING = 'utf-8'
ENCODING_ERRORS_POLICY = 'ignore'
STDIN, STD... | true | true |
1c3260c0e2eecca41e5e9561c9a6cc46d9880888 | 397 | py | Python | app/Images_DRF/wsgi.py | MateuszZalewski/images_drf | 8e4b3012ef6bce290d013db9c2318d1badb99b17 | [
"MIT"
] | null | null | null | app/Images_DRF/wsgi.py | MateuszZalewski/images_drf | 8e4b3012ef6bce290d013db9c2318d1badb99b17 | [
"MIT"
] | null | null | null | app/Images_DRF/wsgi.py | MateuszZalewski/images_drf | 8e4b3012ef6bce290d013db9c2318d1badb99b17 | [
"MIT"
] | null | null | null | """
WSGI config for Images_DRF project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SE... | 23.352941 | 78 | 0.788413 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Images_DRF.settings')
application = get_wsgi_application()
| true | true |
1c3260f34fa9e0aad04e8d0bc77a99f301bb1242 | 933 | py | Python | sentsplit/regexes.py | zaemyung/sentsplit | cce34e1ed372b6a79c739f42334c775581fc0de8 | [
"MIT"
] | 10 | 2021-03-26T19:34:45.000Z | 2021-11-23T17:36:45.000Z | sentsplit/regexes.py | zaemyung/sentsplit | cce34e1ed372b6a79c739f42334c775581fc0de8 | [
"MIT"
] | 10 | 2021-03-26T17:27:49.000Z | 2021-11-16T17:09:19.000Z | sentsplit/regexes.py | zaemyung/sentsplit | cce34e1ed372b6a79c739f42334c775581fc0de8 | [
"MIT"
] | null | null | null | """
`segment_regexes`: make sure a string is segmented at either the start or end of the matching group(s)
"""
newline = {
'name': 'newline',
'regex': r'\n',
'at': 'end'
}
ellipsis = {
'name': 'ellipsis',
'regex': r'…(?![\!\?\..?!])',
'at': 'end'
}
after_semicolon = {
'name': 'after_semico... | 25.916667 | 225 | 0.487674 | newline = {
'name': 'newline',
'regex': r'\n',
'at': 'end'
}
ellipsis = {
'name': 'ellipsis',
'regex': r'…(?![\!\?\..?!])',
'at': 'end'
}
after_semicolon = {
'name': 'after_semicolon',
'regex': r' *;',
'at': 'end'
}
liberal_url = {
l_url',
'regex': r'\b((?:[a-z][\w\-]+:(?... | true | true |
1c3261fa9f8dfffa8f5f181f97cefb2281e6fd79 | 13,511 | py | Python | al_utils/vae_sampling.py | PrateekMunjal/TorchAL | ec60b093333c66e4c8862d128d81680060fddf36 | [
"MIT"
] | null | null | null | al_utils/vae_sampling.py | PrateekMunjal/TorchAL | ec60b093333c66e4c8862d128d81680060fddf36 | [
"MIT"
] | null | null | null | al_utils/vae_sampling.py | PrateekMunjal/TorchAL | ec60b093333c66e4c8862d128d81680060fddf36 | [
"MIT"
] | null | null | null | import torch
import os
import math
import numpy as np
from copy import deepcopy
from pycls.core.config import cfg
import pycls.utils.distributed as du
from tqdm import tqdm
class AdversarySampler:
def __init__(self, budget):
self.budget = budget
self.cuda_id = torch.cuda.current_device()
def ... | 35.36911 | 136 | 0.595589 | import torch
import os
import math
import numpy as np
from copy import deepcopy
from pycls.core.config import cfg
import pycls.utils.distributed as du
from tqdm import tqdm
class AdversarySampler:
def __init__(self, budget):
self.budget = budget
self.cuda_id = torch.cuda.current_device()
def ... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.