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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f71f603e3e2b9119bf19c27949a553a350de4dbb | 3,576 | py | Python | nowcast/workers/ping_erddap.py | SalishSeaCast/SalishSeaNowcast | 947ba6fbb8952c7ae989a3aa96614b900748f55d | [
"Apache-2.0"
] | 4 | 2020-02-06T01:10:13.000Z | 2021-12-11T01:06:10.000Z | nowcast/workers/ping_erddap.py | SalishSeaCast/SalishSeaNowcast | 947ba6fbb8952c7ae989a3aa96614b900748f55d | [
"Apache-2.0"
] | 30 | 2020-02-03T23:54:10.000Z | 2022-03-18T18:50:31.000Z | nowcast/workers/ping_erddap.py | SalishSeaCast/SalishSeaNowcast | 947ba6fbb8952c7ae989a3aa96614b900748f55d | [
"Apache-2.0"
] | null | null | null | # Copyright 2013-2021 The Salish Sea MEOPAR contributors
# and The University 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
#
# https://www.apache.org/licenses/... | 33.420561 | 85 | 0.661074 |
import logging
from pathlib import Path
from nemo_nowcast import NowcastWorker
NAME = "ping_erddap"
logger = logging.getLogger(NAME)
def main():
worker = NowcastWorker(NAME, description=__doc__)
worker.init_cli()
worker.cli.add_argument(
"dataset",
choices={
"we... | true | true |
f71f61276a4576ec17d6d55cf5e8e0be9bdbeab7 | 918 | py | Python | FILE/file_merge.py | AceCoooool/python-example | 1d0068627210f08d31f027b6a333118d9f743956 | [
"MIT"
] | 2 | 2019-02-15T09:19:44.000Z | 2019-02-15T09:21:01.000Z | FILE/file_merge.py | AceCoooool/python-example | 1d0068627210f08d31f027b6a333118d9f743956 | [
"MIT"
] | null | null | null | FILE/file_merge.py | AceCoooool/python-example | 1d0068627210f08d31f027b6a333118d9f743956 | [
"MIT"
] | null | null | null | import os
import argparse
def file_merge(folder, out_file, ext):
files = [os.path.join(folder, file) for file in os.listdir(folder) if file.endswith(ext)]
with open(out_file, 'w') as f:
for file in files:
with open(file, 'r') as rf:
print('File {} readed.'.format(file))
... | 31.655172 | 93 | 0.61329 | import os
import argparse
def file_merge(folder, out_file, ext):
files = [os.path.join(folder, file) for file in os.listdir(folder) if file.endswith(ext)]
with open(out_file, 'w') as f:
for file in files:
with open(file, 'r') as rf:
print('File {} readed.'.format(file))
... | true | true |
f71f61bbd250bef9d676ace26f835628c544adaa | 2,169 | py | Python | api/generated/python/azure-iiot-opc-twin/models/value_write_request_api_model.py | jaz230/Industrial-IoT | bd4c5abfe579cbb7086a621e8381978e6c70a563 | [
"MIT"
] | 1 | 2020-01-22T12:03:08.000Z | 2020-01-22T12:03:08.000Z | api/generated/python/azure-iiot-opc-twin/models/value_write_request_api_model.py | likithadt/Industrial-IoT | d4ea7b330eff08455ca0556fed76aa74d2034da5 | [
"MIT"
] | null | null | null | api/generated/python/azure-iiot-opc-twin/models/value_write_request_api_model.py | likithadt/Industrial-IoT | d4ea7b330eff08455ca0556fed76aa74d2034da5 | [
"MIT"
] | null | null | null | # 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 2.3.33.0
# ... | 36.15 | 109 | 0.608575 |
from msrest.serialization import Model
class ValueWriteRequestApiModel(Model):
_validation = {
'value': {'required': True},
}
_attribute_map = {
'node_id': {'key': 'nodeId', 'type': 'str'},
'browse_path': {'key': 'browsePath', 'type': '[str]'},
'value': {'key':... | true | true |
f71f61e720b4ca7b2e7ace2c709ec4297289840e | 130,096 | py | Python | salt/states/pkg.py | waynegemmell/salt | 88056db3589cccab8956c2ae4f9b733acce89461 | [
"Apache-2.0"
] | 1 | 2020-09-10T07:38:20.000Z | 2020-09-10T07:38:20.000Z | salt/states/pkg.py | waynegemmell/salt | 88056db3589cccab8956c2ae4f9b733acce89461 | [
"Apache-2.0"
] | 4 | 2016-05-10T22:05:34.000Z | 2016-05-20T18:10:13.000Z | salt/states/pkg.py | waynegemmell/salt | 88056db3589cccab8956c2ae4f9b733acce89461 | [
"Apache-2.0"
] | 1 | 2020-12-02T01:20:28.000Z | 2020-12-02T01:20:28.000Z | """
Installation of packages using OS package managers such as yum or apt-get
=========================================================================
.. note::
On minions running systemd>=205, as of version 2015.8.12, 2016.3.3, and
2016.11.0, `systemd-run(1)`_ is now used to isolate commands which modify
... | 35.672059 | 116 | 0.563891 |
import fnmatch
import logging
import os
import re
import salt.utils.pkg
import salt.utils.platform
import salt.utils.versions
from salt.exceptions import CommandExecutionError, MinionError, SaltInvocationError
from salt.modules.pkg_resource import _repack_pkgs
from salt.output import nested
from salt.utils.functools... | true | true |
f71f6287f35f2c7ff53b83f6c0121a0e0b75c1ea | 13,549 | py | Python | chainer/training/extensions/variable_statistics_plot.py | seiyab/chainer | 39fffb9597a6e9646307fba27ad3233c65d38632 | [
"MIT"
] | null | null | null | chainer/training/extensions/variable_statistics_plot.py | seiyab/chainer | 39fffb9597a6e9646307fba27ad3233c65d38632 | [
"MIT"
] | null | null | null | chainer/training/extensions/variable_statistics_plot.py | seiyab/chainer | 39fffb9597a6e9646307fba27ad3233c65d38632 | [
"MIT"
] | null | null | null | from __future__ import division
import os
import warnings
import numpy
import six
import chainer
from chainer import backend
from chainer.backends import cuda
from chainer.training import extension
from chainer.training import trigger as trigger_module
from chainer.utils import argument
_available = None
def _try... | 36.817935 | 79 | 0.569489 | from __future__ import division
import os
import warnings
import numpy
import six
import chainer
from chainer import backend
from chainer.backends import cuda
from chainer.training import extension
from chainer.training import trigger as trigger_module
from chainer.utils import argument
_available = None
def _try... | true | true |
f71f62b04af3fdacd6538bdd099ff2935e8e0a14 | 2,893 | py | Python | tests/test_param_grid.py | MarcoJHB/ploomber | 4849ef6915572f7934392443b4faf138172b9596 | [
"Apache-2.0"
] | 2,141 | 2020-02-14T02:34:34.000Z | 2022-03-31T22:43:20.000Z | tests/test_param_grid.py | MarcoJHB/ploomber | 4849ef6915572f7934392443b4faf138172b9596 | [
"Apache-2.0"
] | 660 | 2020-02-06T16:15:57.000Z | 2022-03-31T22:55:01.000Z | tests/test_param_grid.py | MarcoJHB/ploomber | 4849ef6915572f7934392443b4faf138172b9596 | [
"Apache-2.0"
] | 122 | 2020-02-14T18:53:05.000Z | 2022-03-27T22:33:24.000Z | import datetime
from dateutil.relativedelta import relativedelta
import pytest
from ploomber.util import ParamGrid, Interval
def compare(a, b):
for element in a:
if element not in b:
return False
return len(a) == len(b)
def test_interval():
interval = Interval(datetime.date(year=2... | 19.15894 | 71 | 0.407881 | import datetime
from dateutil.relativedelta import relativedelta
import pytest
from ploomber.util import ParamGrid, Interval
def compare(a, b):
for element in a:
if element not in b:
return False
return len(a) == len(b)
def test_interval():
interval = Interval(datetime.date(year=2... | true | true |
f71f63419874a18aec03723ca69a1e11494c93fe | 27 | py | Python | btd6_memory_info/generated/NinjaKiwi/LiNK/Lobbies/LatencyMeasurements/StatsExtensions/stats_extensions.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/NinjaKiwi/LiNK/Lobbies/LatencyMeasurements/StatsExtensions/stats_extensions.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/NinjaKiwi/LiNK/Lobbies/LatencyMeasurements/StatsExtensions/stats_extensions.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | class StatsExtensions: pass | 27 | 27 | 0.888889 | class StatsExtensions: pass | true | true |
f71f638a703961e5577fb4b19745f2c50b5b4f2c | 478 | py | Python | Django/SOC2/MyChat/chat/routing.py | JanStoltman/100DaysOfCode | 1d18b76ed1e3e942e8392006a5d4bfb41484d047 | [
"MIT"
] | null | null | null | Django/SOC2/MyChat/chat/routing.py | JanStoltman/100DaysOfCode | 1d18b76ed1e3e942e8392006a5d4bfb41484d047 | [
"MIT"
] | null | null | null | Django/SOC2/MyChat/chat/routing.py | JanStoltman/100DaysOfCode | 1d18b76ed1e3e942e8392006a5d4bfb41484d047 | [
"MIT"
] | null | null | null | from channels import route
from .consumers import ws_connect, ws_receive, ws_disconnect, chat_join, chat_leave, chat_send
websocket_routing = [
route("websocket.connect", ws_connect),
route("websocket.receive", ws_receive),
route("websocket.disconnect", ws_disconnect),
]
custom_routing = [
route("ch... | 29.875 | 94 | 0.717573 | from channels import route
from .consumers import ws_connect, ws_receive, ws_disconnect, chat_join, chat_leave, chat_send
websocket_routing = [
route("websocket.connect", ws_connect),
route("websocket.receive", ws_receive),
route("websocket.disconnect", ws_disconnect),
]
custom_routing = [
route("ch... | true | true |
f71f65dc650c5a613143b036baee3ed96b5449c9 | 5,089 | py | Python | jinahub/encoders/audio/VGGISHAudioEncoder/vggish_audio_encoder.py | Gikiman/executors | 98658b4136859164390cfccbde8cf0f7cf843593 | [
"Apache-2.0"
] | null | null | null | jinahub/encoders/audio/VGGISHAudioEncoder/vggish_audio_encoder.py | Gikiman/executors | 98658b4136859164390cfccbde8cf0f7cf843593 | [
"Apache-2.0"
] | null | null | null | jinahub/encoders/audio/VGGISHAudioEncoder/vggish_audio_encoder.py | Gikiman/executors | 98658b4136859164390cfccbde8cf0f7cf843593 | [
"Apache-2.0"
] | null | null | null | __copyright__ = "Copyright (c) 2021 Jina AI Limited. All rights reserved."
__license__ = "Apache-2.0"
import os
from pathlib import Path
from typing import Any, Optional, List, Iterable
from jina import Executor, requests, DocumentArray
from jina.logging.logger import JinaLogger
import requests as _requests
import te... | 41.373984 | 112 | 0.659658 | __copyright__ = "Copyright (c) 2021 Jina AI Limited. All rights reserved."
__license__ = "Apache-2.0"
import os
from pathlib import Path
from typing import Any, Optional, List, Iterable
from jina import Executor, requests, DocumentArray
from jina.logging.logger import JinaLogger
import requests as _requests
import te... | true | true |
f71f66195317baeeed07698a274b4377fafe07c5 | 1,436 | py | Python | alipay/aop/api/domain/AlipayOpenPublicSinglearticleDataBatchqueryModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayOpenPublicSinglearticleDataBatchqueryModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayOpenPublicSinglearticleDataBatchqueryModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
class AlipayOpenPublicSinglearticleDataBatchqueryModel(object):
def __init__(self):
self._begin_date = None
self._end_date = None
@property
def begin_date(self):
... | 25.642857 | 71 | 0.601671 |
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
class AlipayOpenPublicSinglearticleDataBatchqueryModel(object):
def __init__(self):
self._begin_date = None
self._end_date = None
@property
def begin_date(self):
return self._begin_date
@begin_... | true | true |
f71f668d6fbe52a3a43d82cbb88b941356fc85b3 | 2,366 | py | Python | actstream/runtests/manage.py | inspiration4hunter/django-actstream | 7d655b3bf239c85a6ac804ff72e748214b81bb8e | [
"BSD-3-Clause"
] | 1 | 2019-06-27T13:04:59.000Z | 2019-06-27T13:04:59.000Z | actstream/runtests/manage.py | techdragon/django-activity-stream | d5b18470c8682cec3e3db4cfaf8920c3dd33f6bb | [
"BSD-3-Clause"
] | null | null | null | actstream/runtests/manage.py | techdragon/django-activity-stream | d5b18470c8682cec3e3db4cfaf8920c3dd33f6bb | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# http://ericholscher.com/blog/2009/jun/29/enable-setuppy-test-your-django-apps/
# http://www.travisswicegood.com/2010/01/17/django-virtualenv-pip-and-fabric/
# http://code.djangoproject.com/svn/django/trunk/tests/runtests.py
# https://github.com/tomchristie/django-rest-framework/blob/master/rest... | 30.333333 | 102 | 0.703719 |
import os
import sys
import warnings
warnings.filterwarnings("ignore")
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "../..")))
os.environ['DJANGO_SETTINGS_MODULE'] = 'actstream.runtests.settings'
engine = os.environ.get('DATABASE_ENGINE', 'django.db.backends.sqlite3')
if engine.... | true | true |
f71f669e87f2e8ea5e0d8ed4ce44947d705ba9d6 | 572 | py | Python | Python/Factorization Of Numbers/PairFactorization.py | DeWill404/Data-Structure-and-Algorithm | c61d245c920edff747e87dc7c2ea139561766a3a | [
"MIT"
] | null | null | null | Python/Factorization Of Numbers/PairFactorization.py | DeWill404/Data-Structure-and-Algorithm | c61d245c920edff747e87dc7c2ea139561766a3a | [
"MIT"
] | null | null | null | Python/Factorization Of Numbers/PairFactorization.py | DeWill404/Data-Structure-and-Algorithm | c61d245c920edff747e87dc7c2ea139561766a3a | [
"MIT"
] | null | null | null | # function to generate list of factors
def get_factorList(n):
# Insert 1 & n in list, if is n == 1 then only add 1
l = list(set([1,n]))
# Iterate to sq.rt. of n to get all factors
for i in range(2, int(n**0.5)+1):
if n%i == 0:
# If i & n/i aree same, then append only one
if i == n//i:
l.append(i)
# ... | 22.88 | 53 | 0.624126 |
def get_factorList(n):
l = list(set([1,n]))
for i in range(2, int(n**0.5)+1):
if n%i == 0:
if i == n//i:
l.append(i)
else:
l.extend([i,n//i])
return l
if __name__ == "__main__":
list_of_numbers = [23, 46, 65, 34234, 423, 43212]
# Get factor list of given no.
for num in list_of_... | true | true |
f71f684248dd8ea778131509570d6005305ece61 | 3,684 | py | Python | uwb_channel.py | iguarna/uwb-ieee | 782813b8a6fc9effeb076c47cd5d497b6e62b330 | [
"MIT"
] | null | null | null | uwb_channel.py | iguarna/uwb-ieee | 782813b8a6fc9effeb076c47cd5d497b6e62b330 | [
"MIT"
] | null | null | null | uwb_channel.py | iguarna/uwb-ieee | 782813b8a6fc9effeb076c47cd5d497b6e62b330 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
def gen_channel(parameters, fc=5E9, fs=2E9, dynamic_range=30):
# Calculate samples/nanosec ratio
nanosec_to_samples = int(1E-9 * fs)
#####################################
# Unpack parameters and convert units
cluster_rate = parameters['cluster_r... | 28.55814 | 109 | 0.59392 | import numpy as np
import matplotlib.pyplot as plt
def gen_channel(parameters, fc=5E9, fs=2E9, dynamic_range=30):
nanosec_to_samples = int(1E-9 * fs)
er = np.exp(-t / cluster_decay) * np.random.lognormal(mean=0, sigma=std_cluster_shadowing)
while tau < max_tau:
mean_po... | true | true |
f71f689447e4c38f173ed630b270c2889bd40d14 | 3,032 | py | Python | tottle/exception_factory/error_handler/error_handler.py | muffleo/tottle | 69a5bdda879ab56d43505d517d3369a687c135a2 | [
"MIT"
] | 12 | 2020-09-06T15:31:34.000Z | 2021-02-27T20:30:34.000Z | tottle/exception_factory/error_handler/error_handler.py | cyanlabs-org/tottle | 6cf02022ed7b445c9b5af475c6e854b91780d792 | [
"MIT"
] | 2 | 2021-04-13T06:43:42.000Z | 2021-07-07T20:52:39.000Z | tottle/exception_factory/error_handler/error_handler.py | cyanlabs-org/tottle | 6cf02022ed7b445c9b5af475c6e854b91780d792 | [
"MIT"
] | 4 | 2020-09-12T03:09:25.000Z | 2021-03-22T08:52:04.000Z | import traceback
import typing
from tottle.exception_factory.error_handler.abc import ABCErrorHandler, ExceptionHandler
from tottle.modules import logger
class ErrorHandler(ABCErrorHandler):
def __init__(self, redirect_arguments: bool = False):
self.error_handlers: typing.Dict[str, ExceptionHandler] = {}... | 34.067416 | 88 | 0.636544 | import traceback
import typing
from tottle.exception_factory.error_handler.abc import ABCErrorHandler, ExceptionHandler
from tottle.modules import logger
class ErrorHandler(ABCErrorHandler):
def __init__(self, redirect_arguments: bool = False):
self.error_handlers: typing.Dict[str, ExceptionHandler] = {}... | true | true |
f71f68f22277399de37d076c657cde17a277ddbd | 70,087 | py | Python | androguard/core/analysis/analysis.py | appknox/old-androguard | 8b2fbc262f10f99016f4bbaaac51a963abdb90e4 | [
"Apache-2.0"
] | null | null | null | androguard/core/analysis/analysis.py | appknox/old-androguard | 8b2fbc262f10f99016f4bbaaac51a963abdb90e4 | [
"Apache-2.0"
] | null | null | null | androguard/core/analysis/analysis.py | appknox/old-androguard | 8b2fbc262f10f99016f4bbaaac51a963abdb90e4 | [
"Apache-2.0"
] | null | null | null | # This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# 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... | 32.462714 | 169 | 0.551957 |
import re
import collections
from androguard.core.analysis.sign import Signature, TAINTED_PACKAGE_CREATE, \
TAINTED_PACKAGE_CALL
from androguard.core.androconf import debug, is_ascii_problem,\
load_api_specific_resource_module
from androguard.core.bytecodes import dvm
DVM_FIELDS_ACCESS = {
... | true | true |
f71f68f60efce427cc864118cc7e00210f6bd3bb | 302 | py | Python | python3/recent_counter.py | joshiaj7/CodingChallenges | f95dd79132f07c296e074d675819031912f6a943 | [
"MIT"
] | 1 | 2020-10-08T09:17:40.000Z | 2020-10-08T09:17:40.000Z | python3/recent_counter.py | joshiaj7/CodingChallenges | f95dd79132f07c296e074d675819031912f6a943 | [
"MIT"
] | null | null | null | python3/recent_counter.py | joshiaj7/CodingChallenges | f95dd79132f07c296e074d675819031912f6a943 | [
"MIT"
] | null | null | null | """
space : O(n)
time : O(n)
"""
class RecentCounter:
def __init__(self):
self.history = []
def ping(self, t: int) -> int:
self.history.append(t)
s = t - 3000
while self.history[0] < s:
self.history.pop(0)
return len(self.history)
| 15.1 | 34 | 0.503311 |
class RecentCounter:
def __init__(self):
self.history = []
def ping(self, t: int) -> int:
self.history.append(t)
s = t - 3000
while self.history[0] < s:
self.history.pop(0)
return len(self.history)
| true | true |
f71f694ec80a3bd4c8eb0b4d9cd3f8f8a53b92c1 | 8,293 | py | Python | knack/invocation.py | derekbekoe/knack | 07ce4c3ae51ef22e6364ed93c5980cae7688e347 | [
"MIT"
] | 1 | 2019-02-10T01:38:05.000Z | 2019-02-10T01:38:05.000Z | knack/invocation.py | derekbekoe/knack | 07ce4c3ae51ef22e6364ed93c5980cae7688e347 | [
"MIT"
] | null | null | null | knack/invocation.py | derekbekoe/knack | 07ce4c3ae51ef22e6364ed93c5980cae7688e347 | [
"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.
# --------------------------------------------------------------------... | 41.673367 | 119 | 0.636079 |
from __future__ import print_function
import sys
from collections import defaultdict
from .deprecation import ImplicitDeprecated, resolve_deprecate_info
from .util import CLIError, CtxTypeError, CommandResultItem, todict
from .parser import CLICommandParser
from .commands import CLICommandsLoader
from .events i... | true | true |
f71f6972720d1f87a308457a99c2da6ef6fe19d9 | 63,620 | py | Python | LeetCode/contest-2018-11-26/fair_candy_swap.py | Max-PJB/python-learning2 | e8b05bef1574ee9abf8c90497e94ef20a7f4e3bd | [
"MIT"
] | null | null | null | LeetCode/contest-2018-11-26/fair_candy_swap.py | Max-PJB/python-learning2 | e8b05bef1574ee9abf8c90497e94ef20a7f4e3bd | [
"MIT"
] | null | null | null | LeetCode/contest-2018-11-26/fair_candy_swap.py | Max-PJB/python-learning2 | e8b05bef1574ee9abf8c90497e94ef20a7f4e3bd | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
-------------------------------------------------
@ Author : pengj
@ date : 2018/11/26 19:28
@ IDE : PyCharm
@ GitHub : https://github.com/JackyPJB
@ Contact : pengjianbiao@hotmail.com
---------------... | 104.638158 | 120 | 0.623546 |
import time
__author__ = 'Max_Pengjb'
start = time.time()
class Solution(object):
def fairCandySwap(self, A, B):
k = (sum(A) - sum(B)) // 2
b = dict(zip(B, [1 for _ in B]))
for i in A:
if i - k in b.keys():
return [i, i - k]
A = [1, 2, 5]
B = [2, 4]
a1 = [... | true | true |
f71f6977583be15f02e5a3484137a80e4aecac84 | 926 | py | Python | supervised_learning/0x03-optimization/12-learning_rate_decay.py | cbarros7/holbertonschool-machine_learning | 1edb4c253441f6319b86c9c590d1e7dd3fc32bf4 | [
"MIT"
] | 1 | 2022-03-09T19:12:22.000Z | 2022-03-09T19:12:22.000Z | supervised_learning/0x03-optimization/12-learning_rate_decay.py | cbarros7/holbertonschool-machine_learning | 1edb4c253441f6319b86c9c590d1e7dd3fc32bf4 | [
"MIT"
] | null | null | null | supervised_learning/0x03-optimization/12-learning_rate_decay.py | cbarros7/holbertonschool-machine_learning | 1edb4c253441f6319b86c9c590d1e7dd3fc32bf4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""Learning Rate Decay Upgraded"""
import tensorflow as tf
def learning_rate_decay(alpha, decay_rate, global_step, decay_step):
"""learning_rate_decay: creates a learning rate decay operation in
tensorflow using inverse time decay:
Args:
alpha: is th... | 37.04 | 77 | 0.671706 |
import tensorflow as tf
def learning_rate_decay(alpha, decay_rate, global_step, decay_step):
return tf.train.inverse_time_decay(
learning_rate=alpha, global_step=global_step, decay_steps=decay_step,
decay_rate=decay_rate, staircase=True, name=None
)
| true | true |
f71f6a82759cb768681d3430b292afb226aeca63 | 11,152 | py | Python | analyses/weat.py | raphaottoni/youtube-hatespeech | 4467d065c2bddd86feec673ad74670c4c975f017 | [
"MIT"
] | null | null | null | analyses/weat.py | raphaottoni/youtube-hatespeech | 4467d065c2bddd86feec673ad74670c4c975f017 | [
"MIT"
] | 1 | 2018-08-09T14:13:16.000Z | 2018-08-09T15:34:00.000Z | analyses/weat.py | raphaottoni/youtube-hatespeech | 4467d065c2bddd86feec673ad74670c4c975f017 | [
"MIT"
] | null | null | null | from gensim import corpora, models, similarities
import json
import numpy
import random
import csv
import itertools
import gensim, copy
from collections import defaultdict
import glob, os
target_words = {}
attribute_words= {}
weats_name = []
# 1 WEAT Immigrants
target_words["1_a"] = ["immigrant", "migrant"]
target_wo... | 43.733333 | 148 | 0.598816 | from gensim import corpora, models, similarities
import json
import numpy
import random
import csv
import itertools
import gensim, copy
from collections import defaultdict
import glob, os
target_words = {}
attribute_words= {}
weats_name = []
target_words["1_a"] = ["immigrant", "migrant"]
target_words["1_b"] = ["citi... | true | true |
f71f6c8fd9d986ab03b10daa79ec6a243a174abe | 1,152 | py | Python | cgi-bin/utils.py | alexander1389/IMS.WebAPI | cfc8c6c899655c337973f9a32a620e9cd6af34b9 | [
"MIT"
] | null | null | null | cgi-bin/utils.py | alexander1389/IMS.WebAPI | cfc8c6c899655c337973f9a32a620e9cd6af34b9 | [
"MIT"
] | null | null | null | cgi-bin/utils.py | alexander1389/IMS.WebAPI | cfc8c6c899655c337973f9a32a620e9cd6af34b9 | [
"MIT"
] | null | null | null | from datetime import datetime
def validate_dt(date):
""" Validate datetime string
:param date: The datetime string
:type date: str
:returns: True if the date is correct datetime string,
False otherwise
:rtype: bool
"""
pattern = '000101000000'
# letters in date
if... | 22.588235 | 69 | 0.539063 | from datetime import datetime
def validate_dt(date):
pattern = '000101000000'
if not date.isdecimal():
return False
if len(date) < 2 or len(date) > 12:
return False
if len(date) % 2 > 0:
return False
chk = date + pattern[len(date):]
try:
datetime.... | true | true |
f71f6cf1e351242fc9e0d3e8fd6d87cf389216c6 | 383 | py | Python | mitre_attack/data/types/group.py | check-spelling/mitre-attack | f3be1ccff235593c4277f3b9ec2696757924894b | [
"MIT"
] | 1 | 2022-01-13T06:32:10.000Z | 2022-01-13T06:32:10.000Z | mitre_attack/data/types/group.py | check-spelling/mitre-attack | f3be1ccff235593c4277f3b9ec2696757924894b | [
"MIT"
] | null | null | null | mitre_attack/data/types/group.py | check-spelling/mitre-attack | f3be1ccff235593c4277f3b9ec2696757924894b | [
"MIT"
] | 1 | 2022-01-14T00:00:24.000Z | 2022-01-14T00:00:24.000Z | from dataclasses import dataclass, field
from typing import List
from mitre_attack import INTRUSION_SET
from mitre_attack.data.types.object import Object
@dataclass(frozen=True)
class Group(Object):
type: str = field(default=INTRUSION_SET, init=False)
name: str
aliases: List[str] = field(default_factory=l... | 29.461538 | 57 | 0.775457 | from dataclasses import dataclass, field
from typing import List
from mitre_attack import INTRUSION_SET
from mitre_attack.data.types.object import Object
@dataclass(frozen=True)
class Group(Object):
type: str = field(default=INTRUSION_SET, init=False)
name: str
aliases: List[str] = field(default_factory=l... | true | true |
f71f6d3f9666a930b13bac187344c124d81e2c1e | 31,993 | py | Python | electrum/gui/kivy/uix/dialogs/lightning_channels.py | jacky4566/electrum | f1c2191392780a559ecdc374c81c82191a5d1eb5 | [
"MIT"
] | null | null | null | electrum/gui/kivy/uix/dialogs/lightning_channels.py | jacky4566/electrum | f1c2191392780a559ecdc374c81c82191a5d1eb5 | [
"MIT"
] | null | null | null | electrum/gui/kivy/uix/dialogs/lightning_channels.py | jacky4566/electrum | f1c2191392780a559ecdc374c81c82191a5d1eb5 | [
"MIT"
] | null | null | null | import asyncio
from typing import TYPE_CHECKING, Optional, Union
from kivy.lang import Builder
from kivy.factory import Factory
from kivy.uix.popup import Popup
from .fee_dialog import FeeDialog
from electrum.util import bh2u
from electrum.logging import Logger
from electrum.lnutil import LOCAL, REMOTE, format_short_... | 37.772137 | 170 | 0.568218 | import asyncio
from typing import TYPE_CHECKING, Optional, Union
from kivy.lang import Builder
from kivy.factory import Factory
from kivy.uix.popup import Popup
from .fee_dialog import FeeDialog
from electrum.util import bh2u
from electrum.logging import Logger
from electrum.lnutil import LOCAL, REMOTE, format_short_... | true | true |
f71f6d9f3398355ffe923f131ddebd4aceaed71f | 8,876 | py | Python | tests/conftest.py | forestriveral/floris | 02c31e121283ad6ccae987cfa3aa1bf1e4b43014 | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | forestriveral/floris | 02c31e121283ad6ccae987cfa3aa1bf1e4b43014 | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | forestriveral/floris | 02c31e121283ad6ccae987cfa3aa1bf1e4b43014 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 NREL
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distri... | 32.512821 | 82 | 0.305994 |
import pytest
def turbines_to_array(turbine_list: list):
return [[t.Ct, t.power, t.aI, t.average_velocity] for t in turbine_list]
def print_test_values(turbine_list: list):
for t in turbine_list:
print(
"({:.7f}, {:.7f}, {:.7f}, {:.7f}),".format(
t.Ct, t.po... | true | true |
f71f6e1acacc2c48f4a28b2d425b5fac6cb232dd | 113,230 | py | Python | tests/test_class.py | michelp/cxxheaderparser | 83bb2903790cf448bf838cdb8a93ca96e758bd1a | [
"BSD-3-Clause"
] | 12 | 2020-12-28T09:40:53.000Z | 2022-03-13T15:36:21.000Z | tests/test_class.py | michelp/cxxheaderparser | 83bb2903790cf448bf838cdb8a93ca96e758bd1a | [
"BSD-3-Clause"
] | 28 | 2021-01-04T14:58:59.000Z | 2022-01-03T03:00:16.000Z | tests/test_class.py | michelp/cxxheaderparser | 83bb2903790cf448bf838cdb8a93ca96e758bd1a | [
"BSD-3-Clause"
] | 1 | 2021-11-06T03:44:53.000Z | 2021-11-06T03:44:53.000Z | # Note: testcases generated via `python -m cxxheaderparser.gentest`
from cxxheaderparser.types import (
AnonymousName,
Array,
BaseClass,
ClassDecl,
EnumDecl,
Enumerator,
Field,
ForwardDecl,
Function,
FundamentalSpecifier,
Method,
MoveReference,
NameSpecifier,
Ope... | 38.240459 | 94 | 0.2641 |
from cxxheaderparser.types import (
AnonymousName,
Array,
BaseClass,
ClassDecl,
EnumDecl,
Enumerator,
Field,
ForwardDecl,
Function,
FundamentalSpecifier,
Method,
MoveReference,
NameSpecifier,
Operator,
PQName,
Parameter,
Pointer,
Reference,
T... | true | true |
f71f6e862b3a393d8f1a1757bbce7092bfb70ae4 | 33,635 | py | Python | demisto_sdk/commands/common/tests/pack_unique_files_test.py | guiguitodelperuu/demisto-sdk | 3eb0206593bc955a64c6594d717c04e52e254e1d | [
"MIT"
] | null | null | null | demisto_sdk/commands/common/tests/pack_unique_files_test.py | guiguitodelperuu/demisto-sdk | 3eb0206593bc955a64c6594d717c04e52e254e1d | [
"MIT"
] | null | null | null | demisto_sdk/commands/common/tests/pack_unique_files_test.py | guiguitodelperuu/demisto-sdk | 3eb0206593bc955a64c6594d717c04e52e254e1d | [
"MIT"
] | null | null | null | import json
import os
import click
import pytest
import requests_mock
from click.testing import CliRunner
from git import GitCommandError
from demisto_sdk.__main__ import main
from demisto_sdk.commands.common import tools
from demisto_sdk.commands.common.constants import (PACK_METADATA_DESC,
... | 43.456072 | 150 | 0.648759 | import json
import os
import click
import pytest
import requests_mock
from click.testing import CliRunner
from git import GitCommandError
from demisto_sdk.__main__ import main
from demisto_sdk.commands.common import tools
from demisto_sdk.commands.common.constants import (PACK_METADATA_DESC,
... | true | true |
f71f6ee079b895d1562283af73f4c7cb38b99b68 | 371 | py | Python | src/example02/main.py | luisibanez/cssi-appengine-introduction-01 | 617c27147f8ba91bdecc7b774ccd2d3204607514 | [
"Apache-2.0"
] | null | null | null | src/example02/main.py | luisibanez/cssi-appengine-introduction-01 | 617c27147f8ba91bdecc7b774ccd2d3204607514 | [
"Apache-2.0"
] | null | null | null | src/example02/main.py | luisibanez/cssi-appengine-introduction-01 | 617c27147f8ba91bdecc7b774ccd2d3204607514 | [
"Apache-2.0"
] | null | null | null | import webapp2
class MainHandler(webapp2.RequestHandler):
def get(self):
self.response.write('Hello world!')
class CountHandler(webapp2.RequestHandler):
def get(self):
for i in range(1, 21):
self.response.write('Hello %d <br>' % i)
app = webapp2.WSGIApplication([
('/', MainHan... | 23.1875 | 52 | 0.638814 | import webapp2
class MainHandler(webapp2.RequestHandler):
def get(self):
self.response.write('Hello world!')
class CountHandler(webapp2.RequestHandler):
def get(self):
for i in range(1, 21):
self.response.write('Hello %d <br>' % i)
app = webapp2.WSGIApplication([
('/', MainHan... | true | true |
f71f6f31a5c782d44a541c5b9d96b9cf0320881f | 2,317 | py | Python | tests/test_json.py | pestun/strace-parser | 8bcddb1670c891785c1fa798b948e9637462c474 | [
"MIT"
] | 6 | 2020-02-03T10:29:59.000Z | 2022-03-07T13:24:26.000Z | tests/test_json.py | pestun/strace-parser | 8bcddb1670c891785c1fa798b948e9637462c474 | [
"MIT"
] | 2 | 2020-11-23T03:04:00.000Z | 2021-09-25T00:39:00.000Z | tests/test_json.py | pestun/strace-parser | 8bcddb1670c891785c1fa798b948e9637462c474 | [
"MIT"
] | 2 | 2020-04-23T03:25:04.000Z | 2021-10-21T23:07:21.000Z | from importlib.resources import read_text
import pytest
from lark import Token, Tree
from strace_parser.json_transformer import to_json
from strace_parser.parser import get_parser
from . import data
def assert_fully_serialized(obj):
def _assert_fully_serialized(obj):
assert not isinstance(obj, Tree), o... | 30.893333 | 79 | 0.518774 | from importlib.resources import read_text
import pytest
from lark import Token, Tree
from strace_parser.json_transformer import to_json
from strace_parser.parser import get_parser
from . import data
def assert_fully_serialized(obj):
def _assert_fully_serialized(obj):
assert not isinstance(obj, Tree), o... | true | true |
f71f6f77797715e2642a7242a6f13d06b57a1ac6 | 6,833 | py | Python | loops/__init__.py | fenhl/python-loops | ea36e3b1ad68c2257071724a1f760b0e352bb29c | [
"MIT"
] | null | null | null | loops/__init__.py | fenhl/python-loops | ea36e3b1ad68c2257071724a1f760b0e352bb29c | [
"MIT"
] | null | null | null | loops/__init__.py | fenhl/python-loops | ea36e3b1ad68c2257071724a1f760b0e352bb29c | [
"MIT"
] | null | null | null | import datetime
import threading
import time
try:
from loops.version import __version__
except ImportError:
__version__ = None
class IterThread(threading.Thread):
"""Helper class used in loops."""
def __init__(self, iterator):
super().__init__()
self.daemon = True
self.iterator... | 46.80137 | 412 | 0.658861 | import datetime
import threading
import time
try:
from loops.version import __version__
except ImportError:
__version__ = None
class IterThread(threading.Thread):
def __init__(self, iterator):
super().__init__()
self.daemon = True
self.iterator = iterator
self.stopped = Fal... | true | true |
f71f6ffc94e95da06954304971002720ccddd90b | 537 | py | Python | plugins/yt.py | ctburley/akesho-irc3 | 7d27a45f401ffcfa3a380c7de01687cbe69b874d | [
"MIT"
] | 3 | 2018-06-03T11:55:28.000Z | 2020-01-03T02:33:22.000Z | plugins/yt.py | ctburley/akesho-irc3 | 7d27a45f401ffcfa3a380c7de01687cbe69b874d | [
"MIT"
] | 14 | 2018-05-07T13:33:21.000Z | 2021-04-30T20:46:54.000Z | plugins/yt.py | ctburley/akesho-irc3 | 7d27a45f401ffcfa3a380c7de01687cbe69b874d | [
"MIT"
] | 1 | 2018-06-04T04:45:58.000Z | 2018-06-04T04:45:58.000Z | import irc3
from irc3.plugins.command import command
@irc3.plugin
class Plugin:
def __init__(self, bot):
self.bot = bot
print("yt loaded")
@irc3.event('^(@(?P<tags>\S+) )?:(?P<nick>\S+)(?P<mask>!\S+@\S+) PRIVMSG (?P<channel>\S+) :\.yt\s+(?P<target>.*?)$')
def yt(self, nick=None, mask=None, channel=None,... | 35.8 | 122 | 0.621974 | import irc3
from irc3.plugins.command import command
@irc3.plugin
class Plugin:
def __init__(self, bot):
self.bot = bot
print("yt loaded")
@irc3.event('^(@(?P<tags>\S+) )?:(?P<nick>\S+)(?P<mask>!\S+@\S+) PRIVMSG (?P<channel>\S+) :\.yt\s+(?P<target>.*?)$')
def yt(self, nick=None, mask=None, channel=None,... | true | true |
f71f70018ea2bb974a7995e741772da0a860e199 | 11,666 | py | Python | mesh_voxel_color/color_pil_cupy.py | naysok/Mesh_Voxel_Color | 9ca3549822ada1be67efcb3e47cf4c193d54cbaa | [
"MIT"
] | null | null | null | mesh_voxel_color/color_pil_cupy.py | naysok/Mesh_Voxel_Color | 9ca3549822ada1be67efcb3e47cf4c193d54cbaa | [
"MIT"
] | null | null | null | mesh_voxel_color/color_pil_cupy.py | naysok/Mesh_Voxel_Color | 9ca3549822ada1be67efcb3e47cf4c193d54cbaa | [
"MIT"
] | null | null | null | import sys
sys.path.append("C:\\Users\\ysoky\\Documents\\Mesh_Voxel_Color\\_module_\\Mesh_Contour")
import math
import cupy as cp
import random
from PIL import Image, ImageDraw, ImageOps, ImageEnhance
from mesh_contour import stl_parser
sp = stl_parser.StlParser()
from .import util
ut = util.Util()... | 27.193473 | 109 | 0.407252 | import sys
sys.path.append("C:\\Users\\ysoky\\Documents\\Mesh_Voxel_Color\\_module_\\Mesh_Contour")
import math
import cupy as cp
import random
from PIL import Image, ImageDraw, ImageOps, ImageEnhance
from mesh_contour import stl_parser
sp = stl_parser.StlParser()
from .import util
ut = util.Util()... | true | true |
f71f7031c4f8fd46d4b8fe54a23ba04cced48350 | 644 | py | Python | coronavirus/json_update.py | StevenHuang2020/WebSpider | 40ab36416e061da3eb98a3174f18f50260b2e2d3 | [
"MIT"
] | null | null | null | coronavirus/json_update.py | StevenHuang2020/WebSpider | 40ab36416e061da3eb98a3174f18f50260b2e2d3 | [
"MIT"
] | null | null | null | coronavirus/json_update.py | StevenHuang2020/WebSpider | 40ab36416e061da3eb98a3174f18f50260b2e2d3 | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
# Date: 27/Apr/2020
# Author: Steven Huang, Auckland, NZ
# License: MIT License
"""
Description: Update json file
"""
import json
import datetime
def write_file(file, content):
with open(file, 'w', newline='\n', encoding='utf-8') as f:
f.write(content)
def get_datetime():
... | 23 | 89 | 0.641304 |
import json
import datetime
def write_file(file, content):
with open(file, 'w', newline='\n', encoding='utf-8') as f:
f.write(content)
def get_datetime():
daytime = datetime.datetime.now()
return str(daytime.strftime("%Y-%m-%d %H:%M:%S"))
def update_json(file=r'update.json'):
info = {... | true | true |
f71f706d2b3fdf3882c5261d9237067d22214993 | 694 | py | Python | src/decisionengine_modules/glideinwms/tests/test_UniversalFrontendParams.py | BrunoCoimbra/decisionengine_modules | bfd14644eb2e16b72b75fdcc3ebe8ad1323b904f | [
"Apache-2.0"
] | null | null | null | src/decisionengine_modules/glideinwms/tests/test_UniversalFrontendParams.py | BrunoCoimbra/decisionengine_modules | bfd14644eb2e16b72b75fdcc3ebe8ad1323b904f | [
"Apache-2.0"
] | null | null | null | src/decisionengine_modules/glideinwms/tests/test_UniversalFrontendParams.py | BrunoCoimbra/decisionengine_modules | bfd14644eb2e16b72b75fdcc3ebe8ad1323b904f | [
"Apache-2.0"
] | null | null | null | from decisionengine_modules.glideinwms.tests.fixtures import ( # noqa: F401
gwms_module_config,
gwms_module_invalid_config,
gwms_src_dir,
)
from decisionengine_modules.glideinwms.UniversalFrontendParams import UniversalFrontendParams
def test_instantiation(gwms_src_dir, gwms_module_config): # noqa: F811... | 36.526316 | 93 | 0.792507 | from decisionengine_modules.glideinwms.tests.fixtures import (
gwms_module_config,
gwms_module_invalid_config,
gwms_src_dir,
)
from decisionengine_modules.glideinwms.UniversalFrontendParams import UniversalFrontendParams
def test_instantiation(gwms_src_dir, gwms_module_config):
params = UniversalF... | true | true |
f71f73422050b5b292bd93215895e5ecf77f8aa9 | 4,482 | py | Python | app/run.py | imisi-akande/disaster-response-pipeline | d691e643c57e45b226ca3cb2c0b4a708c7edfe8b | [
"MIT"
] | null | null | null | app/run.py | imisi-akande/disaster-response-pipeline | d691e643c57e45b226ca3cb2c0b4a708c7edfe8b | [
"MIT"
] | null | null | null | app/run.py | imisi-akande/disaster-response-pipeline | d691e643c57e45b226ca3cb2c0b4a708c7edfe8b | [
"MIT"
] | null | null | null | import json
import plotly
import pandas as pd
import nltk
from nltk.stem import WordNetLemmatizer
from nltk.tokenize import word_tokenize, sent_tokenize
from nltk import pos_tag, word_tokenize
from nltk.stem import WordNetLemmatizer
from nltk.tokenize import word_tokenize
from flask import Flask
from flask import rend... | 28.367089 | 77 | 0.56805 | import json
import plotly
import pandas as pd
import nltk
from nltk.stem import WordNetLemmatizer
from nltk.tokenize import word_tokenize, sent_tokenize
from nltk import pos_tag, word_tokenize
from nltk.stem import WordNetLemmatizer
from nltk.tokenize import word_tokenize
from flask import Flask
from flask import rend... | true | true |
f71f7408f54375e5147ae5b03a495305fdff73de | 1,853 | py | Python | mercury_agent/procedures/inspector.py | jr0d/mercury-agent | 12b75ecc951d3ab5cd15c5213df2412b108cf47c | [
"Apache-2.0"
] | null | null | null | mercury_agent/procedures/inspector.py | jr0d/mercury-agent | 12b75ecc951d3ab5cd15c5213df2412b108cf47c | [
"Apache-2.0"
] | 4 | 2017-11-01T16:25:49.000Z | 2018-08-22T13:50:23.000Z | mercury_agent/procedures/inspector.py | jr0d/mercury-agent | 12b75ecc951d3ab5cd15c5213df2412b108cf47c | [
"Apache-2.0"
] | 5 | 2017-10-19T12:40:15.000Z | 2018-08-21T20:18:54.000Z | # Copyright 2015 Jared Rodriguez (jared.rodriguez@rackspace.com)
# 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/LICENS... | 36.333333 | 98 | 0.729628 |
from mercury_agent.capabilities import capability
from mercury_agent.configuration import get_configuration
from mercury_agent.inspector import inspect
from mercury_agent.inspector.inspect import global_device_info
from mercury_agent.inspector.inspectors import health
@capability('inspector', descripti... | true | true |
f71f755bceeeb2c38e3122cc3e6f50cb403624cb | 453 | py | Python | examples/user/user_playlists.py | LorenzoCavatorta/spotify.py | 7f375f030fbac4ef3dbbd577a898b4d72f37b72b | [
"MIT"
] | null | null | null | examples/user/user_playlists.py | LorenzoCavatorta/spotify.py | 7f375f030fbac4ef3dbbd577a898b4d72f37b72b | [
"MIT"
] | null | null | null | examples/user/user_playlists.py | LorenzoCavatorta/spotify.py | 7f375f030fbac4ef3dbbd577a898b4d72f37b72b | [
"MIT"
] | null | null | null | import asyncio
import spotify
client = spotify.Client('someid', 'somesecret')
async def main():
# You can use a user with a http presence
user = await client.user_from_token('sometoken')
# Or you can get a generic user
user = await client.get_user(user_id)
# returns a list of spotify.Playlist ob... | 25.166667 | 55 | 0.715232 | import asyncio
import spotify
client = spotify.Client('someid', 'somesecret')
async def main():
user = await client.user_from_token('sometoken')
user = await client.get_user(user_id)
playlists = await user.get_playlists()
if __name__ == '__main__':
asyncio.get_event_loop().run_until_... | true | true |
f71f75b68bb7f3fa7cd5a31932f2aebd38d239e8 | 8,668 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2021_02_01/aio/operations/_load_balancer_outbound_rules_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 3 | 2020-06-23T02:25:27.000Z | 2021-09-07T18:48:11.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2021_02_01/aio/operations/_load_balancer_outbound_rules_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 510 | 2019-07-17T16:11:19.000Z | 2021-08-02T08:38:32.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2021_02_01/aio/operations/_load_balancer_outbound_rules_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 5 | 2019-09-04T12:51:37.000Z | 2020-09-16T07:28:40.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 ... | 48.424581 | 206 | 0.671666 |
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pi... | true | true |
f71f76fbbb3977874071bfc11924aee5822e4bea | 2,317 | py | Python | itng/common/templatetags/ng_utils.py | NoviSystems/ng-utils | 29d20ba65fe2078694d18e6a33f7a448b26fa297 | [
"BSD-3-Clause"
] | null | null | null | itng/common/templatetags/ng_utils.py | NoviSystems/ng-utils | 29d20ba65fe2078694d18e6a33f7a448b26fa297 | [
"BSD-3-Clause"
] | null | null | null | itng/common/templatetags/ng_utils.py | NoviSystems/ng-utils | 29d20ba65fe2078694d18e6a33f7a448b26fa297 | [
"BSD-3-Clause"
] | null | null | null |
import re
from django import template
from django.template.defaultfilters import stringfilter
from django.utils.encoding import force_text
from ordered_set import OrderedSet
register = template.Library()
@register.filter
def required(field):
"""
Return 'required' as a string if the BoundField's underlying ... | 31.739726 | 156 | 0.686664 |
import re
from django import template
from django.template.defaultfilters import stringfilter
from django.utils.encoding import force_text
from ordered_set import OrderedSet
register = template.Library()
@register.filter
def required(field):
return "required" if field.field.required else ""
@register.filter
... | true | true |
f71f78bb67acd2a761bf282de28af8274e07ab9d | 1,636 | py | Python | Largest_Range.py | Le-bruit-de-nos-pas/python-functions | 0d86f924087da228ef46f6b984239b4ec8b7b305 | [
"MIT"
] | null | null | null | Largest_Range.py | Le-bruit-de-nos-pas/python-functions | 0d86f924087da228ef46f6b984239b4ec8b7b305 | [
"MIT"
] | null | null | null | Largest_Range.py | Le-bruit-de-nos-pas/python-functions | 0d86f924087da228ef46f6b984239b4ec8b7b305 | [
"MIT"
] | null | null | null | array_to_analyze = [11,7,3,4,2,5,1,0]
def largestRange(array_to_analyze):
# create a dictionary / hash table to keep track if we've seen the number already
elements = {x:0 for x in array_to_analyze} # set them all to "0"
#how many places have we moved to the left and right
left = 0
right = 0... | 38.046512 | 106 | 0.620416 | array_to_analyze = [11,7,3,4,2,5,1,0]
def largestRange(array_to_analyze):
elements = {x:0 for x in array_to_analyze} # set them all to "0"
#how many places have we moved to the left and right
left = 0
right = 0
#for each number
for entry in array_to_analyze:
#if the number ... | true | true |
f71f7a46733f735693deb2dee446ef1ebe2704f2 | 2,218 | py | Python | notifier.py | gkumar7/vaccine-notifier | 3177fcf7fa0eef38779e544db95844ac5b6edbdd | [
"MIT"
] | 1 | 2021-03-24T02:52:34.000Z | 2021-03-24T02:52:34.000Z | notifier.py | gkumar7/vaccine-notifier | 3177fcf7fa0eef38779e544db95844ac5b6edbdd | [
"MIT"
] | null | null | null | notifier.py | gkumar7/vaccine-notifier | 3177fcf7fa0eef38779e544db95844ac5b6edbdd | [
"MIT"
] | null | null | null | import time
from datetime import datetime
from math import radians, cos, sin, asin, sqrt
import requests
url = "https://www.vaccinespotter.org/api/v0/states/IL.json"
minutes = 1
center = {'lat': 0.0, 'lon': 0.0}
max_distance = 50
found = []
def haversine(lon1, lat1, lon2, lat2):
"""
Calculate the great circ... | 27.04878 | 100 | 0.576646 | import time
from datetime import datetime
from math import radians, cos, sin, asin, sqrt
import requests
url = "https://www.vaccinespotter.org/api/v0/states/IL.json"
minutes = 1
center = {'lat': 0.0, 'lon': 0.0}
max_distance = 50
found = []
def haversine(lon1, lat1, lon2, lat2):
lon1, lat1, lon2, lat2 = ma... | true | true |
f71f7aaa0bb10df8c141305e95139c15bca2394f | 4,249 | py | Python | tests/test_histogram2d.py | ess-dmsc/JustBinIt | dc8242ed44f03e92f60618c96596025ec8cbc40e | [
"BSD-2-Clause"
] | null | null | null | tests/test_histogram2d.py | ess-dmsc/JustBinIt | dc8242ed44f03e92f60618c96596025ec8cbc40e | [
"BSD-2-Clause"
] | 23 | 2018-12-04T11:50:37.000Z | 2022-03-17T11:30:39.000Z | tests/test_histogram2d.py | ess-dmsc/JustBinIt | dc8242ed44f03e92f60618c96596025ec8cbc40e | [
"BSD-2-Clause"
] | 2 | 2019-07-24T11:13:41.000Z | 2020-08-04T18:33:22.000Z | import numpy as np
import pytest
from just_bin_it.histograms.histogram2d import Histogram2d
IRRELEVANT_TOPIC = "some-topic"
class TestHistogram2dFunctionality:
@pytest.fixture(autouse=True)
def prepare(self):
self.pulse_time = 1234
self.num_bins = (5, 10)
self.tof_range = (0, 10)
... | 36.62931 | 88 | 0.65992 | import numpy as np
import pytest
from just_bin_it.histograms.histogram2d import Histogram2d
IRRELEVANT_TOPIC = "some-topic"
class TestHistogram2dFunctionality:
@pytest.fixture(autouse=True)
def prepare(self):
self.pulse_time = 1234
self.num_bins = (5, 10)
self.tof_range = (0, 10)
... | true | true |
f71f7e5bf94980d2547f9d71b092b8666b476e67 | 17,709 | py | Python | contrib/tools/python3/src/Lib/wave.py | HeyLey/catboost | f472aed90604ebe727537d9d4a37147985e10ec2 | [
"Apache-2.0"
] | 486 | 2016-05-28T18:51:54.000Z | 2022-03-20T17:30:31.000Z | contrib/tools/python3/src/Lib/wave.py | HeyLey/catboost | f472aed90604ebe727537d9d4a37147985e10ec2 | [
"Apache-2.0"
] | 42 | 2018-05-25T15:57:08.000Z | 2021-01-17T18:39:59.000Z | contrib/tools/python3/src/Lib/wave.py | HeyLey/catboost | f472aed90604ebe727537d9d4a37147985e10ec2 | [
"Apache-2.0"
] | 46 | 2016-05-28T18:52:03.000Z | 2021-06-01T07:57:51.000Z | """Stuff to parse WAVE files.
Usage.
Reading WAVE files:
f = wave.open(file, 'r')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods read(), seek(), and close().
When the setpos() and rewind() methods are not used, the seek()
method is not necessary.
This ... | 34.998024 | 130 | 0.61257 |
import builtins
__all__ = ["open", "openfp", "Error", "Wave_read", "Wave_write"]
class Error(Exception):
pass
WAVE_FORMAT_PCM = 0x0001
_array_fmts = None, 'b', 'h', None, 'i'
import audioop
import struct
import sys
from chunk import Chunk
from collections import namedtuple
_wave_params = namedtuple('_wave_pa... | true | true |
f71f7e70877767a16cf3a649cd197af3470937c5 | 2,541 | py | Python | interface/Movie.py | BrickText/JHROM | d99b907e0837d8dcc57ab474e9435891736f0dda | [
"MIT"
] | null | null | null | interface/Movie.py | BrickText/JHROM | d99b907e0837d8dcc57ab474e9435891736f0dda | [
"MIT"
] | null | null | null | interface/Movie.py | BrickText/JHROM | d99b907e0837d8dcc57ab474e9435891736f0dda | [
"MIT"
] | null | null | null | from database.queries.insert_queries import INSERT_MOVIE
from database.queries.update_queries import UPDATE_MOVIE
from database.queries.delete_queries import DELETE_MOVIE
from database.queries.select_queries import SELECT_MOVIES_ORDERED_BY_RATING,\
SELECT_PROJECTION_FOR_MOVIE... | 32.164557 | 77 | 0.63046 | from database.queries.insert_queries import INSERT_MOVIE
from database.queries.update_queries import UPDATE_MOVIE
from database.queries.delete_queries import DELETE_MOVIE
from database.queries.select_queries import SELECT_MOVIES_ORDERED_BY_RATING,\
SELECT_PROJECTION_FOR_MOVIE... | true | true |
f71f7f0a14770a0fbed65f68d8dd2ab2c222a92a | 5,067 | py | Python | cardinal_pythonlib/cmdline.py | RudolfCardinal/pythonlib | 4c583ad1aae3c1166a4e6f964df87eb6c02a73cb | [
"Apache-2.0"
] | 10 | 2015-09-30T02:46:48.000Z | 2021-07-23T05:03:38.000Z | cardinal_pythonlib/cmdline.py | RudolfCardinal/pythonlib | 4c583ad1aae3c1166a4e6f964df87eb6c02a73cb | [
"Apache-2.0"
] | 9 | 2019-07-04T11:10:31.000Z | 2021-09-23T21:11:42.000Z | cardinal_pythonlib/cmdline.py | RudolfCardinal/pythonlib | 4c583ad1aae3c1166a4e6f964df87eb6c02a73cb | [
"Apache-2.0"
] | 4 | 2017-07-17T15:17:44.000Z | 2021-07-23T05:03:41.000Z | #!/usr/bin/env python
# cardinal_pythonlib/cmdline.py
"""
===============================================================================
Original code copyright (C) 2009-2021 Rudolf Cardinal (rudolf@pobox.com).
This file is part of cardinal_pythonlib.
Licensed under the Apache License, Version 2.0 (the... | 32.273885 | 129 | 0.532465 |
import re
import subprocess
import sys
from typing import List, Union
def cmdline_split(s: str, platform: Union[int, str] = 'this') -> List[str]:
if platform == 'this':
platform = (sys.platform != 'win32')
if platform == 1:
re_cmd_lex = r'''"((?:\\["\\]|[^"])*)"|'([^']*)'|(\\.)|(&&?|... | true | true |
f71f809f8758a5472aea90c604d0f3c9e8cb4804 | 25,645 | py | Python | autolabeling.py | MGH-LMIC/CXR-autolabeling | 74eac30bb6eaa6c1d5a8b343743024ef6bd9db7d | [
"Apache-2.0"
] | null | null | null | autolabeling.py | MGH-LMIC/CXR-autolabeling | 74eac30bb6eaa6c1d5a8b343743024ef6bd9db7d | [
"Apache-2.0"
] | null | null | null | autolabeling.py | MGH-LMIC/CXR-autolabeling | 74eac30bb6eaa6c1d5a8b343743024ef6bd9db7d | [
"Apache-2.0"
] | null | null | null | import re
import pickle
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.cm as mpl_color_map
from tqdm import tqdm
from pathlib import Path
from prettytable import PrettyTable
from scipy.ndimage import gaussian_filter
from sklearn.metrics import roc_curve, precision_recall_curve... | 40.259027 | 230 | 0.569429 | import re
import pickle
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.cm as mpl_color_map
from tqdm import tqdm
from pathlib import Path
from prettytable import PrettyTable
from scipy.ndimage import gaussian_filter
from sklearn.metrics import roc_curve, precision_recall_curve... | true | true |
f71f8112d97cf0d0c960835f729f2a0a204f5395 | 6,801 | py | Python | src/python/tests/core/bot/tasks/task_creation_test.py | stplaydog/clusterfuzz | faa957d265641c031631c36f701c1dc76704a5c7 | [
"Apache-2.0"
] | null | null | null | src/python/tests/core/bot/tasks/task_creation_test.py | stplaydog/clusterfuzz | faa957d265641c031631c36f701c1dc76704a5c7 | [
"Apache-2.0"
] | 2 | 2021-03-31T19:59:19.000Z | 2021-05-20T22:08:07.000Z | src/python/tests/core/bot/tasks/task_creation_test.py | hixio-mh/clusterfuzz | 3f9a69ed71a4420b1a1df8864dd7f3fc1d5b6e07 | [
"Apache-2.0"
] | null | null | null | # 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 agreed to in writing, ... | 36.762162 | 74 | 0.704161 |
import mock
import unittest
from bot.tasks import task_creation
from datastore import data_types
from tests.test_libs import helpers
from tests.test_libs import mock_config
from tests.test_libs import test_utils
@test_utils.with_cloud_emulators('datastore')
class RequestBisectionTest(unittest.TestCase):... | true | true |
f71f83d71e89545d5f222b0941888734de4afcee | 1,798 | py | Python | benchmark/memory_profile_tool.py | coolteemf/coolteemf-deformetrica | f965d6ecc0d04f243e487468a9dafe9fe864eed2 | [
"MIT"
] | 2 | 2022-03-04T11:19:30.000Z | 2022-03-08T04:47:22.000Z | benchmark/memory_profile_tool.py | lepennec/Deformetrica_multiscale | dbcb69962dd02f14dde5d63a9abc1de69112f273 | [
"MIT"
] | null | null | null | benchmark/memory_profile_tool.py | lepennec/Deformetrica_multiscale | dbcb69962dd02f14dde5d63a9abc1de69112f273 | [
"MIT"
] | 1 | 2022-03-07T09:52:52.000Z | 2022-03-07T09:52:52.000Z | import resource
import sys
import time
from threading import Thread
from memory_profiler import memory_usage
import GPUtil
import torch
# _cudart = ctypes.CDLL('libcudart.so')
#
#
# def start_cuda_profile():
# # As shown at http://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__PROFILER.html,
# # the re... | 23.350649 | 94 | 0.660178 | import resource
import sys
import time
from threading import Thread
from memory_profiler import memory_usage
import GPUtil
import torch
': []}
def run(self):
while self.run_flag:
self.data['ram'].append(self.current_ram_usage())
time.sleep(self.freq)
def stop(se... | true | true |
f71f84709e6e370286285ed6bcfe99e6b5009b1b | 436 | py | Python | lessrpc_stub/StubConstants.py | MoujiRPC/mouji_stub_py2x | 3f8d7c0ccdfade7f80020528ca9ddb52556def6c | [
"MIT"
] | 2 | 2019-03-19T21:44:11.000Z | 2019-04-16T21:41:50.000Z | lessrpc_stub/StubConstants.py | MoujiRPC/mouji_stub_py2x | 3f8d7c0ccdfade7f80020528ca9ddb52556def6c | [
"MIT"
] | null | null | null | lessrpc_stub/StubConstants.py | MoujiRPC/mouji_stub_py2x | 3f8d7c0ccdfade7f80020528ca9ddb52556def6c | [
"MIT"
] | null | null | null | '''
Created on Nov 7, 2017
@author: Salim
'''
CONF_PARAM_NAME_SERVER_URL = "CONF.NAMESERVER.URL"
CONF_PARAM_NAME_SERVER_PORT = "CONF.NAMESERVER.PORT"
RPC_PROTOCOL = "http://"
LESS_RPC_REQUEST_PING = "/ping"
LESS_RPC_REQUEST_EXECUTE = "/execute"
LESS_RPC_REQUEST_SERVICE = "/service"
LESS_RPC_REQUEST_INFO = "/info"
... | 17.44 | 52 | 0.743119 |
CONF_PARAM_NAME_SERVER_URL = "CONF.NAMESERVER.URL"
CONF_PARAM_NAME_SERVER_PORT = "CONF.NAMESERVER.PORT"
RPC_PROTOCOL = "http://"
LESS_RPC_REQUEST_PING = "/ping"
LESS_RPC_REQUEST_EXECUTE = "/execute"
LESS_RPC_REQUEST_SERVICE = "/service"
LESS_RPC_REQUEST_INFO = "/info"
HTTP_PROTOCOL = "http://"
HTTPS_PROTOCOL = "htt... | true | true |
f71f85094dbcb9fd0be92bb6eec98b8e5363d046 | 100,399 | py | Python | src/sardana/macroserver/macros/scan.py | aureocarneiro/sardana | 43644c9966d73c7a9023b53e97b530f3ea0dfb39 | [
"CC-BY-3.0"
] | null | null | null | src/sardana/macroserver/macros/scan.py | aureocarneiro/sardana | 43644c9966d73c7a9023b53e97b530f3ea0dfb39 | [
"CC-BY-3.0"
] | null | null | null | src/sardana/macroserver/macros/scan.py | aureocarneiro/sardana | 43644c9966d73c7a9023b53e97b530f3ea0dfb39 | [
"CC-BY-3.0"
] | null | null | null | ##############################################################################
##
# This file is part of Sardana
##
# http://www.sardana-controls.org/
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Sardana is free software: you can redistribute it and/or modify
# it under the terms of the GNU Less... | 43.126718 | 99 | 0.587436 | id value for mode %s' % mode)
self._data = self._gScan.data
def _stepGenerator(self):
step = {}
step["integ_time"] = self.integ_time
step["pre-move-hooks"] = self.getHooks('pre-move')
step["post-move-hooks"] = self.getHooks('p... | true | true |
f71f8633b734353bac2000dd7387efb6ae942340 | 2,457 | py | Python | cli/polyaxon/utils/cache.py | polyaxon/cli | 3543c0220a8a7c06fc9573cd2a740f8ae4930641 | [
"Apache-2.0"
] | null | null | null | cli/polyaxon/utils/cache.py | polyaxon/cli | 3543c0220a8a7c06fc9573cd2a740f8ae4930641 | [
"Apache-2.0"
] | 1 | 2022-01-24T11:26:47.000Z | 2022-03-18T23:17:58.000Z | cli/polyaxon/utils/cache.py | polyaxon/cli | 3543c0220a8a7c06fc9573cd2a740f8ae4930641 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2018-2022 Polyaxon, 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 ... | 33.202703 | 84 | 0.728938 |
from polyaxon.exceptions import PolyaxonSchemaError
from polyaxon.managers.project import ProjectConfigManager
from polyaxon.utils.formatting import Printer
CACHE_ERROR = (
"Found an invalid project config or project config cache, "
"if you are using Polyaxon CLI please run: "
"`polyaxon con... | true | true |
f71f8692d84797110282e3423509cce733cecedd | 13,447 | py | Python | containers.py | Fy-Network/fysql | 9a5910601e9aa13479c9fbd05eb64e958e90dea2 | [
"MIT"
] | 1 | 2016-06-17T08:48:52.000Z | 2016-06-17T08:48:52.000Z | containers.py | Fy-/fysql | 9a5910601e9aa13479c9fbd05eb64e958e90dea2 | [
"MIT"
] | 1 | 2016-06-17T18:06:41.000Z | 2016-06-17T18:06:41.000Z | containers.py | Fy-Network/fysql | 9a5910601e9aa13479c9fbd05eb64e958e90dea2 | [
"MIT"
] | 2 | 2018-02-11T02:14:11.000Z | 2020-01-07T05:40:34.000Z | # -*- coding: utf-8 -*-
"""
fysql.containers
~~~~~~~~~~~~~~~~
:copyright: (c) 2016 by Gasquez Florian
:license: MIT, see LICENSE for more details.
"""
from __future__ import unicode_literals
from functools import wraps
import copy
import hashlib
from .entities import SQLEntity, SQLJoin, SQLCondition, SQLColumn
fro... | 25.809981 | 121 | 0.692348 |
from __future__ import unicode_literals
from functools import wraps
import copy
import hashlib
from .entities import SQLEntity, SQLJoin, SQLCondition, SQLColumn
from .columns import FKeyColumn, PKeyColumn, IntegerColumn
from .static import Tables
class ContainerWalker(object):
def __init__(self, entities, separa... | true | true |
f71f86944f4a3f67142dcc0a2330fcdd6e0e21be | 8,966 | py | Python | lib/kubernetes/client/models/v1_resource_attributes.py | splunkenizer/splunk_as_a_service_app | 97c4aaf927d2171bf131126cf9b70489ac75bc5a | [
"Apache-2.0"
] | 7 | 2019-12-21T00:14:14.000Z | 2021-03-11T14:51:37.000Z | lib/kubernetes/client/models/v1_resource_attributes.py | splunkenizer/splunk_as_a_service_app | 97c4aaf927d2171bf131126cf9b70489ac75bc5a | [
"Apache-2.0"
] | 29 | 2019-10-09T11:16:21.000Z | 2020-06-23T09:32:09.000Z | lib/kubernetes/client/models/v1_resource_attributes.py | splunkenizer/splunk_as_a_service_app | 97c4aaf927d2171bf131126cf9b70489ac75bc5a | [
"Apache-2.0"
] | 1 | 2021-05-07T10:13:31.000Z | 2021-05-07T10:13:31.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.14.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteri... | 30.39322 | 361 | 0.565135 |
from pprint import pformat
from six import iteritems
import re
class V1ResourceAttributes(object):
swagger_types = {
'group': 'str',
'name': 'str',
'namespace': 'str',
'resource': 'str',
'subresource': 'str',
'verb': 'str',
'version':... | true | true |
f71f86e48de8074e6e823ee832ad036d915afdae | 16,478 | py | Python | figures/kCSD_properties/targeted_basis.py | rdarie/kCSD-python | 5b9e1b1dce2ff95c0d981c2c4015b7a75199de9a | [
"BSD-3-Clause"
] | 11 | 2017-11-06T21:24:18.000Z | 2022-02-07T21:17:13.000Z | figures/kCSD_properties/targeted_basis.py | aeladly91/kCSD-python | 4dd0015e9c5598e7eceeeb25668e696e495b2026 | [
"BSD-3-Clause"
] | 105 | 2017-12-13T12:49:54.000Z | 2022-03-19T12:25:51.000Z | figures/kCSD_properties/targeted_basis.py | aeladly91/kCSD-python | 4dd0015e9c5598e7eceeeb25668e696e495b2026 | [
"BSD-3-Clause"
] | 27 | 2017-06-08T07:32:32.000Z | 2022-02-07T21:17:15.000Z | """
@author: mkowalska
"""
import os
from os.path import expanduser
import numpy as np
import matplotlib.pyplot as plt
import datetime
import time
from kcsd import ValidateKCSD, ValidateKCSD1D, SpectralStructure, KCSD1D
__abs_file__ = os.path.abspath(__file__)
home = expanduser('~')
DAY = datetime.datetime.now()
DAY ... | 31.749518 | 82 | 0.585933 | import os
from os.path import expanduser
import numpy as np
import matplotlib.pyplot as plt
import datetime
import time
from kcsd import ValidateKCSD, ValidateKCSD1D, SpectralStructure, KCSD1D
__abs_file__ = os.path.abspath(__file__)
home = expanduser('~')
DAY = datetime.datetime.now()
DAY = DAY.strftime('%Y%m%d')
TI... | true | true |
f71f873815e728bc7fb92f7c3c25537c688114fb | 58,117 | py | Python | src/train_eval.py | chanyh0/PyTorch-StudioGAN | 5a912affc1ec975d97a33a12d1c96d05d4b883f0 | [
"MIT"
] | 75 | 2021-02-25T20:04:53.000Z | 2022-03-12T12:12:58.000Z | src/train_eval.py | chanyh0/PyTorch-StudioGAN | 5a912affc1ec975d97a33a12d1c96d05d4b883f0 | [
"MIT"
] | 1 | 2021-08-08T13:12:27.000Z | 2021-08-08T13:12:27.000Z | src/train_eval.py | chanyh0/PyTorch-StudioGAN | 5a912affc1ec975d97a33a12d1c96d05d4b883f0 | [
"MIT"
] | 7 | 2021-03-02T18:47:45.000Z | 2022-01-26T13:49:25.000Z | # PyTorch StudioGAN: https://github.com/POSTECH-CVLab/PyTorch-StudioGAN
# The MIT License (MIT)
# See license file or visit https://github.com/POSTECH-CVLab/PyTorch-StudioGAN for details
# train_eval.py
import numpy as np
import sys
import glob
from scipy import ndimage
from os.path import join
from PIL import Image... | 61.958422 | 176 | 0.573189 |
import numpy as np
import sys
import glob
from scipy import ndimage
from os.path import join
from PIL import Image
from tqdm import tqdm
from datetime import datetime
from metrics.IS import calculate_incep_score
from metrics.FID import calculate_fid_score
from metrics.F_beta import calculate_f_beta_score
from m... | true | true |
f71f885cac4c2f109c64f495a43df8973c10dbfa | 2,038 | py | Python | benchmark/points/edge_cnn_ke.py | KuangenZhang/pytorch_geometric | 0bfc79a5eaccfcd16a82395e8578a90c5e44759f | [
"MIT"
] | 1 | 2021-09-14T15:55:56.000Z | 2021-09-14T15:55:56.000Z | benchmark/points/edge_cnn_ke.py | KuangenZhang/pytorch_geometric | 0bfc79a5eaccfcd16a82395e8578a90c5e44759f | [
"MIT"
] | null | null | null | benchmark/points/edge_cnn_ke.py | KuangenZhang/pytorch_geometric | 0bfc79a5eaccfcd16a82395e8578a90c5e44759f | [
"MIT"
] | null | null | null | import argparse
import torch
import torch.nn.functional as F
from torch.nn import Sequential as Seq, Linear as Lin, ReLU, LeakyReLU
from torch_geometric.nn import DynamicEdgeConv, global_max_pool
from datasets import get_dataset
from train_eval import run
parser = argparse.ArgumentParser()
parser.add_argument('--epoc... | 33.966667 | 78 | 0.663395 | import argparse
import torch
import torch.nn.functional as F
from torch.nn import Sequential as Seq, Linear as Lin, ReLU, LeakyReLU
from torch_geometric.nn import DynamicEdgeConv, global_max_pool
from datasets import get_dataset
from train_eval import run
parser = argparse.ArgumentParser()
parser.add_argument('--epoc... | true | true |
f71f895df82d2833eb823b4a18567f17d274743e | 1,316 | py | Python | torch2trt/converters/grid_sample.py | huliang2016/torch2trt_dynamic | aa55f354a742d26272eae93934d0cff7cd946cbf | [
"MIT"
] | null | null | null | torch2trt/converters/grid_sample.py | huliang2016/torch2trt_dynamic | aa55f354a742d26272eae93934d0cff7cd946cbf | [
"MIT"
] | null | null | null | torch2trt/converters/grid_sample.py | huliang2016/torch2trt_dynamic | aa55f354a742d26272eae93934d0cff7cd946cbf | [
"MIT"
] | null | null | null | from torch2trt.torch2trt import *
from torch2trt.plugins import *
@tensorrt_converter('torch.nn.functional.grid_sample')
def convert_grid_sample(ctx):
input = ctx.method_args[0]
grid = get_arg(ctx, 'grid', pos=1, default=None)
mode = get_arg(ctx, 'mode', pos=2, default='bilinear')
padding_mod... | 34.631579 | 74 | 0.591945 | from torch2trt.torch2trt import *
from torch2trt.plugins import *
@tensorrt_converter('torch.nn.functional.grid_sample')
def convert_grid_sample(ctx):
input = ctx.method_args[0]
grid = get_arg(ctx, 'grid', pos=1, default=None)
mode = get_arg(ctx, 'mode', pos=2, default='bilinear')
padding_mod... | true | true |
f71f89ceb3c12643c41afd03550daee9d2e132a8 | 658 | py | Python | main/lynx/template.py | RoastVeg/cports | 803c7f07af341eb32f791b6ec1f237edb2764bd5 | [
"BSD-2-Clause"
] | 46 | 2021-06-10T02:27:32.000Z | 2022-03-27T11:33:24.000Z | main/lynx/template.py | RoastVeg/cports | 803c7f07af341eb32f791b6ec1f237edb2764bd5 | [
"BSD-2-Clause"
] | 58 | 2021-07-03T13:58:20.000Z | 2022-03-13T16:45:35.000Z | main/lynx/template.py | RoastVeg/cports | 803c7f07af341eb32f791b6ec1f237edb2764bd5 | [
"BSD-2-Clause"
] | 6 | 2021-07-04T10:46:40.000Z | 2022-01-09T00:03:59.000Z | pkgname = "lynx"
pkgver = "2.9.0_pre10"
_uver = "2.9.0dev.10"
pkgrel = 0
build_style = "gnu_configure"
configure_args = [
"--enable-widec", "--enable-ipv6", "--with-zlib", "--with-bzlib",
"--with-ssl"
]
hostmakedepends = ["pkgconf"]
makedepends = [
"zlib-devel", "libbz2-devel", "ncurses-devel", "openssl-dev... | 31.333333 | 92 | 0.696049 | pkgname = "lynx"
pkgver = "2.9.0_pre10"
_uver = "2.9.0dev.10"
pkgrel = 0
build_style = "gnu_configure"
configure_args = [
"--enable-widec", "--enable-ipv6", "--with-zlib", "--with-bzlib",
"--with-ssl"
]
hostmakedepends = ["pkgconf"]
makedepends = [
"zlib-devel", "libbz2-devel", "ncurses-devel", "openssl-dev... | true | true |
f71f8a26e59f7652219836c7aac3c3072c01af66 | 5,150 | py | Python | conf.py | SmartDataProjects/dynamo-docs | dffc4e853ffd8bc1a1eabce8b34c1084412cb562 | [
"MIT"
] | null | null | null | conf.py | SmartDataProjects/dynamo-docs | dffc4e853ffd8bc1a1eabce8b34c1084412cb562 | [
"MIT"
] | null | null | null | conf.py | SmartDataProjects/dynamo-docs | dffc4e853ffd8bc1a1eabce8b34c1084412cb562 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Dynamo documentation build configuration file, created by
# sphinx-quickstart on Tue Jun 5 10:40:30 2018.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... | 32.389937 | 121 | 0.687379 |
extensions = ['sphinx.ext.intersphinx']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'Dynamo'
copyright = u'2018, Yutaro Iiyama, Max Goncharov, Benedikt Maier, Daniel Abercrombie, Siddarth Narayanan, Christoph Paus'
author = u'Yutaro I... | true | true |
f71f8a38750a1ac3b7381ca20272a675585b6e22 | 414 | py | Python | scanEngine/migrations/0006_auto_20200718_0429.py | Suprita-25/rengine | d6aabb49f27f7ad6039477c16a96213b0d80f81f | [
"MIT"
] | null | null | null | scanEngine/migrations/0006_auto_20200718_0429.py | Suprita-25/rengine | d6aabb49f27f7ad6039477c16a96213b0d80f81f | [
"MIT"
] | null | null | null | scanEngine/migrations/0006_auto_20200718_0429.py | Suprita-25/rengine | d6aabb49f27f7ad6039477c16a96213b0d80f81f | [
"MIT"
] | null | null | null | # Generated by Django 3.0.7 on 2020-07-18 04:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('scanEngine', '0005_auto_20200718_0407'),
]
operations = [
migrations.AlterField(
model_name='wordlist',
name='path',... | 21.789474 | 75 | 0.60628 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('scanEngine', '0005_auto_20200718_0407'),
]
operations = [
migrations.AlterField(
model_name='wordlist',
name='path',
field=models.CharField(blank=True,... | true | true |
f71f8aad34c9f5bcb36563c0f477edba60015bc9 | 1,029 | py | Python | printing.py | shuckc/printerface | 1f3eeca4c4d090c119404fd354eac02a4f68a56b | [
"BSD-3-Clause"
] | 3 | 2017-02-03T18:29:35.000Z | 2020-02-19T14:46:05.000Z | printing.py | TeaEngineering/printerface | 1f3eeca4c4d090c119404fd354eac02a4f68a56b | [
"BSD-3-Clause"
] | 3 | 2015-08-03T12:01:25.000Z | 2015-12-26T13:52:18.000Z | printing.py | TeaEngineering/printerface | 1f3eeca4c4d090c119404fd354eac02a4f68a56b | [
"BSD-3-Clause"
] | 1 | 2016-03-21T13:45:34.000Z | 2016-03-21T13:45:34.000Z | #!/usr/bin/python
import sys
import subprocess
printers = []
def getPrinters():
global printers
if not sys.platform == "linux2":
return ['default']
if len(printers) > 0: return printers
try:
process = subprocess.Popen(["lpstat", "-a"], stdout=subprocess.PIPE)
result = process.communicate()[0].strip()
# KO... | 30.264706 | 96 | 0.678328 |
import sys
import subprocess
printers = []
def getPrinters():
global printers
if not sys.platform == "linux2":
return ['default']
if len(printers) > 0: return printers
try:
process = subprocess.Popen(["lpstat", "-a"], stdout=subprocess.PIPE)
result = process.communicate()[0].strip()
print(result)
pr... | true | true |
f71f8acdefea0e50130dc14864f4cd1d3a47060b | 4,453 | py | Python | rpc/client.py | watermelonano/melonbot | 7ac8418020e63e340f1f6df13ad4e85d6c864cda | [
"MIT"
] | null | null | null | rpc/client.py | watermelonano/melonbot | 7ac8418020e63e340f1f6df13ad4e85d6c864cda | [
"MIT"
] | 1 | 2019-12-03T20:13:23.000Z | 2019-12-03T20:13:23.000Z | rpc/client.py | watermelonano/melonbot | 7ac8418020e63e340f1f6df13ad4e85d6c864cda | [
"MIT"
] | null | null | null | import aiohttp
import rapidjson as json
import socket
from config import Config
from typing import List, Tuple
class RPCClient(object):
_instance = None
def __init__(self):
raise RuntimeError('Call instance() instead')
@classmethod
def instance(cls) -> 'RPCClient':
if cls._instance is... | 35.062992 | 137 | 0.587469 | import aiohttp
import rapidjson as json
import socket
from config import Config
from typing import List, Tuple
class RPCClient(object):
_instance = None
def __init__(self):
raise RuntimeError('Call instance() instead')
@classmethod
def instance(cls) -> 'RPCClient':
if cls._instance is... | true | true |
f71f8b0bf067a0ad1bfabdb4bd73bb6ce0671e67 | 2,071 | py | Python | ryu/tests/unit/packet/test_openflow.py | MrCocoaCat/ryu | 9e9571991a73380099b7ba7c6f37e0e587080a6a | [
"Apache-2.0"
] | null | null | null | ryu/tests/unit/packet/test_openflow.py | MrCocoaCat/ryu | 9e9571991a73380099b7ba7c6f37e0e587080a6a | [
"Apache-2.0"
] | null | null | null | ryu/tests/unit/packet/test_openflow.py | MrCocoaCat/ryu | 9e9571991a73380099b7ba7c6f37e0e587080a6a | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2017 Nippon Telegraph and Telephone 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 ... | 31.861538 | 80 | 0.627233 |
from __future__ import print_function
import logging
import os
import sys
import unittest
from nose.tools import eq_
from nose.tools import ok_
from ryu.lib import pcaplib
from ryu.lib.packet import openflow
from ryu.lib.packet import packet
from ryu.utils import binary_str
LOG = lo... | true | true |
f71f8bd977b164017df62a900a494bb42ac54683 | 2,444 | py | Python | tests/test_data_structures/test_linked_list.py | titus-ong/my-python-algorithms | d9eecf2846c0a7dd8978f11fec8e8f52be23f3bc | [
"MIT"
] | null | null | null | tests/test_data_structures/test_linked_list.py | titus-ong/my-python-algorithms | d9eecf2846c0a7dd8978f11fec8e8f52be23f3bc | [
"MIT"
] | null | null | null | tests/test_data_structures/test_linked_list.py | titus-ong/my-python-algorithms | d9eecf2846c0a7dd8978f11fec8e8f52be23f3bc | [
"MIT"
] | null | null | null | import pytest
from my_python_algorithms.data_structures.linked_list import LinkedList, Node
def test_node():
n = Node(1)
assert 1 == n.value
assert None is n.next
def test_empty_ll():
ll = LinkedList()
assert None is ll.head
def test_ll_with_head():
ll = LinkedList(1)
assert 1 == ll.he... | 17.090909 | 77 | 0.614157 | import pytest
from my_python_algorithms.data_structures.linked_list import LinkedList, Node
def test_node():
n = Node(1)
assert 1 == n.value
assert None is n.next
def test_empty_ll():
ll = LinkedList()
assert None is ll.head
def test_ll_with_head():
ll = LinkedList(1)
assert 1 == ll.he... | true | true |
f71f8c4271a58e5975430cb596344aa1a4927d19 | 3,169 | py | Python | homeassistant/components/device_tracker/bluetooth_tracker.py | shire210/home-assistant | 63cd8bbee6f1b74ae9c6c249ac820119a8a573d8 | [
"Apache-2.0"
] | 2 | 2017-02-25T00:27:06.000Z | 2017-02-25T03:09:30.000Z | homeassistant/components/device_tracker/bluetooth_tracker.py | shire210/home-assistant | 63cd8bbee6f1b74ae9c6c249ac820119a8a573d8 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/device_tracker/bluetooth_tracker.py | shire210/home-assistant | 63cd8bbee6f1b74ae9c6c249ac820119a8a573d8 | [
"Apache-2.0"
] | 2 | 2018-06-03T11:14:44.000Z | 2018-11-04T18:18:12.000Z | """Tracking for bluetooth devices."""
import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.event import track_point_in_utc_time
from homeassistant.components.device_tracker import (
YAML_DEVICES, CONF_TRACK_NEW, CONF_SCAN_INTERVAL, DEFAULT_SCAN_IN... | 34.824176 | 76 | 0.618492 | import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.event import track_point_in_utc_time
from homeassistant.components.device_tracker import (
YAML_DEVICES, CONF_TRACK_NEW, CONF_SCAN_INTERVAL, DEFAULT_SCAN_INTERVAL,
load_config, PLATFORM_SCHE... | true | true |
f71f8d6b054c39b44978826f1f894a184c1e7cce | 212 | py | Python | social/__init__.py | Diolor/python-social-auth | ba4e30d4a11b2e188954770bae4df9426d61a470 | [
"BSD-3-Clause"
] | 1 | 2015-04-19T21:38:46.000Z | 2015-04-19T21:38:46.000Z | social/__init__.py | nvbn/python-social-auth | 3e0e99404f20e7b6847ca069e0844ba8c090415f | [
"BSD-3-Clause"
] | null | null | null | social/__init__.py | nvbn/python-social-auth | 3e0e99404f20e7b6847ca069e0844ba8c090415f | [
"BSD-3-Clause"
] | 1 | 2020-05-23T05:49:36.000Z | 2020-05-23T05:49:36.000Z | """
python-social-auth application, allows OpenId or OAuth user
registration/authentication just adding a few configurations.
"""
version = (0, 1, 13)
extra = ''
__version__ = '.'.join(map(str, version)) + extra
| 26.5 | 61 | 0.721698 | version = (0, 1, 13)
extra = ''
__version__ = '.'.join(map(str, version)) + extra
| true | true |
f71f8de993bce72bcbeae4db86fff99ba77edf5b | 324 | py | Python | AOJ/pra_intro/7-d.py | Nishi05/Competitive-programming | e59a6755b706d9d5c1f359f4511d92c114e6a94e | [
"MIT"
] | null | null | null | AOJ/pra_intro/7-d.py | Nishi05/Competitive-programming | e59a6755b706d9d5c1f359f4511d92c114e6a94e | [
"MIT"
] | null | null | null | AOJ/pra_intro/7-d.py | Nishi05/Competitive-programming | e59a6755b706d9d5c1f359f4511d92c114e6a94e | [
"MIT"
] | null | null | null | n, m, l = map(int, input().split())
a = [list(map(int, input().split())) for i in range(n)]
b = [list(map(int, input().split())) for i in range(m)]
C = [[0]*l for _ in range(n)]
for i in range(n):
for j in range(l):
for k in range(m):
C[i][j] += a[i][k] * b[k][j]
for line in C:
print(*li... | 21.6 | 55 | 0.506173 | n, m, l = map(int, input().split())
a = [list(map(int, input().split())) for i in range(n)]
b = [list(map(int, input().split())) for i in range(m)]
C = [[0]*l for _ in range(n)]
for i in range(n):
for j in range(l):
for k in range(m):
C[i][j] += a[i][k] * b[k][j]
for line in C:
print(*li... | true | true |
f71f8e826c91b8b02c825b8f93c01a539cdf6534 | 1,888 | py | Python | tsutils/cog_settings.py | kary5678/tsutils | ab6ecdcd2f0e10ba19092028909b3f74bf1708a9 | [
"MIT"
] | 1 | 2021-07-28T19:41:18.000Z | 2021-07-28T19:41:18.000Z | tsutils/cog_settings.py | kary5678/tsutils | ab6ecdcd2f0e10ba19092028909b3f74bf1708a9 | [
"MIT"
] | 19 | 2020-09-14T07:55:14.000Z | 2022-03-06T17:23:14.000Z | tsutils/cog_settings.py | kary5678/tsutils | ab6ecdcd2f0e10ba19092028909b3f74bf1708a9 | [
"MIT"
] | 3 | 2020-09-14T07:47:27.000Z | 2021-09-14T02:16:33.000Z | from redbot.core import data_manager
from .json_utils import *
class CogSettings(object):
SETTINGS_FILE_NAME = "legacy_settings.json"
def __init__(self, cog_name, bot=None):
self.folder = str(data_manager.cog_data_path(raw_name=cog_name))
self.file_path = os.path.join(self.folder, CogSetting... | 33.122807 | 110 | 0.603814 | from redbot.core import data_manager
from .json_utils import *
class CogSettings(object):
SETTINGS_FILE_NAME = "legacy_settings.json"
def __init__(self, cog_name, bot=None):
self.folder = str(data_manager.cog_data_path(raw_name=cog_name))
self.file_path = os.path.join(self.folder, CogSetting... | true | true |
f71f90277bdccfb77a66e3b8e60c836a40516eb8 | 4,991 | py | Python | preql/core/casts.py | otherJL0/Preql | 958a8dfd3a040f9c40fa394a8bfc3295f32a3019 | [
"MIT"
] | null | null | null | preql/core/casts.py | otherJL0/Preql | 958a8dfd3a040f9c40fa394a8bfc3295f32a3019 | [
"MIT"
] | null | null | null | preql/core/casts.py | otherJL0/Preql | 958a8dfd3a040f9c40fa394a8bfc3295f32a3019 | [
"MIT"
] | null | null | null | from . import pql_objects as objects
from . import sql
from .exceptions import Signal
from .interp_common import call_builtin_func
from .pql_types import ITEM_NAME, T, dp_type
from .types_impl import kernel_type
@dp_type
def _cast(inst_type, target_type, inst):
if inst_type <= target_type:
return inst
... | 28.19774 | 111 | 0.661992 | from . import pql_objects as objects
from . import sql
from .exceptions import Signal
from .interp_common import call_builtin_func
from .pql_types import ITEM_NAME, T, dp_type
from .types_impl import kernel_type
@dp_type
def _cast(inst_type, target_type, inst):
if inst_type <= target_type:
return inst
... | true | true |
f71f912ae78f467af2ef0d275e047683484c9024 | 132 | py | Python | clvm/EvalError.py | ChiaMineJP/clvm | 1a5cb17895d8707f784a85180bc97d3c6ebe71a0 | [
"Apache-2.0"
] | 83 | 2020-02-23T13:02:41.000Z | 2022-03-31T06:27:11.000Z | clvm/EvalError.py | ChiaMineJP/clvm | 1a5cb17895d8707f784a85180bc97d3c6ebe71a0 | [
"Apache-2.0"
] | 56 | 2020-01-30T00:28:33.000Z | 2022-03-29T10:38:14.000Z | venv/lib/python3.8/site-packages/clvm/EvalError.py | hu12305204/chia-analyze | 1c9e2104dbe340412e79051fad4cb5b591f6d1a3 | [
"Apache-2.0"
] | 31 | 2019-12-06T09:27:37.000Z | 2022-03-21T13:38:14.000Z | class EvalError(Exception):
def __init__(self, message: str, sexp):
super().__init__(message)
self._sexp = sexp
| 26.4 | 43 | 0.643939 | class EvalError(Exception):
def __init__(self, message: str, sexp):
super().__init__(message)
self._sexp = sexp
| true | true |
f71f91ba96fb0454f17f5b10798f2ab9bc54d086 | 7,164 | py | Python | src/socket_proxy/utils.py | fkantelberg/socket-proxy | 4fc971cfef29282f30299f40106263b53463cdd3 | [
"MIT"
] | 1 | 2021-05-18T02:28:37.000Z | 2021-05-18T02:28:37.000Z | src/socket_proxy/utils.py | fkantelberg/socket-proxy | 4fc971cfef29282f30299f40106263b53463cdd3 | [
"MIT"
] | null | null | null | src/socket_proxy/utils.py | fkantelberg/socket-proxy | 4fc971cfef29282f30299f40106263b53463cdd3 | [
"MIT"
] | null | null | null | import argparse
import ipaddress
import itertools
import logging
import os
import re
import secrets
import socket
import ssl
import sys
from random import shuffle
from typing import List, Tuple, Union
from urllib.parse import urlsplit
from . import base
_logger = logging.getLogger(__name__)
def configure_logging(lo... | 31.012987 | 87 | 0.630374 | import argparse
import ipaddress
import itertools
import logging
import os
import re
import secrets
import socket
import ssl
import sys
from random import shuffle
from typing import List, Tuple, Union
from urllib.parse import urlsplit
from . import base
_logger = logging.getLogger(__name__)
def configure_logging(lo... | true | true |
f71f91d24c0fd013e9b7c15807da9faf8ffce3f9 | 63 | py | Python | src/com/view/__init__.py | amzpiper/synchronize_data | a0ef983a6445ac5b793691dd3d4a86790c0581a7 | [
"Apache-2.0"
] | null | null | null | src/com/view/__init__.py | amzpiper/synchronize_data | a0ef983a6445ac5b793691dd3d4a86790c0581a7 | [
"Apache-2.0"
] | null | null | null | src/com/view/__init__.py | amzpiper/synchronize_data | a0ef983a6445ac5b793691dd3d4a86790c0581a7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env/python
# -*- coding:utf-8 -*-
# Author:guoyuhang | 21 | 22 | 0.634921 | true | true | |
f71f928563424af0b3d6d9d923982a0a08ad1255 | 910 | py | Python | nautilus/network/events/util.py | AlecAivazis/python | 70e2acef27a2f87355590be1a6ca60ce3ab4d09c | [
"MIT"
] | 9 | 2019-02-17T01:33:43.000Z | 2022-02-03T02:14:12.000Z | nautilus/network/events/util.py | AlecAivazis/python | 70e2acef27a2f87355590be1a6ca60ce3ab4d09c | [
"MIT"
] | 59 | 2016-03-14T15:55:50.000Z | 2016-07-17T15:22:56.000Z | nautilus/network/events/util.py | AlecAivazis/python | 70e2acef27a2f87355590be1a6ca60ce3ab4d09c | [
"MIT"
] | 3 | 2017-08-03T20:18:59.000Z | 2018-07-18T02:03:41.000Z | """
This module defines various utilities for dealing with the network.
"""
from asyncio import iscoroutinefunction, iscoroutine
def combine_action_handlers(*handlers):
"""
This function combines the given action handlers into a single function
which will call all of them.
"""
# make su... | 33.703704 | 81 | 0.668132 | from asyncio import iscoroutinefunction, iscoroutine
def combine_action_handlers(*handlers):
for handler in handlers:
if not (iscoroutinefunction(handler) or iscoroutine(handler)):
raise ValueError("Provided handler is not a coroutine: %s" % handler)
async d... | true | true |
f71f92cb89c3fdddcc269f270e17130bd0cea3de | 2,945 | py | Python | app/auth/forms.py | xdhuxc/xblog | ff0383140a5a0c1e8422223154cb98defee73121 | [
"W3C"
] | null | null | null | app/auth/forms.py | xdhuxc/xblog | ff0383140a5a0c1e8422223154cb98defee73121 | [
"W3C"
] | null | null | null | app/auth/forms.py | xdhuxc/xblog | ff0383140a5a0c1e8422223154cb98defee73121 | [
"W3C"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask_wtf import FlaskForm
from wtforms import StringField
from wtforms import PasswordField
from wtforms import BooleanField
from wtforms import SubmitField
from wtforms.validators import DataRequired
from wtforms.validators import Length
from wtforms.validators imp... | 32.722222 | 112 | 0.696774 |
from flask_wtf import FlaskForm
from wtforms import StringField
from wtforms import PasswordField
from wtforms import BooleanField
from wtforms import SubmitField
from wtforms.validators import DataRequired
from wtforms.validators import Length
from wtforms.validators import Email
from wtforms.validators import Reg... | true | true |
f71f9324bc59454b4d777a1a8dfc0cbafae774e6 | 9,717 | py | Python | mbam/parsing/base.py | danebjork/AutomatedMBAM | 91183dcfef634ad9150ee187da8172cff6845fe3 | [
"MIT"
] | 2 | 2018-11-10T17:06:36.000Z | 2018-12-19T23:47:26.000Z | mbam/parsing/base.py | danebjork/AutomatedMBAM | 91183dcfef634ad9150ee187da8172cff6845fe3 | [
"MIT"
] | 6 | 2018-05-16T21:06:34.000Z | 2019-01-14T22:23:15.000Z | mbam/parsing/base.py | danebjork/AutomatedMBAM | 91183dcfef634ad9150ee187da8172cff6845fe3 | [
"MIT"
] | 2 | 2018-11-14T13:30:55.000Z | 2019-01-14T20:49:15.000Z | import os
from sympy.printing import julia_code
from sympy import Symbol
import json
import logging
import re
class BaseParser:
"""Parent class for all model parsers.
"""
def __init__(self, mbam_model, data_path):
"""
Parameters
----------
mbam_model : ``mbammodel``
... | 34.580071 | 137 | 0.529793 | import os
from sympy.printing import julia_code
from sympy import Symbol
import json
import logging
import re
class BaseParser:
def __init__(self, mbam_model, data_path):
self.logger = logging.getLogger("MBAM.BaseParser")
self.logger.debug("Initializing BaseParser")
self.mm = mbam_model
... | true | true |
f71f93774042467cdcd4ca52abc67522df7b11cf | 649 | py | Python | intro-python/part2/structure.py | cobeam/DevNetRepo | d824bb6ad7d21bcae03485b571e97fc2b6b61df9 | [
"MIT"
] | 90 | 2018-04-07T00:39:23.000Z | 2020-06-09T02:44:02.000Z | intro-python/part2/structure.py | cobeam/DevNetRepo | d824bb6ad7d21bcae03485b571e97fc2b6b61df9 | [
"MIT"
] | 38 | 2018-04-06T18:11:36.000Z | 2020-05-11T23:36:24.000Z | intro-python/part2/structure.py | cobeam/DevNetRepo | d824bb6ad7d21bcae03485b571e97fc2b6b61df9 | [
"MIT"
] | 143 | 2018-04-20T00:17:24.000Z | 2020-06-12T15:07:42.000Z | #!/usr/bin/env python
"""Module docstring."""
# Imports
import os
import sys
# Module Constants
START_MESSAGE = "CLI Inspection Script"
# Module "Global" Variables
location = os.path.abspath(__file__)
# Module Functions and Classes
def main(*args):
"""My main script function.
Displays the full patch to... | 19.088235 | 78 | 0.694915 |
import os
import sys
START_MESSAGE = "CLI Inspection Script"
location = os.path.abspath(__file__)
def main(*args):
print(START_MESSAGE)
print("Script Location:", location)
print("Arguments Passed:", args)
if __name__ == '__main__':
_, *script_args = sys.argv
main(*script_args)
| true | true |
f71f943b61674db1e41754a8a4cbc52954162b47 | 10,921 | py | Python | setup.py | dineshsonachalam/atheris | 7c96c70056478b29d81d634b197c356f479fb6d7 | [
"Apache-2.0"
] | null | null | null | setup.py | dineshsonachalam/atheris | 7c96c70056478b29d81d634b197c356f479fb6d7 | [
"Apache-2.0"
] | null | null | null | setup.py | dineshsonachalam/atheris | 7c96c70056478b29d81d634b197c356f479fb6d7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC
# Copyright 2021 Fraunhofer FKIE
#
# 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.451104 | 228 | 0.672557 |
import os
import shutil
import subprocess
import sys
import tempfile
import setuptools
from setuptools import Extension
from setuptools import setup
from setuptools.command.build_ext import build_ext
__version__ = os.getenv("ATHERIS_VERSION", "1.0.11")
if len(sys.argv) > 1 and sys.argv[1] == "print_v... | true | true |
f71f94cc9ad067fb869ddb7fb431d9594d731530 | 361 | py | Python | fast_gui/core.py | asvcode/nbdev_test | e5bc1a1da28e7c5d87cbba0a207e016219644ee4 | [
"Apache-2.0"
] | 2 | 2020-06-04T08:38:00.000Z | 2020-07-15T15:42:13.000Z | fast_gui/core.py | asvcode/nbdev_test | e5bc1a1da28e7c5d87cbba0a207e016219644ee4 | [
"Apache-2.0"
] | 2 | 2021-09-28T03:23:17.000Z | 2022-02-26T08:14:46.000Z | fast_gui/core.py | asvcode/nbdev_test | e5bc1a1da28e7c5d87cbba0a207e016219644ee4 | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: 00_core.ipynb (unless otherwise specified).
__all__ = ['repeat_one']
# Cell
import ipywidgets as widgets
from fastai2.vision.all import*
from .dashboard_two import ds_choice
# Cell
def repeat_one(source, n=128):
"""Single image helper for displaying batch"""
return... | 27.769231 | 87 | 0.753463 |
__all__ = ['repeat_one']
import ipywidgets as widgets
from fastai2.vision.all import*
from .dashboard_two import ds_choice
def repeat_one(source, n=128):
return [get_image_files(ds_choice.source)[9]]*n | true | true |
f71f978be69f377fe3ca350b8404a8eecbbbb6b5 | 11,993 | py | Python | tests/contrib/falcon/test_suite.py | discord/dd-trace-py | 3f6bca078e751bf7459fd02b7aff7f96eff0eeb6 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tests/contrib/falcon/test_suite.py | discord/dd-trace-py | 3f6bca078e751bf7459fd02b7aff7f96eff0eeb6 | [
"Apache-2.0",
"BSD-3-Clause"
] | 3 | 2022-02-16T09:35:37.000Z | 2022-03-04T16:48:45.000Z | tests/contrib/falcon/test_suite.py | goodspark/dd-trace-py | e2089c7b348e9d1a70e01f96927d85a643d6ae56 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2022-02-11T16:34:22.000Z | 2022-02-11T16:34:22.000Z | from ddtrace import config
from ddtrace.constants import ANALYTICS_SAMPLE_RATE_KEY
from ddtrace.constants import ERROR_TYPE
from ddtrace.contrib.falcon.patch import FALCON_VERSION
from ddtrace.ext import http as httpx
from tests.opentracer.utils import init_tracer
from tests.utils import assert_is_measured
from tests.u... | 41.071918 | 117 | 0.650546 | from ddtrace import config
from ddtrace.constants import ANALYTICS_SAMPLE_RATE_KEY
from ddtrace.constants import ERROR_TYPE
from ddtrace.contrib.falcon.patch import FALCON_VERSION
from ddtrace.ext import http as httpx
from tests.opentracer.utils import init_tracer
from tests.utils import assert_is_measured
from tests.u... | true | true |
f71f98aa12c458b74228cfac53a00bd4f6d9a013 | 11,247 | py | Python | tensorflow/python/ops/standard_ops.py | noahl/tensorflow | b95d8cce7323d328565378e0d60d72603393f87d | [
"Apache-2.0"
] | 5 | 2018-09-22T20:16:46.000Z | 2022-02-28T10:35:19.000Z | tensorflow/python/ops/standard_ops.py | noahl/tensorflow | b95d8cce7323d328565378e0d60d72603393f87d | [
"Apache-2.0"
] | null | null | null | tensorflow/python/ops/standard_ops.py | noahl/tensorflow | b95d8cce7323d328565378e0d60d72603393f87d | [
"Apache-2.0"
] | 2 | 2019-08-14T09:04:37.000Z | 2022-02-02T20:08:02.000Z | # Copyright 2015 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... | 36.163987 | 93 | 0.767049 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys as _sys
from tensorflow.python.ops import array_grad
from tensorflow.python.ops import cudnn_rnn_grad
from tensorflow.python.ops import data_flow_grad
from tensorflow.python.ops i... | true | true |
f71f992d007cb05563bc79a20eaf79c8910f3047 | 7,240 | py | Python | run_scripts/FreeSurfer/nipype_reconall_with_tracker.py | neurodatascience/watts_up_compute | 1ed41e62690f99f699b44180208689cc19616bb7 | [
"MIT"
] | null | null | null | run_scripts/FreeSurfer/nipype_reconall_with_tracker.py | neurodatascience/watts_up_compute | 1ed41e62690f99f699b44180208689cc19616bb7 | [
"MIT"
] | null | null | null | run_scripts/FreeSurfer/nipype_reconall_with_tracker.py | neurodatascience/watts_up_compute | 1ed41e62690f99f699b44180208689cc19616bb7 | [
"MIT"
] | null | null | null | # Import modules
import os
import sys
from os.path import join as opj
import pandas as pd
import time
from nipype.interfaces.freesurfer import ReconAll
from nipype.interfaces.utility import IdentityInterface
from nipype.pipeline.engine import Workflow, Node
from pypapi import events, papi_high as high
import argparse
... | 36.938776 | 171 | 0.642403 |
import os
import sys
from os.path import join as opj
import pandas as pd
import time
from nipype.interfaces.freesurfer import ReconAll
from nipype.interfaces.utility import IdentityInterface
from nipype.pipeline.engine import Workflow, Node
from pypapi import events, papi_high as high
import argparse
from exper... | true | true |
f71f9baff849e1b3e85a4e00a676e11b093d2eb9 | 7,777 | py | Python | examples/vae.py | strint/myia | 3d00d3fb3df80ab7a264a724226c5f56c6ff1a8a | [
"MIT"
] | 222 | 2019-02-13T07:56:28.000Z | 2022-03-28T07:07:54.000Z | examples/vae.py | strint/myia | 3d00d3fb3df80ab7a264a724226c5f56c6ff1a8a | [
"MIT"
] | 107 | 2019-02-12T21:56:39.000Z | 2022-03-12T01:08:03.000Z | examples/vae.py | strint/myia | 3d00d3fb3df80ab7a264a724226c5f56c6ff1a8a | [
"MIT"
] | 27 | 2017-11-14T17:58:15.000Z | 2019-01-14T01:36:09.000Z | """Example of an MLP in Myia.
Myia is still a work in progress, and this example may change in the future.
"""
import time
from dataclasses import dataclass
import numpy
import torch
from numpy.random import RandomState
from torchvision import datasets, transforms
import myia.public_api as pub
from myia import Arit... | 26.542662 | 80 | 0.626077 |
import time
from dataclasses import dataclass
import numpy
import torch
from numpy.random import RandomState
from torchvision import datasets, transforms
import myia.public_api as pub
from myia import ArithmeticData, myia, value_and_grad
from myia.api import to_device
from myia.debug import traceback
from myia.ope... | true | true |
f71f9c72961197bdb094aca591c521ff5e6e78f6 | 2,944 | py | Python | scripts/cfg/cfg.py | jepler/aocl-libm-ose | 4033e022da428125747e118ccd6fdd9cee21c470 | [
"BSD-3-Clause"
] | 66 | 2020-11-04T17:06:10.000Z | 2022-03-10T08:03:12.000Z | scripts/cfg/cfg.py | HollowMan6/aocl-libm-ose | 4033e022da428125747e118ccd6fdd9cee21c470 | [
"BSD-3-Clause"
] | 8 | 2021-04-18T18:37:53.000Z | 2022-03-11T12:49:31.000Z | scripts/cfg/cfg.py | HollowMan6/aocl-libm-ose | 4033e022da428125747e118ccd6fdd9cee21c470 | [
"BSD-3-Clause"
] | 8 | 2020-11-09T03:45:01.000Z | 2021-11-08T02:25:31.000Z | #
# Copyright (C) 2008-2020 Advanced Micro Devices, Inc. All rights reserved.
#
# 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... | 41.464789 | 94 | 0.686481 |
from SCons.Variables import Variables as SVariables
from SCons.Script import AddOption
class LocalOption:
def __init__(self):
self.__help_texts = ""
pass
def Add(self, *args, **kwargs):
col_width = 30
help = " " + ", ".join(args)
if "help" in ... | true | true |
f71f9c7e66717452a4ba40fb6f3d1934e7331d68 | 7,731 | py | Python | sadedegel/bblock/vocabulary.py | GlobalMaksimum/sadedegel | 8e28dbeabc3bf0d6f2222089ac5e3a849f9d3a6b | [
"MIT"
] | 100 | 2020-07-06T05:50:49.000Z | 2022-03-21T21:56:55.000Z | sadedegel/bblock/vocabulary.py | LyotardPostmodernizm/sadedegel | 8e28dbeabc3bf0d6f2222089ac5e3a849f9d3a6b | [
"MIT"
] | 244 | 2020-07-06T06:31:01.000Z | 2022-02-26T10:40:17.000Z | sadedegel/bblock/vocabulary.py | LyotardPostmodernizm/sadedegel | 8e28dbeabc3bf0d6f2222089ac5e3a849f9d3a6b | [
"MIT"
] | 23 | 2020-07-27T16:32:48.000Z | 2022-03-18T11:13:07.000Z | import warnings
from collections import defaultdict
from os.path import dirname
from pathlib import Path
import h5py
import numpy as np
from cached_property import cached_property
from rich.console import Console
from .util import tr_lower, normalize_tokenizer_name
console = Console()
class InvalidTokenizer(Except... | 32.078838 | 144 | 0.56073 | import warnings
from collections import defaultdict
from os.path import dirname
from pathlib import Path
import h5py
import numpy as np
from cached_property import cached_property
from rich.console import Console
from .util import tr_lower, normalize_tokenizer_name
console = Console()
class InvalidTokenizer(Except... | true | true |
f71f9cca7a4b7ebe90d9da227393163bb8dccc2f | 215 | py | Python | employee_management/employee_management/doctype/category_module_info/test_category_module_info.py | Vivekananthan112599/Frappe-Vivek | 6a2b70c736e17e9748c6a30e5722341acfb3b5c5 | [
"MIT"
] | null | null | null | employee_management/employee_management/doctype/category_module_info/test_category_module_info.py | Vivekananthan112599/Frappe-Vivek | 6a2b70c736e17e9748c6a30e5722341acfb3b5c5 | [
"MIT"
] | null | null | null | employee_management/employee_management/doctype/category_module_info/test_category_module_info.py | Vivekananthan112599/Frappe-Vivek | 6a2b70c736e17e9748c6a30e5722341acfb3b5c5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2021, Gopi and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
import unittest
class TestCategoryModuleInfo(unittest.TestCase):
pass
| 19.545455 | 48 | 0.767442 |
from __future__ import unicode_literals
import unittest
class TestCategoryModuleInfo(unittest.TestCase):
pass
| true | true |
f71f9d8b86afa01dd3ceaf3a886e43128a317c40 | 600 | py | Python | sources/t05/t05ej12.py | workready/pythonbasic | 59bd82caf99244f5e711124e1f6f4dec8de22141 | [
"MIT"
] | null | null | null | sources/t05/t05ej12.py | workready/pythonbasic | 59bd82caf99244f5e711124e1f6f4dec8de22141 | [
"MIT"
] | null | null | null | sources/t05/t05ej12.py | workready/pythonbasic | 59bd82caf99244f5e711124e1f6f4dec8de22141 | [
"MIT"
] | null | null | null | import argparse
parser = argparse.ArgumentParser(description="Este programa calcula X^Y")
group = parser.add_mutually_exclusive_group()
group.add_argument("-v", "--verbose", action="store_true")
group.add_argument("-q", "--quiet", action="store_true")
parser.add_argument("x", type=int, help="la base")
parser.add_argum... | 33.333333 | 73 | 0.695 | import argparse
parser = argparse.ArgumentParser(description="Este programa calcula X^Y")
group = parser.add_mutually_exclusive_group()
group.add_argument("-v", "--verbose", action="store_true")
group.add_argument("-q", "--quiet", action="store_true")
parser.add_argument("x", type=int, help="la base")
parser.add_argum... | true | true |
f71f9dd0c9b57edc5e44757006a6fb2ad0870d9a | 8,176 | py | Python | open_spiel/python/examples/hearts_supervised_learning.py | xujing1994/open_spiel | 7663a2717f16ff84c0d6a6bfdf19a9c21b37b765 | [
"Apache-2.0"
] | null | null | null | open_spiel/python/examples/hearts_supervised_learning.py | xujing1994/open_spiel | 7663a2717f16ff84c0d6a6bfdf19a9c21b37b765 | [
"Apache-2.0"
] | 4 | 2020-11-13T18:59:55.000Z | 2022-02-10T02:08:27.000Z | open_spiel/python/examples/hearts_supervised_learning.py | xujing1994/open_spiel | 7663a2717f16ff84c0d6a6bfdf19a9c21b37b765 | [
"Apache-2.0"
] | 1 | 2020-12-25T03:01:37.000Z | 2020-12-25T03:01:37.000Z | # Copyright 2019 DeepMind Technologies Ltd. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 34.209205 | 80 | 0.689946 |
import os
import pickle
from typing import Any, Tuple
from absl import app
from absl import flags
import haiku as hk
import jax
from jax import numpy as jnp
from jax.experimental import optix
import numpy as np
import pyspiel
OptState = Any
Params = Any
FLAGS = flags.FLAGS
GAME = pyspiel.load_game(... | true | true |
f71f9e454eb33061bb98dbbfbd0ff5e4e58bf745 | 38,248 | py | Python | conda_build/render.py | scopatz/conda-build | dd74b17f4e7cb4286fe9a403895f9d34feb8e071 | [
"BSD-3-Clause"
] | null | null | null | conda_build/render.py | scopatz/conda-build | dd74b17f4e7cb4286fe9a403895f9d34feb8e071 | [
"BSD-3-Clause"
] | null | null | null | conda_build/render.py | scopatz/conda-build | dd74b17f4e7cb4286fe9a403895f9d34feb8e071 | [
"BSD-3-Clause"
] | null | null | null | # (c) Continuum Analytics, Inc. / http://continuum.io
# All Rights Reserved
#
# conda is distributed under the terms of the BSD 3-clause license.
# Consult LICENSE.txt or http://opensource.org/licenses/BSD-3-Clause.
from __future__ import absolute_import, division, print_function
from collections import OrderedDict, ... | 43.912744 | 115 | 0.616189 |
from __future__ import absolute_import, division, print_function
from collections import OrderedDict, defaultdict
from locale import getpreferredencoding
import json
import os
from os.path import isdir, isfile, abspath
import random
import re
import shutil
import string
import subprocess
import sys
import tarfil... | true | true |
f71fa02523d9f3e25a04474d5b9b67ff8827679a | 346 | py | Python | .history/routes_20200723125644.py | rkustas/taskmanager | 3218b277a235c4e8d30b1d548ba28be3ab3f628f | [
"MIT"
] | null | null | null | .history/routes_20200723125644.py | rkustas/taskmanager | 3218b277a235c4e8d30b1d548ba28be3ab3f628f | [
"MIT"
] | null | null | null | .history/routes_20200723125644.py | rkustas/taskmanager | 3218b277a235c4e8d30b1d548ba28be3ab3f628f | [
"MIT"
] | null | null | null | from app import app
from flask import render_template
import forms
# Basic route
@app.route('/')
@app.route('/index')
def index():
return render_template('index.html', current_title= 'Custom Title')
@app.route('/about', methods=['GET','POST'])
def about():
form = forms.AddTaskForm()
return render_templat... | 23.066667 | 71 | 0.702312 | from app import app
from flask import render_template
import forms
@app.route('/')
@app.route('/index')
def index():
return render_template('index.html', current_title= 'Custom Title')
@app.route('/about', methods=['GET','POST'])
def about():
form = forms.AddTaskForm()
return render_template('about.html... | true | true |
f71fa109caf8f0da6ce9758d0b1182b0c641a35c | 2,136 | py | Python | python/cuml/test/test_trustworthiness.py | efajardo-nv/cuml | bc86714836284ed4752c267513e5d447e884e1c5 | [
"Apache-2.0"
] | 3 | 2019-10-17T21:46:07.000Z | 2019-10-22T20:13:55.000Z | python/cuml/test/test_trustworthiness.py | efajardo-nv/cuml | bc86714836284ed4752c267513e5d447e884e1c5 | [
"Apache-2.0"
] | 1 | 2020-02-03T22:43:57.000Z | 2020-02-29T02:32:40.000Z | python/cuml/test/test_trustworthiness.py | efajardo-nv/cuml | bc86714836284ed4752c267513e5d447e884e1c5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018-2019, NVIDIA 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 agre... | 35.6 | 77 | 0.690543 |
import pytest
from sklearn.manifold.t_sne import trustworthiness as sklearn_trustworthiness
from cuml.metrics import trustworthiness as cuml_trustworthiness
from sklearn.datasets.samples_generator import make_blobs
from umap import UMAP
import cudf
import numpy as np
@pytest.mark.parametrize('input_ty... | true | true |
f71fa140056dc835bd2625ea657d951e01d571d7 | 7,163 | py | Python | bindings/python/ensmallen_graph/datasets/networkrepository/socfbucsc68.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/networkrepository/socfbucsc68.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/networkrepository/socfbucsc68.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | """
This file offers the methods to automatically retrieve the graph socfb-UCSC68.
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: 202... | 31.835556 | 103 | 0.668993 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen_graph import EnsmallenGraph
def SocfbUcsc68(
directed: bool = False,
verbose: int = 2,
cache_path: str = "graphs/networkrepository",
**additional_graph_kwargs: Dict
) -> EnsmallenGraph:
... | true | true |
f71fa2527a6d8ee637811cf737524b29b2058b63 | 8,210 | py | Python | var/spack/repos/builtin/packages/graphviz/package.py | varioustoxins/spack | cab0e4cb240f34891a6d753f3393e512f9a99e9a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/graphviz/package.py | varioustoxins/spack | cab0e4cb240f34891a6d753f3393e512f9a99e9a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 6 | 2022-01-08T08:41:11.000Z | 2022-03-14T19:28:07.000Z | var/spack/repos/builtin/packages/graphviz/package.py | foeroyingur/spack | 5300cbbb2e569190015c72d0970d25425ea38647 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import sys
from spack import *
from spack.operating_systems.mac_os import macos_version
MACOS_VERSION = macos_... | 43.439153 | 155 | 0.637881 |
import os
import sys
from spack import *
from spack.operating_systems.mac_os import macos_version
MACOS_VERSION = macos_version() if sys.platform == 'darwin' else None
class Graphviz(AutotoolsPackage):
homepage = 'http://www.graphviz.org'
git = 'https://gitlab.com/graphviz/graphviz.git'
url ... | true | true |
f71fa28fe37d5ad73815c67dfd54a10cbdef33d0 | 84,349 | py | Python | python/src/chirpstack_api/as_pb/external/api/application_pb2_grpc.py | maxreb/chirpstack-api | c591dd556e70b384318cdf61de19c0350715d61d | [
"MIT"
] | 55 | 2019-11-05T15:46:49.000Z | 2022-03-23T14:31:33.000Z | python/src/chirpstack_api/as_pb/external/api/application_pb2_grpc.py | maxreb/chirpstack-api | c591dd556e70b384318cdf61de19c0350715d61d | [
"MIT"
] | 39 | 2019-11-08T21:03:45.000Z | 2022-03-01T12:40:36.000Z | python/src/chirpstack_api/as_pb/external/api/application_pb2_grpc.py | maxreb/chirpstack-api | c591dd556e70b384318cdf61de19c0350715d61d | [
"MIT"
] | 101 | 2019-11-22T13:59:59.000Z | 2022-03-14T09:52:46.000Z | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from chirpstack_api.as_pb.external.api import application_pb2 as chirpstack__api_dot_as__pb_dot_external_dot_api_dot_application__pb2
from google.protobuf import... | 56.195203 | 176 | 0.719013 |
import grpc
from chirpstack_api.as_pb.external.api import application_pb2 as chirpstack__api_dot_as__pb_dot_external_dot_api_dot_application__pb2
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
class ApplicationServiceStub(object):
def __init__(self, channel):
self.Create = ... | true | true |
f71fa2a559498de7857b82dce82c2cf35e13d842 | 1,475 | py | Python | heterogeneous_client.py | samiul272/fed_ml_proj | 16b6ab0e8a5a5c8ca1a7c6636ec167238f63b31b | [
"MIT"
] | null | null | null | heterogeneous_client.py | samiul272/fed_ml_proj | 16b6ab0e8a5a5c8ca1a7c6636ec167238f63b31b | [
"MIT"
] | null | null | null | heterogeneous_client.py | samiul272/fed_ml_proj | 16b6ab0e8a5a5c8ca1a7c6636ec167238f63b31b | [
"MIT"
] | null | null | null | import logging
class HeterogeneousClient:
def __init__(self, client_idx, local_training_data, local_test_data, local_sample_number, args, device,
model_trainer):
self.client_idx = client_idx
self.local_training_data = local_training_data
self.local_test_data = local_test_... | 36.875 | 107 | 0.711864 | import logging
class HeterogeneousClient:
def __init__(self, client_idx, local_training_data, local_test_data, local_sample_number, args, device,
model_trainer):
self.client_idx = client_idx
self.local_training_data = local_training_data
self.local_test_data = local_test_... | true | true |
f71fa355b3f48d5c42b444b5071f36c04ba8f953 | 5,989 | py | Python | src/utils.py | SimonPerche/PersonalitiesWars | 495803a5be5e9fde572c3f39086d8a3510c75f58 | [
"MIT"
] | null | null | null | src/utils.py | SimonPerche/PersonalitiesWars | 495803a5be5e9fde572c3f39086d8a3510c75f58 | [
"MIT"
] | null | null | null | src/utils.py | SimonPerche/PersonalitiesWars | 495803a5be5e9fde572c3f39086d8a3510c75f58 | [
"MIT"
] | 1 | 2022-03-08T22:07:50.000Z | 2022-03-08T22:07:50.000Z | from typing import Dict, List, Optional, Union
import contextlib
import asyncio
import discord
from discord.ext import pages
from database import DatabasePersonality, DatabaseDeck
# Set authorized guilds for slash command (return [] for global command - might take up to 1h to register)
def get_authorized_guild_ids(... | 39.143791 | 152 | 0.688429 | from typing import Dict, List, Optional, Union
import contextlib
import asyncio
import discord
from discord.ext import pages
from database import DatabasePersonality, DatabaseDeck
def get_authorized_guild_ids():
return [550631040826343427]
async def personalities_name_searcher(ctx: discord.AutocompleteContex... | true | true |
f71fa39892b1a2c86c574196d784cf419690c32e | 449 | py | Python | app/commons/errorCodes.py | handdola/ai-chatbot | f0a336afb873db10b7a5f068b4e1eaa07bf62967 | [
"MIT"
] | 3 | 2017-12-27T19:29:27.000Z | 2018-01-07T02:51:44.000Z | app/commons/errorCodes.py | handdola/ai-chatbot | f0a336afb873db10b7a5f068b4e1eaa07bf62967 | [
"MIT"
] | 108 | 2018-03-26T05:44:22.000Z | 2020-12-14T15:08:38.000Z | app/commons/errorCodes.py | handdola/ai-chatbot | f0a336afb873db10b7a5f068b4e1eaa07bf62967 | [
"MIT"
] | 1 | 2019-05-30T10:50:49.000Z | 2019-05-30T10:50:49.000Z | emptyInput = {"errorCode": 601, "description": "empty input"}
InvalidInput = {"errorCode": 602, "description": "Invalid input"}
UnidentifiedIntent = {
"errorCode": 701,
"description": "Can't identify the intent"}
NotEnoughData = {
"errorCode": 702,
"description": "Not enough Training Data. Please Add m... | 34.538462 | 71 | 0.659243 | emptyInput = {"errorCode": 601, "description": "empty input"}
InvalidInput = {"errorCode": 602, "description": "Invalid input"}
UnidentifiedIntent = {
"errorCode": 701,
"description": "Can't identify the intent"}
NotEnoughData = {
"errorCode": 702,
"description": "Not enough Training Data. Please Add m... | true | true |
f71fa3cd63c33d94a24ea578cb181d5f2238b651 | 108,132 | py | Python | airflow/jobs.py | yujiantao/incubator-airflow | 97ac37d0b936fd565b113b79f418ff25b245de14 | [
"Apache-2.0"
] | 1 | 2020-05-03T04:34:08.000Z | 2020-05-03T04:34:08.000Z | airflow/jobs.py | yujiantao/incubator-airflow | 97ac37d0b936fd565b113b79f418ff25b245de14 | [
"Apache-2.0"
] | 4 | 2018-03-20T21:24:26.000Z | 2020-05-03T04:23:02.000Z | airflow/jobs.py | yujiantao/incubator-airflow | 97ac37d0b936fd565b113b79f418ff25b245de14 | [
"Apache-2.0"
] | 1 | 2018-10-23T08:58:10.000Z | 2018-10-23T08:58:10.000Z | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | 41.47756 | 104 | 0.558447 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import getpass
import logging
import multiprocessing
import os
import signal
import sys
import threading
import time
from collections import defaultdic... | true | true |
f71fa3db4ff531443af2a92cd1b1a2d567ddaf8d | 188 | py | Python | lightningrun.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | lightningrun.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | lightningrun.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | import os
os.system("git clone https://github.com/justteen/BUZZ-USERBOT /root/userbot && mkdir /root/userbot/bin/ && cd /root/userbot/ && chmod +x /usr/local/bin/* && python3 -m userbot")
| 62.666667 | 177 | 0.702128 | import os
os.system("git clone https://github.com/justteen/BUZZ-USERBOT /root/userbot && mkdir /root/userbot/bin/ && cd /root/userbot/ && chmod +x /usr/local/bin/* && python3 -m userbot")
| true | true |
f71fa5c1c650d81c5044415e020b232623ab58c2 | 37,109 | py | Python | src/m1_Line.py | chenx15rose/10-MoreImplementingClasses | 2bce636c73e968111c22bc245d90a596276d4679 | [
"MIT"
] | null | null | null | src/m1_Line.py | chenx15rose/10-MoreImplementingClasses | 2bce636c73e968111c22bc245d90a596276d4679 | [
"MIT"
] | null | null | null | src/m1_Line.py | chenx15rose/10-MoreImplementingClasses | 2bce636c73e968111c22bc245d90a596276d4679 | [
"MIT"
] | null | null | null | """
A simple Line class.
NOTE: This is NOT rosegraphics -- it is your OWN Line class.
Authors: David Mutchler, Vibha Alangar, Dave Fisher, Amanda Stouder,
their colleagues and Xiaolong Chen.
""" # DONE: 1. PUT YOUR NAME IN THE ABOVE LINE.
import math
import m1t_test_Line as m1t
########################... | 37.789206 | 97 | 0.487052 |
import math
import m1t_test_Line as m1t
| true | true |
f71fa77e0d385cdca5a886aa27031fa0a8e90b0c | 1,251 | py | Python | canary-dedup-groomer.py | open-cluster-management/canary-reporting | d97d49fb83e8e8d5e56b937261928285303e475e | [
"Apache-2.0"
] | null | null | null | canary-dedup-groomer.py | open-cluster-management/canary-reporting | d97d49fb83e8e8d5e56b937261928285303e475e | [
"Apache-2.0"
] | 35 | 2021-03-24T14:57:42.000Z | 2021-09-23T18:37:58.000Z | canary-dedup-groomer.py | open-cluster-management/canary-reporting | d97d49fb83e8e8d5e56b937261928285303e475e | [
"Apache-2.0"
] | 1 | 2021-08-02T14:26:55.000Z | 2021-08-02T14:26:55.000Z | import os, sys, json, db_utils
import pymysql
from github import Github, UnknownObjectException
from datetime import datetime
# Aligns all defects recorded in database with their github status
TABLE_NAME = "canary_issues"
c = None
conn = None
github_token=os.getenv('GITHUB_TOKEN')
github_org=os.getenv('GITHUB_ORG')
g... | 24.529412 | 66 | 0.710631 | import os, sys, json, db_utils
import pymysql
from github import Github, UnknownObjectException
from datetime import datetime
TABLE_NAME = "canary_issues"
c = None
conn = None
github_token=os.getenv('GITHUB_TOKEN')
github_org=os.getenv('GITHUB_ORG')
github_repo=os.getenv('GITHUB_REPO')
def query_github_status(defec... | true | true |
f71fa7d89da3839e79f74760543e4ed894dcc3ac | 3,351 | py | Python | imagr_images/tests.py | sazlin/cfpydev-imagr | e34ac025e357694f40034ab1c02ed3be5294c2d8 | [
"MIT"
] | null | null | null | imagr_images/tests.py | sazlin/cfpydev-imagr | e34ac025e357694f40034ab1c02ed3be5294c2d8 | [
"MIT"
] | null | null | null | imagr_images/tests.py | sazlin/cfpydev-imagr | e34ac025e357694f40034ab1c02ed3be5294c2d8 | [
"MIT"
] | null | null | null | from django.test import TestCase
from models import Photo, Album
from imagr_users.models import ImagrUser
from imagr_images.models import get_file_owner_username
from admin import PhotoAdmin, AlbumAdmin, ImageSizeListFilter
from django.core.urlresolvers import reverse
from django.contrib.admin.sites import AdminSite
im... | 37.651685 | 101 | 0.64906 | from django.test import TestCase
from models import Photo, Album
from imagr_users.models import ImagrUser
from imagr_images.models import get_file_owner_username
from admin import PhotoAdmin, AlbumAdmin, ImageSizeListFilter
from django.core.urlresolvers import reverse
from django.contrib.admin.sites import AdminSite
im... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.