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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c2c346b926e965849966de02518eb85033da42d | 4,375 | py | Python | aoc/day22.py | martinhenstridge/adventofcode2021 | f9fa76fd91f13abab9307794e30461033a470eca | [
"MIT"
] | null | null | null | aoc/day22.py | martinhenstridge/adventofcode2021 | f9fa76fd91f13abab9307794e30461033a470eca | [
"MIT"
] | null | null | null | aoc/day22.py | martinhenstridge/adventofcode2021 | f9fa76fd91f13abab9307794e30461033a470eca | [
"MIT"
] | null | null | null | import re
from typing import NamedTuple
from . import util
class Cuboid(NamedTuple):
xmin: int
xmax: int
ymin: int
ymax: int
zmin: int
zmax: int
@property
def count(self):
return (
(1 + self.xmax - self.xmin)
* (1 + self.ymax - self.ymin)
* ... | 29.362416 | 102 | 0.511086 | import re
from typing import NamedTuple
from . import util
class Cuboid(NamedTuple):
xmin: int
xmax: int
ymin: int
ymax: int
zmin: int
zmax: int
@property
def count(self):
return (
(1 + self.xmax - self.xmin)
* (1 + self.ymax - self.ymin)
* ... | true | true |
1c2c3481f1407d2b1c0479de6b385d4aac674d9f | 3,749 | py | Python | SprityBird/spritybird/python3.5/lib/python3.5/site-packages/objc/_convenience_nsdecimal.py | MobileAnalytics/iPython-Framework | da0e598308c067cd5c5290a6364b3ffaf2d2418f | [
"MIT"
] | 4 | 2018-07-04T17:20:12.000Z | 2019-07-14T18:07:25.000Z | SprityBird/spritybird/python3.5/lib/python3.5/site-packages/objc/_convenience_nsdecimal.py | MobileAnalytics/iPython-Framework | da0e598308c067cd5c5290a6364b3ffaf2d2418f | [
"MIT"
] | null | null | null | SprityBird/spritybird/python3.5/lib/python3.5/site-packages/objc/_convenience_nsdecimal.py | MobileAnalytics/iPython-Framework | da0e598308c067cd5c5290a6364b3ffaf2d2418f | [
"MIT"
] | 1 | 2018-09-03T03:02:06.000Z | 2018-09-03T03:02:06.000Z | """
Support for NSDecimalNumber.
The actual class is defined in Foundation, but having the wrapper
here is much more convenient.
"""
__all__ = ()
from objc._convenience import addConvenienceForClass
from _objc import lookUpClass, NSDecimal
import sys
import operator
NSDecimalNumber = lookUpClass('NSDecimalNumber')
d... | 49.986667 | 104 | 0.65004 | __all__ = ()
from objc._convenience import addConvenienceForClass
from _objc import lookUpClass, NSDecimal
import sys
import operator
NSDecimalNumber = lookUpClass('NSDecimalNumber')
def decimal_new(cls, value=None):
if value is None:
return cls.numberWithInt_(0)
else:
if isinstance(value, NS... | true | true |
1c2c34ed42e078182cd2bd0a9d7af18b99592cbf | 7,302 | py | Python | google/cloud/aiplatform_v1/types/specialist_pool_service.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | 1 | 2022-03-30T05:23:29.000Z | 2022-03-30T05:23:29.000Z | google/cloud/aiplatform_v1/types/specialist_pool_service.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform_v1/types/specialist_pool_service.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 37.446154 | 129 | 0.71364 |
import proto
from google.cloud.aiplatform_v1.types import operation
from google.cloud.aiplatform_v1.types import specialist_pool as gca_specialist_pool
from google.protobuf import field_mask_pb2
__protobuf__ = proto.module(
package="google.cloud.aiplatform.v1",
manifest={
"CreateSp... | true | true |
1c2c35e8c03707058b2c6e6a8afcf60ccd099056 | 3,764 | py | Python | mgf_checker/reader.py | kusterlab/MasterSpectrum | 938688043690a7da1b68126a73e519d2a07ba6de | [
"MIT"
] | null | null | null | mgf_checker/reader.py | kusterlab/MasterSpectrum | 938688043690a7da1b68126a73e519d2a07ba6de | [
"MIT"
] | null | null | null | mgf_checker/reader.py | kusterlab/MasterSpectrum | 938688043690a7da1b68126a73e519d2a07ba6de | [
"MIT"
] | null | null | null |
from mgf_checker.msParserInfo import MS_parser_info
from abc import ABCMeta, abstractmethod
import csv
from mgf_checker.mzidInfo import MZID_info
class Reader(metaclass=ABCMeta):
def __init__(self, path):
self.path = path
self.data = {}
def read_file(self):
with open(self.path) as cs... | 39.208333 | 197 | 0.535335 |
from mgf_checker.msParserInfo import MS_parser_info
from abc import ABCMeta, abstractmethod
import csv
from mgf_checker.mzidInfo import MZID_info
class Reader(metaclass=ABCMeta):
def __init__(self, path):
self.path = path
self.data = {}
def read_file(self):
with open(self.path) as cs... | true | true |
1c2c36196484c2b0158ae77c67ec5b00f64a6446 | 10,704 | py | Python | contrib/database/schema_migration/versions/3f96c40b580a_created_event_schema.py | ctrlsys/sensys | 58221bca169c95c300ecc5526aa00590f0ce5c2f | [
"BSD-3-Clause-Open-MPI"
] | 14 | 2016-09-06T17:02:20.000Z | 2020-03-30T14:34:59.000Z | contrib/database/schema_migration/versions/3f96c40b580a_created_event_schema.py | ctrlsys/sensys | 58221bca169c95c300ecc5526aa00590f0ce5c2f | [
"BSD-3-Clause-Open-MPI"
] | 9 | 2017-04-25T20:45:11.000Z | 2017-07-20T14:58:03.000Z | contrib/database/schema_migration/versions/3f96c40b580a_created_event_schema.py | ctrlsys/sensys | 58221bca169c95c300ecc5526aa00590f0ce5c2f | [
"BSD-3-Clause-Open-MPI"
] | 5 | 2016-10-11T03:28:26.000Z | 2019-07-31T00:36:02.000Z | #
# Copyright (c) 2015 Intel Corporation. All rights reserved
#
"""Created 'event', 'event_data', and 'event_data_key' tables to store data from the EvGen framework.
Revision ID: 3f96c40b580a
Revises: 1d10ef20817b
Create Date: 2015-11-19 22:26:55.393954
"""
# revision identifiers, used by Alembic.
import textwrap
r... | 41.169231 | 101 | 0.526999 |
import textwrap
revision = '3f96c40b580a'
down_revision = '1d10ef20817b'
branch_labels = None
from alembic import op
import sqlalchemy as sa
def _postgresql_upgrade_ddl():
op.execute(textwrap.dedent("""
CREATE FUNCTION add_event(
p_time_stamp TIMESTAMP WITHOUT TIME ZONE,
... | true | true |
1c2c36a370c83b79c722649dc78b5c5da8e1ef45 | 8,240 | py | Python | fairseq/models/__init__.py | tran-khoa/fairseq | 558366b3c6970a5dd85ad1909581d43e41fdce9f | [
"MIT"
] | null | null | null | fairseq/models/__init__.py | tran-khoa/fairseq | 558366b3c6970a5dd85ad1909581d43e41fdce9f | [
"MIT"
] | null | null | null | fairseq/models/__init__.py | tran-khoa/fairseq | 558366b3c6970a5dd85ad1909581d43e41fdce9f | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""isort:skip_file"""
import argparse
import importlib
import os
from contextlib import ExitStack
from fairseq.dataclass import FairseqDatacl... | 34.915254 | 117 | 0.653641 |
import argparse
import importlib
import os
from contextlib import ExitStack
from fairseq.dataclass import FairseqDataclass
from fairseq.dataclass.utils import merge_with_parent
from hydra.core.config_store import ConfigStore
from omegaconf import open_dict, OmegaConf
from .composite_encoder import CompositeEncod... | true | true |
1c2c36bf2d6e93d5f3d560ba85669dcf9accf49b | 203 | py | Python | system/t04_mirror/__init__.py | kchida/aptly | 07165efc9d4bcd7018031787f27e70c2d8ecb8b9 | [
"MIT"
] | 16 | 2015-02-10T16:32:43.000Z | 2021-08-10T18:59:10.000Z | system/t04_mirror/__init__.py | kchida/aptly | 07165efc9d4bcd7018031787f27e70c2d8ecb8b9 | [
"MIT"
] | null | null | null | system/t04_mirror/__init__.py | kchida/aptly | 07165efc9d4bcd7018031787f27e70c2d8ecb8b9 | [
"MIT"
] | 8 | 2015-02-28T23:21:55.000Z | 2020-11-24T11:29:30.000Z | """
Testing mirror management
"""
from .create import *
from .show import *
from .list import *
from .update import *
from .drop import *
from .rename import *
from .edit import *
from .search import *
| 15.615385 | 25 | 0.704433 |
from .create import *
from .show import *
from .list import *
from .update import *
from .drop import *
from .rename import *
from .edit import *
from .search import *
| true | true |
1c2c380f19bf455f71912570bd1e4554ad7f517a | 18,542 | py | Python | dashboard/main.py | narek-davtyan/bigquery-bokeh-dashboard | e2f8ab7684ded7bad81ac8d7b5ffaa3eb954481f | [
"Apache-2.0"
] | null | null | null | dashboard/main.py | narek-davtyan/bigquery-bokeh-dashboard | e2f8ab7684ded7bad81ac8d7b5ffaa3eb954481f | [
"Apache-2.0"
] | null | null | null | dashboard/main.py | narek-davtyan/bigquery-bokeh-dashboard | e2f8ab7684ded7bad81ac8d7b5ffaa3eb954481f | [
"Apache-2.0"
] | null | null | null | import pandas as pd
import numpy as np
# Import multiprocessing libraries
from pandarallel import pandarallel
# Initialization
pandarallel.initialize()
# Load data
min_list_of_columns_to_load = ['company', 'service', 'recommendation', 'easiness', 'rec_sc', 'eas_sc']
df_orig = pd.read_excel(r'CDD1.xlsx', names=min_l... | 54.216374 | 371 | 0.643081 | import pandas as pd
import numpy as np
from pandarallel import pandarallel
pandarallel.initialize()
min_list_of_columns_to_load = ['company', 'service', 'recommendation', 'easiness', 'rec_sc', 'eas_sc']
df_orig = pd.read_excel(r'CDD1.xlsx', names=min_list_of_columns_to_load)
df_orig['service'] = df_orig['servi... | true | true |
1c2c380fe9cc858758b68712b42ad3237a84b6f0 | 3,650 | py | Python | V2RaycSpider1225/src/BusinessLogicLayer/utils/sckey_steward.py | game-loader/V2RayCloudSpider | 21d37e9ce3af3fb1c77ec5394449d8373cad1816 | [
"MIT"
] | null | null | null | V2RaycSpider1225/src/BusinessLogicLayer/utils/sckey_steward.py | game-loader/V2RayCloudSpider | 21d37e9ce3af3fb1c77ec5394449d8373cad1816 | [
"MIT"
] | null | null | null | V2RaycSpider1225/src/BusinessLogicLayer/utils/sckey_steward.py | game-loader/V2RayCloudSpider | 21d37e9ce3af3fb1c77ec5394449d8373cad1816 | [
"MIT"
] | null | null | null | __all__ = ['api']
import base64
import hashlib
import os
from Crypto.Cipher import AES
class _SecretSteward(object):
"""
> 接收用户输入
- 校验数据 if 正确 -> 缓存数据 data:服务器敏感数据
- else -> 丢弃
> 接收用户确认信息
- 是否存储 data if YES -> 启动密钥管理模块
- else -> 丢弃缓存
> 密钥管理模块
- 接收用户输入 pem-pass... | 33.486239 | 115 | 0.592055 | __all__ = ['api']
import base64
import hashlib
import os
from Crypto.Cipher import AES
class _SecretSteward(object):
def __init__(self, sckey: str):
self.base_pem = '_sckeyStream.v2raycs'
if sckey.__len__() > 32:
sckey = sckey[:32]
self.sckey = self._complete_stream(sckey=... | true | true |
1c2c38675ddeb50a2e1178f4d9b6889afd1dc419 | 375 | py | Python | csob/tests/resources/__init__.py | druids/csob-paymentgateway | 64e5e84ad4a0239f716855e12ee70364ab4414df | [
"MIT"
] | null | null | null | csob/tests/resources/__init__.py | druids/csob-paymentgateway | 64e5e84ad4a0239f716855e12ee70364ab4414df | [
"MIT"
] | 3 | 2019-03-13T10:28:35.000Z | 2019-04-04T10:56:59.000Z | csob/tests/resources/__init__.py | druids/csob-paymentgateway | 64e5e84ad4a0239f716855e12ee70364ab4414df | [
"MIT"
] | 1 | 2019-03-11T02:32:14.000Z | 2019-03-11T02:32:14.000Z | import os
import sys
PRIVATE_KEY_PATH = os.path.join(sys.prefix, 'csob_keys/rsa_test_A3746UdxZO.key')
GATEWAY_KEY_PATH = os.path.join(sys.prefix, 'csob_keys/mips_platebnibrana.csob.cz.pub')
def get_private_key():
with open(PRIVATE_KEY_PATH, 'r') as f:
return f.read()
def get_gateway_key():
with ope... | 23.4375 | 87 | 0.714667 | import os
import sys
PRIVATE_KEY_PATH = os.path.join(sys.prefix, 'csob_keys/rsa_test_A3746UdxZO.key')
GATEWAY_KEY_PATH = os.path.join(sys.prefix, 'csob_keys/mips_platebnibrana.csob.cz.pub')
def get_private_key():
with open(PRIVATE_KEY_PATH, 'r') as f:
return f.read()
def get_gateway_key():
with ope... | true | true |
1c2c3886367fd57d2bba97ab2435464496cd0f56 | 144 | py | Python | conda-4.3/run_test.py | jakirkham/anaconda-recipes | 74fb2280662a022f2d12a7744b4823cfa5e236df | [
"BSD-3-Clause"
] | 130 | 2015-07-28T03:41:21.000Z | 2022-03-16T03:07:41.000Z | conda-4.3/run_test.py | jakirkham/anaconda-recipes | 74fb2280662a022f2d12a7744b4823cfa5e236df | [
"BSD-3-Clause"
] | 119 | 2015-08-01T00:54:06.000Z | 2021-01-05T13:00:46.000Z | conda-4.3/run_test.py | jakirkham/anaconda-recipes | 74fb2280662a022f2d12a7744b4823cfa5e236df | [
"BSD-3-Clause"
] | 72 | 2015-07-29T02:35:56.000Z | 2022-02-26T14:31:15.000Z | import conda
print('conda.__version__: %s' % conda.__version__)
assert conda.__version__ == '4.3.25'
from conda.fetch import handle_proxy_407
| 20.571429 | 50 | 0.770833 | import conda
print('conda.__version__: %s' % conda.__version__)
assert conda.__version__ == '4.3.25'
from conda.fetch import handle_proxy_407
| true | true |
1c2c38900d31a5e1fbf65407352dee9fdcd9bf95 | 7,749 | py | Python | tests/test_gcloud.py | timgates42/pyramid_storage | a45e54beb52957e1e9d0177ad5a225815df827c1 | [
"BSD-3-Clause"
] | null | null | null | tests/test_gcloud.py | timgates42/pyramid_storage | a45e54beb52957e1e9d0177ad5a225815df827c1 | [
"BSD-3-Clause"
] | null | null | null | tests/test_gcloud.py | timgates42/pyramid_storage | a45e54beb52957e1e9d0177ad5a225815df827c1 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from io import BytesIO
import mock
import pytest
from pyramid import compat
from pyramid import exceptions as pyramid_exceptions
class MockGCloudConnection(object):
def get_bucket(self, bucket_name):
bucket = mock.MagicMock()
bucket.get_blob.return_value = None
re... | 27.874101 | 85 | 0.677507 |
from io import BytesIO
import mock
import pytest
from pyramid import compat
from pyramid import exceptions as pyramid_exceptions
class MockGCloudConnection(object):
def get_bucket(self, bucket_name):
bucket = mock.MagicMock()
bucket.get_blob.return_value = None
return bucket
def _get_... | true | true |
1c2c38922ab51ffc005959091fad12ea82adc024 | 12,323 | py | Python | saharaclient/tests/unit/osc/v2/test_data_sources.py | openstack/python-saharaclient | 2f01b878a9e07bc712fae9c6c2c5f823bd986dd6 | [
"Apache-2.0"
] | 34 | 2015-01-26T21:39:46.000Z | 2021-01-16T17:30:25.000Z | saharaclient/tests/unit/osc/v2/test_data_sources.py | openstack/python-saharaclient | 2f01b878a9e07bc712fae9c6c2c5f823bd986dd6 | [
"Apache-2.0"
] | null | null | null | saharaclient/tests/unit/osc/v2/test_data_sources.py | openstack/python-saharaclient | 2f01b878a9e07bc712fae9c6c2c5f823bd986dd6 | [
"Apache-2.0"
] | 15 | 2015-03-13T23:24:59.000Z | 2017-06-22T12:15:46.000Z | # Copyright (c) 2015 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 39.751613 | 78 | 0.6031 |
from osc_lib.tests import utils as osc_utils
from unittest import mock
from saharaclient.api import data_sources as api_ds
from saharaclient.osc.v1 import data_sources as osc_ds
from saharaclient.tests.unit.osc.v1 import test_data_sources as tds_v1
DS_INFO = {'id': 'id', 'name': 'source', 'type': 'swif... | true | true |
1c2c38f1314c710ed50ebe34a3ec895a178c8f82 | 1,779 | py | Python | tests/serializers.py | jwhitlock/drf-json-api | a62802432c612c34079f3c3694129f37778e2577 | [
"MIT"
] | null | null | null | tests/serializers.py | jwhitlock/drf-json-api | a62802432c612c34079f3c3694129f37778e2577 | [
"MIT"
] | null | null | null | tests/serializers.py | jwhitlock/drf-json-api | a62802432c612c34079f3c3694129f37778e2577 | [
"MIT"
] | null | null | null | from rest_framework import relations, serializers
from tests import models
import rest_framework
class CommentSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
fields = ("id", "url", "post", "body", )
model = models.Comment
class PersonSerializer(serializers.HyperlinkedModelSerial... | 26.552239 | 123 | 0.728499 | from rest_framework import relations, serializers
from tests import models
import rest_framework
class CommentSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
fields = ("id", "url", "post", "body", )
model = models.Comment
class PersonSerializer(serializers.HyperlinkedModelSerial... | true | true |
1c2c38f7831d706904b45845d1bc5d3e68681c1d | 1,960 | py | Python | samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py | JigarJoshi/openapi-generator | 785535b8d6881b358463994823abbda2b26ff42e | [
"Apache-2.0"
] | 1 | 2022-02-23T20:33:43.000Z | 2022-02-23T20:33:43.000Z | samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py | JigarJoshi/openapi-generator | 785535b8d6881b358463994823abbda2b26ff42e | [
"Apache-2.0"
] | 7 | 2021-12-16T03:21:30.000Z | 2022-03-31T03:26:58.000Z | samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py | JigarJoshi/openapi-generator | 785535b8d6881b358463994823abbda2b26ff42e | [
"Apache-2.0"
] | 1 | 2022-02-19T21:56:04.000Z | 2022-02-19T21:56:04.000Z | # coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
... | 21.075269 | 174 | 0.640306 |
import re
import sys
import typing
from frozendict import frozendict
import decimal
from datetime import date, datetime
from frozendict import frozendict
from petstore_api.schemas import (
AnyTypeSchema,
ComposedSchema,
DictSchema,
ListSchema,
StrSchema,
IntSchema,
Int3... | true | true |
1c2c3984c19ddc16ccb2625358b0d022aea89c00 | 1,270 | py | Python | tests/test_entity.py | juntosdesdecasa/mcthings_extra | dc4c91ac6920b861ff4454be506eed6e067f306b | [
"Apache-2.0"
] | 1 | 2020-05-12T06:33:36.000Z | 2020-05-12T06:33:36.000Z | tests/test_entity.py | Voxelers/mcthings_extra | dc4c91ac6920b861ff4454be506eed6e067f306b | [
"Apache-2.0"
] | 1 | 2020-04-24T12:25:24.000Z | 2020-04-24T23:09:30.000Z | tests/test_entity.py | Voxelers/mcthings_extra | dc4c91ac6920b861ff4454be506eed6e067f306b | [
"Apache-2.0"
] | 1 | 2020-05-15T14:02:51.000Z | 2020-05-15T14:02:51.000Z | #!/usr/bin/env python3
# Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
# Author (©): Alvaro del Castillo
import sys
import mcpi.block
import mcpi.entity
from mcpi.vec3 import Vec3
from mcthings.decorators.light_decorator import LightDecorator
from mcthings.house import House
from mcthings.se... | 25.4 | 90 | 0.716535 |
import sys
import mcpi.block
import mcpi.entity
from mcpi.vec3 import Vec3
from mcthings.decorators.light_decorator import LightDecorator
from mcthings.house import House
from mcthings.server import Server
from mcthings.world import World
from mcthings_extra.decorators.villager_decorator import VillagerDecorator... | true | true |
1c2c398680d7f59fc0fd38aaa36a16bdc1bfeb3a | 13,112 | py | Python | scripts/models/verification_result.py | Druidos/cv | 90cdbf212d7cc8c5cbd2fbbcc770d18a89771037 | [
"Apache-2.0"
] | null | null | null | scripts/models/verification_result.py | Druidos/cv | 90cdbf212d7cc8c5cbd2fbbcc770d18a89771037 | [
"Apache-2.0"
] | null | null | null | scripts/models/verification_result.py | Druidos/cv | 90cdbf212d7cc8c5cbd2fbbcc770d18a89771037 | [
"Apache-2.0"
] | null | null | null | #
# CV is a framework for continuous verification.
#
# Copyright (c) 2018-2019 ISP RAS (http://www.ispras.ru)
# Ivannikov Institute for System Programming of the Russian Academy of Sciences
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... | 40.594427 | 114 | 0.59701 |
import glob
import json
import os
import re
import shutil
import time
from xml.etree import ElementTree
from components import *
from components.mea import MEA
TAG_OPTIMIZE = "optimize"
def to_str(val) -> str:
return "{}".format(val)
class EntryPointDesc:
def __init__(self, file: str, i... | true | true |
1c2c3b53bf84a7751b24ce63b436536f011c60b2 | 1,967 | py | Python | tests/test_formatter.py | Cottonwood-Technology/ConfigTree | ce7d92a4e536ba0104b92a9ce871819279f5b63a | [
"BSD-2-Clause"
] | null | null | null | tests/test_formatter.py | Cottonwood-Technology/ConfigTree | ce7d92a4e536ba0104b92a9ce871819279f5b63a | [
"BSD-2-Clause"
] | null | null | null | tests/test_formatter.py | Cottonwood-Technology/ConfigTree | ce7d92a4e536ba0104b92a9ce871819279f5b63a | [
"BSD-2-Clause"
] | null | null | null | from os import linesep
from configtree import formatter
from configtree.tree import Tree
t = Tree(
{
"a.x": 1,
"a.y": 'Testing "json"',
"a.z": "Testing 'shell'",
"list": ['Testing "json"', "Testing 'shell'"],
"none": None,
"bool": True,
}
)
def test_json():
... | 25.881579 | 67 | 0.449415 | from os import linesep
from configtree import formatter
from configtree.tree import Tree
t = Tree(
{
"a.x": 1,
"a.y": 'Testing "json"',
"a.z": "Testing 'shell'",
"list": ['Testing "json"', "Testing 'shell'"],
"none": None,
"bool": True,
}
)
def test_json():
... | true | true |
1c2c3c44f55c81475ff3d43350cbad7efe9dd2a3 | 410 | py | Python | basic_web/app.py | HungThinhPhung/Miscellaneous | dee5c6551a8580510c3c4e54087d38feb995d4d4 | [
"MIT"
] | null | null | null | basic_web/app.py | HungThinhPhung/Miscellaneous | dee5c6551a8580510c3c4e54087d38feb995d4d4 | [
"MIT"
] | null | null | null | basic_web/app.py | HungThinhPhung/Miscellaneous | dee5c6551a8580510c3c4e54087d38feb995d4d4 | [
"MIT"
] | null | null | null | import logging
import os
from flask import Flask, render_template
app = Flask(__name__)
@app.route("/", methods=['GET'])
def render():
return render_template('index.html')
if __name__ == "__main__":
port = int(os.getenv('PORT', 8111))
logging.warning("Starting app on port %d" % port)
app.config['J... | 21.578947 | 65 | 0.67561 | import logging
import os
from flask import Flask, render_template
app = Flask(__name__)
@app.route("/", methods=['GET'])
def render():
return render_template('index.html')
if __name__ == "__main__":
port = int(os.getenv('PORT', 8111))
logging.warning("Starting app on port %d" % port)
app.config['J... | true | true |
1c2c3c7f288d963874d9bedd9f8d88d979674e3a | 20,112 | py | Python | bin/docker_detection_tester/modules/splunk_container.py | arjunkhunti-crest/security_content | 41e354485e5917d3366ef735a9c5b25a20d3b8cc | [
"Apache-2.0"
] | null | null | null | bin/docker_detection_tester/modules/splunk_container.py | arjunkhunti-crest/security_content | 41e354485e5917d3366ef735a9c5b25a20d3b8cc | [
"Apache-2.0"
] | null | null | null | bin/docker_detection_tester/modules/splunk_container.py | arjunkhunti-crest/security_content | 41e354485e5917d3366ef735a9c5b25a20d3b8cc | [
"Apache-2.0"
] | 1 | 2022-01-27T05:29:43.000Z | 2022-01-27T05:29:43.000Z | from collections import OrderedDict
import datetime
import docker
import docker.types
import docker.models
import docker.models.resource
import docker.models.containers
import os.path
import random
import requests
import shutil
from modules import splunk_sdk
from modules import testing_service
from modules import test_... | 42.520085 | 187 | 0.606504 | from collections import OrderedDict
import datetime
import docker
import docker.types
import docker.models
import docker.models.resource
import docker.models.containers
import os.path
import random
import requests
import shutil
from modules import splunk_sdk
from modules import testing_service
from modules import test_... | true | true |
1c2c3cb5d27790c1e7ed31daba914ceae5626d89 | 61,187 | py | Python | Tools/gdb/libpython.py | deadsnakes/python3.3 | 4faaf44cd5478410ac3b977351c1965fa054b5e9 | [
"PSF-2.0"
] | 652 | 2015-07-26T00:00:17.000Z | 2022-02-24T18:30:04.000Z | Tools/gdb/libpython.py | deadsnakes/python3.3 | 4faaf44cd5478410ac3b977351c1965fa054b5e9 | [
"PSF-2.0"
] | 8 | 2015-09-07T03:38:19.000Z | 2021-05-23T03:18:51.000Z | Tools/gdb/libpython.py | isabella232/cpython-pt | 16d0393123bcc49009e3746471a603290804899a | [
"PSF-2.0"
] | 40 | 2015-07-24T19:45:08.000Z | 2021-11-01T14:54:56.000Z | #!/usr/bin/python
'''
From gdb 7 onwards, gdb's build can be configured --with-python, allowing gdb
to be extended with Python code e.g. for library-specific data visualizations,
such as for the C++ STL types. Documentation on this API can be seen at:
http://sourceware.org/gdb/current/onlinedocs/gdb/Python-API.html
... | 33.842367 | 102 | 0.574191 |
__future__ import print_function, with_statement
import gdb
import os
import locale
import sys
if sys.version_info[0] >= 3:
unichr = chr
xrange = range
long = int
_type_char_ptr = gdb.lookup_type('char').pointer()
_type_unsigned_char_ptr = gdb.lookup_type('unsigned char').pointer()
_type_void_ptr = ... | true | true |
1c2c3d61eee8035467645bf5c46c77b5e5e49dc2 | 8,611 | py | Python | brainMRI/dataset.py | giacomodeodato/BrainMRIDataset | 7f2dd315e7c970c61651e025dcafbed94caa8924 | [
"MIT"
] | 1 | 2022-03-04T06:18:21.000Z | 2022-03-04T06:18:21.000Z | brainMRI/dataset.py | giacomodeodato/BrainMRIDataset | 7f2dd315e7c970c61651e025dcafbed94caa8924 | [
"MIT"
] | null | null | null | brainMRI/dataset.py | giacomodeodato/BrainMRIDataset | 7f2dd315e7c970c61651e025dcafbed94caa8924 | [
"MIT"
] | null | null | null | import os
import numpy as np
import h5py
from skimage.io import imread
from datetime import datetime
from tqdm.auto import tqdm
from .utils import preprocess_volume, preprocess_mask
class Dataset():
"""
TCGA-LGG dataset of brain MRIs for Lower Grade Glioma segmentation.
Attributes:
IMG_SHAPE : tu... | 37.60262 | 133 | 0.561956 | import os
import numpy as np
import h5py
from skimage.io import imread
from datetime import datetime
from tqdm.auto import tqdm
from .utils import preprocess_volume, preprocess_mask
class Dataset():
IMG_SHAPE = (256, 256)
VOLUMES = ["pre-contrast", "FLAIR", "post-contrast"]
def __init__(self, path="./da... | true | true |
1c2c3db7c37d1820053f9f0dfc995aac11ca4116 | 1,837 | py | Python | contentcuration/contentcuration/migrations/0052_auto_20170201_1155.py | Tlazypanda/studio | cd1c2f169c705027cdd808cbbcae907d0a9b21d2 | [
"MIT"
] | 1 | 2019-03-30T18:14:25.000Z | 2019-03-30T18:14:25.000Z | contentcuration/contentcuration/migrations/0052_auto_20170201_1155.py | Tlazypanda/studio | cd1c2f169c705027cdd808cbbcae907d0a9b21d2 | [
"MIT"
] | 2 | 2019-04-06T07:06:08.000Z | 2019-04-08T23:33:53.000Z | contentcuration/contentcuration/migrations/0052_auto_20170201_1155.py | Tlazypanda/studio | cd1c2f169c705027cdd808cbbcae907d0a9b21d2 | [
"MIT"
] | 1 | 2020-10-20T05:21:56.000Z | 2020-10-20T05:21:56.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-02-01 19:55
from __future__ import unicode_literals
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
('contentcuration', '0051_auto_20170126_1633'),
]
operations = [
... | 54.029412 | 356 | 0.617311 |
from __future__ import unicode_literals
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
('contentcuration', '0051_auto_20170126_1633'),
]
operations = [
migrations.AddField(
model_name='assessmentitem',
... | true | true |
1c2c3fdce517842bc7e8701a457753679cbadd18 | 5,257 | py | Python | docs/conf.py | SylvainCorlay/xhale | 70e2ded348b19ec64d80d3be9b52894f35e73d23 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | SylvainCorlay/xhale | 70e2ded348b19ec64d80d3be9b52894f35e73d23 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | SylvainCorlay/xhale | 70e2ded348b19ec64d80d3be9b52894f35e73d23 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# xhale documentation build configuration file, created by
# sphinx-quickstart on Sun Apr 22 20:02:10 2018.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# auto... | 29.869318 | 79 | 0.684231 |
def setup(app):
app.add_stylesheet("main_stylesheet.css")
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.napoleon']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = 'xhale'
copyright = '2018, Loic gouarin'
author = 'Loic gouarin'
#... | true | true |
1c2c402b5349167d4dbd224778cc996b162ae5b3 | 2,332 | py | Python | bin/bootstrapping/schema_conversion_tool.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | null | null | null | bin/bootstrapping/schema_conversion_tool.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | 11 | 2020-02-29T02:51:12.000Z | 2022-03-30T23:20:08.000Z | bin/bootstrapping/schema_conversion_tool.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | 1 | 2020-07-24T18:47:35.000Z | 2020-07-24T18:47:35.000Z | # Copyright 2017 Google Inc. All Rights Reserved.
#
"""Wrapper for Gcloud-installed Schema Conversion Tool."""
import os
import bootstrapping
from googlecloudsdk.command_lib.util import java
from googlecloudsdk.core.updater import update_manager
# Path to the unpacked component
_COMPONENT_DIR = os.path.join(bootstra... | 32.388889 | 77 | 0.683105 |
import os
import bootstrapping
from googlecloudsdk.command_lib.util import java
from googlecloudsdk.core.updater import update_manager
_COMPONENT_DIR = os.path.join(bootstrapping.SDK_ROOT,
'platform', 'schema_conversion_tool')
_JAR_DIR = os.path.join(_COMPONENT_DIR, 'lib')
_COMPON... | true | true |
1c2c40d45e4de0a5a61b1cd7ccc4c43ca2496bb6 | 6,188 | py | Python | docs/source/conf.py | delepoulle/rawls | 9e57be0b79d8ea09873690f1820cb52640a2a85d | [
"MIT"
] | null | null | null | docs/source/conf.py | delepoulle/rawls | 9e57be0b79d8ea09873690f1820cb52640a2a85d | [
"MIT"
] | 1 | 2021-04-16T06:51:25.000Z | 2021-04-16T06:51:25.000Z | docs/source/conf.py | delepoulle/rawls | 9e57be0b79d8ea09873690f1820cb52640a2a85d | [
"MIT"
] | 1 | 2021-04-13T08:30:14.000Z | 2021-04-13T08:30:14.000Z | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... | 29.051643 | 79 | 0.650452 |
import os
import sys
sys.path.insert(0, os.path.abspath('../../../rawls'))
project = 'rawls'
copyright = '2020, Jérôme BUISINE'
author = 'Jérôme BUISINE'
version = '1.1.7'
release = 'v1.1.7'
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.coverage',
... | true | true |
1c2c41715db2b4c61d502f76ba519ca242650b1d | 972 | py | Python | kubernetes/test/test_v1_secret_env_source.py | anemerovsky-essextec/python | 6e40b9169b27c3f1f9422c0f6dd1cd9caef8d57c | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_v1_secret_env_source.py | anemerovsky-essextec/python | 6e40b9169b27c3f1f9422c0f6dd1cd9caef8d57c | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_v1_secret_env_source.py | anemerovsky-essextec/python | 6e40b9169b27c3f1f9422c0f6dd1cd9caef8d57c | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.12.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
i... | 21.6 | 105 | 0.711934 |
from __future__ import absolute_import
import os
import sys
import unittest
import kubernetes.client
from kubernetes.client.rest import ApiException
from kubernetes.client.models.v1_secret_env_source import V1SecretEnvSource
class TestV1SecretEnvSource(unittest.TestCase):
def setUp(self):
pass
... | true | true |
1c2c4174e9a9774b26b5d7443b67579a36b5ab8e | 4,360 | py | Python | instances/pspnet/ade.pspnet.R50_v1c/network.py | dontLoveBugs/MyTorch | d14bd1a231bde7f2e05282f86c640bcce4a55baf | [
"MIT"
] | 1 | 2020-02-25T00:35:00.000Z | 2020-02-25T00:35:00.000Z | instances/pspnet/ade.pspnet.R50_v1c/network.py | dontLoveBugs/MyTorch | d14bd1a231bde7f2e05282f86c640bcce4a55baf | [
"MIT"
] | null | null | null | instances/pspnet/ade.pspnet.R50_v1c/network.py | dontLoveBugs/MyTorch | d14bd1a231bde7f2e05282f86c640bcce4a55baf | [
"MIT"
] | null | null | null | # encoding: utf-8
from functools import partial
from collections import OrderedDict
import torch
import torch.nn as nn
import torch.nn.functional as F
from modules.backbone import resnet50
from modules.ops.seg.seg_oprs import ConvBnRelu
# 读取配置文件
from modules.engine.seg.config import Config
config = Config(config_fi... | 34.88 | 79 | 0.558028 |
from functools import partial
from collections import OrderedDict
import torch
import torch.nn as nn
import torch.nn.functional as F
from modules.backbone import resnet50
from modules.ops.seg.seg_oprs import ConvBnRelu
from modules.engine.seg.config import Config
config = Config(config_file='./config.json').get_c... | true | true |
1c2c423ba66151af6b755dfd20d9f6dce4f1cc45 | 1,099 | py | Python | examples/tutorial/tutorial/app.py | carbonariy/dvhb-hybrid | adbb250767ea255addc607fb6f6755c9add447db | [
"MIT"
] | 27 | 2018-05-08T16:03:24.000Z | 2020-02-20T06:39:19.000Z | examples/tutorial/tutorial/app.py | carbonariy/dvhb-hybrid | adbb250767ea255addc607fb6f6755c9add447db | [
"MIT"
] | 7 | 2018-10-20T16:03:36.000Z | 2021-11-03T11:09:22.000Z | examples/tutorial/tutorial/app.py | carbonariy/dvhb-hybrid | adbb250767ea255addc607fb6f6755c9add447db | [
"MIT"
] | 16 | 2018-12-11T15:34:22.000Z | 2022-01-25T00:20:55.000Z | import os
import aiopg.sa
import django
from aiohttp_apiset import SwaggerRouter
from aiohttp_apiset.middlewares import jsonify
import aioworkers.http
from dvhb_hybrid.amodels import AppModels
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tutorial.settings")
django.setup()
import tutorial
AppModels.import_all_mo... | 26.804878 | 68 | 0.708826 | import os
import aiopg.sa
import django
from aiohttp_apiset import SwaggerRouter
from aiohttp_apiset.middlewares import jsonify
import aioworkers.http
from dvhb_hybrid.amodels import AppModels
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tutorial.settings")
django.setup()
import tutorial
AppModels.import_all_mo... | true | true |
1c2c4382dc2bec243f9120ad2fca826f556dfdf0 | 475 | py | Python | URI1789.py | rashidulhasanhridoy/URI-Online-Judge-Problem-Solve-with-Python-3 | c7db434e2e6e40c2ca3bd56db0d04cf79f69de12 | [
"Apache-2.0"
] | 2 | 2020-07-21T18:01:37.000Z | 2021-11-29T01:08:14.000Z | URI1789.py | rashidulhasanhridoy/URI-Online-Judge-Problem-Solve-with-Python-3 | c7db434e2e6e40c2ca3bd56db0d04cf79f69de12 | [
"Apache-2.0"
] | null | null | null | URI1789.py | rashidulhasanhridoy/URI-Online-Judge-Problem-Solve-with-Python-3 | c7db434e2e6e40c2ca3bd56db0d04cf79f69de12 | [
"Apache-2.0"
] | null | null | null | def main():
while True:
numbers = []
try:
l = int(input())
except:
break
x = input()
numbers = x.split()
for i in range(len(numbers)):
numbers[i] = int(numbers[i])
if max(numbers) < 10:
print("1")
elif ma... | 25 | 53 | 0.431579 | def main():
while True:
numbers = []
try:
l = int(input())
except:
break
x = input()
numbers = x.split()
for i in range(len(numbers)):
numbers[i] = int(numbers[i])
if max(numbers) < 10:
print("1")
elif ma... | true | true |
1c2c45b6beabbc089285e913423b74d6687ece7b | 777 | py | Python | src/connect4_zero/lib/data_helper.py | maximerihouey/connect4-alpha-zero | 952a47df1a15d1a4e0696c23c9109acefd727aa0 | [
"MIT"
] | null | null | null | src/connect4_zero/lib/data_helper.py | maximerihouey/connect4-alpha-zero | 952a47df1a15d1a4e0696c23c9109acefd727aa0 | [
"MIT"
] | null | null | null | src/connect4_zero/lib/data_helper.py | maximerihouey/connect4-alpha-zero | 952a47df1a15d1a4e0696c23c9109acefd727aa0 | [
"MIT"
] | null | null | null | import json
import os
from glob import glob
from logging import getLogger
from connect4_zero.config import ResourceConfig
logger = getLogger(__name__)
def get_game_data_filenames(rc: ResourceConfig):
pattern = os.path.join(rc.play_data_dir, rc.play_data_filename_tmpl % "*")
files = list(sorted(glob(pattern)... | 23.545455 | 81 | 0.724582 | import json
import os
from glob import glob
from logging import getLogger
from connect4_zero.config import ResourceConfig
logger = getLogger(__name__)
def get_game_data_filenames(rc: ResourceConfig):
pattern = os.path.join(rc.play_data_dir, rc.play_data_filename_tmpl % "*")
files = list(sorted(glob(pattern)... | true | true |
1c2c460c66670ad2aca1c91fa0fc74defb26f85a | 491 | py | Python | mover.py | OlopesMaster/mover_pastas | 384ba76f0a820f07cc4e186b90e7df93f47dc1a7 | [
"MIT"
] | 1 | 2021-12-26T23:17:19.000Z | 2021-12-26T23:17:19.000Z | mover.py | OlopesMaster/mover_pastas | 384ba76f0a820f07cc4e186b90e7df93f47dc1a7 | [
"MIT"
] | null | null | null | mover.py | OlopesMaster/mover_pastas | 384ba76f0a820f07cc4e186b90e7df93f47dc1a7 | [
"MIT"
] | null | null | null | import os
import pathlib
def mover_arquivos(caminho_origem, caminho_destino, formato):
lista = list(set(str(path.parent) for path in pathlib.Path(f"{caminho_origem}\\.").glob(f"**/*{formato}")))
nome_arquivo = list()
aux = 0
for c in lista:
nome_arquivo.append(pathlib.PureWindowsPath(st... | 32.733333 | 112 | 0.627291 | import os
import pathlib
def mover_arquivos(caminho_origem, caminho_destino, formato):
lista = list(set(str(path.parent) for path in pathlib.Path(f"{caminho_origem}\\.").glob(f"**/*{formato}")))
nome_arquivo = list()
aux = 0
for c in lista:
nome_arquivo.append(pathlib.PureWindowsPath(st... | true | true |
1c2c468e4116f074bee492800d8729487553b458 | 41,198 | py | Python | Simulating hydrogen/functionsHydrogenSimulation.py | animucki/2mmn40 | c54c0e4e9c801d63f048fbb5d9abd8fe9432cfdc | [
"Unlicense"
] | null | null | null | Simulating hydrogen/functionsHydrogenSimulation.py | animucki/2mmn40 | c54c0e4e9c801d63f048fbb5d9abd8fe9432cfdc | [
"Unlicense"
] | null | null | null | Simulating hydrogen/functionsHydrogenSimulation.py | animucki/2mmn40 | c54c0e4e9c801d63f048fbb5d9abd8fe9432cfdc | [
"Unlicense"
] | null | null | null | ###################################################################################
################################# FUNCTIONS #######################################
###################################################################################
import numpy as np
import time
from sklearn.metrics.pairwise im... | 54.857523 | 2,014 | 0.609471 | nol + gridVectors[0]
for m in range(0, totalNumMolecules-1):
if moleculeVector[m+1] == "Water":
XYZinitial = np.concatenate((XYZinitial, basicWater + (1/numMoleculeOneDirec)*boxSize*gridVectors[m + 1]))
else:
XYZinitial = np.concatenate((XYZinitial, basicEthan... | true | true |
1c2c46f99a82875b917a330d6ec76062222420de | 20,238 | py | Python | python/paddle/fluid/tests/unittests/test_compat.py | ysh329/Paddle | 50ad9046c9a440564d104eaa354eb9df83a35678 | [
"Apache-2.0"
] | 9 | 2017-12-04T02:58:01.000Z | 2020-12-03T14:46:30.000Z | python/paddle/fluid/tests/unittests/test_compat.py | ysh329/Paddle | 50ad9046c9a440564d104eaa354eb9df83a35678 | [
"Apache-2.0"
] | 7 | 2017-12-05T20:29:08.000Z | 2018-10-15T08:57:40.000Z | python/paddle/fluid/tests/unittests/test_compat.py | ysh329/Paddle | 50ad9046c9a440564d104eaa354eb9df83a35678 | [
"Apache-2.0"
] | 6 | 2018-03-19T22:38:46.000Z | 2019-11-01T22:28:27.000Z | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 39.996047 | 74 | 0.523322 |
from __future__ import print_function
import unittest
import paddle.compat as cpt
import six
class TestCompatible(unittest.TestCase):
def test_type(self):
if six.PY2:
self.assertEqual(cpt.int_type, int)
self.assertEqual(cpt.long_type, long)
else:
... | true | true |
1c2c475e3ed7b3a3ebe61cc7556a74907074f8ef | 70,637 | py | Python | nova/compute/resource_tracker.py | mikalstill/nova | 99ca7d60b41f63446f86ed9be86440a2b250f330 | [
"Apache-2.0"
] | null | null | null | nova/compute/resource_tracker.py | mikalstill/nova | 99ca7d60b41f63446f86ed9be86440a2b250f330 | [
"Apache-2.0"
] | null | null | null | nova/compute/resource_tracker.py | mikalstill/nova | 99ca7d60b41f63446f86ed9be86440a2b250f330 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 46.686715 | 79 | 0.617679 |
import collections
import copy
from keystoneauth1 import exceptions as ks_exc
from oslo_log import log as logging
from oslo_serialization import jsonutils
import retrying
from nova.compute import claims
from nova.compute import monitors
from nova.compute import stats as compute_stats
from nova.compute ... | true | true |
1c2c4942cd88d34d5c3829e03fcdff03e88a827c | 3,893 | py | Python | pc-compliance-alerts-get.py | sgordon46/pc-toolbox | a00cf2aa41eff683151a7f59ed108eaae0e3b384 | [
"MIT"
] | null | null | null | pc-compliance-alerts-get.py | sgordon46/pc-toolbox | a00cf2aa41eff683151a7f59ed108eaae0e3b384 | [
"MIT"
] | null | null | null | pc-compliance-alerts-get.py | sgordon46/pc-toolbox | a00cf2aa41eff683151a7f59ed108eaae0e3b384 | [
"MIT"
] | null | null | null | from __future__ import print_function
try:
input = raw_input
except NameError:
pass
import argparse
import pc_lib_api
import pc_lib_general
import json
# --Execution Block-- #
# --Parse command line arguments-- #
parser = argparse.ArgumentParser(prog='rltoolbox')
parser.add_argument(
'-u',
'--usernam... | 35.715596 | 121 | 0.702543 | from __future__ import print_function
try:
input = raw_input
except NameError:
pass
import argparse
import pc_lib_api
import pc_lib_general
import json
parser = argparse.ArgumentParser(prog='rltoolbox')
parser.add_argument(
'-u',
'--username',
type=str,
help='*Required* - Prisma Cloud API Acc... | true | true |
1c2c4a54661f935f34012845375fb387b79babf9 | 23,116 | py | Python | neutron/tests/unit/extensions/test_l3_ext_gw_mode.py | deepak-dt/neutron | 5226e50c68084dd3d76861d1247f9f292949b616 | [
"Apache-2.0"
] | null | null | null | neutron/tests/unit/extensions/test_l3_ext_gw_mode.py | deepak-dt/neutron | 5226e50c68084dd3d76861d1247f9f292949b616 | [
"Apache-2.0"
] | null | null | null | neutron/tests/unit/extensions/test_l3_ext_gw_mode.py | deepak-dt/neutron | 5226e50c68084dd3d76861d1247f9f292949b616 | [
"Apache-2.0"
] | 1 | 2018-08-28T17:13:16.000Z | 2018-08-28T17:13:16.000Z | # Copyright 2013 VMware, Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 43.207477 | 79 | 0.62779 |
import mock
import netaddr
from neutron_lib.api.definitions import l3 as l3_apidef
from neutron_lib import constants
from neutron_lib import context as nctx
from neutron_lib.db import api as db_api
from neutron_lib.plugins import directory
from oslo_config import cfg
from oslo_db import exception as db_... | true | true |
1c2c4b18f9235e6e3de66a3d2437f9377283e169 | 545 | py | Python | bumblebee_status/modules/core/time.py | rosalogia/bumblebee-status | 19c3975301d8700743df745ecd5ca2c05ecf5cf0 | [
"MIT"
] | null | null | null | bumblebee_status/modules/core/time.py | rosalogia/bumblebee-status | 19c3975301d8700743df745ecd5ca2c05ecf5cf0 | [
"MIT"
] | null | null | null | bumblebee_status/modules/core/time.py | rosalogia/bumblebee-status | 19c3975301d8700743df745ecd5ca2c05ecf5cf0 | [
"MIT"
] | 1 | 2020-10-22T09:23:54.000Z | 2020-10-22T09:23:54.000Z | # pylint: disable=C0111,R0903
"""Displays the current date and time.
Parameters:
* time.format: strftime()-compatible formatting string
* time.locale: locale to use rather than the system default
"""
import core.decorators
from .datetime import Module
class Module(Module):
@core.decorators.every(second... | 22.708333 | 71 | 0.711927 |
import core.decorators
from .datetime import Module
class Module(Module):
@core.decorators.every(seconds=59)
def __init__(self, config, theme):
super().__init__(config, theme)
def default_format(self):
return "%X"
| true | true |
1c2c4c4d7fd9e44abbf1d439a0919ddbed850e12 | 9,329 | py | Python | stretch_render.py | CrunchyDuck/StretchRender | 47d5bf2b34d2bcd6ec2da1317f30ac5e05044add | [
"MIT"
] | null | null | null | stretch_render.py | CrunchyDuck/StretchRender | 47d5bf2b34d2bcd6ec2da1317f30ac5e05044add | [
"MIT"
] | null | null | null | stretch_render.py | CrunchyDuck/StretchRender | 47d5bf2b34d2bcd6ec2da1317f30ac5e05044add | [
"MIT"
] | null | null | null | import bpy
from bpy.types import (Panel, Operator)
import os
os.system("cls") # Clear console
bl_info = {
"name": "Stretch Render",
"description": "Alternative rendering compression method.",
"author": "CrunchyDuck <realvulpes@gmail.com>",
"version": (0, 1, 1),
"blender": (2, 83, 0),
"category": "Render",
"lo... | 50.427027 | 279 | 0.748526 | import bpy
from bpy.types import (Panel, Operator)
import os
os.system("cls")
bl_info = {
"name": "Stretch Render",
"description": "Alternative rendering compression method.",
"author": "CrunchyDuck <realvulpes@gmail.com>",
"version": (0, 1, 1),
"blender": (2, 83, 0),
"category": "Render",
"location": "Opera... | true | true |
1c2c4c5c9c96cc163def26125e1d56f2cde83a4f | 1,522 | py | Python | fontFeatures/feeLib/Conditional.py | m4rc1e/fontFeatures | 522f60ac632ab0a087477cfb57e23a96c33aee99 | [
"BSD-3-Clause"
] | null | null | null | fontFeatures/feeLib/Conditional.py | m4rc1e/fontFeatures | 522f60ac632ab0a087477cfb57e23a96c33aee99 | [
"BSD-3-Clause"
] | null | null | null | fontFeatures/feeLib/Conditional.py | m4rc1e/fontFeatures | 522f60ac632ab0a087477cfb57e23a96c33aee99 | [
"BSD-3-Clause"
] | null | null | null | """
Conditional
===========
Rules can be applied conditionally using the `If` statement. These will make
more sense when you can define variables.
Examples::
If $dosub {
Substitute a -> b;
}
"""
import fontFeatures
GRAMMAR = """
If_Args = boolean_condition:c wsc '{' wsc statement+:s wsc '}' -> (c,... | 26.701754 | 92 | 0.567674 |
import fontFeatures
GRAMMAR = """
If_Args = boolean_condition:c wsc '{' wsc statement+:s wsc '}' -> (c,s)
boolean_condition = or | and | boolean_term
boolean_term = bracketed | not | boolean_factor
boolean_factor = integer:l ws comparison?:r -> parser.plugin_classes["If"].docomparison(l,r)
comparison = ('>='|'>'|'<='... | true | true |
1c2c4d37d63ffae4463d667f463fb1de61cc518f | 2,692 | py | Python | tests/models/validators/v2_1_2/jsd_6db9292d4f28a26b.py | nonstdout/dnacentersdk | dbbbc4baa5300aa9e5c9193f2ea71438018095f5 | [
"MIT"
] | null | null | null | tests/models/validators/v2_1_2/jsd_6db9292d4f28a26b.py | nonstdout/dnacentersdk | dbbbc4baa5300aa9e5c9193f2ea71438018095f5 | [
"MIT"
] | null | null | null | tests/models/validators/v2_1_2/jsd_6db9292d4f28a26b.py | nonstdout/dnacentersdk | dbbbc4baa5300aa9e5c9193f2ea71438018095f5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""DNA Center Add Fabric data model.
Copyright (c) 2019-2020 Cisco and/or its affiliates.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including wi... | 32.047619 | 78 | 0.591382 |
from __future__ import (
absolute_import,
division,
print_function,
unicode_literals,
)
import fastjsonschema
import json
from dnacentersdk.exceptions import MalformedRequest
from builtins import *
class JSONSchemaValidator6Db9292D4F28A26B(object):
def __init__(self):
super(JSONSchema... | true | true |
1c2c4d5411086ef5f379dfac412a371890acce06 | 18,350 | py | Python | selfdrive/car/toyota/interface.py | iamlukewang/openpilot | d44f8c747b0c8764da8b84f208e40abf6e6b712a | [
"MIT"
] | 1 | 2021-04-29T18:40:03.000Z | 2021-04-29T18:40:03.000Z | selfdrive/car/toyota/interface.py | iamlukewang/openpilot | d44f8c747b0c8764da8b84f208e40abf6e6b712a | [
"MIT"
] | null | null | null | selfdrive/car/toyota/interface.py | iamlukewang/openpilot | d44f8c747b0c8764da8b84f208e40abf6e6b712a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from cereal import car
from selfdrive.config import Conversions as CV
from selfdrive.car.toyota.values import Ecu, ECU_FINGERPRINT, CAR, TSS2_CAR, FINGERPRINTS
from selfdrive.car import STD_CARGO_KG, scale_rot_inertia, scale_tire_stiffness, is_ecu_disconnected, gen_empty_fingerprint
from selfdriv... | 42.575406 | 139 | 0.667248 |
from cereal import car
from selfdrive.config import Conversions as CV
from selfdrive.car.toyota.values import Ecu, ECU_FINGERPRINT, CAR, TSS2_CAR, FINGERPRINTS
from selfdrive.car import STD_CARGO_KG, scale_rot_inertia, scale_tire_stiffness, is_ecu_disconnected, gen_empty_fingerprint
from selfdrive.swaglog import cloud... | true | true |
1c2c4e7dee45b65ff30006c880c9cbfc23744252 | 19,192 | py | Python | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_private_endpoint_connections_operations.py | mohamedshabanofficial/azure-sdk-for-python | 81c585f310cd2ec23d2ad145173958914a075a58 | [
"MIT"
] | 2 | 2021-03-24T06:26:11.000Z | 2021-04-18T15:55:59.000Z | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_private_endpoint_connections_operations.py | mohamedshabanofficial/azure-sdk-for-python | 81c585f310cd2ec23d2ad145173958914a075a58 | [
"MIT"
] | null | null | null | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_private_endpoint_connections_operations.py | mohamedshabanofficial/azure-sdk-for-python | 81c585f310cd2ec23d2ad145173958914a075a58 | [
"MIT"
] | 1 | 2021-12-18T20:01:22.000Z | 2021-12-18T20:01:22.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 ... | 52.294278 | 251 | 0.685911 |
from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpRequest, HttpResponse
from azure.c... | true | true |
1c2c4f726603ea041b7ba928b14302a2c024617d | 63 | py | Python | wagtail_tinify/__init__.py | lucasmoeskops/wagtail-tinify | d0a6bf3f52f8b7ded2b7bd2c408bc7c10edc95a6 | [
"MIT"
] | null | null | null | wagtail_tinify/__init__.py | lucasmoeskops/wagtail-tinify | d0a6bf3f52f8b7ded2b7bd2c408bc7c10edc95a6 | [
"MIT"
] | null | null | null | wagtail_tinify/__init__.py | lucasmoeskops/wagtail-tinify | d0a6bf3f52f8b7ded2b7bd2c408bc7c10edc95a6 | [
"MIT"
] | null | null | null | default_app_config = 'wagtail_tinify.apps.WagtailTinifyConfig'
| 31.5 | 62 | 0.873016 | default_app_config = 'wagtail_tinify.apps.WagtailTinifyConfig'
| true | true |
1c2c5152116a83913c132f0a97f1b7bcc9d02645 | 5,399 | py | Python | data/p3BR/R1/benchmark/startQiskit_Class403.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R1/benchmark/startQiskit_Class403.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R1/benchmark/startQiskit_Class403.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=3
# total number=71
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collections import Counter
from... | 29.183784 | 140 | 0.629561 |
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collections import Counter
from qiskit.test.mock import FakeVigo... | true | true |
1c2c5293b6e6088817defdb6355b42a48bb97468 | 13,301 | py | Python | expression/core/option.py | erlendvollset/Expression | 888fd757d69e39efa5e3b76228d565b2607c1c5b | [
"MIT"
] | null | null | null | expression/core/option.py | erlendvollset/Expression | 888fd757d69e39efa5e3b76228d565b2607c1c5b | [
"MIT"
] | null | null | null | expression/core/option.py | erlendvollset/Expression | 888fd757d69e39efa5e3b76228d565b2607c1c5b | [
"MIT"
] | null | null | null | """Option module.
Contains a collection of static methods (functions) for operating on
options. All functions takes the source as the last curried
argument, i.e all functions returns a function that takes the source
sequence as the only argument.
"""
from __future__ import annotations
from abc import ABC, abstractmet... | 27.089613 | 108 | 0.618826 | from __future__ import annotations
from abc import ABC, abstractmethod
from typing import (
TYPE_CHECKING,
Any,
Callable,
Generator,
Iterable,
Iterator,
List,
Optional,
Protocol,
TypeVar,
Union,
cast,
get_origin,
overload,
)
from .error import EffectError
from .... | true | true |
1c2c52d5d734a20158e75ad1077782aa67773b86 | 3,867 | py | Python | tests/test_modules.py | m3g4p0p/jsonscript | 9f55c46bd75c5f55a6fa8235abeffa8e5d8ee31b | [
"MIT"
] | null | null | null | tests/test_modules.py | m3g4p0p/jsonscript | 9f55c46bd75c5f55a6fa8235abeffa8e5d8ee31b | [
"MIT"
] | null | null | null | tests/test_modules.py | m3g4p0p/jsonscript | 9f55c46bd75c5f55a6fa8235abeffa8e5d8ee31b | [
"MIT"
] | null | null | null | import json
import pytest
from jsonscript.interpreter import run
class TestModules:
@staticmethod
@pytest.fixture
def create_json(tmp_path):
def create(file_path, obj):
file = tmp_path / file_path
file.parent.mkdir(exist_ok=True, parents=True)
with open(file... | 23.723926 | 61 | 0.376519 | import json
import pytest
from jsonscript.interpreter import run
class TestModules:
@staticmethod
@pytest.fixture
def create_json(tmp_path):
def create(file_path, obj):
file = tmp_path / file_path
file.parent.mkdir(exist_ok=True, parents=True)
with open(file... | true | true |
1c2c52fb474a12cf3a58bc7c2fe1b5a2f5c53cbc | 3,267 | py | Python | address/migrations/0004_auto__add_field_address_extended_address__chg_field_address_street_add.py | jacinda/django-address | c9a351b20e29c4fa9841a4bda849befa68f1c3de | [
"BSD-3-Clause"
] | 2 | 2015-08-11T08:21:40.000Z | 2016-01-24T05:51:08.000Z | address/migrations/0004_auto__add_field_address_extended_address__chg_field_address_street_add.py | jacinda/django-address | c9a351b20e29c4fa9841a4bda849befa68f1c3de | [
"BSD-3-Clause"
] | null | null | null | address/migrations/0004_auto__add_field_address_extended_address__chg_field_address_street_add.py | jacinda/django-address | c9a351b20e29c4fa9841a4bda849befa68f1c3de | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Address.extended_address'
db.add_column(u'address_address', 'extended_address',
... | 59.4 | 154 | 0.561983 |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.add_column(u'address_address', 'extended_address',
self.gf('django.db.models.fields.CharField')(default='... | true | true |
1c2c53300bd2714dada7580fe3e104cfec20b37b | 11,723 | py | Python | tests/db_engine_specs/mssql_tests.py | psbsgic/rabbitai | 769e120ba605d56ac076f810a549c38dac410c8e | [
"Apache-2.0"
] | null | null | null | tests/db_engine_specs/mssql_tests.py | psbsgic/rabbitai | 769e120ba605d56ac076f810a549c38dac410c8e | [
"Apache-2.0"
] | null | null | null | tests/db_engine_specs/mssql_tests.py | psbsgic/rabbitai | 769e120ba605d56ac076f810a549c38dac410c8e | [
"Apache-2.0"
] | 1 | 2021-07-09T16:29:50.000Z | 2021-07-09T16:29:50.000Z | import unittest.mock as mock
from textwrap import dedent
from sqlalchemy import column, table
from sqlalchemy.dialects import mssql
from sqlalchemy.dialects.mssql import DATE, NTEXT, NVARCHAR, TEXT, VARCHAR
from sqlalchemy.sql import select
from sqlalchemy.types import String, UnicodeText
from rabbitai.db_engine_spec... | 39.738983 | 121 | 0.565981 | import unittest.mock as mock
from textwrap import dedent
from sqlalchemy import column, table
from sqlalchemy.dialects import mssql
from sqlalchemy.dialects.mssql import DATE, NTEXT, NVARCHAR, TEXT, VARCHAR
from sqlalchemy.sql import select
from sqlalchemy.types import String, UnicodeText
from rabbitai.db_engine_spec... | true | true |
1c2c533fd377e36d4c3a4e909727f095973d5a8e | 12,981 | py | Python | nuitka/nodes/AttributeNodes.py | ronnymajani/Nuitka | 0083a931e0bd085e4ac9991074b3b8bc05be52b1 | [
"Apache-2.0"
] | null | null | null | nuitka/nodes/AttributeNodes.py | ronnymajani/Nuitka | 0083a931e0bd085e4ac9991074b3b8bc05be52b1 | [
"Apache-2.0"
] | null | null | null | nuitka/nodes/AttributeNodes.py | ronnymajani/Nuitka | 0083a931e0bd085e4ac9991074b3b8bc05be52b1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | 33.199488 | 88 | 0.657191 |
from .ExpressionBases import (
ExpressionChildHavingBase,
ExpressionChildrenHavingBase,
)
from .NodeBases import StatementChildHavingBase, StatementChildrenHavingBase
from .NodeMakingHelpers import wrapExpressionWithNodeSideEffects
class StatementAssignmentAttribute(StatementChildrenHavingBa... | true | true |
1c2c5435cf1ab2a2633586653446fc7f3f8dc9f4 | 2,289 | py | Python | rusentrel/classic/ctx/att_hidden_z_yang.py | nicolay-r/attitude-extraction-with-attention-and-ds | fb8e9d0d9488363738a88c4c447c7a8cb3e2ec1d | [
"MIT"
] | null | null | null | rusentrel/classic/ctx/att_hidden_z_yang.py | nicolay-r/attitude-extraction-with-attention-and-ds | fb8e9d0d9488363738a88c4c447c7a8cb3e2ec1d | [
"MIT"
] | 1 | 2020-12-16T18:21:11.000Z | 2020-12-30T10:08:27.000Z | rusentrel/classic/ctx/att_hidden_z_yang.py | nicolay-r/attitude-extraction-with-attention-and-ds | fb8e9d0d9488363738a88c4c447c7a8cb3e2ec1d | [
"MIT"
] | 1 | 2021-03-29T20:58:26.000Z | 2021-03-29T20:58:26.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import tensorflow as tf
sys.path.append('../../../')
from io_utils import RuSentRelBasedExperimentsIOUtils
from arekit.contrib.networks.context.architectures.att_self_z_yang_bilstm import AttentionSelfZYangBiLSTM
from arekit.contrib.networks.context.configurations... | 43.188679 | 112 | 0.757536 |
import sys
import tensorflow as tf
sys.path.append('../../../')
from io_utils import RuSentRelBasedExperimentsIOUtils
from arekit.contrib.networks.context.architectures.att_self_z_yang_bilstm import AttentionSelfZYangBiLSTM
from arekit.contrib.networks.context.configurations.att_self_z_yang_bilstm import Attention... | true | true |
1c2c546cd2d3e521fb82afe1504f6f706a98dc6b | 59,591 | py | Python | tests/test_cloudformation/test_cloudformation_stack_crud_boto3.py | thrau/moto | 125aeea70ae8dad9f21545e34ae6214f696a8eb2 | [
"Apache-2.0"
] | null | null | null | tests/test_cloudformation/test_cloudformation_stack_crud_boto3.py | thrau/moto | 125aeea70ae8dad9f21545e34ae6214f696a8eb2 | [
"Apache-2.0"
] | 1 | 2021-09-13T04:39:03.000Z | 2021-09-13T04:39:03.000Z | tests/test_cloudformation/test_cloudformation_stack_crud_boto3.py | thrau/moto | 125aeea70ae8dad9f21545e34ae6214f696a8eb2 | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
import json
from collections import OrderedDict
from datetime import datetime, timedelta
import pytz
import boto3
from botocore.exceptions import ClientError, ValidationError
import sure # noqa
import pytest
from moto import mock_cloudformation, mock_dynamodb2, mock_s3, mock... | 35.094817 | 147 | 0.690222 | from __future__ import unicode_literals
import json
from collections import OrderedDict
from datetime import datetime, timedelta
import pytz
import boto3
from botocore.exceptions import ClientError, ValidationError
import sure
import pytest
from moto import mock_cloudformation, mock_dynamodb2, mock_s3, mock_sqs, ... | true | true |
1c2c55c0e9953e586f31be7674dab04396932620 | 2,783 | py | Python | jiant-russian-v2/setup.py | RussianNLP/RussianSuperGLUE | dafecf6f734835ba22cff5ea3ec2ff70cca3cd3c | [
"MIT"
] | 74 | 2020-06-11T11:37:57.000Z | 2022-03-07T09:44:05.000Z | jiant-russian-v2/setup.py | RussianNLP/RussianSuperGLUE | dafecf6f734835ba22cff5ea3ec2ff70cca3cd3c | [
"MIT"
] | 1 | 2020-06-11T12:08:50.000Z | 2020-12-15T10:51:50.000Z | jiant-russian-v2/setup.py | RussianNLP/RussianSuperGLUE | dafecf6f734835ba22cff5ea3ec2ff70cca3cd3c | [
"MIT"
] | 13 | 2020-06-18T11:53:19.000Z | 2022-03-23T17:15:44.000Z | """Setuptools package definition for PyPI/pip distribution
Dependencies will need to be updated in the "install_requires" of setup()
below. Those dependencies are used to create the CircleCI virtual environment.
These are generally the same dependencies as in environment.yml, but should be
limited to dependencies requ... | 33.939024 | 100 | 0.679123 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="jiant",
author="NYU Machine Learning for Language Group",
author_email="bowman@nyu.edu",
description="jiant is a software toolkit for natural language processing research, designed to \
fa... | true | true |
1c2c5656f8cb8cb081a07cb79d30fe7e82e2ac65 | 2,110 | py | Python | gbpservice/neutron/services/servicechain/plugins/ncp/node_drivers/dummy_driver.py | baodongli/group-based-policy | f3b892ecdc1051b204376e18679f73bf457ce7dc | [
"Apache-2.0"
] | null | null | null | gbpservice/neutron/services/servicechain/plugins/ncp/node_drivers/dummy_driver.py | baodongli/group-based-policy | f3b892ecdc1051b204376e18679f73bf457ce7dc | [
"Apache-2.0"
] | null | null | null | gbpservice/neutron/services/servicechain/plugins/ncp/node_drivers/dummy_driver.py | baodongli/group-based-policy | f3b892ecdc1051b204376e18679f73bf457ce7dc | [
"Apache-2.0"
] | null | null | null | # 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, software
# d... | 26.708861 | 78 | 0.693839 |
from oslo_log import helpers as log
from gbpservice.neutron.services.servicechain.plugins.ncp import driver_base
class NoopNodeDriver(driver_base.NodeDriverBase):
initialized = False
@log.log_method_call
def initialize(self, name):
self.initialized = True
self._name = name
... | true | true |
1c2c572a8c7ab69a86c0a51ef94ba47c41f04215 | 621 | py | Python | tasks/migrations/0001_initial.py | akshaygepl1/NewTodoApp | 87b697bd1e454279aa329154ec72ba8e9a40c4e6 | [
"MIT"
] | null | null | null | tasks/migrations/0001_initial.py | akshaygepl1/NewTodoApp | 87b697bd1e454279aa329154ec72ba8e9a40c4e6 | [
"MIT"
] | null | null | null | tasks/migrations/0001_initial.py | akshaygepl1/NewTodoApp | 87b697bd1e454279aa329154ec72ba8e9a40c4e6 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.8 on 2020-07-30 09:08
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Task',
fields=[
('id', models.AutoField(aut... | 25.875 | 114 | 0.57649 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Task',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=Fal... | true | true |
1c2c593c533af0bcc8d96984fc534b7dcc96e506 | 19,656 | py | Python | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/protocols.py | Vibaswan/ixnetwork_restpy | 239fedc7050890746cbabd71ea1e91c68d9e5cad | [
"MIT"
] | null | null | null | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/protocols.py | Vibaswan/ixnetwork_restpy | 239fedc7050890746cbabd71ea1e91c68d9e5cad | [
"MIT"
] | null | null | null | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/protocols.py | Vibaswan/ixnetwork_restpy | 239fedc7050890746cbabd71ea1e91c68d9e5cad | [
"MIT"
] | null | null | null | # MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify,... | 38.315789 | 165 | 0.661172 |
from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
class Protocols(Base):
__slots__ = ()
_SDM_NAME = 'protocols'
_SDM_ATT_MAP = {
'ProtocolMaxNodeCount': 'protocolMaxNodeCount',
}
def __init__(self, parent):
super(Protocols, self)... | true | true |
1c2c59574a1b63bcdd79eda9edb55687ab1f37bd | 9,787 | py | Python | pgn_read/samples/_utilities.py | RogerMarsh/pgn-read | 514031110afcdcda29bb769f532e0993525abc85 | [
"BSD-3-Clause"
] | 2 | 2021-02-21T07:13:48.000Z | 2021-02-25T21:50:15.000Z | pgn_read/samples/_utilities.py | RogerMarsh/pgn-read | 514031110afcdcda29bb769f532e0993525abc85 | [
"BSD-3-Clause"
] | null | null | null | pgn_read/samples/_utilities.py | RogerMarsh/pgn-read | 514031110afcdcda29bb769f532e0993525abc85 | [
"BSD-3-Clause"
] | 1 | 2021-02-21T14:47:29.000Z | 2021-02-21T14:47:29.000Z | # _utilities.py
# Copyright 2020 Roger Marsh
# Licence: See LICENCE (BSD licence)
"""Utilities to run a sample module."""
import tkinter
import tkinter.ttk
import tkinter.filedialog
import tkinter.messagebox
import os
import time
from ..core.parser import PGN
from ..core.game import generate_fen_for_position
def r... | 35.33213 | 79 | 0.547154 |
import tkinter
import tkinter.ttk
import tkinter.filedialog
import tkinter.messagebox
import os
import time
from ..core.parser import PGN
from ..core.game import generate_fen_for_position
def read_pgn(filename, game_class=None, size=10000000):
game_ok_count = 0
game_not_ok_count = 0
game_ok_token_co... | true | true |
1c2c5a98edc05a4e7efc4472c00d75f91a63068e | 4,786 | py | Python | sdk/python/pulumi_azure_nextgen/sql/v20200801preview/_inputs.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/sql/v20200801preview/_inputs.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/sql/v20200801preview/_inputs.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__a... | 33.468531 | 144 | 0.619933 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__all__ = [
'ElasticPoolPerDatabaseSettingsArgs',
'SkuArgs',
]
@pulumi.input_type
class ElasticPoolPerDatabaseSettingsArgs:
def __init__(__self__, *,
... | true | true |
1c2c5bf02958a264687eb3a041c1006eb85b72bd | 2,058 | py | Python | competition/portfolio.py | xfuzzycomp/FuzzyChallenge2021 | 5876450fdb913c6707352bfe9fcc25748f041f52 | [
"MIT"
] | null | null | null | competition/portfolio.py | xfuzzycomp/FuzzyChallenge2021 | 5876450fdb913c6707352bfe9fcc25748f041f52 | [
"MIT"
] | null | null | null | competition/portfolio.py | xfuzzycomp/FuzzyChallenge2021 | 5876450fdb913c6707352bfe9fcc25748f041f52 | [
"MIT"
] | null | null | null | from competition.scenarios import *
portfolio = [
threat_test_1,
threat_test_2,
threat_test_3,
threat_test_4,
accuracy_test_1,
accuracy_test_2,
accuracy_test_3,
accuracy_test_4,
accuracy_test_5,
accuracy_test_6,
accuracy_test_7,
accuracy_test_8,
accuracy_test_9,
... | 20.787879 | 78 | 0.729349 | from competition.scenarios import *
portfolio = [
threat_test_1,
threat_test_2,
threat_test_3,
threat_test_4,
accuracy_test_1,
accuracy_test_2,
accuracy_test_3,
accuracy_test_4,
accuracy_test_5,
accuracy_test_6,
accuracy_test_7,
accuracy_test_8,
accuracy_test_9,
... | true | true |
1c2c5c765623036e293e8c37573a07c2f79363f7 | 27,063 | py | Python | girderformindlogger/models/user.py | shnizzedy/mindlogger-app-backend | a8ba865af82fc95fa3fcc4251afb8a0d22e63cc3 | [
"Apache-2.0"
] | null | null | null | girderformindlogger/models/user.py | shnizzedy/mindlogger-app-backend | a8ba865af82fc95fa3fcc4251afb8a0d22e63cc3 | [
"Apache-2.0"
] | null | null | null | girderformindlogger/models/user.py | shnizzedy/mindlogger-app-backend | a8ba865af82fc95fa3fcc4251afb8a0d22e63cc3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime
import os
import re
from passlib.context import CryptContext
from passlib.totp import TOTP, TokenError
import six
from girderformindlogger import events
from girderformindlogger.constants import AccessType, CoreEventHandler, TokenScope
from girderformindlogger.exceptions import ... | 37.797486 | 104 | 0.586409 |
import datetime
import os
import re
from passlib.context import CryptContext
from passlib.totp import TOTP, TokenError
import six
from girderformindlogger import events
from girderformindlogger.constants import AccessType, CoreEventHandler, TokenScope
from girderformindlogger.exceptions import AccessException, Valida... | true | true |
1c2c5cd62e42cd0bc8971612062aac4c733a7a57 | 466 | py | Python | Apps/contatos/migrations/0021_alter_chat_data.py | arthur-asilva/rc_plataforma | 7e6f7eb7f9a3b9089c02db98518b60d8e481ce4c | [
"BSD-2-Clause"
] | null | null | null | Apps/contatos/migrations/0021_alter_chat_data.py | arthur-asilva/rc_plataforma | 7e6f7eb7f9a3b9089c02db98518b60d8e481ce4c | [
"BSD-2-Clause"
] | null | null | null | Apps/contatos/migrations/0021_alter_chat_data.py | arthur-asilva/rc_plataforma | 7e6f7eb7f9a3b9089c02db98518b60d8e481ce4c | [
"BSD-2-Clause"
] | null | null | null | # Generated by Django 4.0 on 2022-02-24 18:48
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contatos', '0020_alter_chat_data'),
]
operations = [
migrations.AlterField(
model_name='chat',
name='d... | 23.3 | 122 | 0.620172 |
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contatos', '0020_alter_chat_data'),
]
operations = [
migrations.AlterField(
model_name='chat',
name='data',
field=models.DateTimeField(... | true | true |
1c2c5cec8efd1af9f39dda1bf64c9fd122edf367 | 2,568 | py | Python | virtual/lib/python3.8/site-packages/pylint/extensions/emptystring.py | erastus-1/GramApp | d926a8a894b5dc673d077b35f9df867dab737372 | [
"MIT"
] | 10 | 2021-05-31T07:18:08.000Z | 2022-03-19T09:20:11.000Z | virtual/lib/python3.8/site-packages/pylint/extensions/emptystring.py | erastus-1/GramApp | d926a8a894b5dc673d077b35f9df867dab737372 | [
"MIT"
] | 10 | 2020-09-30T12:49:45.000Z | 2020-10-04T10:26:33.000Z | virtual/lib/python3.8/site-packages/pylint/extensions/emptystring.py | erastus-1/GramApp | d926a8a894b5dc673d077b35f9df867dab737372 | [
"MIT"
] | 7 | 2021-03-15T13:39:20.000Z | 2022-03-29T12:08:21.000Z | # Copyright (c) 2016 Alexander Todorov <atodorov@otb.bg>
# Copyright (c) 2017-2018, 2020 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2019 Pierre Sassoulas <pierre.sassoulas@gmail.com>
# Copyright (c) 2020 Anthony Sottile <asottile@umich.edu>
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/... | 33.789474 | 85 | 0.648754 |
import itertools
import astroid
from pylint import checkers, interfaces
from pylint.checkers import utils
def _is_constant_empty_str(node):
return isinstance(node, astroid.Const) and node.value == ""
class CompareToEmptyStringChecker(checkers.BaseChecker):
__implements__ = (interfaces.IAstroidCh... | true | true |
1c2c5e5c68e34865d3a608d0d05b86301c5d6ffe | 2,661 | py | Python | app/recipe/tests/test_tags_api.py | JDuskey/recipe-app-api | 911c892b57fcfe62b9ba7fa74f3b7c998d0b7918 | [
"MIT"
] | null | null | null | app/recipe/tests/test_tags_api.py | JDuskey/recipe-app-api | 911c892b57fcfe62b9ba7fa74f3b7c998d0b7918 | [
"MIT"
] | null | null | null | app/recipe/tests/test_tags_api.py | JDuskey/recipe-app-api | 911c892b57fcfe62b9ba7fa74f3b7c998d0b7918 | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Tag
from recipe.serializers import TagSerializer
TAGS_URL = reverse('recipe:tag-list')
class PublicTa... | 30.238636 | 76 | 0.652011 | from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Tag
from recipe.serializers import TagSerializer
TAGS_URL = reverse('recipe:tag-list')
class PublicTa... | true | true |
1c2c5e911abaf13e56c422deb67ffab421752834 | 4,993 | py | Python | scripts/mo.py | aafulei/leetcode | e3a0ef9c912abf99a1d6e56eff8802ba44b0057d | [
"MIT"
] | 2 | 2019-04-13T09:55:04.000Z | 2019-05-16T12:47:40.000Z | scripts/mo.py | aafulei/leetcode | e3a0ef9c912abf99a1d6e56eff8802ba44b0057d | [
"MIT"
] | null | null | null | scripts/mo.py | aafulei/leetcode | e3a0ef9c912abf99a1d6e56eff8802ba44b0057d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# 22/06/03 = Fri
# 22/05/27 = Fri
# -----------------
# Markdown Outliner
# -----------------
# A Python module that support the LeetCode Information Tracker. It reads and
# understands a markdown document.
import bisect
import io
import os
import sys
class Section:
def __init__(self, l... | 27.434066 | 77 | 0.527939 |
import bisect
import io
import os
import sys
class Section:
def __init__(self, level=0, name="", father=None, children=None):
self.level = level
self.name = name
self.father = father
self.children = [] if not children else children
def __iter__(self):
retur... | true | true |
1c2c5fb1897434edf813ca11fee52e66fc56491b | 458 | py | Python | mspyteams/aiohttp.py | sander76/mspyteams | b8755afe8533fd1b9c059ca5d176b335f8070310 | [
"MIT"
] | null | null | null | mspyteams/aiohttp.py | sander76/mspyteams | b8755afe8533fd1b9c059ca5d176b335f8070310 | [
"MIT"
] | null | null | null | mspyteams/aiohttp.py | sander76/mspyteams | b8755afe8533fd1b9c059ca5d176b335f8070310 | [
"MIT"
] | null | null | null | """Send card using aiohttp"""
import logging
from typing import TYPE_CHECKING
import aiohttp
if TYPE_CHECKING:
from mspyteams.card import Card
_LOGGER = logging.getLogger(__name__)
async def send(card: "Card", webhook_url, session: aiohttp.ClientSession):
"""Send the card to the teams webhook."""
data ... | 25.444444 | 74 | 0.735808 |
import logging
from typing import TYPE_CHECKING
import aiohttp
if TYPE_CHECKING:
from mspyteams.card import Card
_LOGGER = logging.getLogger(__name__)
async def send(card: "Card", webhook_url, session: aiohttp.ClientSession):
data = card.card_data()
async with session.post(webhook_url, json=data) as re... | true | true |
1c2c612e60bb50ea7a694d80419862366ba69591 | 2,514 | py | Python | gmprocess/io/asdf/utils.py | baagaard-usgs/groundmotion-processing | 6be2b4460d598bba0935135efa85af2655578565 | [
"Unlicense"
] | 54 | 2019-01-12T02:05:38.000Z | 2022-03-29T19:43:56.000Z | gmprocess/io/asdf/utils.py | baagaard-usgs/groundmotion-processing | 6be2b4460d598bba0935135efa85af2655578565 | [
"Unlicense"
] | 700 | 2018-12-18T19:44:31.000Z | 2022-03-30T20:54:28.000Z | gmprocess/io/asdf/utils.py | baagaard-usgs/groundmotion-processing | 6be2b4460d598bba0935135efa85af2655578565 | [
"Unlicense"
] | 41 | 2018-11-29T23:17:56.000Z | 2022-03-31T04:04:23.000Z | """Utilities for simple operations on an ASDF workspace.
"""
# third party imports
import h5py
class TallyStorage(object):
"""Tally storage used within each group."""
def __init__(self, group_detail=None):
"""Constructor.
Args:
group_detail (list):
List of group ... | 31.822785 | 78 | 0.536993 |
import h5py
class TallyStorage(object):
def __init__(self, group_detail=None):
self.group_detail = group_detail if group_detail else []
return
@staticmethod
def compute_dataset_storage(dataset):
assert isinstance(dataset, h5py.Dataset)
return dataset.size * dataset.dtyp... | true | true |
1c2c615b05e64ea5edd0451a394a00de6035afd7 | 5,596 | py | Python | macro_benchmark/WideDeep/census_test.py | songhappy/ai-matrix | 901078e480c094235c721c49f8141aec7a84e70e | [
"Apache-2.0"
] | 180 | 2018-09-20T07:27:40.000Z | 2022-03-19T07:55:42.000Z | macro_benchmark/WideDeep/census_test.py | songhappy/ai-matrix | 901078e480c094235c721c49f8141aec7a84e70e | [
"Apache-2.0"
] | 80 | 2018-09-26T18:55:56.000Z | 2022-02-10T02:03:26.000Z | macro_benchmark/WideDeep/census_test.py | songhappy/ai-matrix | 901078e480c094235c721c49f8141aec7a84e70e | [
"Apache-2.0"
] | 72 | 2018-08-30T00:49:15.000Z | 2022-02-15T23:22:40.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 34.54321 | 80 | 0.682809 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import tensorflow as tf
from utils.testing import integration
import census_dataset
import census_main
import wide_deep_run_loop
tf.logging.set_verbosity(tf.logging.ERROR)
TEST_IN... | true | true |
1c2c61708ea7a4fbdd8343ddaced6398fa026d2a | 8,750 | py | Python | base-LASED/build/lib/LASED/time_evolution_matrix.py | mvpmanish/LASED | 7793037b3e77ee9205f631d7ff6c511895108400 | [
"MIT"
] | 7 | 2021-06-07T14:58:01.000Z | 2022-03-24T18:08:13.000Z | base-LASED/LASED/.ipynb_checkpoints/time_evolution_matrix-checkpoint.py | mvpmanish/LASED | 7793037b3e77ee9205f631d7ff6c511895108400 | [
"MIT"
] | 13 | 2021-06-07T14:15:54.000Z | 2022-03-29T11:06:10.000Z | base-LASED/LASED/time_evolution_matrix.py | mvpmanish/LASED | 7793037b3e77ee9205f631d7ff6c511895108400 | [
"MIT"
] | 2 | 2021-12-09T06:31:23.000Z | 2022-03-18T17:29:48.000Z | '''
This is a file to define a function to populate the time evolution matrix for a laser-atom system
Author: Manish Patel
Date created: 12/05/2021
'''
from LASED.state import *
from LASED.detuning import *
from LASED.symbolic_print import *
from LASED.half_rabi_freq import *
from LASED.decay_constant import *
from LA... | 49.157303 | 173 | 0.543886 |
from LASED.state import *
from LASED.detuning import *
from LASED.symbolic_print import *
from LASED.half_rabi_freq import *
from LASED.decay_constant import *
from LASED.index import *
from sympy import *
from sympy import Symbol
import numpy as np
def timeEvolutionMatrix(n, E, G, Q, Q_decay, tau, laser_wavelength,... | true | true |
1c2c620fe4e04f19a92c2ab7051646f1df26af3b | 23,267 | py | Python | bdgym/envs/driver_assistant/policy.py | RDLLab/benevolent-deception-gym | 4d04e097609097e0f07c661aac221184ebdec2fe | [
"MIT"
] | null | null | null | bdgym/envs/driver_assistant/policy.py | RDLLab/benevolent-deception-gym | 4d04e097609097e0f07c661aac221184ebdec2fe | [
"MIT"
] | null | null | null | bdgym/envs/driver_assistant/policy.py | RDLLab/benevolent-deception-gym | 4d04e097609097e0f07c661aac221184ebdec2fe | [
"MIT"
] | null | null | null | """Driver Policies for the Driver Assistant Environment """
from copy import deepcopy
from typing import Tuple, Optional, List, Dict
import numpy as np
from highway_env.utils import not_zero, do_every
from highway_env.types import Vector
from highway_env.road.lane import AbstractLane
from highway_env.envs.common.acti... | 37.588045 | 79 | 0.614261 | from copy import deepcopy
from typing import Tuple, Optional, List, Dict
import numpy as np
from highway_env.utils import not_zero, do_every
from highway_env.types import Vector
from highway_env.road.lane import AbstractLane
from highway_env.envs.common.action import Action
from highway_env.vehicle.kinematics import ... | true | true |
1c2c635271b21d5a400449f0ebcfa562d6bb73e8 | 6,582 | py | Python | qa/rpc-tests/txn_doublespend.py | raasakh/beenode | b28e026ab14059c5774a13210e65e376725c82ad | [
"MIT"
] | null | null | null | qa/rpc-tests/txn_doublespend.py | raasakh/beenode | b28e026ab14059c5774a13210e65e376725c82ad | [
"MIT"
] | null | null | null | qa/rpc-tests/txn_doublespend.py | raasakh/beenode | b28e026ab14059c5774a13210e65e376725c82ad | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test proper accounting with a double-spend conflict
#
from test_framework.test_framework import Bitc... | 46.027972 | 111 | 0.609389 |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
class TxnMallTest(BitcoinTestFramework):
def add_options(self, parser):
parser.add_option("--mineblock", dest="mine_block", default=False, action="store_true",
help="Test dou... | true | true |
1c2c63f5b27e9b7d657b53a9fba7139c1916373d | 3,314 | py | Python | app/app/settings.py | dilnawaz07/recipe-app-api | bc6fe1693d5117390461f09a902dc6799c975b71 | [
"MIT"
] | null | null | null | app/app/settings.py | dilnawaz07/recipe-app-api | bc6fe1693d5117390461f09a902dc6799c975b71 | [
"MIT"
] | null | null | null | app/app/settings.py | dilnawaz07/recipe-app-api | bc6fe1693d5117390461f09a902dc6799c975b71 | [
"MIT"
] | null | null | null | """
Django settings for app project.
Generated by 'django-admin startproject' using Django 2.1.15.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
# Bu... | 25.492308 | 91 | 0.687085 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'u*g%p(%4(b&4dq)yh$1gw_cv3cag-=pqicw(q1y47_0_56pyt$'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
1c2c6486806e2c5d1e0bf1b01c8c40c028b80544 | 5,091 | py | Python | nose/test_pearl.py | finn-dodgson/DeepHalos | 86e0ac6c24ac97a0a2a0a60a7ea3721a04bd050c | [
"MIT"
] | 2 | 2021-07-26T10:56:33.000Z | 2021-12-20T17:30:53.000Z | nose/test_pearl.py | finn-dodgson/DeepHalos | 86e0ac6c24ac97a0a2a0a60a7ea3721a04bd050c | [
"MIT"
] | 1 | 2021-11-25T21:01:19.000Z | 2021-12-05T01:40:53.000Z | nose/test_pearl.py | finn-dodgson/DeepHalos | 86e0ac6c24ac97a0a2a0a60a7ea3721a04bd050c | [
"MIT"
] | 1 | 2021-11-27T02:35:10.000Z | 2021-11-27T02:35:10.000Z | import sys
sys.path.append("/home/luisals/DeepHalos")
from dlhalos_code import CNN
from dlhalos_code import custom_regularizers as reg
import dlhalos_code.data_processing as tn
from dlhalos_code import evaluation as evalu
from pickle import dump, load
import numpy as np
import os
########### CREATE GENERATORS FOR TRAI... | 48.028302 | 121 | 0.607739 | import sys
sys.path.append("/home/luisals/DeepHalos")
from dlhalos_code import CNN
from dlhalos_code import custom_regularizers as reg
import dlhalos_code.data_processing as tn
from dlhalos_code import evaluation as evalu
from pickle import dump, load
import numpy as np
import os
random_subset_each_sim... | true | true |
1c2c64d2b856540aff814af4368f6379ad600b93 | 1,598 | py | Python | Numpy XOR/Tensor_ImageRecognition.py | chaseaucoin/Neural-Primer | d5163af8cd74ea5cea620069dffca8c124bffc05 | [
"MIT"
] | 1 | 2017-08-07T04:45:53.000Z | 2017-08-07T04:45:53.000Z | Numpy XOR/Tensor_ImageRecognition.py | chaseaucoin/Neural-Primer | d5163af8cd74ea5cea620069dffca8c124bffc05 | [
"MIT"
] | null | null | null | Numpy XOR/Tensor_ImageRecognition.py | chaseaucoin/Neural-Primer | d5163af8cd74ea5cea620069dffca8c124bffc05 | [
"MIT"
] | null | null | null | from tensorflow.examples.tutorials.mnist import input_data
#Get The MNIST Data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
import tensorflow as tf
# Create the model
inputs = tf.placeholder(tf.float32, [None, 784])
weights = tf.Variable(tf.zeros([784, 10]))
biases = tf.Variable(tf.zeros(... | 37.162791 | 96 | 0.706508 | from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
import tensorflow as tf
inputs = tf.placeholder(tf.float32, [None, 784])
weights = tf.Variable(tf.zeros([784, 10]))
biases = tf.Variable(tf.zeros([10]))
predictions = tf.matmul(inputs,... | true | true |
1c2c652f3bebe66d5eab4b30dfd527aeb1c21307 | 252 | py | Python | contest/abc084/B.py | mola1129/atcoder | 1d3b18cb92d0ba18c41172f49bfcd0dd8d29f9db | [
"MIT"
] | null | null | null | contest/abc084/B.py | mola1129/atcoder | 1d3b18cb92d0ba18c41172f49bfcd0dd8d29f9db | [
"MIT"
] | null | null | null | contest/abc084/B.py | mola1129/atcoder | 1d3b18cb92d0ba18c41172f49bfcd0dd8d29f9db | [
"MIT"
] | null | null | null | a, b = map(int, input().split())
s = input()
if len(s) == a + b + 1 and s[a] == '-':
for i in range(len(s)):
if i != a and not ('0' <= s[i] and s[i] <= '9'):
print('No')
exit()
print('Yes')
else:
print('No')
| 22.909091 | 56 | 0.404762 | a, b = map(int, input().split())
s = input()
if len(s) == a + b + 1 and s[a] == '-':
for i in range(len(s)):
if i != a and not ('0' <= s[i] and s[i] <= '9'):
print('No')
exit()
print('Yes')
else:
print('No')
| true | true |
1c2c659cd569322139014dd69e52efc1ae242aa0 | 3,339 | py | Python | test/test_simple/test_multiswitch.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | test/test_simple/test_multiswitch.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | test/test_simple/test_multiswitch.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | # -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2022 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the t... | 33.727273 | 79 | 0.648997 |
import mock
from nicos.core import ConfigurationError, InvalidValueError, LimitError, \
NicosError, PositionError, status
from test.utils import raises
session_setup = 'multiswitch'
def test_multi_switcher(session):
sc1 = session.getDevice('sc1')
x = session.getDevice('x')
... | true | true |
1c2c6644942a06b5e2cb6058c9c5629cf6809176 | 2,524 | py | Python | pkgs/grep_p2/grep_p2.py | Morphux/installer | a26419838fcfc156a93a42c1516157e2aae54d9c | [
"Apache-2.0"
] | null | null | null | pkgs/grep_p2/grep_p2.py | Morphux/installer | a26419838fcfc156a93a42c1516157e2aae54d9c | [
"Apache-2.0"
] | null | null | null | pkgs/grep_p2/grep_p2.py | Morphux/installer | a26419838fcfc156a93a42c1516157e2aae54d9c | [
"Apache-2.0"
] | null | null | null | ################################### LICENSE ####################################
# Copyright 2016 Morphux #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); ... | 40.709677 | 90 | 0.442155 | true | true | |
1c2c664cd146ce55db4b181d0f81c3dcacfa2a68 | 26,955 | py | Python | flaml/model.py | dan0nchik/FLAML | 9d661759b49de6e403d9288af7a015606528fe7e | [
"Apache-2.0"
] | null | null | null | flaml/model.py | dan0nchik/FLAML | 9d661759b49de6e403d9288af7a015606528fe7e | [
"Apache-2.0"
] | null | null | null | flaml/model.py | dan0nchik/FLAML | 9d661759b49de6e403d9288af7a015606528fe7e | [
"Apache-2.0"
] | null | null | null | '''!
* Copyright (c) 2020-2021 Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
'''
import numpy as np
import xgboost as xgb
import time
from sklearn.ensemble import RandomForestRegressor, RandomForestClassifier
from sklearn.ensemble import ExtraTreesRegressor, ExtraTreesClassi... | 36.036096 | 81 | 0.551475 |
import numpy as np
import xgboost as xgb
import time
from sklearn.ensemble import RandomForestRegressor, RandomForestClassifier
from sklearn.ensemble import ExtraTreesRegressor, ExtraTreesClassifier
from sklearn.linear_model import LogisticRegression
from lightgbm import LGBMClassifier, LGBMRegressor
from scip... | true | true |
1c2c67ee1b5f4c5fbb03ab10efcc9133f3946fa0 | 843 | py | Python | metarecord/migrations/0036_add_classification_function_allowed.py | kerkkoheiskanen/helerm | bdaf801a940d42325a1076b42bb0edef831fbac9 | [
"MIT"
] | 2 | 2017-04-21T15:36:23.000Z | 2020-12-04T09:32:39.000Z | metarecord/migrations/0036_add_classification_function_allowed.py | kerkkoheiskanen/helerm | bdaf801a940d42325a1076b42bb0edef831fbac9 | [
"MIT"
] | 168 | 2016-10-05T12:58:41.000Z | 2021-08-31T14:29:56.000Z | metarecord/migrations/0036_add_classification_function_allowed.py | kerkkoheiskanen/helerm | bdaf801a940d42325a1076b42bb0edef831fbac9 | [
"MIT"
] | 7 | 2016-10-13T12:51:36.000Z | 2021-01-21T13:05:04.000Z | # Generated by Django 2.0.1 on 2018-01-12 12:04
from django.db import migrations, models
def populate_function_allowed(apps, schema_editor):
Classification = apps.get_model('metarecord', 'Classification')
for classification in Classification.objects.all():
classification.function_allowed = not class... | 30.107143 | 86 | 0.699881 |
from django.db import migrations, models
def populate_function_allowed(apps, schema_editor):
Classification = apps.get_model('metarecord', 'Classification')
for classification in Classification.objects.all():
classification.function_allowed = not classification.children.exists()
classificat... | true | true |
1c2c68c004e78ae9ce7a1151915aa845b798f605 | 1,051 | py | Python | toontown/ai/DistributedBlackCatMgrAI.py | CrankySupertoon01/Toontown-2 | 60893d104528a8e7eb4aced5d0015f22e203466d | [
"MIT"
] | 1 | 2021-02-13T22:40:50.000Z | 2021-02-13T22:40:50.000Z | toontown/ai/DistributedBlackCatMgrAI.py | CrankySupertoonArchive/Toontown-2 | 60893d104528a8e7eb4aced5d0015f22e203466d | [
"MIT"
] | 1 | 2018-07-28T20:07:04.000Z | 2018-07-30T18:28:34.000Z | toontown/ai/DistributedBlackCatMgrAI.py | CrankySupertoonArchive/Toontown-2 | 60893d104528a8e7eb4aced5d0015f22e203466d | [
"MIT"
] | 2 | 2019-12-02T01:39:10.000Z | 2021-02-13T22:41:00.000Z | from direct.directnotify import DirectNotifyGlobal
from direct.distributed.DistributedObjectAI import DistributedObjectAI
from toontown.toon.ToonDNA import ToonDNA
from toontown.toonbase import ToontownGlobals
class DistributedBlackCatMgrAI(DistributedObjectAI):
notify = DirectNotifyGlobal.directNotify.newCategory... | 43.791667 | 113 | 0.743102 | from direct.directnotify import DirectNotifyGlobal
from direct.distributed.DistributedObjectAI import DistributedObjectAI
from toontown.toon.ToonDNA import ToonDNA
from toontown.toonbase import ToontownGlobals
class DistributedBlackCatMgrAI(DistributedObjectAI):
notify = DirectNotifyGlobal.directNotify.newCategory... | true | true |
1c2c68cda1ba5abb7f297c0c2cbabf3c195e892b | 202 | py | Python | examples/HelloWorld.py | piotrmaslanka/systemy | fff963cb9622f6a449524bea2ee10bb9503bcaa6 | [
"MIT"
] | null | null | null | examples/HelloWorld.py | piotrmaslanka/systemy | fff963cb9622f6a449524bea2ee10bb9503bcaa6 | [
"MIT"
] | null | null | null | examples/HelloWorld.py | piotrmaslanka/systemy | fff963cb9622f6a449524bea2ee10bb9503bcaa6 | [
"MIT"
] | 1 | 2021-11-28T09:52:04.000Z | 2021-11-28T09:52:04.000Z | from yos.rt import BaseTasklet
from yos.tasklets import Tasklet
from yos.io import NetworkSocket
class HelloWorldTasklet(BaseTasklet):
def on_startup(self):
print('Hello World!')
| 20.2 | 37 | 0.727723 | from yos.rt import BaseTasklet
from yos.tasklets import Tasklet
from yos.io import NetworkSocket
class HelloWorldTasklet(BaseTasklet):
def on_startup(self):
print('Hello World!')
| true | true |
1c2c696274b2d93fa0051a0dbadbbce7c014e570 | 1,384 | py | Python | web/books/management/commands/books.py | hdknr/django-books | b4bf6d144240edc4bcfc94180377adaadc9e533c | [
"MIT"
] | null | null | null | web/books/management/commands/books.py | hdknr/django-books | b4bf6d144240edc4bcfc94180377adaadc9e533c | [
"MIT"
] | null | null | null | web/books/management/commands/books.py | hdknr/django-books | b4bf6d144240edc4bcfc94180377adaadc9e533c | [
"MIT"
] | null | null | null | from django.utils import translation ,timezone
from django.conf import settings
from datetime import datetime, time, timedelta
import djclick as click
from logging import getLogger
from collections import OrderedDict
import requests
import yaml
import os
import uuid
import itertools
from books import models
log = getLo... | 22.688525 | 77 | 0.732659 | from django.utils import translation ,timezone
from django.conf import settings
from datetime import datetime, time, timedelta
import djclick as click
from logging import getLogger
from collections import OrderedDict
import requests
import yaml
import os
import uuid
import itertools
from books import models
log = getLo... | true | true |
1c2c6a527f99317b1fa4a91b5989f19c6b3bc987 | 5,605 | py | Python | survival_evaluation/evaluations.py | haiderstats/survival_evaluation | 70e3a4d530a61549609689e3ebd80818f3ab14d9 | [
"MIT"
] | 4 | 2021-03-02T00:33:22.000Z | 2021-10-06T12:33:19.000Z | survival_evaluation/evaluations.py | haiderstats/survival_evaluation | 70e3a4d530a61549609689e3ebd80818f3ab14d9 | [
"MIT"
] | null | null | null | survival_evaluation/evaluations.py | haiderstats/survival_evaluation | 70e3a4d530a61549609689e3ebd80818f3ab14d9 | [
"MIT"
] | null | null | null | from typing import Optional
import numpy as np # type: ignore
from scipy.stats import chi2 # type: ignore
from survival_evaluation.types import NumericArrayLike
from survival_evaluation.utility import (
KaplanMeier,
KaplanMeierArea,
to_array,
validate_size,
)
# pylint: disable=too-many-arguments
d... | 36.633987 | 88 | 0.70116 | from typing import Optional
import numpy as np
from scipy.stats import chi2
from survival_evaluation.types import NumericArrayLike
from survival_evaluation.utility import (
KaplanMeier,
KaplanMeierArea,
to_array,
validate_size,
)
def l1(
event_times: NumericArrayLike,
event_indicators: ... | true | true |
1c2c6a9b7cfebf83a0d807beb46af8faed3075a5 | 8,978 | py | Python | plugin/plugins/network/check_ibm_san_directors_crcs.py | crazy-canux/xPlugin_Monitoring | 4a66d26f9d2982609489eaa0f57d6afb16aca37c | [
"Apache-2.0"
] | 2 | 2015-12-17T04:00:30.000Z | 2015-12-22T11:49:01.000Z | plugin/plugins/network/check_ibm_san_directors_crcs.py | crazy-canux/xPlugin_Monitoring | 4a66d26f9d2982609489eaa0f57d6afb16aca37c | [
"Apache-2.0"
] | null | null | null | plugin/plugins/network/check_ibm_san_directors_crcs.py | crazy-canux/xPlugin_Monitoring | 4a66d26f9d2982609489eaa0f57d6afb16aca37c | [
"Apache-2.0"
] | 1 | 2017-02-20T22:57:17.000Z | 2017-02-20T22:57:17.000Z | #!/usr/bin/env python2.7
# -*- coding: UTF-8 -*-
#===============================================================================
# Name : check_ibm_san_directors_crcs.py
# Authors : Canux CHENG <canuxcheng@gmail.com>
# Description : Check IBM SAN Directors for CRCs on ports.
#-------------------------... | 37.099174 | 118 | 0.597349 |
import logging as log
from pprint import pformat
import traceback
from time import time
from datetime import datetime
import math
from shared import __version__
from monitoring.nagios.plugin import NagiosPluginSNMP
logger = log.getLogger('plugin')
class IBMSanDirectorsCRC(NagiosPluginSNMP):
... | true | true |
1c2c6b4afff1c3c11a4c616543565ad5bc21a643 | 11,347 | py | Python | tests/auth_tests/test_validators.py | Fak3/django | 1ae8014a0bbae0cc1d951c1ee0f7888b6141f582 | [
"PSF-2.0",
"BSD-3-Clause"
] | 19 | 2015-07-07T02:08:59.000Z | 2021-11-08T11:05:40.000Z | tests/auth_tests/test_validators.py | Fak3/django | 1ae8014a0bbae0cc1d951c1ee0f7888b6141f582 | [
"PSF-2.0",
"BSD-3-Clause"
] | 2 | 2020-03-13T18:15:37.000Z | 2020-03-16T18:33:38.000Z | tests/auth_tests/test_validators.py | Fak3/django | 1ae8014a0bbae0cc1d951c1ee0f7888b6141f582 | [
"PSF-2.0",
"BSD-3-Clause"
] | 145 | 2019-03-14T18:54:45.000Z | 2022-03-04T20:25:31.000Z | import os
from django.contrib.auth import validators
from django.contrib.auth.models import User
from django.contrib.auth.password_validation import (
CommonPasswordValidator, MinimumLengthValidator, NumericPasswordValidator,
UserAttributeSimilarityValidator, get_default_password_validators,
get_password_v... | 43.30916 | 110 | 0.689345 | import os
from django.contrib.auth import validators
from django.contrib.auth.models import User
from django.contrib.auth.password_validation import (
CommonPasswordValidator, MinimumLengthValidator, NumericPasswordValidator,
UserAttributeSimilarityValidator, get_default_password_validators,
get_password_v... | true | true |
1c2c6ba87184c8614268e8666ecd7ffc3d3da608 | 1,868 | py | Python | tests/acceptance/test_organization_rate_limits.py | JannKleen/sentry | 8b29c8234bb51a81d5cab821a1f2ed4ea8e8bd88 | [
"BSD-3-Clause"
] | 1 | 2019-02-27T15:13:06.000Z | 2019-02-27T15:13:06.000Z | tests/acceptance/test_organization_rate_limits.py | rmax/sentry | 8b29c8234bb51a81d5cab821a1f2ed4ea8e8bd88 | [
"BSD-3-Clause"
] | 5 | 2020-07-17T11:20:41.000Z | 2021-05-09T12:16:53.000Z | tests/acceptance/test_organization_rate_limits.py | zaasmi/codeerrorhelp | 1ab8d3e314386b9b2d58dad9df45355bf6014ac9 | [
"BSD-3-Clause"
] | 2 | 2021-01-26T09:53:39.000Z | 2022-03-22T09:01:47.000Z | from __future__ import absolute_import
from django.utils import timezone
from mock import Mock, patch
from sentry.testutils import AcceptanceTestCase
class OrganizationRateLimitsTest(AcceptanceTestCase):
def setUp(self):
super(OrganizationRateLimitsTest, self).setUp()
self.user = self.create_use... | 38.122449 | 81 | 0.662741 | from __future__ import absolute_import
from django.utils import timezone
from mock import Mock, patch
from sentry.testutils import AcceptanceTestCase
class OrganizationRateLimitsTest(AcceptanceTestCase):
def setUp(self):
super(OrganizationRateLimitsTest, self).setUp()
self.user = self.create_use... | true | true |
1c2c6cb9e5f2a0bb11c0027ddc29692246a672bf | 712 | py | Python | Algorithms/Easy/500. Keyboard Row/answer.py | KenWoo/Algorithm | 4012a2f0a099a502df1e5df2e39faa75fe6463e8 | [
"Apache-2.0"
] | null | null | null | Algorithms/Easy/500. Keyboard Row/answer.py | KenWoo/Algorithm | 4012a2f0a099a502df1e5df2e39faa75fe6463e8 | [
"Apache-2.0"
] | null | null | null | Algorithms/Easy/500. Keyboard Row/answer.py | KenWoo/Algorithm | 4012a2f0a099a502df1e5df2e39faa75fe6463e8 | [
"Apache-2.0"
] | null | null | null | from typing import List
class Solution:
def findWords(self, words: List[str]) -> List[str]:
l1 = "qwertyuiop"
l2 = "asdfghjkl"
l3 = "zxcvbnm"
res = []
for w in words:
tmp = []
for c in w:
c = c.lower()
if c in l1:
... | 23.733333 | 61 | 0.414326 | from typing import List
class Solution:
def findWords(self, words: List[str]) -> List[str]:
l1 = "qwertyuiop"
l2 = "asdfghjkl"
l3 = "zxcvbnm"
res = []
for w in words:
tmp = []
for c in w:
c = c.lower()
if c in l1:
... | true | true |
1c2c6d144c9c98ed224fc1dcd860aa913fbc7268 | 5,400 | py | Python | src/sage/repl/configuration.py | fchapoton/sage | 765c5cb3e24dd134708eca97e4c52e0221cd94ba | [
"BSL-1.0"
] | 4 | 2020-07-17T04:49:44.000Z | 2020-07-29T06:33:51.000Z | src/sage/repl/configuration.py | Ivo-Maffei/sage | 467fbc70a08b552b3de33d9065204ee9cbfb02c7 | [
"BSL-1.0"
] | 1 | 2020-04-18T16:30:43.000Z | 2020-04-18T16:30:43.000Z | src/sage/repl/configuration.py | dimpase/sage | 468f23815ade42a2192b0a9cd378de8fdc594dcd | [
"BSL-1.0"
] | 1 | 2020-07-23T10:40:14.000Z | 2020-07-23T10:40:14.000Z | r"""
Sage's IPython Configuration
TESTS:
We check that Sage stdin can be piped in even if stdout is a tty; In that case
the IPython simple prompt is being used::
sage: cmd = 'print([sys.stdin.isatty(), sys.stdout.isatty()])'
sage: import pexpect
sage: output = pexpect.run(
....: 'bash -c \'echo "... | 30 | 88 | 0.599074 |
from __future__ import absolute_import
import sys
import copy
from traitlets.config.loader import Config
from sage.repl.prompts import SagePrompts
SAGE_EXTENSION = 'sage'
class SageIpythonConfiguration(object):
def _doctest_mode(self):
from sage.doctest import DOCTEST_MODE
return D... | true | true |
1c2c6d5ee9b956cecf5d71c01f591b811b204490 | 57,919 | py | Python | test/functional/test_framework/mininode.py | honeycomb-project/litecoin | 636cc4974613040ca15bdedf803ec5ac2bb59c30 | [
"MIT"
] | null | null | null | test/functional/test_framework/mininode.py | honeycomb-project/litecoin | 636cc4974613040ca15bdedf803ec5ac2bb59c30 | [
"MIT"
] | null | null | null | test/functional/test_framework/mininode.py | honeycomb-project/litecoin | 636cc4974613040ca15bdedf803ec5ac2bb59c30 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Bitcoin P2P ... | 30.923118 | 262 | 0.597593 |
import asyncore
from codecs import encode
from collections import defaultdict
import copy
import hashlib
from io import BytesIO
import logging
import random
import socket
import struct
import sys
import time
from threading import RLock, Thread
import honeycomb_scrypt
from test_framework.siphash import siphash25... | true | true |
1c2c6e74502a6c621fd01f854bf4f97c4970f8a2 | 986 | py | Python | tf_quant_finance/math/root_search/__init__.py | slowy07/tf-quant-finance | 0976f720fb58a2d7bfd863640c12a2425cd2f94f | [
"Apache-2.0"
] | 3,138 | 2019-07-24T21:43:17.000Z | 2022-03-30T12:11:09.000Z | tf_quant_finance/math/root_search/__init__.py | slowy07/tf-quant-finance | 0976f720fb58a2d7bfd863640c12a2425cd2f94f | [
"Apache-2.0"
] | 63 | 2019-09-07T19:16:03.000Z | 2022-03-29T19:29:40.000Z | tf_quant_finance/math/root_search/__init__.py | slowy07/tf-quant-finance | 0976f720fb58a2d7bfd863640c12a2425cd2f94f | [
"Apache-2.0"
] | 423 | 2019-07-26T21:28:05.000Z | 2022-03-26T13:07:44.000Z | # Lint as: python3
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 34 | 109 | 0.776876 |
from tf_quant_finance.math.root_search.brent import brentq
from tf_quant_finance.math.root_search.newton import root_finder as newton_root
from tensorflow.python.util.all_util import remove_undocumented
_allowed_symbols = [
'brentq',
'newton_root',
]
remove_undocumented(__name__, _allowed_s... | true | true |
1c2c6eb508fbb7db0f4bc9542432ad2c73f2504b | 181 | py | Python | modules/__init__.py | trislaz/SimCLR | d7c8950a1afc8adad4e617e7ecd90a0d3828740f | [
"MIT"
] | null | null | null | modules/__init__.py | trislaz/SimCLR | d7c8950a1afc8adad4e617e7ecd90a0d3828740f | [
"MIT"
] | null | null | null | modules/__init__.py | trislaz/SimCLR | d7c8950a1afc8adad4e617e7ecd90a0d3828740f | [
"MIT"
] | null | null | null | from .simclr import SimCLR
from .nt_xent import NT_Xent
from .logistic_regression import LogisticRegression
from .lars import LARS
from .dataloader import dataset, datasetWSI_simple | 36.2 | 51 | 0.856354 | from .simclr import SimCLR
from .nt_xent import NT_Xent
from .logistic_regression import LogisticRegression
from .lars import LARS
from .dataloader import dataset, datasetWSI_simple | true | true |
1c2c6f1bcf8a0d65242015ce640b42950c65e4f4 | 316 | py | Python | errorges/config/docs.py | paurosello/errorges | c91f48282f28224dee33d9feb77ca9abd6e2eb5b | [
"MIT"
] | null | null | null | errorges/config/docs.py | paurosello/errorges | c91f48282f28224dee33d9feb77ca9abd6e2eb5b | [
"MIT"
] | null | null | null | errorges/config/docs.py | paurosello/errorges | c91f48282f28224dee33d9feb77ca9abd6e2eb5b | [
"MIT"
] | null | null | null | """
Configuration for docs
"""
# source_link = "https://github.com/[org_name]/errorges"
# docs_base_url = "https://[org_name].github.io/errorges"
# headline = "App that does everything"
# sub_heading = "Yes, you got that right the first time, everything"
def get_context(context):
context.brand_html = "Errorges"
| 26.333333 | 68 | 0.724684 |
def get_context(context):
context.brand_html = "Errorges"
| true | true |
1c2c6f46414369ce2c51604c5dc0bf18f43b745e | 11,171 | py | Python | contrib/runners/orquesta_runner/tests/unit/test_cancel.py | shusugmt/st2 | 31da26badfb4ca3fb3e8cae07cfeec4791191afd | [
"Apache-2.0"
] | null | null | null | contrib/runners/orquesta_runner/tests/unit/test_cancel.py | shusugmt/st2 | 31da26badfb4ca3fb3e8cae07cfeec4791191afd | [
"Apache-2.0"
] | null | null | null | contrib/runners/orquesta_runner/tests/unit/test_cancel.py | shusugmt/st2 | 31da26badfb4ca3fb3e8cae07cfeec4791191afd | [
"Apache-2.0"
] | null | null | null | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | 46.740586 | 95 | 0.760183 |
from __future__ import absolute_import
import mock
import st2tests
from oslo_config import cfg
import st2tests.config as tests_config
tests_config.parse_args()
from tests.unit import base
from st2common.bootstrap import actionsregistrar
from st2common.bootstrap import runnersregistrar
from st2comm... | true | true |
1c2c710854e2a2abe4f872614d3e8b926df1f78f | 4,933 | py | Python | pandapower/test/opf/test_dcline.py | Zamwell/pandapower | ce51946342109e969b87b60c8883d7eec02d3060 | [
"BSD-3-Clause"
] | 1 | 2019-06-16T05:06:03.000Z | 2019-06-16T05:06:03.000Z | pandapower/test/opf/test_dcline.py | Zamwell/pandapower | ce51946342109e969b87b60c8883d7eec02d3060 | [
"BSD-3-Clause"
] | null | null | null | pandapower/test/opf/test_dcline.py | Zamwell/pandapower | ce51946342109e969b87b60c8883d7eec02d3060 | [
"BSD-3-Clause"
] | 1 | 2022-02-07T14:11:03.000Z | 2022-02-07T14:11:03.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2016-2019 by University of Kassel and Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel. All rights reserved.
import pytest
from numpy import array, allclose, isclose
import pandapower as pp
from pandapower.test.consistency_checks import c... | 38.539063 | 96 | 0.700993 |
import pytest
from numpy import array, allclose, isclose
import pandapower as pp
from pandapower.test.consistency_checks import consistency_checks
try:
import pplog as logging
except ImportError:
import logging
logger = logging.getLogger(__name__)
@pytest.fixture
def dcline_net():
net = pp.create... | true | true |
1c2c711f45577a76148ae8af191d115d86196cec | 8,486 | py | Python | client/filesystem.py | thatch/pyre-check | 31278b71081ec3a3636f0d94da91dc0e4273ece9 | [
"MIT"
] | null | null | null | client/filesystem.py | thatch/pyre-check | 31278b71081ec3a3636f0d94da91dc0e4273ece9 | [
"MIT"
] | null | null | null | client/filesystem.py | thatch/pyre-check | 31278b71081ec3a3636f0d94da91dc0e4273ece9 | [
"MIT"
] | null | null | null | # Copyright (c) 2016-present, Facebook, Inc.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import errno
import fcntl
import functools
import logging
import os
import shutil
import subprocess
from contextlib import contextmanager
from typin... | 30.415771 | 88 | 0.604054 |
import errno
import fcntl
import functools
import logging
import os
import shutil
import subprocess
from contextlib import contextmanager
from typing import ContextManager, Dict, Generator, Iterable, List, Optional, Set
from .exceptions import EnvironmentException
LOG: logging.Logger = logging.getLogger(__name_... | true | true |
1c2c733fc10a2c7c9bd106f46e4f2937d96ffece | 4,121 | py | Python | test/jpypetest/test_caller_sensitive.py | pitmanst/jpype | 7256261e435b5c9309941c668258bebd1bcdff2d | [
"Apache-2.0"
] | 531 | 2018-07-19T03:30:04.000Z | 2022-03-29T16:52:44.000Z | test/jpypetest/test_caller_sensitive.py | pitmanst/jpype | 7256261e435b5c9309941c668258bebd1bcdff2d | [
"Apache-2.0"
] | 715 | 2018-07-18T09:21:01.000Z | 2022-03-24T17:45:49.000Z | test/jpypetest/test_caller_sensitive.py | pitmanst/jpype | 7256261e435b5c9309941c668258bebd1bcdff2d | [
"Apache-2.0"
] | 80 | 2018-07-18T13:10:55.000Z | 2022-03-31T19:47:16.000Z | # *****************************************************************************
#
# 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
#
# ... | 36.469027 | 79 | 0.67605 |
import jpype
import common
class JCallerSensitiveCase(common.JPypeTestCase):
def setUp(self):
common.JPypeTestCase.setUp(self)
if not jpype.getJVMVersion() > (1, 8, 0):
raise common.unittest.SkipTest
self.Class = jpype.JClass("jpype.method.Caller")
se... | true | true |
1c2c73f8fcee516f5d2087002b4b428c69c7db50 | 32,923 | py | Python | orgbook-issuer-agent/issuer_controller/src/issuer.py | BrendanBeachBC/jag-lcrb-carla-public | cd270e463ea5995073a609a86be7ca5a1e9b8ca3 | [
"Apache-2.0"
] | 7 | 2019-03-06T20:11:00.000Z | 2021-09-04T13:58:10.000Z | orgbook-issuer-agent/issuer_controller/src/issuer.py | BrendanBeachBC/jag-lcrb-carla-public | cd270e463ea5995073a609a86be7ca5a1e9b8ca3 | [
"Apache-2.0"
] | 47 | 2018-07-21T22:39:11.000Z | 2022-03-02T13:08:36.000Z | orgbook-issuer-agent/issuer_controller/src/issuer.py | BrendanBeachBC/jag-lcrb-carla-public | cd270e463ea5995073a609a86be7ca5a1e9b8ca3 | [
"Apache-2.0"
] | 20 | 2018-12-12T14:15:09.000Z | 2022-03-23T00:01:34.000Z | import json
import os
import threading
import time
from datetime import datetime
import requests
import logging
import random
import requests
from flask import jsonify
from src import config
AGENT_ADMIN_API_KEY = os.environ.get("AGENT_ADMIN_API_KEY")
ADMIN_REQUEST_HEADERS = {"Content-Type": "application/json"}
if AG... | 35.515642 | 111 | 0.598184 | import json
import os
import threading
import time
from datetime import datetime
import requests
import logging
import random
import requests
from flask import jsonify
from src import config
AGENT_ADMIN_API_KEY = os.environ.get("AGENT_ADMIN_API_KEY")
ADMIN_REQUEST_HEADERS = {"Content-Type": "application/json"}
if AG... | true | true |
1c2c74ebac6f9b761ec268cc65a3a706ab9a78fd | 620 | py | Python | setup.py | EndevelCZ/flexibee-export | fdc333249ec2ebf438009469d9229ea6f6532b62 | [
"MIT"
] | null | null | null | setup.py | EndevelCZ/flexibee-export | fdc333249ec2ebf438009469d9229ea6f6532b62 | [
"MIT"
] | null | null | null | setup.py | EndevelCZ/flexibee-export | fdc333249ec2ebf438009469d9229ea6f6532b62 | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="flexibee_export",
version="0.1.0",
author="Endevel",
author_email="info@endevel.cz",
description="FlexiBee xml export package",
long_description=long_description,
long_description_... | 29.52381 | 59 | 0.670968 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="flexibee_export",
version="0.1.0",
author="Endevel",
author_email="info@endevel.cz",
description="FlexiBee xml export package",
long_description=long_description,
long_description_... | true | true |
1c2c7514183a01a411328b1524fc7485a462acfa | 65 | py | Python | python/testData/mover/outsideStatement_afterUp.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/mover/outsideStatement_afterUp.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/mover/outsideStatement_afterUp.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | def foo():
a = 1
a = 3
if a:
pass
a = 4 | 8.125 | 12 | 0.292308 | def foo():
a = 1
a = 3
if a:
pass
a = 4 | true | true |
1c2c75f5f5b645fe3d21e5d7ac21ebfec9f0fd10 | 3,154 | py | Python | submodel/resnet.py | yukyeongleee/CodeTemplate | d0777d501bf64b01ea63787c75b505f7b76ebeda | [
"MIT"
] | null | null | null | submodel/resnet.py | yukyeongleee/CodeTemplate | d0777d501bf64b01ea63787c75b505f7b76ebeda | [
"MIT"
] | 2 | 2022-03-15T09:00:29.000Z | 2022-03-17T03:36:43.000Z | submodel/resnet.py | yukyeongleee/CodeTemplate | d0777d501bf64b01ea63787c75b505f7b76ebeda | [
"MIT"
] | 1 | 2022-03-19T08:08:22.000Z | 2022-03-19T08:08:22.000Z | import torch.nn as nn
import torch.nn.functional as F
import torch.utils.model_zoo as modelzoo
from lib.utils import conv3x3
resnet18_url = 'https://download.pytorch.org/models/resnet18-5c106cde.pth'
class Resnet18(nn.Module):
def __init__(self):
super(Resnet18, self).__init__()
self.conv1 = nn.... | 35.044444 | 74 | 0.606214 | import torch.nn as nn
import torch.nn.functional as F
import torch.utils.model_zoo as modelzoo
from lib.utils import conv3x3
resnet18_url = 'https://download.pytorch.org/models/resnet18-5c106cde.pth'
class Resnet18(nn.Module):
def __init__(self):
super(Resnet18, self).__init__()
self.conv1 = nn.... | true | true |
1c2c76ffd1479b59a53f3ea57987fc92d476200e | 2,931 | py | Python | data/external/repositories_2to3/137656/blundercheck-master/combine/contest_20150210a/data_prep/make_scatterplots.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories_2to3/137656/blundercheck-master/combine/contest_20150210a/data_prep/make_scatterplots.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories_2to3/137656/blundercheck-master/combine/contest_20150210a/data_prep/make_scatterplots.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | 1 | 2019-12-04T08:23:33.000Z | 2019-12-04T08:23:33.000Z | #!/usr/bin/env python
import matplotlib
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
import sys
import seaborn as sns
from pandas import read_pickle, qcut
from itertools import combinations
import matplotlib.pyplot as plt
from djeval import *
sns.set_palette("deep", desat=... | 34.892857 | 103 | 0.578983 |
import matplotlib
matplotlib.use('Agg')
import sys
import seaborn as sns
from pandas import read_pickle, qcut
from itertools import combinations
import matplotlib.pyplot as plt
from djeval import *
sns.set_palette("deep", desat=.6)
sns.set_context(rc={"figure.figsize": (8, 4)})
msg("Hello there, read... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.