hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | 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 3 239 | max_forks_repo_name stringlengths 5 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7978237e8752783fa5e778612a1498e67d9592ee | 2,126 | py | Python | legal-api/src/legal_api/errorhandlers.py | argush3/lear | 804820ea93a9ca44d1a474ce7a903bb0a808aacb | [
"Apache-2.0"
] | 8 | 2019-06-19T16:16:15.000Z | 2021-08-28T23:56:40.000Z | legal-api/src/legal_api/errorhandlers.py | argush3/lear | 804820ea93a9ca44d1a474ce7a903bb0a808aacb | [
"Apache-2.0"
] | 1,313 | 2019-10-18T22:48:16.000Z | 2022-03-30T17:42:47.000Z | legal-api/src/legal_api/errorhandlers.py | argush3/lear | 804820ea93a9ca44d1a474ce7a903bb0a808aacb | [
"Apache-2.0"
] | 201 | 2019-10-18T21:34:41.000Z | 2022-03-31T20:07:42.000Z | # Copyright © 2019 Province of British Columbia
#
# 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 agr... | 32.707692 | 79 | 0.755409 |
7978248f4d1f033eb6aaf80edcfc04c2f6e5f605 | 8,601 | py | Python | betterletter/substituters.py | alexpovel/subalt | eee633f29a5c1ecd2e6d5efa22d8cd361c3ffe78 | [
"MIT"
] | null | null | null | betterletter/substituters.py | alexpovel/subalt | eee633f29a5c1ecd2e6d5efa22d8cd361c3ffe78 | [
"MIT"
] | null | null | null | betterletter/substituters.py | alexpovel/subalt | eee633f29a5c1ecd2e6d5efa22d8cd361c3ffe78 | [
"MIT"
] | null | null | null | import logging
import re
from typing import Iterator
from betterletter import LanguageMapping, NativeSpelling, Span, WordLookup
from betterletter.iteration import all_lengths_combinations, subset
logger = logging.getLogger(__name__)
def _substitute_spans(
string: str,
substitutions: dict[Span, NativeSpellin... | 43.439394 | 88 | 0.63667 |
7978251873dae704f679c7b9c351720643c051fe | 96 | py | Python | 4_5_4.py | rursvd/pynumerical2 | 4b2d33125b64a39099ac8eddef885e0ea11b237d | [
"MIT"
] | null | null | null | 4_5_4.py | rursvd/pynumerical2 | 4b2d33125b64a39099ac8eddef885e0ea11b237d | [
"MIT"
] | null | null | null | 4_5_4.py | rursvd/pynumerical2 | 4b2d33125b64a39099ac8eddef885e0ea11b237d | [
"MIT"
] | 1 | 2019-12-03T01:34:19.000Z | 2019-12-03T01:34:19.000Z | a = 10
b = 60
if a > 50 and b < 50:
print("True")
elif a < 50 or b > 50:
print("False")
| 13.714286 | 22 | 0.5 |
7978251c57e011e12d02321e9daf4780f81e5306 | 2,796 | py | Python | mriutils/datasets/acdc.py | kuangmeng/MRIUtils | 3a79e8104071deb0dc17c402ac878f94161d9b4a | [
"MIT"
] | null | null | null | mriutils/datasets/acdc.py | kuangmeng/MRIUtils | 3a79e8104071deb0dc17c402ac878f94161d9b4a | [
"MIT"
] | null | null | null | mriutils/datasets/acdc.py | kuangmeng/MRIUtils | 3a79e8104071deb0dc17c402ac878f94161d9b4a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 14 22:42:15 2020
@author: kuangmeng
"""
import os
import SimpleITK as sitk
import skimage.io as skio
from skimage.transform import resize
import numpy as np
import sys
sys.path.append("..")
import platform
class LoadACDC():
def __init__(self, d... | 36.789474 | 130 | 0.484979 |
7978268d93f09595456938f6d63369ae2732e453 | 10,234 | py | Python | config/settings/base.py | dopeheadz/Ploopy | e6d1ff8b3351062ed8971c37943a71bfe8294ee4 | [
"MIT"
] | null | null | null | config/settings/base.py | dopeheadz/Ploopy | e6d1ff8b3351062ed8971c37943a71bfe8294ee4 | [
"MIT"
] | null | null | null | config/settings/base.py | dopeheadz/Ploopy | e6d1ff8b3351062ed8971c37943a71bfe8294ee4 | [
"MIT"
] | 1 | 2020-09-30T17:38:59.000Z | 2020-09-30T17:38:59.000Z | """
Base settings to build other settings files upon.
"""
import environ
ROOT_DIR = environ.Path(__file__) - 3 # (ploopy/config/settings/base.py - 3 = ploopy/)
APPS_DIR = ROOT_DIR.path('ploopy')
env = environ.Env()
READ_DOT_ENV_FILE = env.bool('DJANGO_READ_DOT_ENV_FILE', default=False)
if READ_DOT_ENV_FILE:
# ... | 38.618868 | 98 | 0.628396 |
797826adb8a5e228a45a5602aedba68ccdad5b0d | 1,515 | py | Python | test/option-b.py | EmanueleCannizzaro/scons | 6baa4e65cdf4df6951473545b69435711864e509 | [
"MIT"
] | 1 | 2019-09-18T06:37:02.000Z | 2019-09-18T06:37:02.000Z | test/option-b.py | EmanueleCannizzaro/scons | 6baa4e65cdf4df6951473545b69435711864e509 | [
"MIT"
] | null | null | null | test/option-b.py | EmanueleCannizzaro/scons | 6baa4e65cdf4df6951473545b69435711864e509 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to us... | 34.431818 | 90 | 0.751815 |
797827229e5a94db0371c0ef5537de55dd513474 | 1,649 | py | Python | sarafan/ethereum/event.py | sarafanio/sarafan | 1c15bcdb61c13558ca1d833547222530dd363333 | [
"MIT"
] | 2 | 2021-02-07T17:08:32.000Z | 2022-01-21T06:39:50.000Z | sarafan/ethereum/event.py | sarafanio/sarafan | 1c15bcdb61c13558ca1d833547222530dd363333 | [
"MIT"
] | 2 | 2021-02-07T15:22:57.000Z | 2021-02-07T15:24:49.000Z | sarafan/ethereum/event.py | sarafanio/sarafan | 1c15bcdb61c13558ca1d833547222530dd363333 | [
"MIT"
] | null | null | null | from dataclasses import dataclass, field
from typing import Dict, List
@dataclass
class Event:
log_index: int
block_number: int
block_hash: str
transaction_hash: str
transaction_index: int
address: str
data: str
topics: List[str]
@classmethod
def from_raw_event(cls, raw: Dict)... | 29.446429 | 83 | 0.638569 |
79782a44925a808fb11b947d26c6a46e3424ef0d | 936 | py | Python | example_d/websocket/subscribeallticker.py | ArtemMartus/Binance_Futures_python | 946bfdbdbb417d1b59091541c356f3e6ec32bad8 | [
"MIT"
] | null | null | null | example_d/websocket/subscribeallticker.py | ArtemMartus/Binance_Futures_python | 946bfdbdbb417d1b59091541c356f3e6ec32bad8 | [
"MIT"
] | null | null | null | example_d/websocket/subscribeallticker.py | ArtemMartus/Binance_Futures_python | 946bfdbdbb417d1b59091541c356f3e6ec32bad8 | [
"MIT"
] | null | null | null | import logging
from binance_d import SubscriptionClient
from binance_d.constant.test import *
from binance_d.model import *
from binance_d.exception.binanceapiexception import BinanceApiException
from binance_d.base.printobject import *
logger = logging.getLogger("binance-futures")
logger.setLevel(level=logg... | 31.2 | 96 | 0.75 |
79782a9480058cad73020de01d0a232c887da9ba | 7,875 | py | Python | nums/core/grid/grid.py | UsernameChun/nums | 3a10598cc32b9763f1f2733e9e1089399d48ef3c | [
"Apache-2.0"
] | null | null | null | nums/core/grid/grid.py | UsernameChun/nums | 3a10598cc32b9763f1f2733e9e1089399d48ef3c | [
"Apache-2.0"
] | null | null | null | nums/core/grid/grid.py | UsernameChun/nums | 3a10598cc32b9763f1f2733e9e1089399d48ef3c | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2020 NumS Development Team.
#
# 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 ... | 36.458333 | 88 | 0.634921 |
79782ae1d0b1d61460a336b88f61db7f408eb419 | 16,451 | py | Python | pywikibot/login.py | masti01/pywikibot | bebd2b77b983581bc302656083e8b283a61e8679 | [
"MIT"
] | 326 | 2017-11-21T07:04:19.000Z | 2022-03-26T01:25:44.000Z | pywikibot/login.py | masti01/pywikibot | bebd2b77b983581bc302656083e8b283a61e8679 | [
"MIT"
] | 17 | 2017-12-20T13:41:32.000Z | 2022-02-16T16:42:41.000Z | pywikibot/login.py | dvorapa/pywikibot | 459e79a4e4b87960e562318eaea265e8ef332a18 | [
"MIT"
] | 147 | 2017-11-22T19:13:40.000Z | 2022-03-29T04:47:07.000Z | #!/usr/bin/python
"""Library to log the bot in to a wiki account."""
#
# (C) Pywikibot team, 2003-2021
#
# Distributed under the terms of the MIT license.
#
import codecs
import os
import webbrowser
from enum import IntEnum
from typing import Any, Optional
from warnings import warn
import pywikibot
import pywikibot.da... | 35.151709 | 79 | 0.583308 |
79782af90eed41bb63d4ea708273aa8aa07fdf37 | 9,570 | py | Python | simscale_sdk/models/animation_output_settings.py | SimScaleGmbH/simscale-python-sdk | 34c881ca0be87e2b0bb315a9fee1d73f0da61e78 | [
"MIT"
] | 8 | 2021-01-22T13:41:03.000Z | 2022-01-03T09:00:10.000Z | simscale_sdk/models/animation_output_settings.py | eljoelopez/simscale-python-sdk | 189f1337b2ab40feed123111ddead0cdecf83c93 | [
"MIT"
] | null | null | null | simscale_sdk/models/animation_output_settings.py | eljoelopez/simscale-python-sdk | 189f1337b2ab40feed123111ddead0cdecf83c93 | [
"MIT"
] | 3 | 2021-03-18T15:52:52.000Z | 2022-01-03T08:59:30.000Z | # coding: utf-8
"""
SimScale API
The version of the OpenAPI document: 0.0.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from simscale_sdk.configuration import Configuration
class AnimationOutputSettings(object):
"""NOTE: This class is auto ge... | 32.662116 | 182 | 0.620376 |
79782b0813a6c2e19f9279b1f336a5b1bd40cbec | 877 | py | Python | bubbly/test/extractor_benchmarks.py | ChrisBeaumont/brut | f4223b84448d1db1b0e98e043dc6670adf05ee5d | [
"MIT"
] | 6 | 2015-03-06T20:32:50.000Z | 2018-04-17T12:14:07.000Z | bubbly/test/extractor_benchmarks.py | ChrisBeaumont/brut | f4223b84448d1db1b0e98e043dc6670adf05ee5d | [
"MIT"
] | 1 | 2016-08-14T17:12:58.000Z | 2016-08-14T17:12:58.000Z | bubbly/test/extractor_benchmarks.py | ChrisBeaumont/brut | f4223b84448d1db1b0e98e043dc6670adf05ee5d | [
"MIT"
] | 7 | 2015-07-29T16:17:02.000Z | 2018-12-14T03:15:59.000Z | from hashlib import md5
from bubbly import extractors as ex
from bubbly.dr1 import on_stamp_params
benchmark_params = list(on_stamp_params())[::100]
benchmark_extractors = [ex.RGBExtractor,
ex.EllipseExtractor,
ex.RingWaveletCompressionStatExtractor,
... | 24.361111 | 72 | 0.652223 |
79782cc69c9cf4e00646f52e6701ec87ec1bba2b | 11,378 | py | Python | posthog/api/insight.py | FarazPatankar/posthog | dddf2644376d0fd6836ed96c139f6a825c74202f | [
"MIT"
] | null | null | null | posthog/api/insight.py | FarazPatankar/posthog | dddf2644376d0fd6836ed96c139f6a825c74202f | [
"MIT"
] | 1 | 2021-10-13T10:05:26.000Z | 2021-10-13T10:05:26.000Z | posthog/api/insight.py | FarazPatankar/posthog | dddf2644376d0fd6836ed96c139f6a825c74202f | [
"MIT"
] | null | null | null | from distutils.util import strtobool
from typing import Any, Dict
from django.core.cache import cache
from django.db.models import QuerySet
from django.db.models.query_utils import Q
from django.utils.timezone import now
from rest_framework import request, serializers, viewsets
from rest_framework.decorators import ac... | 40.204947 | 122 | 0.627527 |
79782de4526408e7e3c210c2d3f304ddaa3cf2a5 | 12,565 | py | Python | gluoncv/model_zoo/yolo/yolo_target.py | precedenceguo/gluon-cv | 48aef614a9effbcf11eb75975ab8e770f36562eb | [
"Apache-2.0"
] | 36 | 2019-12-25T04:59:49.000Z | 2022-03-17T07:24:49.000Z | gluoncv/model_zoo/yolo/yolo_target.py | icemansina/gluon-cv | f116fbd3b0cebbf2a34f08461471db3b4e1c7133 | [
"Apache-2.0"
] | 1 | 2019-04-29T04:05:51.000Z | 2019-04-29T04:05:51.000Z | gluoncv/model_zoo/yolo/yolo_target.py | icemansina/gluon-cv | f116fbd3b0cebbf2a34f08461471db3b4e1c7133 | [
"Apache-2.0"
] | 9 | 2019-12-25T05:00:33.000Z | 2021-10-01T14:23:51.000Z | """Target generators for YOLOs."""
# pylint: disable=arguments-differ, unsupported-assignment-operation
from __future__ import absolute_import
from __future__ import division
import numpy as np
from mxnet import gluon
from mxnet import nd
from mxnet import autograd
from ...nn.bbox import BBoxCornerToCenter, BBoxCenter... | 47.594697 | 100 | 0.610665 |
79782e504eb6a20adefcc8d3ea1c4849e187f451 | 16,573 | py | Python | utils/dependency_management.py | greschd/aiida_core | 99f988b556c14c51dbc8ba37867fd67882730aae | [
"MIT",
"BSD-3-Clause"
] | null | null | null | utils/dependency_management.py | greschd/aiida_core | 99f988b556c14c51dbc8ba37867fd67882730aae | [
"MIT",
"BSD-3-Clause"
] | 5 | 2017-07-20T09:11:59.000Z | 2020-08-28T15:43:16.000Z | utils/dependency_management.py | greschd/aiida_core | 99f988b556c14c51dbc8ba37867fd67882730aae | [
"MIT",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 38.812646 | 118 | 0.675376 |
79782f417d6b1d81fdff9b4bf0c6c152f213840b | 4,180 | py | Python | main.py | surajkawthekar/Memcache-Microsoft-Azure- | ae0e480afad5f150b810450ec4edc1dad73b98cb | [
"MIT"
] | null | null | null | main.py | surajkawthekar/Memcache-Microsoft-Azure- | ae0e480afad5f150b810450ec4edc1dad73b98cb | [
"MIT"
] | null | null | null | main.py | surajkawthekar/Memcache-Microsoft-Azure- | ae0e480afad5f150b810450ec4edc1dad73b98cb | [
"MIT"
] | null | null | null | #References:https://clasense4.wordpress.com/2012/07/29/python-redis-how-to-cache-python-mysql-result-using-redis/
#https://opensource.com/article/18/4/how-build-hello-redis-with-python
#https://docs.microsoft.com/en-us/azure/redis-cache/cache-python-get-started
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
from f... | 35.726496 | 113 | 0.619139 |
79782f665976a9fa5f14dcee8c1ef07ce52fc2e0 | 1,639 | py | Python | src/nwdiag/utils/rst/directives.py | flying-foozy/nwdiag | 4e3df59e3f73706f3d37041202747aabc3831899 | [
"Apache-2.0"
] | 72 | 2018-07-02T06:36:38.000Z | 2022-02-20T10:50:50.000Z | src/nwdiag/utils/rst/directives.py | flying-foozy/nwdiag | 4e3df59e3f73706f3d37041202747aabc3831899 | [
"Apache-2.0"
] | 22 | 2018-05-06T09:05:33.000Z | 2022-03-08T01:45:27.000Z | src/nwdiag/utils/rst/directives.py | flying-foozy/nwdiag | 4e3df59e3f73706f3d37041202747aabc3831899 | [
"Apache-2.0"
] | 10 | 2018-10-30T20:36:59.000Z | 2022-02-07T14:57:55.000Z | # -*- coding: utf-8 -*-
# Copyright 2011 Takeshi KOMIYA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 32.78 | 75 | 0.649176 |
79782fe293e1ad3a138506c21beecadee6032bf6 | 1,939 | py | Python | bioptim/dynamics/fatigue/xia_fatigue.py | leasanchez/BiorbdOptim | 28fac818af031668ecd82bc1929f78303c5d58d2 | [
"MIT"
] | 34 | 2020-12-14T17:09:41.000Z | 2022-03-31T17:03:37.000Z | bioptim/dynamics/fatigue/xia_fatigue.py | pariterre/bioptim | 4064138e7d3fce34e21d488df19941937ce30557 | [
"MIT"
] | 229 | 2020-09-30T16:53:40.000Z | 2022-03-29T21:11:46.000Z | bioptim/dynamics/fatigue/xia_fatigue.py | fbailly/bioptim | 3a5473ee7c39d645d960611596a45b044e8ccf58 | [
"MIT"
] | 15 | 2020-11-20T12:32:59.000Z | 2022-01-22T22:59:08.000Z | from casadi import vertcat, lt, gt, if_else
from .muscle_fatigue import MuscleFatigue
from .tau_fatigue import TauFatigue
from ...misc.enums import VariableType
class XiaFatigue(MuscleFatigue):
"""
A placeholder for fatigue dynamics.
"""
def __init__(self, LD: float, LR: float, F: float, R: float, *... | 25.513158 | 90 | 0.562145 |
797830761b48cd0f70a5881b507734783492dbbc | 12,385 | py | Python | python/fb2youtrack.py | sa363/youtrack-rest-python-library | ed7921a4ca8aa882517a531af934836a0ef295ed | [
"Apache-2.0"
] | null | null | null | python/fb2youtrack.py | sa363/youtrack-rest-python-library | ed7921a4ca8aa882517a531af934836a0ef295ed | [
"Apache-2.0"
] | null | null | null | python/fb2youtrack.py | sa363/youtrack-rest-python-library | ed7921a4ca8aa882517a531af934836a0ef295ed | [
"Apache-2.0"
] | null | null | null | import sys
#if not('/usr/lib/pymodules/python2.6' in sys.path) :
# sys.path.append('/usr/lib/pymodules/python2.6')
#if not('/usr/lib/python2.6' in sys.path) :
# sys.path.append('/usr/lib/python2.6')
#if not('/home/user/.PyCharm10' in sys.path) :
# sys.path.append('/home/user/.PyCharm10')
from fbugz.fbSOAPClie... | 41.700337 | 137 | 0.667259 |
7978309627fc400898459e29015220eea2c5f3bf | 5,692 | py | Python | Spectroscopy/specutils.py | guangtunbenzhu/BGT-Cosmology | 2dbedfb6ead3ecd2f43a2716cfd388a5a65979ee | [
"MIT"
] | 1 | 2018-06-17T14:42:52.000Z | 2018-06-17T14:42:52.000Z | Spectroscopy/specutils.py | guangtunbenzhu/BGT-Cosmology | 2dbedfb6ead3ecd2f43a2716cfd388a5a65979ee | [
"MIT"
] | null | null | null | Spectroscopy/specutils.py | guangtunbenzhu/BGT-Cosmology | 2dbedfb6ead3ecd2f43a2716cfd388a5a65979ee | [
"MIT"
] | null | null | null |
"""
Useful small tools for spectroscopic analysis
"""
# Python 3 vs. 2
from __future__ import print_function, division
# Standard Library Modules
import numpy as np
from scipy.interpolate import UnivariateSpline, interp1d
from scipy import constants
# Third Party Modules
# Your Own Modules
#####################... | 33.093023 | 112 | 0.665495 |
7978320badc70882e1e314d9fa52067c28268a87 | 16,064 | py | Python | old/pepper1/src/test/testmain.py | andybalaam/pepper | f0d12379c7c6e2d82003c0c1d6130bfac685e1c3 | [
"MIT"
] | 2 | 2018-12-19T16:32:46.000Z | 2019-01-10T09:00:33.000Z | old/pepper1/src/test/testmain.py | andybalaam/pepper | f0d12379c7c6e2d82003c0c1d6130bfac685e1c3 | [
"MIT"
] | null | null | null | old/pepper1/src/test/testmain.py | andybalaam/pepper | f0d12379c7c6e2d82003c0c1d6130bfac685e1c3 | [
"MIT"
] | null | null | null | # Copyright (C) 2011-2012 Andy Balaam and The Pepper Developers
# Released under the MIT License. See the file COPYING.txt for details.
from cStringIO import StringIO
from nose.tools import *
from libpepper.buildsteps.buildstep import BuildStep
from libpepper.buildsteps.lexbuildstep import LexBuildStep
from libpepp... | 26.291326 | 83 | 0.63994 |
7978332eb1f59d688fd0340847243071cdddde7f | 4,736 | py | Python | tests/integration/test_multi_objective_bayesian_optimization.py | vishalbelsare/trieste | d25b66becd0cac47574b0f8e80bc28301aa0bf98 | [
"Apache-2.0"
] | 1 | 2021-10-02T19:53:48.000Z | 2021-10-02T19:53:48.000Z | tests/integration/test_multi_objective_bayesian_optimization.py | vishalbelsare/trieste | d25b66becd0cac47574b0f8e80bc28301aa0bf98 | [
"Apache-2.0"
] | null | null | null | tests/integration/test_multi_objective_bayesian_optimization.py | vishalbelsare/trieste | d25b66becd0cac47574b0f8e80bc28301aa0bf98 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The Trieste Contributors
#
# 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... | 38.193548 | 100 | 0.706715 |
7978338c6c1edee679bdfadb1fb67b6ea86fbbf6 | 6,561 | py | Python | parlai/agents/drqa/utils.py | shagunsodhani/ParlAI | 5b634b844807372adfb0f6d6e5c42341ac8138f0 | [
"BSD-3-Clause"
] | 1 | 2017-06-26T07:46:33.000Z | 2017-06-26T07:46:33.000Z | parlai/agents/drqa/utils.py | shagunsodhani/ParlAI | 5b634b844807372adfb0f6d6e5c42341ac8138f0 | [
"BSD-3-Clause"
] | null | null | null | parlai/agents/drqa/utils.py | shagunsodhani/ParlAI | 5b634b844807372adfb0f6d6e5c42341ac8138f0 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
import torch
import time
im... | 34.898936 | 80 | 0.567444 |
7978347b2616c4e3c10be2b460295ceffd96f5c8 | 2,993 | py | Python | app/request.py | scottwedge/News-Highlight | c321d683dde5bd7f4a38f100bcaa91e1f4de2e08 | [
"MIT"
] | null | null | null | app/request.py | scottwedge/News-Highlight | c321d683dde5bd7f4a38f100bcaa91e1f4de2e08 | [
"MIT"
] | 2 | 2020-02-06T22:03:41.000Z | 2020-02-07T19:08:42.000Z | app/request.py | scottwedge/News-Highlight | c321d683dde5bd7f4a38f100bcaa91e1f4de2e08 | [
"MIT"
] | 2 | 2020-02-06T19:11:39.000Z | 2020-02-06T19:59:56.000Z | # from app import app
import urllib.request
import json
from .models import Source,Article
# Source = source.Source
# Getting api key
api_key = None
# Getting the news base url
source_base_url = None
article_base_url = None
def configure_request(app):
'''
Function to acquire the api key and base urls
'''
glo... | 26.486726 | 86 | 0.732376 |
7978350adf86e9ef87d39d4719cd78e6b14f6c71 | 9,581 | py | Python | mindhome_alpha/erpnext/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py | Mindhome/field_service | 3aea428815147903eb9af1d0c1b4b9fc7faed057 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | mindhome_alpha/erpnext/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py | Mindhome/field_service | 3aea428815147903eb9af1d0c1b4b9fc7faed057 | [
"MIT"
] | null | null | null | mindhome_alpha/erpnext/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py | Mindhome/field_service | 3aea428815147903eb9af1d0c1b4b9fc7faed057 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, erpnext
from frappe import _
from frappe.model.document import Document
from frappe.utils import (nowdate, getdate, now_d... | 38.171315 | 143 | 0.772571 |
7978352e4a71b984eaead132bcbbf32609adb5b5 | 485 | py | Python | env/Lib/site-packages/plotly/validators/heatmapgl/hoverlabel/_bordercolor.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | venv/Lib/site-packages/plotly/validators/heatmapgl/hoverlabel/_bordercolor.py | wakisalvador/constructed-misdirection | 74779e9ec640a11bc08d5d1967c85ac4fa44ea5e | [
"Unlicense"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | venv/Lib/site-packages/plotly/validators/heatmapgl/hoverlabel/_bordercolor.py | wakisalvador/constructed-misdirection | 74779e9ec640a11bc08d5d1967c85ac4fa44ea5e | [
"Unlicense"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import _plotly_utils.basevalidators
class BordercolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="bordercolor", parent_name="heatmapgl.hoverlabel", **kwargs
):
super(BordercolorValidator, self).__init__(
plotly_name=plotly_name,
... | 32.333333 | 85 | 0.657732 |
79783531bfcc127cc6b3c51984e307e6bcf0c734 | 2,204 | py | Python | api/app.py | datalogics/circulation | a4767404a63dd034d101e6ee76f824626e5d5269 | [
"Apache-2.0"
] | null | null | null | api/app.py | datalogics/circulation | a4767404a63dd034d101e6ee76f824626e5d5269 | [
"Apache-2.0"
] | 6 | 2016-10-25T14:55:39.000Z | 2017-10-09T15:37:03.000Z | api/app.py | datalogics/circulation | a4767404a63dd034d101e6ee76f824626e5d5269 | [
"Apache-2.0"
] | 2 | 2016-09-29T16:28:14.000Z | 2021-08-04T12:28:21.000Z | from nose.tools import set_trace
import os
import logging
import urlparse
import flask
from flask import (
Flask,
Response,
redirect,
)
from flask_sqlalchemy_session import flask_scoped_session
from sqlalchemy.orm import sessionmaker
from config import Configuration
from core.model import (
Configurat... | 28.623377 | 106 | 0.74274 |
79783665250ef13c4bad8783a2d211f6b045155f | 278 | py | Python | Password Generator.py | abhinandanraj/Password-Generators | 226e441a470ab94ff0edb14c84b2b3574b768b40 | [
"MIT"
] | 2 | 2020-08-05T18:15:50.000Z | 2020-08-06T18:02:09.000Z | Password Generator.py | abhinandanraj/Password-Generators | 226e441a470ab94ff0edb14c84b2b3574b768b40 | [
"MIT"
] | null | null | null | Password Generator.py | abhinandanraj/Password-Generators | 226e441a470ab94ff0edb14c84b2b3574b768b40 | [
"MIT"
] | null | null | null | import random
char = 'qwui5o@p1a&sdfg4hk3lz2xnmj#ey$%*_06t7r8cvb9'
password = []
rand = random.randint(5,15)
for i in range(1, rand):
index = random.randint(1, 43)
password.append(char[index])
password = ''.join(password)
print('Your password is : ' + password)
| 15.444444 | 52 | 0.676259 |
797837524001184bf591c36bffa1e69940c6b1ce | 1,840 | py | Python | .config/qutebrowser/config.py | DrCracket/dotfiles | 7cb5432ec6814e037ecbc4dad5ab43717bbb302a | [
"MIT"
] | null | null | null | .config/qutebrowser/config.py | DrCracket/dotfiles | 7cb5432ec6814e037ecbc4dad5ab43717bbb302a | [
"MIT"
] | null | null | null | .config/qutebrowser/config.py | DrCracket/dotfiles | 7cb5432ec6814e037ecbc4dad5ab43717bbb302a | [
"MIT"
] | null | null | null | # pyright: reportUndefinedVariable=false
from os import getenv
## General
# -----------------------------------------------------------------------------
config.load_autoconfig(False)
c.search.incremental = False
c.spellcheck.languages = ["en-US", "de-DE"]
terminal, editor = getenv("TERMCMD", "alacritty"), getenv("ED... | 34.074074 | 79 | 0.594565 |
7978377bac6a5eb28216df8d004d6aba34984a07 | 3,497 | py | Python | official/nlp/bert/common_flags.py | Nitin-Mane/models | faf5ad73be910e0010ec57b9fdd122976e8a9195 | [
"Apache-2.0"
] | 3 | 2017-07-11T15:12:06.000Z | 2018-01-07T11:53:44.000Z | official/nlp/bert/common_flags.py | jsn5/models | 984be23d3d0f7c324c230dd4014c5e5ee1359684 | [
"Apache-2.0"
] | 2 | 2020-05-26T22:53:21.000Z | 2020-06-14T04:24:54.000Z | official/nlp/bert/common_flags.py | jsn5/models | 984be23d3d0f7c324c230dd4014c5e5ee1359684 | [
"Apache-2.0"
] | 3 | 2017-08-15T11:29:03.000Z | 2020-12-07T18:06:12.000Z | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 35.323232 | 80 | 0.680297 |
7978382277fc1926cae41cd4f900b711ad759e15 | 3,438 | py | Python | src/crawl/unicrawl/spiders/hers_courses.py | VictorLeP/Education4Climate | 7d419c96c759da2215504ac9051dd6f61d940b96 | [
"MIT"
] | 4 | 2021-09-24T16:17:57.000Z | 2022-01-31T17:32:16.000Z | src/crawl/unicrawl/spiders/hers_courses.py | VictorLeP/Education4Climate | 7d419c96c759da2215504ac9051dd6f61d940b96 | [
"MIT"
] | 23 | 2021-08-02T07:38:47.000Z | 2022-02-11T14:16:56.000Z | src/crawl/unicrawl/spiders/hers_courses.py | VictorLeP/Education4Climate | 7d419c96c759da2215504ac9051dd6f61d940b96 | [
"MIT"
] | 3 | 2021-11-20T06:06:44.000Z | 2022-03-11T07:44:43.000Z | # -*- coding: utf-8 -*-
from abc import ABC
from pathlib import Path
import pandas as pd
import scrapy
from src.crawl.utils import cleanup
from settings import YEAR, CRAWLING_OUTPUT_FOLDER
BASE_URl = "http://progcours.hers.be/cocoon/cours/{}.html"
PROG_DATA_PATH = Path(__file__).parent.absolute().joinpath(
f'../... | 38.2 | 113 | 0.58726 |
7978383e552c40ff0180b06a4cf14351f81db1ab | 30,018 | py | Python | tensorflow/python/eager/backprop.py | Zwysilence/tensorflow | b55001be83da044bb21d539d433dec6231eaec55 | [
"Apache-2.0"
] | 3 | 2018-09-25T00:35:34.000Z | 2018-09-25T00:38:06.000Z | tensorflow/python/eager/backprop.py | Zwysilence/tensorflow | b55001be83da044bb21d539d433dec6231eaec55 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/eager/backprop.py | Zwysilence/tensorflow | b55001be83da044bb21d539d433dec6231eaec55 | [
"Apache-2.0"
] | 2 | 2019-02-07T15:33:54.000Z | 2019-03-29T17:44:31.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 34.267123 | 108 | 0.680259 |
79783ab51f513fbf0c1fe718a2fe713df304e463 | 2,857 | py | Python | cairis/gui/UseCasesDialog.py | RachelLar/cairis_update | 0b1d6d17ce49bc74887d1684e28c53c1b06e2fa2 | [
"Apache-2.0"
] | null | null | null | cairis/gui/UseCasesDialog.py | RachelLar/cairis_update | 0b1d6d17ce49bc74887d1684e28c53c1b06e2fa2 | [
"Apache-2.0"
] | null | null | null | cairis/gui/UseCasesDialog.py | RachelLar/cairis_update | 0b1d6d17ce49bc74887d1684e28c53c1b06e2fa2 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | 40.239437 | 141 | 0.752188 |
79783b2db8c51fa500b2d1fece92a7f4983e2bf1 | 2,518 | py | Python | Master_detection/detect_faces_cmd.py | Freddo1/Emotion-detection | 224d7c6229de9fdc946f5492337b000e99f74a0b | [
"MIT"
] | 1 | 2019-02-14T11:06:59.000Z | 2019-02-14T11:06:59.000Z | Master_detection/detect_faces_cmd.py | Freddo1/Emotion-detection | 224d7c6229de9fdc946f5492337b000e99f74a0b | [
"MIT"
] | 2 | 2020-01-28T22:57:44.000Z | 2020-09-25T23:21:51.000Z | Master_detection/detect_faces_cmd.py | Freddo1/Emotion-detection | 224d7c6229de9fdc946f5492337b000e99f74a0b | [
"MIT"
] | null | null | null | #python detect_faces_cmd.py -p Detection_models/deploy.prototxt.txt -d Detection_models/ResNet_300x300.caffemodel
import sys,os
sys.path.append(os.getcwd())
from imutils.video import VideoStream
import numpy as np
import argparse
import time
import cv2
# Required arguments are paths to prototxt, detection model and cl... | 35.971429 | 121 | 0.67911 |
79783b991380f3ba2e5b67e4907c8b92ad4e4d3b | 340 | py | Python | seamo/support/df_to_sql.py | amandalynne/Seattle-Mobility-Index | f21d2fa6913ce9474aedc298e9e4a6e7c9390e64 | [
"MIT"
] | 3 | 2018-08-20T18:34:03.000Z | 2018-10-02T23:41:52.000Z | seamo/support/df_to_sql.py | amandalynne/Seattle-Mobility-Index | f21d2fa6913ce9474aedc298e9e4a6e7c9390e64 | [
"MIT"
] | null | null | null | seamo/support/df_to_sql.py | amandalynne/Seattle-Mobility-Index | f21d2fa6913ce9474aedc298e9e4a6e7c9390e64 | [
"MIT"
] | 1 | 2018-10-02T23:42:24.000Z | 2018-10-02T23:42:24.000Z | import init
import sqlite3
import sys
import re
import os
import sqlalchemy
import constants as cn
def df_to_sql(df, table_name):
db_file = os.path.join(cn.DB_DIR, str(table_name) + '.db')
conn = sqlite3.connect(db_file)
df.to_sql(table_name, conn, schema=None, if_exists='fail', index=False)
conn.commi... | 24.285714 | 75 | 0.723529 |
79783c07a8f9c3e0a15248e8c4321e68fedb71c2 | 1,702 | py | Python | app/core/migrations/0001_initial.py | JopeAlgorta/django-recipe-api | a92ae3b206682564d147618f83794edaf2c9a785 | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | JopeAlgorta/django-recipe-api | a92ae3b206682564d147618f83794edaf2c9a785 | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | JopeAlgorta/django-recipe-api | a92ae3b206682564d147618f83794edaf2c9a785 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.14 on 2020-07-22 03:00
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='User',
... | 50.058824 | 266 | 0.637485 |
79783c78048643d5dddc47f1172ee4f57c31426a | 806 | py | Python | data/config.py | youthhou1992/darknet_yolov3 | ff1c0e4a48712bbcd8aaa6597aafd2d0864ee90a | [
"MIT"
] | 1 | 2022-03-15T00:56:31.000Z | 2022-03-15T00:56:31.000Z | data/config.py | youthhou1992/darknet_yolov3 | ff1c0e4a48712bbcd8aaa6597aafd2d0864ee90a | [
"MIT"
] | null | null | null | data/config.py | youthhou1992/darknet_yolov3 | ff1c0e4a48712bbcd8aaa6597aafd2d0864ee90a | [
"MIT"
] | null | null | null | # config.py
import os.path
# gets home dir cross platform
#HOME = os.path.expanduser("~")
HOME = '/home/houyaozu/repo/'
#HOME = '/data/houyaozu'
# for making bounding boxes pretty
COLORS = ((255, 0, 0, 128), (0, 255, 0, 128), (0, 0, 255, 128),
(0, 255, 255, 128), (255, 0, 255, 128), (255, 255, 0, 128))
MEA... | 26.866667 | 69 | 0.558313 |
79783d46cd95400d8f23703e84de9efbe050b14e | 376 | py | Python | app/app/tests.py | krishdp/recipe-app-api | 2cbef288894d15de3d52387c2b73a9d90babb449 | [
"MIT"
] | null | null | null | app/app/tests.py | krishdp/recipe-app-api | 2cbef288894d15de3d52387c2b73a9d90babb449 | [
"MIT"
] | null | null | null | app/app/tests.py | krishdp/recipe-app-api | 2cbef288894d15de3d52387c2b73a9d90babb449 | [
"MIT"
] | null | null | null | # from django.test import TestCase
#
# from .calc import add, subtract
#
#
# class CalcTests(TestCase):
# def test_add_numbers(self):
# """test that two number are added together"""
# self.assertEqual(add(3, 8), 11)
#
# def test_subtract_numbers(self):
# """test that two number are subtr... | 26.857143 | 55 | 0.632979 |
79783e046fb596265d71f372fc5711892f91ee36 | 553 | py | Python | odata_query/sqlalchemy/functions_ext.py | itd-fsc/odata-query | 7d5239b775633594ce52d4eda5754c2ad078eb75 | [
"MIT"
] | 26 | 2021-06-11T07:42:08.000Z | 2022-02-16T04:42:45.000Z | odata_query/sqlalchemy/functions_ext.py | itd-fsc/odata-query | 7d5239b775633594ce52d4eda5754c2ad078eb75 | [
"MIT"
] | 13 | 2021-08-07T21:38:22.000Z | 2022-03-28T17:25:47.000Z | odata_query/sqlalchemy/functions_ext.py | itd-fsc/odata-query | 7d5239b775633594ce52d4eda5754c2ad078eb75 | [
"MIT"
] | 6 | 2021-07-28T04:46:14.000Z | 2022-03-15T08:22:19.000Z | from sqlalchemy.sql.functions import GenericFunction
from sqlalchemy.types import Integer, String
class strpos(GenericFunction):
type = Integer
class substr(GenericFunction):
type = String
class lower(GenericFunction):
type = String
class upper(GenericFunction):
type = String
class ltrim(Gener... | 14.179487 | 52 | 0.732369 |
79783e4090dc2b54cf820f1989ca8b2e98627e36 | 6,229 | py | Python | models/modeling/backbone/resnet.py | everythoughthelps/SfmLearner-Pytorch | b506ac3532e15632443f51d373804de1d69c6d32 | [
"MIT"
] | null | null | null | models/modeling/backbone/resnet.py | everythoughthelps/SfmLearner-Pytorch | b506ac3532e15632443f51d373804de1d69c6d32 | [
"MIT"
] | null | null | null | models/modeling/backbone/resnet.py | everythoughthelps/SfmLearner-Pytorch | b506ac3532e15632443f51d373804de1d69c6d32 | [
"MIT"
] | null | null | null | import math
import torch.nn as nn
import torch.utils.model_zoo as model_zoo
from models.modeling.sync_batchnorm.batchnorm import SynchronizedBatchNorm2d
class Bottleneck(nn.Module):
expansion = 4
def __init__(self, inplanes, planes, stride=1, dilation=1, downsample=None, BatchNorm=None):
super(Bottlen... | 38.450617 | 130 | 0.602665 |
79783f83d037d61d9188ca741620b74438409621 | 5,550 | py | Python | AdvBox/examples/image_cls/imagenet_tutorial_gp.py | Tough2011/PaddleSleeve | e654598a370220fbbc96ae527833676183909383 | [
"Apache-2.0"
] | 2 | 2022-02-24T08:47:04.000Z | 2022-02-24T08:47:13.000Z | AdvBox/examples/image_cls/imagenet_tutorial_gp.py | Tough2011/PaddleSleeve | e654598a370220fbbc96ae527833676183909383 | [
"Apache-2.0"
] | null | null | null | AdvBox/examples/image_cls/imagenet_tutorial_gp.py | Tough2011/PaddleSleeve | e654598a370220fbbc96ae527833676183909383 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 31.714286 | 159 | 0.672252 |
79783f9d7b8d39823b206b84972d542750e301f2 | 189 | py | Python | 6. ArithmeticOperations/operator_precedence.py | VasuGoel/python-personal-notes | 752c84533677e30e2abdaaf288ed7cf43220bd42 | [
"MIT"
] | 1 | 2019-09-04T12:08:29.000Z | 2019-09-04T12:08:29.000Z | 6. ArithmeticOperations/operator_precedence.py | VasuGoel/python-personal-notes | 752c84533677e30e2abdaaf288ed7cf43220bd42 | [
"MIT"
] | null | null | null | 6. ArithmeticOperations/operator_precedence.py | VasuGoel/python-personal-notes | 752c84533677e30e2abdaaf288ed7cf43220bd42 | [
"MIT"
] | 2 | 2019-09-04T12:08:30.000Z | 2020-10-13T16:18:58.000Z | value = (2 + 3) ** 5 - 4 + 7 * 10 / 5 ** 2
print(value) # returns 3123.8
# Order of precedence (left to right)
# (Paranthesis) > Exponential > Multiply or Divide > Add or Subtract
| 27 | 68 | 0.608466 |
79783febebfa6f5b57c5ae6ae7c347e93bac2cbd | 6,101 | py | Python | easy_infra/utils.py | SeisoLLC/easy_infra | cf272856e92fc3a38348bab255c00e8e46715687 | [
"BSD-3-Clause"
] | 14 | 2020-05-19T20:52:31.000Z | 2021-12-21T18:58:22.000Z | easy_infra/utils.py | SeisoLLC/easy_infra | cf272856e92fc3a38348bab255c00e8e46715687 | [
"BSD-3-Clause"
] | 65 | 2020-05-20T03:48:19.000Z | 2022-03-30T14:52:56.000Z | easy_infra/utils.py | SeisoLLC/easy_infra | cf272856e92fc3a38348bab255c00e8e46715687 | [
"BSD-3-Clause"
] | 7 | 2021-01-20T20:58:06.000Z | 2021-07-28T17:12:29.000Z | import re
import sys
from logging import getLogger
from pathlib import Path
import docker
import requests
from easy_infra import constants
from jinja2 import Environment, FileSystemLoader
from yaml import YAMLError, dump, safe_load
LOG = getLogger(__name__)
CLIENT = docker.from_env()
# Helper functions
def render_j... | 29.331731 | 112 | 0.632847 |
7978407699e837b415c37e391ee86c7f53865b3a | 1,963 | py | Python | IPython/utils/tests/test_pickleshare.py | pyarnold/ipython | c4797f7f069d0a974ddfa1e4251c7550c809dba0 | [
"BSD-3-Clause-Clear"
] | 1 | 2020-12-18T01:07:55.000Z | 2020-12-18T01:07:55.000Z | IPython/utils/tests/test_pickleshare.py | pyarnold/ipython | c4797f7f069d0a974ddfa1e4251c7550c809dba0 | [
"BSD-3-Clause-Clear"
] | null | null | null | IPython/utils/tests/test_pickleshare.py | pyarnold/ipython | c4797f7f069d0a974ddfa1e4251c7550c809dba0 | [
"BSD-3-Clause-Clear"
] | null | null | null | from __future__ import print_function
import os
from unittest import TestCase
from IPython.testing.decorators import skip
from IPython.utils.tempdir import TemporaryDirectory
from IPython.utils.pickleshare import PickleShareDB
class PickleShareDBTestCase(TestCase):
def setUp(self):
self.tempdir = Tempo... | 30.2 | 62 | 0.527764 |
797840e8e70d8718adc603de9228ad0bb47633d8 | 1,467 | py | Python | profiles_api/serializers.py | vinayreddy2592/profiles-rest-api | 34639c132ee08f4822661a37d7b84d179f01ce4f | [
"MIT"
] | null | null | null | profiles_api/serializers.py | vinayreddy2592/profiles-rest-api | 34639c132ee08f4822661a37d7b84d179f01ce4f | [
"MIT"
] | null | null | null | profiles_api/serializers.py | vinayreddy2592/profiles-rest-api | 34639c132ee08f4822661a37d7b84d179f01ce4f | [
"MIT"
] | null | null | null | from rest_framework import serializers
from profiles_api import models
class HelloSerializer(serializers.Serializer):
"""Serializes a name field for testig our APIView"""
name = serializers.CharField(max_length=10)
class UserProfileSerializer(serializers.ModelSerializer):
"""Serializes a user profile ob... | 29.938776 | 68 | 0.630539 |
797841946f9c26071c8fafc603b113502d16eed8 | 1,760 | py | Python | folium/plugins/scroll_zoom_toggler.py | iwpnd/folium | 67aab11039cd990d73fdf14566380286835ff84b | [
"MIT"
] | 1 | 2022-03-11T00:37:00.000Z | 2022-03-11T00:37:00.000Z | folium/plugins/scroll_zoom_toggler.py | iwpnd/folium | 67aab11039cd990d73fdf14566380286835ff84b | [
"MIT"
] | null | null | null | folium/plugins/scroll_zoom_toggler.py | iwpnd/folium | 67aab11039cd990d73fdf14566380286835ff84b | [
"MIT"
] | null | null | null | from branca.element import MacroElement
from jinja2 import Template
class ScrollZoomToggler(MacroElement):
"""Creates a button for enabling/disabling scroll on the Map."""
_template = Template("""
{% macro header(this,kwargs) %}
<style>
#{{ this.get_name() }} {
... | 33.207547 | 99 | 0.471023 |
7978420ca85593d892e041b7921812c1e1fbb03d | 22,362 | py | Python | lsql/judge/tests/test_ranking.py | Tamiflu9/lsql | 5e2620eedd32949af85ea885cb54fe0f16defd0d | [
"MIT"
] | null | null | null | lsql/judge/tests/test_ranking.py | Tamiflu9/lsql | 5e2620eedd32949af85ea885cb54fe0f16defd0d | [
"MIT"
] | null | null | null | lsql/judge/tests/test_ranking.py | Tamiflu9/lsql | 5e2620eedd32949af85ea885cb54fe0f16defd0d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Tests for rankings
"""
from datetime import datetime
import tempfile
import openpyxl
from django.test import TestCase, Client
from django.urls import reverse
from judge.models import NumSolvedCollectionAchievementDefinition, PodiumAchievementDefinition, \
NumSolvedAchievementDefinition... | 58.083117 | 120 | 0.612736 |
797842b2b61fd265f5630fc402251c06066bc76a | 2,623 | py | Python | google_backend_rule_table.py | loghmanb/daily-coding-problem | 97c165fc00422566f463cd862374de66135bc3e3 | [
"MIT"
] | null | null | null | google_backend_rule_table.py | loghmanb/daily-coding-problem | 97c165fc00422566f463cd862374de66135bc3e3 | [
"MIT"
] | null | null | null | google_backend_rule_table.py | loghmanb/daily-coding-problem | 97c165fc00422566f463cd862374de66135bc3e3 | [
"MIT"
] | null | null | null | '''
Google Interview Question for Backend Developers
https://www.careercup.com/question?id=5651823193489408
You have a table :
Rule1 Rule2 Rule3 Value
A1 B2 C3 40
A1 B1 C1 20
A2 B2 C2 10
A1 B1 C1 40
* B1 * 20
A5 B2 * 10
Now i... | 29.806818 | 113 | 0.472741 |
797842fb3725d457caeb6e37343548bd8c3ea108 | 5,078 | py | Python | samtranslator/model/lambda_.py | forzagreen/serverless-application-model | 966a26cb2329606cae669ba151c06c1c12150729 | [
"Apache-2.0"
] | null | null | null | samtranslator/model/lambda_.py | forzagreen/serverless-application-model | 966a26cb2329606cae669ba151c06c1c12150729 | [
"Apache-2.0"
] | null | null | null | samtranslator/model/lambda_.py | forzagreen/serverless-application-model | 966a26cb2329606cae669ba151c06c1c12150729 | [
"Apache-2.0"
] | null | null | null | from samtranslator.model import PropertyType, Resource
from samtranslator.model.types import is_type, one_of, is_str, list_of, any_type
from samtranslator.model.intrinsics import fnGetAtt, ref
class LambdaFunction(Resource):
resource_type = "AWS::Lambda::Function"
property_types = {
"Code": PropertyTy... | 42.672269 | 117 | 0.669949 |
797843330f784ddcce9ebd39d401e486b443bda4 | 6,149 | py | Python | roboto/datautil.py | tarcisioe/roboto | 7358eab184ccc7192444845144cb9d172ae3066d | [
"MIT"
] | 5 | 2020-04-22T22:51:00.000Z | 2021-10-02T01:08:10.000Z | roboto/datautil.py | tarcisioe/roboto | 7358eab184ccc7192444845144cb9d172ae3066d | [
"MIT"
] | 40 | 2020-04-05T14:43:58.000Z | 2021-10-09T20:32:11.000Z | roboto/datautil.py | tarcisioe/roboto | 7358eab184ccc7192444845144cb9d172ae3066d | [
"MIT"
] | 2 | 2020-04-04T15:51:23.000Z | 2021-10-02T00:17:57.000Z | """Utilities from deserializing values as dataclasses."""
from dataclasses import asdict, fields, is_dataclass
from enum import Enum
from typing import (
Any,
Dict,
List,
Optional,
Type,
TypeVar,
Union,
cast,
get_type_hints,
overload,
)
from typing_extensions import Literal
from... | 27.698198 | 84 | 0.629859 |
797844241c029bf5d3473caa011af20fa6f791cd | 499 | py | Python | trinity/components/eth2/eth1_monitor/exceptions.py | dendisuhubdy/trinity | 001664781259c7dd0779a0ef6f822451b608ded4 | [
"MIT"
] | 14 | 2020-08-24T18:23:31.000Z | 2021-11-04T14:11:04.000Z | trinity/components/eth2/eth1_monitor/exceptions.py | dendisuhubdy/trinity | 001664781259c7dd0779a0ef6f822451b608ded4 | [
"MIT"
] | 19 | 2020-08-25T15:57:05.000Z | 2021-07-07T00:49:45.000Z | trinity/components/eth2/eth1_monitor/exceptions.py | dendisuhubdy/trinity | 001664781259c7dd0779a0ef6f822451b608ded4 | [
"MIT"
] | 7 | 2020-08-24T22:53:02.000Z | 2022-03-28T18:51:48.000Z | from eth_utils import ValidationError
class Eth1MonitorError(Exception):
...
class Eth1MonitorValidationError(ValidationError, Eth1MonitorError):
...
class Eth1BlockNotFound(Eth1MonitorError):
...
class DepositDataCorrupted(Eth1MonitorError):
"""
`DepositData` which we have locally is not co... | 17.821429 | 89 | 0.745491 |
7978447a839f989621bad4a2ad9b25f9d025d4fb | 706 | py | Python | app/request.py | Angelamutyota/blog-point | d68da8632951702d797206e07ec7fb57d2234443 | [
"Unlicense",
"MIT"
] | null | null | null | app/request.py | Angelamutyota/blog-point | d68da8632951702d797206e07ec7fb57d2234443 | [
"Unlicense",
"MIT"
] | null | null | null | app/request.py | Angelamutyota/blog-point | d68da8632951702d797206e07ec7fb57d2234443 | [
"Unlicense",
"MIT"
] | null | null | null | # from app.models.models_test import Quote
import urllib.request, json
from .models import Quote
# Getting the base url
base_url= None
def configure_request(app):
global base_url
base_url = app.config['QUOTE_API_BASE_URL']
def get_quotes():
'''
Function that gets the json response to our url request... | 22.0625 | 59 | 0.699717 |
797845158c89b7bca5c24f7e115b94d8dac835e1 | 7,024 | py | Python | openpyxl/packaging/workbook.py | xinetzone/openpyxl | df1507591952e6b4f865957bafc4f69e44845b75 | [
"MIT"
] | null | null | null | openpyxl/packaging/workbook.py | xinetzone/openpyxl | df1507591952e6b4f865957bafc4f69e44845b75 | [
"MIT"
] | null | null | null | openpyxl/packaging/workbook.py | xinetzone/openpyxl | df1507591952e6b4f865957bafc4f69e44845b75 | [
"MIT"
] | null | null | null | # Copyright (c) 2010-2022 openpyxl
from openpyxl.descriptors.serialisable import Serialisable
from openpyxl.descriptors import (
Alias,
Typed,
String,
Integer,
Bool,
NoneSet,
Set,
Sequence,
)
from openpyxl.descriptors.excel import ExtensionList, Relation
from openpyxl.descriptors.sequen... | 34.263415 | 118 | 0.652904 |
79784625506d2e3e823a1678a780ba1731d6feba | 1,694 | py | Python | ch04/train_neuralnet.py | onlyforreg/deep-learning-from-scratch | e71797f95b8442e592a4424df91dac06cc4934f6 | [
"MIT"
] | 1 | 2020-08-20T14:01:50.000Z | 2020-08-20T14:01:50.000Z | ch04/train_neuralnet.py | onlyforreg/deep-learning-from-scratch | e71797f95b8442e592a4424df91dac06cc4934f6 | [
"MIT"
] | null | null | null | ch04/train_neuralnet.py | onlyforreg/deep-learning-from-scratch | e71797f95b8442e592a4424df91dac06cc4934f6 | [
"MIT"
] | null | null | null | # coding: utf-8
import sys, os
sys.path.append(os.pardir) # 親ディレクトリのファイルをインポートするための設定
sys.path.append(os.getcwd())
import numpy as np
import matplotlib.pyplot as plt
from dataset.mnist import load_mnist
from two_layer_net import TwoLayerNet
# データの読み込み
(x_train, t_train), (x_test, t_test) = load_mnist(normalize=True, ... | 29.206897 | 85 | 0.697166 |
79784656d76b958c5db1584124f40ae2b77ede52 | 884 | py | Python | pinax/referrals/admin.py | Boondockers-Welcome/pinax-referrals | 761b484bd115510666a07150bc17d6dd7825c791 | [
"MIT"
] | null | null | null | pinax/referrals/admin.py | Boondockers-Welcome/pinax-referrals | 761b484bd115510666a07150bc17d6dd7825c791 | [
"MIT"
] | null | null | null | pinax/referrals/admin.py | Boondockers-Welcome/pinax-referrals | 761b484bd115510666a07150bc17d6dd7825c791 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Referral, ReferralResponse
admin.site.register(
Referral,
list_display=[
"user",
"code",
"label",
"redirect_to",
"target_content_type",
"target_object_id"
],
readonly_fields=["code", "created_at"],
... | 26 | 98 | 0.627828 |
7978471e6e3c4ce04be8ce20dcc7feefe3afffb6 | 2,745 | py | Python | clientService.py | amar771/DataGenerator-uni-db1-s1 | 642a16d2b275e28624369cd76eae79bd8f2e26f3 | [
"MIT"
] | null | null | null | clientService.py | amar771/DataGenerator-uni-db1-s1 | 642a16d2b275e28624369cd76eae79bd8f2e26f3 | [
"MIT"
] | null | null | null | clientService.py | amar771/DataGenerator-uni-db1-s1 | 642a16d2b275e28624369cd76eae79bd8f2e26f3 | [
"MIT"
] | null | null | null | '''
Works with python 3.x
Generates data about client purchases
'''
from random import randint
from datetime import datetime
def get_random_date(lowYear=2016, highYear=2018):
newDate = datetime(randint(lowYear, highYear),
randint(1, 12),
randint(1, 28))
... | 27.727273 | 64 | 0.557013 |
797847db1aacee59121dc8051cfa595cf084598c | 167 | py | Python | examples/expected_hello-world/parameters.py | RLogik/phpytex | 4e422a07ec23b4ade5263db499318b3e2c75f1f9 | [
"MIT"
] | null | null | null | examples/expected_hello-world/parameters.py | RLogik/phpytex | 4e422a07ec23b4ade5263db499318b3e2c75f1f9 | [
"MIT"
] | 8 | 2021-08-24T12:27:02.000Z | 2021-10-14T07:50:12.000Z | examples/expected_hello-world/parameters.py | RLogik/phpytex | 4e422a07ec23b4ade5263db499318b3e2c75f1f9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
Greeting = r'Hello World';
Planets = [r'mercury',r'venus',r'terra',r'mars',r'jupiter',r'saturn',r'uranus',r'neptune'];
| 27.833333 | 91 | 0.640719 |
7978480fea77fa050028c86be74ae66bcf6eccdb | 4,969 | py | Python | rnn_speech_recognition/pytorch/common/sampler.py | lamyiowce/training | da4c959b5a7b65091b850872cdd4014d768c087c | [
"Apache-2.0"
] | 567 | 2018-09-13T05:07:49.000Z | 2020-11-23T11:52:11.000Z | rnn_speech_recognition/pytorch/common/sampler.py | lamyiowce/training | da4c959b5a7b65091b850872cdd4014d768c087c | [
"Apache-2.0"
] | 222 | 2018-09-14T10:15:39.000Z | 2020-11-20T22:21:09.000Z | rnn_speech_recognition/pytorch/common/sampler.py | ltechkorea/mlperf-training | 498b945dd914573bdbf7a871eaeebd9388b60b76 | [
"Apache-2.0"
] | 279 | 2018-09-16T12:40:29.000Z | 2020-11-17T14:22:52.000Z | # Copyright (c) 2020, NVIDIA CORPORATION. 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 ... | 34.506944 | 80 | 0.652244 |
797848692543b5dcf275b09607e06385c6f65e62 | 10,185 | py | Python | BalancerWindowsRebalance/Strategy.py | powerpool-finance/powerpool-research | 2acfe857d42ee4d570fe0606f35f278bfbd56aef | [
"MIT"
] | 3 | 2022-02-11T17:13:30.000Z | 2022-02-27T12:21:09.000Z | BalancerWindowsRebalance/Strategy.py | powerpool-finance/powerpool-research | 2acfe857d42ee4d570fe0606f35f278bfbd56aef | [
"MIT"
] | null | null | null | BalancerWindowsRebalance/Strategy.py | powerpool-finance/powerpool-research | 2acfe857d42ee4d570fe0606f35f278bfbd56aef | [
"MIT"
] | 2 | 2021-11-29T19:36:14.000Z | 2022-02-11T17:13:32.000Z | #!/usr/bin/env python
# coding: utf-8
# ## Functions of three Strategies
# In[ ]:
from Balancer_lib_new import *
fee=0.3
import copy
# In[ ]:
def strategy1(pool1, ratio1, datas, n, step, fee, gas_fee):
st=[]
arr_pool1=[]
arr_value_pool1=[]
arr_value_tokens1=[]
arr_IL1=[]
w1=[]
arr_ratio1... | 30.044248 | 126 | 0.602847 |
797849046dc4a7b2c74ef3e19790d68c98b58641 | 26,506 | py | Python | patcherex/utils.py | swkim101/patcherex | cd6f3ffb707f347a7366bb33c72a31fbca7114f8 | [
"BSD-2-Clause"
] | null | null | null | patcherex/utils.py | swkim101/patcherex | cd6f3ffb707f347a7366bb33c72a31fbca7114f8 | [
"BSD-2-Clause"
] | null | null | null | patcherex/utils.py | swkim101/patcherex | cd6f3ffb707f347a7366bb33c72a31fbca7114f8 | [
"BSD-2-Clause"
] | null | null | null | import os
import re
import sys
import shutil
import struct
import capstone
import tempfile
import contextlib
import subprocess
import fnmatch
import os
import string
from .errors import ASMConverterError, ASMConverterNotImplementedError
class NasmException(Exception):
pass
class CLangException(Exception):
p... | 32.723457 | 118 | 0.508451 |
79784946e390f511a397c0c6e941c13b7f0f9f36 | 5,056 | py | Python | RL/agents/stats_recording_agent.py | bhatiaabhinav/RL-v2 | 38322aac7d1dcb1f9e86dd32bc1d861d143dcd7a | [
"MIT"
] | 4 | 2021-01-14T02:32:37.000Z | 2022-02-20T19:36:51.000Z | RL/agents/stats_recording_agent.py | bhatiaabhinav/RL-v2 | 38322aac7d1dcb1f9e86dd32bc1d861d143dcd7a | [
"MIT"
] | 3 | 2020-08-15T13:46:00.000Z | 2021-06-08T21:58:42.000Z | RL/agents/stats_recording_agent.py | bhatiaabhinav/RL-v2 | 38322aac7d1dcb1f9e86dd32bc1d861d143dcd7a | [
"MIT"
] | 1 | 2020-09-16T05:50:34.000Z | 2020-09-16T05:50:34.000Z | import logging
import time
from collections import deque
import wandb
import RL
logger = logging.getLogger(__name__)
class StatsRecordingAgent(RL.Agent):
def __init__(self, name, algo, reward_scaling, cost_scaling, record_unscaled, gamma, cost_gamma, record_undiscounted, frameskip, RPE_av_over=100, RPS_av_over... | 39.5 | 170 | 0.637263 |
79784a3eac4598977a6300dfc4e6103cdac587c5 | 4,733 | py | Python | skimage/color/tests/test_delta_e.py | thewtex/scikit-image | 22bb6b94698b8889cbdf26b25d9e4fdb8b968d97 | [
"BSD-3-Clause"
] | 3 | 2019-02-28T16:05:36.000Z | 2020-04-03T17:29:07.000Z | skimage/color/tests/test_delta_e.py | thewtex/scikit-image | 22bb6b94698b8889cbdf26b25d9e4fdb8b968d97 | [
"BSD-3-Clause"
] | 30 | 2020-04-15T19:37:40.000Z | 2020-04-22T21:19:35.000Z | skimage/color/tests/test_delta_e.py | thewtex/scikit-image | 22bb6b94698b8889cbdf26b25d9e4fdb8b968d97 | [
"BSD-3-Clause"
] | 3 | 2019-12-31T23:21:40.000Z | 2020-04-03T17:29:08.000Z | """Test for correctness of color distance functions"""
from os.path import abspath, dirname, join as pjoin
import numpy as np
from skimage._shared.testing import assert_allclose
from skimage.color import (deltaE_cie76,
deltaE_ciede94,
deltaE_ciede2000,
... | 29.03681 | 72 | 0.544686 |
79784af15ef28dbc889062e897cb7062aadc92d1 | 1,600 | py | Python | 6.3/Scraping.py | Tabitha2912/PersonalWeb | 1ccdebcaa2808a66f3036b3f5fcfdedd9397f570 | [
"CC-BY-3.0"
] | null | null | null | 6.3/Scraping.py | Tabitha2912/PersonalWeb | 1ccdebcaa2808a66f3036b3f5fcfdedd9397f570 | [
"CC-BY-3.0"
] | null | null | null | 6.3/Scraping.py | Tabitha2912/PersonalWeb | 1ccdebcaa2808a66f3036b3f5fcfdedd9397f570 | [
"CC-BY-3.0"
] | null | null | null | from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.service import Service
from datetime import datetime
import urllib.request
import json
s = Service("D:/Kuliah/Semester 2/Proyek 1/Pertemuan 6/Tugas 6.3/msedgedriver.exe")
driver = webdriver.Edge(service=s)
driver.... | 39.02439 | 108 | 0.578125 |
79784b677dc762fb5ad39bd5b79b924ffd084143 | 801 | py | Python | api/urls.py | mwschouten/gps | d6086b210f5ccf599970a6fbe2abe51d71775a20 | [
"MIT"
] | null | null | null | api/urls.py | mwschouten/gps | d6086b210f5ccf599970a6fbe2abe51d71775a20 | [
"MIT"
] | null | null | null | api/urls.py | mwschouten/gps | d6086b210f5ccf599970a6fbe2abe51d71775a20 | [
"MIT"
] | null | null | null | """gps URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based v... | 34.826087 | 79 | 0.699126 |
79784bc5faa48a71ce5ddfdc8e2069374fa7095c | 7,835 | py | Python | contrib/bitrpc/bitrpc.py | xnccoin/XNCCoin | 24470202c4d2ba8d0a2670445ee90ffd4c3416bb | [
"MIT"
] | null | null | null | contrib/bitrpc/bitrpc.py | xnccoin/XNCCoin | 24470202c4d2ba8d0a2670445ee90ffd4c3416bb | [
"MIT"
] | null | null | null | contrib/bitrpc/bitrpc.py | xnccoin/XNCCoin | 24470202c4d2ba8d0a2670445ee90ffd4c3416bb | [
"MIT"
] | null | null | null | from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:8332")
else:
access = Ser... | 24.182099 | 79 | 0.668283 |
79784bdbbac6a2bda38df43d790c1efd431525dd | 711 | py | Python | tests/settings.py | SVDV/django-haystack | ae0f02d894b7936c6f5039fc69a03fea473b8473 | [
"BSD-3-Clause"
] | null | null | null | tests/settings.py | SVDV/django-haystack | ae0f02d894b7936c6f5039fc69a03fea473b8473 | [
"BSD-3-Clause"
] | 1 | 2016-08-03T18:01:43.000Z | 2016-08-03T18:03:00.000Z | tests/settings.py | SVDV/django-haystack | ae0f02d894b7936c6f5039fc69a03fea473b8473 | [
"BSD-3-Clause"
] | null | null | null | from os import environ
SECRET_KEY = "Please do not spew DeprecationWarnings"
# Haystack settings for running tests.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'haystack_tests.db',
}
}
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
... | 19.216216 | 56 | 0.654008 |
79784be86db52095dee626c8f7e833d7169e4bdd | 1,185 | py | Python | test/functional/rpc_generate.py | Mantle-One/mantlecoin | 61342ad672819d412b17ec110aca89a9d0205dcc | [
"MIT"
] | null | null | null | test/functional/rpc_generate.py | Mantle-One/mantlecoin | 61342ad672819d412b17ec110aca89a9d0205dcc | [
"MIT"
] | null | null | null | test/functional/rpc_generate.py | Mantle-One/mantlecoin | 61342ad672819d412b17ec110aca89a9d0205dcc | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2020 The Mantle Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test generate RPC."""
from test_framework.test_framework import MantleTestFramework
from test_framework.util... | 32.027027 | 95 | 0.691139 |
79784d01e105be10e100249aa9f09cc885e40174 | 4,003 | py | Python | google/ads/googleads/v4/services/services/campaign_service/transports/base.py | batardo/google-ads-python | a39748521847e85138fca593f3be2681352ad024 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v4/services/services/campaign_service/transports/base.py | batardo/google-ads-python | a39748521847e85138fca593f3be2681352ad024 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v4/services/services/campaign_service/transports/base.py | batardo/google-ads-python | a39748521847e85138fca593f3be2681352ad024 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 33.923729 | 78 | 0.663502 |
79784d6664b9f86b29d2291c06813bb5f074f0e5 | 1,602 | py | Python | samples/generated_samples/aiplatform_generated_aiplatform_v1beta1_model_service_update_model_sync.py | lclc19/python-aiplatform | d8da2e365277441abadb04328943f23345d72b0e | [
"Apache-2.0"
] | 180 | 2020-09-23T17:21:15.000Z | 2022-03-30T17:25:47.000Z | samples/generated_samples/aiplatform_generated_aiplatform_v1beta1_model_service_update_model_sync.py | lclc19/python-aiplatform | d8da2e365277441abadb04328943f23345d72b0e | [
"Apache-2.0"
] | 601 | 2020-09-23T16:23:44.000Z | 2022-03-31T19:08:23.000Z | samples/generated_samples/aiplatform_generated_aiplatform_v1beta1_model_service_update_model_sync.py | lclc19/python-aiplatform | d8da2e365277441abadb04328943f23345d72b0e | [
"Apache-2.0"
] | 109 | 2020-09-23T16:22:04.000Z | 2022-03-28T21:18:29.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 31.411765 | 85 | 0.760924 |
79784dcaf59a40bf1ab0d20a865eb74b0baaaf16 | 3,527 | py | Python | hasher-matcher-actioner/hmalib/banks/bank_operations.py | crhird/ThreatExchange | bb1d80c414fd44fb94ade28dc332126da2db4e51 | [
"BSD-3-Clause"
] | null | null | null | hasher-matcher-actioner/hmalib/banks/bank_operations.py | crhird/ThreatExchange | bb1d80c414fd44fb94ade28dc332126da2db4e51 | [
"BSD-3-Clause"
] | null | null | null | hasher-matcher-actioner/hmalib/banks/bank_operations.py | crhird/ThreatExchange | bb1d80c414fd44fb94ade28dc332126da2db4e51 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
"""
Defines the "Banks" API. What operations can be done on a bank?
Coordinates common operations. Conceptually midway between the API and the DB
Layer.
"""
import typing as t
import json
from mypy_boto3_sqs.client import SQSClient
from threate... | 29.889831 | 88 | 0.730082 |
79784f4ba5672ed904d0fba8dbe91f15c4cff181 | 5,281 | py | Python | src/rust/iced-x86-py/tests/formatter_intel_test.py | darfink/iced | 6371d812392a02bd9c37cbe4f19d2dcdf33aacd4 | [
"MIT"
] | 1 | 2021-05-12T21:05:23.000Z | 2021-05-12T21:05:23.000Z | src/rust/iced-x86-py/tests/formatter_intel_test.py | paulfariello/iced | 08f663ae9626b05ab08ad36dd5143f94aed365b6 | [
"MIT"
] | 59 | 2021-03-22T08:48:28.000Z | 2022-03-02T00:22:28.000Z | src/rust/iced-x86-py/tests/formatter_intel_test.py | paulfariello/iced | 08f663ae9626b05ab08ad36dd5143f94aed365b6 | [
"MIT"
] | null | null | null | # SPDX-License-Identifier: MIT
# Copyright (C) 2018-present iced project and contributors
from iced_x86 import *
FORMATTER_SYNTAX = FormatterSyntax.INTEL
def test_default_options():
formatter = Formatter(FORMATTER_SYNTAX)
assert not formatter.uppercase_prefixes
assert not formatter.uppercase_mnemonics
assert no... | 44.754237 | 118 | 0.811589 |
797850bbd0f5fcbf8eddee5cc41ecf440ad79d2a | 6,267 | py | Python | fairseq/models/huggingface/hf_gpt2.py | nedo0shki/fairseq-editor | a0f09787bc0d302be5833ec0dad3e568440f4551 | [
"MIT"
] | 490 | 2018-08-18T14:25:38.000Z | 2022-03-25T12:19:35.000Z | fairseq/models/huggingface/hf_gpt2.py | nedo0shki/fairseq-editor | a0f09787bc0d302be5833ec0dad3e568440f4551 | [
"MIT"
] | 23 | 2020-09-12T05:13:23.000Z | 2021-09-16T13:49:31.000Z | fairseq/models/huggingface/hf_gpt2.py | nedo0shki/fairseq-editor | a0f09787bc0d302be5833ec0dad3e568440f4551 | [
"MIT"
] | 80 | 2018-08-20T09:54:49.000Z | 2022-03-22T01:18:23.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import os
import sys
from typing import Dict, List, Optional
import torch
from fairseq.models import (
FairseqIncrementalD... | 35.011173 | 86 | 0.646402 |
7978511e200dc78a153ee229fff480c5729eb586 | 8,382 | py | Python | detectron2/modeling/poolers.py | atzenn/detectron2 | 989f52d67d05445ccd030d8f13d6cc53e297fb91 | [
"Apache-2.0"
] | 1 | 2020-04-19T01:44:54.000Z | 2020-04-19T01:44:54.000Z | detectron2/modeling/poolers.py | atzenn/detectron2 | 989f52d67d05445ccd030d8f13d6cc53e297fb91 | [
"Apache-2.0"
] | null | null | null | detectron2/modeling/poolers.py | atzenn/detectron2 | 989f52d67d05445ccd030d8f13d6cc53e297fb91 | [
"Apache-2.0"
] | 1 | 2020-04-19T01:44:56.000Z | 2020-04-19T01:44:56.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import math
import sys
import torch
from torch import nn
from torchvision.ops import RoIPool
from detectron2.layers import ROIAlign, ROIAlignRotated, cat
def assign_boxes_to_levels(box_lists, min_level, max_level, canonical_box_size, canonical_l... | 42.984615 | 100 | 0.637557 |
797851e118210cf71787fdc1211da09add7e2d70 | 4,764 | py | Python | python/setup.py | andrewdotn/hfst-optimized-lookup | e1148c71ad2a268437093726323381ae0f54621d | [
"Apache-2.0"
] | 2 | 2021-01-13T20:26:19.000Z | 2022-01-04T11:24:38.000Z | python/setup.py | andrewdotn/hfst_optimized_lookup | 9a2808e9075909c87f1fe40bbbe6ab7578d404b0 | [
"Apache-2.0"
] | 6 | 2021-02-03T18:41:24.000Z | 2021-08-17T15:53:52.000Z | python/setup.py | andrewdotn/hfst-optimized-lookup | e1148c71ad2a268437093726323381ae0f54621d | [
"Apache-2.0"
] | 2 | 2021-02-25T22:30:29.000Z | 2021-05-13T17:09:28.000Z | # type: ignore
# ^ otherwise `pytest --mypy` complains; see “No stub for setuptools?” at
# https://github.com/python/typeshed/issues/2171
# setup.py for hfst_optimized_lookup
#
# The intent here is:
# - When building from a git checkout, run Cython on the `.pyx` file to
# get a `.cpp` file to go to pypi
# - ... | 37.511811 | 176 | 0.72838 |
79785258a4a0199a452c72407a5325f05da80e5f | 1,097 | py | Python | mosqito/functions/loudness_zwicker/loudness_zwicker_temporal_weighting.py | JosemaAlvarez/MoSQITo | 95754e91ff42906e6f1899aa3f6b6a4980d34d8a | [
"Apache-2.0"
] | null | null | null | mosqito/functions/loudness_zwicker/loudness_zwicker_temporal_weighting.py | JosemaAlvarez/MoSQITo | 95754e91ff42906e6f1899aa3f6b6a4980d34d8a | [
"Apache-2.0"
] | null | null | null | mosqito/functions/loudness_zwicker/loudness_zwicker_temporal_weighting.py | JosemaAlvarez/MoSQITo | 95754e91ff42906e6f1899aa3f6b6a4980d34d8a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@date Created on Fri May 22 2020
@author martin_g for Eomys
"""
import sys
sys.path.append('../..')
# Local application import
from mosqito.functions.loudness_zwicker.loudness_zwicker_lowpass_intp import loudness_zwicker_lowpass_intp
def loudness_zwicker_temporal_weighting(loudness):
... | 28.128205 | 106 | 0.697356 |
797855927837c6a91aaacb99e29ace9146fa4d04 | 620 | py | Python | pixelpuncher/player/migrations/0017_auto_20160506_0528.py | ej2/pixelpuncher | 8dd31090252c00772932c78ea21438d1e979f722 | [
"BSD-3-Clause"
] | null | null | null | pixelpuncher/player/migrations/0017_auto_20160506_0528.py | ej2/pixelpuncher | 8dd31090252c00772932c78ea21438d1e979f722 | [
"BSD-3-Clause"
] | null | null | null | pixelpuncher/player/migrations/0017_auto_20160506_0528.py | ej2/pixelpuncher | 8dd31090252c00772932c78ea21438d1e979f722 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-05-06 05:28
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('player', '0016_auto_20160110_2056'),
]
operations = [
migrations.AddField(
... | 23.846154 | 49 | 0.601613 |
797856bcb93e1d8265ecb8de9e816e2f447a09eb | 1,574 | py | Python | accenv/lib/python3.4/site-packages/bootstrap3/html.py | adamshamsudeen/clubdin-dj | eb48c67dab3a4ae7c4032544eb4d64e0b1d7e15a | [
"MIT"
] | 1 | 2015-05-12T11:40:38.000Z | 2015-05-12T11:40:38.000Z | bootstrap3/html.py | nikolas/django-bootstrap3 | 0ca18577c39218e85d52b65213da3e2a6991a1c5 | [
"Apache-2.0"
] | null | null | null | bootstrap3/html.py | nikolas/django-bootstrap3 | 0ca18577c39218e85d52b65213da3e2a6991a1c5 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.forms.widgets import flatatt
from .text import text_value
# Handle HTML and CSS manipulation
def split_css_classes(css_classes):
"""
Turn string into a list of CSS classes
"""
classes_list = text_value(css_classes).split('... | 25.803279 | 91 | 0.660737 |
797856dc8cb571d8e8aaa7adf4be31e0b9eeecb2 | 398 | py | Python | sample_request.py | sikhoalieng/job-recommendation-engine | aff0ee06f94daf4bc1fda2feba7cb3b38c522666 | [
"MIT"
] | null | null | null | sample_request.py | sikhoalieng/job-recommendation-engine | aff0ee06f94daf4bc1fda2feba7cb3b38c522666 | [
"MIT"
] | null | null | null | sample_request.py | sikhoalieng/job-recommendation-engine | aff0ee06f94daf4bc1fda2feba7cb3b38c522666 | [
"MIT"
] | null | null | null | import requests
# Initialize the Keras REST API endpoint URL along with the input
url = "http://localhost:5000/predict"
data = {
"major_input": "Accounting",
"degree_type_input": "Bachelor's",
"managed_others_input": "No",
"years_exp_input": 2,
"k": 50}
# Submit the request
response = requests.post(url, hea... | 24.875 | 93 | 0.711055 |
797857285f52e4a7a93553444531630eae554f9a | 7,473 | py | Python | Goland Wing/Scale 1by9/modal_optim_GOLAND_COBYLA_scale1by9.py | aguptaisae/Masters-Research-Project-S2 | b44cd21a95a60b8fb38852dac5a5b0794e1f3e3f | [
"Apache-2.0"
] | 4 | 2019-02-15T14:43:15.000Z | 2021-04-13T04:22:48.000Z | Goland Wing/Scale 1by9/modal_optim_GOLAND_COBYLA_scale1by9.py | aguptaisae/Masters-Research-Project-S2 | b44cd21a95a60b8fb38852dac5a5b0794e1f3e3f | [
"Apache-2.0"
] | null | null | null | Goland Wing/Scale 1by9/modal_optim_GOLAND_COBYLA_scale1by9.py | aguptaisae/Masters-Research-Project-S2 | b44cd21a95a60b8fb38852dac5a5b0794e1f3e3f | [
"Apache-2.0"
] | 3 | 2020-11-27T02:18:16.000Z | 2021-08-04T13:47:46.000Z | # -*- coding: utf-8 -*-
"""
Created on Tue Mar 29 10:50:10 2016
@author: © Joan Mas Colomer
"""
from __future__ import print_function
from openmdao.api import Problem, Group, IndepVarComp, ExecComp, ScipyGMRES, SqliteRecorder, ScipyOptimizer, view_model
from aerostructures import NastranDynamic, ModalFun... | 36.99505 | 164 | 0.627593 |
79785888ccae420d45dfe4303b45d63deb3361b3 | 285 | py | Python | huiAudioCorpus/model/Histogram.py | iisys-hof/HUI-Audio-Corpus-German | 4d2de2ed538a6b943166e1e35c10ee8b0b266be6 | [
"Apache-2.0"
] | 11 | 2021-06-22T09:44:28.000Z | 2022-01-10T12:35:29.000Z | huiAudioCorpus/model/Histogram.py | iisys-hof/HUI-Audio-Corpus-German | 4d2de2ed538a6b943166e1e35c10ee8b0b266be6 | [
"Apache-2.0"
] | 1 | 2021-07-17T20:19:01.000Z | 2021-10-04T09:36:43.000Z | huiAudioCorpus/model/Histogram.py | iisys-hof/HUI-Audio-Corpus-German | 4d2de2ed538a6b943166e1e35c10ee8b0b266be6 | [
"Apache-2.0"
] | null | null | null | from huiAudioCorpus.utils.ModelToStringConverter import ToString
from typing import List, TypeVar
number = TypeVar('number', int, float)
class Histogram(ToString):
def __init__(self, bins: List[number], values: List[number]):
self.bins = bins
self.values = values
| 31.666667 | 65 | 0.729825 |
797859e141d88622e3c058743d13ea4db6e6de5e | 296 | py | Python | chitti/__init__.py | raja-1996/chitti | 2cd84c45fd0dbac625565c2f3a6b196a50d97396 | [
"MIT"
] | null | null | null | chitti/__init__.py | raja-1996/chitti | 2cd84c45fd0dbac625565c2f3a6b196a50d97396 | [
"MIT"
] | null | null | null | chitti/__init__.py | raja-1996/chitti | 2cd84c45fd0dbac625565c2f3a6b196a50d97396 | [
"MIT"
] | null | null | null | name='chitti'
from chitti.print import pprint, plen, pprint_nl
from chitti.color_text import color_words_in_text
from chitti.sklearn_utilities import plot_confusion_matrix as confusion_matrix
from chitti.list_to_dic import counter, counter_df
from chitti.train_test_split import train_val_split
| 37 | 78 | 0.871622 |
797859e22c919db42384559dd6061a5408e0fa73 | 73,338 | py | Python | angr/state_plugins/unicorn_engine.py | aflorea-2k/angr | 39306e5fbd629cd80880b7aa59b1c6b832423996 | [
"BSD-2-Clause"
] | null | null | null | angr/state_plugins/unicorn_engine.py | aflorea-2k/angr | 39306e5fbd629cd80880b7aa59b1c6b832423996 | [
"BSD-2-Clause"
] | null | null | null | angr/state_plugins/unicorn_engine.py | aflorea-2k/angr | 39306e5fbd629cd80880b7aa59b1c6b832423996 | [
"BSD-2-Clause"
] | null | null | null | import binascii
import copy
import ctypes
import itertools
import logging
import os
import sys
import threading
import time
import archinfo
import cffi # lmao
import claripy
import pyvex
from angr.engines.vex.claripy import ccall
from angr.sim_state import SimState
from .. import sim_options as options
from ..errors... | 43.292798 | 140 | 0.63566 |
79785a773fc8bce40738755ff3ab44edc656152b | 19,195 | py | Python | highway_env/vehicle/uncertainty/prediction.py | Little-Sky/highway-env | 891dec0a4b6c0b3c6c7343548a859dff2ad52882 | [
"MIT"
] | 3 | 2021-04-23T03:30:57.000Z | 2021-04-27T19:32:41.000Z | highway_env/vehicle/uncertainty/prediction.py | Little-Sky/highway-env | 891dec0a4b6c0b3c6c7343548a859dff2ad52882 | [
"MIT"
] | 1 | 2020-11-10T14:51:29.000Z | 2020-11-11T01:27:37.000Z | build/lib/highway_env/vehicle/uncertainty/prediction.py | chenxiaochang/CNC_Highway_env | e48a6237e45ead4242e7e62ab5b88c3b75b8aa59 | [
"MIT"
] | 1 | 2020-11-03T01:10:54.000Z | 2020-11-03T01:10:54.000Z | import copy
from typing import List, Tuple, Callable, Union, TYPE_CHECKING
import numpy as np
from highway_env import utils
from highway_env.interval import polytope, vector_interval_section, integrator_interval, \
interval_negative_part, intervals_diff, intervals_product, LPV, interval_absolute_to_local, \
in... | 47.512376 | 118 | 0.606668 |
79785b9ed704d1e3aea18b4911b0e8e62d1d72d2 | 2,796 | py | Python | templates/checkcel/BrasExplor_Population_landrace_template.py | mboudet/braskoload | 8f39f2d68638a683e0d8e5065b33a218afe370cb | [
"MIT"
] | null | null | null | templates/checkcel/BrasExplor_Population_landrace_template.py | mboudet/braskoload | 8f39f2d68638a683e0d8e5065b33a218afe370cb | [
"MIT"
] | null | null | null | templates/checkcel/BrasExplor_Population_landrace_template.py | mboudet/braskoload | 8f39f2d68638a683e0d8e5065b33a218afe370cb | [
"MIT"
] | null | null | null | from checkcel import Checkplate
from checkcel.validators import DateValidator, NoValidator, UniqueValidator, SetValidator, IntValidator
from collections import OrderedDict
class MyTemplate(Checkplate):
empty_ok = True
validators = OrderedDict([
("Population name", UniqueValidator()),
("Samplin... | 54.823529 | 148 | 0.586552 |
79785bef9c8356e2d9008d9eb728a25bc6e67819 | 23,093 | py | Python | salt/states/lxd_container.py | leifliddy/salt | 22edef4bdaa20502865a6710696c953260fc3f76 | [
"Apache-2.0",
"MIT"
] | null | null | null | salt/states/lxd_container.py | leifliddy/salt | 22edef4bdaa20502865a6710696c953260fc3f76 | [
"Apache-2.0",
"MIT"
] | null | null | null | salt/states/lxd_container.py | leifliddy/salt | 22edef4bdaa20502865a6710696c953260fc3f76 | [
"Apache-2.0",
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Manage LXD containers.
.. versionadded:: 2019.2.0
.. note:
- :ref:`pylxd` version 2 is required to let this work,
currently only available via pip.
To install on Ubuntu:
$ apt-get install libssl-dev python-pip
$ pip install -U pylxd
- you need lxd ... | 27.590203 | 88 | 0.577578 |
79785c0fb427a5b2759c06e3506f14e2a604b757 | 8,137 | py | Python | data/external/repositories_2to3/132160/kaggle-ndsb-master/configurations/triplescale_fs2_fs5.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories_2to3/132160/kaggle-ndsb-master/configurations/triplescale_fs2_fs5.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories_2to3/132160/kaggle-ndsb-master/configurations/triplescale_fs2_fs5.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | 1 | 2019-12-04T08:23:33.000Z | 2019-12-04T08:23:33.000Z | import numpy as np
import theano
import theano.tensor as T
import lasagne as nn
import data
import load
import nn_plankton
import dihedral
import tmp_dnn
import tta
patch_sizes = [(95, 95), (47, 47), (47, 47)]
augmentation_params = {
'zoom_range': (1 / 1.6, 1.6),
'rotation_range': (0, ... | 49.920245 | 154 | 0.688706 |
79785c244cf1e5c504ccb8240970230aa39f5ab4 | 755 | py | Python | lists_basics/exercise/seize_the_fire.py | PetkoAndreev/Python-fundamentals | dcf2ecb65d7a82a6688a7529a14eb8a331a83256 | [
"MIT"
] | null | null | null | lists_basics/exercise/seize_the_fire.py | PetkoAndreev/Python-fundamentals | dcf2ecb65d7a82a6688a7529a14eb8a331a83256 | [
"MIT"
] | null | null | null | lists_basics/exercise/seize_the_fire.py | PetkoAndreev/Python-fundamentals | dcf2ecb65d7a82a6688a7529a14eb8a331a83256 | [
"MIT"
] | null | null | null | fire_data = input().split('#')
water = int(input())
result_list = []
total_fire = 0
effort = 0
for fire in fire_data:
fire_type, fire_value = fire.split(' = ')
fire_value = int(fire_value)
if fire_type == 'Low' and fire_value not in range(1, 51):
continue
elif fire_type == 'Medium' and fire_va... | 26.964286 | 67 | 0.635762 |
79785c5c4dcfe1d0e86e3ea5406b87af7cc87f7d | 4,535 | py | Python | venv/Lib/site-packages/ibm_cloud_sdk_core/jwt_token_manager.py | jo2hu6/home-assistant | 1f97943a97d511323f7bfb57facb3fe93840d726 | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/ibm_cloud_sdk_core/jwt_token_manager.py | jo2hu6/home-assistant | 1f97943a97d511323f7bfb57facb3fe93840d726 | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/ibm_cloud_sdk_core/jwt_token_manager.py | jo2hu6/home-assistant | 1f97943a97d511323f7bfb57facb3fe93840d726 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
# Copyright 2019 IBM 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 applicabl... | 32.392857 | 96 | 0.615877 |
79785cb22dce76b0dc87b70070a70e392c460c62 | 1,711 | py | Python | container_app_conf/source/yaml_source.py | markusressel/container-app-conf | 0f28e4fd4e064b244a5f657372a9b4cfee1e24f4 | [
"MIT"
] | 2 | 2019-07-11T23:02:11.000Z | 2019-07-14T02:50:59.000Z | container_app_conf/source/yaml_source.py | markusressel/container-app-conf | 0f28e4fd4e064b244a5f657372a9b4cfee1e24f4 | [
"MIT"
] | 28 | 2019-08-31T00:40:20.000Z | 2022-02-14T15:13:34.000Z | container_app_conf/source/yaml_source.py | markusressel/container-app-conf | 0f28e4fd4e064b244a5f657372a9b4cfee1e24f4 | [
"MIT"
] | 3 | 2019-10-07T13:08:04.000Z | 2021-12-25T00:25:12.000Z | # Copyright (c) 2019 Markus Ressel
# .
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publis... | 38.886364 | 81 | 0.745763 |
79785cf89cd888020b9c645242fd7377f44847d7 | 396 | py | Python | src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_gevent_simple.py | r3m0t/debugpy | 090e3c3ef5758e5b316514c9d6f44f9b9b488cf1 | [
"MIT"
] | null | null | null | src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_gevent_simple.py | r3m0t/debugpy | 090e3c3ef5758e5b316514c9d6f44f9b9b488cf1 | [
"MIT"
] | null | null | null | src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_gevent_simple.py | r3m0t/debugpy | 090e3c3ef5758e5b316514c9d6f44f9b9b488cf1 | [
"MIT"
] | null | null | null | import gevent
def foo():
print('Running in foo')
gevent.sleep(0)
print('Explicit context switch to foo again')
def bar():
print('Explicit context to bar')
gevent.sleep(0) # break here
print('Implicit context switch back to bar')
if __name__ == '__main__':
gevent.joinall([
geve... | 18 | 49 | 0.621212 |
79785e28c65b4090168d291732e0f4aa987ab5b9 | 513 | py | Python | python/tests/test_bias_optimizer.py | stanford-futuredata/sketchstore | c209e4d01343a05dc5aecdb7a9801fc639019fd3 | [
"Apache-2.0"
] | 5 | 2020-05-07T02:25:01.000Z | 2021-05-25T07:54:42.000Z | python/tests/test_bias_optimizer.py | stanford-futuredata/sketchstore | c209e4d01343a05dc5aecdb7a9801fc639019fd3 | [
"Apache-2.0"
] | 1 | 2020-07-31T20:04:59.000Z | 2020-07-31T20:04:59.000Z | python/tests/test_bias_optimizer.py | stanford-futuredata/sketchstore | c209e4d01343a05dc5aecdb7a9801fc639019fd3 | [
"Apache-2.0"
] | 1 | 2020-07-06T20:39:05.000Z | 2020-07-06T20:39:05.000Z | import unittest
import pandas as pd
import numpy as np
# import storyboard.bias_optimizer as bopt
import storyboard.bias_solver as bopt
class BiasOptimizerTest(unittest.TestCase):
def test_bias(self):
xs = [
np.array(pd.Series(np.random.zipf(a=1.1, size=30000)).value_counts())
for... | 27 | 81 | 0.641326 |
79785ed47bf27c2772d63ccb8ccca206e2b0b943 | 15,430 | py | Python | sigstore/_cli.py | trailofbits/pysign | ac11c48b010129a09afc30e6aea650df24f133a2 | [
"Apache-2.0"
] | 2 | 2022-01-19T04:27:18.000Z | 2022-02-25T01:53:55.000Z | sigstore/_cli.py | trailofbits/pysign | ac11c48b010129a09afc30e6aea650df24f133a2 | [
"Apache-2.0"
] | 4 | 2022-03-07T05:40:08.000Z | 2022-03-07T11:27:11.000Z | sigstore/_cli.py | trailofbits/pysign | ac11c48b010129a09afc30e6aea650df24f133a2 | [
"Apache-2.0"
] | 1 | 2022-02-25T01:53:57.000Z | 2022-02-25T01:53:57.000Z | # Copyright 2022 The Sigstore 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... | 33.25431 | 96 | 0.619119 |
79785f73dd5a23b1f1a554756391e30ce55c4128 | 2,907 | py | Python | torpy/cli/console.py | 0x20bf-org/tor | 3b1443826d12d4956afd08a3febce0ce0dd087ef | [
"Apache-2.0"
] | null | null | null | torpy/cli/console.py | 0x20bf-org/tor | 3b1443826d12d4956afd08a3febce0ce0dd087ef | [
"Apache-2.0"
] | null | null | null | torpy/cli/console.py | 0x20bf-org/tor | 3b1443826d12d4956afd08a3febce0ce0dd087ef | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 James Brown
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 29.969072 | 86 | 0.665291 |
79786028e97e9088f7ded7a3ac28b8b01e794a77 | 2,260 | py | Python | external_attention_block/SK-Net.py | Roypic/Attention_Code | 5b6cbfc36e49101567d19d65894641550917a66e | [
"MIT"
] | 3 | 2021-07-05T08:31:03.000Z | 2022-01-12T02:42:29.000Z | external_attention_block/SK-Net.py | Roypic/Attention_Code | 5b6cbfc36e49101567d19d65894641550917a66e | [
"MIT"
] | null | null | null | external_attention_block/SK-Net.py | Roypic/Attention_Code | 5b6cbfc36e49101567d19d65894641550917a66e | [
"MIT"
] | 2 | 2021-07-05T08:31:05.000Z | 2021-12-28T10:57:02.000Z | #code from https://zhuanlan.zhihu.com/p/379501097?utm_source=qq&utm_medium=social&utm_oi=1042802029118377984
import torch
import torch.nn as nn
class SKConv(nn.Module):
def __init__(self, features, M=2, G=32, r=16, stride=1, L=32):
""" Constructor
Args:
features: input channel dimensiona... | 39.649123 | 116 | 0.577434 |
7978615979f60207ff8d55514cd84eed7a6ebd37 | 3,273 | py | Python | dwio/nyu/counting/starsbars.py | danielwalt-io/nyu-python | be706940eb06d69dd331cf96d3327bbd5963d28b | [
"MIT"
] | null | null | null | dwio/nyu/counting/starsbars.py | danielwalt-io/nyu-python | be706940eb06d69dd331cf96d3327bbd5963d28b | [
"MIT"
] | null | null | null | dwio/nyu/counting/starsbars.py | danielwalt-io/nyu-python | be706940eb06d69dd331cf96d3327bbd5963d28b | [
"MIT"
] | null | null | null | import math
from dwio.nyu.counting import BinomialCoef
from dwio.nyu.counting import Partition
from dwio.nyu.counting import StirlingSecond
# Heavily guided by:
# https://www.careerbless.com/aptitude/qa/permutations_combinations_imp7.php
class StarsAndBars(object):
def __init__(self, objects=1, bins=1, distinc... | 39.914634 | 81 | 0.608616 |
7978620ece8a1d6261693d45edfe7bb412539a9e | 12,492 | py | Python | oadenv/lib/python2.7/site-packages/django/middleware/csrf.py | isabernardes/Archaeodatabase | 86090e8f840d5d202c15906e614d683f8a12d3bc | [
"MIT"
] | 7 | 2017-02-12T06:03:00.000Z | 2020-12-31T11:57:35.000Z | oadenv/lib/python2.7/site-packages/django/middleware/csrf.py | isabernardes/Archaeodatabase | 86090e8f840d5d202c15906e614d683f8a12d3bc | [
"MIT"
] | 10 | 2017-07-13T00:24:03.000Z | 2017-07-17T07:39:03.000Z | oadenv/lib/python2.7/site-packages/django/middleware/csrf.py | isabernardes/Archaeodatabase | 86090e8f840d5d202c15906e614d683f8a12d3bc | [
"MIT"
] | 7 | 2017-08-01T04:02:07.000Z | 2018-10-06T21:07:20.000Z | """
Cross Site Request Forgery Middleware.
This module provides a middleware that implements protection
against request forgeries from other sites.
"""
from __future__ import unicode_literals
import logging
import re
import string
from django.conf import settings
from django.urls import get_callable
from django.util... | 41.364238 | 95 | 0.636647 |
7978624b4f3c5df7da143aeed54109f6c6900ea7 | 6,723 | py | Python | doc/examples/edges/plot_skeleton.py | zhanwenchen/scikit-image | af8a78e5b12ebb5709a57f9350b4b1f4c8f0c7db | [
"BSD-3-Clause"
] | 3 | 2019-02-28T16:05:36.000Z | 2020-04-03T17:29:07.000Z | doc/examples/edges/plot_skeleton.py | zhanwenchen/scikit-image | af8a78e5b12ebb5709a57f9350b4b1f4c8f0c7db | [
"BSD-3-Clause"
] | 1 | 2019-02-12T23:58:34.000Z | 2019-02-13T04:13:30.000Z | doc/examples/edges/plot_skeleton.py | zhanwenchen/scikit-image | af8a78e5b12ebb5709a57f9350b4b1f4c8f0c7db | [
"BSD-3-Clause"
] | 3 | 2019-12-31T23:21:40.000Z | 2020-04-03T17:29:08.000Z | """
===========
Skeletonize
===========
Skeletonization reduces binary objects to 1 pixel wide representations. This
can be useful for feature extraction, and/or representing an object's topology.
``skeletonize`` works by making successive passes of the image. On each pass,
border pixels are identified and removed on... | 33.954545 | 83 | 0.715306 |
797862586fdf75b292ad53f86532860d3fa8f7d4 | 6,397 | py | Python | graph_objs/pointcloud/marker/_border.py | wwwidonja/changed_plotly | 1bda35a438539a97c84a3ab3952e95e8848467bd | [
"MIT"
] | null | null | null | graph_objs/pointcloud/marker/_border.py | wwwidonja/changed_plotly | 1bda35a438539a97c84a3ab3952e95e8848467bd | [
"MIT"
] | null | null | null | graph_objs/pointcloud/marker/_border.py | wwwidonja/changed_plotly | 1bda35a438539a97c84a3ab3952e95e8848467bd | [
"MIT"
] | null | null | null | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Border(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "pointcloud.marker"
_path_str = "pointcloud.marker.border"
_valid_props = {"arearatio", "colo... | 35.938202 | 82 | 0.562451 |
7978626e71975c3a600016a938041c2920dcb389 | 2,523 | py | Python | tests/rest/admin/test_username_available.py | dsonck92/synapse | 2560b1b6b2f74b5724253396c0e3665fa1f7968c | [
"Apache-2.0"
] | 9,945 | 2015-01-02T07:41:06.000Z | 2022-03-31T23:22:42.000Z | tests/rest/admin/test_username_available.py | t2bot/synapse | 62ca554ef09330cb88d46fca8296a859d0adc143 | [
"Apache-2.0"
] | 9,320 | 2015-01-08T14:09:03.000Z | 2022-03-31T21:11:24.000Z | tests/rest/admin/test_username_available.py | t2bot/synapse | 62ca554ef09330cb88d46fca8296a859d0adc143 | [
"Apache-2.0"
] | 2,299 | 2015-01-31T22:16:29.000Z | 2022-03-31T06:08:26.000Z | # Copyright 2021 The Matrix.org Foundation C.I.C.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 34.561644 | 90 | 0.668252 |
797863a0d469f349aee40cbdcab3e24dcaf03571 | 544 | py | Python | setup.py | developmentforpeople/estamosdepaso_site | 561e26b211ad7413e94ac76fc269b591d4eae666 | [
"MIT"
] | null | null | null | setup.py | developmentforpeople/estamosdepaso_site | 561e26b211ad7413e94ac76fc269b591d4eae666 | [
"MIT"
] | null | null | null | setup.py | developmentforpeople/estamosdepaso_site | 561e26b211ad7413e94ac76fc269b591d4eae666 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
with open('requirements.txt') as f:
install_requires = f.read().strip().split('\n')
# get version from __version__ variable in estamosdepaso_site/__init__.py
from estamosdepaso_site import __version__ as version
setup(
name='estamosdepaso_site',
... | 25.904762 | 73 | 0.78125 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.