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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f713e7fc29e485533a2b6dde959137a75ce66d30 | 7,898 | py | Python | gammapy/estimators/tests/test_flux_point.py | LauraOlivera/gammapy | 0643bb772c86092f758efad745f248a517658013 | [
"BSD-3-Clause"
] | 155 | 2015-02-25T12:38:02.000Z | 2022-03-13T17:54:30.000Z | gammapy/estimators/tests/test_flux_point.py | LauraOlivera/gammapy | 0643bb772c86092f758efad745f248a517658013 | [
"BSD-3-Clause"
] | 3,131 | 2015-01-06T15:36:23.000Z | 2022-03-31T17:30:57.000Z | gammapy/estimators/tests/test_flux_point.py | registerrier/gammapy | 8aadf0ec524bcf51d0ac5655a04507d5d449e7ed | [
"BSD-3-Clause"
] | 158 | 2015-03-16T20:36:44.000Z | 2022-03-30T16:05:37.000Z | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from numpy.testing import assert_allclose
import astropy.units as u
from astropy.table import Table
from gammapy.catalog.fermi import SourceCatalog3FGL
from gammapy.estimators import FluxPoints
from gammapy.modeling.models ... | 30.851563 | 92 | 0.67688 |
import pytest
import numpy as np
from numpy.testing import assert_allclose
import astropy.units as u
from astropy.table import Table
from gammapy.catalog.fermi import SourceCatalog3FGL
from gammapy.estimators import FluxPoints
from gammapy.modeling.models import SpectralModel
from gammapy.utils.scripts import make_pat... | true | true |
f713e8c33d889784d56225ab47aa4e7c69c1753d | 1,369 | py | Python | backend/config.py | takusan64/world-dictionary-backend | 98d92547eef6c5bb4adf89dd412273d30db00317 | [
"MIT"
] | null | null | null | backend/config.py | takusan64/world-dictionary-backend | 98d92547eef6c5bb4adf89dd412273d30db00317 | [
"MIT"
] | null | null | null | backend/config.py | takusan64/world-dictionary-backend | 98d92547eef6c5bb4adf89dd412273d30db00317 | [
"MIT"
] | null | null | null | import os
from os.path import join, dirname
from dotenv import load_dotenv
from urllib.parse import urlparse
# loading .env file
env_path = join(dirname(__file__), '.env')
load_dotenv(env_path)
# use function
def url_path_check(path):
sample_host = 'http://localhost'
sample_url = sample_host + path
... | 36.026316 | 94 | 0.716581 | import os
from os.path import join, dirname
from dotenv import load_dotenv
from urllib.parse import urlparse
env_path = join(dirname(__file__), '.env')
load_dotenv(env_path)
def url_path_check(path):
sample_host = 'http://localhost'
sample_url = sample_host + path
if urlparse(sample_url) and urlpar... | true | true |
f713ea8db528032ad33727686296727e18b4ed76 | 4,232 | py | Python | pnc/draco3_lb_pnc/draco3_lb_controller.py | MaxxWilson/ASE389Project | 13c3c72887e27fbed2eef63c1e27b4a185036a39 | [
"MIT"
] | 17 | 2021-05-31T10:55:48.000Z | 2022-03-30T10:09:37.000Z | pnc/draco3_lb_pnc/draco3_lb_controller.py | MaxxWilson/ASE389Project | 13c3c72887e27fbed2eef63c1e27b4a185036a39 | [
"MIT"
] | 2 | 2021-10-01T22:11:43.000Z | 2021-12-06T02:34:33.000Z | pnc/draco3_lb_pnc/draco3_lb_controller.py | MaxxWilson/ASE389Project | 13c3c72887e27fbed2eef63c1e27b4a185036a39 | [
"MIT"
] | 3 | 2021-08-24T00:53:18.000Z | 2022-03-31T17:29:07.000Z | import numpy as np
from util import util
from config.draco3_lb_config import PnCConfig, WBCConfig
from pnc.wbc.ihwbc.ihwbc import IHWBC
from pnc.wbc.ihwbc.joint_integrator import JointIntegrator
class Draco3LBController(object):
def __init__(self, tci_container, robot):
self._tci_container = tci_containe... | 41.90099 | 80 | 0.617675 | import numpy as np
from util import util
from config.draco3_lb_config import PnCConfig, WBCConfig
from pnc.wbc.ihwbc.ihwbc import IHWBC
from pnc.wbc.ihwbc.joint_integrator import JointIntegrator
class Draco3LBController(object):
def __init__(self, tci_container, robot):
self._tci_container = tci_containe... | true | true |
f713ee8c639c7e6ee5d24c6125c399a3192d0f4d | 1,629 | py | Python | pymantic/parsers/base.py | machallboyd/pymantic | 159208f1a45d4bfda56adaa0cfdb555cadd89d39 | [
"BSD-3-Clause"
] | null | null | null | pymantic/parsers/base.py | machallboyd/pymantic | 159208f1a45d4bfda56adaa0cfdb555cadd89d39 | [
"BSD-3-Clause"
] | 1 | 2019-06-19T13:17:57.000Z | 2019-06-19T13:44:10.000Z | pymantic/parsers/base.py | machallboyd/pymantic | 159208f1a45d4bfda56adaa0cfdb555cadd89d39 | [
"BSD-3-Clause"
] | 1 | 2020-09-22T15:38:33.000Z | 2020-09-22T15:38:33.000Z | from collections import defaultdict
from threading import local
import pymantic.primitives
class BaseParser(object):
"""Common base class for all parsers
Provides shared utilities for creating RDF objects, handling IRIs, and
tracking parser state.
"""
def __init__(self, environment=None):
... | 30.735849 | 74 | 0.688152 | from collections import defaultdict
from threading import local
import pymantic.primitives
class BaseParser(object):
def __init__(self, environment=None):
self.env = environment or pymantic.primitives.RDFEnvironment()
self.profile = self.env.createProfile()
self._call_state = local()
... | true | true |
f713eea928557ab0c23074afaa3be56464a6df33 | 3,006 | py | Python | huobi/impl/accountinfomap.py | icemilk00/huobi_Python | 0cccd98ed926faa21e0bfc34033e29755788a36e | [
"Apache-2.0"
] | null | null | null | huobi/impl/accountinfomap.py | icemilk00/huobi_Python | 0cccd98ed926faa21e0bfc34033e29755788a36e | [
"Apache-2.0"
] | null | null | null | huobi/impl/accountinfomap.py | icemilk00/huobi_Python | 0cccd98ed926faa21e0bfc34033e29755788a36e | [
"Apache-2.0"
] | null | null | null | from huobi.exception.huobiapiexception import HuobiApiException
from huobi.impl.restapiinvoker import call_sync
from huobi.model.user import User
class AccountInfoMap:
user_map = dict()
account_id_type_map = dict()
account_type_id_map = dict()
def update_user_info(self, api_key, request_impl):
... | 45.545455 | 123 | 0.674983 | from huobi.exception.huobiapiexception import HuobiApiException
from huobi.impl.restapiinvoker import call_sync
from huobi.model.user import User
class AccountInfoMap:
user_map = dict()
account_id_type_map = dict()
account_type_id_map = dict()
def update_user_info(self, api_key, request_impl):
... | true | true |
f713efa3bf3641e0b950751ae3760062ec38d96a | 6,138 | py | Python | visual_change_analysis/main.py | Barry-lab/Publication_TanniDeCothiBarry2021 | 425bc0bd9a74b837d912820e9ea1539a111fcb1f | [
"Unlicense"
] | null | null | null | visual_change_analysis/main.py | Barry-lab/Publication_TanniDeCothiBarry2021 | 425bc0bd9a74b837d912820e9ea1539a111fcb1f | [
"Unlicense"
] | null | null | null | visual_change_analysis/main.py | Barry-lab/Publication_TanniDeCothiBarry2021 | 425bc0bd9a74b837d912820e9ea1539a111fcb1f | [
"Unlicense"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from scipy.stats import pearsonr
from bin_data import bin_data
# import pixel data
right_z_pixel_change = np.load("right_z_pixel_change.npy")
left_z_pixel_change = np.load("left_z_pixel_change.npy")
front_z_pixel_change = np.load("front_z_pixel_... | 47.581395 | 194 | 0.717009 | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from scipy.stats import pearsonr
from bin_data import bin_data
right_z_pixel_change = np.load("right_z_pixel_change.npy")
left_z_pixel_change = np.load("left_z_pixel_change.npy")
front_z_pixel_change = np.load("front_z_pixel_change.npy")
pixel_c... | true | true |
f713f0ef135be2dc5f92333e9d7d370a70df85aa | 2,956 | py | Python | mbrl/examples/main.py | alik-git/mbrl-lib | b364f8e64ca71ebd18147fe8cdbd3068b74e1f1e | [
"MIT"
] | null | null | null | mbrl/examples/main.py | alik-git/mbrl-lib | b364f8e64ca71ebd18147fe8cdbd3068b74e1f1e | [
"MIT"
] | 2 | 2022-03-09T19:33:18.000Z | 2022-03-09T19:44:22.000Z | mbrl/examples/main.py | alik-git/mbrl-lib | b364f8e64ca71ebd18147fe8cdbd3068b74e1f1e | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import Iterable
import hydra
import numpy as np
import omegaconf
import torch
import mbrl.algorithms.mbpo as ... | 33.977011 | 233 | 0.680988 |
from typing import Iterable
import hydra
import numpy as np
import omegaconf
import torch
import mbrl.algorithms.mbpo as mbpo
import mbrl.algorithms.pets as pets
import mbrl.algorithms.planet as planet
import mbrl.algorithms.dreamer as dreamer
import mbrl.util.env
import pandas as pd
from collections import Iter... | true | true |
f713f27d6c357f44964b8142d9ebf6c68ba5f1f4 | 1,631 | py | Python | extern/locating-objects-without-bboxes/object-locator/models/utils.py | YuHsin1998/EllSeg | 91a532650ef809eef081a7ef9af5f1940fb37a37 | [
"MIT"
] | 1 | 2021-05-26T05:45:42.000Z | 2021-05-26T05:45:42.000Z | extern/locating-objects-without-bboxes/object-locator/models/utils.py | xiaohuaibaoguigui/EllSeg | ff56b255f8e650856aec9af23792e105897eba5c | [
"MIT"
] | null | null | null | extern/locating-objects-without-bboxes/object-locator/models/utils.py | xiaohuaibaoguigui/EllSeg | ff56b255f8e650856aec9af23792e105897eba5c | [
"MIT"
] | null | null | null | __copyright__ = \
"""
Copyright ©right © (c) 2019 The Board of Trustees of Purdue University and the Purdue Research Foundation.
All rights reserved.
This software is covered by US patents and copyright.
This source code is to be used for academic research purposes only, and no commercial use is allowed.
For any ... | 33.285714 | 110 | 0.700184 | __copyright__ = \
"""
Copyright ©right © (c) 2019 The Board of Trustees of Purdue University and the Purdue Research Foundation.
All rights reserved.
This software is covered by US patents and copyright.
This source code is to be used for academic research purposes only, and no commercial use is allowed.
For any ... | true | true |
f713f39ba58b4fe5662cd70ad5768f8a6af5ad06 | 9,744 | py | Python | tests/torch/nas/test_state.py | openvinotoolkit/nncf_pytorch | 13a483eac6ed891720ba90d7902142c4b3bfa599 | [
"Apache-2.0"
] | 136 | 2020-06-01T14:03:31.000Z | 2020-10-28T06:10:50.000Z | tests/torch/nas/test_state.py | openvinotoolkit/nncf_pytorch | 13a483eac6ed891720ba90d7902142c4b3bfa599 | [
"Apache-2.0"
] | 133 | 2020-05-26T13:48:04.000Z | 2020-10-28T05:25:55.000Z | tests/torch/nas/test_state.py | openvinotoolkit/nncf_pytorch | 13a483eac6ed891720ba90d7902142c4b3bfa599 | [
"Apache-2.0"
] | 36 | 2020-05-28T08:18:39.000Z | 2020-10-27T14:46:58.000Z | """
Copyright (c) 2022 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writin... | 37.476923 | 117 | 0.74179 | import logging
from copy import deepcopy
from functools import partial
import pytest
import torch
from nncf.common.utils.logger import logger as nncf_logger
from nncf.experimental.torch.nas.bootstrapNAS.elasticity.base_handler import SEHBuilderStateNames
from nncf.experimental.torch.nas.bootstrapNAS.elasticity.elasti... | true | true |
f713f3f9c3a36c6b39f53d8a182a15163e5b1137 | 7,573 | gyp | Python | gyp/animator.gyp | Android4SAM/platform_external_skia | 7cd90d4eecdba0f40a36945749d40df95d6d641b | [
"BSD-3-Clause"
] | null | null | null | gyp/animator.gyp | Android4SAM/platform_external_skia | 7cd90d4eecdba0f40a36945749d40df95d6d641b | [
"BSD-3-Clause"
] | null | null | null | gyp/animator.gyp | Android4SAM/platform_external_skia | 7cd90d4eecdba0f40a36945749d40df95d6d641b | [
"BSD-3-Clause"
] | 1 | 2020-11-12T05:40:43.000Z | 2020-11-12T05:40:43.000Z | {
'includes': [
'common.gypi',
],
'targets': [
{
'target_name': 'animator',
'type': 'static_library',
'include_dirs': [
'../include/config',
'../include/core',
'../include/effects',
'../include/animator',
'../include/views',
'../include/xml... | 39.238342 | 66 | 0.579955 | {
'includes': [
'common.gypi',
],
'targets': [
{
'target_name': 'animator',
'type': 'static_library',
'include_dirs': [
'../include/config',
'../include/core',
'../include/effects',
'../include/animator',
'../include/views',
'../include/xml... | true | true |
f713f41205149d08465b67431cb2f925a8e7cf98 | 221,612 | py | Python | jax/lax/lax.py | baba1587/jax | cb77f2a22de49e85da93f43b7dc448aa238d5207 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-05-18T23:57:13.000Z | 2020-05-18T23:57:13.000Z | jax/lax/lax.py | baba1587/jax | cb77f2a22de49e85da93f43b7dc448aa238d5207 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | jax/lax/lax.py | baba1587/jax | cb77f2a22de49e85da93f43b7dc448aa238d5207 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright 2018 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 agreed to in writing, ... | 41.774175 | 141 | 0.711189 |
import builtins
import collections
import enum
import functools
import itertools
import operator
import string
from typing import (Any, Callable, List, NamedTuple, Optional, Sequence, Union,
Tuple, Type)
import warnings
import numpy as onp
from ..util import partial, prod
from .. i... | true | true |
f713f4cb4e88d6989f2ec465138945e7b6d049ed | 231 | py | Python | santa_helpers/__init__.py | lenarother/santa-helpers | 0498b9922b357c98543929a39d9755085da527b0 | [
"MIT"
] | null | null | null | santa_helpers/__init__.py | lenarother/santa-helpers | 0498b9922b357c98543929a39d9755085da527b0 | [
"MIT"
] | null | null | null | santa_helpers/__init__.py | lenarother/santa-helpers | 0498b9922b357c98543929a39d9755085da527b0 | [
"MIT"
] | null | null | null | """Top-level package for santa-helpers."""
__author__ = """Magdalena Rother"""
__email__ = 'rother.magdalena@gmail.com'
__version__ = '0.0.1'
from .neighbors import neighbors # noqa
from .parse import parse_grid_to_dict # noqa
| 25.666667 | 45 | 0.735931 |
__author__ = """Magdalena Rother"""
__email__ = 'rother.magdalena@gmail.com'
__version__ = '0.0.1'
from .neighbors import neighbors
from .parse import parse_grid_to_dict
| true | true |
f713f6e459931ce5f210c3897d1bf4d851edf6bf | 1,194 | py | Python | tests/test_class_oelint_vars_bugtrackerurl.py | vermaete/oelint-adv | 6a2cadf2fd076d6e531d4bb0abcc4ad89d1fdbee | [
"BSD-2-Clause"
] | null | null | null | tests/test_class_oelint_vars_bugtrackerurl.py | vermaete/oelint-adv | 6a2cadf2fd076d6e531d4bb0abcc4ad89d1fdbee | [
"BSD-2-Clause"
] | null | null | null | tests/test_class_oelint_vars_bugtrackerurl.py | vermaete/oelint-adv | 6a2cadf2fd076d6e531d4bb0abcc4ad89d1fdbee | [
"BSD-2-Clause"
] | null | null | null | import os
import sys
import pytest
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
from base import TestBaseClass
class TestClassOelintVarsBugtrackerIsUrl(TestBaseClass):
@pytest.mark.parametrize('id', ['oelint.vars.bugtrackerisurl'])
@pytest.mark.parametrize('occurrence', [1])
@pytest.... | 24.875 | 67 | 0.536851 | import os
import sys
import pytest
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
from base import TestBaseClass
class TestClassOelintVarsBugtrackerIsUrl(TestBaseClass):
@pytest.mark.parametrize('id', ['oelint.vars.bugtrackerisurl'])
@pytest.mark.parametrize('occurrence', [1])
@pytest.... | true | true |
f713f744998c6af0cf3cc3d45319704b6dcf176c | 99 | py | Python | spacetrading/apps.py | claudiobierig/doppeldenk | 770cd5322753450834ec393a0801de1d2de2bfa2 | [
"MIT"
] | 1 | 2020-11-08T12:32:36.000Z | 2020-11-08T12:32:36.000Z | spacetrading/apps.py | claudiobierig/doppeldenk | 770cd5322753450834ec393a0801de1d2de2bfa2 | [
"MIT"
] | 1 | 2021-06-04T22:23:30.000Z | 2021-06-04T22:23:30.000Z | spacetrading/apps.py | claudiobierig/doppeldenk | 770cd5322753450834ec393a0801de1d2de2bfa2 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class SpacetradingConfig(AppConfig):
name = 'spacetrading'
| 16.5 | 36 | 0.777778 | from django.apps import AppConfig
class SpacetradingConfig(AppConfig):
name = 'spacetrading'
| true | true |
f713f7962135e6e3e3c9bc85590f2aebb3b24ea0 | 4,956 | py | Python | cookie/cookie.py | ChairsDaily/cookie | 58e294a6f92d061ab96683b7fda13d32daefe3a2 | [
"MIT"
] | null | null | null | cookie/cookie.py | ChairsDaily/cookie | 58e294a6f92d061ab96683b7fda13d32daefe3a2 | [
"MIT"
] | null | null | null | cookie/cookie.py | ChairsDaily/cookie | 58e294a6f92d061ab96683b7fda13d32daefe3a2 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
"""
Beautiful command line parsing
@author chairs
"""
import inspect, sys
from collections import namedtuple
from collections import defaultdict
from subprocess import DEVNULL
class Cookie (object):
"""
Main decorator object
@param name of application
"""
def __init__ (self, app_name, notes=... | 26.084211 | 84 | 0.682002 |
import inspect, sys
from collections import namedtuple
from collections import defaultdict
from subprocess import DEVNULL
class Cookie (object):
def __init__ (self, app_name, notes=()):
self.optarg = namedtuple('optarg',
['full', 'abbrev', 'default'])
self.name = str(app_name)
self.notes = notes
def __... | true | true |
f713f85e83a78de7f23187319432ac1b46bbef92 | 3,117 | py | Python | tests/test_cron.py | SF-300/aiocron | fe1abc1728d6c8ecb7ecbf75f86f1014e823dfec | [
"MIT"
] | 245 | 2015-02-23T22:50:55.000Z | 2022-03-24T10:24:44.000Z | tests/test_cron.py | SF-300/aiocron | fe1abc1728d6c8ecb7ecbf75f86f1014e823dfec | [
"MIT"
] | 21 | 2015-10-21T16:00:29.000Z | 2022-03-28T08:25:46.000Z | tests/test_cron.py | SF-300/aiocron | fe1abc1728d6c8ecb7ecbf75f86f1014e823dfec | [
"MIT"
] | 28 | 2015-10-21T15:41:42.000Z | 2022-03-25T21:36:04.000Z | # -*- coding: utf-8 -*-
import time
import datetime
from aiocron import asyncio
from aiocron import crontab
import pytest
class CustomError(Exception):
pass
def test_str():
loop = asyncio.new_event_loop()
@crontab('* * * * * *', loop=loop)
def t():
pass
assert '* * * * *' in str(t)
... | 20.78 | 67 | 0.605711 |
import time
import datetime
from aiocron import asyncio
from aiocron import crontab
import pytest
class CustomError(Exception):
pass
def test_str():
loop = asyncio.new_event_loop()
@crontab('* * * * * *', loop=loop)
def t():
pass
assert '* * * * *' in str(t)
def test_cron():
lo... | true | true |
f713f8f82b5a192645afd5b548efee29e36fd35a | 23,097 | py | Python | nova/tests/unit/test_fixtures.py | maya2250/nova | e483ca1cd9a5db5856f87fc69ca07c42d2be5def | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/test_fixtures.py | maya2250/nova | e483ca1cd9a5db5856f87fc69ca07c42d2be5def | [
"Apache-2.0"
] | 1 | 2021-03-31T19:35:21.000Z | 2021-03-31T19:35:21.000Z | nova/tests/unit/test_fixtures.py | Mattlk13/nova | 5b13eb59540aaf535a53920e783964d106de2620 | [
"Apache-2.0"
] | 1 | 2020-07-22T09:09:38.000Z | 2020-07-22T09:09:38.000Z | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 t... | 40.592267 | 78 | 0.650387 |
import copy
import fixtures as fx
import futurist
import mock
from oslo_config import cfg
from oslo_db import exception as db_exc
from oslo_log import log as logging
from oslo_utils.fixture import uuidsentinel as uuids
from oslo_utils import timeutils
from oslo_utils import uuidutils
from oslotest impo... | true | true |
f713fb2b521629818719bab00598f5172b4dfd6d | 58,015 | py | Python | sphinx/builders/html/__init__.py | SamB/sphinx | bf010790ace78ba4bc4231445e73bcecf97e4947 | [
"BSD-2-Clause"
] | null | null | null | sphinx/builders/html/__init__.py | SamB/sphinx | bf010790ace78ba4bc4231445e73bcecf97e4947 | [
"BSD-2-Clause"
] | null | null | null | sphinx/builders/html/__init__.py | SamB/sphinx | bf010790ace78ba4bc4231445e73bcecf97e4947 | [
"BSD-2-Clause"
] | null | null | null | """Several HTML builders."""
import html
import os
import posixpath
import re
import sys
from datetime import datetime
from os import path
from typing import IO, Any, Dict, Iterable, Iterator, List, Optional, Set, Tuple, Type
from urllib.parse import quote
from docutils import nodes
from docutils.core import publish_... | 41.707405 | 116 | 0.602965 |
import html
import os
import posixpath
import re
import sys
from datetime import datetime
from os import path
from typing import IO, Any, Dict, Iterable, Iterator, List, Optional, Set, Tuple, Type
from urllib.parse import quote
from docutils import nodes
from docutils.core import publish_parts
from docutils.frontend ... | true | true |
f713fb64d17d622dd93ea8409be4defebd59a2ca | 39,023 | py | Python | ServidorPython/python32_web/Lib/site-packages/numpy/lib/tests/test_recfunctions.py | mak213k/Servidor_automatizado_python | 4403ef8027a2f814220baacc95856cf5fbf01d21 | [
"MIT"
] | 65 | 2019-07-24T21:44:58.000Z | 2022-03-23T07:12:07.000Z | venv/lib/python3.7/site-packages/numpy/lib/tests/test_recfunctions.py | haideraltahan/CropMe | 75a111b9d3b2c50c6f2a9a36d21432053f02284d | [
"MIT"
] | 10 | 2019-12-04T23:51:44.000Z | 2022-02-10T09:23:15.000Z | venv/lib/python3.7/site-packages/numpy/lib/tests/test_recfunctions.py | haideraltahan/CropMe | 75a111b9d3b2c50c6f2a9a36d21432053f02284d | [
"MIT"
] | 45 | 2019-08-13T09:20:48.000Z | 2022-02-18T06:09:42.000Z | from __future__ import division, absolute_import, print_function
import pytest
import numpy as np
import numpy.ma as ma
from numpy.ma.mrecords import MaskedRecords
from numpy.ma.testutils import assert_equal
from numpy.testing import assert_, assert_raises
from numpy.lib.recfunctions import (
drop_fields, rename_... | 42.27844 | 85 | 0.429413 | from __future__ import division, absolute_import, print_function
import pytest
import numpy as np
import numpy.ma as ma
from numpy.ma.mrecords import MaskedRecords
from numpy.ma.testutils import assert_equal
from numpy.testing import assert_, assert_raises
from numpy.lib.recfunctions import (
drop_fields, rename_... | true | true |
f713fcb4e6bd2a51f7ae62f8c0d54992a88852ed | 4,771 | py | Python | capture/noworkflow/now/persistence/models/diff.py | raffaelfoidl/noworkflow | aa4ca189df24fec6c7abd32bcca6a097b21fdf31 | [
"MIT"
] | 108 | 2015-02-04T14:16:51.000Z | 2022-03-06T13:52:45.000Z | capture/noworkflow/now/persistence/models/diff.py | raffaelfoidl/noworkflow | aa4ca189df24fec6c7abd32bcca6a097b21fdf31 | [
"MIT"
] | 92 | 2015-01-19T14:58:06.000Z | 2021-04-19T17:28:50.000Z | capture/noworkflow/now/persistence/models/diff.py | raffaelfoidl/noworkflow | aa4ca189df24fec6c7abd32bcca6a097b21fdf31 | [
"MIT"
] | 31 | 2015-03-03T23:53:59.000Z | 2021-11-11T04:23:44.000Z | # Copyright (c) 2016 Universidade Federal Fluminense (UFF)
# Copyright (c) 2016 Polytechnic Institute of New York University.
# This file is part of noWorkflow.
# Please, consult the license terms in the LICENSE file.
"""Diff Object"""
from __future__ import (absolute_import, print_function,
div... | 32.678082 | 108 | 0.627961 |
from __future__ import (absolute_import, print_function,
division, unicode_literals)
from collections import OrderedDict
from future.utils import viewkeys
from .base import Model, proxy_gen
from .trial import Trial
from .graphs.diff_graph import DiffGraph
class Diff(Model):
__model... | true | true |
f713fd3785a1602b0c5e916541eb25874c85284a | 22,928 | py | Python | lib/streamlit/app_session.py | ab077u/streamlit | 40356a941dc39411597084d733055e310e3cfcd1 | [
"Apache-2.0"
] | null | null | null | lib/streamlit/app_session.py | ab077u/streamlit | 40356a941dc39411597084d733055e310e3cfcd1 | [
"Apache-2.0"
] | null | null | null | lib/streamlit/app_session.py | ab077u/streamlit | 40356a941dc39411597084d733055e310e3cfcd1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-2022 Streamlit 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 wr... | 37.648604 | 117 | 0.664341 |
import sys
import uuid
from enum import Enum
from typing import TYPE_CHECKING, Callable, Optional, List, Any, cast
from streamlit.uploaded_file_manager import UploadedFileManager
import tornado.ioloop
import streamlit.elements.exception as exception_utils
from streamlit import __version__, caching, con... | true | true |
f713fedde4b97aea695b77b89fd9f2e970232bca | 435 | py | Python | Lista4/Lista4ex7.py | hugo-paiva/IntroducaoCienciasDaComputacao | a563f2fd5b773acbffaf4c858b86423b1130ae1f | [
"MIT"
] | null | null | null | Lista4/Lista4ex7.py | hugo-paiva/IntroducaoCienciasDaComputacao | a563f2fd5b773acbffaf4c858b86423b1130ae1f | [
"MIT"
] | null | null | null | Lista4/Lista4ex7.py | hugo-paiva/IntroducaoCienciasDaComputacao | a563f2fd5b773acbffaf4c858b86423b1130ae1f | [
"MIT"
] | null | null | null | def concat(s1, s2):
if not s1:
return s2
return s1[0:1] + concat(s1[1:], s2)
def reverse(s1):
if not s1:
return s1
return concat(reverse(s1[1:]), s1[0])
def prefix(s1, s2):
if s1 == '' and s2 != '':
return True
if s1[:1] == s2[:1]:
return prefix(s1[1:], s2... | 16.111111 | 41 | 0.524138 | def concat(s1, s2):
if not s1:
return s2
return s1[0:1] + concat(s1[1:], s2)
def reverse(s1):
if not s1:
return s1
return concat(reverse(s1[1:]), s1[0])
def prefix(s1, s2):
if s1 == '' and s2 != '':
return True
if s1[:1] == s2[:1]:
return prefix(s1[1:], s2... | true | true |
f713feed6e11f6d272abab6a55db7e1b8686813b | 4,620 | py | Python | env/lib/python3.8/site-packages/ask_sdk_model/interfaces/audioplayer/stream.py | adamash99/alexa-play-pot-of-greed | dc2d18dae55692a4bf1becb72685a5777870c643 | [
"MIT"
] | 90 | 2018-09-19T21:56:42.000Z | 2022-03-30T11:25:21.000Z | ask-sdk-model/ask_sdk_model/interfaces/audioplayer/stream.py | ishitaojha/alexa-apis-for-python | a68f94b7a0e41f819595d6fe56e800403e8a4194 | [
"Apache-2.0"
] | 11 | 2018-09-23T12:16:48.000Z | 2021-06-10T19:49:45.000Z | ask-sdk-model/ask_sdk_model/interfaces/audioplayer/stream.py | ishitaojha/alexa-apis-for-python | a68f94b7a0e41f819595d6fe56e800403e8a4194 | [
"Apache-2.0"
] | 28 | 2018-09-19T22:30:38.000Z | 2022-02-22T22:57:07.000Z | # coding: utf-8
#
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file
# except in compliance with the License. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "lice... | 33.970588 | 123 | 0.614286 |
import pprint
import re
import six
import typing
from enum import Enum
if typing.TYPE_CHECKING:
from typing import Dict, List, Optional, Union, Any
from datetime import datetime
from ask_sdk_model.interfaces.audioplayer.caption_data import CaptionData as CaptionData_e119f120
class Strea... | true | true |
f713feeff5540cb5abd88be8581806ea4a417b09 | 14,614 | py | Python | oscar/lib/python2.7/site-packages/IPython/core/pylabtools.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/IPython/core/pylabtools.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/IPython/core/pylabtools.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Pylab (matplotlib) support utilities."""
from __future__ import print_function
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from io import BytesIO
from IPython.core.display import _pngxy
from IPython.utils.decorators import ... | 35.643902 | 91 | 0.622212 |
from __future__ import print_function
from io import BytesIO
from IPython.core.display import _pngxy
from IPython.utils.decorators import flag_calls
from IPython.utils import py3compat
backends = {'tk': 'TkAgg',
'gtk': 'GTKAgg',
'gtk3': 'GTK3Agg',
'wx': 'WXAgg',
... | true | true |
f713ff1895f64aa70104aa664da6eedd61326435 | 35,539 | py | Python | sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_pool_operations.py | eliagrady/azure-sdk-for-python | 64d0c78ce4a9b409dbc96864d7b65098891863f9 | [
"MIT"
] | null | null | null | sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_pool_operations.py | eliagrady/azure-sdk-for-python | 64d0c78ce4a9b409dbc96864d7b65098891863f9 | [
"MIT"
] | null | null | null | sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_pool_operations.py | eliagrady/azure-sdk-for-python | 64d0c78ce4a9b409dbc96864d7b65098891863f9 | [
"MIT"
] | 1 | 2021-05-19T02:55:10.000Z | 2021-05-19T02:55:10.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 ... | 50.842632 | 215 | 0.662624 |
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.... | true | true |
f713ff85630f45ddfb90ff880de1b07a38106d1e | 1,867 | py | Python | plaso/cli/helpers/vfs_backend.py | rgayon/plaso | 5f1d0f2da19a28a00ab62c276162483e79a42efb | [
"Apache-2.0"
] | 1 | 2020-12-04T10:26:34.000Z | 2020-12-04T10:26:34.000Z | plaso/cli/helpers/vfs_backend.py | dvntaudio/plaso | 6debdabbce3619b3210efa2a2cbc91242c02d4e3 | [
"Apache-2.0"
] | null | null | null | plaso/cli/helpers/vfs_backend.py | dvntaudio/plaso | 6debdabbce3619b3210efa2a2cbc91242c02d4e3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""The VFS back-end CLI arguments helper."""
from __future__ import unicode_literals
from plaso.cli import tools
from plaso.cli.helpers import interface
from plaso.cli.helpers import manager
from plaso.lib import errors
class VFSBackEndArgumentsHelper(interface.ArgumentsHelper):
"""VFS bac... | 32.189655 | 79 | 0.705945 |
from __future__ import unicode_literals
from plaso.cli import tools
from plaso.cli.helpers import interface
from plaso.cli.helpers import manager
from plaso.lib import errors
class VFSBackEndArgumentsHelper(interface.ArgumentsHelper):
NAME = 'vfs_backend'
DESCRIPTION = 'dfVFS back-end command line arguments.'... | true | true |
f71401cefe5604f63cb273a6cb7d6715836fee70 | 2,146 | py | Python | fab_deploy/contrib/servers.py | samdolan/django-fab-deploy | 642e5cc319f811d4ee647d65388c85988ac887e2 | [
"Unlicense"
] | 1 | 2019-08-04T20:54:43.000Z | 2019-08-04T20:54:43.000Z | fab_deploy/contrib/servers.py | samdolan/django-fab-deploy | 642e5cc319f811d4ee647d65388c85988ac887e2 | [
"Unlicense"
] | null | null | null | fab_deploy/contrib/servers.py | samdolan/django-fab-deploy | 642e5cc319f811d4ee647d65388c85988ac887e2 | [
"Unlicense"
] | null | null | null | from .constants import ALL_ROLES, DB_ROLE, WEB_ROLE
from .database import setup_db
from .django import update_db, update_python_libs
from .nginx import stop_nginx, start_nginx
from .ssh import setup_ssh_key
from .supervisor import stop_supervisor, start_supervisor, update_supervisor
from .utils import get_ip
from .webs... | 23.582418 | 82 | 0.695247 | from .constants import ALL_ROLES, DB_ROLE, WEB_ROLE
from .database import setup_db
from .django import update_db, update_python_libs
from .nginx import stop_nginx, start_nginx
from .ssh import setup_ssh_key
from .supervisor import stop_supervisor, start_supervisor, update_supervisor
from .utils import get_ip
from .webs... | true | true |
f71404e9bb036de5356fa647bf6aa5feffbe1d2a | 1,654 | py | Python | cog/help.py | tasuren/TunaBot | dd9ecf79280c388bd3b38cb1822b5dbc3666a86c | [
"MIT"
] | 1 | 2021-05-22T07:30:40.000Z | 2021-05-22T07:30:40.000Z | cog/help.py | tasuren/TunaBot | dd9ecf79280c388bd3b38cb1822b5dbc3666a86c | [
"MIT"
] | 1 | 2021-12-14T12:24:30.000Z | 2021-12-14T12:24:30.000Z | cog/help.py | tasuren/TunaBot | dd9ecf79280c388bd3b38cb1822b5dbc3666a86c | [
"MIT"
] | 2 | 2020-10-25T01:29:16.000Z | 2022-02-26T04:49:20.000Z | # TunaBot Ext - Help
from discord.ext import commands
import discord
from aiofiles import open as async_open
from ujson import load, loads
from data import is_admin
JSON_PATH = "data/help.json"
class Help(commands.Cog):
def __init__(self, bot):
self.bot, self.tuna = bot, bot.data
with open(JS... | 29.017544 | 83 | 0.52237 |
from discord.ext import commands
import discord
from aiofiles import open as async_open
from ujson import load, loads
from data import is_admin
JSON_PATH = "data/help.json"
class Help(commands.Cog):
def __init__(self, bot):
self.bot, self.tuna = bot, bot.data
with open(JSON_PATH, 'r') as f:
... | true | true |
f71405186d46fa9050d4b62064a287cfd9e3f822 | 485 | py | Python | main.py | FayasNoushad/Requote-URL-Bot | 24f35ba56981d455d7e80a7a3dfb60b1cacb3caa | [
"MIT"
] | 5 | 2021-09-04T06:15:05.000Z | 2021-11-28T12:00:35.000Z | main.py | sreeragbot/Requote-URL-Bot | 24f35ba56981d455d7e80a7a3dfb60b1cacb3caa | [
"MIT"
] | null | null | null | main.py | sreeragbot/Requote-URL-Bot | 24f35ba56981d455d7e80a7a3dfb60b1cacb3caa | [
"MIT"
] | 5 | 2021-09-04T06:45:24.000Z | 2022-02-06T18:05:24.000Z | import os
from requests.utils import requote_uri
from pyrogram import Client, filters
Bot = Client(
"Requote-URL-Bot",
bot_token = os.environ["BOT_TOKEN"],
api_id = int(os.environ["API_ID"]),
api_hash = os.environ["API_HASH"]
)
@Bot.on_message(filters.text)
async def filter(bot, update):
await u... | 20.208333 | 70 | 0.676289 | import os
from requests.utils import requote_uri
from pyrogram import Client, filters
Bot = Client(
"Requote-URL-Bot",
bot_token = os.environ["BOT_TOKEN"],
api_id = int(os.environ["API_ID"]),
api_hash = os.environ["API_HASH"]
)
@Bot.on_message(filters.text)
async def filter(bot, update):
await u... | true | true |
f714056b038088a8e129999ae37a63685ffc8967 | 1,296 | py | Python | settings.py | UUDigitalHumanitieslab/historic-hebrew-dates | 5ace44d9b1315a96a96ea296383f0b618d994212 | [
"BSD-3-Clause"
] | 1 | 2020-06-24T10:29:17.000Z | 2020-06-24T10:29:17.000Z | settings.py | UUDigitalHumanitieslab/historic-hebrew-dates | 5ace44d9b1315a96a96ea296383f0b618d994212 | [
"BSD-3-Clause"
] | 11 | 2019-10-10T08:50:01.000Z | 2022-03-02T05:23:55.000Z | settings.py | UUDigitalHumanitieslab/historic-hebrew-dates | 5ace44d9b1315a96a96ea296383f0b618d994212 | [
"BSD-3-Clause"
] | null | null | null | """ This is magic glue for integrating the frontend and backend.
This is NOT the place for backend customizations. Go to
api/historic_hebrew_dates_ui/settings.py instead.
"""
import os.path as op
here = op.dirname(op.abspath(__file__))
# First, import the standard backend settings. This requires some
# magi... | 28.8 | 97 | 0.748457 |
import os.path as op
here = op.dirname(op.abspath(__file__))
port util, machinery
settings_name = 'settings'
settings_path = op.join(here, 'api', 'historic_hebrew_dates_ui', 'settings.py')
if sys.version_info >= (3, 5):
spec = util.spec_from_file_location(settings_name, settings_path)
settings = util.mod... | true | true |
f714058cf6804da67a6dd34483c0d76cf1bd23ea | 3,828 | py | Python | delfin/tests/unit/drivers/dell_emc/vmax/test_alert_handler.py | joseph-v/SIM | 61fedb261aa745d715b8a30c0945a6244fb807e2 | [
"Apache-2.0"
] | 4 | 2020-04-10T03:48:55.000Z | 2020-04-27T07:52:55.000Z | delfin/tests/unit/drivers/dell_emc/vmax/test_alert_handler.py | joseph-v/SIM | 61fedb261aa745d715b8a30c0945a6244fb807e2 | [
"Apache-2.0"
] | 210 | 2020-05-08T04:06:49.000Z | 2020-06-22T12:59:02.000Z | delfin/tests/unit/drivers/dell_emc/vmax/test_alert_handler.py | joseph-v/SIM | 61fedb261aa745d715b8a30c0945a6244fb807e2 | [
"Apache-2.0"
] | 10 | 2020-04-11T07:09:55.000Z | 2020-04-28T09:50:13.000Z | # Copyright 2020 The SODA Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 42.533333 | 79 | 0.59326 |
tils import importutils
from delfin import exception
from delfin.common import constants
class AlertHandlerTestCase(unittest.TestCase):
ALERT_HANDLER_CLASS = 'delfin.drivers.dell_emc.vmax.alert_handler' \
'.snmp_alerts.AlertHandler'
def _get_alert_handler(self):
alert... | true | true |
f71409450650072e4b031dd2e4e4906f4cb8d026 | 12,788 | py | Python | recipes/hdf5/all/conanfile.py | dyndrite/conan-center-index | 106b5c2f532d5129e7ca1997e29e4e105bb3018c | [
"MIT"
] | 1 | 2021-11-11T03:07:13.000Z | 2021-11-11T03:07:13.000Z | recipes/hdf5/all/conanfile.py | dyndrite/conan-center-index | 106b5c2f532d5129e7ca1997e29e4e105bb3018c | [
"MIT"
] | null | null | null | recipes/hdf5/all/conanfile.py | dyndrite/conan-center-index | 106b5c2f532d5129e7ca1997e29e4e105bb3018c | [
"MIT"
] | null | null | null | from conans import ConanFile, CMake, tools
from conans.errors import ConanInvalidConfiguration
import functools
import os
import textwrap
required_conan_version = ">=1.43.0"
class Hdf5Conan(ConanFile):
name = "hdf5"
description = "HDF5 is a data model, library, and file format for storing and managing data."... | 48.075188 | 139 | 0.64451 | from conans import ConanFile, CMake, tools
from conans.errors import ConanInvalidConfiguration
import functools
import os
import textwrap
required_conan_version = ">=1.43.0"
class Hdf5Conan(ConanFile):
name = "hdf5"
description = "HDF5 is a data model, library, and file format for storing and managing data."... | true | true |
f71409decc2bf9a049085abd9f2ece5b6c0c08de | 1,143 | py | Python | event_sourced_bank/domain_model.py | sfinnie/event_sourced_bank | dcec864724e85ac8049a377ee2f6e2c05b1b6a2c | [
"MIT"
] | 5 | 2022-02-17T05:54:49.000Z | 2022-03-09T20:13:21.000Z | event_sourced_bank/domain_model.py | sfinnie/event_sourced_bank | dcec864724e85ac8049a377ee2f6e2c05b1b6a2c | [
"MIT"
] | 2 | 2022-02-17T14:19:16.000Z | 2022-02-17T14:21:31.000Z | event_sourced_bank/domain_model.py | sfinnie/event_sourced_bank | dcec864724e85ac8049a377ee2f6e2c05b1b6a2c | [
"MIT"
] | 1 | 2022-03-03T05:03:23.000Z | 2022-03-03T05:03:23.000Z | from eventsourcing.domain import Aggregate, event
from uuid import uuid5, NAMESPACE_URL
class Account(Aggregate):
"""A simple-as-can-be bank account"""
@event('Created')
def __init__(self):
self.balance = 0
@event('Credited')
def credit(self, amount: int):
self.balance += amount
... | 25.4 | 78 | 0.637795 | from eventsourcing.domain import Aggregate, event
from uuid import uuid5, NAMESPACE_URL
class Account(Aggregate):
@event('Created')
def __init__(self):
self.balance = 0
@event('Credited')
def credit(self, amount: int):
self.balance += amount
@event('Debited')
def debit(self,... | true | true |
f71409fcadaa0c4d31744b8e38f76955efffacf1 | 14,688 | py | Python | notion_export_enhancer/enhancer.py | Cobertos/notion-export-enhancer | 07a34d4b3daeb1ec69cd4253c089ba4d9dc5bbc3 | [
"MIT"
] | 17 | 2021-01-28T11:03:47.000Z | 2022-02-10T22:51:44.000Z | notion_export_enhancer/enhancer.py | Cobertos/notion-export-enhancer | 07a34d4b3daeb1ec69cd4253c089ba4d9dc5bbc3 | [
"MIT"
] | 3 | 2021-03-21T02:35:24.000Z | 2021-10-05T07:10:22.000Z | notion_export_enhancer/enhancer.py | Cobertos/notion-export-enhancer | 07a34d4b3daeb1ec69cd4253c089ba4d9dc5bbc3 | [
"MIT"
] | 4 | 2021-03-21T03:39:36.000Z | 2022-01-19T07:05:14.000Z | """
Takes a [Notion.so](https://notion.so) export .zip and enhances it
"""
import tempfile
import sys
import os
import time
import re
import argparse
import zipfile
import urllib.parse
from datetime import datetime
from pathlib import Path
import backoff
import requests
from emoji_extractor.extract import Extractor as... | 45.757009 | 158 | 0.701593 |
import tempfile
import sys
import os
import time
import re
import argparse
import zipfile
import urllib.parse
from datetime import datetime
from pathlib import Path
import backoff
import requests
from emoji_extractor.extract import Extractor as EmojiExtractor
from notion.client import NotionClient
from notion.block im... | true | true |
f7140a3806b353cd7b15d13284304cbfff67879e | 5,382 | py | Python | examples/old/zipline_alpaca2.py | sherrytp/TradingEvolved | 4bc9cc18244954bff37a80f67cce658bd0802b5d | [
"Apache-2.0"
] | null | null | null | examples/old/zipline_alpaca2.py | sherrytp/TradingEvolved | 4bc9cc18244954bff37a80f67cce658bd0802b5d | [
"Apache-2.0"
] | null | null | null | examples/old/zipline_alpaca2.py | sherrytp/TradingEvolved | 4bc9cc18244954bff37a80f67cce658bd0802b5d | [
"Apache-2.0"
] | 1 | 2022-03-26T07:11:18.000Z | 2022-03-26T07:11:18.000Z | # https://github.com/RomanMichaelPaolucci/AI_Stock_Trading/blob/master/IBM.csv
import abc
import threading
import time
import pandas as pd
import numpy as np
from keras.layers import Dense
from keras.models import Sequential, model_from_json
from sklearn.model_selection import train_test_split
from sklearn.metrics impo... | 30.40678 | 78 | 0.579153 |
import abc
import threading
import time
import pandas as pd
import numpy as np
from keras.layers import Dense
from keras.models import Sequential, model_from_json
from sklearn.model_selection import train_test_split
from sklearn.metrics import classification_report
from alpaca_trade_api import REST
class AlpacaPaper... | true | true |
f7140adcd0356882246b5c8d05e68682363f163a | 5,186 | py | Python | src/calculator.py | u-aaa/simple_calculator | 562231083fca44ffc0825295179af14d30df17bb | [
"MIT"
] | null | null | null | src/calculator.py | u-aaa/simple_calculator | 562231083fca44ffc0825295179af14d30df17bb | [
"MIT"
] | null | null | null | src/calculator.py | u-aaa/simple_calculator | 562231083fca44ffc0825295179af14d30df17bb | [
"MIT"
] | 1 | 2021-08-17T18:59:53.000Z | 2021-08-17T18:59:53.000Z | class Calculator:
""""
This calculator performs the following basic mathematical operations:
* Addition
* Subtraction
* Division
* Multiplication
* nth root of number
* exponent
Attributes
----------
__value : (int or float)
the calculator memory value
Methods
... | 29.299435 | 122 | 0.604898 | class Calculator:
def __init__(self, value = 0) -> None:
self.__input_validation(value)
self.__value = value
def __input_validation(self, new_value: (int, float)) -> None:
if not isinstance(new_value, (int,float)):
raise NotANumber(new_value)
def add(self, new_value:... | true | true |
f7140bdb4009f76fa9ca6d9f7fe0d41411f83b25 | 3,237 | py | Python | homeassistant/components/harmony/__init__.py | unverbraucht/core | 312af53935a1bffd58b3b35e82e31292a6ec22ad | [
"Apache-2.0"
] | 2 | 2019-11-20T20:56:59.000Z | 2021-01-03T08:52:18.000Z | homeassistant/components/harmony/__init__.py | shownor/core | b50281a9173e7fb4a37b3f813ca92876088eaac3 | [
"Apache-2.0"
] | 5 | 2020-04-26T10:50:01.000Z | 2021-03-16T21:19:46.000Z | homeassistant/components/harmony/__init__.py | winterscar/core | 5a55d508791aae65f16396691d014c73fb2095f0 | [
"Apache-2.0"
] | 1 | 2021-04-18T19:36:34.000Z | 2021-04-18T19:36:34.000Z | """The Logitech Harmony Hub integration."""
import asyncio
import logging
from homeassistant.components.remote import ATTR_ACTIVITY, ATTR_DELAY_SECS
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_HOST, CONF_NAME
from homeassistant.core import HomeAssistant, callback
from home... | 32.049505 | 88 | 0.724745 | import asyncio
import logging
from homeassistant.components.remote import ATTR_ACTIVITY, ATTR_DELAY_SECS
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_HOST, CONF_NAME
from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import ConfigEntryNotRe... | true | true |
f7140c4bcf3648504d65dea8b56a9087ccad5b5d | 16,838 | py | Python | src/utils.py | amelieEmily/RobustDARTS | b26e127c6e9c330258786f5eb77b17d367f546ff | [
"Apache-2.0"
] | null | null | null | src/utils.py | amelieEmily/RobustDARTS | b26e127c6e9c330258786f5eb77b17d367f546ff | [
"Apache-2.0"
] | null | null | null | src/utils.py | amelieEmily/RobustDARTS | b26e127c6e9c330258786f5eb77b17d367f546ff | [
"Apache-2.0"
] | null | null | null | import os
import yaml
import numpy as np
import torch
import shutil
import torchvision.transforms as transforms
from torch.autograd import Variable
from collections import namedtuple
class MyDumper(yaml.Dumper):
def increase_indent(self, flow=False, indentless=False):
return super(MyDumper, self).increase... | 34.646091 | 90 | 0.62644 | import os
import yaml
import numpy as np
import torch
import shutil
import torchvision.transforms as transforms
from torch.autograd import Variable
from collections import namedtuple
class MyDumper(yaml.Dumper):
def increase_indent(self, flow=False, indentless=False):
return super(MyDumper, self).increase... | true | true |
f7140cef6c17f8b6d97948c204447446cb386e9d | 3,433 | py | Python | samples/basic/crud/gnmi/models/cisco-ios-xr/Cisco-IOS-XR-ip-domain-cfg/gn-create-xr-ip-domain-cfg-33-ydk.py | deom119/ydk-py-samples | 1ad6cc2b798f358ff835df93d12924df308b85fc | [
"Apache-2.0"
] | 104 | 2016-03-15T17:04:01.000Z | 2021-12-31T06:09:35.000Z | samples/basic/crud/gnmi/models/cisco-ios-xr/Cisco-IOS-XR-ip-domain-cfg/gn-create-xr-ip-domain-cfg-33-ydk.py | https-maxus-github-com/ydk-py-samples | 1ad6cc2b798f358ff835df93d12924df308b85fc | [
"Apache-2.0"
] | 15 | 2016-03-15T23:09:47.000Z | 2020-08-13T12:13:18.000Z | samples/basic/crud/gnmi/models/cisco-ios-xr/Cisco-IOS-XR-ip-domain-cfg/gn-create-xr-ip-domain-cfg-33-ydk.py | https-maxus-github-com/ydk-py-samples | 1ad6cc2b798f358ff835df93d12924df308b85fc | [
"Apache-2.0"
] | 87 | 2016-04-15T16:59:23.000Z | 2021-09-18T18:05:47.000Z | #!/usr/bin/env python
#
# Copyright 2016 Cisco Systems, 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 applicab... | 32.386792 | 76 | 0.665599 |
from argparse import ArgumentParser
from urlparse import urlparse
from ydk.path import Repository
from ydk.services import CRUDService
from ydk.gnmi.providers import gNMIServiceProvider
from ydk.models.cisco_ios_xr import Cisco_IOS_XR_ip_domain_cfg \
as xr_ip_domain_cfg
import os
import logging
... | true | true |
f7140d6b0c6c816241055072b9f57a174a01a5af | 13,262 | py | Python | tests/test_zipreader.py | itsmehara/pysmi | 51347f3c4adcc030afb9bc1ded8ce72748068b1b | [
"BSD-2-Clause"
] | 121 | 2016-05-17T14:19:25.000Z | 2022-02-03T14:28:25.000Z | tests/test_zipreader.py | itsmehara/pysmi | 51347f3c4adcc030afb9bc1ded8ce72748068b1b | [
"BSD-2-Clause"
] | 61 | 2016-05-16T20:45:32.000Z | 2022-02-11T22:28:33.000Z | tests/test_zipreader.py | itsmehara/pysmi | 51347f3c4adcc030afb9bc1ded8ce72748068b1b | [
"BSD-2-Clause"
] | 50 | 2016-05-16T20:04:51.000Z | 2021-11-12T12:14:35.000Z | #
# This file is part of pysmi software.
#
# Copyright (c) 2015-2020, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pysmi/license.html
#
import sys
import os
import tempfile
try:
import unittest2 as unittest
except ImportError:
import unittest
try:
import StringIO
except ImportError:
... | 59.205357 | 87 | 0.454833 |
import sys
import os
import tempfile
try:
import unittest2 as unittest
except ImportError:
import unittest
try:
import StringIO
except ImportError:
from io import StringIO
from pysmi.reader.zipreader import ZipReader
class ZipReaderTestCase(unittest.TestCase):
zipArchive = [
80... | true | true |
f7140dc72de40d4e3c5a116bf6731262aa4867da | 4,343 | py | Python | multiaddr/multiaddr.py | DalavanCloud/py-multiaddr | e1cce8ebacc6f25d0aadc0a913edb5ae2be3ee73 | [
"Apache-2.0",
"MIT"
] | 1 | 2018-12-24T22:07:47.000Z | 2018-12-24T22:07:47.000Z | multiaddr/multiaddr.py | DalavanCloud/py-multiaddr | e1cce8ebacc6f25d0aadc0a913edb5ae2be3ee73 | [
"Apache-2.0",
"MIT"
] | null | null | null | multiaddr/multiaddr.py | DalavanCloud/py-multiaddr | e1cce8ebacc6f25d0aadc0a913edb5ae2be3ee73 | [
"Apache-2.0",
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import binascii
from copy import copy
from .codec import size_for_addr
from .codec import string_to_bytes
from .codec import bytes_to_string
from .codec import protocol_with_name
from .protocols import protocol_with_code
from .protocols import read_varint_code
class ProtocolNotFoundException(... | 31.70073 | 77 | 0.593599 |
import binascii
from copy import copy
from .codec import size_for_addr
from .codec import string_to_bytes
from .codec import bytes_to_string
from .codec import protocol_with_name
from .protocols import protocol_with_code
from .protocols import read_varint_code
class ProtocolNotFoundException(Exception):
pass
... | true | true |
f7140dda44b8773a6814740e7a397d7b4ea099ad | 223 | py | Python | profiles/urls.py | ErnestaMajute/lucentCavern | a98253c5192456637f7af6400eee39cf5363d838 | [
"W3C",
"PostgreSQL"
] | null | null | null | profiles/urls.py | ErnestaMajute/lucentCavern | a98253c5192456637f7af6400eee39cf5363d838 | [
"W3C",
"PostgreSQL"
] | null | null | null | profiles/urls.py | ErnestaMajute/lucentCavern | a98253c5192456637f7af6400eee39cf5363d838 | [
"W3C",
"PostgreSQL"
] | 1 | 2021-07-19T14:29:15.000Z | 2021-07-19T14:29:15.000Z | from django.urls import path
from . import views
urlpatterns = [
path('', views.profile, name='profile'),
path(
'order_history/<order_number>',
views.order_history,
name='order_history'),
]
| 20.272727 | 44 | 0.632287 | from django.urls import path
from . import views
urlpatterns = [
path('', views.profile, name='profile'),
path(
'order_history/<order_number>',
views.order_history,
name='order_history'),
]
| true | true |
f7140efb0d92fdd73416da8a46ac3e435a8a01e6 | 3,647 | py | Python | autosklearn/data/abstract_data_manager.py | tuggeluk/auto-sklearn | 202918e5641701c696b995039d06bfec81973cc6 | [
"BSD-3-Clause"
] | 1 | 2017-08-13T13:57:40.000Z | 2017-08-13T13:57:40.000Z | autosklearn/data/abstract_data_manager.py | chrinide/auto-sklearn | 1c6af59ff61f1d0a3b54b16a35ffbc5d2d3828cd | [
"BSD-3-Clause"
] | null | null | null | autosklearn/data/abstract_data_manager.py | chrinide/auto-sklearn | 1c6af59ff61f1d0a3b54b16a35ffbc5d2d3828cd | [
"BSD-3-Clause"
] | 1 | 2020-05-06T14:47:17.000Z | 2020-05-06T14:47:17.000Z | # -*- encoding: utf-8 -*-
import abc
import numpy as np
import scipy.sparse
from autosklearn.pipeline.implementations.OneHotEncoder import OneHotEncoder
from autosklearn.util import predict_RAM_usage
def perform_one_hot_encoding(sparse, categorical, data):
predicted_RAM_usage = float(
predict_RAM_usage(d... | 30.391667 | 79 | 0.550315 |
import abc
import numpy as np
import scipy.sparse
from autosklearn.pipeline.implementations.OneHotEncoder import OneHotEncoder
from autosklearn.util import predict_RAM_usage
def perform_one_hot_encoding(sparse, categorical, data):
predicted_RAM_usage = float(
predict_RAM_usage(data[0], categorical)) / 1... | true | true |
f7140f0751f48afe56cd8ba43fa9cea43551623a | 1,042 | py | Python | app/core/migrations/0004_recipe.py | devmahmud/recipe-app-api | 8cf5cef38e25b6a43b013d4f65b0b8115e27ef10 | [
"MIT"
] | 1 | 2020-04-05T12:55:29.000Z | 2020-04-05T12:55:29.000Z | app/core/migrations/0004_recipe.py | devmahmud/recipe-app-api | 8cf5cef38e25b6a43b013d4f65b0b8115e27ef10 | [
"MIT"
] | null | null | null | app/core/migrations/0004_recipe.py | devmahmud/recipe-app-api | 8cf5cef38e25b6a43b013d4f65b0b8115e27ef10 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.5 on 2020-04-11 04:24
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0003_ingredient'),
]
operations = [
migrations.CreateModel(
... | 35.931034 | 118 | 0.603647 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0003_ingredient'),
]
operations = [
migrations.CreateModel(
name='Recipe',
fields=[
... | true | true |
f7140f27a25c6348d47859e93ebdb50708467af5 | 3,433 | py | Python | travel_blog/travel_blog/settings.py | kennethlove/travel_blog_livestream | a6bc74e99b4922b5ac0d3a8ed0f2d5dbebde6fd2 | [
"MIT"
] | 2 | 2016-12-17T02:56:22.000Z | 2017-07-19T05:13:59.000Z | travel_blog/travel_blog/settings.py | kennethlove/travel_blog_livestream | a6bc74e99b4922b5ac0d3a8ed0f2d5dbebde6fd2 | [
"MIT"
] | null | null | null | travel_blog/travel_blog/settings.py | kennethlove/travel_blog_livestream | a6bc74e99b4922b5ac0d3a8ed0f2d5dbebde6fd2 | [
"MIT"
] | 1 | 2018-12-19T06:34:37.000Z | 2018-12-19T06:34:37.000Z | """
Django settings for travel_blog project.
Generated by 'django-admin startproject' using Django 1.10.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
impor... | 26.206107 | 91 | 0.694436 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'd$^_aoggnuh-=s=kpxb*2qkr+%)^^0cnm8h32h@qq*&1k8*g^l'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
f714115dff427760c5619baec448dfd0b676ee52 | 8,961 | py | Python | privilege/tests/group.py | luodaihong/django-privilege | 1f6a6b410221aa8be109e43326b3a9d7d614287b | [
"Apache-2.0"
] | null | null | null | privilege/tests/group.py | luodaihong/django-privilege | 1f6a6b410221aa8be109e43326b3a9d7d614287b | [
"Apache-2.0"
] | null | null | null | privilege/tests/group.py | luodaihong/django-privilege | 1f6a6b410221aa8be109e43326b3a9d7d614287b | [
"Apache-2.0"
] | null | null | null | # -*- coding: UTF-8 -*-
from django.test import Client, TestCase
from django.contrib.auth.models import Group
from django.core.cache import cache
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _
from django.utils import simplejson
from privilege.core.config import GROUP_... | 44.142857 | 87 | 0.703828 |
from django.test import Client, TestCase
from django.contrib.auth.models import Group
from django.core.cache import cache
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _
from django.utils import simplejson
from privilege.core.config import GROUP_CACHE_KEY
class Group... | true | true |
f714119de3a6993ecf4b41e82919d082c69d9996 | 2,020 | py | Python | the-complete-guide-to-bot-creation/batch_renamer/cron_scheudule.py | rulgamer03/Python-Projects | 89a2418fadce0fd4674d3f7d3fa682a9aaa4b14d | [
"Apache-2.0"
] | 1 | 2021-06-18T16:29:46.000Z | 2021-06-18T16:29:46.000Z | the-complete-guide-to-bot-creation/batch_renamer/cron_scheudule.py | rulgamer03/Python-Projects | 89a2418fadce0fd4674d3f7d3fa682a9aaa4b14d | [
"Apache-2.0"
] | null | null | null | the-complete-guide-to-bot-creation/batch_renamer/cron_scheudule.py | rulgamer03/Python-Projects | 89a2418fadce0fd4674d3f7d3fa682a9aaa4b14d | [
"Apache-2.0"
] | null | null | null | import os
import time
from pathlib import Path # from path home
import schedule
print(Path.home()) # C:\Users\angel
old_files_folder_name = "old_files"
print("Hello ")
def clean_up_downloads():
print("Cleaning up Downloads")
# get all items from the downloads filder
download_folder_path = os.path.join(P... | 34.827586 | 105 | 0.719802 | import os
import time
from pathlib import Path
import schedule
print(Path.home())
old_files_folder_name = "old_files"
print("Hello ")
def clean_up_downloads():
print("Cleaning up Downloads")
download_folder_path = os.path.join(Path.home(), "Downloads", "Downloads")
download_items = os.listdir(do... | true | true |
f71411da7bac62abcff4bebab8f8c05a980019ae | 34,992 | py | Python | tests/test_types.py | gertjanvanzwieten/nutils | ec04d66e4797398496453181f96b14ad2edae228 | [
"MIT"
] | null | null | null | tests/test_types.py | gertjanvanzwieten/nutils | ec04d66e4797398496453181f96b14ad2edae228 | [
"MIT"
] | null | null | null | tests/test_types.py | gertjanvanzwieten/nutils | ec04d66e4797398496453181f96b14ad2edae228 | [
"MIT"
] | null | null | null | from nutils.testing import *
import nutils.types
import inspect, pickle, itertools, ctypes, stringly, tempfile, io, os
import numpy
class apply_annotations(TestCase):
def test_without_annotations(self):
@nutils.types.apply_annotations
def f(a, b):
return a, b
a, b = f(1, 2)
self.assertEqual(a,... | 34.714286 | 165 | 0.658551 | from nutils.testing import *
import nutils.types
import inspect, pickle, itertools, ctypes, stringly, tempfile, io, os
import numpy
class apply_annotations(TestCase):
def test_without_annotations(self):
@nutils.types.apply_annotations
def f(a, b):
return a, b
a, b = f(1, 2)
self.assertEqual(a,... | true | true |
f7141225b2cad5e68e436f1ea8c5e6741e83043d | 1,244 | py | Python | DATA_SORT/3cities/SCAM/outputcesmscam_TREFHT_CLM5_CLM5F_001.py | islasimpson/snowpaper_2022 | d6ee677f696d7fd6e7cadef8168ce4fd8b184cac | [
"Apache-2.0"
] | null | null | null | DATA_SORT/3cities/SCAM/outputcesmscam_TREFHT_CLM5_CLM5F_001.py | islasimpson/snowpaper_2022 | d6ee677f696d7fd6e7cadef8168ce4fd8b184cac | [
"Apache-2.0"
] | null | null | null | DATA_SORT/3cities/SCAM/outputcesmscam_TREFHT_CLM5_CLM5F_001.py | islasimpson/snowpaper_2022 | d6ee677f696d7fd6e7cadef8168ce4fd8b184cac | [
"Apache-2.0"
] | null | null | null | import importlib
import xarray as xr
import numpy as np
import pandas as pd
import sys
from CASutils import filter_utils as filt
from CASutils import readdata_utils as read
from CASutils import calendar_utils as cal
importlib.reload(filt)
importlib.reload(read)
importlib.reload(cal)
expname=['SASK_CLM5_CLM5F_01.001... | 29.619048 | 88 | 0.696945 | import importlib
import xarray as xr
import numpy as np
import pandas as pd
import sys
from CASutils import filter_utils as filt
from CASutils import readdata_utils as read
from CASutils import calendar_utils as cal
importlib.reload(filt)
importlib.reload(read)
importlib.reload(cal)
expname=['SASK_CLM5_CLM5F_01.001... | true | true |
f714129360782fdce2e19567a3deb3c965cf7a55 | 5,386 | py | Python | chapter2/intogen-arrays/src/biomart/ent_exp.py | chris-zen/phd-thesis | 1eefdff8e7ca1910304e27ae42551dc64496b101 | [
"Unlicense"
] | 1 | 2015-12-22T00:53:18.000Z | 2015-12-22T00:53:18.000Z | chapter2/intogen-arrays/src/biomart/ent_exp.py | chris-zen/phd-thesis | 1eefdff8e7ca1910304e27ae42551dc64496b101 | [
"Unlicense"
] | null | null | null | chapter2/intogen-arrays/src/biomart/ent_exp.py | chris-zen/phd-thesis | 1eefdff8e7ca1910304e27ae42551dc64496b101 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
"""
Import experiments into the database
* Configuration parameters:
- The ones required by intogen.data.entity.EntityManagerFactory
"""
from wok.task import Task
from wok.element import DataElementList
from intogen.data.entity import types
from intogen.data.entity.server import EntityServer
... | 30.602273 | 132 | 0.690123 |
from wok.task import Task
from wok.element import DataElementList
from intogen.data.entity import types
from intogen.data.entity.server import EntityServer
from intogen.biomart import biomart_db_connect, DEFAULT_INSERT_SIZE, DEFAULT_DB_ENGINE
from intogen.sql import BatchInsert
from pubmed import Pubmed
task = Tas... | true | true |
f714170b4a34daae5309a0afed9dc4fc7ef8fc70 | 1,331 | py | Python | app/core/tests/test_models.py | Aqurds/django-rest-api | 685215f05c1eba8a7ef64f3f49dbd33465544099 | [
"MIT"
] | null | null | null | app/core/tests/test_models.py | Aqurds/django-rest-api | 685215f05c1eba8a7ef64f3f49dbd33465544099 | [
"MIT"
] | null | null | null | app/core/tests/test_models.py | Aqurds/django-rest-api | 685215f05c1eba8a7ef64f3f49dbd33465544099 | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.contrib.auth import get_user_model
class ModelTests(TestCase):
def test_create_user_with_email_successful(self):
"""Test creating a new user with email """
email = "test@aqurds.com"
password = "aqurds123"
user = get_user_model().objects... | 35.026316 | 79 | 0.681443 | from django.test import TestCase
from django.contrib.auth import get_user_model
class ModelTests(TestCase):
def test_create_user_with_email_successful(self):
email = "test@aqurds.com"
password = "aqurds123"
user = get_user_model().objects.create_user(email, password)
self.assertE... | true | true |
f714177fea775d7ec4d451e8fd295b515bc257fe | 14,092 | py | Python | hddcoin/hodl/val.py | u4ma-hdd/hddcoin-blockchain | 4199d1f1d87e129ae9c08bf50dd48ec3b2c08727 | [
"Apache-2.0"
] | 37 | 2021-07-08T23:42:01.000Z | 2022-03-26T21:30:10.000Z | hddcoin/hodl/val.py | u4ma-hdd/hddcoin-blockchain | 4199d1f1d87e129ae9c08bf50dd48ec3b2c08727 | [
"Apache-2.0"
] | 13 | 2021-07-11T15:12:01.000Z | 2022-03-15T08:36:18.000Z | hddcoin/hodl/val.py | u4ma-hdd/hddcoin-blockchain | 4199d1f1d87e129ae9c08bf50dd48ec3b2c08727 | [
"Apache-2.0"
] | 19 | 2021-07-10T14:09:07.000Z | 2022-03-14T11:17:05.000Z | # -*- coding: utf-8 -*-
# NOTES:
# - this file is all about the trust model for the HODL contracts. TRUST NO ONE. VALIDATE ALL.
from __future__ import annotations
import dataclasses
import decimal
import re
import time
import typing as th
import hddcoin.hodl
from clvm_tools.binutils import disassemble, int_to_bytes ... | 51.057971 | 100 | 0.648027 |
from __future__ import annotations
import dataclasses
import decimal
import re
import time
import typing as th
import hddcoin.hodl
from clvm_tools.binutils import disassemble, int_to_bytes
from hddcoin.hodl import exc as exc
from hddcoin.hodl.ContractDetails import ContractDetails
from hddcoin.hodl.util import vl... | true | true |
f71417e1074609cbc2856e5c9c5709dab7cdcb5e | 114 | py | Python | django_filtersmerger/apps.py | MPASolutions/django-filtersmerger | 9a209af142a5be15b79cb7025fdf771dac3aec35 | [
"MIT"
] | null | null | null | django_filtersmerger/apps.py | MPASolutions/django-filtersmerger | 9a209af142a5be15b79cb7025fdf771dac3aec35 | [
"MIT"
] | null | null | null | django_filtersmerger/apps.py | MPASolutions/django-filtersmerger | 9a209af142a5be15b79cb7025fdf771dac3aec35 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class DjangoFiltersMergerConfig(AppConfig):
name = 'django_filtersmerger'
| 19 | 43 | 0.807018 | from django.apps import AppConfig
class DjangoFiltersMergerConfig(AppConfig):
name = 'django_filtersmerger'
| true | true |
f7141a61052156f4da421af60a3f48ccdefcac14 | 103 | py | Python | KulliSharif/KulliSharifapp/apps.py | iqran-star/API-PROJECT | 77d021098fd17b4ce086f8e6f914a7722fa9b558 | [
"MIT"
] | null | null | null | KulliSharif/KulliSharifapp/apps.py | iqran-star/API-PROJECT | 77d021098fd17b4ce086f8e6f914a7722fa9b558 | [
"MIT"
] | null | null | null | KulliSharif/KulliSharifapp/apps.py | iqran-star/API-PROJECT | 77d021098fd17b4ce086f8e6f914a7722fa9b558 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class KullisharifappConfig(AppConfig):
name = 'KulliSharifapp'
| 17.166667 | 38 | 0.786408 | from django.apps import AppConfig
class KullisharifappConfig(AppConfig):
name = 'KulliSharifapp'
| true | true |
f7141cc9e45ecbc5219b86989037c927da949950 | 16,052 | py | Python | owslib/fes2.py | vjf/OWSLib | 9a3768c3cae21cb9a30dc4437259dfaa8dde1118 | [
"BSD-3-Clause"
] | null | null | null | owslib/fes2.py | vjf/OWSLib | 9a3768c3cae21cb9a30dc4437259dfaa8dde1118 | [
"BSD-3-Clause"
] | null | null | null | owslib/fes2.py | vjf/OWSLib | 9a3768c3cae21cb9a30dc4437259dfaa8dde1118 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: ISO-8859-15 -*-
# =============================================================================
# Copyright (c) 2021 Tom Kralidis
#
# Authors : Tom Kralidis <tomkralidis@gmail.com>
#
# Contact email: tomkralidis@gmail.com
# =============================================================================
"""... | 36.56492 | 119 | 0.637989 |
from owslib.etree import etree
from owslib import util
from owslib.namespaces import Namespaces
def get_namespaces():
n = Namespaces()
ns = n.get_namespaces(["dif", "fes", "gml", "ogc", "ows110", "xs", "xsi"])
ns[None] = n.get_namespace("fes")
return ns
namespaces = get_namespaces()
schem... | true | true |
f7141cf967ed30a0143ab32103399d5b149ab436 | 361 | py | Python | users/migrations/0002_alter_user_options.py | JeffreyDrJ/myfirstblog | 5b1f0fbd6c85027bad7d0e24d67251f41da53fac | [
"MIT"
] | null | null | null | users/migrations/0002_alter_user_options.py | JeffreyDrJ/myfirstblog | 5b1f0fbd6c85027bad7d0e24d67251f41da53fac | [
"MIT"
] | 1 | 2021-05-29T17:09:43.000Z | 2021-05-29T17:09:43.000Z | users/migrations/0002_alter_user_options.py | JeffreyDrJ/myfirstblog | 5b1f0fbd6c85027bad7d0e24d67251f41da53fac | [
"MIT"
] | null | null | null | # Generated by Django 3.2 on 2021-05-05 06:00
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='user',
options={'verbose_name': '用户管理', 'verbose... | 20.055556 | 76 | 0.592798 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='user',
options={'verbose_name': '用户管理', 'verbose_name_plural': '用户管理'},
),
]
| true | true |
f7141de0498279619548f98c6c2bc7c8730633e4 | 4,876 | py | Python | test/mitmproxy/io/test_tnetstring.py | 0x7c48/mitmproxy | f9d8f3bae3f4e681d5f4d406b7e06b099e60ecba | [
"MIT"
] | 74 | 2016-03-20T17:39:26.000Z | 2020-05-12T13:53:23.000Z | test/mitmproxy/io/test_tnetstring.py | 0x7c48/mitmproxy | f9d8f3bae3f4e681d5f4d406b7e06b099e60ecba | [
"MIT"
] | 7 | 2020-06-16T06:35:02.000Z | 2022-03-15T20:15:53.000Z | test/mitmproxy/io/test_tnetstring.py | 0x7c48/mitmproxy | f9d8f3bae3f4e681d5f4d406b7e06b099e60ecba | [
"MIT"
] | 5 | 2016-12-14T14:56:57.000Z | 2020-03-08T20:58:31.000Z | import unittest
import random
import math
import io
import struct
from mitmproxy.io import tnetstring
MAXINT = 2 ** (struct.Struct('i').size * 8 - 1) - 1
FORMAT_EXAMPLES = {
b'0:}': {},
b'0:]': [],
b'51:5:hello,39:11:12345678901#4:this,4:true!0:~4:\x00\x00\x00\x00,]}':
{b'hello': [12345678901, b'this... | 35.333333 | 381 | 0.553322 | import unittest
import random
import math
import io
import struct
from mitmproxy.io import tnetstring
MAXINT = 2 ** (struct.Struct('i').size * 8 - 1) - 1
FORMAT_EXAMPLES = {
b'0:}': {},
b'0:]': [],
b'51:5:hello,39:11:12345678901#4:this,4:true!0:~4:\x00\x00\x00\x00,]}':
{b'hello': [12345678901, b'this... | true | true |
f7141ebf7eb8ca97831794cbe3f70aa8721341b7 | 2,217 | py | Python | examples/gbml_omniglot.py | Renovamen/metallic | c3992e4b322f9d41d9b7997c472baf99c843046c | [
"MIT"
] | 5 | 2021-04-14T07:31:06.000Z | 2021-12-11T08:12:10.000Z | examples/gbml_omniglot.py | Renovamen/metallic | c3992e4b322f9d41d9b7997c472baf99c843046c | [
"MIT"
] | 1 | 2021-04-14T07:44:36.000Z | 2021-04-15T14:01:52.000Z | examples/gbml_omniglot.py | Renovamen/metallic | c3992e4b322f9d41d9b7997c472baf99c843046c | [
"MIT"
] | null | null | null | import os
import sys
base_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.append(base_path)
from torch import optim
from metallic.data.benchmarks import get_benchmarks
from metallic.data.dataloader import MetaDataLoader
from metallic.models import OmniglotCNN
from metallic.metalearners... | 25.482759 | 86 | 0.664862 | import os
import sys
base_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.append(base_path)
from torch import optim
from metallic.data.benchmarks import get_benchmarks
from metallic.data.dataloader import MetaDataLoader
from metallic.models import OmniglotCNN
from metallic.metalearners... | true | true |
f7141ff71ab7ab9a6756e73b6c2e968a45ebb526 | 2,637 | py | Python | workshops/migrations/0049_auto_20150916_0544.py | tracykteal/amy | cb19e318d36b880b1c3be2104efff42ef776118a | [
"MIT"
] | 1 | 2015-04-03T20:26:56.000Z | 2015-04-03T20:26:56.000Z | workshops/migrations/0049_auto_20150916_0544.py | tracykteal/amy | cb19e318d36b880b1c3be2104efff42ef776118a | [
"MIT"
] | 1 | 2019-12-13T11:22:47.000Z | 2019-12-13T11:22:47.000Z | workshops/migrations/0049_auto_20150916_0544.py | tracykteal/amy | cb19e318d36b880b1c3be2104efff42ef776118a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('workshops', '0048_auto_20150916_0441'),
]
operations = [
migrations.AlterField(
model_name='person',
... | 52.74 | 629 | 0.628366 |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('workshops', '0048_auto_20150916_0441'),
]
operations = [
migrations.AlterField(
model_name='person',
name='gender',
... | true | true |
f714200e0fceaf12937e196c4653e7f5a945e815 | 2,657 | bzl | Python | pkg/tests/path_test.bzl | hborawski/rules_pkg | 8d542763a3959db79175404758f46c7f3f385fa5 | [
"Apache-2.0"
] | null | null | null | pkg/tests/path_test.bzl | hborawski/rules_pkg | 8d542763a3959db79175404758f46c7f3f385fa5 | [
"Apache-2.0"
] | null | null | null | pkg/tests/path_test.bzl | hborawski/rules_pkg | 8d542763a3959db79175404758f46c7f3f385fa5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 28.880435 | 78 | 0.637938 |
load("@bazel_skylib//lib:unittest.bzl", "analysistest", "asserts", "unittest")
load("//:mappings.bzl", "pkg_mkdirs")
load("//:path.bzl", "compute_data_path")
er_test = analysistest.target_under_test(env)
expect = ctx.attr.expected_path
if expect.startswith('tests'):
expect = ctx.... | true | true |
f71421b82991b2284752df5cbc3abe620e97baaf | 8,509 | py | Python | tests/test_version.py | dfroger/conda | c0f99ff46b217d081501e66f4dcd7bcdb5d9c6aa | [
"BSD-3-Clause"
] | null | null | null | tests/test_version.py | dfroger/conda | c0f99ff46b217d081501e66f4dcd7bcdb5d9c6aa | [
"BSD-3-Clause"
] | null | null | null | tests/test_version.py | dfroger/conda | c0f99ff46b217d081501e66f4dcd7bcdb5d9c6aa | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function, absolute_import
import unittest
from conda.version import ver_eval, VersionSpec, VersionOrder, normalized_version
class TestVersionSpec(unittest.TestCase):
def test_version_order(self):
versions = [
(VersionOrder("0.4"), [[0], [0], [4]]),
... | 50.349112 | 104 | 0.466212 | from __future__ import print_function, absolute_import
import unittest
from conda.version import ver_eval, VersionSpec, VersionOrder, normalized_version
class TestVersionSpec(unittest.TestCase):
def test_version_order(self):
versions = [
(VersionOrder("0.4"), [[0], [0], [4]]),
... | true | true |
f7142361616cc1d896aba889094e5bdfd2013e97 | 178 | py | Python | frederic/hello_world.py | infelane/python-for-java-devs | 56f313f89ad8603598f879f31e0d9a35795e50e3 | [
"Apache-2.0"
] | 1 | 2019-10-20T16:05:30.000Z | 2019-10-20T16:05:30.000Z | frederic/hello_world.py | infelane/python-for-java-devs | 56f313f89ad8603598f879f31e0d9a35795e50e3 | [
"Apache-2.0"
] | 1 | 2020-07-10T09:09:58.000Z | 2020-07-10T09:09:58.000Z | frederic/hello_world.py | infelane/python-for-java-devs | 56f313f89ad8603598f879f31e0d9a35795e50e3 | [
"Apache-2.0"
] | 3 | 2020-07-10T07:46:51.000Z | 2022-02-21T08:58:45.000Z | import logging
def say(n):
logging.basicConfig(level=logging.DEBUG)
for i in range(n):
logging.info(str(i) + ": Hello world")
say(1)
if __name__=="__main__":
say(3)
| 14.833333 | 42 | 0.662921 | import logging
def say(n):
logging.basicConfig(level=logging.DEBUG)
for i in range(n):
logging.info(str(i) + ": Hello world")
say(1)
if __name__=="__main__":
say(3)
| true | true |
f71423f13ea7f981319138912b683e99f21321aa | 3,285 | py | Python | invenio_assets/npm.py | pazembrz/invenio-assets | dd9acd8f0bf1a10eb2593949d9f1b6cc6d95ef43 | [
"MIT"
] | 1 | 2018-10-24T11:17:30.000Z | 2018-10-24T11:17:30.000Z | invenio_assets/npm.py | okraskaj/invenio-assets | e0f48743982d16cffa312fa9fe392c62db906d89 | [
"MIT"
] | null | null | null | invenio_assets/npm.py | okraskaj/invenio-assets | e0f48743982d16cffa312fa9fe392c62db906d89 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Bundle class with support for npm dependencies."""
from __future__ import absolut... | 27.605042 | 73 | 0.635616 |
from __future__ import absolute_import, print_function
from collections import defaultdict
import semver
from flask_assets import Bundle as BundleBase
from pkg_resources import parse_version
from speaklater import is_lazy_string
__all__ = ('LazyNpmBundle', 'NpmBundle', 'extract_deps', 'make_semver', )
cla... | true | true |
f7142447c41c8ccca6568a1c6a262abb22071efc | 2,371 | py | Python | geometry/matrix.py | GuillaumeRochette/HumanViewSynthesis | d65ea8744e284ec956bbc04f294f05e47731360f | [
"Apache-2.0"
] | 10 | 2021-11-30T05:56:10.000Z | 2022-03-16T07:06:16.000Z | geometry/matrix.py | GuillaumeRochette/Reconstruction3D | 358d9cb55486ad0f81a31df8ab4159153765e7e5 | [
"Apache-2.0"
] | 1 | 2022-01-10T09:27:22.000Z | 2022-01-10T09:27:22.000Z | geometry/matrix.py | GuillaumeRochette/Reconstruction3D | 358d9cb55486ad0f81a31df8ab4159153765e7e5 | [
"Apache-2.0"
] | null | null | null | from typing import Tuple
import torch
from torch import Tensor
def homogeneous(A: Tensor, b: Tensor) -> Tensor:
"""
Converts heterogeneous matrix into homogeneous matrix.
:param A: Heterogeneous matrix of shape [*, N, N].
:param b: Heterogeneous vector of shape [*, N, 1].
:return: Homogeneous mat... | 25.223404 | 92 | 0.547027 | from typing import Tuple
import torch
from torch import Tensor
def homogeneous(A: Tensor, b: Tensor) -> Tensor:
assert A.shape[:-2] == b.shape[:-2]
assert A.shape[-2] == A.shape[-1] == b.shape[-2]
assert b.shape[-1] == 1
s, n = A.shape[:-2], A.shape[-2]
c = torch.zeros(s + (1, n), dtype=A.dtype,... | true | true |
f714244989fbad4476876ccb83e7dfefdbb4a895 | 1,275 | py | Python | hardware/ci/build.py | Axford/AFRo | e57369c2d37e6001587cd37307d36c5f9f112c53 | [
"MIT"
] | null | null | null | hardware/ci/build.py | Axford/AFRo | e57369c2d37e6001587cd37307d36c5f9f112c53 | [
"MIT"
] | null | null | null | hardware/ci/build.py | Axford/AFRo | e57369c2d37e6001587cd37307d36c5f9f112c53 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Run the various build scripts
import sys
import os
from parse import parse_machines
from machines import machines
from assemblies import assemblies
from vitamins import vitamins
from printed import printed
from guides import guides
from publish import publish
def build(do_publish=0):
prin... | 22.368421 | 65 | 0.620392 |
import sys
import os
from parse import parse_machines
from machines import machines
from assemblies import assemblies
from vitamins import vitamins
from printed import printed
from guides import guides
from publish import publish
def build(do_publish=0):
print("Build")
print("-----")
outfile = 'ha... | true | true |
f7142459f0d44ac68274d37d43ee06f916581229 | 301 | py | Python | kai/model/__init__.py | Pylons/kai | 8c843bdb7508a25dea094fdd38bd5b5cc521d486 | [
"BSD-3-Clause"
] | 1 | 2021-04-27T19:13:28.000Z | 2021-04-27T19:13:28.000Z | kai/model/__init__.py | Pylons/kai | 8c843bdb7508a25dea094fdd38bd5b5cc521d486 | [
"BSD-3-Clause"
] | null | null | null | kai/model/__init__.py | Pylons/kai | 8c843bdb7508a25dea094fdd38bd5b5cc521d486 | [
"BSD-3-Clause"
] | null | null | null | """CouchDB Models"""
from kai.model.blog import Article
from kai.model.documentation import Documentation
from kai.model.generics import Comment, Rating
from kai.model.human import Human
from kai.model.paste import Paste
from kai.model.snippet import Snippet
from kai.model.traceback import Traceback
| 33.444444 | 49 | 0.827243 | from kai.model.blog import Article
from kai.model.documentation import Documentation
from kai.model.generics import Comment, Rating
from kai.model.human import Human
from kai.model.paste import Paste
from kai.model.snippet import Snippet
from kai.model.traceback import Traceback
| true | true |
f714245b3cc1fcb188d83f0e5b42aacd5f5699f1 | 1,095 | py | Python | beautiful_earth/app/routes.py | craklyn/space-apps-2019 | f0a7e28907b9471b207d75eb840b1bd27ef99547 | [
"MIT"
] | 6 | 2021-08-16T14:48:30.000Z | 2022-01-25T01:06:03.000Z | beautiful_earth/app/routes.py | craklyn/space-apps-2019 | f0a7e28907b9471b207d75eb840b1bd27ef99547 | [
"MIT"
] | 3 | 2021-06-08T20:29:10.000Z | 2022-03-12T00:02:34.000Z | beautiful_earth/app/routes.py | craklyn/space-apps-2019 | f0a7e28907b9471b207d75eb840b1bd27ef99547 | [
"MIT"
] | 1 | 2019-10-21T05:42:25.000Z | 2019-10-21T05:42:25.000Z | from flask import render_template
from flask import request
from flask import send_file
from flask import make_response
import cv2
import urllib
import numpy as np
# Add the pytorch folder to our script path
import sys
# insert at 1, 0 is the script path (or '' in REPL)
sys.path.insert(1, '/Users/danielblackburn/space... | 28.076923 | 121 | 0.734247 | from flask import render_template
from flask import request
from flask import send_file
from flask import make_response
import cv2
import urllib
import numpy as np
import sys
sys.path.insert(1, '/Users/danielblackburn/space-apps-2019/beautiful_earth/pytorch-CycleGAN-and-pix2pix')
import inference
from inference imp... | true | true |
f71424d21246fe49464870c05f4d12121a8e0237 | 79,831 | py | Python | core/domain/user_services.py | AbhinavGopal/oppiabackup | e5ae39b20623d4389885802d670b0142d82034ea | [
"Apache-2.0"
] | 1 | 2022-02-22T09:27:22.000Z | 2022-02-22T09:27:22.000Z | core/domain/user_services.py | IMADILKHAN/oppia | 454bf732dfd0087bcc0b8b7cd65d80ba386f4929 | [
"Apache-2.0"
] | null | null | null | core/domain/user_services.py | IMADILKHAN/oppia | 454bf732dfd0087bcc0b8b7cd65d80ba386f4929 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 39.075379 | 5,138 | 0.710539 |
from __future__ import absolute_import
from __future__ import unicode_literals
import datetime
import hashlib
import imghdr
import logging
import re
from constants import constants
from core.domain import role_services
from core.domain import user_domain
from core.platform import models
import fe... | true | true |
f7142608165d85e92bb7ae364ff06ed93053dee8 | 7,827 | py | Python | python/scripts/traj_gen/chomp_trajectory.py | tomcattigerkkk/traj_gen | d01882c17d8e979860fb1f09defa968a86adb494 | [
"MIT"
] | null | null | null | python/scripts/traj_gen/chomp_trajectory.py | tomcattigerkkk/traj_gen | d01882c17d8e979860fb1f09defa968a86adb494 | [
"MIT"
] | null | null | null | python/scripts/traj_gen/chomp_trajectory.py | tomcattigerkkk/traj_gen | d01882c17d8e979860fb1f09defa968a86adb494 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
from .traj_gen_base import TrajGen
import numpy as np
import casadi as ca
from scipy.interpolate import interp1d
class CHOMPTrajGen(TrajGen):
def __init__(self, knots_, dim_, pntDensity_):
super().__init__(knots_, dim_)
self.pntDensity = pntDensity_
asse... | 39.530303 | 157 | 0.505302 |
from .traj_gen_base import TrajGen
import numpy as np
import casadi as ca
from scipy.interpolate import interp1d
class CHOMPTrajGen(TrajGen):
def __init__(self, knots_, dim_, pntDensity_):
super().__init__(knots_, dim_)
self.pntDensity = pntDensity_
assert knots_.shape[0]==2, 'For optimal... | true | true |
f71428346cb81628139bf8ea3efe2d5d9ce53196 | 1,858 | py | Python | setup.py | infosmith/batteries | e1e018043392997ec43f55f874231d5feb684110 | [
"MIT"
] | null | null | null | setup.py | infosmith/batteries | e1e018043392997ec43f55f874231d5feb684110 | [
"MIT"
] | 2 | 2022-01-04T06:14:09.000Z | 2022-01-04T09:18:14.000Z | setup.py | infosmith/helpers | e1e018043392997ec43f55f874231d5feb684110 | [
"MIT"
] | null | null | null | """Package setup script."""
from setuptools import setup, find_packages
# Python packaging constants
CLASSIFIERS = [
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.... | 29.03125 | 74 | 0.678149 |
from setuptools import setup, find_packages
CLASSIFIERS = [
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Pr... | true | true |
f71428e49e034b578ef70ffe2a26d9dc7901f807 | 403 | py | Python | DiscordOauth2/wsgi.py | TShoKT/Django-DiscordOauth2 | 2deab89d4bbb0f36ef405e8f29f689525df479e2 | [
"MIT"
] | 4 | 2021-09-01T10:55:06.000Z | 2022-02-07T16:37:22.000Z | DiscordOauth2/wsgi.py | TShoKT/Django-DiscordOauth2 | 2deab89d4bbb0f36ef405e8f29f689525df479e2 | [
"MIT"
] | 1 | 2021-10-03T09:45:05.000Z | 2021-10-06T18:20:17.000Z | DiscordOauth2/wsgi.py | TShoKT/Django-DiscordOauth2 | 2deab89d4bbb0f36ef405e8f29f689525df479e2 | [
"MIT"
] | 3 | 2021-09-11T18:49:33.000Z | 2021-12-28T16:49:42.000Z | """
WSGI config for DiscordOauth2 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO... | 23.705882 | 78 | 0.791563 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'DiscordOauth2.settings')
application = get_wsgi_application()
| true | true |
f7142941df2d1fb97ae8bcfca78c1126c1828d24 | 5,515 | py | Python | docs/cornell CS class/Lesson 29. Coroutines/demos/animate3.py | LizzieDeng/kalman_fliter_analysis | 50e728f32c496c3fcbb8ca3ee00857b999b88d99 | [
"MIT"
] | null | null | null | docs/cornell CS class/Lesson 29. Coroutines/demos/animate3.py | LizzieDeng/kalman_fliter_analysis | 50e728f32c496c3fcbb8ca3ee00857b999b88d99 | [
"MIT"
] | null | null | null | docs/cornell CS class/Lesson 29. Coroutines/demos/animate3.py | LizzieDeng/kalman_fliter_analysis | 50e728f32c496c3fcbb8ca3ee00857b999b88d99 | [
"MIT"
] | null | null | null | """
A module to show off a timed animation using coroutines
Making timed animations is messy, because we have to add a lot of
class attributes for all of the loop variables. A cleaner way is
to do this with coroutines. Each animation is its own coroutine.
The advantage of the coroutine is that yield allows you to p... | 32.827381 | 84 | 0.616863 |
import introcs
import random
import math
from game2d import *
import time
import random
next(self._animator)
def draw(self):
self.image.draw(self.view)
def _animate_turn(self,direction):
sangle = self.image.angle
if direction == 'left':
fangle = sangle+90
el... | true | true |
f7142aa0459addf88df1549845b063ae44233e96 | 5,200 | py | Python | azure-devops/azext_devops/vstsCompressed/models/models.py | vijayraavi/azure-devops-cli-extension | 88f1420c5815cb09bea15b050f4c553e0f326dad | [
"MIT"
] | null | null | null | azure-devops/azext_devops/vstsCompressed/models/models.py | vijayraavi/azure-devops-cli-extension | 88f1420c5815cb09bea15b050f4c553e0f326dad | [
"MIT"
] | 37 | 2020-04-27T07:45:19.000Z | 2021-04-05T07:27:15.000Z | azure-devops/azext_devops/vstsCompressed/models/models.py | vijayraavi/azure-devops-cli-extension | 88f1420c5815cb09bea15b050f4c553e0f326dad | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 32.911392 | 104 | 0.59 |
from msrest.serialization import Model
class ApiResourceLocation(Model):
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'area': {'key': 'area', 'type': 'str'},
'resource_name': {'key': 'resourceName', 'type': 'str'},
'route_template': {'key': 'routeTemplate', 'typ... | true | true |
f7142b7c798ada6e8b0a89e5f7341c459d5053a1 | 6,028 | py | Python | client.py | ElianMariano/Sistema-de-Trocas | a1caf6a1503cfa7a81fd48fbe81f19fd91f0eb3c | [
"MIT"
] | null | null | null | client.py | ElianMariano/Sistema-de-Trocas | a1caf6a1503cfa7a81fd48fbe81f19fd91f0eb3c | [
"MIT"
] | null | null | null | client.py | ElianMariano/Sistema-de-Trocas | a1caf6a1503cfa7a81fd48fbe81f19fd91f0eb3c | [
"MIT"
] | null | null | null | #from lib2to3.pytree import convert
import socket
import sys
import _thread
import json
import os
import time
import zmq
IP_ADDRESS = '127.0.0.1'
TOPIC = None
fila_msgs = []
conf = []
# Envia os dados
def enviar():
ctx = zmq.Context()
sock = ctx.socket(zmq.PUB)
sock.connect(f"tcp://{IP_ADDRESS}:5500")
... | 30.291457 | 62 | 0.503152 |
import socket
import sys
import _thread
import json
import os
import time
import zmq
IP_ADDRESS = '127.0.0.1'
TOPIC = None
fila_msgs = []
conf = []
def enviar():
ctx = zmq.Context()
sock = ctx.socket(zmq.PUB)
sock.connect(f"tcp://{IP_ADDRESS}:5500")
codigo = 5
while True:
if(len(fi... | true | true |
f7142c06ba23c1277d4a118307c17e2599d7a4f9 | 8,434 | py | Python | third_party/tlslite/tlslite/utils/cryptomath.py | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 575 | 2015-06-18T23:58:20.000Z | 2022-03-23T09:32:39.000Z | third_party/tlslite/tlslite/utils/cryptomath.py | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 113 | 2015-05-04T09:58:14.000Z | 2022-01-31T19:35:03.000Z | third_party/tlslite/tlslite/utils/cryptomath.py | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 52 | 2015-07-14T10:40:50.000Z | 2022-03-15T01:11:49.000Z | # Authors:
# Trevor Perrin
# Martin von Loewis - python 3 port
# Yngve Pettersen (ported by Paul Sokolovsky) - TLS 1.2
#
# See the LICENSE file for legal information regarding use of this file.
"""cryptomath module
This module has basic math/crypto code."""
from __future__ import print_function
import os
impor... | 26.945687 | 76 | 0.509248 |
from __future__ import print_function
import os
import math
import base64
import binascii
from .compat import *
try:
from M2Crypto import m2
m2cryptoLoaded = True
except ImportError:
m2cryptoLoaded = False
try:
import gmpy
gmpyLoaded = True
except ImportError:
gmpyLoaded = Fals... | true | true |
f7142c82611ea8aa0b9d89d7f852e92f1eb6cabd | 2,892 | py | Python | implementation/server/factories/files.py | Aincient/cleo | 933ef372fa7847d943206d72bfb03c201dbafbd6 | [
"Apache-2.0"
] | null | null | null | implementation/server/factories/files.py | Aincient/cleo | 933ef372fa7847d943206d72bfb03c201dbafbd6 | [
"Apache-2.0"
] | null | null | null | implementation/server/factories/files.py | Aincient/cleo | 933ef372fa7847d943206d72bfb03c201dbafbd6 | [
"Apache-2.0"
] | 3 | 2018-10-01T12:04:36.000Z | 2021-01-07T09:30:50.000Z | """
Files for testing.
"""
import base64
import tempfile
from PIL import Image
from six import BytesIO
__all__ = (
'BASE64_PREFIX',
'TEMPORARY_FILE_LIST',
'TEMPORARY_FILE_LIST_FILE_CONTENT',
'TEMPORARY_FILE_LIST_FILE_BASE64',
'TEMPORARY_FILE_VIEW',
'TEMPORARY_FILE_VIEW_FILE_CONTENT',
'TEM... | 31.434783 | 77 | 0.802213 |
import base64
import tempfile
from PIL import Image
from six import BytesIO
__all__ = (
'BASE64_PREFIX',
'TEMPORARY_FILE_LIST',
'TEMPORARY_FILE_LIST_FILE_CONTENT',
'TEMPORARY_FILE_LIST_FILE_BASE64',
'TEMPORARY_FILE_VIEW',
'TEMPORARY_FILE_VIEW_FILE_CONTENT',
'TEMPORARY_FILE_VIEW_FILE_BASE6... | true | true |
f7142cca0f48800d8b25507f5d1b79a5a49af070 | 245 | py | Python | simdata/hakata/script/dummy_db.py | RDC4Smart-Mobility/UniSim | 872a22ccdac859b9a12f11a9f5d20467e9db18ee | [
"MIT"
] | null | null | null | simdata/hakata/script/dummy_db.py | RDC4Smart-Mobility/UniSim | 872a22ccdac859b9a12f11a9f5d20467e9db18ee | [
"MIT"
] | null | null | null | simdata/hakata/script/dummy_db.py | RDC4Smart-Mobility/UniSim | 872a22ccdac859b9a12f11a9f5d20467e9db18ee | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from unisim import DB
class DummyDB(DB):
def connect(self):
pass
def disconnect(self):
pass
def init_table(self):
pass
def store(self, tick, objects):
pass
| 14.411765 | 35 | 0.526531 |
from unisim import DB
class DummyDB(DB):
def connect(self):
pass
def disconnect(self):
pass
def init_table(self):
pass
def store(self, tick, objects):
pass
| true | true |
f7142d1dd2c3894eb628d06b70747641aac633ec | 7,231 | py | Python | paramunittest.py | rik0/ParamUnittest | e064fb382c6da355ae7242e79ea1bf14fb2b43e9 | [
"BSD-2-Clause"
] | 7 | 2016-03-17T07:34:39.000Z | 2019-08-09T05:31:38.000Z | paramunittest.py | rik0/ParamUnittest | e064fb382c6da355ae7242e79ea1bf14fb2b43e9 | [
"BSD-2-Clause"
] | 2 | 2015-01-18T03:35:14.000Z | 2017-03-27T18:11:41.000Z | paramunittest.py | rik0/ParamUnittest | e064fb382c6da355ae7242e79ea1bf14fb2b43e9 | [
"BSD-2-Clause"
] | 4 | 2015-10-23T07:42:31.000Z | 2021-01-15T02:28:11.000Z | # Copyright 2012 Enrico Franchi
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#... | 40.396648 | 89 | 0.603098 |
# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
import copy
import unittest
import collections
import importlib
__all__ = [
'parametrized',
'ParametrizedTestCase',
]
def _process_parameters(parameters_seq):
processed_parameters_seq = []
for parameters i... | true | true |
f7142e78dcfc85a5990b30355dbe0eeb484752fd | 1,454 | py | Python | download_data.py | EugenHotaj/ray-automl | f516c06f8c24559edac120941cd36e8720ecd228 | [
"MIT"
] | null | null | null | download_data.py | EugenHotaj/ray-automl | f516c06f8c24559edac120941cd36e8720ecd228 | [
"MIT"
] | null | null | null | download_data.py | EugenHotaj/ray-automl | f516c06f8c24559edac120941cd36e8720ecd228 | [
"MIT"
] | null | null | null | """Script to download and cache all data."""
import os
from typing import List
import openml
from automl import openml_utils
BENCHMARK_TASKS = {"adult": 7592, "nomao": 9977, "phoneme": 9952}
FOLD_COL = "fold"
def download_openml_tasks(task_ids: List[int]):
"""Downloads the given task_ids from OpenML and dumps... | 33.813953 | 88 | 0.672627 |
import os
from typing import List
import openml
from automl import openml_utils
BENCHMARK_TASKS = {"adult": 7592, "nomao": 9977, "phoneme": 9952}
FOLD_COL = "fold"
def download_openml_tasks(task_ids: List[int]):
tasks = openml.tasks.get_tasks(
task_ids, download_data=True, download_qualities=False
... | true | true |
f7142ea121c4efd6ef516ca222b10a3ea61550d2 | 3,746 | py | Python | data_loader.py | SmirnovKol/recurrent-visual-attention | 4cb8d9e768ae35f38439278bb8a7b4d6b253a537 | [
"MIT"
] | 463 | 2017-12-25T12:36:08.000Z | 2022-03-29T17:05:19.000Z | data_loader.py | Pandinosaurus/recurrent-visual-attention | a38ac8958ebf1c61a10c4d5320f1e31d3d0b73dd | [
"MIT"
] | 44 | 2018-01-16T08:41:36.000Z | 2021-12-17T06:23:13.000Z | data_loader.py | Pandinosaurus/recurrent-visual-attention | a38ac8958ebf1c61a10c4d5320f1e31d3d0b73dd | [
"MIT"
] | 135 | 2017-12-26T05:09:03.000Z | 2022-03-27T00:40:42.000Z | import numpy as np
from utils import plot_images
import torch
from torchvision import datasets
from torchvision import transforms
from torch.utils.data.sampler import SubsetRandomSampler
def get_train_valid_loader(
data_dir,
batch_size,
random_seed,
valid_size=0.1,
shuffle=True,
show_sample=F... | 30.704918 | 83 | 0.664976 | import numpy as np
from utils import plot_images
import torch
from torchvision import datasets
from torchvision import transforms
from torch.utils.data.sampler import SubsetRandomSampler
def get_train_valid_loader(
data_dir,
batch_size,
random_seed,
valid_size=0.1,
shuffle=True,
show_sample=F... | true | true |
f7142ff349e7ada53e51a9c796f37baacff04ec9 | 1,290 | py | Python | cl_progress/cl_progress.py | CORDEA/myPythonModules | 790674a8f155a94804242b9b220eb6ac6efc8328 | [
"Apache-2.0"
] | null | null | null | cl_progress/cl_progress.py | CORDEA/myPythonModules | 790674a8f155a94804242b9b220eb6ac6efc8328 | [
"Apache-2.0"
] | null | null | null | cl_progress/cl_progress.py | CORDEA/myPythonModules | 790674a8f155a94804242b9b220eb6ac6efc8328 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# encoding:utf-8
#
# Copyright 2015-2017 Yoshihiro Tanaka
# 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 requi... | 30 | 75 | 0.66124 |
__Author__ = "Yoshihiro Tanaka"
__date__ = "2015-02-02"
def progress(sent, flag):
import sys, commands
_SUC = '[SUCCEED]'
_FAL = '[FAILED]'
colors = {'clear': '\033[0m', 'red': '\033[31m', 'green': '\033[32m'}
width = int(commands.getoutput('stty size').split()[1])
if ... | true | true |
f71430b176a3802c19f4d2638a14ba0259909022 | 863 | py | Python | src/utils/osrm.py | sashakh/vroom-scripts | 46b8abce2d8680f5f854965cccf57ac7856fe092 | [
"BSD-2-Clause"
] | null | null | null | src/utils/osrm.py | sashakh/vroom-scripts | 46b8abce2d8680f5f854965cccf57ac7856fe092 | [
"BSD-2-Clause"
] | null | null | null | src/utils/osrm.py | sashakh/vroom-scripts | 46b8abce2d8680f5f854965cccf57ac7856fe092 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
import requests
DEFAULT_IP = '0.0.0.0'
DEFAULT_PORT = '5000'
def format_request(service,
locs,
ip = DEFAULT_IP,
port = DEFAULT_PORT):
req = 'http://' + ip + ':' + port + '/'
req += service + '/v1/car/'
for loc in ... | 23.324324 | 80 | 0.559676 |
import requests
DEFAULT_IP = '0.0.0.0'
DEFAULT_PORT = '5000'
def format_request(service,
locs,
ip = DEFAULT_IP,
port = DEFAULT_PORT):
req = 'http://' + ip + ':' + port + '/'
req += service + '/v1/car/'
for loc in locs:
req += str(loc[0]) + ',' + str... | true | true |
f7143197fc3c82b21a8db9b00f7324492cb578fa | 1,210 | py | Python | src/prometheus_async/__init__.py | hynek/prometheus_async | 4abb25ac4f893c951131123989013df1286338d0 | [
"Apache-2.0"
] | 49 | 2015-10-03T00:04:12.000Z | 2019-05-13T10:32:02.000Z | src/prometheus_async/__init__.py | hynek/prometheus_async | 4abb25ac4f893c951131123989013df1286338d0 | [
"Apache-2.0"
] | 13 | 2015-10-07T21:15:23.000Z | 2019-02-09T17:12:46.000Z | src/prometheus_async/__init__.py | hynek/prometheus_async | 4abb25ac4f893c951131123989013df1286338d0 | [
"Apache-2.0"
] | 12 | 2015-10-15T23:05:03.000Z | 2019-02-09T15:49:07.000Z | # SPDX-License-Identifier: Apache-2.0
#
# Copyright 2016 Hynek Schlawack
#
# 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... | 25.744681 | 74 | 0.733058 |
__version__ = "22.3.0.dev0"
__title__ = "prometheus_async"
__description__ = (__doc__ or "").strip()
__uri__ = "https://prometheus-async.readthedocs.io/"
__author__ = "Hynek Schlawack"
__email__ = "hs@ox.cx"
__license__ = "Apache License, Version 2.0"
__copyright__ = f"Copyright (c) 2016 {__author... | true | true |
f71431a16aaaf2c0f14e8c3eceaefa14bf68a0e5 | 5,134 | py | Python | scrolls/errors.py | a-bison/scrolls-py | cd531bd0755a107e79afc5bd8a23f0905e1fc120 | [
"BSD-3-Clause"
] | null | null | null | scrolls/errors.py | a-bison/scrolls-py | cd531bd0755a107e79afc5bd8a23f0905e1fc120 | [
"BSD-3-Clause"
] | null | null | null | scrolls/errors.py | a-bison/scrolls-py | cd531bd0755a107e79afc5bd8a23f0905e1fc120 | [
"BSD-3-Clause"
] | null | null | null | """
Errors not dependent on any specific Scrolls types.
Typically, you won't need to instantiate any of these yourself. The base exception
for _all_ Scrolls errors is `ScrollError`. Any error that occurs while validating
script syntax or interpreting scripts will inherit from `PositionalError`.
"""
import fun... | 28.681564 | 90 | 0.599533 |
import functools
import math
import typing as t
__all__ = (
"format_positional_error",
"ScrollError",
"PositionalError",
"ParseError",
"ParseEofError",
"ParseExpectError",
"TokenizeError",
"TokenizeEofError"
)
@functools.lru_cache(128)
def format_positional_error(
... | true | true |
f71431e0bae919d25b50e4bc0811e7098763a471 | 173 | py | Python | virtual/lib/python3.6/site-packages/pylint/test/functional/broad_except.py | drewheathens/The-Moringa-Tribune | 98ee4d63c9df6f1f7497fc6876960a822d914500 | [
"MIT"
] | 69 | 2019-02-18T12:07:35.000Z | 2022-03-12T10:38:32.000Z | virtual/lib/python3.6/site-packages/pylint/test/functional/broad_except.py | drewheathens/The-Moringa-Tribune | 98ee4d63c9df6f1f7497fc6876960a822d914500 | [
"MIT"
] | 32 | 2018-05-01T05:24:43.000Z | 2022-03-11T23:20:39.000Z | virtual/lib/python3.6/site-packages/pylint/test/functional/broad_except.py | drewheathens/The-Moringa-Tribune | 98ee4d63c9df6f1f7497fc6876960a822d914500 | [
"MIT"
] | 28 | 2019-03-22T01:07:13.000Z | 2022-02-21T16:38:27.000Z | # pylint: disable=missing-docstring
from __future__ import print_function
__revision__ = 0
try:
__revision__ += 1
except Exception: # [broad-except]
print('error')
| 19.222222 | 37 | 0.739884 |
from __future__ import print_function
__revision__ = 0
try:
__revision__ += 1
except Exception:
print('error')
| true | true |
f71431e15f97613abc12e56b17caf9d892de3bd9 | 1,359 | py | Python | setup.py | butla/bravado-falcon | 2c377db486150a6e0b93a4fb5970be9cf3e769d0 | [
"MIT"
] | 2 | 2017-01-16T07:51:35.000Z | 2020-02-17T21:44:13.000Z | setup.py | butla/bravado-falcon | 2c377db486150a6e0b93a4fb5970be9cf3e769d0 | [
"MIT"
] | null | null | null | setup.py | butla/bravado-falcon | 2c377db486150a6e0b93a4fb5970be9cf3e769d0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os.path
from setuptools import setup
project_name = 'bravado-falcon'
version = '0.1.0'
setup_dir = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(setup_dir, 'requirements.txt')) as req_file:
requirements = [lib.split('==')[0] for lib in req_file.readlines()]
with ... | 32.357143 | 71 | 0.65195 |
import os.path
from setuptools import setup
project_name = 'bravado-falcon'
version = '0.1.0'
setup_dir = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(setup_dir, 'requirements.txt')) as req_file:
requirements = [lib.split('==')[0] for lib in req_file.readlines()]
with open(os.path.join(setup... | true | true |
f714331b5f57e69f93e8004c75487a73e41833cf | 1,224 | py | Python | config/urls.py | kdagley/publicrelations | dbf424c247028ed93881a5375b22d196cfeed175 | [
"BSD-3-Clause"
] | null | null | null | config/urls.py | kdagley/publicrelations | dbf424c247028ed93881a5375b22d196cfeed175 | [
"BSD-3-Clause"
] | null | null | null | config/urls.py | kdagley/publicrelations | dbf424c247028ed93881a5375b22d196cfeed175 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic import TemplateView
urlpatterns = [
url(r'^$', TemplateView.as_view(templ... | 34.971429 | 91 | 0.693627 |
from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic import TemplateView
urlpatterns = [
url(r'^$', TemplateView.as_view(template_name='pages/home.ht... | true | true |
f714342388aea63bff603443250cc030b85ccfb7 | 7,152 | py | Python | specklepy/api/resources/branch.py | jsdbroughton/specklepy | 81a98ea938106001abae308e3cfe04a2c588f06a | [
"Apache-2.0"
] | null | null | null | specklepy/api/resources/branch.py | jsdbroughton/specklepy | 81a98ea938106001abae308e3cfe04a2c588f06a | [
"Apache-2.0"
] | null | null | null | specklepy/api/resources/branch.py | jsdbroughton/specklepy | 81a98ea938106001abae308e3cfe04a2c588f06a | [
"Apache-2.0"
] | null | null | null | from gql import gql
from specklepy.api.resource import ResourceBase
from specklepy.api.models import Branch
from specklepy.logging import metrics
NAME = "branch"
METHODS = ["create"]
class Resource(ResourceBase):
"""API Access class for branches"""
def __init__(self, account, basepath, client) -> None:
... | 32.958525 | 97 | 0.457634 | from gql import gql
from specklepy.api.resource import ResourceBase
from specklepy.api.models import Branch
from specklepy.logging import metrics
NAME = "branch"
METHODS = ["create"]
class Resource(ResourceBase):
def __init__(self, account, basepath, client) -> None:
super().__init__(
accoun... | true | true |
f71434b3c8211cc2ab644b5205326ec0c652e164 | 5,009 | py | Python | cnn/model_search.py | badrutdinovrr/darts | 434708e63cbda8f710d3c1810d06ad31c11db923 | [
"Apache-2.0"
] | null | null | null | cnn/model_search.py | badrutdinovrr/darts | 434708e63cbda8f710d3c1810d06ad31c11db923 | [
"Apache-2.0"
] | null | null | null | cnn/model_search.py | badrutdinovrr/darts | 434708e63cbda8f710d3c1810d06ad31c11db923 | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
from operations import *
from torch.autograd import Variable
from genotypes import PRIMITIVES
from genotypes import Genotype
class MixedOp(nn.Module):
def __init__(self, C, stride):
super(MixedOp, self).__init__()
self._ops = nn.ModuleList(... | 30.542683 | 128 | 0.643242 | import torch
import torch.nn as nn
import torch.nn.functional as F
from operations import *
from torch.autograd import Variable
from genotypes import PRIMITIVES
from genotypes import Genotype
class MixedOp(nn.Module):
def __init__(self, C, stride):
super(MixedOp, self).__init__()
self._ops = nn.ModuleList(... | true | true |
f71434c24f3b7959298b19af49f4893c651e600c | 2,465 | py | Python | credoscript/adaptors/variationadaptor.py | tlb-lab/credoscript | 32bdf08d84703dc2062dae4df1a95587d36c3cf7 | [
"MIT"
] | null | null | null | credoscript/adaptors/variationadaptor.py | tlb-lab/credoscript | 32bdf08d84703dc2062dae4df1a95587d36c3cf7 | [
"MIT"
] | null | null | null | credoscript/adaptors/variationadaptor.py | tlb-lab/credoscript | 32bdf08d84703dc2062dae4df1a95587d36c3cf7 | [
"MIT"
] | null | null | null | from sqlalchemy.sql.expression import and_
from credoscript.mixins.base import paginate
class VariationAdaptor(object):
"""
"""
def __init__(self, dynamic=False, paginate=False, per_page=100):
self.query = Variation.query
self.dynamic = dynamic
self.paginate = paginate
self.... | 31.602564 | 109 | 0.643813 | from sqlalchemy.sql.expression import and_
from credoscript.mixins.base import paginate
class VariationAdaptor(object):
def __init__(self, dynamic=False, paginate=False, per_page=100):
self.query = Variation.query
self.dynamic = dynamic
self.paginate = paginate
self.per_page = per_p... | true | true |
f71435aefbab60525e1f6180d047b1c4a343f58a | 957 | py | Python | test/test_basic_software_asset_all_of.py | cons3rt/cons3rt-python-sdk | f0bcb295735ac55bbe47448fcbd95d2c7beb3ec0 | [
"RSA-MD"
] | null | null | null | test/test_basic_software_asset_all_of.py | cons3rt/cons3rt-python-sdk | f0bcb295735ac55bbe47448fcbd95d2c7beb3ec0 | [
"RSA-MD"
] | null | null | null | test/test_basic_software_asset_all_of.py | cons3rt/cons3rt-python-sdk | f0bcb295735ac55bbe47448fcbd95d2c7beb3ec0 | [
"RSA-MD"
] | null | null | null | # coding: utf-8
"""
CONS3RT Web API
A CONS3RT ReSTful API # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: apiteam@swagger.io
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import openapi_client
from openapi_client.mode... | 23.341463 | 107 | 0.726228 |
from __future__ import absolute_import
import unittest
import openapi_client
from openapi_client.models.basic_software_asset_all_of import BasicSoftwareAssetAllOf
from openapi_client.rest import ApiException
class TestBasicSoftwareAssetAllOf(unittest.TestCase):
def setUp(self):
pass
def tear... | true | true |
f7143656ce4da10df1aaa3d84302fc6d8f3085ff | 4,728 | py | Python | tests/integration_tests/build/test_coverage.py | Mehigh17/firecracker | 78c6b29f14f9e810c7426d935b5c4fbdfdfc4119 | [
"Apache-2.0"
] | null | null | null | tests/integration_tests/build/test_coverage.py | Mehigh17/firecracker | 78c6b29f14f9e810c7426d935b5c4fbdfdfc4119 | [
"Apache-2.0"
] | null | null | null | tests/integration_tests/build/test_coverage.py | Mehigh17/firecracker | 78c6b29f14f9e810c7426d935b5c4fbdfdfc4119 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests pertaining to line/branch test coverage for the Firecracker code base.
# TODO
- Put the coverage in `s3://spec.firecracker` and update it automatically.
target should be put in `s3://spec.firecra... | 32.833333 | 79 | 0.655245 |
import os
import platform
import re
import pytest
import framework.utils as utils
import host_tools.cargo_build as host
COVERAGE_TARGET_PCT = 84.53
COVERAGE_MAX_DELTA = 0.05
CARGO_KCOV_REL_PATH = os.path.join(host.CARGO_BUILD_REL_PATH, 'kcov')
KCOV_COVERAGE_FILE = 'index.js'
KCOV_COVERED_LINES_REGEX = r'"cov... | true | true |
f71436d10cc2c701fbdd2731e650a7b4d07afd22 | 6,393 | py | Python | bindings/python/ensmallen_graph/datasets/networkrepository/cfat5005.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/networkrepository/cfat5005.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/networkrepository/cfat5005.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | """
This file offers the methods to automatically retrieve the graph c-fat500-5.
The graph is automatically retrieved from the NetworkRepository repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime: 2021-... | 31.185366 | 94 | 0.672141 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen_graph import EnsmallenGraph
def CFat5005(
directed: bool = False,
verbose: int = 2,
cache_path: str = "graphs/networkrepository",
**additional_graph_kwargs: Dict
) -> EnsmallenGraph:
re... | true | true |
f714374a1632476acaefbc832c81cdaf88352611 | 337 | py | Python | app.py | munrojm/api | 478eb7b7d65ee72c65c9c3a61aec02aed7aa5ffe | [
"BSD-3-Clause-LBNL"
] | null | null | null | app.py | munrojm/api | 478eb7b7d65ee72c65c9c3a61aec02aed7aa5ffe | [
"BSD-3-Clause-LBNL"
] | null | null | null | app.py | munrojm/api | 478eb7b7d65ee72c65c9c3a61aec02aed7aa5ffe | [
"BSD-3-Clause-LBNL"
] | null | null | null | import os
from monty.serialization import loadfn
from fastapi import FastAPI
import mp_api.xas.api
xas_store = os.environ.get("XAS_STORE", "xas_store.json")
xas_store = loadfn(xas_store)
xas_router = mp_api.xas.api.get_router(xas_store)
app = FastAPI(title="Materials Project API", version="3.0.0-dev")
app.include_ro... | 25.923077 | 65 | 0.789318 | import os
from monty.serialization import loadfn
from fastapi import FastAPI
import mp_api.xas.api
xas_store = os.environ.get("XAS_STORE", "xas_store.json")
xas_store = loadfn(xas_store)
xas_router = mp_api.xas.api.get_router(xas_store)
app = FastAPI(title="Materials Project API", version="3.0.0-dev")
app.include_ro... | true | true |
f714379ee3973b8021d36894d60ed8cb48ed5454 | 246 | py | Python | exercicios/Lista4/Q14.py | AlexandrePeBrito/CursoUdemyPython | 3de58cb30c9f333b32078309847179ff3f9d7e22 | [
"MIT"
] | null | null | null | exercicios/Lista4/Q14.py | AlexandrePeBrito/CursoUdemyPython | 3de58cb30c9f333b32078309847179ff3f9d7e22 | [
"MIT"
] | null | null | null | exercicios/Lista4/Q14.py | AlexandrePeBrito/CursoUdemyPython | 3de58cb30c9f333b32078309847179ff3f9d7e22 | [
"MIT"
] | null | null | null | #Faça um programa que leia um vetor de 10 posições e verifique
#se existem valores iguais e os escreva na tela.
vetor=[]
for c in range(0,10):
n=int(input("Informe um numero: "))
if n in vetor:
print(f"{n}")
vetor.append(n)
| 24.6 | 62 | 0.650407 |
vetor=[]
for c in range(0,10):
n=int(input("Informe um numero: "))
if n in vetor:
print(f"{n}")
vetor.append(n)
| true | true |
f71438eae2367cd2d781df2131122da34442181b | 27,609 | py | Python | nova/tests/unit/virt/test_block_device.py | gabriel-samfira/nova | 5ef07cc04dbf0216452ae358e57d9ddac51f1803 | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/virt/test_block_device.py | gabriel-samfira/nova | 5ef07cc04dbf0216452ae358e57d9ddac51f1803 | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/virt/test_block_device.py | gabriel-samfira/nova | 5ef07cc04dbf0216452ae358e57d9ddac51f1803 | [
"Apache-2.0"
] | null | null | null | # All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 40.305109 | 78 | 0.604477 |
import contextlib
import mock
from oslo.serialization import jsonutils
from nova import block_device
from nova import context
from nova import test
from nova.tests.unit import fake_instance
from nova.tests.unit import matchers
from nova.virt import block_device as driver_block_device
from nova.virt impo... | true | true |
f71439ce9d32a0f70a4540340143a4985060ff8f | 8,950 | py | Python | algorithm/RL/DDPG.py | 915288938lx/Personae-master-01 | 0885c37956bd3f9157c66109e09755a51ad5d3a1 | [
"MIT"
] | null | null | null | algorithm/RL/DDPG.py | 915288938lx/Personae-master-01 | 0885c37956bd3f9157c66109e09755a51ad5d3a1 | [
"MIT"
] | null | null | null | algorithm/RL/DDPG.py | 915288938lx/Personae-master-01 | 0885c37956bd3f9157c66109e09755a51ad5d3a1 | [
"MIT"
] | null | null | null | # coding=utf-8
import tensorflow as tf
import numpy as np
import os
from algorithm import config
from base.env.market import Market
from checkpoints import CHECKPOINTS_DIR
from base.algorithm.model import BaseRLTFModel
from helper.args_parser import model_launcher_parser
from helper.data_logger import generate_algor... | 42.018779 | 142 | 0.557765 |
import tensorflow as tf
import numpy as np
import os
from algorithm import config
from base.env.market import Market
from checkpoints import CHECKPOINTS_DIR
from base.algorithm.model import BaseRLTFModel
from helper.args_parser import model_launcher_parser
from helper.data_logger import generate_algorithm_logger, g... | true | true |
f7143a6df31b6e88eabff6f5aaf40943f677d15c | 6,824 | py | Python | pynotify/__init__.py | dhgrs/pynotify | 5bdfb0108466b7779f5bb7643b272c96f05c6f7c | [
"MIT"
] | null | null | null | pynotify/__init__.py | dhgrs/pynotify | 5bdfb0108466b7779f5bb7643b272c96f05c6f7c | [
"MIT"
] | null | null | null | pynotify/__init__.py | dhgrs/pynotify | 5bdfb0108466b7779f5bb7643b272c96f05c6f7c | [
"MIT"
] | null | null | null | import subprocess
class NotificationError(Exception):
pass
class BaseNotification:
def set_typed_variable(self, value, specified_type):
if isinstance(value, specified_type):
return value
else:
raise NotificationError(
'can only set '
f'... | 24.028169 | 75 | 0.592175 | import subprocess
class NotificationError(Exception):
pass
class BaseNotification:
def set_typed_variable(self, value, specified_type):
if isinstance(value, specified_type):
return value
else:
raise NotificationError(
'can only set '
f'... | true | true |
f7143a7938cf66264f124bc702bc410c903aa5bf | 147 | py | Python | FastAPISQLAlchamyGraphQL/app/mutations/__init__.py | scionoftech/FastAPI-Full-Stack-Samples | e7d42661ed59324ff20f419d05c6cd1e7dab7e97 | [
"MIT"
] | 29 | 2021-03-31T02:42:59.000Z | 2022-03-12T16:20:05.000Z | FastAPIMongoEngineGraphQL/app/mutations/__init__.py | scionoftech/FastAPI-Full-Stack-Samples | e7d42661ed59324ff20f419d05c6cd1e7dab7e97 | [
"MIT"
] | null | null | null | FastAPIMongoEngineGraphQL/app/mutations/__init__.py | scionoftech/FastAPI-Full-Stack-Samples | e7d42661ed59324ff20f419d05c6cd1e7dab7e97 | [
"MIT"
] | 4 | 2021-08-21T01:02:00.000Z | 2022-01-09T15:33:51.000Z | from .user import CreateUser, AuthUser, UpdateUser, DeleteUser, UpdatePassword
from .articles import CreateArticle, UpdateArticle, DeleteArticle
| 49 | 79 | 0.836735 | from .user import CreateUser, AuthUser, UpdateUser, DeleteUser, UpdatePassword
from .articles import CreateArticle, UpdateArticle, DeleteArticle
| true | true |
f7143afde7eec54cc467e2279b80d92472d6fb74 | 319 | py | Python | bitly_api/__init__.py | galeone/bitly-api-python | 162add496ba2b42675b36581178902cce516cdf7 | [
"Apache-2.0"
] | 3 | 2018-08-29T08:53:57.000Z | 2019-02-22T19:56:11.000Z | bitly_api/__init__.py | galeone/bitly-api-python | 162add496ba2b42675b36581178902cce516cdf7 | [
"Apache-2.0"
] | null | null | null | bitly_api/__init__.py | galeone/bitly-api-python | 162add496ba2b42675b36581178902cce516cdf7 | [
"Apache-2.0"
] | 1 | 2019-06-28T20:30:47.000Z | 2019-06-28T20:30:47.000Z | from .bitly_api import Connection, BitlyError, Error
__version__ = '0.3'
__author__ = "Jehiah Czebotar <jehiah@gmail.com>"
__all__ = ["Connection", "BitlyError", "Error"]
__doc__ = """
This is a python library for the bitly api
all methods raise BitlyError on an unexpected response, or a problem with input
format
"""
| 31.9 | 79 | 0.752351 | from .bitly_api import Connection, BitlyError, Error
__version__ = '0.3'
__author__ = "Jehiah Czebotar <jehiah@gmail.com>"
__all__ = ["Connection", "BitlyError", "Error"]
__doc__ = """
This is a python library for the bitly api
all methods raise BitlyError on an unexpected response, or a problem with input
format
"""
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.