hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c2ac4ae55fa2e80c1a9c465c094082b9c0ebfee | 3,543 | py | Python | scikinC/QuantileTransformerConverter.py | landerlini/scikinC | c408e2b63a32eecefc514193a4483b9d95b8d0fa | [
"MIT"
] | null | null | null | scikinC/QuantileTransformerConverter.py | landerlini/scikinC | c408e2b63a32eecefc514193a4483b9d95b8d0fa | [
"MIT"
] | 2 | 2021-07-30T16:30:23.000Z | 2021-09-15T07:27:38.000Z | scikinC/QuantileTransformerConverter.py | landerlini/scikinC | c408e2b63a32eecefc514193a4483b9d95b8d0fa | [
"MIT"
] | null | null | null | import numpy as np
import sys
from scikinC import BaseConverter
from scipy import stats
from ._tools import array2c, get_interpolation_function
class QuantileTransformerConverter (BaseConverter):
def convert (self, model, name=None):
lines = self.header()
distr = model.output_distribution
if distr n... | 28.572581 | 81 | 0.545865 | import numpy as np
import sys
from scikinC import BaseConverter
from scipy import stats
from ._tools import array2c, get_interpolation_function
class QuantileTransformerConverter (BaseConverter):
def convert (self, model, name=None):
lines = self.header()
distr = model.output_distribution
if distr n... | true | true |
1c2ac59cb95ab9b612e5fe0ce2de7aba2ecd8eb7 | 7,370 | py | Python | src/pybel/io/hetionet/hetionet.py | rpatil524/pybel | 565fa0bc37ddc362370fd36926cc1ae76c10d71a | [
"MIT"
] | 103 | 2016-10-25T05:51:26.000Z | 2022-03-23T02:21:12.000Z | src/pybel/io/hetionet/hetionet.py | rpatil524/pybel | 565fa0bc37ddc362370fd36926cc1ae76c10d71a | [
"MIT"
] | 444 | 2016-10-22T13:09:10.000Z | 2022-03-21T12:01:39.000Z | src/pybel/io/hetionet/hetionet.py | rpatil524/pybel | 565fa0bc37ddc362370fd36926cc1ae76c10d71a | [
"MIT"
] | 38 | 2017-01-06T03:32:38.000Z | 2022-03-19T11:27:30.000Z | # -*- coding: utf-8 -*-
"""Importer for Hetionet JSON."""
import bz2
import json
import logging
from typing import Any, Mapping, Set, Tuple, Union
import pystow
from tqdm.autonotebook import tqdm
from .constants import (
ACTIVATES_ACTIONS, BINDS_ACTIONS, COMPOUND, DSL_MAP, GENE, HETIONET_PUBMED, INHIBITS_ACTION... | 35.776699 | 120 | 0.645455 |
import bz2
import json
import logging
from typing import Any, Mapping, Set, Tuple, Union
import pystow
from tqdm.autonotebook import tqdm
from .constants import (
ACTIVATES_ACTIONS, BINDS_ACTIONS, COMPOUND, DSL_MAP, GENE, HETIONET_PUBMED, INHIBITS_ACTIONS, PHARMACOLOGICAL_CLASS,
QUALIFIED_MAPPING, REGULATE... | true | true |
1c2ac5defee01e9e56d5ce1c6467a9e4f776b13c | 1,840 | py | Python | deeplook/tests/test_gradient_descent.py | opengeophysics/deeplook | 0b39a81fe5e7f28c341e0a83e214e259ab19028b | [
"BSD-3-Clause"
] | 4 | 2018-05-23T23:27:22.000Z | 2021-04-13T14:44:37.000Z | deeplook/tests/test_gradient_descent.py | opengeophysics/deeplook | 0b39a81fe5e7f28c341e0a83e214e259ab19028b | [
"BSD-3-Clause"
] | 1 | 2019-05-25T09:45:36.000Z | 2019-06-26T04:40:02.000Z | deeplook/tests/test_gradient_descent.py | opengeophysics/deeplook | 0b39a81fe5e7f28c341e0a83e214e259ab19028b | [
"BSD-3-Clause"
] | 1 | 2020-07-02T05:22:21.000Z | 2020-07-02T05:22:21.000Z | # pylint: disable=redefined-outer-name,no-self-use,too-few-public-methods
"""
Test the gradient descent optimization.
"""
import pytest
import numpy as np
import numpy.testing as npt
from ..optimization.gradient_descent import Newton, apply_preconditioning
class Paraboloid():
"An N-dimensional paraboloid functio... | 32.280702 | 76 | 0.645109 |
import pytest
import numpy as np
import numpy.testing as npt
from ..optimization.gradient_descent import Newton, apply_preconditioning
class Paraboloid():
def __call__(self, params):
return params.T.dot(params)
def derivatives(self, params, include_hessian=False):
gradient = 2*params
... | true | true |
1c2ac61138c5b5da3c9ecc0109710bf5d74e5b3d | 2,118 | py | Python | src/sdk/healthchecks.py | iYasha/studycobra | 097a78e4a3679bfe6934983eb2be77ba76408d77 | [
"MIT"
] | null | null | null | src/sdk/healthchecks.py | iYasha/studycobra | 097a78e4a3679bfe6934983eb2be77ba76408d77 | [
"MIT"
] | null | null | null | src/sdk/healthchecks.py | iYasha/studycobra | 097a78e4a3679bfe6934983eb2be77ba76408d77 | [
"MIT"
] | null | null | null | import os
import uuid
from asyncio import get_event_loop
import aio_pika
import aiofiles
import psutil
from aio_pika import RobustConnection
from core.config import settings
from core.database import database
SUCCESS_STATUS = "working"
DISK_USAGE_MAX = 90 # percentage
MEMORY_MIN = 100 # Mb
async def check_databas... | 26.148148 | 100 | 0.65203 | import os
import uuid
from asyncio import get_event_loop
import aio_pika
import aiofiles
import psutil
from aio_pika import RobustConnection
from core.config import settings
from core.database import database
SUCCESS_STATUS = "working"
DISK_USAGE_MAX = 90
MEMORY_MIN = 100
async def check_database() -> str:
... | true | true |
1c2ac71132a79951ae12521bc9411ab95f904ecf | 3,529 | py | Python | azure-graphrbac/azure/graphrbac/models/user_update_parameters.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 4 | 2016-06-17T23:25:29.000Z | 2022-03-30T22:37:45.000Z | azure/graphrbac/models/user_update_parameters.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 2 | 2016-09-30T21:40:24.000Z | 2017-11-10T18:16:18.000Z | azure/graphrbac/models/user_update_parameters.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 3 | 2016-05-03T20:49:46.000Z | 2017-10-05T21:05:27.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 50.414286 | 220 | 0.675262 |
from .user_base import UserBase
class UserUpdateParameters(UserBase):
_attribute_map = {
'immutable_id': {'key': 'immutableId', 'type': 'str'},
'usage_location': {'key': 'usageLocation', 'type': 'str'},
'given_name': {'key': 'givenName', 'type': 'str'},
'surname': {'key... | true | true |
1c2ac7bf1005b445d29b7e92cbd6e890c97de8ea | 5,655 | py | Python | tests/utils/test_merge_dict.py | Purg/SMQTK | 705a2b2979935ed129aac7db578571c4ae1343e7 | [
"BSD-3-Clause"
] | 82 | 2015-01-07T15:33:29.000Z | 2021-08-11T18:34:05.000Z | tests/utils/test_merge_dict.py | Purg/SMQTK | 705a2b2979935ed129aac7db578571c4ae1343e7 | [
"BSD-3-Clause"
] | 230 | 2015-04-08T14:36:51.000Z | 2022-03-14T17:55:30.000Z | tests/utils/test_merge_dict.py | Purg/SMQTK | 705a2b2979935ed129aac7db578571c4ae1343e7 | [
"BSD-3-Clause"
] | 65 | 2015-01-04T15:00:16.000Z | 2021-11-19T18:09:11.000Z | import unittest
from smqtk.utils.dict import merge_dict
class TestMergeDict (unittest.TestCase):
def setUp(self):
# Reset values
self.a = {
1: 2,
3: 'value',
'nested': {
'v': 'sub-value',
'l': [0, 1, 2],
'i': 4,
... | 25.704545 | 80 | 0.345181 | import unittest
from smqtk.utils.dict import merge_dict
class TestMergeDict (unittest.TestCase):
def setUp(self):
self.a = {
1: 2,
3: 'value',
'nested': {
'v': 'sub-value',
'l': [0, 1, 2],
'i': 4,
... | true | true |
1c2ac7ef15f2f881365767cbd282fcf891e2d5a4 | 2,454 | py | Python | __init__.py | XYlearn/binja-wasm | b0a66edad2b5f522de2099896037fe11a4244a05 | [
"Apache-2.0"
] | 1 | 2019-01-14T11:56:48.000Z | 2019-01-14T11:56:48.000Z | __init__.py | XYlearn/binja-wasm | b0a66edad2b5f522de2099896037fe11a4244a05 | [
"Apache-2.0"
] | null | null | null | __init__.py | XYlearn/binja-wasm | b0a66edad2b5f522de2099896037fe11a4244a05 | [
"Apache-2.0"
] | null | null | null | import binaryninja
import struct
from .loader import WamsLoader
from .utils import *
from .waop import WasmOpcode, max_mnem_length
from .disasm import WasmDisasm
class Wasm(binaryninja.Architecture):
name = "wasm"
regs = {
"sp": binaryninja.RegisterInfo('sp', 4)
}
max_instr_length = 2 + 19 * ... | 26.967033 | 88 | 0.666259 | import binaryninja
import struct
from .loader import WamsLoader
from .utils import *
from .waop import WasmOpcode, max_mnem_length
from .disasm import WasmDisasm
class Wasm(binaryninja.Architecture):
name = "wasm"
regs = {
"sp": binaryninja.RegisterInfo('sp', 4)
}
max_instr_length = 2 + 19 * ... | true | true |
1c2ac8671a6ef4bf026410d455cb4ea304a3167c | 2,820 | py | Python | dvc/main.py | sahilbhosale63/dvc | 999c9e188801f971b75f51ca84f5bad533cb462c | [
"Apache-2.0"
] | null | null | null | dvc/main.py | sahilbhosale63/dvc | 999c9e188801f971b75f51ca84f5bad533cb462c | [
"Apache-2.0"
] | null | null | null | dvc/main.py | sahilbhosale63/dvc | 999c9e188801f971b75f51ca84f5bad533cb462c | [
"Apache-2.0"
] | null | null | null | """Main entry point for dvc CLI."""
import errno
import logging
from dvc import analytics
from dvc.cli import parse_args
from dvc.config import ConfigError
from dvc.exceptions import DvcException, DvcParserError, NotDvcRepoError
from dvc.external_repo import clean_repos
from dvc.logger import FOOTER, disable_other_lo... | 28.2 | 79 | 0.599645 |
import errno
import logging
from dvc import analytics
from dvc.cli import parse_args
from dvc.config import ConfigError
from dvc.exceptions import DvcException, DvcParserError, NotDvcRepoError
from dvc.external_repo import clean_repos
from dvc.logger import FOOTER, disable_other_loggers
from dvc.remote.pool import cl... | true | true |
1c2ac8a339f463be16cc39f35900d7f2ccc131e8 | 3,032 | py | Python | tests/test_vote_ensembled.py | dyollb/MONAI | 9084c452c48095c82c71d4391b3684006e5a3c56 | [
"Apache-2.0"
] | 2,971 | 2019-10-16T23:53:16.000Z | 2022-03-31T20:58:24.000Z | tests/test_vote_ensembled.py | dyollb/MONAI | 9084c452c48095c82c71d4391b3684006e5a3c56 | [
"Apache-2.0"
] | 2,851 | 2020-01-10T16:23:44.000Z | 2022-03-31T22:14:53.000Z | tests/test_vote_ensembled.py | dyollb/MONAI | 9084c452c48095c82c71d4391b3684006e5a3c56 | [
"Apache-2.0"
] | 614 | 2020-01-14T19:18:01.000Z | 2022-03-31T14:06:14.000Z | # Copyright 2020 - 2021 MONAI Consortium
# 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 wri... | 36.53012 | 116 | 0.58872 |
import unittest
import torch
from parameterized import parameterized
from monai.transforms import VoteEnsembled
TEST_CASE_1 = [
{"keys": ["pred0", "pred1", "pred2"], "output_key": "output", "num_classes": None},
{
"pred0": torch.tensor([[[[1]], [[0]]]]),
"pred1": torch.tensor([[[[... | true | true |
1c2ac98a86443b6773ae201fed5c48e9c66e947b | 78,806 | py | Python | arkbutler/venv/Lib/site-packages/pyautogui/__init__.py | terrillcallum/unknown3344 | 82c5063c84551e9d6ef3bd77302c135f1585adf0 | [
"Apache-2.0"
] | 5 | 2022-01-21T06:26:06.000Z | 2022-01-24T17:51:04.000Z | arkbutler/venv/Lib/site-packages/pyautogui/__init__.py | terrillcallum/unknown3344 | 82c5063c84551e9d6ef3bd77302c135f1585adf0 | [
"Apache-2.0"
] | 9 | 2021-08-14T01:27:36.000Z | 2021-08-24T18:10:18.000Z | arkbutler/venv/Lib/site-packages/pyautogui/__init__.py | terrillcallum/unknown3344 | 82c5063c84551e9d6ef3bd77302c135f1585adf0 | [
"Apache-2.0"
] | 2 | 2022-01-16T23:01:20.000Z | 2022-01-30T13:51:27.000Z | # PyAutoGUI lets Python control the mouse and keyboard, and other GUI automation tasks. For Windows, macOS, and Linux,
# on Python 3 and 2.
# https://github.com/asweigart/pyautogui
# Al Sweigart al@inventwithpython.com (Send me feedback & suggestions!)
# TODO - the following features are half-implemented right now:
#... | 36.518072 | 252 | 0.642832 |
from __future__ import absolute_import, division, print_function
__version__ = "0.9.53"
import sys
import time
import datetime
import os
import platform
import re
import functools
from contextlib import contextmanager
class PyAutoGUIException(Exception):
pass
class FailSafeException(PyAutoGUIExc... | true | true |
1c2acaa4aa1e1801f1d773079e649597a9f12e23 | 2,295 | py | Python | docs/source/conf.py | GuoqingZhou-LANL/hippynn | e3c31b3dc77369bd24ed575005b6385796ba04b0 | [
"BSD-3-Clause"
] | null | null | null | docs/source/conf.py | GuoqingZhou-LANL/hippynn | e3c31b3dc77369bd24ed575005b6385796ba04b0 | [
"BSD-3-Clause"
] | null | null | null | docs/source/conf.py | GuoqingZhou-LANL/hippynn | e3c31b3dc77369bd24ed575005b6385796ba04b0 | [
"BSD-3-Clause"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 31.875 | 79 | 0.67451 |
project = 'hippynn'
copyright = '2019, Los Alamos National Laboratory'
author = 'Nicholas Lubbers'
release = '0.0.1a'
extensions = [
'sphinx.ext.autodoc',
'sphinx_rtd_theme',
'sphinx.ext.viewcode'
]
add_module_names = False
templates_path = ['_templates']
exclude_patterns =... | true | true |
1c2acb237331539184c600646558dd53a11136bb | 2,717 | py | Python | Kaggle/Playgroud/RiskPrediction/Home-Credit-Default-Risk-master/py/506_aggregate-6m.py | hehuanlin123/DeepLearning | 6b7feabbbde9ac9489f76da4c06eeb6703fb165a | [
"MIT"
] | 1 | 2020-02-28T12:03:39.000Z | 2020-02-28T12:03:39.000Z | Kaggle/Playgroud/RiskPrediction/Home-Credit-Default-Risk-master/py/506_aggregate-6m.py | hehuanlin123/DeepLearning | 6b7feabbbde9ac9489f76da4c06eeb6703fb165a | [
"MIT"
] | null | null | null | Kaggle/Playgroud/RiskPrediction/Home-Credit-Default-Risk-master/py/506_aggregate-6m.py | hehuanlin123/DeepLearning | 6b7feabbbde9ac9489f76da4c06eeb6703fb165a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jul 21 01:58:42 2018
@author: Kazuki
"""
import numpy as np
import pandas as pd
import gc
import os
from multiprocessing import Pool, cpu_count
NTHREAD = cpu_count()
import utils_agg
import utils
utils.start(__file__)
#=================================... | 28.302083 | 89 | 0.461907 |
import numpy as np
import pandas as pd
import gc
import os
from multiprocessing import Pool, cpu_count
NTHREAD = cpu_count()
import utils_agg
import utils
utils.start(__file__)
PREF = 'f506_'
KEY = 'SK_ID_CURR'
day_start = -365*0.5
day_end = -365*0
os.system(f'rm ../feature/t*_{PREF}*')
bure = utils.read_... | true | true |
1c2acbec3311866f07db9ac26c7cb63410cb897c | 20,217 | py | Python | test/functional/rpc_rawtransaction.py | tavecchiacoinpay/tavecchiacoinpay | 9ec5d7b7e1af31ae63df1621e37cd62669219a3b | [
"MIT"
] | null | null | null | test/functional/rpc_rawtransaction.py | tavecchiacoinpay/tavecchiacoinpay | 9ec5d7b7e1af31ae63df1621e37cd62669219a3b | [
"MIT"
] | null | null | null | test/functional/rpc_rawtransaction.py | tavecchiacoinpay/tavecchiacoinpay | 9ec5d7b7e1af31ae63df1621e37cd62669219a3b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The TavecchiacoinPay Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the rawtransaction RPCs.
Test the following RPCs:
- createrawtransaction
- signraw... | 53.343008 | 233 | 0.647524 |
from test_framework.test_framework import TavecchiacoinPayTestFramework
from test_framework.util import *
class multidict(dict):
def __init__(self, x):
dict.__init__(self, x)
self.x = x
def items(self):
return self.x
class RawTransactionsTest(TavecchiacoinPayTestFramework):
... | true | true |
1c2acc4ad46f77260c79f6299a04439b5b360e28 | 586 | py | Python | tests/test_skeleton.py | tn69849/data-science | 0dab5145f3191b118e3c9feec29f5c8ef9b79042 | [
"MIT"
] | null | null | null | tests/test_skeleton.py | tn69849/data-science | 0dab5145f3191b118e3c9feec29f5c8ef9b79042 | [
"MIT"
] | null | null | null | tests/test_skeleton.py | tn69849/data-science | 0dab5145f3191b118e3c9feec29f5c8ef9b79042 | [
"MIT"
] | null | null | null | import pytest
from data_science.skeleton import fib, main
__author__ = "Than Nguyen"
__copyright__ = "Than Nguyen"
__license__ = "MIT"
def test_fib():
"""API Tests"""
assert fib(1) == 1
assert fib(2) == 1
assert fib(7) == 13
with pytest.raises(AssertionError):
fib(-10)
def test_main(ca... | 22.538462 | 73 | 0.66041 | import pytest
from data_science.skeleton import fib, main
__author__ = "Than Nguyen"
__copyright__ = "Than Nguyen"
__license__ = "MIT"
def test_fib():
assert fib(1) == 1
assert fib(2) == 1
assert fib(7) == 13
with pytest.raises(AssertionError):
fib(-10)
def test_main(capsys):
... | true | true |
1c2acd2f7c2aa27d7ff0b3cd90b5fdd250f5ff16 | 1,467 | py | Python | projects/CenterNet2/centernet/ct_utils/track_utils.py | jozhang97/CenterNet2 | dc439b6bed77c72409d4e75a5bfdef1bebd5355c | [
"Apache-2.0"
] | null | null | null | projects/CenterNet2/centernet/ct_utils/track_utils.py | jozhang97/CenterNet2 | dc439b6bed77c72409d4e75a5bfdef1bebd5355c | [
"Apache-2.0"
] | null | null | null | projects/CenterNet2/centernet/ct_utils/track_utils.py | jozhang97/CenterNet2 | dc439b6bed77c72409d4e75a5bfdef1bebd5355c | [
"Apache-2.0"
] | null | null | null | from collections import defaultdict
import itertools
def _make_track_ids_unique(annotations):
"""
Makes the track IDs unqiue over the whole annotation set. Adapted from https://github.com/TAO-Dataset/
:param annotations: the annotation set
:return: the number of updated IDs
"""
track_id_videos ... | 32.6 | 106 | 0.646898 | from collections import defaultdict
import itertools
def _make_track_ids_unique(annotations):
track_id_videos = {}
track_ids_to_update = set()
max_track_id = 0
for ann in annotations:
t = ann['track_id']
if t not in track_id_videos:
track_id_videos[t] = ann['video_id']
... | true | true |
1c2ace2e09d6626d278d1a3cfd8204ea22505436 | 75,147 | py | Python | src/python/grpcio/grpc_core_dependencies.py | gautamrishabh/grpc | 566d77efb92c235ebd7ebb7dc3ce80c4e5700dfd | [
"Apache-2.0"
] | 1 | 2020-10-31T06:20:46.000Z | 2020-10-31T06:20:46.000Z | src/python/grpcio/grpc_core_dependencies.py | lokifist/grpc | 01cc519b53eb2d37f2ee0218bbeee7f08b621c4c | [
"Apache-2.0"
] | null | null | null | src/python/grpcio/grpc_core_dependencies.py | lokifist/grpc | 01cc519b53eb2d37f2ee0218bbeee7f08b621c4c | [
"Apache-2.0"
] | 1 | 2020-10-31T06:20:48.000Z | 2020-10-31T06:20:48.000Z | # Copyright 2015 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 63.042785 | 131 | 0.752392 |
CORE_SOURCE_FILES = [
'src/core/ext/filters/census/grpc_context.cc',
'src/core/ext/filters/client_channel/backend_metric.cc',
'src/core/ext/filters/client_channel/backup_poller.cc',
'src/core/ext/filters/client_channel/channel_connectivity.cc',
'src/core/ext/filters/client_channel/cl... | true | true |
1c2ace3f100eae19ce9f3167ee7b4c32dbe3e05a | 1,969 | py | Python | src/fava/core/documents.py | edwardtheharris/fava | 86f4fdd2ab0b019add668af2b3be3bf687a220e2 | [
"MIT"
] | 1,224 | 2016-10-20T14:21:35.000Z | 2022-03-29T00:56:07.000Z | src/fava/core/documents.py | edwardtheharris/fava | 86f4fdd2ab0b019add668af2b3be3bf687a220e2 | [
"MIT"
] | 830 | 2016-10-29T12:38:43.000Z | 2022-03-30T20:54:44.000Z | src/fava/core/documents.py | edwardtheharris/fava | 86f4fdd2ab0b019add668af2b3be3bf687a220e2 | [
"MIT"
] | 230 | 2016-10-30T21:47:41.000Z | 2022-03-30T07:07:10.000Z | """Document path related helpers."""
import os
from os import path
from typing import TYPE_CHECKING
from fava.helpers import FavaAPIException
if TYPE_CHECKING: # pragma: no cover
from fava.core import FavaLedger
def is_document_or_import_file(filename: str, ledger: "FavaLedger") -> bool:
"""Check whether t... | 28.536232 | 78 | 0.660741 | import os
from os import path
from typing import TYPE_CHECKING
from fava.helpers import FavaAPIException
if TYPE_CHECKING:
from fava.core import FavaLedger
def is_document_or_import_file(filename: str, ledger: "FavaLedger") -> bool:
filenames = [
document.filename for document in ledger.all_entrie... | true | true |
1c2ace55c3094d237b2ee33d730a279091ae7a83 | 10,872 | py | Python | tests/obfuscatetests/test_ob_get_source_statements.py | rdevost/pymixup | 9004fbdc7939033014b0eefa669056014647a0c8 | [
"MIT"
] | 5 | 2017-01-02T15:12:31.000Z | 2021-09-03T15:51:39.000Z | tests/obfuscatetests/test_ob_get_source_statements.py | rdevost/pymixup | 9004fbdc7939033014b0eefa669056014647a0c8 | [
"MIT"
] | null | null | null | tests/obfuscatetests/test_ob_get_source_statements.py | rdevost/pymixup | 9004fbdc7939033014b0eefa669056014647a0c8 | [
"MIT"
] | 1 | 2021-09-03T15:51:41.000Z | 2021-09-03T15:51:41.000Z | import pytest
from os.path import join
import io
from logic.obfuscatefile import source_statement_gen
def test_get_source_statements(tmpdir):
#
# Create a short source file
#
dir_name = str(tmpdir.mkdir('source'))
source_file = 'app.py'
with io.open(join(dir_name, source_file), 'w') as source:... | 37.75 | 78 | 0.588944 | import pytest
from os.path import join
import io
from logic.obfuscatefile import source_statement_gen
def test_get_source_statements(tmpdir):
dir_name = str(tmpdir.mkdir('source'))
source_file = 'app.py'
with io.open(join(dir_name, source_file), 'w') as source:
source.write... | true | true |
1c2acfbd67f58cb4d040e6d848691e3ca6daad54 | 737 | py | Python | tema1/gym_step.py | oscarramos2001/Oscar-Marino-Ramos | c05e497b467aab4572f3578f1b9068d4585106d2 | [
"MIT"
] | 112 | 2018-11-19T17:23:40.000Z | 2022-03-29T05:36:14.000Z | tema1/gym_step.py | BrujitoOz/ia-course | c05e497b467aab4572f3578f1b9068d4585106d2 | [
"MIT"
] | null | null | null | tema1/gym_step.py | BrujitoOz/ia-course | c05e497b467aab4572f3578f1b9068d4585106d2 | [
"MIT"
] | 187 | 2018-11-28T11:38:02.000Z | 2022-03-16T11:18:39.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 30 18:26:17 2018
@author: juangabriel
"""
import gym
environment = gym.make("Qbert-v0")
MAX_NUM_EPISODES = 10
MAX_STEPS_PER_EPISODE = 500
for episode in range(MAX_NUM_EPISODES):
obs = environment.reset()
for step in range(MAX_STEPS_PER_... | 27.296296 | 86 | 0.648575 |
import gym
environment = gym.make("Qbert-v0")
MAX_NUM_EPISODES = 10
MAX_STEPS_PER_EPISODE = 500
for episode in range(MAX_NUM_EPISODES):
obs = environment.reset()
for step in range(MAX_STEPS_PER_EPISODE):
environment.render()
action = environment.action_space.sample()info = environment.ste... | true | true |
1c2acfbf12d1a92708108d26e0413ffc2e207a0e | 3,077 | py | Python | src/toolkits.py | yuanli-cn/tele-aria2 | 394dcfb88bb481de8546ba0149ae3ad1f64c7936 | [
"MIT"
] | null | null | null | src/toolkits.py | yuanli-cn/tele-aria2 | 394dcfb88bb481de8546ba0149ae3ad1f64c7936 | [
"MIT"
] | null | null | null | src/toolkits.py | yuanli-cn/tele-aria2 | 394dcfb88bb481de8546ba0149ae3ad1f64c7936 | [
"MIT"
] | null | null | null | import configparser
def config_reader(config_path):
config = configparser.ConfigParser()
with open(config_path) as configs:
config_string = configs.read()
config.read_string(config_string)
# Use dict to convert result to dixt
# https://stackoverflow.com/a/1773820/4480674
return dict(con... | 26.299145 | 74 | 0.496588 | import configparser
def config_reader(config_path):
config = configparser.ConfigParser()
with open(config_path) as configs:
config_string = configs.read()
config.read_string(config_string)
return dict(config.items('telegram'))
def merge_two_dicts(*dict_args):
result = {}
for... | true | true |
1c2ad0303e6c8a0781c3fe1d36b8dee5cab805f9 | 7,005 | py | Python | notebooks/run_inpaint.py | dbanys/glide-text2im | 5177545ec62f1fddc3075a8a69b63df3eb2256a5 | [
"MIT"
] | null | null | null | notebooks/run_inpaint.py | dbanys/glide-text2im | 5177545ec62f1fddc3075a8a69b63df3eb2256a5 | [
"MIT"
] | null | null | null | notebooks/run_inpaint.py | dbanys/glide-text2im | 5177545ec62f1fddc3075a8a69b63df3eb2256a5 | [
"MIT"
] | null | null | null | # Run this line to install the package if it is
# not already installed.
from typing import Tuple
from IPython.display import display
from PIL import Image
import numpy as np
import torch as th
import torch.nn.functional as F
import argparse
from glide_text2im.download import load_checkpoint
from glide_text2im.model_... | 32.430556 | 97 | 0.701213 |
from typing import Tuple
from IPython.display import display
from PIL import Image
import numpy as np
import torch as th
import torch.nn.functional as F
import argparse
from glide_text2im.download import load_checkpoint
from glide_text2im.model_creation import (
create_model_and_diffusion,
model_and_diffusio... | true | true |
1c2ad1016b18be8f0f79eab64a3ed6a44caa4ae4 | 103 | py | Python | creds.example.py | alyxw/minicom-tone-gen | f6405008ed85d62550bfde83daad963fdcc0be6b | [
"MIT"
] | null | null | null | creds.example.py | alyxw/minicom-tone-gen | f6405008ed85d62550bfde83daad963fdcc0be6b | [
"MIT"
] | null | null | null | creds.example.py | alyxw/minicom-tone-gen | f6405008ed85d62550bfde83daad963fdcc0be6b | [
"MIT"
] | 1 | 2021-12-18T02:04:04.000Z | 2021-12-18T02:04:04.000Z | db_host="127.0.0.1"
db_port="3306"
db_user=""
db_pass=""
db_database=""
twitch_key=""
twitch_channel="" | 14.714286 | 19 | 0.708738 | db_host="127.0.0.1"
db_port="3306"
db_user=""
db_pass=""
db_database=""
twitch_key=""
twitch_channel="" | true | true |
1c2ad23700edeb596817456101eb4d24c74dace6 | 11,199 | py | Python | main.py | YotYot/StereoNet | 0fd7a6b33bbc02d24cc0bd1817fccec0e756579d | [
"MIT"
] | 6 | 2019-02-13T15:29:46.000Z | 2021-09-04T12:59:26.000Z | main.py | YotYot/StereoNet | 0fd7a6b33bbc02d24cc0bd1817fccec0e756579d | [
"MIT"
] | null | null | null | main.py | YotYot/StereoNet | 0fd7a6b33bbc02d24cc0bd1817fccec0e756579d | [
"MIT"
] | 2 | 2019-02-04T16:50:06.000Z | 2019-03-26T01:52:22.000Z | from __future__ import print_function
import argparse
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
import random
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torch.utils.data
from torch.autograd import Variable
import torch.nn.... | 44.264822 | 345 | 0.656755 | from __future__ import print_function
import argparse
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
import random
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torch.utils.data
from torch.autograd import Variable
import torch.nn.... | true | true |
1c2ad3ab50dd1e488625e1128de415f797e94cc6 | 12,420 | py | Python | kaffe/tensorflow/network.py | w3sip/caffe-tensorflow | 67b4525bbff5b1d53cc64dbbf5f25c5d8e2ce667 | [
"MIT"
] | 2 | 2017-10-04T05:37:13.000Z | 2017-10-18T20:49:09.000Z | kaffe/tensorflow/network.py | w3sip/caffe-tensorflow | 67b4525bbff5b1d53cc64dbbf5f25c5d8e2ce667 | [
"MIT"
] | null | null | null | kaffe/tensorflow/network.py | w3sip/caffe-tensorflow | 67b4525bbff5b1d53cc64dbbf5f25c5d8e2ce667 | [
"MIT"
] | 2 | 2021-05-12T17:19:23.000Z | 2021-05-12T17:38:10.000Z | import math
import numpy as np
import tensorflow as tf
BATCH_SIZE = 4 # Only used for deconvolution
DEFAULT_PADDING = 'SAME'
def layer(op):
'''Decorator for composable network layers.'''
def layer_decorated(self, *args, **kwargs):
# Automatically set a name if not provided.
name = kwargs.set... | 39.55414 | 121 | 0.543076 | import math
import numpy as np
import tensorflow as tf
BATCH_SIZE = 4
DEFAULT_PADDING = 'SAME'
def layer(op):
def layer_decorated(self, *args, **kwargs):
name = kwargs.setdefault('name', self.get_unique_name(op.__name__))
if len(self.terminals) == 0:
raise RuntimeE... | true | true |
1c2ad44675975410e5fc3ca298109cf77b32a279 | 97,915 | py | Python | r0c/ivt100.py | 9001/r0c | 871dd8ab990d5134694b518f2abfff67a1e9b6f8 | [
"MIT"
] | 16 | 2018-01-07T19:26:43.000Z | 2022-03-24T12:19:08.000Z | r0c/ivt100.py | 9001/r0c | 871dd8ab990d5134694b518f2abfff67a1e9b6f8 | [
"MIT"
] | 2 | 2018-03-19T01:02:25.000Z | 2020-12-19T00:40:54.000Z | r0c/ivt100.py | 9001/r0c | 871dd8ab990d5134694b518f2abfff67a1e9b6f8 | [
"MIT"
] | 1 | 2021-02-27T10:13:15.000Z | 2021-02-27T10:13:15.000Z | # coding: utf-8
from __future__ import print_function
from .__init__ import EP, PY2, COLORS, IRONPY, unicode
from . import util as Util
from . import chat as Chat
from . import user as User
import os
import re
import time
import zlib
import socket
import threading
import binascii
from datetime import datetime
import o... | 35.183255 | 140 | 0.445795 |
from __future__ import print_function
from .__init__ import EP, PY2, COLORS, IRONPY, unicode
from . import util as Util
from . import chat as Chat
from . import user as User
import os
import re
import time
import zlib
import socket
import threading
import binascii
from datetime import datetime
import operator
print ... | true | true |
1c2ad4dc24a343ff29242b5b391190dfd34a3843 | 2,805 | py | Python | backend/processor/builtin/cmc_spider.py | bb111189/Tora-Zilliqa | ae6430ec6594a1ec8c55b02c29d5e7e2db37a021 | [
"Apache-2.0"
] | null | null | null | backend/processor/builtin/cmc_spider.py | bb111189/Tora-Zilliqa | ae6430ec6594a1ec8c55b02c29d5e7e2db37a021 | [
"Apache-2.0"
] | null | null | null | backend/processor/builtin/cmc_spider.py | bb111189/Tora-Zilliqa | ae6430ec6594a1ec8c55b02c29d5e7e2db37a021 | [
"Apache-2.0"
] | 1 | 2022-02-16T07:12:41.000Z | 2022-02-16T07:12:41.000Z | # -*- coding:utf-8 -*-
# Copyright 2019 TEEX
#
# 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 ... | 30.16129 | 122 | 0.643137 |
from bs4 import BeautifulSoup
from re import sub
import certifi
import urllib3
import json
top_exchange_urls = [
"https://coinmarketcap.com/exchanges/bitmax/",
"https://coinmarketcap.com/exchanges/bitmex/",
"https://coinmarketcap.com/exchanges/fcoin/",
"https://coinmarketcap.com/exchan... | true | true |
1c2ad4e5021ad468ba092ef8b09c48cb2edaff46 | 2,106 | py | Python | openGaussBase/testcase/SYSTEM_CATALOGS&SYSTEM_VIEWS/SYSTEM_VIEW/Opengauss_Function_System_View_Case0046.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/SYSTEM_CATALOGS&SYSTEM_VIEWS/SYSTEM_VIEW/Opengauss_Function_System_View_Case0046.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/SYSTEM_CATALOGS&SYSTEM_VIEWS/SYSTEM_VIEW/Opengauss_Function_System_View_Case0046.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | """
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... | 32.90625 | 84 | 0.618708 |
import unittest
from testcase.utils.Common import Common
from testcase.utils.CommonSH import CommonSH
from testcase.utils.Logger import Logger
LOG = Logger()
class SystemView(unittest.TestCase):
def setUp(self):
LOG.info('----------------this is setup-----------------------')
LOG.info(
... | true | true |
1c2ad533801320efddf2fba25992903bdd34b255 | 5,641 | py | Python | Plugins/UnrealEnginePython/Binaries/Win64/Lib/site-packages/h5py/tests/common.py | JustinACoder/H22-GR3-UnrealAI | 361eb9ef1147f8a2991e5f98c4118cd823184adf | [
"MIT"
] | 6 | 2022-02-04T18:12:24.000Z | 2022-03-21T23:57:12.000Z | SLpackage/private/thirdparty/pythonpkgs/h5py/h5py_2.7.0/lib/python2.7/site-packages/h5py/tests/common.py | fanglab/6mASCOPE | 3f1fdcb7693ff152f17623ce549526ec272698b1 | [
"BSD-3-Clause"
] | null | null | null | SLpackage/private/thirdparty/pythonpkgs/h5py/h5py_2.7.0/lib/python2.7/site-packages/h5py/tests/common.py | fanglab/6mASCOPE | 3f1fdcb7693ff152f17623ce549526ec272698b1 | [
"BSD-3-Clause"
] | 1 | 2022-02-08T03:53:23.000Z | 2022-02-08T03:53:23.000Z | # This file is part of h5py, a Python interface to the HDF5 library.
#
# http://www.h5py.org
#
# Copyright 2008-2013 Andrew Collette and contributors
#
# License: Standard 3-clause BSD; see "license.txt" for full license terms
# and contributor agreement.
from __future__ import absolute_import
import sys
i... | 30.491892 | 92 | 0.552384 |
from __future__ import absolute_import
import sys
import os
import shutil
import tempfile
from contextlib import contextmanager
from six import unichr
import numpy as np
import h5py
if sys.version_info >= (2, 7) or sys.version_info >= (3, 2):
import unittest as ut
else:
try:
import unittest... | true | true |
1c2ad5b8e60d229ec96f0273e8eae95bf8e5a365 | 1,421 | py | Python | pub_data_visualization/global_var/path_folders.py | l-leo/pub-data-visualization | 68eea00491424581b057495a7f0f69cf74e16e7d | [
"MIT"
] | 1 | 2021-01-22T16:47:20.000Z | 2021-01-22T16:47:20.000Z | pub_data_visualization/global_var/path_folders.py | l-leo/pub-data-visualization | 68eea00491424581b057495a7f0f69cf74e16e7d | [
"MIT"
] | null | null | null | pub_data_visualization/global_var/path_folders.py | l-leo/pub-data-visualization | 68eea00491424581b057495a7f0f69cf74e16e7d | [
"MIT"
] | null | null | null |
"""
Definition of the paths to the data.
Definition of
the folders to read and save the data
and the folders where the plots should be saved.
Although a default configuration is proposed,
the user can decide her own folders by creating
a module pers_var.py in this folder.
"""
import os
... | 35.525 | 79 | 0.494018 |
import os
| true | true |
1c2ad5cb8db20b72f0b053744a33f21af6814650 | 5,915 | py | Python | litedb/table/persistent_table.py | JonathanVusich/pydb | c750b9045c353b7f57dddb028410ec67f8b23a46 | [
"MIT"
] | 14 | 2019-11-02T18:32:58.000Z | 2022-02-17T10:12:40.000Z | litedb/table/persistent_table.py | JonathanVusich/pydb | c750b9045c353b7f57dddb028410ec67f8b23a46 | [
"MIT"
] | 3 | 2019-11-02T18:38:10.000Z | 2020-12-07T16:44:27.000Z | litedb/table/persistent_table.py | JonathanVusich/pydb | c750b9045c353b7f57dddb028410ec67f8b23a46 | [
"MIT"
] | 2 | 2020-04-21T20:00:35.000Z | 2021-07-07T07:26:30.000Z | import os
from typing import List, Generator, Union, Set
from sortedcontainers import SortedList
from litedb.abc.table import Table
from ..database.config import Config
from ..index import PersistentIndex
from ..shard import ShardManager
from ..utils.io import empty_directory
from ..utils.path import create_info_path... | 40.793103 | 113 | 0.659003 | import os
from typing import List, Generator, Union, Set
from sortedcontainers import SortedList
from litedb.abc.table import Table
from ..database.config import Config
from ..index import PersistentIndex
from ..shard import ShardManager
from ..utils.io import empty_directory
from ..utils.path import create_info_path... | true | true |
1c2ad6585db08e812903dfb02c0b1f504c2879df | 3,062 | py | Python | classes/Hand_On_2/Figure_scripts/fig14_meanshift.py | rbiswas4/MachineLearningInAstronomy | 1318c1befaeb2fbd453b9c272aedf00015e9786a | [
"MIT"
] | 1 | 2019-11-22T14:10:25.000Z | 2019-11-22T14:10:25.000Z | classes/Hand_On_2/Figure_scripts/fig14_meanshift.py | rbiswas4/MachineLearningInAstronomy | 1318c1befaeb2fbd453b9c272aedf00015e9786a | [
"MIT"
] | 2 | 2018-02-18T14:24:52.000Z | 2018-02-19T11:31:56.000Z | classes/Hand_On_2/Figure_scripts/fig14_meanshift.py | oskarkleincentre/MachineLearningInAstronomy | 1318c1befaeb2fbd453b9c272aedf00015e9786a | [
"MIT"
] | null | null | null | # Author: Jake VanderPlas
# License: BSD
# The figure produced by this code is published in the textbook
# "Statistics, Data Mining, and Machine Learning in Astronomy" (2013)
# For more information, see http://astroML.github.com
# To report a bug or issue, use the following forum:
# https://groups.google.com... | 33.282609 | 79 | 0.647616 |
m matplotlib import pyplot as plt
from matplotlib.patches import Ellipse
from scipy.stats import norm
from sklearn.cluster import MeanShift, estimate_bandwidth
from sklearn import preprocessing
from astroML.datasets import fetch_sdss_sspp
from astroML.plotting import setup_text_plots
setup_text_plots(font... | true | true |
1c2ad688deffbd737798b81009eb79c9c12003ac | 13,712 | py | Python | mrl/algorithms/continuous_off_policy.py | vincentlui/megae | 16b8d29377e3180447b03cb8f5120e9e086ad56d | [
"MIT"
] | 82 | 2020-07-06T16:53:39.000Z | 2022-03-25T18:12:35.000Z | mrl/algorithms/continuous_off_policy.py | vincentlui/megae | 16b8d29377e3180447b03cb8f5120e9e086ad56d | [
"MIT"
] | 7 | 2020-10-21T21:25:12.000Z | 2022-01-13T02:58:46.000Z | mrl/algorithms/continuous_off_policy.py | vincentlui/megae | 16b8d29377e3180447b03cb8f5120e9e086ad56d | [
"MIT"
] | 19 | 2020-06-05T23:11:32.000Z | 2022-03-28T08:43:27.000Z | import mrl
from mrl.utils.misc import soft_update, flatten_state
from mrl.modules.model import PytorchModel
import numpy as np
import torch
import torch.nn.functional as F
import os
class ActorPolicy(mrl.Module):
"""Used for DDPG / TD3 and other deterministic policy variants"""
def __init__(self):
super().__i... | 36.468085 | 115 | 0.684437 | import mrl
from mrl.utils.misc import soft_update, flatten_state
from mrl.modules.model import PytorchModel
import numpy as np
import torch
import torch.nn.functional as F
import os
class ActorPolicy(mrl.Module):
def __init__(self):
super().__init__(
'policy',
required_agent_modules=[
... | true | true |
1c2ad6e9846eaa9160a1f274b155668cf98c844a | 10,804 | py | Python | tool/config.py | ethan4335/pytorch-YOLOv4 | 44f67130d83fc2949efb50afe67337735836169b | [
"Apache-2.0"
] | null | null | null | tool/config.py | ethan4335/pytorch-YOLOv4 | 44f67130d83fc2949efb50afe67337735836169b | [
"Apache-2.0"
] | null | null | null | tool/config.py | ethan4335/pytorch-YOLOv4 | 44f67130d83fc2949efb50afe67337735836169b | [
"Apache-2.0"
] | null | null | null | import torch
from tool.torch_utils import convert2cpu
def parse_cfg(cfgfile):
blocks = []
fp = open(cfgfile, 'r')
block = None
line = fp.readline()
while line != '':
line = line.rstrip() # 删除 string 字符串末尾的指定字符(默认为空格).
if line == '' or line[0] == '#':
line = fp.readline(... | 41.714286 | 118 | 0.555905 | import torch
from tool.torch_utils import convert2cpu
def parse_cfg(cfgfile):
blocks = []
fp = open(cfgfile, 'r')
block = None
line = fp.readline()
while line != '':
line = line.rstrip()
if line == '' or line[0] == '#':
line = fp.readline()
continue
... | true | true |
1c2ad77ec86ace346f4528f4798e27cf08dc8f83 | 11,073 | py | Python | slybot/slybot/spider.py | Youwotma/portia | 796741035ef57d2d1a7548f95e4b98393c077056 | [
"BSD-3-Clause"
] | null | null | null | slybot/slybot/spider.py | Youwotma/portia | 796741035ef57d2d1a7548f95e4b98393c077056 | [
"BSD-3-Clause"
] | null | null | null | slybot/slybot/spider.py | Youwotma/portia | 796741035ef57d2d1a7548f95e4b98393c077056 | [
"BSD-3-Clause"
] | 1 | 2018-07-04T10:55:23.000Z | 2018-07-04T10:55:23.000Z | from __future__ import absolute_import
import json
import re
from operator import itemgetter
from copy import deepcopy
import itertools
from six.moves.urllib_parse import urlparse
from w3lib.http import basic_auth_header
from scrapy.http import Request, HtmlResponse, FormRequest
import six
try:
from scrapy.spide... | 41.163569 | 79 | 0.595322 | from __future__ import absolute_import
import json
import re
from operator import itemgetter
from copy import deepcopy
import itertools
from six.moves.urllib_parse import urlparse
from w3lib.http import basic_auth_header
from scrapy.http import Request, HtmlResponse, FormRequest
import six
try:
from scrapy.spide... | true | true |
1c2ad84bd58333fca1a453e809b5571f7a6e794d | 149 | py | Python | average_scores.py | Kunalpod/codewars | 8dc1af2f3c70e209471045118fd88b3ea1e627e5 | [
"MIT"
] | null | null | null | average_scores.py | Kunalpod/codewars | 8dc1af2f3c70e209471045118fd88b3ea1e627e5 | [
"MIT"
] | null | null | null | average_scores.py | Kunalpod/codewars | 8dc1af2f3c70e209471045118fd88b3ea1e627e5 | [
"MIT"
] | null | null | null | #Kunal Gautam
#Codewars : @Kunalpod
#Problem name: Average Scores
#Problem level: 7 kyu
def average(array):
return round(sum(array)/len(array))
| 18.625 | 39 | 0.731544 |
def average(array):
return round(sum(array)/len(array))
| true | true |
1c2ad89b40c683d434569240e47790f1391d1bb9 | 4,037 | py | Python | agents/dqn/q3_nature.py | caoxuwen/bitgym | 0a6796a039290122430ebc13c8d7ad9ff741921a | [
"MIT"
] | 1 | 2018-09-07T10:10:29.000Z | 2018-09-07T10:10:29.000Z | agents/dqn/q3_nature.py | caoxuwen/bitgym | 0a6796a039290122430ebc13c8d7ad9ff741921a | [
"MIT"
] | null | null | null | agents/dqn/q3_nature.py | caoxuwen/bitgym | 0a6796a039290122430ebc13c8d7ad9ff741921a | [
"MIT"
] | null | null | null | import pandas as pd
import tensorflow as tf
import tensorflow.contrib.layers as layers
from utils.general import get_logger
from utils.test_env import EnvTest
from q1_schedule import LinearExploration, LinearSchedule
from q2_linear import Linear
from configs.q3_nature import config
import trading_env
... | 41.618557 | 104 | 0.576914 | import pandas as pd
import tensorflow as tf
import tensorflow.contrib.layers as layers
from utils.general import get_logger
from utils.test_env import EnvTest
from q1_schedule import LinearExploration, LinearSchedule
from q2_linear import Linear
from configs.q3_nature import config
import trading_env
... | true | true |
1c2ad970403627afc847e38cb2e88d49e1b6c06d | 2,183 | py | Python | analysisService/tests/testApi.py | Godis715/Core-Sample-Analysis | 892b3d322e9ce86dab0da9754b902b504b2e0d8b | [
"Apache-2.0"
] | 2 | 2019-09-18T10:59:21.000Z | 2019-10-02T16:50:05.000Z | analysisService/tests/testApi.py | Godis715/Core-Sample-Analysis | 892b3d322e9ce86dab0da9754b902b504b2e0d8b | [
"Apache-2.0"
] | 78 | 2019-09-20T16:56:18.000Z | 2022-03-12T00:04:37.000Z | analysisService/tests/testApi.py | Godis715/Core-Sample-Analysis | 892b3d322e9ce86dab0da9754b902b504b2e0d8b | [
"Apache-2.0"
] | 1 | 2019-10-03T20:49:34.000Z | 2019-10-03T20:49:34.000Z | import json
import os
import requests
url = 'http://127.0.0.1:5050/api/data_analysis/'
TESTDIR = f'{os.path.dirname(os.path.dirname(os.path.abspath(__file__)))}/tests'
data = {
'deposit': 1,
'hole': 2,
'fragments': [
{
'top': 0,
'bottom': 1300,
'dl_resolution'... | 33.584615 | 87 | 0.520843 | import json
import os
import requests
url = 'http://127.0.0.1:5050/api/data_analysis/'
TESTDIR = f'{os.path.dirname(os.path.dirname(os.path.abspath(__file__)))}/tests'
data = {
'deposit': 1,
'hole': 2,
'fragments': [
{
'top': 0,
'bottom': 1300,
'dl_resolution'... | true | true |
1c2ad99706f47d0a3ca46ecce1b6deda77cfb61d | 6,732 | py | Python | tests/integration_tests/data_steward/utils/participant_summary_requests_test.py | ChaoPang/curation | a754bd51e0f63e306da5b685dac9b31a8154b579 | [
"MIT"
] | null | null | null | tests/integration_tests/data_steward/utils/participant_summary_requests_test.py | ChaoPang/curation | a754bd51e0f63e306da5b685dac9b31a8154b579 | [
"MIT"
] | null | null | null | tests/integration_tests/data_steward/utils/participant_summary_requests_test.py | ChaoPang/curation | a754bd51e0f63e306da5b685dac9b31a8154b579 | [
"MIT"
] | null | null | null | """
Integration Test for the deactivated_participants module
Ensures that get_token function fetches the access token properly, get_deactivated_participants
fetches all deactivated participants information, and store_participant_data properly stores all
the fetched deactivated participant data
Original Issues... | 38.689655 | 105 | 0.605169 |
import mock
import os
import pandas
import pandas.testing
import google.auth.transport.requests as req
from google.auth import default
from dateutil import parser
import utils.participant_summary_requests as psr
from app_identity import PROJECT_ID
from utils import auth
from tests.integration_tests.data_steward.c... | true | true |
1c2adc3b0902a6cb0997828cb500a30ddb651ec9 | 98 | py | Python | Baekjoon/Python/2193.py | KHJcode/Algorithm-study | fa08d3c752fcb3557fd45fb394157926afc0de4a | [
"MIT"
] | 2 | 2020-05-23T01:55:38.000Z | 2020-07-07T15:59:00.000Z | Baekjoon/Python/2193.py | KHJcode/Algorithm-study | fa08d3c752fcb3557fd45fb394157926afc0de4a | [
"MIT"
] | null | null | null | Baekjoon/Python/2193.py | KHJcode/Algorithm-study | fa08d3c752fcb3557fd45fb394157926afc0de4a | [
"MIT"
] | null | null | null | cnt = [0,1,1]
n = int(input())
for i in range(3,n+1): cnt.append(cnt[i-2]+cnt[i-1])
print(cnt[n]) | 24.5 | 53 | 0.581633 | cnt = [0,1,1]
n = int(input())
for i in range(3,n+1): cnt.append(cnt[i-2]+cnt[i-1])
print(cnt[n]) | true | true |
1c2add58a158dba2833ad4a46c77557599749929 | 1,799 | py | Python | src/utils/bullet_client.py | yifan-you-37/omnihang | c80b699b2cf2cf3422201cc8c3fa572d0e01d5a2 | [
"MIT"
] | 1 | 2022-01-16T20:24:09.000Z | 2022-01-16T20:24:09.000Z | src/utils/bullet_client.py | yifan-you-37/omnihang | c80b699b2cf2cf3422201cc8c3fa572d0e01d5a2 | [
"MIT"
] | null | null | null | src/utils/bullet_client.py | yifan-you-37/omnihang | c80b699b2cf2cf3422201cc8c3fa572d0e01d5a2 | [
"MIT"
] | 1 | 2022-03-16T03:14:37.000Z | 2022-03-16T03:14:37.000Z | """A wrapper for pybullet to manage different clients."""
from __future__ import absolute_import
from __future__ import division
import functools
import inspect
import pybullet
class BulletClient(object):
"""A wrapper for pybullet to manage different clients."""
def __init__(self, connection_mode=None):
"""... | 34.596154 | 78 | 0.675931 | from __future__ import absolute_import
from __future__ import division
import functools
import inspect
import pybullet
class BulletClient(object):
def __init__(self, connection_mode=None):
self._shapes = {}
if connection_mode is None:
self._client = pybullet.connect(pybullet.SHARED_MEMORY)
if... | true | true |
1c2adde109e2a4388c5b117b6b7515e171b5fa34 | 3,617 | py | Python | random_clinical.py | disulfidebond/ehr_toy_dataset | 71cab460d8165fc990b0e81723796a4945bfc26f | [
"MIT"
] | null | null | null | random_clinical.py | disulfidebond/ehr_toy_dataset | 71cab460d8165fc990b0e81723796a4945bfc26f | [
"MIT"
] | null | null | null | random_clinical.py | disulfidebond/ehr_toy_dataset | 71cab460d8165fc990b0e81723796a4945bfc26f | [
"MIT"
] | null | null | null | def randTemp(bpm, sepsisBool):
import random
# generate a randomized temperature in Celsius
# with the tail ends at slightly abnormal cold or feverish ranges
randomizedTemp = random.uniform(36.0, 38.5)
modifiedBPM = int()
rValue = random.random()
# if this is a sepsis patient value, then rec... | 30.91453 | 103 | 0.568427 | def randTemp(bpm, sepsisBool):
import random
randomizedTemp = random.uniform(36.0, 38.5)
modifiedBPM = int()
rValue = random.random()
if sepsisBool:
if rValue < 0.4:
randomizedTemp = random.uniform(34.0, 36.0)
randomizedTemp = round(randomizedTemp, 2)
... | true | true |
1c2ade2717bad110fe7dd29f34c52f884bb06777 | 2,040 | py | Python | services/fuse/tests/test_retry.py | thehyve/arvados | 7b72f9d1b628698277617e9f1b8a9eac1f8dd562 | [
"Apache-2.0"
] | null | null | null | services/fuse/tests/test_retry.py | thehyve/arvados | 7b72f9d1b628698277617e9f1b8a9eac1f8dd562 | [
"Apache-2.0"
] | null | null | null | services/fuse/tests/test_retry.py | thehyve/arvados | 7b72f9d1b628698277617e9f1b8a9eac1f8dd562 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) The Arvados Authors. All rights reserved.
#
# SPDX-License-Identifier: AGPL-3.0
import arvados
import arvados_fuse.command
import json
import mock
import os
import pycurl
import Queue
import run_test_server
import tempfile
import unittest
from .integration_test import IntegrationTest
class KeepClien... | 31.384615 | 105 | 0.661275 |
import arvados
import arvados_fuse.command
import json
import mock
import os
import pycurl
import Queue
import run_test_server
import tempfile
import unittest
from .integration_test import IntegrationTest
class KeepClientRetry(unittest.TestCase):
origKeepClient = arvados.keep.KeepClient
def setUp(self):... | true | true |
1c2adf1212a0f8aa886d938d2635e1643be51147 | 3,197 | py | Python | tests/serializers/test_email_verification_serializer.py | hacknd/django-rest-auth | bd873f67e93854460b3966556d775b5319193eee | [
"MIT"
] | 3 | 2020-05-25T22:05:10.000Z | 2020-05-28T18:21:24.000Z | tests/serializers/test_email_verification_serializer.py | hacknd/django-rest-auth | bd873f67e93854460b3966556d775b5319193eee | [
"MIT"
] | 3 | 2021-03-30T13:55:31.000Z | 2021-06-10T19:47:06.000Z | tests/serializers/test_email_verification_serializer.py | hacknd/django-rest-auth | bd873f67e93854460b3966556d775b5319193eee | [
"MIT"
] | 2 | 2020-06-11T17:59:38.000Z | 2020-06-13T16:46:36.000Z | try:
from unittest import mock
except ImportError:
import mock
from rest_social_email_auth import serializers
def test_confirm_email(email_confirmation_factory, email_factory, user_factory):
"""
If a valid confirmation key and password are provided,
the email matching the key should be verified.
"""
... | 28.292035 | 80 | 0.732249 | try:
from unittest import mock
except ImportError:
import mock
from rest_social_email_auth import serializers
def test_confirm_email(email_confirmation_factory, email_factory, user_factory):
user = user_factory(password="password")
email = email_factory(user=user)
confirmation = email_confirmatio... | true | true |
1c2adf6a1949f107eec548878f339ea3bc8f3fb1 | 414 | py | Python | openapi/code_samples/python/get_all_transactions/code.py | Reloadly/reloadly-giftcard-documentation | 080a42305f7e92d971f2e214e5c3356d2122d2b9 | [
"MIT"
] | 1 | 2022-03-15T11:20:51.000Z | 2022-03-15T11:20:51.000Z | openapi/code_samples/python/get_all_transactions/code.py | Reloadly/reloadly-giftcard-documentation | 080a42305f7e92d971f2e214e5c3356d2122d2b9 | [
"MIT"
] | 5 | 2022-03-10T10:27:35.000Z | 2022-03-29T09:40:56.000Z | openapi/code_samples/python/get_all_transactions/code.py | Reloadly/reloadly-giftcard-documentation | 080a42305f7e92d971f2e214e5c3356d2122d2b9 | [
"MIT"
] | 1 | 2022-03-24T01:12:36.000Z | 2022-03-24T01:12:36.000Z | import requests
url = "https://giftcards.reloadly.com/reports/transactions?startDate=2021-06-01 00:00:00&endDate=2021-06-18 23:17:02"
payload={}
headers = {
'Authorization': 'Bearer eyJraXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
'Content-Type': 'application/json',
'Accept': 'application/com.reloadly.giftcards-v1+json'
}... | 29.571429 | 117 | 0.756039 | import requests
url = "https://giftcards.reloadly.com/reports/transactions?startDate=2021-06-01 00:00:00&endDate=2021-06-18 23:17:02"
payload={}
headers = {
'Authorization': 'Bearer eyJraXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
'Content-Type': 'application/json',
'Accept': 'application/com.reloadly.giftcards-v1+json'
}... | true | true |
1c2ae330d7954fd6825cf5d0d5833f5fcf9694b9 | 1,641 | py | Python | chromium/tools/telemetry/telemetry/internal/actions/pinch_unittest.py | wedataintelligence/vivaldi-source | 22a46f2c969f6a0b7ca239a05575d1ea2738768c | [
"BSD-3-Clause"
] | 925 | 2015-11-06T03:04:46.000Z | 2017-09-16T19:08:43.000Z | chromium/tools/telemetry/telemetry/internal/actions/pinch_unittest.py | wedataintelligence/vivaldi-source | 22a46f2c969f6a0b7ca239a05575d1ea2738768c | [
"BSD-3-Clause"
] | 29 | 2015-11-09T17:37:28.000Z | 2017-08-16T17:50:11.000Z | chromium/tools/telemetry/telemetry/internal/actions/pinch_unittest.py | wedataintelligence/vivaldi-source | 22a46f2c969f6a0b7ca239a05575d1ea2738768c | [
"BSD-3-Clause"
] | 51 | 2015-11-08T07:06:38.000Z | 2017-08-21T07:27:19.000Z | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.internal.actions import page_action
from telemetry.page import action_runner as action_runner_module
from telemetry.testing import tab_test_ca... | 40.02439 | 77 | 0.735527 |
from telemetry.internal.actions import page_action
from telemetry.page import action_runner as action_runner_module
from telemetry.testing import tab_test_case
class PinchActionTest(tab_test_case.TabTestCase):
def setUp(self):
super(PinchActionTest, self).setUp()
def testPinchByApiCalledWithCorrectArgume... | true | true |
1c2ae3a6948a5b405b0979538b8625bc3c1021b1 | 8,869 | py | Python | tools/automation/vendoring/__init__.py | j420247/pip | 33cd93cac86690134e8b4874ac42c4e0ce8770d2 | [
"MIT"
] | null | null | null | tools/automation/vendoring/__init__.py | j420247/pip | 33cd93cac86690134e8b4874ac42c4e0ce8770d2 | [
"MIT"
] | 1 | 2019-12-12T02:34:38.000Z | 2019-12-12T02:34:38.000Z | tools/automation/vendoring/__init__.py | gudonglaile/pip-gui | ac9c49c54b7a882d8091959ba14eec37612a3845 | [
"MIT"
] | null | null | null | """"Vendoring script, python 3.5 with requests needed"""
# The following comment should be removed at some point in the future.
# mypy: disallow-untyped-defs=False
import re
import shutil
import tarfile
import zipfile
from pathlib import Path
import invoke
import requests
from .typing import generate_stubs
FILE_WH... | 31.339223 | 79 | 0.647536 |
import re
import shutil
import tarfile
import zipfile
from pathlib import Path
import invoke
import requests
from .typing import generate_stubs
FILE_WHITE_LIST = (
'Makefile',
'vendor.txt',
'__init__.py',
'README.rst',
)
LIBRARY_DIRNAMES = {
'setuptools': 'pkg_resources',
'msgpack-pytho... | true | true |
1c2ae4e0eb180c9030626926c9a92220ca20e554 | 33,128 | py | Python | venv/Lib/site-packages/requests/utils.py | rphira/footstats | adab32e411d1b83bf15f7bb891affe334175bc48 | [
"MIT"
] | 1 | 2022-03-17T12:56:14.000Z | 2022-03-17T12:56:14.000Z | requests/utils.py | blackvitasoy/requests | 17e6e27a93131b7295165408e69b4cadb098b0d7 | [
"Apache-2.0"
] | 8 | 2021-09-22T12:47:32.000Z | 2022-01-14T21:30:38.000Z | venv/lib/python3.8/site-packages/requests/utils.py | HCDigitalScholarship/migration-encounters | 08e705f8ed1b4d4e00d2c1112a8b5d30bf2ebd4d | [
"MIT"
] | 1 | 2022-03-28T09:19:34.000Z | 2022-03-28T09:19:34.000Z | # -*- coding: utf-8 -*-
"""
requests.utils
~~~~~~~~~~~~~~
This module provides utility functions that are used within Requests
that are also useful for external consumption.
"""
import codecs
import contextlib
import io
import os
import re
import socket
import struct
import sys
import tempfile
import warnings
import... | 31.341533 | 128 | 0.618057 |
import codecs
import contextlib
import io
import os
import re
import socket
import struct
import sys
import tempfile
import warnings
import zipfile
from collections import OrderedDict
from urllib3.util import make_headers
from urllib3.util import parse_url
from .__version__ import __version__
from . import certs
f... | true | true |
1c2ae52a7ec2c865ce6ba564f585cb818eb8fd75 | 984 | py | Python | fec/home/migrations/0020_auto_20160909_0139.py | rds0751/fec-cms | 833cdac7240d056ed234ed5b503a2407e1fee1ce | [
"CC0-1.0"
] | 47 | 2015-09-09T14:23:30.000Z | 2019-12-29T13:58:41.000Z | fec/home/migrations/0020_auto_20160909_0139.py | rds0751/fec-cms | 833cdac7240d056ed234ed5b503a2407e1fee1ce | [
"CC0-1.0"
] | 1,634 | 2015-08-19T16:36:28.000Z | 2018-03-09T18:22:23.000Z | fec/home/migrations/0020_auto_20160909_0139.py | rds0751/fec-cms | 833cdac7240d056ed234ed5b503a2407e1fee1ce | [
"CC0-1.0"
] | 27 | 2015-08-20T02:10:13.000Z | 2021-02-14T10:51:18.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2016-09-09 01:39
from __future__ import unicode_literals
from django.db import migrations
import wagtail.wagtailcore.blocks
import wagtail.wagtailcore.fields
class Migration(migrations.Migration):
dependencies = [
('home', '0019_auto_20160908_2113')... | 42.782609 | 517 | 0.706301 |
from __future__ import unicode_literals
from django.db import migrations
import wagtail.wagtailcore.blocks
import wagtail.wagtailcore.fields
class Migration(migrations.Migration):
dependencies = [
('home', '0019_auto_20160908_2113'),
]
operations = [
migrations.AlterField(
... | true | true |
1c2ae576ba53bc42f5fe754954e8243ca9a88284 | 400 | py | Python | ur_vrep/build/catkin_tools_prebuild/catkin_generated/pkg.installspace.context.pc.py | RrQqY/TableRearrangement | e03e4c2e64141dc0984dea65d336ddb6e784c82f | [
"MIT"
] | 2 | 2022-03-14T16:01:53.000Z | 2022-03-25T09:14:21.000Z | ur_vrep/build/catkin_tools_prebuild/catkin_generated/pkg.installspace.context.pc.py | RrQqY/TableRearrangement | e03e4c2e64141dc0984dea65d336ddb6e784c82f | [
"MIT"
] | null | null | null | ur_vrep/build/catkin_tools_prebuild/catkin_generated/pkg.installspace.context.pc.py | RrQqY/TableRearrangement | e03e4c2e64141dc0984dea65d336ddb6e784c82f | [
"MIT"
] | 1 | 2022-03-25T07:16:57.000Z | 2022-03-25T07:16:57.000Z | # generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []
PROJECT_NAME = "catkin_tools_prebuild"
PROJECT_SPACE_... | 44.444444 | 68 | 0.7225 |
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []
PROJECT_NAME = "catkin_tools_prebuild"
PROJECT_SPACE_DIR = "/home/rrqq/TableRearrangement/ur_vrep/install"
PR... | true | true |
1c2ae6a50db81733305a1308130f48eb01f4459c | 909 | py | Python | Python/maximum-average-subarray-ii.py | xiaohalo/LeetCode | 68211ba081934b21bb1968046b7e3c1459b3da2d | [
"MIT"
] | 9 | 2019-06-30T07:15:18.000Z | 2022-02-10T20:13:40.000Z | Python/maximum-average-subarray-ii.py | pnandini/LeetCode | e746c3298be96dec8e160da9378940568ef631b1 | [
"MIT"
] | 1 | 2018-07-10T03:28:43.000Z | 2018-07-10T03:28:43.000Z | Python/maximum-average-subarray-ii.py | pnandini/LeetCode | e746c3298be96dec8e160da9378940568ef631b1 | [
"MIT"
] | 9 | 2019-01-16T22:16:49.000Z | 2022-02-06T17:33:41.000Z | # Time: O(n)
# Space: O(n)
class Solution(object):
def findMaxAverage(self, nums, k):
"""
:type nums: List[int]
:type k: int
:rtype: float
"""
def getDelta(avg, nums, k):
accu = [0.0] * (len(nums) + 1)
minval_pos = None
delta = 0.... | 31.344828 | 95 | 0.436744 |
class Solution(object):
def findMaxAverage(self, nums, k):
def getDelta(avg, nums, k):
accu = [0.0] * (len(nums) + 1)
minval_pos = None
delta = 0.0
for i in xrange(len(nums)):
accu[i+1] = nums[i] + accu[i] - avg
if i >= (k-1)... | true | true |
1c2ae8e02b10a4be4ea60bd5015aef356cc49088 | 2,941 | py | Python | tensorflow_datasets/testing/caltech.py | atksh/datasets | 814058b31ebd99e418114016d60ab4d6f8f82070 | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/testing/caltech.py | atksh/datasets | 814058b31ebd99e418114016d60ab4d6f8f82070 | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/testing/caltech.py | atksh/datasets | 814058b31ebd99e418114016d60ab4d6f8f82070 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2019 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 28.553398 | 85 | 0.716083 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from absl import app
from absl import flags
import numpy as np
import tensorflow as tf
from tensorflow_datasets.core import utils
from tensorflow_datasets.core.utils import py_utils... | true | true |
1c2ae8f63e2a5bf543e146aa69d9948b5a403445 | 8,652 | py | Python | tests/test_image.py | data61/landshark | 01d28c47be4b688f4705acbf5dd64f7d790574fd | [
"Apache-2.0"
] | 10 | 2019-03-05T23:53:58.000Z | 2021-12-17T08:27:05.000Z | tests/test_image.py | data61/landshark | 01d28c47be4b688f4705acbf5dd64f7d790574fd | [
"Apache-2.0"
] | 7 | 2019-03-05T05:39:02.000Z | 2020-02-03T01:10:40.000Z | tests/test_image.py | data61/landshark | 01d28c47be4b688f4705acbf5dd64f7d790574fd | [
"Apache-2.0"
] | 8 | 2019-03-23T22:55:25.000Z | 2021-01-12T05:14:31.000Z | """Tests for the image module."""
# Copyright 2019 CSIRO (Data61)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 35.604938 | 78 | 0.631877 |
from itertools import product
import numpy as np
import pytest
from landshark import image
from landshark.basetypes import IndexType
SEED = 666
def test_bounding_box():
x_coords = np.arange(10)
y_coords = np.arange(5)
b = image.BoundingBox(x_coords, y_coords)
assert b.xmin == x_coo... | true | true |
1c2ae92cb253c4516af3037d58e820546cc3bb60 | 1,189 | py | Python | tests/test_api.py | nhsiehgit/basictracer-python | b53f826b8f2c99618238a59bf668dd081c5c02a4 | [
"Apache-2.0"
] | 28 | 2016-06-07T03:44:51.000Z | 2021-04-15T13:20:42.000Z | tests/test_api.py | nhsiehgit/basictracer-python | b53f826b8f2c99618238a59bf668dd081c5c02a4 | [
"Apache-2.0"
] | 37 | 2016-05-09T20:00:46.000Z | 2021-11-08T04:31:49.000Z | tests/test_api.py | nhsiehgit/basictracer-python | b53f826b8f2c99618238a59bf668dd081c5c02a4 | [
"Apache-2.0"
] | 22 | 2016-08-20T11:39:05.000Z | 2022-02-01T23:17:18.000Z | # Copyright The OpenTracing Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 33.027778 | 74 | 0.744323 |
from __future__ import absolute_import
import unittest
from basictracer import BasicTracer
from opentracing.harness.api_check import APICompatibilityCheckMixin
class APICheckBasicTracer(unittest.TestCase, APICompatibilityCheckMixin):
def tracer(self):
t = BasicTracer()
t.register_req... | true | true |
1c2ae966155cb7975eb636b1e7a7820ce72d918e | 24,435 | py | Python | modpy/optimize/_quadprog.py | FrederikLehn/modpy | 19ab18547e06e93fabfbd7f7b2f0f07ff0e70db3 | [
"MIT"
] | null | null | null | modpy/optimize/_quadprog.py | FrederikLehn/modpy | 19ab18547e06e93fabfbd7f7b2f0f07ff0e70db3 | [
"MIT"
] | null | null | null | modpy/optimize/_quadprog.py | FrederikLehn/modpy | 19ab18547e06e93fabfbd7f7b2f0f07ff0e70db3 | [
"MIT"
] | null | null | null | import numpy as np
import numpy.linalg as la
from modpy._util import where
from modpy.optimize._optim_util import OptimizeResult, _chk_dimensions, _chk_system_dimensions, _ensure_vector,\
_atleast_zeros
from modpy.optimize._nlprog_util import _max_step_lengths
from modpy.optimize._constraints import prepare... | 32.754692 | 121 | 0.584735 | import numpy as np
import numpy.linalg as la
from modpy._util import where
from modpy.optimize._optim_util import OptimizeResult, _chk_dimensions, _chk_system_dimensions, _ensure_vector,\
_atleast_zeros
from modpy.optimize._nlprog_util import _max_step_lengths
from modpy.optimize._constraints import prepare... | true | true |
1c2aeaea50577d646fdad726a8fe7863a1e30b8a | 8,152 | py | Python | mars/tensor/stats/tests/test_stats_execute.py | loopyme/mars | 52f9552855f96bf744515c4d08413f949d3512af | [
"Apache-2.0"
] | null | null | null | mars/tensor/stats/tests/test_stats_execute.py | loopyme/mars | 52f9552855f96bf744515c4d08413f949d3512af | [
"Apache-2.0"
] | null | null | null | mars/tensor/stats/tests/test_stats_execute.py | loopyme/mars | 52f9552855f96bf744515c4d08413f949d3512af | [
"Apache-2.0"
] | null | null | null | # Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 32.608 | 95 | 0.63739 |
import functools
import numpy as np
import pytest
import scipy
from scipy.stats import (
entropy as sp_entropy,
power_divergence as sp_power_divergence,
chisquare as sp_chisquare,
ks_1samp as sp_ks_1samp,
ks_2samp as sp_ks_2samp,
norm as sp_norm,
ttest_rel as sp_ttest_rel,
... | true | true |
1c2aebb86482ed8ba85003c7cb15999950ea331e | 5,125 | py | Python | ape_trezor/client.py | unparalleled-js/ape-trezor | 61cf94e3d49089a3c9f753ce18bc9b7323e82e6a | [
"Apache-2.0"
] | null | null | null | ape_trezor/client.py | unparalleled-js/ape-trezor | 61cf94e3d49089a3c9f753ce18bc9b7323e82e6a | [
"Apache-2.0"
] | null | null | null | ape_trezor/client.py | unparalleled-js/ape-trezor | 61cf94e3d49089a3c9f753ce18bc9b7323e82e6a | [
"Apache-2.0"
] | null | null | null | from typing import Any, Dict, Tuple
from eth_typing.evm import ChecksumAddress
from trezorlib import ethereum # type: ignore
from trezorlib.client import get_default_client # type: ignore
from trezorlib.exceptions import PinException, TrezorFailure # type: ignore
from trezorlib.messages import TransactionType # ty... | 34.166667 | 96 | 0.636098 | from typing import Any, Dict, Tuple
from eth_typing.evm import ChecksumAddress
from trezorlib import ethereum
from trezorlib.client import get_default_client
from trezorlib.exceptions import PinException, TrezorFailure
from trezorlib.messages import TransactionType
from trezorlib.tools import parse_path as par... | true | true |
1c2aec5fbc38af4844d61d45409916999ac3c8a4 | 6,168 | py | Python | foss_finder/utils/user_defined_info/base.py | iotile/foss_finder | 0c31530cf2158d4565a8168aecda18ffbcc68f04 | [
"MIT"
] | 6 | 2019-03-11T22:36:55.000Z | 2019-04-05T17:49:40.000Z | foss_finder/utils/user_defined_info/base.py | iotile/foss_finder | 0c31530cf2158d4565a8168aecda18ffbcc68f04 | [
"MIT"
] | 11 | 2018-09-06T23:10:52.000Z | 2020-01-14T20:49:35.000Z | foss_finder/utils/user_defined_info/base.py | iotile/foss_finder | 0c31530cf2158d4565a8168aecda18ffbcc68f04 | [
"MIT"
] | 1 | 2020-07-16T12:21:29.000Z | 2020-07-16T12:21:29.000Z | import json
import sys
import copy
from foss_finder.config.config import DEFAULT_COLUMNS, OPTIONAL_COLUMNS
from foss_finder.config.strings import *
from .fields import AddPackages, Overwrites, MultiLicenseSelection, AdditionalInfo
class UserDefinedInformation():
"""
Initialized from json data. It processes ... | 48.952381 | 133 | 0.5762 | import json
import sys
import copy
from foss_finder.config.config import DEFAULT_COLUMNS, OPTIONAL_COLUMNS
from foss_finder.config.strings import *
from .fields import AddPackages, Overwrites, MultiLicenseSelection, AdditionalInfo
class UserDefinedInformation():
_FIELDS = {
AddPackages.NAME: AddPac... | true | true |
1c2aecd4a81212764f4241a472594a00d7bea80c | 46,310 | py | Python | cogdl/datasets/pyg_strategies_data.py | kwyoke/cogdl | df919b4fc7db40f8b035665edbcc7ed59f9d448e | [
"MIT"
] | null | null | null | cogdl/datasets/pyg_strategies_data.py | kwyoke/cogdl | df919b4fc7db40f8b035665edbcc7ed59f9d448e | [
"MIT"
] | null | null | null | cogdl/datasets/pyg_strategies_data.py | kwyoke/cogdl | df919b4fc7db40f8b035665edbcc7ed59f9d448e | [
"MIT"
] | null | null | null | """
This file is borrowed from https://github.com/snap-stanford/pretrain-gnns/
"""
from cogdl.datasets import register_dataset
import random
import zipfile
import networkx as nx
import numpy as np
import torch
from torch_geometric.data import InMemoryDataset, Data, Batch
from cogdl.data import download_url
import ... | 40.410122 | 190 | 0.597689 | from cogdl.datasets import register_dataset
import random
import zipfile
import networkx as nx
import numpy as np
import torch
from torch_geometric.data import InMemoryDataset, Data, Batch
from cogdl.data import download_url
import os.path as osp
from itertools import repeat, product, chain
def nx_to_graph_data_o... | true | true |
1c2aecd5dfa2095aa3e74d9c7fa457a836aa887f | 5,381 | py | Python | sdk/python/pulumi_azure_nextgen/cdn/latest/get_secret.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/cdn/latest/get_secret.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/cdn/latest/get_secret.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 36.114094 | 171 | 0.660286 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
__all__ = [
'GetSecretResult',
'AwaitableGetSecretResult',
'get_secret',
]
warnings.warn("""The 'latest' version is deprecated. Pleas... | true | true |
1c2aed7f9b76b28554f43aa892dba8385732eb67 | 1,394 | py | Python | app/core/tests/test_admin.py | terminator891/django-rest-framework-practice | e7df6d733d6e163b88c564b0d4a140c7308ea06a | [
"MIT"
] | null | null | null | app/core/tests/test_admin.py | terminator891/django-rest-framework-practice | e7df6d733d6e163b88c564b0d4a140c7308ea06a | [
"MIT"
] | 3 | 2021-04-08T21:14:14.000Z | 2021-09-22T19:20:17.000Z | app/core/tests/test_admin.py | terminator891/django-rest-framework-practice | e7df6d733d6e163b88c564b0d4a140c7308ea06a | [
"MIT"
] | null | null | null | from django.test import TestCase, Client
from django.contrib.auth import get_user_model
from django.urls import reverse
class AdminSiteTests(TestCase):
def setUp(self):
self.client = Client()
self.admin_user = get_user_model().objects.create_superuser(
email="admin@humayun.com",
... | 33.190476 | 68 | 0.639168 | from django.test import TestCase, Client
from django.contrib.auth import get_user_model
from django.urls import reverse
class AdminSiteTests(TestCase):
def setUp(self):
self.client = Client()
self.admin_user = get_user_model().objects.create_superuser(
email="admin@humayun.com",
... | true | true |
1c2aee8f304a8686f85e30cdd0f3a7d2b4f8f01e | 1,915 | py | Python | danmaku/fishing.py | lolisound/Rancher_Danmaku | ccdbd7d4f329bc844256d398b26504d1a86f697b | [
"WTFPL"
] | 1 | 2021-07-19T14:40:39.000Z | 2021-07-19T14:40:39.000Z | danmaku/fishing.py | lolisound/Rancher_Danmaku | ccdbd7d4f329bc844256d398b26504d1a86f697b | [
"WTFPL"
] | null | null | null | danmaku/fishing.py | lolisound/Rancher_Danmaku | ccdbd7d4f329bc844256d398b26504d1a86f697b | [
"WTFPL"
] | null | null | null | # fishing
import random
import datetime
from danmaku.models import fish
def fish_list():
f=[]
for i in fish.objects.all():
f.append(i)
return(f)
def season():
if 4 <= datetime.date.today().month <= 6 :
season='spring'
elif 7 <= datetime.date.today().month <= 9 :
season='sum... | 23.353659 | 56 | 0.469452 |
import random
import datetime
from danmaku.models import fish
def fish_list():
f=[]
for i in fish.objects.all():
f.append(i)
return(f)
def season():
if 4 <= datetime.date.today().month <= 6 :
season='spring'
elif 7 <= datetime.date.today().month <= 9 :
season='summer'
... | true | true |
1c2aef141178afa0d1610ac98098db45535d4b21 | 383 | py | Python | build/lib/sexagesimal_calculator/test_pytest.py | HrushikeshPawar/Sexagesimal-Calculatory | f63458c159d498cc94f084853a70f078731cac5e | [
"MIT"
] | 1 | 2022-03-08T18:55:39.000Z | 2022-03-08T18:55:39.000Z | build/lib/sexagesimal_calculator/test_pytest.py | HrushikeshPawar/Sexagesimal-Calculator | f63458c159d498cc94f084853a70f078731cac5e | [
"MIT"
] | null | null | null | build/lib/sexagesimal_calculator/test_pytest.py | HrushikeshPawar/Sexagesimal-Calculator | f63458c159d498cc94f084853a70f078731cac5e | [
"MIT"
] | null | null | null | from .sexagesimal import Sexagesimal
def test_IntegralModN():
A = Sexagesimal('274.778')
print(hasattr(A, 'S'))
print(hasattr(A, 'Decimal2Sexagesimal'))
print(hasattr(A, 'IntegralModN'))
assert A.IntegralModN('274.778', 30).S == '09,04;46,40,48'
def test_Decimal2Sexagesimal():
A = 1.23456
... | 25.533333 | 64 | 0.673629 | from .sexagesimal import Sexagesimal
def test_IntegralModN():
A = Sexagesimal('274.778')
print(hasattr(A, 'S'))
print(hasattr(A, 'Decimal2Sexagesimal'))
print(hasattr(A, 'IntegralModN'))
assert A.IntegralModN('274.778', 30).S == '09,04;46,40,48'
def test_Decimal2Sexagesimal():
A = 1.23456
... | true | true |
1c2af19a0cc2e8e0329d5ef34f8e0d9ad15b147e | 518 | py | Python | instanotifier/fetcher/main.py | chaudbak/instanotifier | d29bc6bd9b7a003403886bfff1376b2c1925cc74 | [
"MIT"
] | null | null | null | instanotifier/fetcher/main.py | chaudbak/instanotifier | d29bc6bd9b7a003403886bfff1376b2c1925cc74 | [
"MIT"
] | 6 | 2020-06-06T01:27:17.000Z | 2022-02-10T11:20:17.000Z | instanotifier/fetcher/main.py | chaudbak/instanotifier | d29bc6bd9b7a003403886bfff1376b2c1925cc74 | [
"MIT"
] | null | null | null | from instanotifier.fetcher.rss.fetcher import fetch_rss_feed
def fetch(url):
# TODO: Determining that a feed is password-protected
# TODO: if source_id:
# specify the Etag and Last-Modified values.
# * update source_entry_status when the permanently deleted status received
result = fetch_rss_fe... | 30.470588 | 86 | 0.73166 | from instanotifier.fetcher.rss.fetcher import fetch_rss_feed
def fetch(url):
result = fetch_rss_feed(url)
return result
| true | true |
1c2af1f341325bb96306ca00e79f7525a256a865 | 4,741 | py | Python | test/pytest/test_xpedite/test_profiler/test_profiler.py | dendisuhubdy/Xpedite | d6b67e98d4b640c98499a373425f1f009e5b9061 | [
"Apache-2.0"
] | 1 | 2019-11-16T17:53:30.000Z | 2019-11-16T17:53:30.000Z | test/pytest/test_xpedite/test_profiler/test_profiler.py | dendisuhubdy/Xpedite | d6b67e98d4b640c98499a373425f1f009e5b9061 | [
"Apache-2.0"
] | 1 | 2019-12-10T01:07:20.000Z | 2019-12-10T01:07:20.000Z | test/pytest/test_xpedite/test_profiler/test_profiler.py | dendisuhubdy/Xpedite | d6b67e98d4b640c98499a373425f1f009e5b9061 | [
"Apache-2.0"
] | null | null | null | """
Pytest module to test xpedite features report and record with:
Application running in a REMOTE box, benchmarks and performance counters
This module also provides test for generating profile information and
a Jupyter notebook
This module contains pytests to test Xpedite features including:
1. Record
2. Report
3. Pr... | 38.544715 | 106 | 0.728749 |
import pytest
from test_xpedite import loadProfileInfo
from test_xpedite.test_profiler.profile import (
runXpediteReport, runXpediteRecord, loadProbes,
buildNotebook, compareVsBaseline, gen... | true | true |
1c2af208e6e7b298fee0214682dbf018366e841c | 2,209 | py | Python | python/DeepSeaVectorDraw/StartPathCommand.py | akb825/DeepSea | fff790d0a472cf2f9f89de653e0b4470ce605d24 | [
"Apache-2.0"
] | 5 | 2018-11-17T23:13:22.000Z | 2021-09-30T13:37:04.000Z | python/DeepSeaVectorDraw/StartPathCommand.py | akb825/DeepSea | fff790d0a472cf2f9f89de653e0b4470ce605d24 | [
"Apache-2.0"
] | null | null | null | python/DeepSeaVectorDraw/StartPathCommand.py | akb825/DeepSea | fff790d0a472cf2f9f89de653e0b4470ce605d24 | [
"Apache-2.0"
] | 2 | 2019-09-23T12:23:35.000Z | 2020-04-07T05:31:06.000Z | # automatically generated by the FlatBuffers compiler, do not modify
# namespace: DeepSeaVectorDraw
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class StartPathCommand(object):
__slots__ = ['_tab']
@classmethod
def GetRootAs(cls, buf, offset=0):
n = flatbuff... | 36.816667 | 128 | 0.69579 |
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class StartPathCommand(object):
__slots__ = ['_tab']
@classmethod
def GetRootAs(cls, buf, offset=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = StartPathCommand()
x.I... | true | true |
1c2af33a35eef79b8ced99b1fb22899836b290cb | 411 | py | Python | bartpy/diagnostics/sigma.py | danielremo/bartpy | f299d8be9378daf75ee1a6b1527de5cb0f0ced89 | [
"MIT"
] | 147 | 2018-09-17T16:53:38.000Z | 2022-03-30T22:40:37.000Z | bartpy/diagnostics/sigma.py | danielremo/bartpy | f299d8be9378daf75ee1a6b1527de5cb0f0ced89 | [
"MIT"
] | 35 | 2018-09-25T06:27:35.000Z | 2022-01-21T19:33:09.000Z | bartpy/diagnostics/sigma.py | danielremo/bartpy | f299d8be9378daf75ee1a6b1527de5cb0f0ced89 | [
"MIT"
] | 24 | 2019-03-21T11:46:11.000Z | 2022-03-20T02:06:11.000Z | from matplotlib import pyplot as plt
from bartpy.sklearnmodel import SklearnModel
def plot_sigma_convergence(model: SklearnModel, ax=None):
if ax is None:
fig, ax = plt.subplots(1, 1)
sigma_samples = [x.sigma.current_value() for x in model.model_samples]
ax.plot(sigma_samples)
ax.set_title("S... | 27.4 | 74 | 0.717762 | from matplotlib import pyplot as plt
from bartpy.sklearnmodel import SklearnModel
def plot_sigma_convergence(model: SklearnModel, ax=None):
if ax is None:
fig, ax = plt.subplots(1, 1)
sigma_samples = [x.sigma.current_value() for x in model.model_samples]
ax.plot(sigma_samples)
ax.set_title("S... | true | true |
1c2af45ddc18ec0293a56581c6f3882e438209b0 | 1,021 | py | Python | gurtel/util.py | oddbird/gurtel | 6400ae0e65618b6477ae5ae4791ac618c8112b7a | [
"BSD-3-Clause"
] | null | null | null | gurtel/util.py | oddbird/gurtel | 6400ae0e65618b6477ae5ae4791ac618c8112b7a | [
"BSD-3-Clause"
] | null | null | null | gurtel/util.py | oddbird/gurtel | 6400ae0e65618b6477ae5ae4791ac618c8112b7a | [
"BSD-3-Clause"
] | null | null | null | """Testing utilities."""
import urlparse
class Url(object):
"""
A wrapper class for comparing urls with querystrings while avoiding
dict-ordering dependencies. Order of keys in querystring should not matter,
although order of multiple values for a single key does matter.
"""
def __init__(self... | 27.594595 | 79 | 0.571009 | import urlparse
class Url(object):
def __init__(self, url):
self.url = url
parts = urlparse.urlparse(url)
self.non_qs = (
parts.scheme,
parts.netloc,
parts.path,
parts.params,
parts.fragment)
self.qs = tuple(
... | true | true |
1c2af5549d147d95aa2f8b6642cb8bcf9e75deca | 1,676 | py | Python | citrination_client/search/core/result/base_search_result.py | matSciMalcolm/python-citrination-client | a59a2ddd49b3a4323a3393ce13c81172c9b1b645 | [
"Apache-2.0"
] | 20 | 2016-06-15T18:40:50.000Z | 2022-03-21T11:59:13.000Z | citrination_client/search/core/result/base_search_result.py | matSciMalcolm/python-citrination-client | a59a2ddd49b3a4323a3393ce13c81172c9b1b645 | [
"Apache-2.0"
] | 91 | 2015-12-23T18:13:43.000Z | 2020-07-21T21:33:13.000Z | citrination_client/search/core/result/base_search_result.py | matSciMalcolm/python-citrination-client | a59a2ddd49b3a4323a3393ce13c81172c9b1b645 | [
"Apache-2.0"
] | 18 | 2016-07-19T15:33:18.000Z | 2022-03-02T19:42:24.000Z | from pypif.util.serializable import Serializable
class BaseSearchResult(Serializable):
"""
Base class for all search results.
"""
def __init__(self, took=None, total_num_hits=None, max_score=None, hits=None, **kwargs):
"""
Constructor.
:param took: Number of milliseconds that... | 22.648649 | 92 | 0.622912 | from pypif.util.serializable import Serializable
class BaseSearchResult(Serializable):
def __init__(self, took=None, total_num_hits=None, max_score=None, hits=None, **kwargs):
self._took = None
self.took = took
self._total_num_hits = None
self.total_num_hits = total_num_hits
... | true | true |
1c2af63070f568f07384d486a35efdab6d41c97a | 11,036 | py | Python | venv/Lib/site-packages/JEDatabase/Core/SQLiteCore.py | JE-Chen/finalProject_nknySystem | bc8b15f0d9ef416c9a5a2aea4955a7f34e916cc7 | [
"MIT"
] | 3 | 2020-12-30T06:37:10.000Z | 2021-03-05T11:56:04.000Z | venv/Lib/site-packages/JEDatabase/Core/SQLiteCore.py | JE-Chen/finalProject_nknySystem | bc8b15f0d9ef416c9a5a2aea4955a7f34e916cc7 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/JEDatabase/Core/SQLiteCore.py | JE-Chen/finalProject_nknySystem | bc8b15f0d9ef416c9a5a2aea4955a7f34e916cc7 | [
"MIT"
] | 1 | 2020-12-21T03:53:03.000Z | 2020-12-21T03:53:03.000Z | import datetime
from JEDatabase.Models.SqliteControl import SqliteControl
class SQLiteCore:
def __init__(self, db_name: str = 'test.sqlite', table_name: str = 'Test', select_prefix: str = '*'):
"""
:type db_name: str
:type table_name: str
"""
try:
... | 47.774892 | 112 | 0.480065 | import datetime
from JEDatabase.Models.SqliteControl import SqliteControl
class SQLiteCore:
def __init__(self, db_name: str = 'test.sqlite', table_name: str = 'Test', select_prefix: str = '*'):
try:
self.SqliteControl = SqliteControl(db_name, table_name)
self.table_name... | true | true |
1c2af7d3d7b673003a017a1bc6dbb2dbc1390e7c | 5,630 | py | Python | lib/surface/compute/os_config/patch_deployments/list.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 2 | 2019-11-10T09:17:07.000Z | 2019-12-18T13:44:08.000Z | lib/surface/compute/os_config/patch_deployments/list.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | null | null | null | lib/surface/compute/os_config/patch_deployments/list.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 1 | 2020-07-25T01:40:19.000Z | 2020-07-25T01:40:19.000Z | # -*- coding: utf-8 -*- #
# Copyright 2019 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 29.946809 | 88 | 0.705684 |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from apitools.base.py import list_pager
from googlecloudsdk.api_lib.compute.os_config import utils as osconfig_api_utils
from googlecloudsdk.calliope import base
from googlecloudsdk.command_lib.... | true | true |
1c2af84d93149b514f30a506f1a97e8e78e96d44 | 6,284 | py | Python | collectors/dbTest.py | OpenScienceFramework/citations | 3679ef4a1746a287061186078ce4b9144afe9083 | [
"Apache-2.0"
] | 4 | 2015-05-20T15:48:35.000Z | 2021-06-24T17:04:51.000Z | collectors/dbTest.py | OpenScienceFramework/citations | 3679ef4a1746a287061186078ce4b9144afe9083 | [
"Apache-2.0"
] | null | null | null | collectors/dbTest.py | OpenScienceFramework/citations | 3679ef4a1746a287061186078ce4b9144afe9083 | [
"Apache-2.0"
] | 1 | 2015-01-10T13:02:45.000Z | 2015-01-10T13:02:45.000Z | """
Tests db class functionality
(1) : Documents are identical -- keep original
(2) : Union of documents is identical
-- differences of documents is merged
(3) : Union of documents is not identical
-- add new document - flag both with 'conflict?'
@TODO: think about changing 'conflict?' fla... | 37.183432 | 96 | 0.577976 |
import unittest
import db
import Document
class dbTest(unittest.TestCase):
def setUp(self):
self.db = db.DB()
test_doc_one = {'properties': {
'author': [
{'family': 'smith', 'given': 'john'}
],
'date': 1999,
'titl... | true | true |
1c2af84f364c0ccdaa62331813474d1bda04a988 | 848 | py | Python | Xana/SaxsAna/integrate.py | ClLov/Xana | 83d880432a457cff0f1fab2801e2530ddecb4019 | [
"MIT"
] | null | null | null | Xana/SaxsAna/integrate.py | ClLov/Xana | 83d880432a457cff0f1fab2801e2530ddecb4019 | [
"MIT"
] | null | null | null | Xana/SaxsAna/integrate.py | ClLov/Xana | 83d880432a457cff0f1fab2801e2530ddecb4019 | [
"MIT"
] | null | null | null | import numpy as np
import pyFAI
from pyFAI.azimuthalIntegrator import AzimuthalIntegrator
def get_soq(Isaxs, mask, setup, Vsaxs=None, nbins=1000):
ai = AzimuthalIntegrator(dist=setup['distance'],
pixel1=setup['pix_size'][0]*1e-6,
pixel2=... | 42.4 | 74 | 0.522406 | import numpy as np
import pyFAI
from pyFAI.azimuthalIntegrator import AzimuthalIntegrator
def get_soq(Isaxs, mask, setup, Vsaxs=None, nbins=1000):
ai = AzimuthalIntegrator(dist=setup['distance'],
pixel1=setup['pix_size'][0]*1e-6,
pixel2=... | true | true |
1c2af88b1a0079a618a7fd1a4b539d7935cca710 | 4,272 | py | Python | Scripts/calc_Accuracy_ClassMultiDecade_ANN_v1.py | zmlabe/ExtremeEvents | 701c274c074dd2c4ae7c7294ec20f35c64e6ea2b | [
"MIT"
] | 3 | 2021-03-08T12:15:58.000Z | 2022-02-22T00:32:29.000Z | Scripts/calc_Accuracy_ClassMultiDecade_ANN_v1.py | zmlabe/ExtremeEvents | 701c274c074dd2c4ae7c7294ec20f35c64e6ea2b | [
"MIT"
] | null | null | null | Scripts/calc_Accuracy_ClassMultiDecade_ANN_v1.py | zmlabe/ExtremeEvents | 701c274c074dd2c4ae7c7294ec20f35c64e6ea2b | [
"MIT"
] | 6 | 2021-02-12T18:09:30.000Z | 2021-09-10T20:26:54.000Z | """
Script calculates accuracy of multi-decadal ANNv1
Author : Zachary M. Labe
Date : 19 January 2021
"""
### Import modules
import numpy as np
import scipy.stats as sts
import matplotlib.pyplot as plt
import calc_Utilities as UT
import calc_dataFunctions as df
import palettable.wesanderson as ww
import calc_... | 34.451613 | 134 | 0.676264 |
stats as sts
import matplotlib.pyplot as plt
import calc_Utilities as UT
import calc_dataFunctions as df
import palettable.wesanderson as ww
import calc_Stats as dSS
from sklearn.metrics import accuracy_score
p/ExtremeEvents_NewANN_v1/LENS/'
directorydata = '/Users/zlabe/Documents/Research/ExtremeEvents/Data/'
reg_na... | true | true |
1c2af8e5727d2303652df4218b453994acacde5b | 1,875 | py | Python | tests/param/get_param_type_spec_test.py | nickgaya/bravado-core | 16e752963bfceb4adfa43724085bc4127eefcd59 | [
"BSD-3-Clause"
] | 122 | 2015-04-22T17:31:18.000Z | 2021-11-08T10:29:57.000Z | tests/param/get_param_type_spec_test.py | nickgaya/bravado-core | 16e752963bfceb4adfa43724085bc4127eefcd59 | [
"BSD-3-Clause"
] | 364 | 2015-04-10T22:19:23.000Z | 2022-02-25T08:55:10.000Z | tests/param/get_param_type_spec_test.py | nickgaya/bravado-core | 16e752963bfceb4adfa43724085bc4127eefcd59 | [
"BSD-3-Clause"
] | 118 | 2015-04-20T15:11:53.000Z | 2021-12-09T10:03:34.000Z | # -*- coding: utf-8 -*-
import pytest
from mock import Mock
from bravado_core.exception import SwaggerMappingError
from bravado_core.operation import Operation
from bravado_core.param import get_param_type_spec
from bravado_core.param import Param
from bravado_core.spec import Spec
@pytest.fixture
def body_param_spe... | 31.25 | 76 | 0.678933 |
import pytest
from mock import Mock
from bravado_core.exception import SwaggerMappingError
from bravado_core.operation import Operation
from bravado_core.param import get_param_type_spec
from bravado_core.param import Param
from bravado_core.spec import Spec
@pytest.fixture
def body_param_spec():
return {
... | true | true |
1c2af97412a69a260122d3e168e84b20e427209b | 4,820 | py | Python | research/object_detection/speed_check.py | r08in279/Traffic-Management-Using-Drones | 15fdba219cef04b3cb59a68901a8064c3795d8e3 | [
"Apache-2.0"
] | null | null | null | research/object_detection/speed_check.py | r08in279/Traffic-Management-Using-Drones | 15fdba219cef04b3cb59a68901a8064c3795d8e3 | [
"Apache-2.0"
] | null | null | null | research/object_detection/speed_check.py | r08in279/Traffic-Management-Using-Drones | 15fdba219cef04b3cb59a68901a8064c3795d8e3 | [
"Apache-2.0"
] | null | null | null | import cv2
import dlib
import time
import threading
import math
carCascade = cv2.CascadeClassifier('myhaar.xml')
video = cv2.VideoCapture('speed.mp4')
WIDTH = 1280
HEIGHT = 720
def estimateSpeed(location1, location2):
d_pixels = math.sqrt(math.pow(location2[0] - location1[0], 2) + math.pow(location2[1] - location1... | 28.862275 | 175 | 0.611411 | import cv2
import dlib
import time
import threading
import math
carCascade = cv2.CascadeClassifier('myhaar.xml')
video = cv2.VideoCapture('speed.mp4')
WIDTH = 1280
HEIGHT = 720
def estimateSpeed(location1, location2):
d_pixels = math.sqrt(math.pow(location2[0] - location1[0], 2) + math.pow(location2[1] - location1... | true | true |
1c2afa2d5188456ea6592f5f2138f1245aa4ec1e | 233 | py | Python | data_processing/pre_processing/pre_config.py | bioengstrom/master-thesis | 7343a2d20c44b4e6fb85f9d457a9ef4746f6a124 | [
"MIT"
] | null | null | null | data_processing/pre_processing/pre_config.py | bioengstrom/master-thesis | 7343a2d20c44b4e6fb85f9d457a9ef4746f6a124 | [
"MIT"
] | null | null | null | data_processing/pre_processing/pre_config.py | bioengstrom/master-thesis | 7343a2d20c44b4e6fb85f9d457a9ef4746f6a124 | [
"MIT"
] | null | null | null | import os
EXTRACT_OFFSET = False
USE_OFFSET = False
SHOULD_DISPLAY = True
FIX_BACK_CAMERA = False
SHOULD_LOAD_TRIMMED = False
SHOULD_SYNC_SESSIONS = False
SHOULD_SEQUENTIATE = True
SHOULD_SAVE_FINAL = False
SHOULD_SAVE_INFO = False | 19.416667 | 28 | 0.832618 | import os
EXTRACT_OFFSET = False
USE_OFFSET = False
SHOULD_DISPLAY = True
FIX_BACK_CAMERA = False
SHOULD_LOAD_TRIMMED = False
SHOULD_SYNC_SESSIONS = False
SHOULD_SEQUENTIATE = True
SHOULD_SAVE_FINAL = False
SHOULD_SAVE_INFO = False | true | true |
1c2afacbbb5b33c01882fc511f7e0552819da17a | 336 | py | Python | sdk/python-autotimeseries/autotimeseries/_nbdev.py | KielRodriguez/nixtla | 8199f04ef79b6718f4a18967e839a735a2ff51ab | [
"MIT"
] | 176 | 2021-10-16T21:53:30.000Z | 2022-03-31T22:34:13.000Z | sdk/python-autotimeseries/autotimeseries/_nbdev.py | valeman/nixtla | 8991230491b16b0c7eb5d0dccd2fe64022ad8796 | [
"MIT"
] | 7 | 2021-11-18T00:24:11.000Z | 2022-03-18T17:02:17.000Z | sdk/python-autotimeseries/autotimeseries/_nbdev.py | valeman/nixtla | 8991230491b16b0c7eb5d0dccd2fe64022ad8796 | [
"MIT"
] | 18 | 2021-11-03T18:49:40.000Z | 2022-03-31T22:34:54.000Z | # AUTOGENERATED BY NBDEV! DO NOT EDIT!
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"AutoTS": "core.ipynb"}
modules = ["core.py"]
doc_url = "https://Nixtla.github.io/autotimeseries/"
git_url = "https://github.com/Nixtla/nixtla/tree/main/sdk/python-autotimeseries"
def custom_doc_links(nam... | 24 | 80 | 0.717262 |
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"AutoTS": "core.ipynb"}
modules = ["core.py"]
doc_url = "https://Nixtla.github.io/autotimeseries/"
git_url = "https://github.com/Nixtla/nixtla/tree/main/sdk/python-autotimeseries"
def custom_doc_links(name): return None
| true | true |
1c2afad46bea83872f14e87b1b23902a0c2b356c | 32,747 | py | Python | mysql-utilities-1.6.0/unit_tests/test_parsers.py | bopopescu/mysql-dbcompare | 1e912fd87282be3b3bed48487e6beb0ecb1de339 | [
"Apache-2.0"
] | 2 | 2018-03-20T07:42:58.000Z | 2018-03-20T07:43:49.000Z | mysql-utilities-1.6.0/unit_tests/test_parsers.py | bopopescu/mysql-dbcompare | 1e912fd87282be3b3bed48487e6beb0ecb1de339 | [
"Apache-2.0"
] | null | null | null | mysql-utilities-1.6.0/unit_tests/test_parsers.py | bopopescu/mysql-dbcompare | 1e912fd87282be3b3bed48487e6beb0ecb1de339 | [
"Apache-2.0"
] | 1 | 2020-07-23T23:07:08.000Z | 2020-07-23T23:07:08.000Z | #
# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in th... | 35.672113 | 79 | 0.566281 |
import sys
import os.path
_HERE = os.path.dirname(os.path.abspath(__file__))
_ROOTPATH = os.path.split(_HERE)[0]
sys.path.append(_ROOTPATH)
import tempfile
import inspect
import datetime
import decimal
import itertools
import unittest
from mysql.utilities.exception import (
LogParserError,
)
... | true | true |
1c2afcb34d57da78f620d63034669d24f6f46bd5 | 1,875 | py | Python | test/test_asset_sudi_info.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 21 | 2018-03-29T14:20:35.000Z | 2021-10-13T05:11:41.000Z | test/test_asset_sudi_info.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 14 | 2018-01-30T15:45:46.000Z | 2022-02-23T14:23:21.000Z | test/test_asset_sudi_info.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 18 | 2018-01-03T15:09:56.000Z | 2021-07-16T02:21:54.000Z | # coding: utf-8
"""
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environmen... | 49.342105 | 1,052 | 0.775467 |
from __future__ import absolute_import
import unittest
import intersight
from intersight.models.asset_sudi_info import AssetSudiInfo
from intersight.rest import ApiException
class TestAssetSudiInfo(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def testAssetSudi... | true | true |
1c2afe32703a43da3fd7dedc3a1ecb5dd7bffc71 | 57,281 | py | Python | Allura/allura/model/project.py | apache/allura | 6184203235ac6f83c943fae7fd3fef54678f9ed7 | [
"Apache-2.0"
] | 113 | 2015-03-25T10:33:37.000Z | 2022-02-16T20:55:06.000Z | Allura/allura/model/project.py | apache/allura | 6184203235ac6f83c943fae7fd3fef54678f9ed7 | [
"Apache-2.0"
] | 4 | 2017-08-04T16:19:07.000Z | 2020-06-08T19:01:33.000Z | Allura/allura/model/project.py | apache/allura | 6184203235ac6f83c943fae7fd3fef54678f9ed7 | [
"Apache-2.0"
] | 36 | 2015-08-14T16:27:39.000Z | 2022-02-16T20:54:35.000Z | # 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,... | 39.64083 | 132 | 0.600758 |
from __future__ import unicode_literals
from __future__ import absolute_import
import logging
from calendar import timegm
from collections import Counter, OrderedDict
from hashlib import sha256
import typing
from datetime import datetime
from copy import deepcopy
import six.moves.urllib.request
import... | true | true |
1c2afe6db18e7b7a1a70b65bc8fe3440926ba390 | 2,804 | py | Python | model/GraphNNet.py | AdrienBenamira/k_coloring_graph_AlphaZeroGo | c8f3271a2b117c95616b5752e134114ee8b20294 | [
"MIT"
] | 1 | 2020-04-05T03:12:22.000Z | 2020-04-05T03:12:22.000Z | model/GraphNNet.py | AdrienBenamira/k_coloring_graph_AlphaZeroGo | c8f3271a2b117c95616b5752e134114ee8b20294 | [
"MIT"
] | null | null | null | model/GraphNNet.py | AdrienBenamira/k_coloring_graph_AlphaZeroGo | c8f3271a2b117c95616b5752e134114ee8b20294 | [
"MIT"
] | null | null | null | import sys
sys.path.append('..')
from utils import *
import torch
import torch.nn as nn
import torch.nn.functional as F
class Graphnet(nn.Module):
def __init__(self, game, config):
# game params
self.board_x, self.board_y = game.getBoardSize()
self.action_size = game.getActionSize()
... | 50.981818 | 132 | 0.595578 | import sys
sys.path.append('..')
from utils import *
import torch
import torch.nn as nn
import torch.nn.functional as F
class Graphnet(nn.Module):
def __init__(self, game, config):
self.board_x, self.board_y = game.getBoardSize()
self.action_size = game.getActionSize()
self.confi... | true | true |
1c2afeb39f4a6a7847662212dc2b69c121657b9f | 5,201 | py | Python | metrics/bleurt/bleurt.py | geohci/datasets | 8c78f9ac4b24dc0fa259abe4d45f698909f5b92e | [
"Apache-2.0"
] | 1 | 2021-12-17T17:27:33.000Z | 2021-12-17T17:27:33.000Z | metrics/bleurt/bleurt.py | geohci/datasets | 8c78f9ac4b24dc0fa259abe4d45f698909f5b92e | [
"Apache-2.0"
] | null | null | null | metrics/bleurt/bleurt.py | geohci/datasets | 8c78f9ac4b24dc0fa259abe4d45f698909f5b92e | [
"Apache-2.0"
] | 1 | 2021-12-20T02:57:15.000Z | 2021-12-20T02:57:15.000Z | # coding=utf-8
# Copyright 2020 The HuggingFace Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 41.277778 | 180 | 0.690636 |
import os
from bleurt import score
import datasets
logger = datasets.logging.get_logger(__name__)
_CITATION = """\
@inproceedings{bleurt,
title={BLEURT: Learning Robust Metrics for Text Generation},
author={Thibault Sellam and Dipanjan Das and Ankur P. Parikh},
booktitle={ACL},
year={2020... | true | true |
1c2afff4182f9aaae187c03526d3f807824be810 | 4,100 | py | Python | lsp_shiloh/common/scan/aspscan/aspnums.py | internaru/Pinetree_P | 1f1525454c8b20c6c589529ff4bc159404611297 | [
"FSFAP"
] | null | null | null | lsp_shiloh/common/scan/aspscan/aspnums.py | internaru/Pinetree_P | 1f1525454c8b20c6c589529ff4bc159404611297 | [
"FSFAP"
] | null | null | null | lsp_shiloh/common/scan/aspscan/aspnums.py | internaru/Pinetree_P | 1f1525454c8b20c6c589529ff4bc159404611297 | [
"FSFAP"
] | null | null | null | #!/usr/bin/python
#
# ============================================================================
# Copyright (c) 2011 Marvell International, Ltd. All Rights Reserved
#
# Marvell Confidential
# ============================================================================
#
# generated by m2l... | 35.964912 | 98 | 0.680732 |
ASP_COOKIE = 0x41535001
SCAN_TYPE_MONO = 0
SCAN_TYPE_COLOR = 1
SCAN_TYPE_SCAN_THRU_COPY = 2
SCAN_MSG_LOCK_SCAN_RESOURCE = 0
SCAN_MSG_RELEASE_SCAN_RESOURCE = 1
SCAN_MSG_START_SCAN_JOB = 2
SCAN_MSG_CANCEL_SCAN_JOB = 3
SCAN_MSG_ABORT_SCAN_JOB = 4
SCAN_MSG_S... | true | true |
1c2b00886f8f858cef54ea63b5932482545e3d3c | 2,152 | py | Python | spinbot/policy/stale_issue_policy.py | invader35/spinnaker | 7e9d30d889a4bf1854a720809a11d740a1bea78d | [
"Apache-2.0"
] | 3 | 2018-08-23T02:45:51.000Z | 2018-12-12T01:37:03.000Z | spinbot/policy/stale_issue_policy.py | invader35/spinnaker | 7e9d30d889a4bf1854a720809a11d740a1bea78d | [
"Apache-2.0"
] | null | null | null | spinbot/policy/stale_issue_policy.py | invader35/spinnaker | 7e9d30d889a4bf1854a720809a11d740a1bea78d | [
"Apache-2.0"
] | null | null | null | from gh import ObjectType, IssueRepo, HasLabel, AddLabel
from datetime import datetime
from .policy import Policy
class StaleIssuePolicy(Policy):
def __init__(self):
super().__init__()
self.stale_days = self.config.get('stale_days')
self.count = 0
if not self.stale_days:
... | 36.474576 | 104 | 0.572026 | from gh import ObjectType, IssueRepo, HasLabel, AddLabel
from datetime import datetime
from .policy import Policy
class StaleIssuePolicy(Policy):
def __init__(self):
super().__init__()
self.stale_days = self.config.get('stale_days')
self.count = 0
if not self.stale_days:
... | true | true |
1c2b025ee72e5deea403f8b69e74159c7080b4ed | 12,339 | py | Python | wiktionaryparser.py | zchvsre/WiktionaryParser | f34286cc1a5600fe12c09874470faf665e156dda | [
"MIT"
] | null | null | null | wiktionaryparser.py | zchvsre/WiktionaryParser | f34286cc1a5600fe12c09874470faf665e156dda | [
"MIT"
] | null | null | null | wiktionaryparser.py | zchvsre/WiktionaryParser | f34286cc1a5600fe12c09874470faf665e156dda | [
"MIT"
] | 1 | 2020-12-14T16:22:31.000Z | 2020-12-14T16:22:31.000Z | import re, requests
from utils import WordData, Definition, RelatedWord
from bs4 import BeautifulSoup
from itertools import zip_longest
from copy import copy
from string import digits
PARTS_OF_SPEECH = [
"noun", "verb", "adjective", "adverb", "determiner",
"article", "preposition", "conjunction", "proper noun"... | 47.275862 | 172 | 0.613178 | import re, requests
from utils import WordData, Definition, RelatedWord
from bs4 import BeautifulSoup
from itertools import zip_longest
from copy import copy
from string import digits
PARTS_OF_SPEECH = [
"noun", "verb", "adjective", "adverb", "determiner",
"article", "preposition", "conjunction", "proper noun"... | true | true |
1c2b034fc310de6b560a15326c43c1c9074d04ac | 457 | py | Python | Python/Algorithms/1912.py | DimitrisJim/leetcode_solutions | 765ea578748f8c9b21243dec9dc8a16163e85c0c | [
"Unlicense"
] | 2 | 2021-01-15T17:22:54.000Z | 2021-05-16T19:58:02.000Z | Python/Algorithms/1912.py | DimitrisJim/leetcode_solutions | 765ea578748f8c9b21243dec9dc8a16163e85c0c | [
"Unlicense"
] | null | null | null | Python/Algorithms/1912.py | DimitrisJim/leetcode_solutions | 765ea578748f8c9b21243dec9dc8a16163e85c0c | [
"Unlicense"
] | null | null | null | class Solution:
def maxProductDifference(self, nums: List[int]) -> int:
# a, b hold 1st and 2nd maxes
a = b = 0
# c, d hold 1st and 2nd mins
c = d = 10 ** 4 + 1
for num in nums:
if num >= a:
a, b = num, a
elif num > b:
b... | 26.882353 | 59 | 0.376368 | class Solution:
def maxProductDifference(self, nums: List[int]) -> int:
a = b = 0
c = d = 10 ** 4 + 1
for num in nums:
if num >= a:
a, b = num, a
elif num > b:
b = num
if num <= c:
c, d = nu... | true | true |
1c2b051560369922611cb4893ba64b53da276670 | 5,960 | py | Python | sonybraviaremote/tv.py | Photonios/sony-bravia-remote | 7a3ab75ebee095671d6fc05a3c49a36f4efe80a8 | [
"MIT"
] | 15 | 2017-09-01T05:48:08.000Z | 2022-03-10T21:18:18.000Z | sonybraviaremote/tv.py | Photonios/sony-bravia-remote | 7a3ab75ebee095671d6fc05a3c49a36f4efe80a8 | [
"MIT"
] | 4 | 2017-12-26T18:24:13.000Z | 2021-11-02T17:40:53.000Z | sonybraviaremote/tv.py | Photonios/sony-bravia-remote | 7a3ab75ebee095671d6fc05a3c49a36f4efe80a8 | [
"MIT"
] | 9 | 2017-12-25T21:19:56.000Z | 2022-03-10T01:43:20.000Z | from typing import Callable
import json
import requests
from .tvconfig import TVConfig
class TV:
"""Represents a Sony Bravia TV that can
be controlled remotely."""
def __init__(self, auth_key: str, config: TVConfig):
"""Initializes a new instance of
:see:TV with the specified configurat... | 27.090909 | 145 | 0.52198 | from typing import Callable
import json
import requests
from .tvconfig import TVConfig
class TV:
def __init__(self, auth_key: str, config: TVConfig):
self.auth_key = auth_key
self.config = config
self._irc_codes = self.irc_codes()
def irc_codes(self) -> dict:
url = 'http:... | true | true |
1c2b054330d8b5be7ba68933ad00868a9544508f | 736 | py | Python | skeleton_recovery/urls.py | lebegueduweb/Local_library-deploy | 23e923b70f2bafa75d49570a35b1ab58a1c2901f | [
"MIT"
] | null | null | null | skeleton_recovery/urls.py | lebegueduweb/Local_library-deploy | 23e923b70f2bafa75d49570a35b1ab58a1c2901f | [
"MIT"
] | null | null | null | skeleton_recovery/urls.py | lebegueduweb/Local_library-deploy | 23e923b70f2bafa75d49570a35b1ab58a1c2901f | [
"MIT"
] | null | null | null | from django.conf import settings
from django.conf.urls.static import static
from django.urls import path, include
from django.contrib import admin
from django.views.generic import RedirectView
urlpatterns = [
path('catalog/', include('catalog.urls')),
path('blog/', include('blog.urls')),
path('jobs/', incl... | 40.888889 | 80 | 0.726902 | from django.conf import settings
from django.conf.urls.static import static
from django.urls import path, include
from django.contrib import admin
from django.views.generic import RedirectView
urlpatterns = [
path('catalog/', include('catalog.urls')),
path('blog/', include('blog.urls')),
path('jobs/', incl... | true | true |
1c2b05d624007ef7a480ed7bcfdf7cb8612f1d96 | 220 | py | Python | pipeline.py | GreLeBr/dataeng | 9b8c370b6c036d539b37364152d4333ee464197a | [
"MIT"
] | null | null | null | pipeline.py | GreLeBr/dataeng | 9b8c370b6c036d539b37364152d4333ee464197a | [
"MIT"
] | null | null | null | pipeline.py | GreLeBr/dataeng | 9b8c370b6c036d539b37364152d4333ee464197a | [
"MIT"
] | null | null | null | # To make a self launching package
# Creating a pipeline of instructions named pipeline.py
import pandas as pd
import sys
print(sys.agrv)
day = sys.argv[1]
#some fancy stuff with pandas
print(f"job done for day={day}") | 22 | 55 | 0.759091 |
import pandas as pd
import sys
print(sys.agrv)
day = sys.argv[1]
print(f"job done for day={day}") | true | true |
1c2b06a4d09a4ef0dac665cf518fb415924f19b4 | 440 | py | Python | singleplot.py | scivision/isrutils | 7e631f615e520ad1e84954dfc56ce34bc33da73f | [
"Apache-2.0"
] | 1 | 2019-10-20T19:19:17.000Z | 2019-10-20T19:19:17.000Z | singleplot.py | scivision/isrutils | 7e631f615e520ad1e84954dfc56ce34bc33da73f | [
"Apache-2.0"
] | null | null | null | singleplot.py | scivision/isrutils | 7e631f615e520ad1e84954dfc56ce34bc33da73f | [
"Apache-2.0"
] | 2 | 2016-06-27T15:03:21.000Z | 2016-08-23T02:24:14.000Z | #!/usr/bin/env python
"""
reading PFISR data down to IQ samples
See Examples/ for more updated specific code
"""
from isrutils.plots import simpleloop
from argparse import ArgumentParser
import seaborn as sns
sns.set_context("talk", 1.75)
sns.set_style("ticks")
def main():
p = ArgumentParser()
p.add_argume... | 16.923077 | 50 | 0.693182 |
from isrutils.plots import simpleloop
from argparse import ArgumentParser
import seaborn as sns
sns.set_context("talk", 1.75)
sns.set_style("ticks")
def main():
p = ArgumentParser()
p.add_argument("fn", help=".ini file to read")
p = p.parse_args()
simpleloop(p.fn)
if __name__ == "__main__":
... | true | true |
1c2b07764b13fae93e438e5a485383f2875d2478 | 8,078 | py | Python | contrib/devtools/update-translations.py | Bittransfer/Bittransfer-master | d4f0e9d3af9adac4641f1b689b736a21f7aa7311 | [
"MIT"
] | null | null | null | contrib/devtools/update-translations.py | Bittransfer/Bittransfer-master | d4f0e9d3af9adac4641f1b689b736a21f7aa7311 | [
"MIT"
] | null | null | null | contrib/devtools/update-translations.py | Bittransfer/Bittransfer-master | d4f0e9d3af9adac4641f1b689b736a21f7aa7311 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Run this script from the root of the repository to update all translations from
transifex.
It will do the follo... | 38.836538 | 124 | 0.636049 |
from __future__ import division, print_function
import subprocess
import re
import sys
import os
import io
import xml.etree.ElementTree as ET
TX = 'tx'
SOURCE_LANG = 'bittransfer_en.ts'
LOCALE_DIR = 'src/qt/locale'
MIN_NUM_MESSAGES = 10
def check_at_repository_root():
if not os.path.exists('.git'):
... | true | true |
1c2b087cffd64b8aeb9606588e40e4ee90044713 | 4,760 | py | Python | ansible/venv/lib/python2.7/site-packages/ansible/plugins/lookup/avi.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 17 | 2017-06-07T23:15:01.000Z | 2021-08-30T14:32:36.000Z | ansible/venv/lib/python2.7/site-packages/ansible/plugins/lookup/avi.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 9 | 2017-06-25T03:31:52.000Z | 2021-05-17T23:43:12.000Z | ansible/venv/lib/python2.7/site-packages/ansible/plugins/lookup/avi.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 3 | 2018-05-26T21:31:22.000Z | 2019-09-28T17:00:45.000Z | # python 3 headers, required if submitting to Ansible
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
lookup: avi
author: Sandeep Bandi <sandeepb@avinetworks.com>
version_added: 2.9
short_description: Look up ``Avi`` objects.
description:
- Given an objec... | 37.480315 | 125 | 0.614706 |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
lookup: avi
author: Sandeep Bandi <sandeepb@avinetworks.com>
version_added: 2.9
short_description: Look up ``Avi`` objects.
description:
- Given an object_type, fetch all the objects of that type or fetch
... | true | true |
1c2b09290a8ae4cfdd360db0b0aa6c5f24af8a7f | 3,392 | py | Python | scripts/generation/hand_dapg_demos.py | xfdywy/d4rl | d15b165c1e68d8c04d19faf44cd387046a4988a2 | [
"Apache-2.0"
] | 552 | 2020-04-20T01:07:02.000Z | 2022-03-31T16:47:39.000Z | d4rl/scripts/hand_dapg_demos.py | clvrai/goal_prox_il | 7c809b2ee575a69a14997068db06f3c1f3c8bd08 | [
"MIT"
] | 103 | 2020-04-20T14:18:32.000Z | 2022-03-30T14:33:45.000Z | d4rl/scripts/hand_dapg_demos.py | clvrai/goal_prox_il | 7c809b2ee575a69a14997068db06f3c1f3c8bd08 | [
"MIT"
] | 135 | 2020-04-21T16:57:52.000Z | 2022-03-30T14:29:55.000Z | import d4rl
import click
import os
import gym
import numpy as np
import pickle
import h5py
import collections
from mjrl.utils.gym_env import GymEnv
DESC = '''
Helper script to visualize demonstrations.\n
USAGE:\n
Visualizes demonstrations on the env\n
$ python utils/visualize_demos --env_name relocate-v0\n
''... | 33.254902 | 119 | 0.615566 | import d4rl
import click
import os
import gym
import numpy as np
import pickle
import h5py
import collections
from mjrl.utils.gym_env import GymEnv
DESC = '''
Helper script to visualize demonstrations.\n
USAGE:\n
Visualizes demonstrations on the env\n
$ python utils/visualize_demos --env_name relocate-v0\n
''... | true | true |
1c2b0959b7fd400608bca90631de0bf1101a5947 | 1,039 | py | Python | test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/models/__init__.py | qwordy/autorest.python | 6b12df51c2a39a1285546b5a771b69f5896e794f | [
"MIT"
] | 35 | 2018-04-03T12:15:53.000Z | 2022-03-11T14:03:34.000Z | test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/models/__init__.py | qwordy/autorest.python | 6b12df51c2a39a1285546b5a771b69f5896e794f | [
"MIT"
] | 652 | 2017-08-28T22:44:41.000Z | 2022-03-31T21:20:31.000Z | test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/models/__init__.py | qwordy/autorest.python | 6b12df51c2a39a1285546b5a771b69f5896e794f | [
"MIT"
] | 29 | 2017-08-28T20:57:01.000Z | 2022-03-11T14:03:38.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 33.516129 | 94 | 0.624639 |
try:
from ._models_py3 import Error
from ._models_py3 import ModelThree
from ._models_py3 import PagingResult
from ._models_py3 import SourcePath
except (SyntaxError, ImportError):
from ._models import Error
from ._models import ModelThree
from ._models import PagingResult
... | true | true |
1c2b0b053382af478cb909eb4e085017ac1f89af | 16,688 | py | Python | src/twisted/enterprise/adbapi.py | giadram/twisted | 4771b1340b822d20d0664bb7d8334e8fb7e52863 | [
"MIT",
"Unlicense"
] | null | null | null | src/twisted/enterprise/adbapi.py | giadram/twisted | 4771b1340b822d20d0664bb7d8334e8fb7e52863 | [
"MIT",
"Unlicense"
] | null | null | null | src/twisted/enterprise/adbapi.py | giadram/twisted | 4771b1340b822d20d0664bb7d8334e8fb7e52863 | [
"MIT",
"Unlicense"
] | null | null | null | # -*- test-case-name: twisted.test.test_adbapi -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
An asynchronous mapping to U{DB-API
2.0<http://www.python.org/topics/database/DatabaseAPI-2.0.html>}.
"""
from twisted.internet import threads
from twisted.python import reflect, log
class... | 34.766667 | 86 | 0.620865 |
from twisted.internet import threads
from twisted.python import reflect, log
class ConnectionLost(Exception):
class Connection:
def __init__(self, pool):
self._pool = pool
self._connection = None
self.reconnect()
def close(self):
... | true | true |
1c2b0b88563889186f8b880f4b5ce4c4570f513e | 16,457 | py | Python | Inventario/cmp/views.py | SYS0xWord/InventarioDjango_Udemy | 073b3edbf3495289251d3edf4d0437a813f5cfb4 | [
"MIT"
] | null | null | null | Inventario/cmp/views.py | SYS0xWord/InventarioDjango_Udemy | 073b3edbf3495289251d3edf4d0437a813f5cfb4 | [
"MIT"
] | null | null | null | Inventario/cmp/views.py | SYS0xWord/InventarioDjango_Udemy | 073b3edbf3495289251d3edf4d0437a813f5cfb4 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect
from django.views import generic
from django.urls import reverse_lazy
import datetime
from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin
from django.contrib.auth.decorators import login_required, permission_required
from .models import Provee... | 36.652561 | 151 | 0.598773 | from django.shortcuts import render, redirect
from django.views import generic
from django.urls import reverse_lazy
import datetime
from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin
from django.contrib.auth.decorators import login_required, permission_required
from .models import Provee... | true | true |
1c2b0b9d5948df7a1bb20379bd18e96c4ab61acf | 2,027 | py | Python | tests/test_http_request_playbook_creation_ui.py | fhightower-tc/playbook-utility | e6b140429491c1ce3b2912436e37937301aad190 | [
"MIT"
] | null | null | null | tests/test_http_request_playbook_creation_ui.py | fhightower-tc/playbook-utility | e6b140429491c1ce3b2912436e37937301aad190 | [
"MIT"
] | 14 | 2018-04-27T15:42:37.000Z | 2018-08-17T19:13:38.000Z | tests/test_http_request_playbook_creation_ui.py | fhightower/playbook-utility | e6b140429491c1ce3b2912436e37937301aad190 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from playbook_utility import playbook_utility
def check_heading(response):
"""Make sure the heading is shown in a response."""
assert 'Playbook Utility' in response
assert 'Helpful tools for working with ThreatConnect playbooks.' in response
... | 36.854545 | 107 | 0.666009 |
import unittest
from playbook_utility import playbook_utility
def check_heading(response):
assert 'Playbook Utility' in response
assert 'Helpful tools for working with ThreatConnect playbooks.' in response
def check_requester_index(response):
check_heading(response)
assert "Try 'https://ioc-fang... | true | true |
1c2b0ba5a241fd0c38155d906e8504d8d54ebe48 | 2,587 | py | Python | service/api_service.py | diiineeei/api_python | d71310a12c4a5ae21026e434f8773a0da63fa71d | [
"MIT"
] | null | null | null | service/api_service.py | diiineeei/api_python | d71310a12c4a5ae21026e434f8773a0da63fa71d | [
"MIT"
] | null | null | null | service/api_service.py | diiineeei/api_python | d71310a12c4a5ae21026e434f8773a0da63fa71d | [
"MIT"
] | null | null | null | from flask import request, jsonify, abort
from flask import abort
class ApiService:
@staticmethod
def get():
response = jsonify({
'id': "001",
'name': "Rodinei Lima",
'date_created': "11/11/2017",
'date_modified': "20/05/... | 33.166667 | 125 | 0.436799 | from flask import request, jsonify, abort
from flask import abort
class ApiService:
@staticmethod
def get():
response = jsonify({
'id': "001",
'name': "Rodinei Lima",
'date_created': "11/11/2017",
'date_modified': "20/05/... | true | true |
1c2b0c808a5c6f4af48a4e1d06a72a38ae2b7eac | 25,437 | py | Python | bot.py | Katistic/LetsBeSafeBot | c8fb4d676a5bf6d6cd8724353a6b4bd03d1da9b8 | [
"MIT"
] | null | null | null | bot.py | Katistic/LetsBeSafeBot | c8fb4d676a5bf6d6cd8724353a6b4bd03d1da9b8 | [
"MIT"
] | 1 | 2020-04-27T21:22:46.000Z | 2020-04-27T21:22:46.000Z | bot.py | Katistic/LetsBeSafeBot | c8fb4d676a5bf6d6cd8724353a6b4bd03d1da9b8 | [
"MIT"
] | null | null | null | import discord
import asyncio
import aiohttp
import random
import time
import os
from iomanage import IOManager as IOM
import urllib.parse
import youtube_dl
ytdl = youtube_dl.YoutubeDL({
'format': 'bestaudio/best',
'outtmpl': 'lbs-%(extractor)s-%(id)s.%(ext)s',
'restrictfilenames': True,
'noplaylist':... | 38.482602 | 195 | 0.547234 | import discord
import asyncio
import aiohttp
import random
import time
import os
from iomanage import IOManager as IOM
import urllib.parse
import youtube_dl
ytdl = youtube_dl.YoutubeDL({
'format': 'bestaudio/best',
'outtmpl': 'lbs-%(extractor)s-%(id)s.%(ext)s',
'restrictfilenames': True,
'noplaylist':... | true | true |
1c2b0d222214b97788dd34af2da3c7c85053506c | 976 | py | Python | certificate_generator/txx_tools/txx_re.py | SleepAqua/certificate_generator | 94605394ac68aa9edbbea548acc4f541bfef8aa2 | [
"MIT"
] | 1 | 2020-10-10T08:55:29.000Z | 2020-10-10T08:55:29.000Z | certificate_generator/txx_tools/txx_re.py | SleepAqua/certificate_generator | 94605394ac68aa9edbbea548acc4f541bfef8aa2 | [
"MIT"
] | null | null | null | certificate_generator/txx_tools/txx_re.py | SleepAqua/certificate_generator | 94605394ac68aa9edbbea548acc4f541bfef8aa2 | [
"MIT"
] | null | null | null | '''
@version: Python 3.7.3
@Author: Louis
@Date: 2020-06-15 15:00:28
@LastEditors: Louis
@LastEditTime: 2020-06-15 17:53:26
'''
import re
from .txx_consts import TODAY
"""
() are important for "|" logic!
"""
# Finance
ASHARE_STK_REGEX = '^60.*SH|^00.*SZ|^30.*SZ'
ASHARE_IDX_REGEX = '^000.*SH|^399.*SZ'
ASHARE_INFUND_R... | 25.684211 | 92 | 0.597336 | import re
from .txx_consts import TODAY
ASHARE_STK_REGEX = '^60.*SH|^00.*SZ|^30.*SZ'
ASHARE_IDX_REGEX = '^000.*SH|^399.*SZ'
ASHARE_INFUND_REGEX = '^5.*SH|^17.*SZ|^18.*SZ|^15.*SZ|^16.*SZ|^5.*SZ'
DATENUM_21_CENTURY_REGEX = "(20[0-9][0-9])([0][1-9]|[1][0-2])([0][1-9]|[1-2][0-9]|[3][0-1])"
MONTH_REGEX = "([0][1-9]|[1... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.