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 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f73bf271bcf6b41568d091472a46e83b99a55918 | 417 | py | Python | torchsparse/nn/modules/crop.py | f-sky/torchsparse | 65466a10c6fa54bff17c6429706b7019a2a59409 | [
"MIT"
] | 1 | 2021-03-16T02:47:56.000Z | 2021-03-16T02:47:56.000Z | torchsparse/nn/modules/crop.py | f-sky/torchsparse | 65466a10c6fa54bff17c6429706b7019a2a59409 | [
"MIT"
] | null | null | null | torchsparse/nn/modules/crop.py | f-sky/torchsparse | 65466a10c6fa54bff17c6429706b7019a2a59409 | [
"MIT"
] | null | null | null | import torch
from torch import nn
from torchsparse.nn.functional import spcrop
__all__ = ['SparseCrop']
class SparseCrop(nn.Module):
def __init__(self, loc_min, loc_max):
super().__init__()
self.loc_min = torch.cuda.IntTensor([list(loc_min)])
self.loc_max = torch.cuda.IntTensor([list(loc_... | 26.0625 | 60 | 0.693046 | import torch
from torch import nn
from torchsparse.nn.functional import spcrop
__all__ = ['SparseCrop']
class SparseCrop(nn.Module):
def __init__(self, loc_min, loc_max):
super().__init__()
self.loc_min = torch.cuda.IntTensor([list(loc_min)])
self.loc_max = torch.cuda.IntTensor([list(loc_... | true | true |
f73bf2e03a18009163612bcd49527a1e50bbe4eb | 6,768 | py | Python | dqn_zoo/networks_test.py | khushjammu/dqn_zoo | 249af96717d605cc1a62fc2b69941881c9661249 | [
"Apache-2.0"
] | 3 | 2021-02-04T23:13:51.000Z | 2021-11-06T10:21:50.000Z | dqn_zoo/networks_test.py | khushjammu/dqn_zoo | 249af96717d605cc1a62fc2b69941881c9661249 | [
"Apache-2.0"
] | null | null | null | dqn_zoo/networks_test.py | khushjammu/dqn_zoo | 249af96717d605cc1a62fc2b69941881c9661249 | [
"Apache-2.0"
] | 1 | 2021-12-20T13:42:35.000Z | 2021-12-20T13:42:35.000Z | # Copyright 2019 DeepMind Technologies Limited. 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 ... | 38.896552 | 80 | 0.700502 |
import haiku as hk
import jax
from jax.config import config
import jax.numpy as jnp
import numpy as np
import tree
from dqn_zoo import networks
from absl.testing import absltest
def _sample_input(input_shape):
return jnp.zeros((1,) + input_shape, dtype=jnp.float32)
class SimpleLayersTest(absltes... | true | true |
f73bf43a853a72ce52ed11b2221e3d69c86939c4 | 72 | py | Python | pagebits/tests/__init__.py | nngroup/django-pagebits | 5580219de66ce5da1b3dda0e82fc32713153f0fc | [
"BSD-3-Clause"
] | 4 | 2016-04-10T13:17:26.000Z | 2019-03-12T17:18:59.000Z | pagebits/tests/__init__.py | nngroup/django-pagebits | 5580219de66ce5da1b3dda0e82fc32713153f0fc | [
"BSD-3-Clause"
] | null | null | null | pagebits/tests/__init__.py | nngroup/django-pagebits | 5580219de66ce5da1b3dda0e82fc32713153f0fc | [
"BSD-3-Clause"
] | 6 | 2015-03-27T15:50:46.000Z | 2017-03-09T18:05:47.000Z | from .models import *
from .views import *
from .templatetags import *
| 14.4 | 27 | 0.736111 | from .models import *
from .views import *
from .templatetags import *
| true | true |
f73bf45e888c263f9c6a0a064dddd9dc61be0e1d | 4,994 | py | Python | bench/sqlite3-search-bench.py | daq-tools/PyTables | 0949d41e611e6882a49248c6d82b1da9a994e788 | [
"BSD-3-Clause"
] | null | null | null | bench/sqlite3-search-bench.py | daq-tools/PyTables | 0949d41e611e6882a49248c6d82b1da9a994e788 | [
"BSD-3-Clause"
] | null | null | null | bench/sqlite3-search-bench.py | daq-tools/PyTables | 0949d41e611e6882a49248c6d82b1da9a994e788 | [
"BSD-3-Clause"
] | 2 | 2021-02-09T22:58:15.000Z | 2021-12-23T14:59:22.000Z | import os
import os.path
from time import perf_counter as clock
import numpy
import random
# in order to always generate the same random sequence
random.seed(19)
def fill_arrays(start, stop):
col_i = numpy.arange(start, stop, dtype=numpy.int32)
if userandom:
col_j = numpy.random.uniform(0, nrows, sto... | 26.284211 | 81 | 0.543452 | import os
import os.path
from time import perf_counter as clock
import numpy
import random
random.seed(19)
def fill_arrays(start, stop):
col_i = numpy.arange(start, stop, dtype=numpy.int32)
if userandom:
col_j = numpy.random.uniform(0, nrows, stop - start)
else:
col_j = numpy.array(col_i... | true | true |
f73bf4c22765ae3b9e4134953e252e8c4eeb07b1 | 158 | py | Python | kattis/heartrate.py | terror/Solutions | 1ad33daec95b565a38ac4730261593bcf249ac86 | [
"CC0-1.0"
] | 2 | 2021-04-05T14:26:37.000Z | 2021-06-10T04:22:01.000Z | kattis/heartrate.py | terror/Solutions | 1ad33daec95b565a38ac4730261593bcf249ac86 | [
"CC0-1.0"
] | null | null | null | kattis/heartrate.py | terror/Solutions | 1ad33daec95b565a38ac4730261593bcf249ac86 | [
"CC0-1.0"
] | null | null | null | for i in range(int(input())):
b, p = list(map(float, input().split()))
t = 60 / p
tt = t * b
print("{:.4f} {:.4f} {:.4f}".format(tt - t, tt, tt + t))
| 26.333333 | 58 | 0.481013 | for i in range(int(input())):
b, p = list(map(float, input().split()))
t = 60 / p
tt = t * b
print("{:.4f} {:.4f} {:.4f}".format(tt - t, tt, tt + t))
| true | true |
f73bf4cc862a2490edd9d343c95505e9bf67c7bb | 9,047 | py | Python | tests/test_filters.py | Outflier/PyAV | f3aa2336a9fddfc2ae46e15a26956da08153af7e | [
"BSD-3-Clause"
] | 965 | 2015-01-08T19:11:16.000Z | 2020-04-30T16:27:07.000Z | tests/test_filters.py | Outflier/PyAV | f3aa2336a9fddfc2ae46e15a26956da08153af7e | [
"BSD-3-Clause"
] | 542 | 2015-01-02T12:55:46.000Z | 2020-04-30T16:13:56.000Z | tests/test_filters.py | Outflier/PyAV | f3aa2336a9fddfc2ae46e15a26956da08153af7e | [
"BSD-3-Clause"
] | 211 | 2015-01-10T12:10:02.000Z | 2020-04-29T14:02:51.000Z | from fractions import Fraction
from unittest import SkipTest
import errno
import numpy as np
from av import AudioFrame, VideoFrame
from av.audio.frame import format_dtypes
from av.filter import Filter, Graph
import av
from .common import Image, TestCase, fate_suite
def generate_audio_frame(
frame_num, input_fo... | 31.522648 | 87 | 0.608378 | from fractions import Fraction
from unittest import SkipTest
import errno
import numpy as np
from av import AudioFrame, VideoFrame
from av.audio.frame import format_dtypes
from av.filter import Filter, Graph
import av
from .common import Image, TestCase, fate_suite
def generate_audio_frame(
frame_num, input_fo... | true | true |
f73bf4f126cc8565a9bbb1503b05b3157f9bdb04 | 1,491 | py | Python | extra_tests/ctypes_tests/test_numbers.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 333 | 2015-08-08T18:03:38.000Z | 2022-03-22T18:13:12.000Z | extra_tests/ctypes_tests/test_numbers.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 7 | 2020-02-16T16:49:05.000Z | 2021-11-26T09:00:56.000Z | extra_tests/ctypes_tests/test_numbers.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 55 | 2015-08-16T02:41:30.000Z | 2022-03-20T20:33:35.000Z | import pytest
from ctypes import *
unsigned_types = [c_ubyte, c_ushort, c_uint, c_ulong]
signed_types = [c_byte, c_short, c_int, c_long, c_longlong]
float_types = [c_double, c_float, c_longdouble]
try:
c_ulonglong
c_longlong
except NameError:
pass
else:
unsigned_types.append(c_ulonglong)
signed_t... | 26.157895 | 74 | 0.653253 | import pytest
from ctypes import *
unsigned_types = [c_ubyte, c_ushort, c_uint, c_ulong]
signed_types = [c_byte, c_short, c_int, c_long, c_longlong]
float_types = [c_double, c_float, c_longdouble]
try:
c_ulonglong
c_longlong
except NameError:
pass
else:
unsigned_types.append(c_ulonglong)
signed_t... | true | true |
f73bf56a0b43782ac33279b2ff8eddf191cc7b6c | 4,515 | py | Python | pyspedas/mms/particles/mms_part_getspec.py | shihikoo/pyspedas | 5251c52d074c4f2c3d91f2f8a457d36f3ad2ddb4 | [
"MIT"
] | null | null | null | pyspedas/mms/particles/mms_part_getspec.py | shihikoo/pyspedas | 5251c52d074c4f2c3d91f2f8a457d36f3ad2ddb4 | [
"MIT"
] | null | null | null | pyspedas/mms/particles/mms_part_getspec.py | shihikoo/pyspedas | 5251c52d074c4f2c3d91f2f8a457d36f3ad2ddb4 | [
"MIT"
] | null | null | null |
import logging
from time import time
import pyspedas
from pyspedas import time_double
from pyspedas.mms.particles.mms_part_products import mms_part_products
logging.captureWarnings(True)
logging.basicConfig(format='%(asctime)s: %(message)s', datefmt='%d-%b-%y %H:%M:%S', level=logging.INFO)
def mms_part_getspec(ins... | 39.955752 | 191 | 0.659579 |
import logging
from time import time
import pyspedas
from pyspedas import time_double
from pyspedas.mms.particles.mms_part_products import mms_part_products
logging.captureWarnings(True)
logging.basicConfig(format='%(asctime)s: %(message)s', datefmt='%d-%b-%y %H:%M:%S', level=logging.INFO)
def mms_part_getspec(ins... | true | true |
f73bf5fb08198debdf711452852fef0c042753b9 | 36,670 | py | Python | auth-api/tests/unit/services/test_user.py | thorwolpert/sbc-auth | 5da50cde2e5625d1b0ceea090c3656ee374c9b71 | [
"Apache-2.0"
] | 11 | 2019-09-26T06:58:25.000Z | 2022-01-26T06:19:39.000Z | auth-api/tests/unit/services/test_user.py | thorwolpert/sbc-auth | 5da50cde2e5625d1b0ceea090c3656ee374c9b71 | [
"Apache-2.0"
] | 1,622 | 2019-05-07T21:08:38.000Z | 2022-03-28T17:07:15.000Z | auth-api/tests/unit/services/test_user.py | thorwolpert/sbc-auth | 5da50cde2e5625d1b0ceea090c3656ee374c9b71 | [
"Apache-2.0"
] | 98 | 2019-03-01T21:36:15.000Z | 2021-12-01T22:11:25.000Z | # Copyright © 2019 Province of British Columbia
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 45.552795 | 118 | 0.74066 |
import json
from unittest.mock import patch
import pytest
from werkzeug.exceptions import HTTPException
from auth_api.exceptions import BusinessException
from auth_api.exceptions.errors import Error
from auth_api.models import Affiliation as AffiliationModel
from auth_api.models import ContactLink as Co... | true | true |
f73bf60adcc79b502502f15afba074b8a5426043 | 18,617 | py | Python | yfinance/base.py | rdiere/yfinance | 969eeb66b5bc98635aa0289c15a49246248910e4 | [
"Apache-2.0"
] | null | null | null | yfinance/base.py | rdiere/yfinance | 969eeb66b5bc98635aa0289c15a49246248910e4 | [
"Apache-2.0"
] | null | null | null | yfinance/base.py | rdiere/yfinance | 969eeb66b5bc98635aa0289c15a49246248910e4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Yahoo! Finance market data downloader (+fix for Pandas Datareader)
# https://github.com/ranaroussi/yfinance
#
# Copyright 2017-2019 Ran Aroussi
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the ... | 36.009671 | 84 | 0.556481 |
from __future__ import print_function
import time as _time
import datetime as _datetime
import requests as _requests
import pandas as _pd
import numpy as _np
try:
from urllib.parse import quote as urlencode
except ImportError:
from urllib import quote as urlencode
from . import utils
... | true | true |
f73bf6dcdd224c16a88b42698e13671d40775354 | 53,040 | py | Python | test/functional/feature_block.py | JoffreyBourdieux/ApsioCoin | 6573a9ab4e6e302f99d203fe0e1e414adb1fd349 | [
"MIT"
] | null | null | null | test/functional/feature_block.py | JoffreyBourdieux/ApsioCoin | 6573a9ab4e6e302f99d203fe0e1e414adb1fd349 | [
"MIT"
] | null | null | null | test/functional/feature_block.py | JoffreyBourdieux/ApsioCoin | 6573a9ab4e6e302f99d203fe0e1e414adb1fd349 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test block processing.
This reimplements tests from the bitcoinj/FullBlockTestGenerator used
by the pu... | 40.8 | 131 | 0.5454 |
from test_framework.test_framework import ComparisonTestFramework
from test_framework.util import *
from test_framework.comptool import TestManager, TestInstance, RejectResult
from test_framework.blocktools import *
import time
from test_framework.key import CECKey
from test_framework.script import *
from test_fra... | true | true |
f73bf710cd9d1456b44da0f6400136e906dc7444 | 11,494 | py | Python | lib/galaxy/files/__init__.py | rhpvorderman/galaxy | 178015f8eff0b0c7a59c0d6756658f6428222837 | [
"CC-BY-3.0"
] | 47 | 2015-10-21T23:30:30.000Z | 2022-03-09T06:51:32.000Z | lib/galaxy/files/__init__.py | rhpvorderman/galaxy | 178015f8eff0b0c7a59c0d6756658f6428222837 | [
"CC-BY-3.0"
] | 20 | 2015-09-30T18:56:40.000Z | 2019-04-12T19:32:59.000Z | lib/galaxy/files/__init__.py | rhpvorderman/galaxy | 178015f8eff0b0c7a59c0d6756658f6428222837 | [
"CC-BY-3.0"
] | 35 | 2015-10-30T13:09:40.000Z | 2021-05-03T23:17:46.000Z | import logging
import os
from collections import (
defaultdict,
namedtuple,
)
from galaxy import exceptions
from galaxy.util import (
plugin_config
)
log = logging.getLogger(__name__)
FileSourcePath = namedtuple('FileSourcePath', ['file_source', 'path'])
class ConfiguredFileSources:
"""Load plugins... | 38.831081 | 150 | 0.66339 | import logging
import os
from collections import (
defaultdict,
namedtuple,
)
from galaxy import exceptions
from galaxy.util import (
plugin_config
)
log = logging.getLogger(__name__)
FileSourcePath = namedtuple('FileSourcePath', ['file_source', 'path'])
class ConfiguredFileSources:
def __init__(s... | true | true |
f73bf8dbbefdfad519cdebbeddc7dbf2a4f595ae | 20,759 | py | Python | src/sage/rings/polynomial/pbori/gbcore.py | hsm207/sage | 020bd59ec28717bfab9af44d2231c53da1ff99f1 | [
"BSL-1.0"
] | 1 | 2021-10-18T01:24:04.000Z | 2021-10-18T01:24:04.000Z | src/sage/rings/polynomial/pbori/gbcore.py | hsm207/sage | 020bd59ec28717bfab9af44d2231c53da1ff99f1 | [
"BSL-1.0"
] | null | null | null | src/sage/rings/polynomial/pbori/gbcore.py | hsm207/sage | 020bd59ec28717bfab9af44d2231c53da1ff99f1 | [
"BSL-1.0"
] | null | null | null | from .nf import GeneratorLimitExceeded, symmGB_F2_C, symmGB_F2_python
from .PyPolyBoRi import (Monomial, Polynomial,
GroebnerStrategy, OrderCode, ll_red_nf_redsb)
from .ll import eliminate, ll_encode
from copy import copy
from itertools import chain
from .statistics import used_vars_set
from .h... | 30.983582 | 141 | 0.58736 | from .nf import GeneratorLimitExceeded, symmGB_F2_C, symmGB_F2_python
from .PyPolyBoRi import (Monomial, Polynomial,
GroebnerStrategy, OrderCode, ll_red_nf_redsb)
from .ll import eliminate, ll_encode
from copy import copy
from itertools import chain
from .statistics import used_vars_set
from .h... | true | true |
f73bfaa83b6b251ff6deddf45ecfca51a29d7b1e | 289 | py | Python | admin_helper/urls.py | truetug/django-admin-helper | a760725610243dedd36c903d4c7d30141e241890 | [
"MIT"
] | null | null | null | admin_helper/urls.py | truetug/django-admin-helper | a760725610243dedd36c903d4c7d30141e241890 | [
"MIT"
] | null | null | null | admin_helper/urls.py | truetug/django-admin-helper | a760725610243dedd36c903d4c7d30141e241890 | [
"MIT"
] | null | null | null | # encoding: utf-8
from django.conf.urls import patterns, url
from admin_helper.views import PopupView, SuggestView
urlpatterns = patterns(
'admin_helper.views',
url(r'^suggest/$', SuggestView.as_view(), name='suggest'),
url(r'^popup/$', PopupView.as_view(), name='popup')
)
| 24.083333 | 62 | 0.705882 |
from django.conf.urls import patterns, url
from admin_helper.views import PopupView, SuggestView
urlpatterns = patterns(
'admin_helper.views',
url(r'^suggest/$', SuggestView.as_view(), name='suggest'),
url(r'^popup/$', PopupView.as_view(), name='popup')
)
| true | true |
f73bfb19701981ec4b479660a9438d906fc3faea | 1,137 | py | Python | pandasread_csv_addheader.py | SecTraversl/python_pandas_Tools | 4b818c993e1587c150d8f94e0c8c6437516deee4 | [
"MIT"
] | null | null | null | pandasread_csv_addheader.py | SecTraversl/python_pandas_Tools | 4b818c993e1587c150d8f94e0c8c6437516deee4 | [
"MIT"
] | null | null | null | pandasread_csv_addheader.py | SecTraversl/python_pandas_Tools | 4b818c993e1587c150d8f94e0c8c6437516deee4 | [
"MIT"
] | null | null | null | # %%
#######################################
def pandasread_csv_addheader(csv_file: str, addheader: list):
"""Returns a pandas dataframe from the given .csv file. Assumes there is no header in the .csv and requires a header to be given as an argument to the 'addheader'.
Example:
>>> myheader = ['NAME'... | 40.607143 | 168 | 0.614776 | true | true | |
f73bfb9915a9103181b4cb12b36cafe4c81fcb2b | 1,803 | py | Python | test.py | hreshtaksensei/forexpy | 706f9f9ba7dd6ec83edd268b1b287d96db59b2cf | [
"MIT"
] | 1 | 2020-03-21T03:19:36.000Z | 2020-03-21T03:19:36.000Z | test.py | hreshtaksensei/forexpy | 706f9f9ba7dd6ec83edd268b1b287d96db59b2cf | [
"MIT"
] | null | null | null | test.py | hreshtaksensei/forexpy | 706f9f9ba7dd6ec83edd268b1b287d96db59b2cf | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""Usage:
test.py FILE
test.py -h --help
"""
import sys
import os.path
from docopt import docopt
from backtest.oanda_backtest import OandaBacktest
from logic.strategy import Strategy
from settings import CANDLES_MINUTES, MAX_PERCENTAGE_ACCOUNT_AT_RISK,\
STOP_LOSS, TRAILING_PERIOD, TAKE_PR... | 25.394366 | 70 | 0.645036 |
import sys
import os.path
from docopt import docopt
from backtest.oanda_backtest import OandaBacktest
from logic.strategy import Strategy
from settings import CANDLES_MINUTES, MAX_PERCENTAGE_ACCOUNT_AT_RISK,\
STOP_LOSS, TRAILING_PERIOD, TAKE_PROFIT, PLOT_RESULTS
from util.plot import Strategyplot
def plot_result... | true | true |
f73bfce54e54d377a8a966317f99d18fbadd3fa0 | 2,839 | py | Python | generative_models/lstm_hc/distribution_learner.py | MorganCThomas/MolScore | b12b7b5539bb3211982fc7a1b5938c0f383a05c0 | [
"MIT"
] | 28 | 2020-12-11T22:10:16.000Z | 2022-02-25T05:00:51.000Z | generative_models/lstm_hc/distribution_learner.py | MorganCThomas/MolScore | b12b7b5539bb3211982fc7a1b5938c0f383a05c0 | [
"MIT"
] | 3 | 2021-08-31T22:50:41.000Z | 2021-11-04T15:41:01.000Z | generative_models/lstm_hc/distribution_learner.py | MorganCThomas/MolScore | b12b7b5539bb3211982fc7a1b5938c0f383a05c0 | [
"MIT"
] | 9 | 2021-03-03T12:10:10.000Z | 2022-02-15T06:53:11.000Z | """
Adapted from guacamol_baselines https://github.com/BenevolentAI/guacamol_baselines
"""
import logging
from typing import List
import torch
#from guacamol.distribution_matching_generator import DistributionMatchingGenerator
from model import SmilesRnn
from trainer import SmilesRnnTrainer
from utils import get_ten... | 37.355263 | 107 | 0.638253 |
import logging
from typing import List
import torch
from model import SmilesRnn
from trainer import SmilesRnnTrainer
from utils import get_tensor_dataset, load_smiles_from_list, set_random_seed
from smiles_char_dict import SmilesCharDictionary
logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHand... | true | true |
f73bfdd51aa47da6aa7a3fd44829b3bad58f6c35 | 780 | py | Python | db/migrations/0023_auto_20210208_0838.py | matchd-ch/matchd-backend | 84be4aab1b4708cae50a8988301b15df877c8db0 | [
"Apache-2.0"
] | 1 | 2022-03-03T09:55:57.000Z | 2022-03-03T09:55:57.000Z | db/migrations/0023_auto_20210208_0838.py | matchd-ch/matchd-backend | 84be4aab1b4708cae50a8988301b15df877c8db0 | [
"Apache-2.0"
] | 7 | 2022-02-09T10:44:53.000Z | 2022-03-28T03:29:43.000Z | db/migrations/0023_auto_20210208_0838.py | matchd-ch/matchd-backend | 84be4aab1b4708cae50a8988301b15df877c8db0 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.1.5 on 2021-02-08 08:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('db', '0022_student_nickname'),
]
operations = [
migrations.AddField(
model_name='student',
name='field_of_study',
... | 26 | 74 | 0.571795 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('db', '0022_student_nickname'),
]
operations = [
migrations.AddField(
model_name='student',
name='field_of_study',
field=models.CharField(default='', ma... | true | true |
f73bfe76a3fb3b909b501dcb198eb297cef9e9fc | 5,979 | py | Python | vulnerabilities/tests/test_npm.py | InLaw/vulnerablecode | e93154ce15f577430dda18cabd1feb1dabc7230a | [
"Apache-2.0"
] | null | null | null | vulnerabilities/tests/test_npm.py | InLaw/vulnerablecode | e93154ce15f577430dda18cabd1feb1dabc7230a | [
"Apache-2.0"
] | null | null | null | vulnerabilities/tests/test_npm.py | InLaw/vulnerablecode | e93154ce15f577430dda18cabd1feb1dabc7230a | [
"Apache-2.0"
] | null | null | null | # Author: Navonil Das (@NavonilDas)
# Copyright (c) 2017 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/vulnerablecode/
# The VulnerableCode software is licensed under the Apache License version 2.0.
# Data generated with VulnerableCode require an acknowledgment.
#
# You may no... | 38.326923 | 98 | 0.676367 |
import json
import os
import shutil
import tempfile
from unittest.mock import patch
import zipfile
from django.test import TestCase
from vulnerabilities import models
from vulnerabilities.import_runner import ImportRunner
from vulnerabilities.package_managers import NpmVersionAPI
from vulnerabil... | true | true |
f73bff3f87ec54b155cbd3be7d85764e39c7a12b | 2,724 | py | Python | purge_files.py | darkrilin/gamemaker-slack-bot | 623489dddde37bad906dedb40ceda1335da9c90d | [
"MIT"
] | 1 | 2016-08-09T21:28:31.000Z | 2016-08-09T21:28:31.000Z | purge_files.py | darkrilin/gamemaker-slack-bot | 623489dddde37bad906dedb40ceda1335da9c90d | [
"MIT"
] | null | null | null | purge_files.py | darkrilin/gamemaker-slack-bot | 623489dddde37bad906dedb40ceda1335da9c90d | [
"MIT"
] | null | null | null | from urllib.parse import urlencode
from urllib.request import urlopen
from time import time
from json import load
from codecs import getreader
from os import environ
reader = getreader("utf-8")
token = environ['SLACK_TEST_TOKEN'] # Uses legacy test API token - TODO: This will need to be updated
days = 14 # Purge fi... | 27.24 | 104 | 0.605727 | from urllib.parse import urlencode
from urllib.request import urlopen
from time import time
from json import load
from codecs import getreader
from os import environ
reader = getreader("utf-8")
token = environ['SLACK_TEST_TOKEN']
days = 14
timestamp = int(time()) - days * 24 * 60 * 60
def list_files(slack_token... | true | true |
f73c01726f9d59c2094688ab60f9d16fd7fb8794 | 2,035 | py | Python | unix/linux/gnu/redhat.py | fmenabe/python-unix | 738907eddcdeece4be8c82f1d5604c296c94e49f | [
"MIT"
] | 7 | 2015-09-17T13:33:10.000Z | 2021-09-30T15:07:59.000Z | unix/linux/gnu/redhat.py | fmenabe/python-unix | 738907eddcdeece4be8c82f1d5604c296c94e49f | [
"MIT"
] | 3 | 2015-09-17T12:53:17.000Z | 2016-09-27T21:10:48.000Z | unix/linux/gnu/redhat.py | fmenabe/python-unix | 738907eddcdeece4be8c82f1d5604c296c94e49f | [
"MIT"
] | 4 | 2017-01-16T15:29:22.000Z | 2019-08-28T21:11:25.000Z | # -*- coding: utf-8 -*-
import re
import os
import unix
import weakref
from .. import Linux, Chroot, LinuxError
from unix.linux.services import Initd, Upstart, Systemd
DISTRIBS = ('RedHat', 'CentOS')
_CONFDIR = '/etc/sysconfig'
_NETFILE = os.path.join(_CONFDIR, 'network')
def RedHat(host, force=False):
unix.is... | 29.926471 | 61 | 0.55086 |
import re
import os
import unix
import weakref
from .. import Linux, Chroot, LinuxError
from unix.linux.services import Initd, Upstart, Systemd
DISTRIBS = ('RedHat', 'CentOS')
_CONFDIR = '/etc/sysconfig'
_NETFILE = os.path.join(_CONFDIR, 'network')
def RedHat(host, force=False):
unix.isvalid(host)
root =... | true | true |
f73c01b1bfd8189c29eab7f24401720eb6d2b7c0 | 507 | py | Python | src/_dependencies/lazy.py | dry-python/dependencies | 1a8bba41ab42d0b5249b36471f5300d9faba81e7 | [
"BSD-2-Clause"
] | 175 | 2018-07-21T13:04:44.000Z | 2020-05-27T15:31:06.000Z | src/_dependencies/lazy.py | proofit404/dependencies | 204e0cfadca801d64857f24aa4c74e7939ed9af0 | [
"BSD-2-Clause"
] | 325 | 2016-05-16T11:16:11.000Z | 2022-03-04T00:45:57.000Z | src/_dependencies/lazy.py | dry-python/dependencies | 1a8bba41ab42d0b5249b36471f5300d9faba81e7 | [
"BSD-2-Clause"
] | 18 | 2018-06-17T09:33:16.000Z | 2020-05-20T18:12:30.000Z | from _dependencies.graph import _Graph
class _LazyGraph:
def __init__(self, attrname, namespace):
self.attrname = attrname
self.namespace = namespace
def __get__(self, instance, owner):
graph = _Graph()
for base in reversed(owner.__bases__):
graph.update(base.__dep... | 29.823529 | 55 | 0.656805 | from _dependencies.graph import _Graph
class _LazyGraph:
def __init__(self, attrname, namespace):
self.attrname = attrname
self.namespace = namespace
def __get__(self, instance, owner):
graph = _Graph()
for base in reversed(owner.__bases__):
graph.update(base.__dep... | true | true |
f73c025048313646ffa657c41d4c35ef79bc7325 | 6,699 | py | Python | pageplot/plotmodel.py | JBorrow/pageplot | 8abad574fda476d26a59fc8b7d36da2838f2c11e | [
"MIT"
] | null | null | null | pageplot/plotmodel.py | JBorrow/pageplot | 8abad574fda476d26a59fc8b7d36da2838f2c11e | [
"MIT"
] | null | null | null | pageplot/plotmodel.py | JBorrow/pageplot | 8abad574fda476d26a59fc8b7d36da2838f2c11e | [
"MIT"
] | null | null | null | """
The base top-level plot model class.
From this all data and plotting flow.
"""
from pageplot.exceptions import PagePlotParserError
from pathlib import Path
from typing import Any, Optional, Dict, List, Union
from pageplot.extensionmodel import PlotExtension
from pageplot.extensions import built_in_extensions
fro... | 29.641593 | 86 | 0.618749 |
from pageplot.exceptions import PagePlotParserError
from pathlib import Path
from typing import Any, Optional, Dict, List, Union
from pageplot.extensionmodel import PlotExtension
from pageplot.extensions import built_in_extensions
from pageplot.io.spec import IOSpecification
from pageplot.config import GlobalConfig
f... | true | true |
f73c033c208b084d389d14b26d72c13c43b1378a | 1,148 | py | Python | jdxapi/routes/preview.py | jobdataexchange/jdx-api | 7815a6463de56423c3b4196648607c4ebe56828c | [
"Apache-2.0"
] | null | null | null | jdxapi/routes/preview.py | jobdataexchange/jdx-api | 7815a6463de56423c3b4196648607c4ebe56828c | [
"Apache-2.0"
] | 9 | 2019-12-26T17:39:58.000Z | 2022-01-13T01:59:49.000Z | jdxapi/routes/preview.py | jobdataexchange/jdx-api | 7815a6463de56423c3b4196648607c4ebe56828c | [
"Apache-2.0"
] | null | null | null | from flask import request, jsonify
from jdxapi.utils.logger_resource import LoggerResource
from jdxapi.app import api, DB
from jdxapi.models import Pipeline
from jdxapi.utils.functions import RequestHandler, ResponseHandler
from jdxapi.utils.error import ApiError
from sqlalchemy.orm.exc import NoResultFound, MultipleRe... | 32.8 | 77 | 0.736063 | from flask import request, jsonify
from jdxapi.utils.logger_resource import LoggerResource
from jdxapi.app import api, DB
from jdxapi.models import Pipeline
from jdxapi.utils.functions import RequestHandler, ResponseHandler
from jdxapi.utils.error import ApiError
from sqlalchemy.orm.exc import NoResultFound, MultipleRe... | true | true |
f73c03827b72ef05b689c636777a89325d1163bc | 43,779 | py | Python | moto/sns/responses.py | thomassross/moto | 407d5c853dbee9b9e132d97b41414b7dca475765 | [
"Apache-2.0"
] | 1 | 2021-12-12T04:23:06.000Z | 2021-12-12T04:23:06.000Z | moto/sns/responses.py | thomassross/moto | 407d5c853dbee9b9e132d97b41414b7dca475765 | [
"Apache-2.0"
] | 4 | 2017-09-30T07:52:52.000Z | 2021-12-13T06:56:55.000Z | moto/sns/responses.py | thomassross/moto | 407d5c853dbee9b9e132d97b41414b7dca475765 | [
"Apache-2.0"
] | 2 | 2021-11-24T08:05:43.000Z | 2021-11-25T16:18:48.000Z | from __future__ import unicode_literals
import json
import re
from collections import defaultdict
from moto.core.responses import BaseResponse
from moto.core.utils import camelcase_to_underscores
from .models import sns_backends
from .exceptions import InvalidParameterValue, SNSNotFoundError
from .utils import is_e164... | 37.163837 | 146 | 0.595856 | from __future__ import unicode_literals
import json
import re
from collections import defaultdict
from moto.core.responses import BaseResponse
from moto.core.utils import camelcase_to_underscores
from .models import sns_backends
from .exceptions import InvalidParameterValue, SNSNotFoundError
from .utils import is_e164... | true | true |
f73c03fdca9ef3303bbf4e974345b850baa55803 | 17,383 | py | Python | sdk/python/pulumi_azure_native/network/latest/vpn_server_configuration.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/latest/vpn_server_configuration.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/latest/vpn_server_configuration.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 57.180921 | 1,813 | 0.712075 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
from ._enums import *
from ._inputs import *
__all__ = ['VpnServerConfiguration']
warnings.warn("""The 'latest' version is deprecated. Please mig... | true | true |
f73c04c3a1d478e20e01cd911a0674b41ed26288 | 18,969 | py | Python | unrestricted-advex/unrestricted_advex/attacks.py | fdcck/unrestricted-adversarial-examples | 125a21d2073308df05ad2dfaf4f9c58ec749b3e4 | [
"Apache-2.0"
] | 1 | 2018-10-08T10:11:51.000Z | 2018-10-08T10:11:51.000Z | unrestricted-advex/unrestricted_advex/attacks.py | fdcck/unrestricted-adversarial-examples | 125a21d2073308df05ad2dfaf4f9c58ec749b3e4 | [
"Apache-2.0"
] | null | null | null | unrestricted-advex/unrestricted_advex/attacks.py | fdcck/unrestricted-adversarial-examples | 125a21d2073308df05ad2dfaf4f9c58ec749b3e4 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import multiprocessing
import random
from itertools import product, repeat
import numpy as np
import tensorflow as tf
from cleverhans.attacks import SPSA
from cleverhans.model import Model
from foolbox.attacks... | 33.455026 | 97 | 0.664611 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import multiprocessing
import random
from itertools import product, repeat
import numpy as np
import tensorflow as tf
from cleverhans.attacks import SPSA
from cleverhans.model import Model
from foolbox.attacks... | true | true |
f73c04f5cde18f43d9effdd9b7c06fb277ff3e0a | 400 | py | Python | sdl2/api.py | vaiorabbit/python-sdl2 | 77b4ce73d83d19dedc943ae7f56ee6f73f62ecad | [
"Zlib"
] | 1 | 2018-03-12T01:54:40.000Z | 2018-03-12T01:54:40.000Z | sdl2/api.py | vaiorabbit/python-sdl2 | 77b4ce73d83d19dedc943ae7f56ee6f73f62ecad | [
"Zlib"
] | null | null | null | sdl2/api.py | vaiorabbit/python-sdl2 | 77b4ce73d83d19dedc943ae7f56ee6f73f62ecad | [
"Zlib"
] | null | null | null | SDL2_LOADER = None
SDL2_TTF_LOADER = None
SDL2_IMG_LOADER = None
SDL2_GFX_LOADER = None
SDL2_API_NAMES = []
SDL2_API_ARGS_MAP = {}
SDL2_API_RETVAL_MAP = {}
SDL2_TTF_API_NAMES = []
SDL2_TTF_API_ARGS_MAP = {}
SDL2_TTF_API_RETVAL_MAP = {}
SDL2_IMG_API_NAMES = []
SDL2_IMG_API_ARGS_MAP = {}
SDL2_IMG_API_RETVAL_MAP = {}
... | 19.047619 | 28 | 0.77 | SDL2_LOADER = None
SDL2_TTF_LOADER = None
SDL2_IMG_LOADER = None
SDL2_GFX_LOADER = None
SDL2_API_NAMES = []
SDL2_API_ARGS_MAP = {}
SDL2_API_RETVAL_MAP = {}
SDL2_TTF_API_NAMES = []
SDL2_TTF_API_ARGS_MAP = {}
SDL2_TTF_API_RETVAL_MAP = {}
SDL2_IMG_API_NAMES = []
SDL2_IMG_API_ARGS_MAP = {}
SDL2_IMG_API_RETVAL_MAP = {}
... | true | true |
f73c05c915497a74bf280bc0b4d01be5e6526e40 | 780 | py | Python | hikvision.py | simpletask1/video_stream | 984f24feb38c778e225d24771c6246577b94e614 | [
"Apache-2.0"
] | null | null | null | hikvision.py | simpletask1/video_stream | 984f24feb38c778e225d24771c6246577b94e614 | [
"Apache-2.0"
] | null | null | null | hikvision.py | simpletask1/video_stream | 984f24feb38c778e225d24771c6246577b94e614 | [
"Apache-2.0"
] | null | null | null | import threading
import traceback
from camera.sdk_gige_hikvision.GrabImage import MVS_Cam # 工业相机SDK读流
class hikCamera(threading.Thread):
def __init__(self, ip_name):
threading.Thread.__init__(self)
self.ip_name = ip_name
# 初始化摄像头
self.device_camera = MVS_Cam(self.ip_name)
... | 24.375 | 69 | 0.544872 | import threading
import traceback
from camera.sdk_gige_hikvision.GrabImage import MVS_Cam
class hikCamera(threading.Thread):
def __init__(self, ip_name):
threading.Thread.__init__(self)
self.ip_name = ip_name
self.device_camera = MVS_Cam(self.ip_name)
def run(self):
... | true | true |
f73c06db0b64a1edcd6aa27780845c92273e5b41 | 3,273 | py | Python | test/travis_test_motors.py | Kageken/pimouse_ros | 97f289755506c53e238d8aa9b331ad449aec0301 | [
"BSD-3-Clause"
] | null | null | null | test/travis_test_motors.py | Kageken/pimouse_ros | 97f289755506c53e238d8aa9b331ad449aec0301 | [
"BSD-3-Clause"
] | null | null | null | test/travis_test_motors.py | Kageken/pimouse_ros | 97f289755506c53e238d8aa9b331ad449aec0301 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#encoding: utf8
import unittest, rostest
import rosnode, rospy
import time
from pimouse_ros.msg import MotorFreqs
from geometry_msgs.msg import Twist
from std_srvs.srv import Trigger, TriggerResponse #追加
from pimouse_ros.srv import TimedMotion
class MotorTest(unittest.TestCase):
def setUp(se... | 38.05814 | 111 | 0.629086 |
import unittest, rostest
import rosnode, rospy
import time
from pimouse_ros.msg import MotorFreqs
from geometry_msgs.msg import Twist
from std_srvs.srv import Trigger, TriggerResponse
from pimouse_ros.srv import TimedMotion
class MotorTest(unittest.TestCase):
def setUp(self):
... | true | true |
f73c0705e1774ed3975ef5197b448f467103f19d | 13,332 | py | Python | source/winKernel.py | SWEN-712/screen-reader-brandonp728 | e30c25ad2d10ce632fac0548696a61a872328f59 | [
"bzip2-1.0.6"
] | null | null | null | source/winKernel.py | SWEN-712/screen-reader-brandonp728 | e30c25ad2d10ce632fac0548696a61a872328f59 | [
"bzip2-1.0.6"
] | null | null | null | source/winKernel.py | SWEN-712/screen-reader-brandonp728 | e30c25ad2d10ce632fac0548696a61a872328f59 | [
"bzip2-1.0.6"
] | null | null | null | #winKernel.py
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2006-2019 NV Access Limited, Rui Batista, Aleksey Sadovoy, Peter Vagner, Mozilla Corporation, Babbage B.V., Joseph Lee
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
"""Functions that wrap Windows ... | 32.048077 | 238 | 0.779853 |
import contextlib
import ctypes
import ctypes.wintypes
from ctypes import WinError
from ctypes import *
from ctypes.wintypes import *
kernel32=ctypes.windll.kernel32
advapi32 = windll.advapi32
INFINITE = 0xffffffff
PROCESS_ALL_ACCESS=0x1F0FFF
PROCESS_TERMINATE=0x1
PROCESS_VM_OPERATION=0x8
PROCESS_VM_READ=0x1... | true | true |
f73c075a61d79912547acd84cbcd6608b85abf86 | 7,856 | py | Python | tests/katsu_tests/test_authx_diagnoses.py | CanDIG/rego_development_playground | 75ba1aa9895f6d949e4ab80f51bfc474895eb304 | [
"Apache-2.0"
] | null | null | null | tests/katsu_tests/test_authx_diagnoses.py | CanDIG/rego_development_playground | 75ba1aa9895f6d949e4ab80f51bfc474895eb304 | [
"Apache-2.0"
] | 4 | 2021-06-04T21:34:18.000Z | 2021-11-17T19:23:46.000Z | tests/katsu_tests/test_authx_diagnoses.py | CanDIG/rego_development_playground | 75ba1aa9895f6d949e4ab80f51bfc474895eb304 | [
"Apache-2.0"
] | null | null | null | from test_helpers import helper_get_katsu_response
from test_helpers import helper_get_user_token
import pytest
"""
This test suite will cover the manual testsfor KATSU in README.md, ensuring that
authorization happens correctly
- beacon permissions
- registered/controlled access
- modified but live token
"""
KATSU_U... | 36.37037 | 95 | 0.710412 | from test_helpers import helper_get_katsu_response
from test_helpers import helper_get_user_token
import pytest
KATSU_URL="http://localhost:8001"
OIDC1_NAME="oidc1"
OIDC2_NAME="oidc2"
@pytest.fixture(scope="session")
def user1_token():
return helper_get_user_token("user1", "pass1")
def test_user1_diagnoses_acc... | true | true |
f73c076c09cd5d3e41014423f1a1b4021464aba5 | 7,344 | py | Python | settings/common.py | TroJan/EvalAI | e378c5d6fd6a2f5d1ec020198eeae5d17793952f | [
"BSD-3-Clause"
] | null | null | null | settings/common.py | TroJan/EvalAI | e378c5d6fd6a2f5d1ec020198eeae5d17793952f | [
"BSD-3-Clause"
] | null | null | null | settings/common.py | TroJan/EvalAI | e378c5d6fd6a2f5d1ec020198eeae5d17793952f | [
"BSD-3-Clause"
] | 1 | 2020-01-15T17:27:02.000Z | 2020-01-15T17:27:02.000Z | """
Django settings for evalai project.
Generated by 'django-admin startproject' using Django 1.10.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import dat... | 26.608696 | 99 | 0.6314 |
import datetime
import os
import sys
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
APPS_DIR = os.path.join(BASE_DIR, 'apps')
sys.path.append(APPS_DIR)
SECRET_KEY = os.environ.get('SECRET_KEY', 'random_secret_key')
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
DEFAULT_A... | true | true |
f73c07bc944c352b0b9d234240f626e277e39eaf | 3,705 | py | Python | openstack_dashboard/theme_settings.py | ankur-gupta91/block_storage | 938548a3d4507dc56c1c26b442767eb41aa2e610 | [
"Apache-2.0"
] | 9 | 2016-06-03T03:53:24.000Z | 2017-05-20T16:53:23.000Z | openstack_dashboard/theme_settings.py | ankur-gupta91/block_storage | 938548a3d4507dc56c1c26b442767eb41aa2e610 | [
"Apache-2.0"
] | 12 | 2022-03-22T07:28:29.000Z | 2022-03-22T07:29:55.000Z | openstack_dashboard/theme_settings.py | ankur-gupta91/block_storage | 938548a3d4507dc56c1c26b442767eb41aa2e610 | [
"Apache-2.0"
] | 4 | 2016-08-01T10:50:15.000Z | 2017-02-22T12:11:19.000Z | # Copyright 2016 Hewlett Packard Enterprise Software, LLC
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 35.625 | 78 | 0.647233 |
import logging
import os
from django.utils.translation import pgettext_lazy
def get_theme_static_dirs(available_themes, collection_dir, root):
static_dirs = []
for theme in available_themes:
theme_name, theme_label, theme_path = theme
theme_url = os.path.join(collection_d... | true | true |
f73c07caec4ae8a0fc91ef1c9848cf2ff5d8a5d1 | 120 | py | Python | test_output/for_loop.py | roshangol/executed-path-visualize | 1759c12b0048fe117205990b151d2f5f57ad9616 | [
"MIT"
] | null | null | null | test_output/for_loop.py | roshangol/executed-path-visualize | 1759c12b0048fe117205990b151d2f5f57ad9616 | [
"MIT"
] | null | null | null | test_output/for_loop.py | roshangol/executed-path-visualize | 1759c12b0048fe117205990b151d2f5f57ad9616 | [
"MIT"
] | null | null | null | lst = [1, 2, 3, 4, 5]
for i in range(len(lst)):
print(lst[i], end=" ")
for j in range(0, 10):
print(j, end=" ") | 20 | 26 | 0.5 | lst = [1, 2, 3, 4, 5]
for i in range(len(lst)):
print(lst[i], end=" ")
for j in range(0, 10):
print(j, end=" ") | true | true |
f73c09d1298a19e2c65689de3b32ae95532ab4b1 | 516 | py | Python | alg_insertion_sort.py | lukes1582/algoritmi | 3313c9ae3cb5f9f0c410ca86ea29e23cb1c3c8fd | [
"Apache-2.0"
] | null | null | null | alg_insertion_sort.py | lukes1582/algoritmi | 3313c9ae3cb5f9f0c410ca86ea29e23cb1c3c8fd | [
"Apache-2.0"
] | null | null | null | alg_insertion_sort.py | lukes1582/algoritmi | 3313c9ae3cb5f9f0c410ca86ea29e23cb1c3c8fd | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""
l0m1s
lukes1582@gmail.com
algoritmo insertion sort sviluppato per Python
"""
arr = [5,4,3,1,2,11,9,8,0]
print("Array in origine ")
print(arr)
print ("Lunghezza dell'array "+ str(len(arr)))
print(50*"x")
for i in range(1, len(arr)):
key = arr[i]
j = i-1
while ... | 18.428571 | 47 | 0.546512 |
arr = [5,4,3,1,2,11,9,8,0]
print("Array in origine ")
print(arr)
print ("Lunghezza dell'array "+ str(len(arr)))
print(50*"x")
for i in range(1, len(arr)):
key = arr[i]
j = i-1
while j >=0 and key < arr[j] :
arr[j+1] = arr[j]
j -= 1
arr[j+1] = key
print ("l'... | true | true |
f73c0a14a8a12842479a4ecfabd7ba1529fc1b0a | 19,243 | py | Python | py/test/fixture/whale/host/interrupt_handler.py | arccode/factory | a1b0fccd68987d8cd9c89710adc3c04b868347ec | [
"BSD-3-Clause"
] | 3 | 2022-01-06T16:52:52.000Z | 2022-03-07T11:30:47.000Z | py/test/fixture/whale/host/interrupt_handler.py | arccode/factory | a1b0fccd68987d8cd9c89710adc3c04b868347ec | [
"BSD-3-Clause"
] | null | null | null | py/test/fixture/whale/host/interrupt_handler.py | arccode/factory | a1b0fccd68987d8cd9c89710adc3c04b868347ec | [
"BSD-3-Clause"
] | 1 | 2021-10-24T01:47:22.000Z | 2021-10-24T01:47:22.000Z | #!/usr/bin/env python3
#
# Copyright 2014 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Handles Whale's button click event."""
import argparse
import functools
import logging
import os
import re
import sys
import ... | 37.657534 | 80 | 0.686276 |
import argparse
import functools
import logging
import os
import re
import sys
import time
from cros.factory.test.fixture.whale import keyboard_emulator
from cros.factory.test.fixture.whale import serial_client
from cros.factory.test.fixture.whale import servo_client
from cros.factory.utils import gpio_utils
fr... | true | true |
f73c0a586407cfff97d64e2d1de431ef07e72d15 | 1,071 | py | Python | proof_of_work/multiagent/turn_based/v4/selfishagentv4.py | michaelneuder/parkes_lab_fa19 | 18d9f564e0df9c17ac5d54619ed869d778d4f6a4 | [
"MIT"
] | null | null | null | proof_of_work/multiagent/turn_based/v4/selfishagentv4.py | michaelneuder/parkes_lab_fa19 | 18d9f564e0df9c17ac5d54619ed869d778d4f6a4 | [
"MIT"
] | null | null | null | proof_of_work/multiagent/turn_based/v4/selfishagentv4.py | michaelneuder/parkes_lab_fa19 | 18d9f564e0df9c17ac5d54619ed869d778d4f6a4 | [
"MIT"
] | null | null | null | import numpy as np
class SelfishAgent(object):
def __init__(self, T):
self.T = T
self.policy = np.asarray([
[0, 0, 0, 0, 0, 0, 0, 0, 0],
[2, 2, 2, 0, 0, 0, 0, 0, 0],
[2, 1, 2, 2, 2, 0, 0, 0, 0],
[2, 2, 1, 2, 2, 2, 0, 0, 0],
[2, 2, 2, 1... | 26.775 | 41 | 0.356676 | import numpy as np
class SelfishAgent(object):
def __init__(self, T):
self.T = T
self.policy = np.asarray([
[0, 0, 0, 0, 0, 0, 0, 0, 0],
[2, 2, 2, 0, 0, 0, 0, 0, 0],
[2, 1, 2, 2, 2, 0, 0, 0, 0],
[2, 2, 1, 2, 2, 2, 0, 0, 0],
[2, 2, 2, 1... | true | true |
f73c0a90b7cbe4e9e76241af7bc20068d063d698 | 2,829 | py | Python | openpnm/geometry/_generic.py | lixuekai2001/OpenPNM | 9026f0fed427d37f4caf1a79e4a7684490d52cf6 | [
"MIT"
] | null | null | null | openpnm/geometry/_generic.py | lixuekai2001/OpenPNM | 9026f0fed427d37f4caf1a79e4a7684490d52cf6 | [
"MIT"
] | null | null | null | openpnm/geometry/_generic.py | lixuekai2001/OpenPNM | 9026f0fed427d37f4caf1a79e4a7684490d52cf6 | [
"MIT"
] | null | null | null | from copy import deepcopy
from openpnm.core import Subdomain, ModelsMixin, ParamMixin
from openpnm.utils import Docorator, SettingsAttr
from openpnm.utils import Workspace, logging
logger = logging.getLogger(__name__)
ws = Workspace()
docstr = Docorator()
@docstr.get_sections(base='GeometrySettings', sections=['Param... | 32.517241 | 79 | 0.634853 | from copy import deepcopy
from openpnm.core import Subdomain, ModelsMixin, ParamMixin
from openpnm.utils import Docorator, SettingsAttr
from openpnm.utils import Workspace, logging
logger = logging.getLogger(__name__)
ws = Workspace()
docstr = Docorator()
@docstr.get_sections(base='GeometrySettings', sections=['Param... | true | true |
f73c0ac78aaa312b971829759014cfbdc0a448ff | 1,652 | py | Python | xos/synchronizer/migration/0012_auto_20200227_1323.py | etrirepo/olt_synchronizer | 493d20a2e404fe7aeca73eaa6d4bb18275faf4ec | [
"Apache-2.0"
] | null | null | null | xos/synchronizer/migration/0012_auto_20200227_1323.py | etrirepo/olt_synchronizer | 493d20a2e404fe7aeca73eaa6d4bb18275faf4ec | [
"Apache-2.0"
] | null | null | null | xos/synchronizer/migration/0012_auto_20200227_1323.py | etrirepo/olt_synchronizer | 493d20a2e404fe7aeca73eaa6d4bb18275faf4ec | [
"Apache-2.0"
] | null | null | null | # Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 34.416667 | 185 | 0.676755 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('volt', '0011_auto_20190626_2027'),
]
operations = [
migrations.RemoveField(
model_name='voltservice_decl',
n... | true | true |
f73c0bae41c8dfc2d32ba13db9a1bf05b21cd322 | 2,793 | py | Python | qiskit/extensions/standard/u2.py | qinvador/qiskit-terra | 4e104de3c113c01688a0ed06b2f2cb1a958fce44 | [
"Apache-2.0"
] | 2 | 2019-06-28T19:58:42.000Z | 2019-07-26T05:04:02.000Z | qiskit/extensions/standard/u2.py | qinvador/qiskit-terra | 4e104de3c113c01688a0ed06b2f2cb1a958fce44 | [
"Apache-2.0"
] | 3 | 2018-11-13T17:33:37.000Z | 2018-12-03T09:35:00.000Z | qiskit/extensions/standard/u2.py | qinvador/qiskit-terra | 4e104de3c113c01688a0ed06b2f2cb1a958fce44 | [
"Apache-2.0"
] | 2 | 2017-12-03T15:48:14.000Z | 2018-03-11T13:08:03.000Z | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modif... | 28.793814 | 89 | 0.595059 |
import numpy
from qiskit.circuit import Gate
from qiskit.circuit import QuantumCircuit
from qiskit.circuit import QuantumRegister
from qiskit.qasm import pi
from qiskit.util import deprecate_arguments
class U2Gate(Gate):
def __init__(self, phi, lam, label=None):
super().__init__('u2', 1, [p... | true | true |
f73c0c5783bcd381970f18749f58281f9fcb878f | 5,107 | py | Python | export_weekly_ad_contacts.py | AfricasVoices/Project-WUSC-LEAP-II | 76fa04a92c352483abd2e6b696bd0af26eea517a | [
"MIT"
] | null | null | null | export_weekly_ad_contacts.py | AfricasVoices/Project-WUSC-LEAP-II | 76fa04a92c352483abd2e6b696bd0af26eea517a | [
"MIT"
] | null | null | null | export_weekly_ad_contacts.py | AfricasVoices/Project-WUSC-LEAP-II | 76fa04a92c352483abd2e6b696bd0af26eea517a | [
"MIT"
] | null | null | null | import argparse
import csv
import importlib
from core_data_modules.cleaners import Codes
from core_data_modules.logging import Logger
from core_data_modules.traced_data.io import TracedDataJsonIO
from src.engagement_db_to_analysis.membership_group import (get_membership_groups_data)
log = Logger(__name__)
if __nam... | 48.179245 | 118 | 0.682005 | import argparse
import csv
import importlib
from core_data_modules.cleaners import Codes
from core_data_modules.logging import Logger
from core_data_modules.traced_data.io import TracedDataJsonIO
from src.engagement_db_to_analysis.membership_group import (get_membership_groups_data)
log = Logger(__name__)
if __nam... | true | true |
f73c0c9cfa0ee96cff187a0a7a14716c2d825e1e | 521 | py | Python | WeatherApp/weatherapp.py | ragreenburg/Amazing-Python-Scripts | d91d0ddd312eb82ac307b58d6d09e6ca19384ea8 | [
"MIT"
] | 930 | 2020-09-05T22:07:28.000Z | 2022-03-30T07:56:18.000Z | WeatherApp/weatherapp.py | ragreenburg/Amazing-Python-Scripts | d91d0ddd312eb82ac307b58d6d09e6ca19384ea8 | [
"MIT"
] | 893 | 2020-09-04T07:57:24.000Z | 2022-02-08T02:12:26.000Z | WeatherApp/weatherapp.py | ragreenburg/Amazing-Python-Scripts | d91d0ddd312eb82ac307b58d6d09e6ca19384ea8 | [
"MIT"
] | 497 | 2020-09-05T08:16:24.000Z | 2022-03-31T00:55:57.000Z | import requests
from bs4 import BeautifulSoup
# Taking City You Want to Check Temperaature
city = input("Enter City : ")
# Storing City You Want to Check Temperaature
search = "weather in" + city
# Searching it on google
url = f"https://www.google.com/search?&q={search}"
# Sending and Receiving Requests
r = requests.g... | 28.944444 | 50 | 0.725528 | import requests
from bs4 import BeautifulSoup
city = input("Enter City : ")
search = "weather in" + city
url = f"https://www.google.com/search?&q={search}"
r = requests.get(url)
s = BeautifulSoup(r.text, "html.parser")
update = s.find("div", class_="BNeawe").text
print("Temperature in " + city + " is: " + updat... | true | true |
f73c0d558d0f1dbc184863759c8cef0fcbc8b587 | 8,519 | py | Python | sympy/physics/units.py | SpeedyiiiTH/sympy | 37b9b84d4c997ccc9307baf29dd83d12ec31298f | [
"BSD-3-Clause"
] | null | null | null | sympy/physics/units.py | SpeedyiiiTH/sympy | 37b9b84d4c997ccc9307baf29dd83d12ec31298f | [
"BSD-3-Clause"
] | 7 | 2017-05-01T14:15:32.000Z | 2017-09-06T20:44:24.000Z | sympy/physics/units.py | SpeedyiiiTH/sympy | 37b9b84d4c997ccc9307baf29dd83d12ec31298f | [
"BSD-3-Clause"
] | null | null | null | """
Physical units and dimensions.
The base class is Unit, where all here defined units (~200) inherit from.
The find_unit function can help you find units for a given quantity:
>>> import sympy.physics.units as u
>>> u.find_unit('coul')
['coulomb', 'coulombs']
>>> u.find_unit(u.charge)
['C', 'ch... | 27.044444 | 79 | 0.638925 |
from __future__ import print_function, division
from sympy import Rational, pi
from sympy.core import AtomicExpr
class Unit(AtomicExpr):
is_positive = True
is_commutative = True
__slots__ = ["name", "abbrev"]
def __new__(cls, name, abbrev, **assumptions):
obj = AtomicExpr.__new__(cls, ... | true | true |
f73c0dd0bc664d16bb63c14b2c4d78cf60a252b4 | 1,705 | py | Python | tests/settings.py | OlgaBorisova/django-pgfields | fc21efc116d017f1bf75c88fa3502cc23f8923b3 | [
"BSD-3-Clause"
] | null | null | null | tests/settings.py | OlgaBorisova/django-pgfields | fc21efc116d017f1bf75c88fa3502cc23f8923b3 | [
"BSD-3-Clause"
] | null | null | null | tests/settings.py | OlgaBorisova/django-pgfields | fc21efc116d017f1bf75c88fa3502cc23f8923b3 | [
"BSD-3-Clause"
] | 1 | 2018-10-23T21:31:29.000Z | 2018-10-23T21:31:29.000Z | from __future__ import absolute_import, unicode_literals
from django_pg.utils.south import south_installed
import os
import sys
DEBUG = True
TEMPLATE_DEBUG = DEBUG
# Database settings. This assumes that the default user and empty
# password will work.
DATABASES = {
'default': {
'ENGINE': 'django.db.back... | 29.396552 | 77 | 0.718475 | from __future__ import absolute_import, unicode_literals
from django_pg.utils.south import south_installed
import os
import sys
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'django_pg',
'USER': '',
'P... | true | true |
f73c0e51df590bc8a015c8e97adf0eb20ac088c3 | 1,383 | py | Python | website/canvas/url_util.py | bopopescu/canvas | 2dfd6009eaecd8dac64ccc6125084e65305fb5d0 | [
"BSD-3-Clause"
] | 61 | 2015-11-10T17:13:46.000Z | 2021-08-06T17:58:30.000Z | website/canvas/url_util.py | bopopescu/canvas | 2dfd6009eaecd8dac64ccc6125084e65305fb5d0 | [
"BSD-3-Clause"
] | 13 | 2015-11-11T07:49:41.000Z | 2021-06-09T03:45:31.000Z | website/canvas/url_util.py | bopopescu/canvas | 2dfd6009eaecd8dac64ccc6125084e65305fb5d0 | [
"BSD-3-Clause"
] | 18 | 2015-11-11T04:50:04.000Z | 2021-08-20T00:57:11.000Z | import urlparse
from django.conf.urls.defaults import url
from canvas.exceptions import ServiceError
re_slug = lambda name: "(?P<%s>[a-zA-Z0-9_.,-]+)" % name
re_group_slug = lambda name: "(?P<%s>[-a-zA-Z0-9_]+)" % name
re_int = lambda name: "(?P<%s>\d+)" % name
re_year = re_int('year')
re_month = re_year + "/" + re... | 27.117647 | 99 | 0.606652 | import urlparse
from django.conf.urls.defaults import url
from canvas.exceptions import ServiceError
re_slug = lambda name: "(?P<%s>[a-zA-Z0-9_.,-]+)" % name
re_group_slug = lambda name: "(?P<%s>[-a-zA-Z0-9_]+)" % name
re_int = lambda name: "(?P<%s>\d+)" % name
re_year = re_int('year')
re_month = re_year + "/" + re... | true | true |
f73c0f2c39b11fc9eed97e1360702015396621e1 | 9,602 | py | Python | oase-root/libs/backyardlibs/oase_action_common_libs.py | wreathvine/oase | e560b124de6239ec94b662ebff3c310c3f2fa631 | [
"Apache-2.0"
] | null | null | null | oase-root/libs/backyardlibs/oase_action_common_libs.py | wreathvine/oase | e560b124de6239ec94b662ebff3c310c3f2fa631 | [
"Apache-2.0"
] | null | null | null | oase-root/libs/backyardlibs/oase_action_common_libs.py | wreathvine/oase | e560b124de6239ec94b662ebff3c310c3f2fa631 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 NEC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 30.194969 | 92 | 0.532493 |
import json
import os
import sys
import re
import pytz
import datetime
from socket import gethostname
import traceback
my_path = os.path.dirname(os.path.abspath(__file__))
tmp_path = my_path.split('oase-root')
root_dir_path = tmp_path[0] + 'oase-root'
sys.path.append(root_dir_path)
from web_app.mo... | true | true |
f73c0fe703b389cfc864ec8c3e6ef753f1d11bd1 | 38,347 | py | Python | tests/workflow_builder_test.py | isi-vista/vista-pegasus-wrapper | bbc220bb9aa6adaaad1df785b51526b6d4b0fafc | [
"MIT"
] | 2 | 2021-03-11T13:33:52.000Z | 2021-06-18T17:49:41.000Z | tests/workflow_builder_test.py | isi-vista/vista-pegasus-wrapper | bbc220bb9aa6adaaad1df785b51526b6d4b0fafc | [
"MIT"
] | 108 | 2020-02-25T21:42:30.000Z | 2022-03-25T21:59:30.000Z | tests/workflow_builder_test.py | isi-vista/vista-pegasus-wrapper | bbc220bb9aa6adaaad1df785b51526b6d4b0fafc | [
"MIT"
] | 1 | 2020-08-05T15:33:52.000Z | 2020-08-05T15:33:52.000Z | import subprocess
from pathlib import Path
from random import Random
from immutablecollections import immutableset
from vistautils.parameters import Parameters
from pegasus_wrapper import PegasusProfile
from pegasus_wrapper.artifact import ValueArtifact
from pegasus_wrapper.locator import Locator, _parse_parts
from p... | 36.108286 | 128 | 0.673534 | import subprocess
from pathlib import Path
from random import Random
from immutablecollections import immutableset
from vistautils.parameters import Parameters
from pegasus_wrapper import PegasusProfile
from pegasus_wrapper.artifact import ValueArtifact
from pegasus_wrapper.locator import Locator, _parse_parts
from p... | true | true |
f73c1068442f8eee12624e768c4bc9ff045c2310 | 6,585 | py | Python | views/endpoint.py | CognitiveRoboticsTUT/robot-semweb | 2b5940bf6c9e601fdd2bf346cdd611dd0ab6130d | [
"BSD-3-Clause"
] | 2 | 2018-10-02T19:51:25.000Z | 2018-10-03T21:01:36.000Z | views/endpoint.py | CognitiveRoboticsTUT/robot-semweb | 2b5940bf6c9e601fdd2bf346cdd611dd0ab6130d | [
"BSD-3-Clause"
] | null | null | null | views/endpoint.py | CognitiveRoboticsTUT/robot-semweb | 2b5940bf6c9e601fdd2bf346cdd611dd0ab6130d | [
"BSD-3-Clause"
] | null | null | null | from flask import Blueprint, render_template,request, jsonify
from rdflib.term import Literal
from . import utils, model
bp = Blueprint('endpoint', __name__)
@bp.route('/endpoint')
def endpoint():
print "received request"
q=request.json['query']
res = utils.kb.query(q, initNs=utils.namespaces)
res_lis... | 29.79638 | 81 | 0.558542 | from flask import Blueprint, render_template,request, jsonify
from rdflib.term import Literal
from . import utils, model
bp = Blueprint('endpoint', __name__)
@bp.route('/endpoint')
def endpoint():
print "received request"
q=request.json['query']
res = utils.kb.query(q, initNs=utils.namespaces)
res_lis... | false | true |
f73c10ee3e5c24d52e1500d097c6c6a3310f74e0 | 10,284 | py | Python | plugin/radar/depth_net.py | a1600012888/mmdetection3d | 2e01549c56dabf1965abc975a7301a8d746973ad | [
"Apache-2.0"
] | null | null | null | plugin/radar/depth_net.py | a1600012888/mmdetection3d | 2e01549c56dabf1965abc975a7301a8d746973ad | [
"Apache-2.0"
] | null | null | null | plugin/radar/depth_net.py | a1600012888/mmdetection3d | 2e01549c56dabf1965abc975a7301a8d746973ad | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Toyota Research Institute. All rights reserved.
import torch
import torch.nn as nn
from .layers01 import \
PackLayerConv3d, UnpackLayerConv3d, Conv2D, ResidualBlock, InvDepth
from .utils import DepthPredictHead2Up, get_depth_metrics
from mmdet.models import DETECTORS
import torch.nn.functional a... | 37.808824 | 134 | 0.583333 |
import torch
import torch.nn as nn
from .layers01 import \
PackLayerConv3d, UnpackLayerConv3d, Conv2D, ResidualBlock, InvDepth
from .utils import DepthPredictHead2Up, get_depth_metrics
from mmdet.models import DETECTORS
import torch.nn.functional as F
@DETECTORS.register_module()
class PackNetSlim01(nn.Module):... | true | true |
f73c139ec5017afdf9ac4cced3afcaf2a5531129 | 5,997 | py | Python | pybind/slxos/v17s_1_02/brocade_tunnels_ext_rpc/get_tunnel_info/output/tunnel/nodes/__init__.py | extremenetworks/pybind | 44c467e71b2b425be63867aba6e6fa28b2cfe7fb | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v17s_1_02/brocade_tunnels_ext_rpc/get_tunnel_info/output/tunnel/nodes/__init__.py | extremenetworks/pybind | 44c467e71b2b425be63867aba6e6fa28b2cfe7fb | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v17s_1_02/brocade_tunnels_ext_rpc/get_tunnel_info/output/tunnel/nodes/__init__.py | extremenetworks/pybind | 44c467e71b2b425be63867aba6e6fa28b2cfe7fb | [
"Apache-2.0"
] | 1 | 2021-11-05T22:15:42.000Z | 2021-11-05T22:15:42.000Z |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | 46.130769 | 458 | 0.717859 |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | true | true |
f73c13bb34372d043ea74f3ff8fb5fc7580b5518 | 35,618 | py | Python | utils/RigidPatching.py | thomaskuestner/CNNArt | c2fc639dd2ce035f6ca90113290682a0ccd26fb8 | [
"Apache-2.0"
] | 22 | 2018-04-27T21:28:46.000Z | 2021-12-24T06:44:55.000Z | utils/RigidPatching.py | thomaskuestner/CNNArt | c2fc639dd2ce035f6ca90113290682a0ccd26fb8 | [
"Apache-2.0"
] | 81 | 2017-11-09T17:23:15.000Z | 2020-01-28T22:54:13.000Z | utils/RigidPatching.py | thomaskuestner/CNNArt | c2fc639dd2ce035f6ca90113290682a0ccd26fb8 | [
"Apache-2.0"
] | 18 | 2017-11-13T16:12:17.000Z | 2020-08-27T10:17:34.000Z | '''
Copyright: 2016-2019 Thomas Kuestner (thomas.kuestner@med.uni-tuebingen.de) under Apache2 license
@author: Thomas Kuestner
'''
import numpy as np
import tensorflow as tf
import math
from utils.Label import Label
##########################################################################################... | 61.199313 | 236 | 0.556264 |
import numpy as np
import tensorflow as tf
import math
from utils.Label import Label
| true | true |
f73c14d25861ed70f0c0e1a0b50b9d6c72f556b2 | 24,829 | py | Python | cirq-core/cirq/protocols/apply_unitary_protocol.py | Zshan0/Cirq | 93bbaa853305faa65117bcbdc2063f741cb2977c | [
"Apache-2.0"
] | 1 | 2022-02-02T07:13:54.000Z | 2022-02-02T07:13:54.000Z | cirq-core/cirq/protocols/apply_unitary_protocol.py | bradyb/Cirq | 610b0d4ea3a7862169610797266734c844ddcc1f | [
"Apache-2.0"
] | null | null | null | cirq-core/cirq/protocols/apply_unitary_protocol.py | bradyb/Cirq | 610b0d4ea3a7862169610797266734c844ddcc1f | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 43.407343 | 100 | 0.668452 |
from typing import (
Any,
cast,
Iterable,
Optional,
Sequence,
Tuple,
TYPE_CHECKING,
TypeVar,
Union,
)
import numpy as np
from typing_extensions import Protocol
from cirq import linalg, qis
from cirq._doc import doc_private
from cirq.protocols import qid_shape_protocol... | true | true |
f73c15662ec170505e5b105b68fa5669388e46eb | 2,384 | py | Python | test/unit/utils/test_expiring_dict.py | dolphinridercrypto/bxcommon | 8f70557c1dbff785a5dd3fcdf91176066e085c3a | [
"MIT"
] | 12 | 2019-11-06T17:39:10.000Z | 2022-03-01T11:26:19.000Z | test/unit/utils/test_expiring_dict.py | dolphinridercrypto/bxcommon | 8f70557c1dbff785a5dd3fcdf91176066e085c3a | [
"MIT"
] | 8 | 2019-11-06T21:31:11.000Z | 2021-06-02T00:46:50.000Z | test/unit/utils/test_expiring_dict.py | dolphinridercrypto/bxcommon | 8f70557c1dbff785a5dd3fcdf91176066e085c3a | [
"MIT"
] | 5 | 2019-11-14T18:08:11.000Z | 2022-02-08T09:36:22.000Z | import time
import unittest
from mock import MagicMock
from bxcommon.utils.expiring_dict import ExpiringDict
from bxcommon.utils.alarm_queue import AlarmQueue
class ExpiringDictTests(unittest.TestCase):
EXPIRATION_TIME_S = 1
def setUp(self):
self.ALARM_QUEUE = AlarmQueue()
self.e_dict = Exp... | 31.786667 | 88 | 0.635906 | import time
import unittest
from mock import MagicMock
from bxcommon.utils.expiring_dict import ExpiringDict
from bxcommon.utils.alarm_queue import AlarmQueue
class ExpiringDictTests(unittest.TestCase):
EXPIRATION_TIME_S = 1
def setUp(self):
self.ALARM_QUEUE = AlarmQueue()
self.e_dict = Exp... | true | true |
f73c15ad1f5b5102b09d5d087c99a68ab986e2b7 | 2,903 | py | Python | HashGenerator.py | Ramin-RX7/DramaX | 54a098b3fb04867453d30838fe3bac73339c294e | [
"MIT"
] | 14 | 2020-05-13T23:17:32.000Z | 2022-02-20T21:31:07.000Z | HashGenerator.py | Ramin-RX7/DramaX | 54a098b3fb04867453d30838fe3bac73339c294e | [
"MIT"
] | null | null | null | HashGenerator.py | Ramin-RX7/DramaX | 54a098b3fb04867453d30838fe3bac73339c294e | [
"MIT"
] | null | null | null | import hashlib
import sys
import getpass
import argparse
import rx7 as rx
from LIB.Functions import pause, cls
from LIB.Hash import sa
def print_hashes(word, file=None, Print=True):
word=bytes(word, encoding='utf-8')
LIST = []
for name,func in sa.items():
try:
result = func(word).he... | 30.557895 | 108 | 0.479848 | import hashlib
import sys
import getpass
import argparse
import rx7 as rx
from LIB.Functions import pause, cls
from LIB.Hash import sa
def print_hashes(word, file=None, Print=True):
word=bytes(word, encoding='utf-8')
LIST = []
for name,func in sa.items():
try:
result = func(word).he... | true | true |
f73c15b3d32cb87c1bb0c87097fc35fb9d3be344 | 3,123 | py | Python | matchengine/tests/timetravel_and_override.py | victoria34/matchengine-V2 | dea74c5eec08b181c3b2bf173fa3a79ded1c1af7 | [
"Apache-2.0"
] | null | null | null | matchengine/tests/timetravel_and_override.py | victoria34/matchengine-V2 | dea74c5eec08b181c3b2bf173fa3a79ded1c1af7 | [
"Apache-2.0"
] | null | null | null | matchengine/tests/timetravel_and_override.py | victoria34/matchengine-V2 | dea74c5eec08b181c3b2bf173fa3a79ded1c1af7 | [
"Apache-2.0"
] | 1 | 2019-09-25T17:31:49.000Z | 2019-09-25T17:31:49.000Z | import datetime
import gc
_scope_handler = {
'date': datetime.date,
'datetime': datetime.datetime,
'old_datetime': datetime.datetime,
'old_date': datetime.date}
def set_static_date_time(year=2000, month=7, day=12, hour=9, minute=47, second=40, microsecond=303620):
global _scope_handler
defau... | 43.375 | 119 | 0.652257 | import datetime
import gc
_scope_handler = {
'date': datetime.date,
'datetime': datetime.datetime,
'old_datetime': datetime.datetime,
'old_date': datetime.date}
def set_static_date_time(year=2000, month=7, day=12, hour=9, minute=47, second=40, microsecond=303620):
global _scope_handler
defau... | true | true |
f73c15da21f1c9c65413e062423fc2efec0b31bc | 18,505 | py | Python | examples/direct_fidelity_estimation.py | aditya-giri/Cirq | e5af689f184c8c5ccd9c076b2907a444b2479629 | [
"Apache-2.0"
] | null | null | null | examples/direct_fidelity_estimation.py | aditya-giri/Cirq | e5af689f184c8c5ccd9c076b2907a444b2479629 | [
"Apache-2.0"
] | null | null | null | examples/direct_fidelity_estimation.py | aditya-giri/Cirq | e5af689f184c8c5ccd9c076b2907a444b2479629 | [
"Apache-2.0"
] | null | null | null | """Implements direct fidelity estimation.
Fidelity between the desired pure state rho and the actual state sigma is
defined as:
F(rho, sigma) = Tr (rho sigma)
It is a unit-less measurement between 0.0 and 1.0. The following two papers
independently described a faster way to estimate its value:
Direct Fidelity Estima... | 39.795699 | 80 | 0.645231 |
from typing import cast, List, Optional, Tuple
import argparse
import asyncio
from dataclasses import dataclass
import itertools
import random
import sys
import numpy as np
import cirq
def build_circuit() -> Tuple[cirq.Circuit, List[cirq.Qid]]:
qubits: List[cirq.Qid] = cast(List[cirq.Qid], cirq.Li... | true | true |
f73c168f7295be6aa1f210c9bc054ac85feb6d13 | 1,407 | py | Python | trisicell/commands/mcalling/z01status.py | faridrashidi/trisicell | 4db89edd44c03ccb6c7d3477beff0079c3ff8035 | [
"BSD-3-Clause"
] | 2 | 2021-07-02T13:53:15.000Z | 2021-11-16T03:14:36.000Z | trisicell/commands/mcalling/z01status.py | faridrashidi/trisicell | 4db89edd44c03ccb6c7d3477beff0079c3ff8035 | [
"BSD-3-Clause"
] | 58 | 2021-06-14T17:14:39.000Z | 2022-03-11T19:32:54.000Z | trisicell/commands/mcalling/z01status.py | faridrashidi/trisicell | 4db89edd44c03ccb6c7d3477beff0079c3ff8035 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2021, Farid Rashidi Mehrabadi All rights reserved.
# ======================================================================================
# Author : Farid Rashidi Mehrabadi (farid.rashidimehrabadi@nih.gov)
# Last Update: Aug 14, 2020
# Description: cleaning
# ==============... | 24.258621 | 88 | 0.428571 |
import glob
def _is_ok(name):
file = open(name)
body = file.read()
file.close()
a = body.count("&& echo Done! )")
b = body.count("Done!\n")
if a == 0 and b == 1:
return True
else:
return a == b
def after01(config):
if config["isrna"]:
steps = [
... | true | true |
f73c19bb24b81831d1a00237e0f18488436e5fbc | 705 | py | Python | pelita/player/__init__.py | aspp-apac/pelita | 57f2cb0a1142495bc2c1297d3f8006092f12b0d0 | [
"BSD-2-Clause"
] | null | null | null | pelita/player/__init__.py | aspp-apac/pelita | 57f2cb0a1142495bc2c1297d3f8006092f12b0d0 | [
"BSD-2-Clause"
] | null | null | null | pelita/player/__init__.py | aspp-apac/pelita | 57f2cb0a1142495bc2c1297d3f8006092f12b0d0 | [
"BSD-2-Clause"
] | 1 | 2019-01-24T06:00:37.000Z | 2019-01-24T06:00:37.000Z |
from .base import AbstractTeam, SimpleTeam, AbstractPlayer
from .base import (SteppingPlayer, SpeakingPlayer,
RoundBasedPlayer, MoveExceptionPlayer, InitialExceptionPlayer,
DebuggablePlayer)
from .team import Team
from .RandomPlayers import RandomPlayer, NQRandomPlayer
from .Fo... | 29.375 | 81 | 0.791489 |
from .base import AbstractTeam, SimpleTeam, AbstractPlayer
from .base import (SteppingPlayer, SpeakingPlayer,
RoundBasedPlayer, MoveExceptionPlayer, InitialExceptionPlayer,
DebuggablePlayer)
from .team import Team
from .RandomPlayers import RandomPlayer, NQRandomPlayer
from .Fo... | true | true |
f73c1a94ecd776da78881c480d9a2e7f506138e7 | 2,682 | py | Python | developing/lombScargle.py | frmunozz/IrregularMatchedFilter | b64c348345b16d777839f13dc585d1816cf81ca6 | [
"MIT"
] | 2 | 2021-12-15T16:38:43.000Z | 2021-12-15T16:38:49.000Z | developing/lombScargle.py | Francisco95/Match_filter | b64c348345b16d777839f13dc585d1816cf81ca6 | [
"MIT"
] | null | null | null | developing/lombScargle.py | Francisco95/Match_filter | b64c348345b16d777839f13dc585d1816cf81ca6 | [
"MIT"
] | null | null | null | from gatspy.periodic import LombScargleFast
from scipy import signal
from astropy.stats import LombScargle
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
plt.style.use('seaborn-paper')
import time
"""
comparison between many implementations of lomb-scargle periodogram
"""
# 3 parts separated i... | 34.384615 | 118 | 0.696122 | from gatspy.periodic import LombScargleFast
from scipy import signal
from astropy.stats import LombScargle
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
plt.style.use('seaborn-paper')
import time
N = 120
T = np.zeros(N)
dt_implicit = 1 / N
t0 = np.linspace(0, int(N/3)-1, int(N/3))
np.random... | true | true |
f73c1b83456bab78de7b5431748ed35239621004 | 2,072 | py | Python | prepare-data2.py | mojtaba-eshghie/ethereum-rtm | 2a999ab5dcd557350922b311dbaba46f2f929d1c | [
"MIT"
] | 7 | 2021-03-06T13:27:16.000Z | 2022-02-06T03:52:23.000Z | prepare-data2.py | mojtaba-eshghie/Dynam | 4f233ea0389c107c90859043911a9bdec7465696 | [
"MIT"
] | 1 | 2021-01-04T14:17:04.000Z | 2021-01-04T14:17:04.000Z | prepare-data2.py | mojtaba-eshghie/ethereum-rtv | 2a999ab5dcd557350922b311dbaba46f2f929d1c | [
"MIT"
] | 1 | 2022-03-31T22:10:08.000Z | 2022-03-31T22:10:08.000Z | #!/usr/bin/python3
import csv
import pandas as pd
import numpy as np
import json
import subprocess
'''
with open('data/final.csv', 'r') as final_csv:
csv_reader = csv.reader(final_csv, delimiter=',')
line_count = 0
for row in csv_reader:
print(row)
'''
data = pd.read_csv('data/final.csv')
sc_balan... | 23.280899 | 116 | 0.693533 |
import csv
import pandas as pd
import numpy as np
import json
import subprocess
data = pd.read_csv('data/final.csv')
sc_balances_before_file = open('data/sc-balances-before-exec.json')
sc_balances_after_file = open('data/sc-balances-after-exec.json')
before_exec_sc_data = json.load(sc_balances_before_file)
after_ex... | true | true |
f73c1c8e2cf45d9105d99d64cef285da9160aa58 | 23 | py | Python | omnidice/__init__.py | sjjessop/omnidice | ca215dabe43b48d15790ad4345aa22ed654d244e | [
"MIT"
] | 2 | 2020-09-17T11:02:32.000Z | 2022-01-07T22:28:37.000Z | omnidice/__init__.py | sjjessop/omnidice | ca215dabe43b48d15790ad4345aa22ed654d244e | [
"MIT"
] | 8 | 2020-07-11T14:37:09.000Z | 2020-10-29T22:24:40.000Z | omnidice/__init__.py | sjjessop/omnidice | ca215dabe43b48d15790ad4345aa22ed654d244e | [
"MIT"
] | null | null | null |
__version__ = '1.2.1'
| 7.666667 | 21 | 0.608696 |
__version__ = '1.2.1'
| true | true |
f73c1cc3eaee375d531e87ecb437d370d043bd2c | 383 | py | Python | rod_align/_ext/rod_align/__init__.py | notantony/Grid-Anchor-based-Image-Cropping-Pytorch | 32a2dea9151c123c8e589bd196450f56cf3ef7d1 | [
"MIT"
] | 92 | 2019-09-18T12:57:54.000Z | 2022-03-22T18:57:33.000Z | rod_align/_ext/rod_align/__init__.py | notantony/Grid-Anchor-based-Image-Cropping-Pytorch | 32a2dea9151c123c8e589bd196450f56cf3ef7d1 | [
"MIT"
] | 5 | 2019-09-24T07:48:21.000Z | 2021-07-26T04:28:26.000Z | rod_align/_ext/rod_align/__init__.py | notantony/Grid-Anchor-based-Image-Cropping-Pytorch | 32a2dea9151c123c8e589bd196450f56cf3ef7d1 | [
"MIT"
] | 16 | 2019-09-24T04:26:47.000Z | 2022-02-15T10:01:06.000Z |
from torch.utils.ffi import _wrap_function
from ._rod_align import lib as _lib, ffi as _ffi
__all__ = []
def _import_symbols(locals):
for symbol in dir(_lib):
fn = getattr(_lib, symbol)
if callable(fn):
locals[symbol] = _wrap_function(fn, _ffi)
else:
locals[symbol] ... | 23.9375 | 53 | 0.639687 |
from torch.utils.ffi import _wrap_function
from ._rod_align import lib as _lib, ffi as _ffi
__all__ = []
def _import_symbols(locals):
for symbol in dir(_lib):
fn = getattr(_lib, symbol)
if callable(fn):
locals[symbol] = _wrap_function(fn, _ffi)
else:
locals[symbol] ... | true | true |
f73c1d11080f5ddf77de887ba84bca7c3e523317 | 7,782 | py | Python | 20-fs-ias-lec/groups/11-sensUI/wifi_link/lora_feed_layer.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-fs-ias-lec/groups/11-sensUI/wifi_link/lora_feed_layer.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-fs-ias-lec/groups/11-sensUI/wifi_link/lora_feed_layer.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | import crypto
import feed
import binascii
import event
import pcap
import os
class Lora_Feed_Layer:
def __init__(self):
self.verbose = 1
self.callback_sensor_feed = 0
self.callback_control_feed = 0
self.pcap_sensor = 'Sensor_Feed.pcap'
key_sensor = 'keyfile_sensor.key'
... | 32.024691 | 116 | 0.541635 | import crypto
import feed
import binascii
import event
import pcap
import os
class Lora_Feed_Layer:
def __init__(self):
self.verbose = 1
self.callback_sensor_feed = 0
self.callback_control_feed = 0
self.pcap_sensor = 'Sensor_Feed.pcap'
key_sensor = 'keyfile_sensor.key'
... | true | true |
f73c1ed57fe251a1a3555ac6e0d799368199d3bc | 3,106 | py | Python | broker/persistence/sqlite/plugin.py | javanlacerda/asperathos-manager | a85ecc53f56dfef07c7634b8f9f6cd2e1e88e1d9 | [
"Apache-2.0"
] | 7 | 2019-02-07T17:59:20.000Z | 2020-04-28T00:56:18.000Z | broker/persistence/sqlite/plugin.py | javanlacerda/asperathos-manager | a85ecc53f56dfef07c7634b8f9f6cd2e1e88e1d9 | [
"Apache-2.0"
] | 52 | 2018-11-09T10:32:39.000Z | 2020-05-07T14:55:58.000Z | broker/persistence/sqlite/plugin.py | javanlacerda/asperathos-manager | a85ecc53f56dfef07c7634b8f9f6cd2e1e88e1d9 | [
"Apache-2.0"
] | 11 | 2018-11-08T20:40:27.000Z | 2019-11-06T17:31:15.000Z | # Copyright (c) 2019 UFCG-LSD.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 29.865385 | 74 | 0.622666 |
from broker.persistence.persistence_interface import PersistenceInterface
from broker.persistence.sqlite.model import JobState, Plugin
import dill
import peewee
class SqliteJobPersistence(PersistenceInterface):
def __init__(self):
try:
JobState.create_table()
except pe... | true | true |
f73c21ab8ff31d42eefafa43012f748feffc581f | 20,942 | py | Python | acq4/pyqtgraph/widgets/SpinBox.py | tropp/ACQ4 | 792e05e99cedfc175593d200aeabecd6fa6304ce | [
"MIT"
] | null | null | null | acq4/pyqtgraph/widgets/SpinBox.py | tropp/ACQ4 | 792e05e99cedfc175593d200aeabecd6fa6304ce | [
"MIT"
] | null | null | null | acq4/pyqtgraph/widgets/SpinBox.py | tropp/ACQ4 | 792e05e99cedfc175593d200aeabecd6fa6304ce | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from ..Qt import QtGui, QtCore
from ..python2_3 import asUnicode
from ..SignalProxy import SignalProxy
from .. import functions as fn
from math import log
from decimal import Decimal as D ## Use decimal to avoid accumulating floating-point errors
from decimal import *
import weakref
__all__ =... | 39.813688 | 150 | 0.518671 |
from ..Qt import QtGui, QtCore
from ..python2_3 import asUnicode
from ..SignalProxy import SignalProxy
from .. import functions as fn
from math import log
from decimal import Decimal as D x']
class SpinBox(QtGui.QAbstractSpinBox):
neEdit()
## This makes it possible to crash the entire program
## by... | true | true |
f73c21f67a9fb8bd1adcb9b8d797b54e92152ee7 | 19,677 | py | Python | numpy/core/getlimits.py | lgeiger/numpy | be8ab91f789c3b688d707940016b4c2d262913e9 | [
"BSD-3-Clause"
] | 2 | 2022-02-02T05:40:47.000Z | 2022-03-05T11:04:24.000Z | numpy/core/getlimits.py | lgeiger/numpy | be8ab91f789c3b688d707940016b4c2d262913e9 | [
"BSD-3-Clause"
] | 32 | 2019-05-20T02:43:57.000Z | 2022-01-28T21:06:29.000Z | numpy/core/getlimits.py | lgeiger/numpy | be8ab91f789c3b688d707940016b4c2d262913e9 | [
"BSD-3-Clause"
] | 2 | 2021-08-16T05:10:04.000Z | 2022-01-15T09:10:09.000Z | """Machine limits for Float32 and Float64 and (long double) if available...
"""
__all__ = ['finfo', 'iinfo']
import warnings
from .machar import MachAr
from .overrides import set_module
from . import numeric
from . import numerictypes as ntypes
from .numeric import array, inf
from .umath import log10, exp2
from . im... | 35.074866 | 102 | 0.533415 | __all__ = ['finfo', 'iinfo']
import warnings
from .machar import MachAr
from .overrides import set_module
from . import numeric
from . import numerictypes as ntypes
from .numeric import array, inf
from .umath import log10, exp2
from . import umath
def _fr0(a):
if a.ndim == 0:
a = a.copy()
a.shap... | true | true |
f73c2247b553f98169bd3fd146f4ad5a10431f08 | 162 | py | Python | src/date.py | joaovitorlopes/bombcrypto-bot | 3994964b3c695e6154f81ab8ebcf91d8a50b77bb | [
"MIT"
] | null | null | null | src/date.py | joaovitorlopes/bombcrypto-bot | 3994964b3c695e6154f81ab8ebcf91d8a50b77bb | [
"MIT"
] | null | null | null | src/date.py | joaovitorlopes/bombcrypto-bot | 3994964b3c695e6154f81ab8ebcf91d8a50b77bb | [
"MIT"
] | null | null | null | import time
def dateFormatted(format = '%Y-%m-%d %H:%M:%S'):
datetime = time.localtime()
formatted = time.strftime(format, datetime)
return formatted | 27 | 48 | 0.67284 | import time
def dateFormatted(format = '%Y-%m-%d %H:%M:%S'):
datetime = time.localtime()
formatted = time.strftime(format, datetime)
return formatted | true | true |
f73c22f3af8a84b65606f8f91c87ad5dec54be4c | 12,497 | py | Python | tests/python_test/collection/test_create_collection.py | chriswarnock/milvus | ff4754a638a491adf7eca9952e1057272ba5d1a4 | [
"Apache-2.0"
] | null | null | null | tests/python_test/collection/test_create_collection.py | chriswarnock/milvus | ff4754a638a491adf7eca9952e1057272ba5d1a4 | [
"Apache-2.0"
] | null | null | null | tests/python_test/collection/test_create_collection.py | chriswarnock/milvus | ff4754a638a491adf7eca9952e1057272ba5d1a4 | [
"Apache-2.0"
] | null | null | null | import pdb
import copy
import logging
import itertools
import time
import threading
from multiprocessing import Process
import sklearn.preprocessing
import pytest
from utils import *
from constants import *
uid = "create_collection"
class TestCreateCollection:
"""
********************************************... | 38.690402 | 136 | 0.657758 | import pdb
import copy
import logging
import itertools
import time
import threading
from multiprocessing import Process
import sklearn.preprocessing
import pytest
from utils import *
from constants import *
uid = "create_collection"
class TestCreateCollection:
@pytest.fixture(
scope="function",
... | true | true |
f73c243731e49b349b0b13fb2e2638a361287579 | 529 | py | Python | douyuSpider/start.py | qq453388937/Scarapy_Git | 6faa32684b76841face3d977fb162290cb79d177 | [
"MIT"
] | null | null | null | douyuSpider/start.py | qq453388937/Scarapy_Git | 6faa32684b76841face3d977fb162290cb79d177 | [
"MIT"
] | null | null | null | douyuSpider/start.py | qq453388937/Scarapy_Git | 6faa32684b76841face3d977fb162290cb79d177 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
import sys
from scrapy import cmdline
# dont forget "".split() function
# cmdline.execute("scrapy crawl fb -o ../fb.json".split()) # 默认是当前路径 ../ 是上一级目录
cmdline.execute("scrapy crawl douyumm".split())
# def fib(num):
# a, b, sum = 0, 1, 0
# while sum < num:
# a, b = b, a +... | 15.114286 | 81 | 0.544423 |
import sys
from scrapy import cmdline
crapy crawl douyumm".split())
| true | true |
f73c2458d172dd5e39ac140d32a584659841472e | 306 | py | Python | 20220429pyconus/code/plusplus_model.py | takanory/gitpitch | 807697c33b6ca16f3cacac339c6e70d52c38b142 | [
"MIT"
] | null | null | null | 20220429pyconus/code/plusplus_model.py | takanory/gitpitch | 807697c33b6ca16f3cacac339c6e70d52c38b142 | [
"MIT"
] | null | null | null | 20220429pyconus/code/plusplus_model.py | takanory/gitpitch | 807697c33b6ca16f3cacac339c6e70d52c38b142 | [
"MIT"
] | null | null | null | from peewee import SqliteDatabase, Model, CharField, IntegerField
db = SqliteDatabase("plusplus.db")
class Plusplus(Model):
name = CharField(primary_key=True) # fields
counter = IntegerField(default=0)
class Meta:
database = db
db.connect()
db.create_tables([Plusplus], safe=True)
| 21.857143 | 65 | 0.718954 | from peewee import SqliteDatabase, Model, CharField, IntegerField
db = SqliteDatabase("plusplus.db")
class Plusplus(Model):
name = CharField(primary_key=True)
counter = IntegerField(default=0)
class Meta:
database = db
db.connect()
db.create_tables([Plusplus], safe=True)
| true | true |
f73c24c4ab315c2587841392e9a192df93b08644 | 522 | py | Python | PythonExercicios/ex091.py | Caio-Moretti/115.Exercicios-Python | 7e66fb1f44ea3eb4ade63f37d843242ac42ade84 | [
"MIT"
] | null | null | null | PythonExercicios/ex091.py | Caio-Moretti/115.Exercicios-Python | 7e66fb1f44ea3eb4ade63f37d843242ac42ade84 | [
"MIT"
] | null | null | null | PythonExercicios/ex091.py | Caio-Moretti/115.Exercicios-Python | 7e66fb1f44ea3eb4ade63f37d843242ac42ade84 | [
"MIT"
] | null | null | null | from random import randint
from time import sleep
from operator import itemgetter
jogo = {'Jogador 1': randint(1, 6),
'Jogador 2': randint(1, 6),
'Jogador 3': randint(1, 6),
'Jogador 4': randint(1, 6)}
ranking = list()
print('Valores sorteados: ')
for k, v in jogo.items():
print(f'{k} tirou ... | 29 | 63 | 0.609195 | from random import randint
from time import sleep
from operator import itemgetter
jogo = {'Jogador 1': randint(1, 6),
'Jogador 2': randint(1, 6),
'Jogador 3': randint(1, 6),
'Jogador 4': randint(1, 6)}
ranking = list()
print('Valores sorteados: ')
for k, v in jogo.items():
print(f'{k} tirou ... | true | true |
f73c24cd61c6f29f2dd100f7e4af4609b7bb9113 | 17,366 | py | Python | XY_Model_propare_state3_chi64_A0.py | StudentsZhouPengfei/Automatically-Differentiable-Quantum-Circuit-for-Many-qubit-State-Preparation | 42d3a77380e78819375c9fb2c5600ddc89a3ae3f | [
"MIT"
] | 3 | 2021-05-10T01:49:59.000Z | 2021-06-13T19:03:40.000Z | XY_Model_propare_state3_chi64_A0.py | StudentsZhouPengfei/Automatically-Differentiable-Quantum-Circuit-for-Many-qubit-State-Preparation | 42d3a77380e78819375c9fb2c5600ddc89a3ae3f | [
"MIT"
] | null | null | null | XY_Model_propare_state3_chi64_A0.py | StudentsZhouPengfei/Automatically-Differentiable-Quantum-Circuit-for-Many-qubit-State-Preparation | 42d3a77380e78819375c9fb2c5600ddc89a3ae3f | [
"MIT"
] | null | null | null | import torch as tc
import numpy as np
import copy
import os,sys
import Circle_Function_Class_A0 as ev
import matplotlib.pyplot as plt
import matplotlib
matplotlib.use('Agg')
from torch.optim.lr_scheduler import StepLR
import BasicFunSJR as bfs
from CNNBTN import Paras_VL_CNN_BTN_Collected1chg1
import BasicFu... | 47.190217 | 114 | 0.651273 | import torch as tc
import numpy as np
import copy
import os,sys
import Circle_Function_Class_A0 as ev
import matplotlib.pyplot as plt
import matplotlib
matplotlib.use('Agg')
from torch.optim.lr_scheduler import StepLR
import BasicFunSJR as bfs
from CNNBTN import Paras_VL_CNN_BTN_Collected1chg1
import BasicFu... | true | true |
f73c24e70f1e75897b57dc8139e94d3d8fc52c39 | 1,037 | py | Python | scripts/yaml2mml.py | MapsMD/mapsmd-carto | e4ca0101d3385c83e6ccaa724ae8b71ef476b570 | [
"CC0-1.0"
] | null | null | null | scripts/yaml2mml.py | MapsMD/mapsmd-carto | e4ca0101d3385c83e6ccaa724ae8b71ef476b570 | [
"CC0-1.0"
] | 1 | 2016-07-11T16:00:23.000Z | 2016-07-11T16:00:23.000Z | scripts/yaml2mml.py | MapsMD/mapsmd-carto | e4ca0101d3385c83e6ccaa724ae8b71ef476b570 | [
"CC0-1.0"
] | 1 | 2019-10-03T15:29:42.000Z | 2019-10-03T15:29:42.000Z | #!/usr/bin/env python
from __future__ import print_function
import argparse, json, os, sys, yaml
parser = argparse.ArgumentParser(description='Keeps project files in sync by converting project.yaml to project.mml.')
parser.add_argument('--check', dest='check', help='write generated JSON to stdout instead to project.m... | 33.451613 | 158 | 0.693346 |
from __future__ import print_function
import argparse, json, os, sys, yaml
parser = argparse.ArgumentParser(description='Keeps project files in sync by converting project.yaml to project.mml.')
parser.add_argument('--check', dest='check', help='write generated JSON to stdout instead to project.mml', required=False, ... | true | true |
f73c25986bb7ea479bfa48f6033b06439abd359f | 24,683 | py | Python | nvp/components/admin.py | roche-emmanuel/nervproj | f784e88957868a17a40f499bef75cc226cf94e69 | [
"MIT"
] | null | null | null | nvp/components/admin.py | roche-emmanuel/nervproj | f784e88957868a17a40f499bef75cc226cf94e69 | [
"MIT"
] | null | null | null | nvp/components/admin.py | roche-emmanuel/nervproj | f784e88957868a17a40f499bef75cc226cf94e69 | [
"MIT"
] | null | null | null | """Collection of admin utility functions"""
import os
import sys
import logging
from nvp.nvp_component import NVPComponent
from nvp.nvp_context import NVPContext
logger = logging.getLogger(__name__)
# Default .editorconfig content:
DEFAULT_EDITORCONFIG_CONTENT = """# Autogenerated .editorconfig file
# Update as need... | 35.617605 | 143 | 0.610015 | import os
import sys
import logging
from nvp.nvp_component import NVPComponent
from nvp.nvp_context import NVPContext
logger = logging.getLogger(__name__)
DEFAULT_EDITORCONFIG_CONTENT = """# Autogenerated .editorconfig file
# Update as needed.
root = true
[*]
end_of_line = lf
"""
DEFAULT_GITIGNORE_CONTENT = """... | true | true |
f73c264eb1e10f6ea4fa8dd0e46d3e8b987fe466 | 39,990 | py | Python | old_projects/eola/chapter1.py | aDotInTheVoid/manim | eb3e5f419cb164f12b253cf885e19c35c62a2f31 | [
"MIT"
] | null | null | null | old_projects/eola/chapter1.py | aDotInTheVoid/manim | eb3e5f419cb164f12b253cf885e19c35c62a2f31 | [
"MIT"
] | null | null | null | old_projects/eola/chapter1.py | aDotInTheVoid/manim | eb3e5f419cb164f12b253cf885e19c35c62a2f31 | [
"MIT"
] | null | null | null | from manimlib.imports import *
from old_projects.eola.chapter0 import UpcomingSeriesOfVidoes
import random
def plane_wave_homotopy(x, y, z, t):
norm = get_norm([x, y])
tau = interpolate(5, -5, t) + norm/FRAME_X_RADIUS
alpha = sigmoid(tau)
return [x, y + 0.5*np.sin(2*np.pi*alpha)-t*SMALL_BUFF/2, z]
... | 32.068966 | 89 | 0.568267 | from manimlib.imports import *
from old_projects.eola.chapter0 import UpcomingSeriesOfVidoes
import random
def plane_wave_homotopy(x, y, z, t):
norm = get_norm([x, y])
tau = interpolate(5, -5, t) + norm/FRAME_X_RADIUS
alpha = sigmoid(tau)
return [x, y + 0.5*np.sin(2*np.pi*alpha)-t*SMALL_BUFF/2, z]
... | true | true |
f73c2676db045c362cb162e36986d32811c59752 | 779 | py | Python | prism/logging.py | ii-Python/Prism-v3 | 15a43161b41117529c915726e6270259f05d187d | [
"MIT"
] | 3 | 2021-11-26T22:08:11.000Z | 2021-12-23T21:42:22.000Z | prism/logging.py | wannurhadi/Prism-v3 | 514f8d17072bf208c42e68391bce471c7d608269 | [
"MIT"
] | 1 | 2021-07-07T22:37:10.000Z | 2021-07-07T22:40:11.000Z | prism/logging.py | wannurhadi/Prism-v3 | 514f8d17072bf208c42e68391bce471c7d608269 | [
"MIT"
] | 1 | 2021-12-23T21:42:24.000Z | 2021-12-23T21:42:24.000Z | # Copyright 2021-xx iiPython
# Modules
import sys
from rich.console import Console
# Logging class
rcon = Console()
class Logging(object):
def __init__(self) -> None:
self._color_map = {"success": "green", "info": "cyan", "warn": "yellow", "error": "red", "crash": "red"}
def log(self, log_type: str, ... | 29.961538 | 112 | 0.623877 |
import sys
from rich.console import Console
rcon = Console()
class Logging(object):
def __init__(self) -> None:
self._color_map = {"success": "green", "info": "cyan", "warn": "yellow", "error": "red", "crash": "red"}
def log(self, log_type: str, message: str, exit_code: int = None) -> None:
... | true | true |
f73c26ee4e2153bf40cc9801cb0634db85f53bef | 352 | py | Python | WEEKS/CD_Sata-Structures/_MISC/misc-examples/python3-book-examples/weakref/weakref_ref.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | null | null | null | WEEKS/CD_Sata-Structures/_MISC/misc-examples/python3-book-examples/weakref/weakref_ref.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | null | null | null | WEEKS/CD_Sata-Structures/_MISC/misc-examples/python3-book-examples/weakref/weakref_ref.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | null | null | null | #
"""Example using weakref.ref to manage a reference to an object.
"""
# end_pymotw_header
import weakref
class ExpensiveObject:
def __del__(self):
print("(Deleting {})".format(self))
obj = ExpensiveObject()
r = weakref.ref(obj)
print("obj:", obj)
print("ref:", r)
print("r():", r())
print("deleting o... | 14.666667 | 64 | 0.639205 |
import weakref
class ExpensiveObject:
def __del__(self):
print("(Deleting {})".format(self))
obj = ExpensiveObject()
r = weakref.ref(obj)
print("obj:", obj)
print("ref:", r)
print("r():", r())
print("deleting obj")
del obj
print("r():", r())
| true | true |
f73c2740e1649fade5126de35b580c31b8df51f6 | 435 | py | Python | similarity/helpers/url_helpers.py | diepdaocs/redis-minhash-es | e570fabd05730375af3e91c7830044cc0413fd9d | [
"Apache-2.0"
] | 1 | 2020-10-06T15:40:46.000Z | 2020-10-06T15:40:46.000Z | similarity/helpers/url_helpers.py | diepdaocs/redis-minhash-es | e570fabd05730375af3e91c7830044cc0413fd9d | [
"Apache-2.0"
] | null | null | null | similarity/helpers/url_helpers.py | diepdaocs/redis-minhash-es | e570fabd05730375af3e91c7830044cc0413fd9d | [
"Apache-2.0"
] | null | null | null | import re
URL_REGEX = re.compile(
r'^(?:http|ftp)s?://' # http:// or https://
r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|' # domain...
r'localhost|' # localhost...
r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})' # ...or ip
r'(?::\d+)?' # optional port
r'(?:/?... | 27.1875 | 101 | 0.448276 | import re
URL_REGEX = re.compile(
r'^(?:http|ftp)s?://'
r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|'
r'localhost|'
r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})'
r'(?::\d+)?'
r'(?:/?|[/?]\S+)$', re.IGNORECASE)
def is_url(word):
if URL_REGEX.match(... | true | true |
f73c27bb08a8934e59e20f51fc072681cf6f55ce | 4,278 | py | Python | datasets/DataAugmentations.py | DrJonoG/StomataGSMax | 18e5f993ed875ae6af07a4c7d1c0e4ff97e2c947 | [
"Apache-2.0"
] | null | null | null | datasets/DataAugmentations.py | DrJonoG/StomataGSMax | 18e5f993ed875ae6af07a4c7d1c0e4ff97e2c947 | [
"Apache-2.0"
] | null | null | null | datasets/DataAugmentations.py | DrJonoG/StomataGSMax | 18e5f993ed875ae6af07a4c7d1c0e4ff97e2c947 | [
"Apache-2.0"
] | null | null | null | from scipy import ndimage
from skimage import measure
import numpy as np
import cv2
def crop_rectangle(image, rect):
# rect has to be upright
num_rows = image.shape[0]
num_cols = image.shape[1]
if not inside_rect(rect = rect, num_cols = num_cols, num_rows = num_rows):
print("Proposed rectang... | 31.925373 | 192 | 0.657083 | from scipy import ndimage
from skimage import measure
import numpy as np
import cv2
def crop_rectangle(image, rect):
num_rows = image.shape[0]
num_cols = image.shape[1]
if not inside_rect(rect = rect, num_cols = num_cols, num_rows = num_rows):
print("Proposed rectangle is not fully in the i... | true | true |
f73c28192b76bb50010568e00f466e7ac325a41b | 14,542 | py | Python | flutter_output.py | declanwalsh/aero-bumps | 823ec1533de585971adacc701b4a0cf7b7b45035 | [
"BSD-3-Clause"
] | null | null | null | flutter_output.py | declanwalsh/aero-bumps | 823ec1533de585971adacc701b4a0cf7b7b45035 | [
"BSD-3-Clause"
] | null | null | null | flutter_output.py | declanwalsh/aero-bumps | 823ec1533de585971adacc701b4a0cf7b7b45035 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""flutter_output
Generates graphs, csv's and other files for export of analysis
MORE DETAILS
Typical usage example:
foo = ClassFoo()
bar = foo.FunctionBar()
TODO
- Add spectrogram of changes in modal frequencies at different airspeeds
"""
from mpl_toolkits.mplot3d im... | 31.47619 | 122 | 0.62543 |
from mpl_toolkits.mplot3d import Axes3D
import csv
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import numpy as np
import flutter_config as cfg
from flutter_config import cfg_analysis
import bisect
def compare_data_acc(results):
plot_modal_variation_with_airspeed(r... | true | true |
f73c288450be7e545ca2380eab9a9ba9c9232ca2 | 352 | py | Python | imagersite/imagersite/custom_storages.py | famavott/django-imager | a9867656af7a665f81574c1be5d50a2a703b4af4 | [
"MIT"
] | null | null | null | imagersite/imagersite/custom_storages.py | famavott/django-imager | a9867656af7a665f81574c1be5d50a2a703b4af4 | [
"MIT"
] | 1 | 2017-11-27T05:32:39.000Z | 2017-11-27T05:32:39.000Z | imagersite/imagersite/custom_storages.py | famavott/django-imager | a9867656af7a665f81574c1be5d50a2a703b4af4 | [
"MIT"
] | null | null | null | """"Custom storage for S3."""
from django.conf import settings
from storages.backends.s3boto import S3BotoStorage
class StaticStorage(S3BotoStorage):
"""Class for static storage."""
location = settings.STATICFILES_LOCATION
class MediaStorage(S3BotoStorage):
"""Class for media storage."""
location... | 20.705882 | 50 | 0.75 | from django.conf import settings
from storages.backends.s3boto import S3BotoStorage
class StaticStorage(S3BotoStorage):
location = settings.STATICFILES_LOCATION
class MediaStorage(S3BotoStorage):
location = settings.MEDIAFILES_LOCATION
| true | true |
f73c28bf7f8af35ba233e6f98fcf880343345243 | 11,106 | py | Python | tools/googlecode_upload.py | costa974/squiggle-sql | 06611a9f05fb27666a1b5b7572c7a3ab0d9dc972 | [
"BSD-3-Clause"
] | 1 | 2015-08-16T23:21:54.000Z | 2015-08-16T23:21:54.000Z | tools/googlecode_upload.py | costa974/squiggle-sql | 06611a9f05fb27666a1b5b7572c7a3ab0d9dc972 | [
"BSD-3-Clause"
] | null | null | null | tools/googlecode_upload.py | costa974/squiggle-sql | 06611a9f05fb27666a1b5b7572c7a3ab0d9dc972 | [
"BSD-3-Clause"
] | 1 | 2015-04-11T20:33:57.000Z | 2015-04-11T20:33:57.000Z | #!/usr/bin/env python
#
# Copyright 2006, 2007 Google Inc. All Rights Reserved.
# Author: danderson@google.com (David Anderson)
#
# Script for uploading files to a Google Code project.
#
# This is intended to be both a useful script for people who want to
# streamline project uploads and a reference implementation for
... | 35.482428 | 79 | 0.682514 |
# Subversion repository, the script will automatically retrieve your
# credentials from there (unless disabled, see the output of '--help'
# for details).
#
# If you are looking at this script as a reference for implementing
# your own Google Code file uploader, then you should take a look at
... | false | true |
f73c295e767d2e72eeb8337e67e3980c6e104b77 | 30,720 | py | Python | datalad/core/local/tests/test_save.py | m-hess/datalad | 4ac10eb04ba4e8dbee013c053e7937cdf20e9728 | [
"MIT"
] | null | null | null | datalad/core/local/tests/test_save.py | m-hess/datalad | 4ac10eb04ba4e8dbee013c053e7937cdf20e9728 | [
"MIT"
] | null | null | null | datalad/core/local/tests/test_save.py | m-hess/datalad | 4ac10eb04ba4e8dbee013c053e7937cdf20e9728 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# ex: set sts=4 ts=4 sw=4 noet:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package for the
# copyright and license terms.
#
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##... | 34.948805 | 216 | 0.635091 |
ve in False,: #, True TODO when implemented
for annex in True, False:
yield check_renamed_file, recursive, annex
@with_tempfile(mkdir=True)
def test_subdataset_save(path):
parent = Dataset(path).create()
sub = parent.create('sub')
assert_repo_status(parent.path)
create_tree(pare... | true | true |
f73c2a8997a5511656d320908a7fe6620c837af8 | 3,498 | py | Python | ImageLib.py | mukeshmike9/SquareImageWithBlurBG | 168d159c77ca23e624938bcb0fbf9902bd20bf02 | [
"MIT"
] | null | null | null | ImageLib.py | mukeshmike9/SquareImageWithBlurBG | 168d159c77ca23e624938bcb0fbf9902bd20bf02 | [
"MIT"
] | null | null | null | ImageLib.py | mukeshmike9/SquareImageWithBlurBG | 168d159c77ca23e624938bcb0fbf9902bd20bf02 | [
"MIT"
] | null | null | null | from PIL import Image
from PIL import ImageFilter
import os
class ImageLib:
BLUR_LEVEL = 100
EDGE_REMOVAL_FACTOR = 0.08
def __init__(self, path):
abs_path = os.path.abspath(path)
self.img = Image.open(abs_path)
def get_width(self):
return self.img.width
def get_heig... | 35.333333 | 149 | 0.617496 | from PIL import Image
from PIL import ImageFilter
import os
class ImageLib:
BLUR_LEVEL = 100
EDGE_REMOVAL_FACTOR = 0.08
def __init__(self, path):
abs_path = os.path.abspath(path)
self.img = Image.open(abs_path)
def get_width(self):
return self.img.width
def get_heig... | true | true |
f73c2b09416acd915d2f7b0e88cc418e82e0b1d4 | 1,709 | py | Python | gp_emailextractor.py | RohanArora13/Google-Play-Scrapping | df6263f1b60cbf5272747e9f762ec5317aaeb773 | [
"Apache-2.0"
] | null | null | null | gp_emailextractor.py | RohanArora13/Google-Play-Scrapping | df6263f1b60cbf5272747e9f762ec5317aaeb773 | [
"Apache-2.0"
] | null | null | null | gp_emailextractor.py | RohanArora13/Google-Play-Scrapping | df6263f1b60cbf5272747e9f762ec5317aaeb773 | [
"Apache-2.0"
] | null | null | null | import urllib.request
import re,time
s1=time.time()
# some variable for filtering
app_with_download_more_than = 10000
app_updated_after=["year":"2016","date":"1","month":"02"]
def linker(mainlink):
mlink= urllib.request.urlopen(str(mainlink))
page=mlink.read()
#print (page)
link=re.find... | 34.18 | 179 | 0.507314 | import urllib.request
import re,time
s1=time.time()
app_with_download_more_than = 10000
app_updated_after=["year":"2016","date":"1","month":"02"]
def linker(mainlink):
mlink= urllib.request.urlopen(str(mainlink))
page=mlink.read()
link=re.findall('href="/store/apps/details?(.*?)"',str(pa... | false | true |
f73c2c48b9f9d9cdf1e290d0f9538467320272e2 | 1,109 | py | Python | 2020/25/ans1.py | chirsz-ever/aoc | dbdc2e32fbef108752db87f3747ce5898a0775ce | [
"BSL-1.0"
] | null | null | null | 2020/25/ans1.py | chirsz-ever/aoc | dbdc2e32fbef108752db87f3747ce5898a0775ce | [
"BSL-1.0"
] | null | null | null | 2020/25/ans1.py | chirsz-ever/aoc | dbdc2e32fbef108752db87f3747ce5898a0775ce | [
"BSL-1.0"
] | null | null | null | import sys
def modexp(M, s, n):
'''calculate s**n % M'''
assert n >= 0
assert M > 2
s %= M
def loop(k):
if k == 0:
return 1
elif k == 1:
return s
h = loop(k // 2)
if k % 2 == 0:
return h * h % M
else:
return h ... | 19.12069 | 64 | 0.450857 | import sys
def modexp(M, s, n):
assert n >= 0
assert M > 2
s %= M
def loop(k):
if k == 0:
return 1
elif k == 1:
return s
h = loop(k // 2)
if k % 2 == 0:
return h * h % M
else:
return h * h * s % M
return loop(n... | true | true |
f73c2c553a443771d7c12888d49d40898c62caab | 485 | py | Python | examples/example_project/simple_framebuffer.py | szabolcsdombi/zengl | 2c9c26784285f2f049fb5d6fc9da0ad65d32d52f | [
"MIT"
] | 116 | 2021-10-31T17:24:18.000Z | 2022-02-01T05:47:18.000Z | examples/example_project/simple_framebuffer.py | szabolcsdombi/zengl | 2c9c26784285f2f049fb5d6fc9da0ad65d32d52f | [
"MIT"
] | 9 | 2021-11-12T19:21:33.000Z | 2022-01-20T09:48:31.000Z | examples/example_project/simple_framebuffer.py | szabolcsdombi/zengl | 2c9c26784285f2f049fb5d6fc9da0ad65d32d52f | [
"MIT"
] | 3 | 2021-11-12T18:55:05.000Z | 2022-01-19T13:58:26.000Z | from typing import Tuple
from context import Context
class SimpleFramebuffer:
def __init__(self, size: Tuple[int, int]):
ctx = Context.context
self.image = ctx.image(size, 'rgba8unorm')
self.depth = ctx.image(size, 'depth24plus')
self.framebuffer = [self.image, self.depth]
de... | 28.529412 | 59 | 0.641237 | from typing import Tuple
from context import Context
class SimpleFramebuffer:
def __init__(self, size: Tuple[int, int]):
ctx = Context.context
self.image = ctx.image(size, 'rgba8unorm')
self.depth = ctx.image(size, 'depth24plus')
self.framebuffer = [self.image, self.depth]
de... | true | true |
f73c2cba93cc24a4febe325eb4e4af9f9eaebfea | 8,303 | py | Python | selfdrive/thermald/power_monitoring.py | cqxmzz/openpilot | 34ebfa20c05dd559147d601740725704652085a6 | [
"MIT"
] | null | null | null | selfdrive/thermald/power_monitoring.py | cqxmzz/openpilot | 34ebfa20c05dd559147d601740725704652085a6 | [
"MIT"
] | null | null | null | selfdrive/thermald/power_monitoring.py | cqxmzz/openpilot | 34ebfa20c05dd559147d601740725704652085a6 | [
"MIT"
] | null | null | null | import random
import threading
import time
from statistics import mean
from cereal import log
from common.params import Params, put_nonblocking
from common.realtime import sec_since_boot
from selfdrive.hardware import HARDWARE
from selfdrive.swaglog import cloudlog
CAR_VOLTAGE_LOW_PASS_K = 0.091 # LPF gain for 5s tau... | 44.639785 | 153 | 0.696375 | import random
import threading
import time
from statistics import mean
from cereal import log
from common.params import Params, put_nonblocking
from common.realtime import sec_since_boot
from selfdrive.hardware import HARDWARE
from selfdrive.swaglog import cloudlog
CAR_VOLTAGE_LOW_PASS_K = 0.091
CAR_BATTERY_CAPAC... | true | true |
f73c2db0eb83f70a6f3d4dea8b6ce39e1c3bbd56 | 12,053 | py | Python | kuryr_kubernetes/utils.py | MaysaMacedo/kuryr-kubernetes-1 | e4ba3896974e98dc46cb1afd9cbec42646250d72 | [
"Apache-2.0"
] | null | null | null | kuryr_kubernetes/utils.py | MaysaMacedo/kuryr-kubernetes-1 | e4ba3896974e98dc46cb1afd9cbec42646250d72 | [
"Apache-2.0"
] | null | null | null | kuryr_kubernetes/utils.py | MaysaMacedo/kuryr-kubernetes-1 | e4ba3896974e98dc46cb1afd9cbec42646250d72 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 33.856742 | 79 | 0.675516 |
import random
import socket
import time
import requests
from openstack import exceptions as os_exc
from os_vif import objects
from oslo_cache import core as cache
from oslo_config import cfg
from oslo_log import log
from oslo_serialization import jsonutils
from kuryr_kubernetes import clients
from kuryr_... | true | true |
f73c2dbaccbb63faac7110ef4d16045fffd597c7 | 5,953 | py | Python | dataset_preproc/preproc_audio/generate_spectogram.py | RicardoP0/multimodal-matchmap | aa44c574a57073833004172734394882889d8d3b | [
"MIT"
] | null | null | null | dataset_preproc/preproc_audio/generate_spectogram.py | RicardoP0/multimodal-matchmap | aa44c574a57073833004172734394882889d8d3b | [
"MIT"
] | null | null | null | dataset_preproc/preproc_audio/generate_spectogram.py | RicardoP0/multimodal-matchmap | aa44c574a57073833004172734394882889d8d3b | [
"MIT"
] | null | null | null | # %%
import pandas as pd
import librosa
import librosa.display
import os
import numpy as np
import joblib
def scale_minmax(X, min=0.0, max=1.0):
X_std = (X - X.min()) / (X.max() - X.min())
X_scaled = X_std * (max - min) + min
return X_scaled
def gen_melspect(
file_path,
output_name,
sr=None,... | 29.914573 | 94 | 0.502772 |
import pandas as pd
import librosa
import librosa.display
import os
import numpy as np
import joblib
def scale_minmax(X, min=0.0, max=1.0):
X_std = (X - X.min()) / (X.max() - X.min())
X_scaled = X_std * (max - min) + min
return X_scaled
def gen_melspect(
file_path,
output_name,
sr=None,
... | true | true |
f73c2e6cbb4ef05d5df80b92133eda07f03f3434 | 17,987 | py | Python | userbot/modules/pms.py | ayanm09/oub-remix | a475f3a8d2f6895c859568319302cb7796a519d2 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/pms.py | ayanm09/oub-remix | a475f3a8d2f6895c859568319302cb7796a519d2 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/pms.py | ayanm09/oub-remix | a475f3a8d2f6895c859568319302cb7796a519d2 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot module for keeping control who PM's you, Logging pm and muting users in pm """
from telethon.tl.functions.... | 39.794248 | 231 | 0.600878 |
from telethon.tl.functions.contacts import BlockRequest, UnblockRequest
from telethon.tl.functions.messages import ReportSpamRequest
from telethon.tl.types import User
from sqlalchemy.exc import IntegrityError
import asyncio
import os
from telethon.tl.functions.photos import GetUserPhotosRequest
from telethon.tl.... | true | true |
f73c2ecebbc61c0c91579bbdb20cb56ad4987d61 | 23,925 | py | Python | gugu/reference.py | TabQ/gugu | 5b07beeddf51bc981f9624e17b53f1bfd4e9080f | [
"Apache-2.0"
] | 26 | 2019-03-21T02:45:48.000Z | 2022-01-15T06:33:40.000Z | gugu/reference.py | TabQ/gugu | 5b07beeddf51bc981f9624e17b53f1bfd4e9080f | [
"Apache-2.0"
] | null | null | null | gugu/reference.py | TabQ/gugu | 5b07beeddf51bc981f9624e17b53f1bfd4e9080f | [
"Apache-2.0"
] | 10 | 2019-03-23T20:35:29.000Z | 2022-01-15T06:33:40.000Z | # -*- coding:utf-8 -*-
"""
投资参考类
Created on 2019/01/03
@author: TabQ
@group : gugu
@contact: 16621596@qq.com
"""
from __future__ import division
import math
import time
import pandas as pd
from pandas.compat import StringIO
import lxml.html
from lxml import etree
import re
import json
from gugu.utility import Utility... | 34.97807 | 203 | 0.473062 |
from __future__ import division
import math
import time
import pandas as pd
from pandas.compat import StringIO
import lxml.html
from lxml import etree
import re
import json
from gugu.utility import Utility
from gugu.base import Base, cf
class Reference(Base):
def distriPlan(self, year=2015, top=25, retry=3, pau... | true | true |
f73c2ef280ee58d10169a5c4ca348deb578bacb0 | 393 | py | Python | backend/Virtuele/asgi.py | harizMunawar/La-Virtuele | 051d11a281620b36638b6be50e71d3c893ce1568 | [
"MIT"
] | 2 | 2021-02-23T16:30:27.000Z | 2021-03-21T08:12:39.000Z | backend/Virtuele/asgi.py | harizMunawar/La-Virtuele | 051d11a281620b36638b6be50e71d3c893ce1568 | [
"MIT"
] | 9 | 2021-02-23T09:05:32.000Z | 2021-07-02T11:41:55.000Z | backend/Virtuele/asgi.py | harizMunawar/La-Virtuele | 051d11a281620b36638b6be50e71d3c893ce1568 | [
"MIT"
] | 1 | 2021-02-23T07:42:17.000Z | 2021-02-23T07:42:17.000Z | """
ASGI config for Virtuele project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETT... | 23.117647 | 78 | 0.78626 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Virtuele.settings')
application = get_asgi_application()
| true | true |
f73c2f35a9443a342845f973b08b1cf07829ed1a | 7,500 | py | Python | src/experiments/simple.py | bathienle/master-thesis-code | 58182f54a56c34fb4a33d67743ca515c80e33657 | [
"Apache-2.0"
] | 2 | 2021-06-22T13:43:40.000Z | 2022-03-01T18:15:32.000Z | src/experiments/simple.py | bathienle/master-thesis-code | 58182f54a56c34fb4a33d67743ca515c80e33657 | [
"Apache-2.0"
] | null | null | null | src/experiments/simple.py | bathienle/master-thesis-code | 58182f54a56c34fb4a33d67743ca515c80e33657 | [
"Apache-2.0"
] | null | null | null | """
Training without inclusion and exclusion map or train with U-Net model
"""
import csv
import numpy as np
import time
import torch
import os
from argparse import ArgumentParser
from torch.optim import Adam
from torch.utils.data import DataLoader
from src import (
NuClick, UNet, TestDataset, Loss, convert_time... | 25.510204 | 77 | 0.588 |
import csv
import numpy as np
import time
import torch
import os
from argparse import ArgumentParser
from torch.optim import Adam
from torch.utils.data import DataLoader
from src import (
NuClick, UNet, TestDataset, Loss, convert_time, str2bool
)
device = torch.device('cuda' if torch.cuda.is_available() else ... | true | true |
f73c309e1b8e2cadcebc2584737e88a986a6c579 | 284 | py | Python | omgbadges/settings/development.py | HarishTeens/omg-badges | cd60b6235b24c6a7831a0794cee57b70ecb9bdc8 | [
"Apache-2.0"
] | null | null | null | omgbadges/settings/development.py | HarishTeens/omg-badges | cd60b6235b24c6a7831a0794cee57b70ecb9bdc8 | [
"Apache-2.0"
] | 1 | 2020-11-17T15:17:39.000Z | 2020-11-17T15:17:39.000Z | omgbadges/settings/development.py | HarishTeens/omg-badges | cd60b6235b24c6a7831a0794cee57b70ecb9bdc8 | [
"Apache-2.0"
] | null | null | null | from .base import *
DEBUG = True
ALLOWED_HOSTS = ['localhost','badges.dscnitrourkela.tech']
CORS_ORIGIN_WHITELIST =['http://localhost:8080']
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
} | 21.846154 | 58 | 0.644366 | from .base import *
DEBUG = True
ALLOWED_HOSTS = ['localhost','badges.dscnitrourkela.tech']
CORS_ORIGIN_WHITELIST =['http://localhost:8080']
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
} | true | true |
f73c31d55a91eed1b3a01766992ad440ebbd2837 | 543 | py | Python | apps/hobbygroups/dashboard/views.py | mariusaarsnes/onlineweb4 | 3495321dabfd7a7236e6d841b004e9f855b6f30e | [
"MIT"
] | null | null | null | apps/hobbygroups/dashboard/views.py | mariusaarsnes/onlineweb4 | 3495321dabfd7a7236e6d841b004e9f855b6f30e | [
"MIT"
] | null | null | null | apps/hobbygroups/dashboard/views.py | mariusaarsnes/onlineweb4 | 3495321dabfd7a7236e6d841b004e9f855b6f30e | [
"MIT"
] | null | null | null | from django.contrib.auth.decorators import login_required
from django.core.exceptions import PermissionDenied
from django.shortcuts import render
from guardian.decorators import permission_required
from apps.dashboard.tools import get_base_context, has_access
@login_required
@permission_required('hobbygroups.change_... | 28.578947 | 71 | 0.813996 | from django.contrib.auth.decorators import login_required
from django.core.exceptions import PermissionDenied
from django.shortcuts import render
from guardian.decorators import permission_required
from apps.dashboard.tools import get_base_context, has_access
@login_required
@permission_required('hobbygroups.change_... | true | true |
f73c32342d3f5903a15b85853b5c60ae2bf1c9dd | 1,182 | py | Python | pyvisdk/do/admin_password_not_changed_event.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | pyvisdk/do/admin_password_not_changed_event.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | pyvisdk/do/admin_password_not_changed_event.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def AdminPasswordNotChangedEvent(vim, *args, **kwargs):
'''Default password for the Admin... | 34.764706 | 124 | 0.612521 |
import logging
from pyvisdk.exceptions import InvalidArgumentError
| true | true |
f73c323c7d28744bf7dce05729310a1c8559720b | 18,201 | py | Python | third_party/webrtc/src/chromium/src/tools/licenses.py | bopopescu/webrtc-streaming-node | 727a441204344ff596401b0253caac372b714d91 | [
"MIT"
] | 8 | 2016-02-08T11:59:31.000Z | 2020-05-31T15:19:54.000Z | third_party/webrtc/src/chromium/src/tools/licenses.py | bopopescu/webrtc-streaming-node | 727a441204344ff596401b0253caac372b714d91 | [
"MIT"
] | 1 | 2021-05-05T11:11:31.000Z | 2021-05-05T11:11:31.000Z | third_party/webrtc/src/chromium/src/tools/licenses.py | bopopescu/webrtc-streaming-node | 727a441204344ff596401b0253caac372b714d91 | [
"MIT"
] | 7 | 2016-02-09T09:28:14.000Z | 2020-07-25T19:03:36.000Z | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility for checking and processing licensing information in third_party
directories.
Usage: licenses.py <command>
Commands:
... | 35.618395 | 80 | 0.593209 |
"""Utility for checking and processing licensing information in third_party
directories.
Usage: licenses.py <command>
Commands:
scan scan third_party directories, verifying that we have licensing info
credits generate about:credits on stdout
(You can also import this as a module.)
"""
import argparse
... | false | true |
f73c3274922d2e2f82105412ce9fa01d7035e3e1 | 3,836 | py | Python | cogctl/cli/config.py | operable/cogctl | bec66471189376e0c33be88edb68f3af8797fc8c | [
"Apache-2.0"
] | 3 | 2016-05-09T23:14:47.000Z | 2017-01-15T20:41:25.000Z | cogctl/cli/config.py | operable/cogctl | bec66471189376e0c33be88edb68f3af8797fc8c | [
"Apache-2.0"
] | 59 | 2016-03-10T20:53:04.000Z | 2021-09-03T17:26:02.000Z | cogctl/cli/config.py | operable/cogctl | bec66471189376e0c33be88edb68f3af8797fc8c | [
"Apache-2.0"
] | 7 | 2016-03-09T21:43:33.000Z | 2019-01-24T15:44:06.000Z | import copy
import os
from configobj import ConfigObj
from collections import OrderedDict
class CogctlConfig():
def __init__(self, filename):
self.filename = filename
if os.path.isfile(filename):
# If the file exists it should be valid, so just try to
# get the default pro... | 32.786325 | 80 | 0.612878 | import copy
import os
from configobj import ConfigObj
from collections import OrderedDict
class CogctlConfig():
def __init__(self, filename):
self.filename = filename
if os.path.isfile(filename):
self._config = ConfigObj(filename)
self.default()
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.