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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c093ae2893336f82fa7e391dae4bfb69817dd33 | 467 | py | Python | plots/model_explorer/plotters/utils/text/font.py | ZviBaratz/pylabber | 35337284f3d0615249f642743b993b7dad407390 | [
"Apache-2.0"
] | 3 | 2020-08-28T21:33:07.000Z | 2021-07-19T17:52:17.000Z | plots/model_explorer/plotters/utils/text/font.py | TheLabbingProject/pylabber | 27d6073e7bde871c16912a8ea5e0e389711bbd9f | [
"Apache-2.0"
] | 74 | 2019-09-04T11:40:16.000Z | 2022-01-03T19:43:04.000Z | plots/model_explorer/plotters/utils/text/font.py | ZviBaratz/pylabber | 35337284f3d0615249f642743b993b7dad407390 | [
"Apache-2.0"
] | 3 | 2019-05-07T07:09:05.000Z | 2019-08-30T15:40:47.000Z | from enum import Enum
class Font(Enum):
arial = "Arial"
calibri = "Calibri"
cursive = "Cursive"
fantasy = "Fantasy"
georgia = "Georgia"
helvetica = "Helvetica"
monospace = "Monospace"
sans_serif = "Sans-Serif"
serif = "Serif"
system_ui = "System UI"
times = "Times"
verd... | 22.238095 | 81 | 0.603854 | from enum import Enum
class Font(Enum):
arial = "Arial"
calibri = "Calibri"
cursive = "Cursive"
fantasy = "Fantasy"
georgia = "Georgia"
helvetica = "Helvetica"
monospace = "Monospace"
sans_serif = "Sans-Serif"
serif = "Serif"
system_ui = "System UI"
times = "Times"
verd... | true | true |
1c093c627fc8e981b38f19fee8e504d92702ccc6 | 647 | py | Python | xen/xen-4.2.2/tools/python/xen/util/xsm/xsm.py | zhiming-shen/Xen-Blanket-NG | 47e59d9bb92e8fdc60942df526790ddb983a5496 | [
"Apache-2.0"
] | 1 | 2018-02-02T00:15:26.000Z | 2018-02-02T00:15:26.000Z | xen/xen-4.2.2/tools/python/xen/util/xsm/xsm.py | zhiming-shen/Xen-Blanket-NG | 47e59d9bb92e8fdc60942df526790ddb983a5496 | [
"Apache-2.0"
] | null | null | null | xen/xen-4.2.2/tools/python/xen/util/xsm/xsm.py | zhiming-shen/Xen-Blanket-NG | 47e59d9bb92e8fdc60942df526790ddb983a5496 | [
"Apache-2.0"
] | 1 | 2019-05-27T09:47:18.000Z | 2019-05-27T09:47:18.000Z | import sys
import string
from xen.xend import XendOptions
from xen.util import xsconstants
from xsm_core import xsm_init
xoptions = XendOptions.instance()
xsm_module_name = xoptions.get_xsm_module_name()
xsconstants.XS_POLICY_USE = eval("xsconstants.XS_POLICY_" +
string.upper(xsm_modu... | 30.809524 | 75 | 0.72643 | import sys
import string
from xen.xend import XendOptions
from xen.util import xsconstants
from xsm_core import xsm_init
xoptions = XendOptions.instance()
xsm_module_name = xoptions.get_xsm_module_name()
xsconstants.XS_POLICY_USE = eval("xsconstants.XS_POLICY_" +
string.upper(xsm_modu... | true | true |
1c093e4b60da67db9b0b2c103edc4283d8b7090d | 106 | py | Python | mwe_discov_eval/databases/__init__.py | nicolaCirillo/mwe_discov_eval | 36f544a802f68d7e274627d57a65531ff23c4c5e | [
"MIT"
] | null | null | null | mwe_discov_eval/databases/__init__.py | nicolaCirillo/mwe_discov_eval | 36f544a802f68d7e274627d57a65531ff23c4c5e | [
"MIT"
] | null | null | null | mwe_discov_eval/databases/__init__.py | nicolaCirillo/mwe_discov_eval | 36f544a802f68d7e274627d57a65531ff23c4c5e | [
"MIT"
] | null | null | null | from .NgramCounter import NgramCounter
from .NgramDb import NgramDb
from .EmbeddingsDb import EmbeddingsDb | 35.333333 | 38 | 0.867925 | from .NgramCounter import NgramCounter
from .NgramDb import NgramDb
from .EmbeddingsDb import EmbeddingsDb | true | true |
1c093ee637bf7e961ef7fcdba0eca16983b130e0 | 24,477 | py | Python | hs_tools_resource/models.py | ResearchSoftwareInstitute/MyHPOM | 2d48fe5ac8d21173b1685eb33059bb391fe24414 | [
"BSD-3-Clause"
] | 1 | 2018-09-17T13:07:29.000Z | 2018-09-17T13:07:29.000Z | hs_tools_resource/models.py | ResearchSoftwareInstitute/MyHPOM | 2d48fe5ac8d21173b1685eb33059bb391fe24414 | [
"BSD-3-Clause"
] | 100 | 2017-08-01T23:48:04.000Z | 2018-04-03T13:17:27.000Z | hs_tools_resource/models.py | ResearchSoftwareInstitute/MyHPOM | 2d48fe5ac8d21173b1685eb33059bb391fe24414 | [
"BSD-3-Clause"
] | 1 | 2018-06-28T13:19:58.000Z | 2018-06-28T13:19:58.000Z | import requests
import base64
import imghdr
from django.db import models, transaction
from django.contrib.contenttypes.fields import GenericRelation
from django.core.exceptions import ValidationError
from django.http import HttpResponse
from mezzanine.pages.page_processors import processor_for
from hs_core.models im... | 39.929853 | 100 | 0.649263 | import requests
import base64
import imghdr
from django.db import models, transaction
from django.contrib.contenttypes.fields import GenericRelation
from django.core.exceptions import ValidationError
from django.http import HttpResponse
from mezzanine.pages.page_processors import processor_for
from hs_core.models im... | true | true |
1c093f2548985e647569aaacbbe276ef5765da26 | 11,858 | py | Python | mmpose/models/backbones/regnet.py | woffett/mmpose | cf8cbf49759e745896b70ce69d412518568af33b | [
"Apache-2.0"
] | 1 | 2020-09-22T03:39:47.000Z | 2020-09-22T03:39:47.000Z | mmpose/models/backbones/regnet.py | woffett/mmpose | cf8cbf49759e745896b70ce69d412518568af33b | [
"Apache-2.0"
] | null | null | null | mmpose/models/backbones/regnet.py | woffett/mmpose | cf8cbf49759e745896b70ce69d412518568af33b | [
"Apache-2.0"
] | 1 | 2021-12-29T08:21:50.000Z | 2021-12-29T08:21:50.000Z | import numpy as np
import torch.nn as nn
from mmcv.cnn import build_conv_layer, build_norm_layer
from ..registry import BACKBONES
from .resnet import ResNet
from .resnext import Bottleneck
@BACKBONES.register_module()
class RegNet(ResNet):
"""RegNet backbone.
More details can be found in `paper <https://arx... | 37.884984 | 79 | 0.569067 | import numpy as np
import torch.nn as nn
from mmcv.cnn import build_conv_layer, build_norm_layer
from ..registry import BACKBONES
from .resnet import ResNet
from .resnext import Bottleneck
@BACKBONES.register_module()
class RegNet(ResNet):
arch_settings = {
'regnetx_400mf':
dict(w0=24, wa=24.48, ... | true | true |
1c093fae8ab8553777f048514ca4fc755cf9d14d | 721 | py | Python | gopdb/config.py | lolizeppelin/gopdb | 6eefd8f01cf77d224f2fd48bc4f4eac8a6e3e296 | [
"MIT"
] | null | null | null | gopdb/config.py | lolizeppelin/gopdb | 6eefd8f01cf77d224f2fd48bc4f4eac8a6e3e296 | [
"MIT"
] | null | null | null | gopdb/config.py | lolizeppelin/gopdb | 6eefd8f01cf77d224f2fd48bc4f4eac8a6e3e296 | [
"MIT"
] | null | null | null | from simpleutil.config import cfg
def list_server_opts():
from simpleservice.ormdb.config import database_opts
from goperation.manager.wsgi.config import route_opts
cfg.set_defaults(route_opts, routes=['gopdb.api.wsgi.routers'])
return route_opts + database_opts
def list_agent_opts():
from gopdb i... | 37.947368 | 69 | 0.769764 | from simpleutil.config import cfg
def list_server_opts():
from simpleservice.ormdb.config import database_opts
from goperation.manager.wsgi.config import route_opts
cfg.set_defaults(route_opts, routes=['gopdb.api.wsgi.routers'])
return route_opts + database_opts
def list_agent_opts():
from gopdb i... | true | true |
1c09407f54f4e585745e9f6029a6c078f9254184 | 2,101 | py | Python | setup.py | RayeRen/wavenet_vocoder | e655dccd283bba09edfc2d3ef39096ea5eed4c9c | [
"MIT"
] | 3 | 2019-06-26T21:32:08.000Z | 2020-01-15T19:45:17.000Z | setup.py | RayeRen/wavenet_vocoder | e655dccd283bba09edfc2d3ef39096ea5eed4c9c | [
"MIT"
] | null | null | null | setup.py | RayeRen/wavenet_vocoder | e655dccd283bba09edfc2d3ef39096ea5eed4c9c | [
"MIT"
] | 2 | 2019-10-02T02:19:48.000Z | 2019-11-24T06:52:15.000Z | #!/usr/bin/env python
from setuptools import setup, find_packages
import setuptools.command.develop
import setuptools.command.build_py
import os
import subprocess
version = '0.0.5'
# Adapted from https://github.com/pytorch/pytorch
cwd = os.path.dirname(os.path.abspath(__file__))
if os.getenv('WAVENET_VOCODER_BUILD_V... | 26.2625 | 74 | 0.566397 |
from setuptools import setup, find_packages
import setuptools.command.develop
import setuptools.command.build_py
import os
import subprocess
version = '0.0.5'
cwd = os.path.dirname(os.path.abspath(__file__))
if os.getenv('WAVENET_VOCODER_BUILD_VERSION'):
version = os.getenv('WAVENET_VOCODER_BUILD_VERSION')
else:... | true | true |
1c09412277a701918d5981d2b8e4a8516ffb5c11 | 6,390 | py | Python | libreco/data/data_generator.py | massquantity/Reco_Project | 6e577d6c3a5f7372d88c25dd9f540a1b7651180f | [
"MIT"
] | null | null | null | libreco/data/data_generator.py | massquantity/Reco_Project | 6e577d6c3a5f7372d88c25dd9f540a1b7651180f | [
"MIT"
] | null | null | null | libreco/data/data_generator.py | massquantity/Reco_Project | 6e577d6c3a5f7372d88c25dd9f540a1b7651180f | [
"MIT"
] | null | null | null | import numpy as np
import tqdm
from .sequence import sparse_user_interacted, user_interacted_seq
class DataGenPure(object):
def __init__(self, data):
self.data_size = len(data)
self.user_indices = data.user_indices
self.item_indices = data.item_indices
self.labels = data.labels
... | 36.724138 | 75 | 0.546166 | import numpy as np
import tqdm
from .sequence import sparse_user_interacted, user_interacted_seq
class DataGenPure(object):
def __init__(self, data):
self.data_size = len(data)
self.user_indices = data.user_indices
self.item_indices = data.item_indices
self.labels = data.labels
... | true | true |
1c094560e4eb6330f5f551e5735f07994439b6c9 | 4,772 | py | Python | datasets/setswana_ner_corpus/setswana_ner_corpus.py | dkajtoch/datasets | 12ef7f0d541a5aca5b29ebc2dddf5e1214f0e3e9 | [
"Apache-2.0"
] | 9 | 2021-04-26T14:43:52.000Z | 2021-11-08T09:47:24.000Z | datasets/setswana_ner_corpus/setswana_ner_corpus.py | dkajtoch/datasets | 12ef7f0d541a5aca5b29ebc2dddf5e1214f0e3e9 | [
"Apache-2.0"
] | null | null | null | datasets/setswana_ner_corpus/setswana_ner_corpus.py | dkajtoch/datasets | 12ef7f0d541a5aca5b29ebc2dddf5e1214f0e3e9 | [
"Apache-2.0"
] | 1 | 2021-03-24T18:33:32.000Z | 2021-03-24T18:33:32.000Z | # coding=utf-8
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# 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/lice... | 35.61194 | 200 | 0.547988 |
from __future__ import absolute_import, division, print_function
import os
import datasets
logger = datasets.logging.get_logger(__name__)
_CITATION = """\
@inproceedings{sepedi_ner_corpus,
author = {S.S.B.M. Phakedi and
Roald Eiselen},
title = {NCHLT Setswana Named Entity Annotated Corpu... | true | true |
1c0945b970f1a0a7cd9a5639eb53783b21af2358 | 2,330 | py | Python | test/functional/feature_config_args.py | MichaelHDesigns/HodlCash | c3ca85c436ba40afadfda11db207068a16527379 | [
"MIT"
] | null | null | null | test/functional/feature_config_args.py | MichaelHDesigns/HodlCash | c3ca85c436ba40afadfda11db207068a16527379 | [
"MIT"
] | null | null | null | test/functional/feature_config_args.py | MichaelHDesigns/HodlCash | c3ca85c436ba40afadfda11db207068a16527379 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 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 various command line arguments and configuration file parameters."""
import os
from test_framework.te... | 46.6 | 169 | 0.694421 |
import os
from test_framework.test_framework import HodlCashTestFramework
from test_framework.util import get_datadir_path
class ConfArgsTest(HodlCashTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 1
def run_test(self):
self.stop_node(0)
... | true | true |
1c094606d6f78a4e573f4e5a91a0abfdc3f34a7e | 2,034 | py | Python | tests/common_utils.py | www516717402/TinyNeuralNetwork | 23e7931b4377462fad94a9ab0651b6d9a346252d | [
"MIT"
] | 1 | 2022-01-11T06:40:13.000Z | 2022-01-11T06:40:13.000Z | tests/common_utils.py | kingkie/TinyNeuralNetwork | 9b4313bbe6fb46d602681b69799e4725eef4d71b | [
"MIT"
] | null | null | null | tests/common_utils.py | kingkie/TinyNeuralNetwork | 9b4313bbe6fb46d602681b69799e4725eef4d71b | [
"MIT"
] | 1 | 2021-12-20T07:21:37.000Z | 2021-12-20T07:21:37.000Z | import torch
import torchvision
import inspect
import models
def collect_torchvision_models():
torchvision_model_classes = []
for key in torchvision.models.__dict__:
item = getattr(torchvision.models, key)
if inspect.isfunction(item):
no_arg = True
has_pretrained = Fa... | 31.292308 | 81 | 0.577679 | import torch
import torchvision
import inspect
import models
def collect_torchvision_models():
torchvision_model_classes = []
for key in torchvision.models.__dict__:
item = getattr(torchvision.models, key)
if inspect.isfunction(item):
no_arg = True
has_pretrained = Fa... | true | true |
1c09466a09bc2bb08a1571590dde45a07ee5f297 | 96,946 | py | Python | python/ccxt/kucoin.py | Cojad/ccxt | e92cefa9269977cf99fe42ffd6ab4ca0183fde07 | [
"MIT"
] | 500 | 2017-06-28T14:43:21.000Z | 2022-03-11T14:19:00.000Z | python/ccxt/kucoin.py | ZenSwordman/ccxt | 48069e3b492260ff8c99fbd6b2ce1bb7e8464992 | [
"MIT"
] | 214 | 2017-07-03T17:39:26.000Z | 2017-09-20T02:41:20.000Z | python/ccxt/kucoin.py | ZenSwordman/ccxt | 48069e3b492260ff8c99fbd6b2ce1bb7e8464992 | [
"MIT"
] | 127 | 2017-06-30T05:49:24.000Z | 2021-11-05T22:39:56.000Z | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
import hashlib
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import ... | 43.087111 | 184 | 0.458369 |
from ccxt.base.exchange import Exchange
import hashlib
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import PermissionDenied
from ccxt.base.errors import AccountSuspended
from ccxt.base.errors import ArgumentsRequired
from ccxt.base.error... | true | true |
1c09471a3d9d5f65b1542512fccf72f4af1c8a25 | 1,279 | py | Python | amr_verbnet_semantics/test/test_service.py | daiki-kimura/AMR-CSLogic-1 | f0227809aa29a7eb666d12f3cafa828cfb042fff | [
"Apache-2.0"
] | 4 | 2022-02-17T17:52:56.000Z | 2022-02-22T16:36:58.000Z | amr_verbnet_semantics/test/test_service.py | daiki-kimura/AMR-CSLogic-1 | f0227809aa29a7eb666d12f3cafa828cfb042fff | [
"Apache-2.0"
] | 1 | 2022-02-25T07:58:58.000Z | 2022-02-25T07:58:58.000Z | amr_verbnet_semantics/test/test_service.py | daiki-kimura/AMR-CSLogic-1 | f0227809aa29a7eb666d12f3cafa828cfb042fff | [
"Apache-2.0"
] | 1 | 2022-02-22T16:40:41.000Z | 2022-02-22T16:40:41.000Z | # Test for services
import argparse
import json
from pprint import pprint
import requests
parser = argparse.ArgumentParser()
parser.add_argument('--ip', type=str, default='0.0.0.0')
parser.add_argument('--port', type=int, default=5000)
parser.add_argument('--text', type=str, default='You enter a kitchen.')
args = ... | 24.132075 | 71 | 0.612197 |
import argparse
import json
from pprint import pprint
import requests
parser = argparse.ArgumentParser()
parser.add_argument('--ip', type=str, default='0.0.0.0')
parser.add_argument('--port', type=int, default=5000)
parser.add_argument('--text', type=str, default='You enter a kitchen.')
args = parser.parse_args()
... | true | true |
1c094840d299df046abdfec4b1f5cfa218a91f5d | 81,390 | py | Python | sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/_models.py | mohamedshabanofficial/azure-sdk-for-python | 81c585f310cd2ec23d2ad145173958914a075a58 | [
"MIT"
] | 2 | 2021-03-24T06:26:11.000Z | 2021-04-18T15:55:59.000Z | sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/_models.py | mohamedshabanofficial/azure-sdk-for-python | 81c585f310cd2ec23d2ad145173958914a075a58 | [
"MIT"
] | 2 | 2021-11-03T06:10:36.000Z | 2021-12-01T06:29:39.000Z | sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/_models.py | mohamedshabanofficial/azure-sdk-for-python | 81c585f310cd2ec23d2ad145173958914a075a58 | [
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 37.062842 | 165 | 0.642425 |
from azure.core.exceptions import HttpResponseError
import msrest.serialization
class AvailableServiceTier(msrest.serialization.Model):
_validation = {
'service_tier': {'readonly': True},
'enabled': {'readonly': True},
'minimum_retention': {'readonly': True},
'maximum_retention':... | true | true |
1c0949fd91c180cb0c6994d24d8668847d43800e | 58 | py | Python | val.py | patrickdijusto/python.hub | 776a6a843dbd8895c414dcb8e7730c8cb2f3894d | [
"MIT"
] | null | null | null | val.py | patrickdijusto/python.hub | 776a6a843dbd8895c414dcb8e7730c8cb2f3894d | [
"MIT"
] | null | null | null | val.py | patrickdijusto/python.hub | 776a6a843dbd8895c414dcb8e7730c8cb2f3894d | [
"MIT"
] | null | null | null | def x(val):
val[0] = 45
val= [2,4,6]
x(val)
print(val) | 7.25 | 12 | 0.534483 | def x(val):
val[0] = 45
val= [2,4,6]
x(val)
print(val) | true | true |
1c094b56261db460021c5094940d93aac84d6aaf | 1,243 | py | Python | src/Caroline/client_side/remote_mongo_test.py | smalbadger/TradeBot | a6d4b443a6584af3e91b2d9bf0162db2b4c362e5 | [
"Apache-2.0"
] | null | null | null | src/Caroline/client_side/remote_mongo_test.py | smalbadger/TradeBot | a6d4b443a6584af3e91b2d9bf0162db2b4c362e5 | [
"Apache-2.0"
] | null | null | null | src/Caroline/client_side/remote_mongo_test.py | smalbadger/TradeBot | a6d4b443a6584af3e91b2d9bf0162db2b4c362e5 | [
"Apache-2.0"
] | null | null | null | import pymongo
from getpass import getpass
from datetime import datetime, timedelta
import matplotlib.pyplot as plt
#username = input("Username: ")
#password = getpass()
db = 'cryptos'
successful_login = True
client = pymongo.MongoClient("mongodb://sam:GoodVibrations_69@192.168.0.23/cryptos")
#client = pymongo.MongoC... | 24.86 | 94 | 0.65004 | import pymongo
from getpass import getpass
from datetime import datetime, timedelta
import matplotlib.pyplot as plt
db = 'cryptos'
successful_login = True
client = pymongo.MongoClient("mongodb://sam:GoodVibrations_69@192.168.0.23/cryptos")
db = client.cryptos
for collection_name in db.collection_names():
print(... | true | true |
1c094cb55ef5a0b8dd7d9d5a4445fba5a33044b3 | 6,370 | py | Python | youtube.py | nichham2/telegram_spotify-bot | dc966f817b0c7a2b98e11700ed15fcbf7e0a9ed5 | [
"MIT"
] | null | null | null | youtube.py | nichham2/telegram_spotify-bot | dc966f817b0c7a2b98e11700ed15fcbf7e0a9ed5 | [
"MIT"
] | null | null | null | youtube.py | nichham2/telegram_spotify-bot | dc966f817b0c7a2b98e11700ed15fcbf7e0a9ed5 | [
"MIT"
] | 1 | 2022-03-17T03:39:05.000Z | 2022-03-17T03:39:05.000Z | #!/usr/bin/python3
from pytube import YouTube
from bs4 import BeautifulSoup
import requests
import lxml
import os
#IMPORT WITH STDOUT REDIRECTION
#FIX STARTUP PYGAME HELLO MESSAGE
#THANKS @Mad Physicist FROM STACK OVERFLOW
import contextlib
# with contextlib.redirect_stdout(None):
# from moviepy.editor import *
# ... | 26.431535 | 134 | 0.553218 | from pytube import YouTube
from bs4 import BeautifulSoup
import requests
import lxml
import os
import contextlib
import imageio
imageio.plugins.ffmpeg.download()
from moviepy.editor import *
import moviepy.editor as mp
import logging
logging.basicConfig(level=logging.INFO,
format='%(asctime)s - ... | true | true |
1c094ce5d0e11367f6fd05d22e1b45b54368bdc6 | 14,035 | py | Python | coapthon/serializer.py | Dalanke/CoAPthon | 6587d950c7cd76197beaf7b6b8d227d81340a8d7 | [
"MIT"
] | 237 | 2015-01-06T17:13:39.000Z | 2022-02-15T10:26:18.000Z | coapthon/serializer.py | Dalanke/CoAPthon | 6587d950c7cd76197beaf7b6b8d227d81340a8d7 | [
"MIT"
] | 143 | 2015-02-04T11:34:08.000Z | 2022-03-04T10:58:30.000Z | coapthon/serializer.py | Dalanke/CoAPthon | 6587d950c7cd76197beaf7b6b8d227d81340a8d7 | [
"MIT"
] | 159 | 2015-02-10T00:57:34.000Z | 2022-02-19T11:31:08.000Z | import logging
import struct
import ctypes
from coapthon.messages.request import Request
from coapthon.messages.response import Response
from coapthon.messages.option import Option
from coapthon import defines
from coapthon.messages.message import Message
__author__ = 'Giacomo Tanganelli'
logger = logging.getLogger(_... | 35.263819 | 112 | 0.52476 | import logging
import struct
import ctypes
from coapthon.messages.request import Request
from coapthon.messages.response import Response
from coapthon.messages.option import Option
from coapthon import defines
from coapthon.messages.message import Message
__author__ = 'Giacomo Tanganelli'
logger = logging.getLogger(_... | true | true |
1c094e229b35d61bab627c488a688b5efc71f84b | 3,400 | py | Python | hummingbot/client/ui/hummingbot_cli.py | rnw2000/hummingbot | 812691718b6738a27a2fc65ace60776e43129070 | [
"Apache-2.0"
] | null | null | null | hummingbot/client/ui/hummingbot_cli.py | rnw2000/hummingbot | 812691718b6738a27a2fc65ace60776e43129070 | [
"Apache-2.0"
] | 15 | 2020-08-17T07:08:56.000Z | 2020-08-25T03:22:48.000Z | hummingbot/client/ui/hummingbot_cli.py | rnw2000/hummingbot | 812691718b6738a27a2fc65ace60776e43129070 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import asyncio
from typing import Callable
from prompt_toolkit.key_binding import KeyBindings
from prompt_toolkit.application import Application
from prompt_toolkit.clipboard.pyperclip import PyperclipClipboard
from prompt_toolkit.document import Document
from prompt_toolkit.eventloop import use_... | 31.775701 | 116 | 0.658235 |
import asyncio
from typing import Callable
from prompt_toolkit.key_binding import KeyBindings
from prompt_toolkit.application import Application
from prompt_toolkit.clipboard.pyperclip import PyperclipClipboard
from prompt_toolkit.document import Document
from prompt_toolkit.eventloop import use_asyncio_event_loop
fro... | true | true |
1c094ecc3d2f0a416d62945f20f05fea45b254bc | 2,002 | py | Python | examples/python/water.py | engagementlab/upm | 9be920dbcd4ff9f333bce27e937a6e72e46899d6 | [
"MIT"
] | 1 | 2018-11-08T03:59:01.000Z | 2018-11-08T03:59:01.000Z | examples/python/water.py | engagementlab/upm | 9be920dbcd4ff9f333bce27e937a6e72e46899d6 | [
"MIT"
] | null | null | null | examples/python/water.py | engagementlab/upm | 9be920dbcd4ff9f333bce27e937a6e72e46899d6 | [
"MIT"
] | 1 | 2018-11-08T03:59:04.000Z | 2018-11-08T03:59:04.000Z | #!/usr/bin/python
# Author: Zion Orent <zorent@ics.com>
# Copyright (c) 2015 Intel Corporation.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limi... | 36.4 | 85 | 0.726274 |
from __future__ import print_function
import time, sys, signal, atexit
from upm import pyupm_water as upmwater
def main():
myWaterSensor = upmwater.Water(2)
def SIGINTHandler(signum, frame):
raise SystemExit
def exitHandler():
print("Exiting")
sys.exit(0)
... | true | true |
1c094f3d9e82307bcf194961d882436dbd2ae84b | 8,863 | py | Python | TimeLine.py | duduainankai/zhihu-terminal | cd57efc606138eee84385a6425998814a0029043 | [
"MIT"
] | 340 | 2016-07-17T08:28:39.000Z | 2022-03-30T15:23:27.000Z | TimeLine.py | mrpascalpa/zhihu-terminal | cd57efc606138eee84385a6425998814a0029043 | [
"MIT"
] | 10 | 2016-08-10T00:19:31.000Z | 2020-04-22T08:24:25.000Z | TimeLine.py | mrpascalpa/zhihu-terminal | cd57efc606138eee84385a6425998814a0029043 | [
"MIT"
] | 76 | 2016-07-17T12:18:31.000Z | 2021-12-21T09:01:03.000Z | #!/usr/bin/env python
# encoding: utf-8
"""
@version: 1.0
@author: lizheming
@contact: nkdudu@126.com
@site: lizheming.top
@file: TimeLine.py
"""
import re
import termcolor
from zhihu import zhihu, error, clear
class TLItem:
item = None
def __init__(self, item, _xsrf):
self.item = item
self... | 36.32377 | 133 | 0.513822 |
"""
@version: 1.0
@author: lizheming
@contact: nkdudu@126.com
@site: lizheming.top
@file: TimeLine.py
"""
import re
import termcolor
from zhihu import zhihu, error, clear
class TLItem:
item = None
def __init__(self, item, _xsrf):
self.item = item
self._xsrf = _xsrf
def get_id(self):
... | false | true |
1c094f40d64f851800044c1dbb7b58868b289b67 | 2,533 | py | Python | src/scenic/core/specifiers.py | shr-project/Scenic | e3ea4c426af7619b4308233fa5e7a33ebcf5dcb9 | [
"BSD-3-Clause"
] | 1 | 2019-06-14T21:04:37.000Z | 2019-06-14T21:04:37.000Z | src/scenic/core/specifiers.py | shr-project/Scenic | e3ea4c426af7619b4308233fa5e7a33ebcf5dcb9 | [
"BSD-3-Clause"
] | null | null | null | src/scenic/core/specifiers.py | shr-project/Scenic | e3ea4c426af7619b4308233fa5e7a33ebcf5dcb9 | [
"BSD-3-Clause"
] | 2 | 2020-01-02T12:37:46.000Z | 2020-07-30T02:02:01.000Z |
### Specifiers and associated objects
import itertools
from scenic.core.lazy_eval import (DelayedArgument, toDelayedArgument, requiredProperties,
needsLazyEvaluation)
from scenic.core.distributions import toDistribution
from scenic.core.utils import RuntimeParseError
## Specifiers... | 30.890244 | 90 | 0.739834 |
import itertools
from scenic.core.lazy_eval import (DelayedArgument, toDelayedArgument, requiredProperties,
needsLazyEvaluation)
from scenic.core.distributions import toDistribution
from scenic.core.utils import RuntimeParseError
class Specifier:
def __init__(self, prop, value, ... | true | true |
1c094fa40dbd843bf1547154aefdf6a17d13b6b0 | 3,644 | py | Python | uwezoachievers/settings.py | Dennis-tec/uwezoachievers | d599c96db6cd8eef1afe05dc508c83bab8d2c28b | [
"MIT"
] | 1 | 2021-08-02T17:28:45.000Z | 2021-08-02T17:28:45.000Z | uwezoachievers/settings.py | Dennis-tec/uwezoachievers | d599c96db6cd8eef1afe05dc508c83bab8d2c28b | [
"MIT"
] | null | null | null | uwezoachievers/settings.py | Dennis-tec/uwezoachievers | d599c96db6cd8eef1afe05dc508c83bab8d2c28b | [
"MIT"
] | null | null | null | """
Django settings for uwezoachievers project.
Generated by 'django-admin startproject' using Django 3.2.5.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from ... | 27.398496 | 91 | 0.715971 |
from pathlib import Path
import django_heroku
import os
import dj_database_url
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'django-insecure-esa24yx$qtpl)%5v5_ciiva5wv1#s1k%q(v(ez1@x8_l##c=dc'
DEBUG = False
ALLOWED_HOSTS = ['www.uwezoachievers.com']
# Application definition
INSTALLED_APPS = [... | true | true |
1c0950f9e82dbd399c91845553b2bf115b1e65fb | 24,166 | py | Python | DRACO20K/NOCS_render.py | RahulSajnani/DRACO-Weakly-Supervised-Dense-Reconstruction-And-Canonicalization-of-Objects | d697905da990487589f88068c886a32d2ef57118 | [
"MIT"
] | 3 | 2021-06-20T17:46:32.000Z | 2021-12-17T16:55:00.000Z | DRACO20K/NOCS_render.py | RahulSajnani/DRACO-Weakly-Supervised-Dense-Reconstruction-And-Canonicalization-of-Objects | d697905da990487589f88068c886a32d2ef57118 | [
"MIT"
] | 1 | 2022-01-13T01:41:00.000Z | 2022-01-13T06:54:29.000Z | DRACO20K/NOCS_render.py | RahulSajnani/DRACO-Weakly-Supervised-Dense-Reconstruction-And-Canonicalization-of-Objects | d697905da990487589f88068c886a32d2ef57118 | [
"MIT"
] | 1 | 2021-09-14T06:17:55.000Z | 2021-09-14T06:17:55.000Z | '''
Adapted from https://github.com/weiaicunzai/blender_shapenet_render
Author: Rahul Sajnani
'''
import sys
import os
import random
import pickle
import bpy
import mathutils
import numpy as np
import json
import glob
from mathutils import Matrix, Vector
import bpy_extras
import imageio
abs_path = os.path.abspath(__fi... | 32.612686 | 214 | 0.674253 | import sys
import os
import random
import pickle
import bpy
import mathutils
import numpy as np
import json
import glob
from mathutils import Matrix, Vector
import bpy_extras
import imageio
abs_path = os.path.abspath(__file__)
sys.path.append(os.path.dirname(abs_path))
from settings import *
import settings
def clea... | true | true |
1c095121fe8491b4e7260bc64f43492e08b039b1 | 23,152 | py | Python | pdm/cli/utils.py | houbie/pdm | 0a3f1733d440a5957d7e9685db9a5b6591a0c677 | [
"MIT"
] | null | null | null | pdm/cli/utils.py | houbie/pdm | 0a3f1733d440a5957d7e9685db9a5b6591a0c677 | [
"MIT"
] | null | null | null | pdm/cli/utils.py | houbie/pdm | 0a3f1733d440a5957d7e9685db9a5b6591a0c677 | [
"MIT"
] | null | null | null | from __future__ import annotations
import argparse
import json
import os
import sys
from argparse import Action, _ArgumentGroup
from collections import ChainMap, OrderedDict
from json import dumps
from pathlib import Path
from typing import TYPE_CHECKING, Any, Callable, Iterable, Mapping, MutableMapping, cast
import ... | 34.658683 | 88 | 0.620422 | from __future__ import annotations
import argparse
import json
import os
import sys
from argparse import Action, _ArgumentGroup
from collections import ChainMap, OrderedDict
from json import dumps
from pathlib import Path
from typing import TYPE_CHECKING, Any, Callable, Iterable, Mapping, MutableMapping, cast
import ... | true | true |
1c095260bb25f457535bf2fcd6d6d30c1d077644 | 2,429 | py | Python | certbothook/handlers/laserjet.py | jamesmcdonald/certbothook | 6529defc0ba6697f0556d71eaaedf693292e3ec8 | [
"MIT"
] | null | null | null | certbothook/handlers/laserjet.py | jamesmcdonald/certbothook | 6529defc0ba6697f0556d71eaaedf693292e3ec8 | [
"MIT"
] | null | null | null | certbothook/handlers/laserjet.py | jamesmcdonald/certbothook | 6529defc0ba6697f0556d71eaaedf693292e3ec8 | [
"MIT"
] | null | null | null | """Handler to renew certificate on an HP LaserJet
Note that this is entirely based on experimentation with an HP
Color LaserJet MFP M477fdw may not work for you at all.
To use HTTPS here (which you should), you have to add the
printer's existing intermediate(s) to your CA certs,
because the printer doesn't send them.... | 37.953125 | 97 | 0.729107 |
from __future__ import print_function
import string
import os
from random import choice
import requests
import OpenSSL
def makehandler(scheme='http', verify=None):
def _lj(service, domain):
if service == 'certificate':
_laserjet_push(domain, scheme, verify)
else:
raise Val... | true | true |
1c0952a0f626f08366c4ae86de83883f56a37cdb | 5,963 | py | Python | src/particle.py | tyler961/GravitySimulation | 9b0f218b4273451394cb345a478aa3c8495f5ce4 | [
"MIT"
] | null | null | null | src/particle.py | tyler961/GravitySimulation | 9b0f218b4273451394cb345a478aa3c8495f5ce4 | [
"MIT"
] | null | null | null | src/particle.py | tyler961/GravitySimulation | 9b0f218b4273451394cb345a478aa3c8495f5ce4 | [
"MIT"
] | null | null | null | import numpy
class Vector:
def __init__(self, magnitude, direction):
self.magnitude = magnitude
self.direction = direction
self.xComp = 0
self.yComp = 0
self.calcVectorComponents()
def calcVectorComponents(self):
self.xComp = self.magnitude * numpy.cos(self.direction)
self.yComp = self.mag... | 40.842466 | 137 | 0.666778 | import numpy
class Vector:
def __init__(self, magnitude, direction):
self.magnitude = magnitude
self.direction = direction
self.xComp = 0
self.yComp = 0
self.calcVectorComponents()
def calcVectorComponents(self):
self.xComp = self.magnitude * numpy.cos(self.direction)
self.yComp = self.mag... | true | true |
1c0955cf735c6123ab0d28b856265fed3e8d0cf3 | 377 | py | Python | acondbs/schema/auth/query.py | simonsobs/acondbs | 6ca11c2889d827ecdb2b54d0cf3b94b8cdd281e6 | [
"MIT"
] | null | null | null | acondbs/schema/auth/query.py | simonsobs/acondbs | 6ca11c2889d827ecdb2b54d0cf3b94b8cdd281e6 | [
"MIT"
] | 24 | 2020-04-02T19:29:07.000Z | 2022-03-08T03:05:43.000Z | acondbs/schema/auth/query.py | simonsobs/acondbs | 6ca11c2889d827ecdb2b54d0cf3b94b8cdd281e6 | [
"MIT"
] | 1 | 2020-04-08T15:48:28.000Z | 2020-04-08T15:48:28.000Z | import graphene
from ... import auth
##__________________________________________________________________||
is_signed_in_field = graphene.Field(
graphene.Boolean, resolver=lambda *_: auth.is_signed_in()
)
is_admin_field = graphene.Field(
graphene.Boolean, resolver=lambda *_: auth.is_admin()
)
##____________... | 25.133333 | 70 | 0.811671 | import graphene
from ... import auth
is_signed_in_field = graphene.Field(
graphene.Boolean, resolver=lambda *_: auth.is_signed_in()
)
is_admin_field = graphene.Field(
graphene.Boolean, resolver=lambda *_: auth.is_admin()
)
| true | true |
1c0956ea11dcbe797eb6f0430492883f5bc44c15 | 16,518 | py | Python | Liquid-job-benchmarks/perfzero/lib/cloud_manager.py | PasaLab/YAO | 2e70203197cd79f9522d65731ee5dc0eb236b005 | [
"Apache-2.0"
] | 2 | 2021-08-30T14:12:09.000Z | 2022-01-20T02:14:22.000Z | Liquid-job-benchmarks/perfzero/lib/cloud_manager.py | PasaLab/YAO | 2e70203197cd79f9522d65731ee5dc0eb236b005 | [
"Apache-2.0"
] | null | null | null | Liquid-job-benchmarks/perfzero/lib/cloud_manager.py | PasaLab/YAO | 2e70203197cd79f9522d65731ee5dc0eb236b005 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#... | 38.236111 | 152 | 0.658494 |
from __future__ import print_function
import argparse
import getpass
import logging
import subprocess
import sys
import time
INSTANCE_NAME_PREFIX = 'perfzero-dev-'
def run_command(cmd, is_from_user=False):
_log = logging.info if is_from_user else logging.debug
_log('Executing command: {}'.form... | true | true |
1c09574ab0e4d927d99cbc049dc77cf4cc646105 | 4,515 | py | Python | util.py | amdecker/ir | 22ff03512c79239c1bd155deaeb6add3708a9805 | [
"MIT"
] | 6 | 2019-06-25T00:34:31.000Z | 2022-03-25T21:50:48.000Z | util.py | amdecker/ir | 22ff03512c79239c1bd155deaeb6add3708a9805 | [
"MIT"
] | null | null | null | util.py | amdecker/ir | 22ff03512c79239c1bd155deaeb6add3708a9805 | [
"MIT"
] | 3 | 2019-07-31T03:36:18.000Z | 2021-10-05T08:02:28.000Z | __author__ = "Amos Decker"
__date__ = "January 2020"
"""
various helpful tools used in StitcherEasy and rescale
- system file chooser
- remove black border from panoramas
- & others
"""
from tkinter import Tk
from tkinter.filedialog import askdirectory
import numpy as np
from typing import List, Dict, Any, Tuple, Tex... | 32.25 | 146 | 0.610631 | __author__ = "Amos Decker"
__date__ = "January 2020"
from tkinter import Tk
from tkinter.filedialog import askdirectory
import numpy as np
from typing import List, Dict, Any, Tuple, TextIO
PALETTES: List[str] = ["arctic.pal", "coldest.pal", "contrast.pal", "gray.pal", "hottest.pal", "iron.pal", "lava.pal", "rainbow.... | true | true |
1c09584d4788a6e2846078c15e9c0f3ac3530e18 | 18,458 | py | Python | src/pytest_executable/_version.py | CS-SI/pytest-executable | 443f524a1c876dab7509cdbb95a96fda7e5ccf01 | [
"Apache-2.0"
] | 8 | 2020-04-22T06:26:58.000Z | 2022-01-22T05:14:45.000Z | src/pytest_executable/_version.py | CS-SI/pytest-executable | 443f524a1c876dab7509cdbb95a96fda7e5ccf01 | [
"Apache-2.0"
] | 6 | 2020-08-08T19:56:15.000Z | 2021-11-11T09:05:43.000Z | src/pytest_executable/_version.py | CS-SI/pytest-executable | 443f524a1c876dab7509cdbb95a96fda7e5ccf01 | [
"Apache-2.0"
] | 2 | 2020-04-23T06:37:42.000Z | 2020-04-29T21:59:25.000Z |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... | 35.428023 | 79 | 0.584733 |
import errno
import os
import re
import subprocess
import sys
def get_keywords():
git_refnames = "$Format:%d$"
git_full = "$Format:%H$"
git_date = "$Format:%ci$"
keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}
return keywords
class VersioneerConfig:
... | true | true |
1c095a039e7dc651e4c8bbcc666168947c680958 | 2,311 | py | Python | _GTW/_OMP/_SRM/Race_Time.py | Tapyr/tapyr | 4235fba6dce169fe747cce4d17d88dcf4a3f9f1d | [
"BSD-3-Clause"
] | 6 | 2016-12-10T17:51:10.000Z | 2021-10-11T07:51:48.000Z | _GTW/_OMP/_SRM/Race_Time.py | Tapyr/tapyr | 4235fba6dce169fe747cce4d17d88dcf4a3f9f1d | [
"BSD-3-Clause"
] | null | null | null | _GTW/_OMP/_SRM/Race_Time.py | Tapyr/tapyr | 4235fba6dce169fe747cce4d17d88dcf4a3f9f1d | [
"BSD-3-Clause"
] | 3 | 2020-03-29T07:37:03.000Z | 2021-01-21T16:08:40.000Z | # -*- coding: utf-8 -*-
# Copyright (C) 2015 Mag. Christian Tanzer All rights reserved
# Glasauergasse 32, A--1130 Wien, Austria. tanzer@swing.co.at
# ****************************************************************************
# This module is part of the package GTW.OMP.SRM.
#
# This module is licensed under the term... | 26.563218 | 78 | 0.51839 |
from _GTW import GTW
from _MOM.import_MOM import *
import _GTW._OMP._SRM.Boat_in_Regatta
from _TFL.I18N import _, _T, _Tn
_Ancestor_Essence = GTW.OMP.SRM.Link1
class Race_Time (_Ancestor_Essence) :
class _Attributes (_Ancestor_Essence._Attributes) :
_... | true | true |
1c095a03f313f6ae6e946b8709267ae51e787f95 | 16,842 | py | Python | qiskit/visualization/timeline/core.py | kevinsung/qiskit-terra | 573198bdc55eaf4ad0691d441ae41c874f46313d | [
"Apache-2.0"
] | 92 | 2018-06-05T11:18:38.000Z | 2018-07-01T23:50:44.000Z | qiskit/visualization/timeline/core.py | QISKit/qiskit-core | 7391168c8944a5d901e0fdf02fb8955e82bc2ca1 | [
"Apache-2.0"
] | 107 | 2018-06-05T08:41:19.000Z | 2018-07-02T12:10:53.000Z | qiskit/visualization/timeline/core.py | kevinsung/qiskit-terra | 573198bdc55eaf4ad0691d441ae41c874f46313d | [
"Apache-2.0"
] | 39 | 2018-06-05T09:55:56.000Z | 2018-07-02T08:47:35.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# 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 modifications or derivative wo... | 37.677852 | 99 | 0.600404 |
import warnings
from copy import deepcopy
from functools import partial
from typing import Tuple, Iterator, Dict
from enum import Enum
import numpy as np
from qiskit import circuit
from qiskit.visualization.exceptions import VisualizationError
from qiskit.visualization.timeline import drawings, types
from qiskit.vis... | true | true |
1c095a48387ff8288fcd69cfb91e3801faf082a7 | 1,107 | py | Python | Doser-main/doser.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | Doser-main/doser.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | Doser-main/doser.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | import requests
from threading import Thread
import random
import os
print("head...")
users = [
"Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3"
"Mozilla / 5.0 (Macintosh; Intel Mac OS X 10.14; rv: 75.0) Gecko / 20100101 Firefox / 75.0"
"Mozilla/5.0 (Windows NT 1... | 29.918919 | 121 | 0.611563 | import requests
from threading import Thread
import random
import os
print("head...")
users = [
"Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3"
"Mozilla / 5.0 (Macintosh; Intel Mac OS X 10.14; rv: 75.0) Gecko / 20100101 Firefox / 75.0"
"Mozilla/5.0 (Windows NT 1... | true | true |
1c095a5ddf2045981b7bc39fb44dd70cedf1f6a0 | 1,795 | py | Python | python/sparseglm/benchmarks/lasso.py | PABannier/sparseglm | ec1c6a15786d9fc0cc58ae3d7e28227bbc9077e9 | [
"MIT"
] | null | null | null | python/sparseglm/benchmarks/lasso.py | PABannier/sparseglm | ec1c6a15786d9fc0cc58ae3d7e28227bbc9077e9 | [
"MIT"
] | null | null | null | python/sparseglm/benchmarks/lasso.py | PABannier/sparseglm | ec1c6a15786d9fc0cc58ae3d7e28227bbc9077e9 | [
"MIT"
] | null | null | null | import time
import numpy as np
import scipy.sparse as sp
from sklearn.linear_model import Lasso as Lasso_sk
from sparseglm.estimators import Lasso
from sparseglm.utils import make_correlated_data, compute_alpha_max
n_samples = 300
n_features = 1000
snr = 2
corr = 0.6
density = 0.5
tol = 1e-9
reg = 0.1
X, y, _ =... | 26.014493 | 78 | 0.690808 | import time
import numpy as np
import scipy.sparse as sp
from sklearn.linear_model import Lasso as Lasso_sk
from sparseglm.estimators import Lasso
from sparseglm.utils import make_correlated_data, compute_alpha_max
n_samples = 300
n_features = 1000
snr = 2
corr = 0.6
density = 0.5
tol = 1e-9
reg = 0.1
X, y, _ =... | true | true |
1c095aa09d932689772b29f840af55dd689eb09b | 2,233 | py | Python | 4_recognizingPerson.py | The-SocialLion/Smart-Attendance-System | 92d846027bbf367ee6b6ba99a4eb83e74bdc15c7 | [
"Apache-2.0"
] | null | null | null | 4_recognizingPerson.py | The-SocialLion/Smart-Attendance-System | 92d846027bbf367ee6b6ba99a4eb83e74bdc15c7 | [
"Apache-2.0"
] | null | null | null | 4_recognizingPerson.py | The-SocialLion/Smart-Attendance-System | 92d846027bbf367ee6b6ba99a4eb83e74bdc15c7 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import imutils
import pickle
import time
import cv2
embeddingModel = "openface_nn4.small2.v1.t7"
embeddingFile = "output/embeddings.pickle"
recognizerFile = "output/recognizer.pickle"
labelEncFile = "output/le.pickle"
conf = 0.5
print("Loading face detector...")
prototxt = "model/deploy.prototxt"
... | 31.013889 | 133 | 0.607703 | import numpy as np
import imutils
import pickle
import time
import cv2
embeddingModel = "openface_nn4.small2.v1.t7"
embeddingFile = "output/embeddings.pickle"
recognizerFile = "output/recognizer.pickle"
labelEncFile = "output/le.pickle"
conf = 0.5
print("Loading face detector...")
prototxt = "model/deploy.prototxt"
... | true | true |
1c095b8e5bea65dd4d5135b9f1438b696e43baeb | 2,211 | py | Python | backend/app/sheets/storage.py | rickh94/smlib | ff75a9523fb1113d934f6ff8c994b1427ca0d764 | [
"MIT"
] | null | null | null | backend/app/sheets/storage.py | rickh94/smlib | ff75a9523fb1113d934f6ff8c994b1427ca0d764 | [
"MIT"
] | 3 | 2021-06-16T19:52:53.000Z | 2022-01-13T02:39:27.000Z | backend/app/sheets/storage.py | rickh94/smlib | ff75a9523fb1113d934f6ff8c994b1427ca0d764 | [
"MIT"
] | null | null | null | import logging
import os
import tempfile
from uuid import UUID
import minio
from fastapi import UploadFile
from pdf2image import convert_from_bytes
from app.dependencies import minio_client
logger = logging.getLogger()
async def save_sheet(
sheet_file: UploadFile, sheet_id: UUID, owner_email: str, sheet_file_e... | 29.48 | 91 | 0.660787 | import logging
import os
import tempfile
from uuid import UUID
import minio
from fastapi import UploadFile
from pdf2image import convert_from_bytes
from app.dependencies import minio_client
logger = logging.getLogger()
async def save_sheet(
sheet_file: UploadFile, sheet_id: UUID, owner_email: str, sheet_file_e... | true | true |
1c095d5e783488e19f9a5deac98420e9c3e00fb7 | 2,617 | py | Python | backend/tasker_business/migrations/0001_initial.py | crowdbotics-apps/test1-28345 | 4ff1bbf6fc11b7398ea891fcc205c22b998c499c | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/tasker_business/migrations/0001_initial.py | crowdbotics-apps/test1-28345 | 4ff1bbf6fc11b7398ea891fcc205c22b998c499c | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/tasker_business/migrations/0001_initial.py | crowdbotics-apps/test1-28345 | 4ff1bbf6fc11b7398ea891fcc205c22b998c499c | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | # Generated by Django 2.2.20 on 2021-07-01 06:14
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('task_profile', '0001_initial'),
('task_category', '0001_initial'),
]
operations = [
... | 46.732143 | 192 | 0.611005 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('task_profile', '0001_initial'),
('task_category', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='T... | true | true |
1c095e11f67303f84978fa9c3e15bbd3aa9344d4 | 16,071 | py | Python | pygeoapi/starlette_app.py | plant99/pygeoapi | 4dfbe42a7ddecc04e76cbcfe5e7c376318919d9e | [
"MIT"
] | 2 | 2020-10-08T12:41:02.000Z | 2020-10-30T02:04:17.000Z | pygeoapi/starlette_app.py | plant99/pygeoapi | 4dfbe42a7ddecc04e76cbcfe5e7c376318919d9e | [
"MIT"
] | null | null | null | pygeoapi/starlette_app.py | plant99/pygeoapi | 4dfbe42a7ddecc04e76cbcfe5e7c376318919d9e | [
"MIT"
] | 1 | 2020-11-16T12:17:27.000Z | 2020-11-16T12:17:27.000Z | # =================================================================
#
# Authors: Francesco Bartoli <xbartolone@gmail.com>
#
#
# Copyright (c) 2020 Francesco Bartoli
# Copyright (c) 2020 Tom Kralidis
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated docume... | 30.265537 | 79 | 0.696596 |
import os
import click
from starlette.staticfiles import StaticFiles
from starlette.applications import Starlette
from starlette.requests import Request
from starlette.responses import Response
import uvicorn
from pygeoapi.api import API
from pygeoapi.util import yaml_load
CONFIG = None
if 'PYGEOAPI_CONFIG' not i... | true | true |
1c09602bee276b2f0e0dadd1f89c1eba521b0acf | 1,016 | py | Python | c.ppy.sh/locationHelper.py | Kreyren/ripple | 586e665bfa712f6c83ddcdec47b8a3cff5ce2831 | [
"MIT"
] | 53 | 2016-03-04T17:39:17.000Z | 2022-03-30T21:18:24.000Z | c.ppy.sh/locationHelper.py | Kreyren/ripple | 586e665bfa712f6c83ddcdec47b8a3cff5ce2831 | [
"MIT"
] | 162 | 2016-03-04T17:53:44.000Z | 2019-12-14T14:45:51.000Z | c.ppy.sh/locationHelper.py | Kreyren/ripple | 586e665bfa712f6c83ddcdec47b8a3cff5ce2831 | [
"MIT"
] | 51 | 2016-03-15T23:07:54.000Z | 2022-01-28T21:20:43.000Z | import urllib.request
import json
import consoleHelper
import bcolors
# API URL
url = "http://ip.zxq.co/"
def getCountry(ip):
"""
Get country from IP address
ip -- IP Address
return -- Country code (2 letters)
"""
# Default value, sent if API is memeing
country = "XX"
try:
# Try to get country from Pik... | 20.734694 | 102 | 0.676181 | import urllib.request
import json
import consoleHelper
import bcolors
url = "http://ip.zxq.co/"
def getCountry(ip):
country = "XX"
try:
country = json.loads(urllib.request.urlopen("{}/{}".format(url, ip)).read().decode())["country"]
except:
consoleHelper.printColored("[!] Error in get country", bcolors.... | true | true |
1c09603f501b5864c6070393fdaea932209fa511 | 1,287 | py | Python | nucleotides/command/fetch_data.py | michaelbarton/nucleotides-cli | 04c94773a9186dc67a887e91e3cdc9ba4a41d3fc | [
"BSD-3-Clause-LBNL"
] | null | null | null | nucleotides/command/fetch_data.py | michaelbarton/nucleotides-cli | 04c94773a9186dc67a887e91e3cdc9ba4a41d3fc | [
"BSD-3-Clause-LBNL"
] | null | null | null | nucleotides/command/fetch_data.py | michaelbarton/nucleotides-cli | 04c94773a9186dc67a887e91e3cdc9ba4a41d3fc | [
"BSD-3-Clause-LBNL"
] | null | null | null | import os.path
import boltons.fileutils as fu
import nucleotides.util as util
import nucleotides.api_client as api
import nucleotides.s3 as s3
import nucleotides.bio as bio
MIN_CONTIG_LENGTH = 1000
EXTENSION_MAPPING = {
'short_read_fastq' : '.fq.gz',
'reference_fasta' ... | 33.868421 | 85 | 0.648796 | import os.path
import boltons.fileutils as fu
import nucleotides.util as util
import nucleotides.api_client as api
import nucleotides.s3 as s3
import nucleotides.bio as bio
MIN_CONTIG_LENGTH = 1000
EXTENSION_MAPPING = {
'short_read_fastq' : '.fq.gz',
'reference_fasta' ... | true | true |
1c0961e96a15bbf1f18ce8103504a15c1c622763 | 5,048 | py | Python | lightcone_resample/test_v4.py | ArgonneCPAC/skysim | f271debe3439efd1ae5230c6020b2dbc5f79d824 | [
"BSD-2-Clause"
] | 4 | 2020-08-08T10:01:49.000Z | 2022-02-27T07:21:00.000Z | lightcone_resample/test_v4.py | ArgonneCPAC/skysim | f271debe3439efd1ae5230c6020b2dbc5f79d824 | [
"BSD-2-Clause"
] | 67 | 2018-07-16T22:12:16.000Z | 2020-07-02T01:12:48.000Z | lightcone_resample/test_v4.py | aphearin/cosmodc2 | 5bc2abebd7123f29b424efc11c3ef374a51cd6c1 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python2.7
from __future__ import print_function, division
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as clr
import dtk
import h5py
import sys
import time
if __name__ == "__main__":
param = dtk.Param(sys.argv[1])
output_fname = param.get_string('output_fname'... | 31.949367 | 85 | 0.658479 |
from __future__ import print_function, division
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as clr
import dtk
import h5py
import sys
import time
if __name__ == "__main__":
param = dtk.Param(sys.argv[1])
output_fname = param.get_string('output_fname').replace("${step}","all"... | true | true |
1c0962aad1df3e78026b72b5f9d199306e763a70 | 1,385 | py | Python | pyannote/audio/labeling/__init__.py | Mymoza/pyannote-audio | 9ac612ee6b854a1a65c3d8992856550304969674 | [
"MIT"
] | 1 | 2020-09-30T23:47:27.000Z | 2020-09-30T23:47:27.000Z | pyannote/audio/labeling/__init__.py | picheny-nyu/pyannote-audio | 9ac612ee6b854a1a65c3d8992856550304969674 | [
"MIT"
] | null | null | null | pyannote/audio/labeling/__init__.py | picheny-nyu/pyannote-audio | 9ac612ee6b854a1a65c3d8992856550304969674 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
# The MIT License (MIT)
# Copyright (c) 2016-2018 CNRS
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limita... | 38.472222 | 79 | 0.775451 |
from ..models import TASK_MULTI_CLASS_CLASSIFICATION
from ..models import TASK_MULTI_LABEL_CLASSIFICATION
from ..models import TASK_REGRESSION
| true | true |
1c09632b90cb9ebe7f8dc67f7ecd4bce4604b7a2 | 623 | py | Python | assignment48.py | gaurav131/infosys_assignments | 3fced6e95c23aa4ab0c78e436099ca97a34846d1 | [
"MIT"
] | null | null | null | assignment48.py | gaurav131/infosys_assignments | 3fced6e95c23aa4ab0c78e436099ca97a34846d1 | [
"MIT"
] | null | null | null | assignment48.py | gaurav131/infosys_assignments | 3fced6e95c23aa4ab0c78e436099ca97a34846d1 | [
"MIT"
] | null | null | null | def find_correct(word_dict):
correct,almost,incorrect=0,0,0
for key,value in word_dict.items():
count=0
if(key==value):
correct+=1
elif(len(key)==len(value)):
for i in range(0,len(key)):
if(key[i]!=value[i]):
count+=1
... | 31.15 | 105 | 0.515249 | def find_correct(word_dict):
correct,almost,incorrect=0,0,0
for key,value in word_dict.items():
count=0
if(key==value):
correct+=1
elif(len(key)==len(value)):
for i in range(0,len(key)):
if(key[i]!=value[i]):
count+=1
... | true | true |
1c096478d74e1f904e6f9da1b6fd2804eb0cd7d1 | 1,341 | py | Python | 2017/D11/D11Q1.py | buchasia/advent-of-code | f568c6330c8934325913705b39ef8c25a1023057 | [
"MIT"
] | null | null | null | 2017/D11/D11Q1.py | buchasia/advent-of-code | f568c6330c8934325913705b39ef8c25a1023057 | [
"MIT"
] | null | null | null | 2017/D11/D11Q1.py | buchasia/advent-of-code | f568c6330c8934325913705b39ef8c25a1023057 | [
"MIT"
] | null | null | null | def solveQuestion(inputPath):
fileP = open(inputPath, 'r')
directions = fileP.readlines()[0].strip().split(',')
fileP.close()
currentX = 0
currentY = 0
directionSteps = {'n': [0, 2], 'ne': [1, 1], 's': [0, -2], 'se': [1, -1], 'nw': [-1, 1], 'sw': [-1, -1]}
for direction in directions:
... | 30.477273 | 108 | 0.50783 | def solveQuestion(inputPath):
fileP = open(inputPath, 'r')
directions = fileP.readlines()[0].strip().split(',')
fileP.close()
currentX = 0
currentY = 0
directionSteps = {'n': [0, 2], 'ne': [1, 1], 's': [0, -2], 'se': [1, -1], 'nw': [-1, 1], 'sw': [-1, -1]}
for direction in directions:
... | true | true |
1c0964bef0534626a0bc91a9e31f6f247a78ff00 | 3,428 | py | Python | tests/python/pants_test/targets/test_java_agent.py | AllClearID/pants | c4fdf00a3bdf9f26f876e85c46909d0729f7132c | [
"Apache-2.0"
] | null | null | null | tests/python/pants_test/targets/test_java_agent.py | AllClearID/pants | c4fdf00a3bdf9f26f876e85c46909d0729f7132c | [
"Apache-2.0"
] | null | null | null | tests/python/pants_test/targets/test_java_agent.py | AllClearID/pants | c4fdf00a3bdf9f26f876e85c46909d0729f7132c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.backend.j... | 39.402299 | 99 | 0.748833 |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.backend.jvm.targets.java_agent import JavaAgent
from pants.base.exceptions import TargetDefinitionException
from pants.build_graph.build_file_aliases impor... | true | true |
1c0966364286dce584731f43a688b9b5ca792264 | 3,860 | py | Python | webapp/graphite/render/hashing.py | dkulikovsky/graphite-ch-web-yandex | 2fe0f86901b6f18d12a6445c4a0cd07d6d89cc1b | [
"Apache-2.0"
] | null | null | null | webapp/graphite/render/hashing.py | dkulikovsky/graphite-ch-web-yandex | 2fe0f86901b6f18d12a6445c4a0cd07d6d89cc1b | [
"Apache-2.0"
] | null | null | null | webapp/graphite/render/hashing.py | dkulikovsky/graphite-ch-web-yandex | 2fe0f86901b6f18d12a6445c4a0cd07d6d89cc1b | [
"Apache-2.0"
] | null | null | null | """Copyright 2008 Orbitz WorldWide
Copyright 2011 Chris Davis
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or ... | 31.900826 | 105 | 0.691192 |
from graphite.logger import log
import time
from hashlib import md5
import bisect
def hashRequest(request):
queryParams = ["%s=%s" % (key, '&'.join(values))
for (key,values) in request.lists()
if not key.startswith('_')]
normalizedParams = ','.join( sorted(queryParams) ) or 'n... | true | true |
1c0966a793511a2ec3a9d147bd75ff22e8fb7209 | 1,922 | py | Python | youtube_dl/extractor/vodlocker.py | Logmytech/youtube-dl-QT | 1497297719a95c4f70fbfa32e0fa4e38cdd475dc | [
"MIT"
] | 1 | 2015-02-19T13:13:47.000Z | 2015-02-19T13:13:47.000Z | youtube_dl/extractor/vodlocker.py | Logmytech/youtube-dl-QT | 1497297719a95c4f70fbfa32e0fa4e38cdd475dc | [
"MIT"
] | 2 | 2019-05-20T12:46:30.000Z | 2020-11-07T12:50:32.000Z | youtube_dl/extractor/vodlocker.py | Logmytech/youtube-dl-QT | 1497297719a95c4f70fbfa32e0fa4e38cdd475dc | [
"MIT"
] | 5 | 2020-10-25T09:18:58.000Z | 2021-05-23T22:57:55.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urllib_request,
)
class VodlockerIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?vodlocker\.com/(?P<id>[0-9a-zA-Z]+)(?:\..*?)?'
_TESTS ... | 30.03125 | 85 | 0.514048 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urllib_request,
)
class VodlockerIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?vodlocker\.com/(?P<id>[0-9a-zA-Z]+)(?:\..*?)?'
_TESTS = [{
'url': 'htt... | true | true |
1c0966f8692cdc177addf72635dff2caa1f997b2 | 811 | py | Python | travel/urls.py | devanshudave12/telustravel_finalproject | 8b169dc3063e6cbbb4804a08837360ddd765651f | [
"MIT"
] | null | null | null | travel/urls.py | devanshudave12/telustravel_finalproject | 8b169dc3063e6cbbb4804a08837360ddd765651f | [
"MIT"
] | null | null | null | travel/urls.py | devanshudave12/telustravel_finalproject | 8b169dc3063e6cbbb4804a08837360ddd765651f | [
"MIT"
] | null | null | null | """telustravel URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-b... | 33.791667 | 77 | 0.709001 |
from django.urls import include, path
from . import views
from django.contrib import admin
urlpatterns = [
path('', views.index, name='index')
] | true | true |
1c0966f8bd13a13c76df61cad10e255b592823d4 | 3,381 | py | Python | Sample_Similarity_Metric.py | Animadversio/Visual_Neuro_InSilico_Exp | 39b1e65e5613b064361c09c7d3f88496f3a7efd2 | [
"Apache-2.0"
] | 2 | 2020-02-03T18:16:26.000Z | 2020-05-01T18:27:01.000Z | Sample_Similarity_Metric.py | Animadversio/Visual_Neuro_InSilico_Exp | 39b1e65e5613b064361c09c7d3f88496f3a7efd2 | [
"Apache-2.0"
] | null | null | null | Sample_Similarity_Metric.py | Animadversio/Visual_Neuro_InSilico_Exp | 39b1e65e5613b064361c09c7d3f88496f3a7efd2 | [
"Apache-2.0"
] | 2 | 2020-01-24T17:27:33.000Z | 2020-08-30T02:54:13.000Z | import os
from os.path import join
from time import time
from importlib import reload
import re
import numpy as np
import torch
import torch.optim as optim
import torch.nn.functional as F
# from cv2 import imread, imwrite
import matplotlib
matplotlib.use('Agg') # if you dont want image show up
import matplotlib.pylab a... | 39.776471 | 137 | 0.715469 | import os
from os.path import join
from time import time
from importlib import reload
import re
import numpy as np
import torch
import torch.optim as optim
import torch.nn.functional as F
import matplotlib
matplotlib.use('Agg') import matplotlib.pylab as plt
import sys
sys.path.append("D:\Github\pytorch-caffe")
sys.pat... | true | true |
1c0967522e33fa373ca7fe277deec5bee4118624 | 8,299 | py | Python | src/pretalx/common/models/log.py | orlando/pretalx | 15f90dc2545f210eaf870ffbdfe0a27c70bfa0ec | [
"Apache-2.0"
] | null | null | null | src/pretalx/common/models/log.py | orlando/pretalx | 15f90dc2545f210eaf870ffbdfe0a27c70bfa0ec | [
"Apache-2.0"
] | 1 | 2019-07-05T20:03:42.000Z | 2019-07-05T20:03:42.000Z | src/pretalx/common/models/log.py | orlando/pretalx | 15f90dc2545f210eaf870ffbdfe0a27c70bfa0ec | [
"Apache-2.0"
] | null | null | null | from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.translation import gettext_lazy as _
from django_scopes import ScopedManager
from pretalx.mail.models import MailTemplate, QueuedMail
from pretalx.s... | 49.106509 | 131 | 0.682612 | from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.translation import gettext_lazy as _
from django_scopes import ScopedManager
from pretalx.mail.models import MailTemplate, QueuedMail
from pretalx.s... | true | true |
1c09683a6569e4dcb527cd62e43f34882a7af434 | 1,294 | py | Python | NMR_Pulse_Sequences/PulsoSimples.py | camposouza/NMR | a55ebf738799b4c1cc14dcd1ebebae3ed57a8d58 | [
"MIT"
] | null | null | null | NMR_Pulse_Sequences/PulsoSimples.py | camposouza/NMR | a55ebf738799b4c1cc14dcd1ebebae3ed57a8d58 | [
"MIT"
] | null | null | null | NMR_Pulse_Sequences/PulsoSimples.py | camposouza/NMR | a55ebf738799b4c1cc14dcd1ebebae3ed57a8d58 | [
"MIT"
] | null | null | null | import numpy as np
from numpy import pi, sin, cos
import matplotlib.pyplot as plt
T1 = 600
T2 = 400
Fo = 10
df = np.arange(-10, 50, 0.1)
theta = pi/2.0
T = 2000
dT = 1
T2inom = 200
T22 = 1/((1/T2) + (1/T2inom))
Rtheta = np.matrix([[1, 0, 0], [0, cos(theta), sin(theta)], [0, -sin(theta), cos(theta)]])
E1 = np.exp(-d... | 21.932203 | 90 | 0.50541 | import numpy as np
from numpy import pi, sin, cos
import matplotlib.pyplot as plt
T1 = 600
T2 = 400
Fo = 10
df = np.arange(-10, 50, 0.1)
theta = pi/2.0
T = 2000
dT = 1
T2inom = 200
T22 = 1/((1/T2) + (1/T2inom))
Rtheta = np.matrix([[1, 0, 0], [0, cos(theta), sin(theta)], [0, -sin(theta), cos(theta)]])
E1 = np.exp(-d... | true | true |
1c09689e6f9803a5d63d77deeaee787820b1b436 | 25,751 | py | Python | gen/python/grpc/gateway/protoc_gen_openapiv2/options/__init__.py | ShayNehmad-RecoLabs/betterproto-service-example | b633a97ab2823ebbec0489f8e83c8dc255a8e7b9 | [
"MIT"
] | null | null | null | gen/python/grpc/gateway/protoc_gen_openapiv2/options/__init__.py | ShayNehmad-RecoLabs/betterproto-service-example | b633a97ab2823ebbec0489f8e83c8dc255a8e7b9 | [
"MIT"
] | null | null | null | gen/python/grpc/gateway/protoc_gen_openapiv2/options/__init__.py | ShayNehmad-RecoLabs/betterproto-service-example | b633a97ab2823ebbec0489f8e83c8dc255a8e7b9 | [
"MIT"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# sources: protoc-gen-openapiv2/options/annotations.proto, protoc-gen-openapiv2/options/openapiv2.proto
# plugin: python-betterproto
from dataclasses import dataclass
from typing import Dict, List
import betterproto
from betterproto.grpc.grpclib_server import ... | 46.990876 | 103 | 0.708516 | from dataclasses import dataclass
from typing import Dict, List
import betterproto
from betterproto.grpc.grpclib_server import ServiceBase
class Scheme(betterproto.Enum):
UNKNOWN = 0
HTTP = 1
HTTPS = 2
WS = 3
WSS = 4
class JsonSchemaJsonSchemaSimpleTypes(betterproto.Enum):
UNKNOWN = 0
... | true | true |
1c0968a9a3b23772f0a7c6c79d7bfa5a8632786a | 10,414 | py | Python | Code/linkedlist.py | AnniePawl/Core-Data-Structures | 5e7112f7da68e7cf4af1c5dbf0a56a41656abcf6 | [
"MIT"
] | null | null | null | Code/linkedlist.py | AnniePawl/Core-Data-Structures | 5e7112f7da68e7cf4af1c5dbf0a56a41656abcf6 | [
"MIT"
] | 1 | 2020-02-15T18:03:10.000Z | 2020-02-15T18:03:10.000Z | Code/linkedlist.py | AnniePawl/Core-Data-Structures | 5e7112f7da68e7cf4af1c5dbf0a56a41656abcf6 | [
"MIT"
] | 1 | 2020-03-16T07:31:10.000Z | 2020-03-16T07:31:10.000Z | #!python
# Initialize Node Class
class Node(object):
def __init__(self, data):
"""Initialize this node with the given data."""
self.data = data
self.next = None
def __repr__(self):
"""Return a string representation of this node."""
return 'Node({!r})'.format(self.data)... | 41.991935 | 109 | 0.597273 |
class Node(object):
def __init__(self, data):
self.data = data
self.next = None
def __repr__(self):
return 'Node({!r})'.format(self.data)
class LinkedList(object):
def __init__(self, iterable=None):
self.head = None self.tail = None self.size = 0 ... | true | true |
1c0969c08b6b2484204a6a0cf0bf56d1d39985a1 | 323 | py | Python | ffmpeg_sample/test01_ffmpeg_probe.py | amaraimusi/python_sample | 7d5524b3d42ecfeff89fbfb8fe2c2c61a18143ac | [
"MIT"
] | null | null | null | ffmpeg_sample/test01_ffmpeg_probe.py | amaraimusi/python_sample | 7d5524b3d42ecfeff89fbfb8fe2c2c61a18143ac | [
"MIT"
] | null | null | null | ffmpeg_sample/test01_ffmpeg_probe.py | amaraimusi/python_sample | 7d5524b3d42ecfeff89fbfb8fe2c2c61a18143ac | [
"MIT"
] | null | null | null |
print('mp4ファイル、またはmp3ファイルの情報をダンプ')
import ffmpeg
import pprint
print('--------------mp4ファイルの情報--------------')
video_info = ffmpeg.probe('./test_data/MVI_0887.MP4')
pprint.pprint(video_info)
print('--------------mp3ファイルの情報--------------')
video_info = ffmpeg.probe('./test_data/MVI_0887.MP4')
pprint.pprint(video_info... | 23.071429 | 53 | 0.647059 |
print('mp4ファイル、またはmp3ファイルの情報をダンプ')
import ffmpeg
import pprint
print('--------------mp4ファイルの情報--------------')
video_info = ffmpeg.probe('./test_data/MVI_0887.MP4')
pprint.pprint(video_info)
print('--------------mp3ファイルの情報--------------')
video_info = ffmpeg.probe('./test_data/MVI_0887.MP4')
pprint.pprint(video_info... | true | true |
1c0969d73ec02f0e62b3e98b739f460454cd015a | 50,442 | py | Python | python/ccxt/async_support/bitbay.py | divyanshBuyhatke/ccxt | ffb7feb098d0ab7c662d522c9bca4199ae971415 | [
"MIT"
] | 500 | 2017-06-28T14:43:21.000Z | 2022-03-11T14:19:00.000Z | python/ccxt/async_support/bitbay.py | ZenSwordman/ccxt | 48069e3b492260ff8c99fbd6b2ce1bb7e8464992 | [
"MIT"
] | 214 | 2017-07-03T17:39:26.000Z | 2017-09-20T02:41:20.000Z | python/ccxt/async_support/bitbay.py | ZenSwordman/ccxt | 48069e3b492260ff8c99fbd6b2ce1bb7e8464992 | [
"MIT"
] | 127 | 2017-06-30T05:49:24.000Z | 2021-11-05T22:39:56.000Z | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
import hashlib
from ccxt.base.errors import ExchangeError
from ccxt.base.errors impor... | 41.312039 | 137 | 0.466992 |
from ccxt.async_support.base.exchange import Exchange
import hashlib
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import PermissionDenied
from ccxt.base.errors import AccountSuspended
from ccxt.base.errors import BadSymbol
from ccxt.base.errors impo... | true | true |
1c096a4448d0b2bfc2221022b1ea3142eaafc6be | 120 | py | Python | app/room/__init__.py | kid-kodi/BioBank | 27c7cb7286dcae737fa53c245456d60857fe949f | [
"MIT"
] | null | null | null | app/room/__init__.py | kid-kodi/BioBank | 27c7cb7286dcae737fa53c245456d60857fe949f | [
"MIT"
] | null | null | null | app/room/__init__.py | kid-kodi/BioBank | 27c7cb7286dcae737fa53c245456d60857fe949f | [
"MIT"
] | null | null | null | from flask import Blueprint
bp = Blueprint('room', __name__, template_folder="templates")
from app.room import routes
| 20 | 61 | 0.783333 | from flask import Blueprint
bp = Blueprint('room', __name__, template_folder="templates")
from app.room import routes
| true | true |
1c096a9ba6e5aabb94f2c5e5ea49f8fc8cc7e618 | 58 | py | Python | test_code/boj/bronze5/2914.py | yjinheon/solve | f47cd19d3c81d0b16586159c754deb2ffcb31ca0 | [
"Apache-2.0"
] | null | null | null | test_code/boj/bronze5/2914.py | yjinheon/solve | f47cd19d3c81d0b16586159c754deb2ffcb31ca0 | [
"Apache-2.0"
] | null | null | null | test_code/boj/bronze5/2914.py | yjinheon/solve | f47cd19d3c81d0b16586159c754deb2ffcb31ca0 | [
"Apache-2.0"
] | null | null | null | a , b = map(int,input().split())
print((a * (b-1)) + 1)
| 14.5 | 32 | 0.465517 | a , b = map(int,input().split())
print((a * (b-1)) + 1)
| true | true |
1c096ba74396de35dd510b292f03a52ac142597c | 81,415 | py | Python | monai/transforms/spatial/array.py | zomglings/MONAI | ba127a2077b1a5d8aed01bc98a6f9550cc191c2b | [
"Apache-2.0"
] | 1 | 2022-01-04T21:38:23.000Z | 2022-01-04T21:38:23.000Z | monai/transforms/spatial/array.py | zomglings/MONAI | ba127a2077b1a5d8aed01bc98a6f9550cc191c2b | [
"Apache-2.0"
] | null | null | null | monai/transforms/spatial/array.py | zomglings/MONAI | ba127a2077b1a5d8aed01bc98a6f9550cc191c2b | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 - 2021 MONAI Consortium
# 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 wri... | 48.089191 | 120 | 0.620881 |
import warnings
from typing import Any, List, Optional, Sequence, Tuple, Union
import numpy as np
import torch
from monai.config import USE_COMPILED, DtypeLike
from monai.data.utils import compute_shape_offset, to_affine_nd, zoom_affine
from monai.networks.layers import AffineTransform, GaussianFilter, grid_pull
fro... | true | true |
1c096dde11270e10aba37c1e279d3cb0339b3147 | 2,181 | py | Python | tests/test_reflection.py | sedezee/TalosBot | aef00289d53d7a9929b7d33d546b7ac18b2cc1c2 | [
"MIT"
] | 11 | 2016-04-19T01:50:55.000Z | 2020-12-10T00:17:30.000Z | tests/test_reflection.py | sedezee/TalosBot | aef00289d53d7a9929b7d33d546b7ac18b2cc1c2 | [
"MIT"
] | 22 | 2016-04-18T14:49:52.000Z | 2020-12-09T19:39:36.000Z | tests/test_reflection.py | sedezee/TalosBot | aef00289d53d7a9929b7d33d546b7ac18b2cc1c2 | [
"MIT"
] | 6 | 2016-06-30T16:32:08.000Z | 2020-03-19T12:19:25.000Z |
import inspect
import pytest
import spidertools.common.reflection as reflection
@pytest.mark.parametrize("package", ["discord_talos", "website"])
def test_docs(package):
result = reflection.get_undoced(package)
assert len(result) is 0, f"Missing documentation on: {', '.join(map(lambda x: x[0], result))}"
S... | 29.472973 | 106 | 0.663457 |
import inspect
import pytest
import spidertools.common.reflection as reflection
@pytest.mark.parametrize("package", ["discord_talos", "website"])
def test_docs(package):
result = reflection.get_undoced(package)
assert len(result) is 0, f"Missing documentation on: {', '.join(map(lambda x: x[0], result))}"
S... | true | true |
1c096e3ae8790ec1731226be4d8e232d0f888eeb | 3,433 | py | Python | eli5/_feature_weights.py | binfnstats/eli5 | 017c738f8dcf3e31346de49a390835ffafad3f1b | [
"MIT"
] | 2,582 | 2016-09-15T01:14:22.000Z | 2022-03-27T16:26:00.000Z | eli5/_feature_weights.py | binfnstats/eli5 | 017c738f8dcf3e31346de49a390835ffafad3f1b | [
"MIT"
] | 407 | 2016-09-19T18:43:14.000Z | 2021-12-12T15:57:53.000Z | eli5/_feature_weights.py | binfnstats/eli5 | 017c738f8dcf3e31346de49a390835ffafad3f1b | [
"MIT"
] | 356 | 2016-09-19T18:35:51.000Z | 2022-03-20T12:52:08.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import numpy as np
from eli5.base import FeatureWeights, FeatureWeight
from .utils import argsort_k_largest_positive, argsort_k_smallest, mask
def _get_top_features(feature_names, coef, top, x):
"""
Return a ``(pos, neg)`` tuple. ``pos`` and ``n... | 36.521277 | 73 | 0.656569 | from __future__ import absolute_import
import numpy as np
from eli5.base import FeatureWeights, FeatureWeight
from .utils import argsort_k_largest_positive, argsort_k_smallest, mask
def _get_top_features(feature_names, coef, top, x):
if isinstance(top, (list, tuple)):
num_pos, num_neg = list(top) ... | true | true |
1c096e6af5dfa040a3c4aafe1d8cc949994726e8 | 8,433 | py | Python | rmgpy/rmg/react.py | tza0035/RMG-Py | 38c49f7107d1b19e4a534408a1040ddd313b8596 | [
"MIT"
] | 250 | 2015-06-06T23:32:00.000Z | 2022-03-22T16:45:16.000Z | rmgpy/rmg/react.py | tza0035/RMG-Py | 38c49f7107d1b19e4a534408a1040ddd313b8596 | [
"MIT"
] | 1,781 | 2015-05-26T23:52:00.000Z | 2022-03-31T19:07:54.000Z | rmgpy/rmg/react.py | tza0035/RMG-Py | 38c49f7107d1b19e4a534408a1040ddd313b8596 | [
"MIT"
] | 161 | 2015-06-02T14:28:59.000Z | 2022-03-02T19:37:14.000Z | #!/usr/bin/env python3
###############################################################################
# #
# RMG - Reaction Mechanism Generator #
# ... | 48.745665 | 126 | 0.620064 |
import logging
from multiprocessing import Pool
from rmgpy.data.rmg import get_db
def react(spc_fam_tuples, procnum=1):
if procnum == 1:
logging.info('For reaction generation {0} process is used.'.format(procnum))
reactions = list(map(_react_species_star, spc_fam_tuples))
else... | true | true |
1c096eb808b5bb4f79c827159e61522c2fe53ee9 | 188 | py | Python | django_sqs/urls.py | mpasternacki/django-sqs | 8c4ab2450f383e89ebfe8f0af104ff496d8c4670 | [
"BSD-3-Clause"
] | 12 | 2015-12-15T14:22:21.000Z | 2020-12-29T14:29:43.000Z | django_sqs/urls.py | mpasternacki/django-sqs | 8c4ab2450f383e89ebfe8f0af104ff496d8c4670 | [
"BSD-3-Clause"
] | null | null | null | django_sqs/urls.py | mpasternacki/django-sqs | 8c4ab2450f383e89ebfe8f0af104ff496d8c4670 | [
"BSD-3-Clause"
] | 8 | 2015-07-19T08:43:54.000Z | 2020-12-29T14:29:47.000Z | from django.conf.urls.defaults import *
from views import status
urlpatterns = patterns('',
url(r'^status/$', status, name='sqs_status'),
)
| 23.5 | 68 | 0.542553 | from django.conf.urls.defaults import *
from views import status
urlpatterns = patterns('',
url(r'^status/$', status, name='sqs_status'),
)
| true | true |
1c096ef7a3da07467e1b6e8e03f41f383da80ebc | 2,897 | py | Python | build/common/commands/auto_migrate.py | girip11/frappe_docker | 7498d5439a266e39fa84799623390de09f103453 | [
"MIT"
] | null | null | null | build/common/commands/auto_migrate.py | girip11/frappe_docker | 7498d5439a266e39fa84799623390de09f103453 | [
"MIT"
] | null | null | null | build/common/commands/auto_migrate.py | girip11/frappe_docker | 7498d5439a266e39fa84799623390de09f103453 | [
"MIT"
] | null | null | null | import os
import json
import semantic_version
import git
from migrate import migrate_sites
from check_connection import get_config
APP_VERSIONS_JSON_FILE = 'app_versions.json'
APPS_TXT_FILE = 'apps.txt'
def save_version_file(versions):
with open(APP_VERSIONS_JSON_FILE, 'w') as f:
return json.dump(version... | 26.336364 | 85 | 0.618916 | import os
import json
import semantic_version
import git
from migrate import migrate_sites
from check_connection import get_config
APP_VERSIONS_JSON_FILE = 'app_versions.json'
APPS_TXT_FILE = 'apps.txt'
def save_version_file(versions):
with open(APP_VERSIONS_JSON_FILE, 'w') as f:
return json.dump(version... | true | true |
1c096f1a70ad40cd894b502b7e1e1ace9208f6ea | 6,259 | py | Python | ros/src/waypoint_updater/waypoint_updater.py | JoeyLI17/2019_11_30_AV_System_Integration_ROS | 32ea70758d1082660dd5be09098bcf7a23f1338e | [
"MIT"
] | 1 | 2019-12-02T03:10:13.000Z | 2019-12-02T03:10:13.000Z | ros/src/waypoint_updater/waypoint_updater.py | JoeyLI17/2019_11_30_AV_System_Integration_ROS | 32ea70758d1082660dd5be09098bcf7a23f1338e | [
"MIT"
] | null | null | null | ros/src/waypoint_updater/waypoint_updater.py | JoeyLI17/2019_11_30_AV_System_Integration_ROS | 32ea70758d1082660dd5be09098bcf7a23f1338e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import rospy
from geometry_msgs.msg import PoseStamped
from styx_msgs.msg import Lane, Waypoint
from std_msgs.msg import Int32
from scipy import spatial
import numpy as np
import math
'''
This node will publish waypoints from the car's current position to some `x` distance ahead.
As mentioned i... | 34.202186 | 132 | 0.62518 |
import rospy
from geometry_msgs.msg import PoseStamped
from styx_msgs.msg import Lane, Waypoint
from std_msgs.msg import Int32
from scipy import spatial
import numpy as np
import math
LOOKAHEAD_WPS = 100 MAX_DECEL = 0.5
LOOP_RATE = 5
class WaypointUpdater(object):
def __init__(self):
ro... | true | true |
1c097003257d2358582a2c82d4a821a2d4def160 | 1,040 | py | Python | setup.py | mikpom/genontol | ee3e0aaedf59a1bc373aadd3a4f9dbb0107baf94 | [
"MIT"
] | 1 | 2020-03-19T15:55:39.000Z | 2020-03-19T15:55:39.000Z | setup.py | mikpom/genontol | ee3e0aaedf59a1bc373aadd3a4f9dbb0107baf94 | [
"MIT"
] | null | null | null | setup.py | mikpom/genontol | ee3e0aaedf59a1bc373aadd3a4f9dbb0107baf94 | [
"MIT"
] | null | null | null | from setuptools import setup
def readme():
with open('README.rst') as f:
return f.read()
setup(name='genontol',
version='0.1',
description='Gene Ontology analysis with Python',
long_description=readme(),
classifiers=[
'Intended Audience :: Science/Research',
'Li... | 32.5 | 64 | 0.584615 | from setuptools import setup
def readme():
with open('README.rst') as f:
return f.read()
setup(name='genontol',
version='0.1',
description='Gene Ontology analysis with Python',
long_description=readme(),
classifiers=[
'Intended Audience :: Science/Research',
'Li... | true | true |
1c0970f154c66a864c1bc1b0b4312e748e1bd034 | 16,083 | py | Python | homeassistant/components/light/hue.py | Norien/Home-Assistant | 0aa8933df675aa3ea93126c0b1eb7c9a77208331 | [
"Apache-2.0"
] | 2 | 2017-02-25T00:27:06.000Z | 2017-02-25T03:09:30.000Z | homeassistant/components/light/hue.py | Norien/Home-Assistant | 0aa8933df675aa3ea93126c0b1eb7c9a77208331 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/light/hue.py | Norien/Home-Assistant | 0aa8933df675aa3ea93126c0b1eb7c9a77208331 | [
"Apache-2.0"
] | null | null | null | """
Support for Hue lights.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.hue/
"""
import json
import logging
import os
import random
import socket
from datetime import timedelta
from urllib.parse import urlparse
import voluptuous as vol
import ... | 34.438972 | 79 | 0.627495 | import json
import logging
import os
import random
import socket
from datetime import timedelta
from urllib.parse import urlparse
import voluptuous as vol
import homeassistant.util as util
import homeassistant.util.color as color_util
from homeassistant.components.light import (
ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ... | true | true |
1c0972397a27b3efcf4dca19791b0333a1eb64f4 | 6,041 | py | Python | contrib/devtools/symbol-check.py | mirzaei-ce/core-fatbit | 4a111beef136b66cdb0f76fef7da397c0ec64789 | [
"MIT"
] | null | null | null | contrib/devtools/symbol-check.py | mirzaei-ce/core-fatbit | 4a111beef136b66cdb0f76fef7da397c0ec64789 | [
"MIT"
] | null | null | null | contrib/devtools/symbol-check.py | mirzaei-ce/core-fatbit | 4a111beef136b66cdb0f76fef7da397c0ec64789 | [
"MIT"
] | null | null | null | #!/usr/bin/python2
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
A script to check that the (Linux) executables produced by gitian only contain
allowed gcc, glibc and libstdc++ ve... | 36.835366 | 142 | 0.650886 | from __future__ import division, print_function
import subprocess
import re
import sys
import os
MAX_VERSIONS = {
'GCC': (4,4,0),
'CXXABI': (1,3,3),
'GLIBCXX': (3,4,13),
'GLIBC': (2,11)
}
IGNORE_EXPORTS = {
'_edata', '_end', '_init', '__bss_start', '_fini', '_IO_stdin_used'
}
READELF_CMD = os.getenv('READELF',... | true | true |
1c09725c3e95884331ff9b7db06fd147c2a8bedd | 956 | py | Python | brownie/tests/test_helpers.py | SuperZooper3/AstroSwap | 86441eb099c8b518441cd9bb58bf8ac75e5709c1 | [
"MIT"
] | 1 | 2022-02-10T05:38:20.000Z | 2022-02-10T05:38:20.000Z | brownie/tests/test_helpers.py | SuperZooper3/AstroSwap | 86441eb099c8b518441cd9bb58bf8ac75e5709c1 | [
"MIT"
] | null | null | null | brownie/tests/test_helpers.py | SuperZooper3/AstroSwap | 86441eb099c8b518441cd9bb58bf8ac75e5709c1 | [
"MIT"
] | 1 | 2022-02-18T13:08:58.000Z | 2022-02-18T13:08:58.000Z | from scripts.helpers import *
def test_calculate_liquidity_pool_output():
ethPool1 = 10
omgPool1 = 500
invariant = 5000
assert invariant == ethPool1 * omgPool1
fee = 400
amount = 1
# Going through the math
# Fee will be 1/400 of the amount, rounded down so here 0
# The new pool will... | 32.965517 | 83 | 0.651674 | from scripts.helpers import *
def test_calculate_liquidity_pool_output():
ethPool1 = 10
omgPool1 = 500
invariant = 5000
assert invariant == ethPool1 * omgPool1
fee = 400
amount = 1
assert calculate_liquidity_pool_output(ethPool1, omgPool1, amount, fee) == 45
eth... | true | true |
1c097262cc246ce51f1db2a8d29e58d52a9db615 | 3,073 | py | Python | datmo/core/entity/tests/test_task.py | awesome-archive/datmo | 72ea51c28a9947e24a464395bb0136b39eb6001a | [
"Apache-2.0"
] | 331 | 2018-03-30T14:33:59.000Z | 2022-01-10T19:43:32.000Z | datmo/core/entity/tests/test_task.py | KIMS-Github/datmo | a456d196006b67ce56af96cb4900682eab747bef | [
"MIT"
] | 274 | 2018-04-08T17:12:44.000Z | 2020-07-29T02:45:22.000Z | datmo/core/entity/tests/test_task.py | KIMS-Github/datmo | a456d196006b67ce56af96cb4900682eab747bef | [
"MIT"
] | 28 | 2018-05-03T21:57:22.000Z | 2020-12-31T04:18:42.000Z | """
Tests for Task
"""
from datmo.core.entity.task import Task
class TestTask():
def setup_class(self):
self.input_dict = {
"model_id":
"my_model",
"command":
"python test.py",
"data_file_path_map": [("/absolute/path/to/data_file",
... | 34.52809 | 79 | 0.610478 | from datmo.core.entity.task import Task
class TestTask():
def setup_class(self):
self.input_dict = {
"model_id":
"my_model",
"command":
"python test.py",
"data_file_path_map": [("/absolute/path/to/data_file",
... | true | true |
1c0972a8bb89e596a0cb72a410bdd9612455ca43 | 1,510 | py | Python | voc_annotation.py | xiaobingchan/yolo3-pytorch | f867218033f394c9b04c4f1eba73bb30415edd01 | [
"MIT"
] | null | null | null | voc_annotation.py | xiaobingchan/yolo3-pytorch | f867218033f394c9b04c4f1eba73bb30415edd01 | [
"MIT"
] | null | null | null | voc_annotation.py | xiaobingchan/yolo3-pytorch | f867218033f394c9b04c4f1eba73bb30415edd01 | [
"MIT"
] | null | null | null | #---------------------------------------------#
# 运行前一定要修改classes
# 如果生成的2007_train.txt里面没有目标信息
# 那么就是因为classes没有设定正确
#---------------------------------------------#
import xml.etree.ElementTree as ET
from os import getcwd
sets=[('2007', 'train'), ('2007', 'val'), ('2007', 'test')]
classes = ["wheat", "no-wheat... | 36.829268 | 136 | 0.57947 | import xml.etree.ElementTree as ET
from os import getcwd
sets=[('2007', 'train'), ('2007', 'val'), ('2007', 'test')]
classes = ["wheat", "no-wheat"]
def convert_annotation(year, image_id, list_file):
in_file = open('VOCdevkit/VOC%s/Annotations/%s.xml'%(year, image_id), encoding='utf-8')
tree=ET.parse(in_file... | true | true |
1c09754a61ef06e49683a29f8a4b74da23a8f931 | 5,743 | py | Python | paz/processors/keypoints.py | dema-software-solutions/paz-1 | e75ab1ba5b0980ee76ae6bd95545497665d69304 | [
"MIT"
] | null | null | null | paz/processors/keypoints.py | dema-software-solutions/paz-1 | e75ab1ba5b0980ee76ae6bd95545497665d69304 | [
"MIT"
] | null | null | null | paz/processors/keypoints.py | dema-software-solutions/paz-1 | e75ab1ba5b0980ee76ae6bd95545497665d69304 | [
"MIT"
] | null | null | null | from warnings import warn
import numpy as np
from ..abstract import Processor
from ..backend.keypoints import translate_keypoints
from ..backend.keypoints import arguments_to_image_points2D
from ..backend.keypoints import normalize_keypoints2D
from ..backend.keypoints import denormalize_keypoints2D
from ..backend.key... | 31.905556 | 81 | 0.676824 | from warnings import warn
import numpy as np
from ..abstract import Processor
from ..backend.keypoints import translate_keypoints
from ..backend.keypoints import arguments_to_image_points2D
from ..backend.keypoints import normalize_keypoints2D
from ..backend.keypoints import denormalize_keypoints2D
from ..backend.key... | true | true |
1c0975af8a43662b0e4861c0b3430c189e309080 | 1,355 | py | Python | Dynamix/CmToDy.py | Laweqyp/Chart_Converter | dce994ef0ae4c2a1f7f99e0ed7de29bca0a96dbe | [
"MIT"
] | 1 | 2021-02-27T12:42:35.000Z | 2021-02-27T12:42:35.000Z | Dynamix/CmToDy.py | Laweqyp/Chart_Converter | dce994ef0ae4c2a1f7f99e0ed7de29bca0a96dbe | [
"MIT"
] | null | null | null | Dynamix/CmToDy.py | Laweqyp/Chart_Converter | dce994ef0ae4c2a1f7f99e0ed7de29bca0a96dbe | [
"MIT"
] | null | null | null | import json
def write(s):
with open('ctody.xml', 'a+', encoding='utf-8') as file:
file.write(s + '\n')
head = """<?xml version="1.0" encoding="UTF-8" ?>
<CMap xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">"""
ctype = """<m_leftRegion>PAD</m_leftRegion... | 27.653061 | 121 | 0.6369 | import json
def write(s):
with open('ctody.xml', 'a+', encoding='utf-8') as file:
file.write(s + '\n')
head = """<?xml version="1.0" encoding="UTF-8" ?>
<CMap xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">"""
ctype = """<m_leftRegion>PAD</m_leftRegion... | true | true |
1c09762c7fd168171ff3e9c9200706986361827c | 23,660 | py | Python | pptx/text/text.py | mikebirdgeneau/python-pptx | ab86d39a643595ccc33f4644d584e35268cb4f22 | [
"MIT"
] | 1 | 2020-02-15T08:01:05.000Z | 2020-02-15T08:01:05.000Z | pptx/text/text.py | mikebirdgeneau/python-pptx | ab86d39a643595ccc33f4644d584e35268cb4f22 | [
"MIT"
] | null | null | null | pptx/text/text.py | mikebirdgeneau/python-pptx | ab86d39a643595ccc33f4644d584e35268cb4f22 | [
"MIT"
] | 3 | 2019-05-28T16:28:53.000Z | 2020-07-28T19:13:44.000Z | # encoding: utf-8
"""
Text-related objects such as TextFrame and Paragraph.
"""
from __future__ import absolute_import, print_function
from ..compat import to_unicode
from ..dml.fill import FillFormat
from ..enum.dml import MSO_FILL
from ..enum.lang import MSO_LANGUAGE_ID
from ..enum.text import MSO_AUTO_SIZE, MSO_U... | 34.339623 | 78 | 0.62426 |
from __future__ import absolute_import, print_function
from ..compat import to_unicode
from ..dml.fill import FillFormat
from ..enum.dml import MSO_FILL
from ..enum.lang import MSO_LANGUAGE_ID
from ..enum.text import MSO_AUTO_SIZE, MSO_UNDERLINE
from .fonts import FontFiles
from .layout import TextFitter
from ..opc.... | true | true |
1c09769ce5014dc59199e1c28a5202c3199be7d1 | 14,234 | py | Python | test/unit/operations/third_party/juniper/test_rpc.py | chelonia-duodeca/ncclient | da9285ad97223c04ff459aa5adaba8d3c57a7032 | [
"Apache-2.0"
] | 498 | 2015-10-21T18:43:23.000Z | 2022-03-29T17:27:59.000Z | test/unit/operations/third_party/juniper/test_rpc.py | chelonia-duodeca/ncclient | da9285ad97223c04ff459aa5adaba8d3c57a7032 | [
"Apache-2.0"
] | 440 | 2015-09-07T23:43:01.000Z | 2022-03-17T11:43:16.000Z | test/unit/operations/third_party/juniper/test_rpc.py | chelonia-duodeca/ncclient | da9285ad97223c04ff459aa5adaba8d3c57a7032 | [
"Apache-2.0"
] | 330 | 2015-09-10T16:53:50.000Z | 2022-03-31T12:24:53.000Z | from ncclient.operations.third_party.juniper.rpc import *
import json
import unittest
try:
from unittest.mock import patch # Python 3.4 and later
except ImportError:
from mock import patch
from ncclient import manager
import ncclient.manager
import ncclient.transport
from ncclient.xml_ import *
from ncclient.o... | 48.250847 | 95 | 0.680413 | from ncclient.operations.third_party.juniper.rpc import *
import json
import unittest
try:
from unittest.mock import patch except ImportError:
from mock import patch
from ncclient import manager
import ncclient.manager
import ncclient.transport
from ncclient.xml_ import *
from ncclient.operations import RaiseM... | true | true |
1c09774b3c28ed0c026ba2af004177683d06e602 | 3,583 | py | Python | code/eval_Pt_eos.py | rongzh/unbiased-pscale | 87ed71baf71af0b447d26b5c440e30fec39a02be | [
"MIT"
] | null | null | null | code/eval_Pt_eos.py | rongzh/unbiased-pscale | 87ed71baf71af0b447d26b5c440e30fec39a02be | [
"MIT"
] | null | null | null | code/eval_Pt_eos.py | rongzh/unbiased-pscale | 87ed71baf71af0b447d26b5c440e30fec39a02be | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
import scipy.optimize as optimize
from scipy.interpolate import interp1d
import collections
from eos_mod import MGD_PowerLaw,debye_fun
def set_dic(a):
param_d['V0'] = a[0]
param_d['K0'] = a[1]
param_d['K0p'] = a[2]
param_d['theta0... | 30.623932 | 125 | 0.670946 | import numpy as np
import matplotlib.pyplot as plt
import scipy.optimize as optimize
from scipy.interpolate import interp1d
import collections
from eos_mod import MGD_PowerLaw,debye_fun
def set_dic(a):
param_d['V0'] = a[0]
param_d['K0'] = a[1]
param_d['K0p'] = a[2]
param_d['theta0'] = np.exp(a[3]) p... | false | true |
1c0977a6cd2022060b5de8cd433904bff05fbe7c | 2,542 | py | Python | aliyun-python-sdk-emr/aliyunsdkemr/request/v20160408/ModifyClusterHostGroupRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-emr/aliyunsdkemr/request/v20160408/ModifyClusterHostGroupRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-emr/aliyunsdkemr/request/v20160408/ModifyClusterHostGroupRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may ... | 34.821918 | 81 | 0.761605 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdkemr.endpoint import endpoint_data
class ModifyClusterHostGroupRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Emr', '2016-04-08', 'ModifyClusterHostGroup','emr')
if hasattr(self, "endpoint_map"):
setattr(self, "endpoint_ma... | true | true |
1c09784ff5f3956968deab9851bd523146e254aa | 5,633 | py | Python | omemo/state.py | Syndace/python-omemo | f0c44fddb6c6a403363efcaabf9dea720392ba58 | [
"MIT"
] | 31 | 2018-03-28T11:15:12.000Z | 2022-01-22T08:05:40.000Z | omemo/state.py | Syndace/python-omemo | f0c44fddb6c6a403363efcaabf9dea720392ba58 | [
"MIT"
] | 30 | 2018-03-28T16:51:27.000Z | 2021-04-04T15:08:41.000Z | omemo/state.py | Syndace/python-omemo | f0c44fddb6c6a403363efcaabf9dea720392ba58 | [
"MIT"
] | 7 | 2018-03-28T16:43:50.000Z | 2022-02-16T03:31:08.000Z | import base64
import x3dh
from .exceptions import UnknownKeyException
from .extendedpublicbundle import ExtendedPublicBundle
def make(backend):
class State(backend.X3DHState):
def __init__(self):
super(State, self).__init__()
self.__spk_id = 0
self.__spk_pub = None
... | 32.373563 | 90 | 0.556364 | import base64
import x3dh
from .exceptions import UnknownKeyException
from .extendedpublicbundle import ExtendedPublicBundle
def make(backend):
class State(backend.X3DHState):
def __init__(self):
super(State, self).__init__()
self.__spk_id = 0
self.__spk_pub = None
... | true | true |
1c0978e461c47939c029b977bc14792937c340d8 | 20 | py | Python | psshlib/version.py | rlewczuk/pssh | 9eb1771f0b4ce52f3a46185a52613dedfcaa5272 | [
"BSD-3-Clause"
] | 2 | 2018-01-28T04:30:18.000Z | 2021-12-09T08:18:35.000Z | psshlib/version.py | rlewczuk/pssh | 9eb1771f0b4ce52f3a46185a52613dedfcaa5272 | [
"BSD-3-Clause"
] | null | null | null | psshlib/version.py | rlewczuk/pssh | 9eb1771f0b4ce52f3a46185a52613dedfcaa5272 | [
"BSD-3-Clause"
] | null | null | null | VERSION = '2.3.1.1'
| 10 | 19 | 0.55 | VERSION = '2.3.1.1'
| true | true |
1c0978f432eb41a1cff38f173c5753b2b0447073 | 18,186 | py | Python | awx/main/isolated/manager.py | Asharma-bhavna/awx | 218b9eaac02d5559a9f87b45cfe39edd78e6e4da | [
"Apache-2.0"
] | null | null | null | awx/main/isolated/manager.py | Asharma-bhavna/awx | 218b9eaac02d5559a9f87b45cfe39edd78e6e4da | [
"Apache-2.0"
] | null | null | null | awx/main/isolated/manager.py | Asharma-bhavna/awx | 218b9eaac02d5559a9f87b45cfe39edd78e6e4da | [
"Apache-2.0"
] | 1 | 2021-01-22T11:08:26.000Z | 2021-01-22T11:08:26.000Z | import fnmatch
import json
import os
import shutil
import stat
import tempfile
import time
import logging
import yaml
from django.conf import settings
import ansible_runner
import awx
from awx.main.utils import (
get_system_task_capacity
)
logger = logging.getLogger('awx.isolated.manager')
playbook_logger = logg... | 43.716346 | 121 | 0.569504 | import fnmatch
import json
import os
import shutil
import stat
import tempfile
import time
import logging
import yaml
from django.conf import settings
import ansible_runner
import awx
from awx.main.utils import (
get_system_task_capacity
)
logger = logging.getLogger('awx.isolated.manager')
playbook_logger = logg... | true | true |
1c09796d794c14d5973f5f4fd7fb82588bf1f84b | 11,035 | py | Python | burger_war_dev/scripts/toshima_main.py | Satori063/burger_war_dev | 68d8be082278fd55f5f5f2c7d883a4a7213f0564 | [
"BSD-3-Clause"
] | null | null | null | burger_war_dev/scripts/toshima_main.py | Satori063/burger_war_dev | 68d8be082278fd55f5f5f2c7d883a4a7213f0564 | [
"BSD-3-Clause"
] | 1 | 2022-02-24T06:39:47.000Z | 2022-02-24T06:39:47.000Z | burger_war_dev/scripts/toshima_main.py | Satori063/burger_war_dev | 68d8be082278fd55f5f5f2c7d883a4a7213f0564 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import rospy
import random
import os
import math
import cv2
import tf
import angles
from geometry_msgs.msg import Twist, Pose, Point, Quaternion, PoseWithCovarianceStamped
from sensor_msgs.msg import Image
from sensor_msgs.msg import Imu
from sensor_msgs.msg import LaserSc... | 36.180328 | 105 | 0.616584 | import rospy
import random
import os
import math
import cv2
import tf
import angles
from geometry_msgs.msg import Twist, Pose, Point, Quaternion, PoseWithCovarianceStamped
from sensor_msgs.msg import Image
from sensor_msgs.msg import Imu
from sensor_msgs.msg import LaserScan
from sensor_msgs.msg import JointState
from... | true | true |
1c097ac17d6e23886775cbd27e27e79aea580494 | 1,410 | py | Python | vm.py | chiguireitor/cpvm | ce8147ed27a93d2ef6c5753f4e7d27786c2ddaae | [
"MIT"
] | null | null | null | vm.py | chiguireitor/cpvm | ce8147ed27a93d2ef6c5753f4e7d27786c2ddaae | [
"MIT"
] | null | null | null | vm.py | chiguireitor/cpvm | ce8147ed27a93d2ef6c5753f4e7d27786c2ddaae | [
"MIT"
] | 2 | 2018-06-08T14:00:58.000Z | 2022-01-13T22:35:51.000Z |
_vm_singleton_ = None
class VM(object):
def __init__(self):
self.regs = {
"filter": {},
"filters": [],
"filterop": None,
"table": None,
"ob": [None, None, None, None, None, None, None, None],
"list": [None, None, None, None, None, Non... | 23.898305 | 69 | 0.468794 |
_vm_singleton_ = None
class VM(object):
def __init__(self):
self.regs = {
"filter": {},
"filters": [],
"filterop": None,
"table": None,
"ob": [None, None, None, None, None, None, None, None],
"list": [None, None, None, None, None, Non... | true | true |
1c097b8a423c7886ef891958ad141a535acd613b | 2,936 | py | Python | rlax/_src/base.py | anukaal/rlax | fbd615419292ece9e78a3a42c44dc4ca622fda0e | [
"Apache-2.0"
] | null | null | null | rlax/_src/base.py | anukaal/rlax | fbd615419292ece9e78a3a42c44dc4ca622fda0e | [
"Apache-2.0"
] | 1 | 2021-10-05T16:06:46.000Z | 2021-10-05T16:06:46.000Z | rlax/_src/base.py | LaudateCorpus1/rlax | caf976f6a808792e604de348187cda15b091085b | [
"Apache-2.0"
] | null | null | null | # 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 ... | 32.622222 | 80 | 0.673365 |
from typing import Optional, Sequence, Union
import chex
import jax
import jax.numpy as jnp
import numpy as np
Array = chex.Array
Numeric = chex.Numeric
def batched_index(
values: Array, indices: Array, keepdims: bool = False
) -> Array:
indexed = jnp.take_along_axis(values, indices[..., None], axis=-1)
if n... | true | true |
1c097be1e8da22d7c82393f98a553cbcf5b95e79 | 7,194 | py | Python | egs/gigaspeech/asr/simple_v1/ctc_decode.py | songmeixu/snowfall | 1f79957e9716c3f980c151df5b1d77bc4bb7ce78 | [
"Apache-2.0"
] | 145 | 2020-11-12T07:12:31.000Z | 2022-03-11T14:56:15.000Z | egs/gigaspeech/asr/simple_v1/ctc_decode.py | songmeixu/snowfall | 1f79957e9716c3f980c151df5b1d77bc4bb7ce78 | [
"Apache-2.0"
] | 212 | 2020-11-12T07:47:39.000Z | 2022-02-02T08:11:33.000Z | egs/gigaspeech/asr/simple_v1/ctc_decode.py | songmeixu/snowfall | 1f79957e9716c3f980c151df5b1d77bc4bb7ce78 | [
"Apache-2.0"
] | 43 | 2020-11-12T07:30:37.000Z | 2022-03-15T08:07:19.000Z | #!/usr/bin/env python3
# Copyright (c) 2020 Xiaomi Corporation (authors: Daniel Povey, Haowen Qiu)
# Copyright (c) 2020-2021 Johns Hopkins University (author: Piotr Żelasko)
# Apache 2.0
import logging
import os
from pathlib import Path
from typing import Union
import k2
import torch
from k2 import Fsa, SymbolTa... | 35.438424 | 110 | 0.644009 |
import logging
import os
from pathlib import Path
from typing import Union
import k2
import torch
from k2 import Fsa, SymbolTable
from kaldialign import edit_distance
from lhotse import CutSet
from lhotse.dataset import K2SpeechRecognitionDataset
from lhotse.dataset import SingleCutSampler
from snowfall.common impo... | true | true |
1c097d138fa0e19103d6ba654ae93c89226f3a72 | 438 | py | Python | venv/Scripts/pip3.7-script.py | LooDaHu/net_drive | 0e265cef6b70d5e3e4e1b0a6db68d465a8ee2fe8 | [
"MIT"
] | 2 | 2019-12-31T07:47:03.000Z | 2020-01-17T00:00:38.000Z | venv/Scripts/pip3.7-script.py | LooDaHu/net_drive | 0e265cef6b70d5e3e4e1b0a6db68d465a8ee2fe8 | [
"MIT"
] | null | null | null | venv/Scripts/pip3.7-script.py | LooDaHu/net_drive | 0e265cef6b70d5e3e4e1b0a6db68d465a8ee2fe8 | [
"MIT"
] | null | null | null | #!"C:\Users\Jinming Yang\PycharmProjects\Local_Network_Drive\venv\Scripts\python.exe"
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==19.0.3','console_scripts','pip3.7'
__requires__ = 'pip==19.0.3'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\... | 33.692308 | 85 | 0.678082 | __requires__ = 'pip==19.0.3'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('pip==19.0.3', 'console_scripts', 'pip3.7')()
)
| true | true |
1c097d8dd281c6f892406611c11d6ed069236c36 | 96 | py | Python | src/Enums/PeriodEnum.py | andreisalvador/bills-management-telegram-bot | ac0ae11cd6196ab8940c3d87dc470018d648f757 | [
"MIT"
] | null | null | null | src/Enums/PeriodEnum.py | andreisalvador/bills-management-telegram-bot | ac0ae11cd6196ab8940c3d87dc470018d648f757 | [
"MIT"
] | null | null | null | src/Enums/PeriodEnum.py | andreisalvador/bills-management-telegram-bot | ac0ae11cd6196ab8940c3d87dc470018d648f757 | [
"MIT"
] | null | null | null | import enum
class PeriodEnum(enum.Enum):
Monthly = 1
Quarterly = 3
Semiannual = 6
| 12 | 28 | 0.645833 | import enum
class PeriodEnum(enum.Enum):
Monthly = 1
Quarterly = 3
Semiannual = 6
| true | true |
1c097e02077829f79157aadd5bbd19507cd23638 | 2,073 | py | Python | machina/algos/qtopt.py | krish-dx/machina | f93bb6f5aca1feccd71fc509bd6370d2015e2d85 | [
"MIT"
] | 302 | 2019-03-13T10:21:29.000Z | 2022-03-25T10:01:46.000Z | machina/algos/qtopt.py | krish-dx/machina | f93bb6f5aca1feccd71fc509bd6370d2015e2d85 | [
"MIT"
] | 50 | 2019-03-13T09:45:00.000Z | 2021-12-23T18:32:00.000Z | machina/algos/qtopt.py | krish-dx/machina | f93bb6f5aca1feccd71fc509bd6370d2015e2d85 | [
"MIT"
] | 55 | 2019-03-17T01:59:57.000Z | 2022-03-28T01:13:40.000Z | """
This is an implementation of QT-Opt.
https://arxiv.org/abs/1806.10293
"""
from machina import loss_functional as lf
from machina import logger
def train(traj,
qf, lagged_qf, targ_qf1, targ_qf2,
optim_qf,
epoch, batch_size, # optimization hypers
tau=0.9999, gamma=0.9, # a... | 27.276316 | 90 | 0.613121 |
from machina import loss_functional as lf
from machina import logger
def train(traj,
qf, lagged_qf, targ_qf1, targ_qf2,
optim_qf,
epoch, batch_size, tau=0.9999, gamma=0.9, loss_type='mse',
log_enable=True,
):
qf_losses = []
if log_enabl... | true | true |
1c097ed561ba1236ee1f2a2d70257e58f5faeaaa | 15,234 | py | Python | spinta/formats/html/commands.py | atviriduomenys/spinta | 77a10e201f8cdc63143fce7996fd0898acb1ff58 | [
"MIT"
] | 2 | 2019-03-14T06:41:14.000Z | 2019-03-26T11:48:14.000Z | spinta/formats/html/commands.py | sirex/spinta | 77a10e201f8cdc63143fce7996fd0898acb1ff58 | [
"MIT"
] | 44 | 2019-04-05T15:52:45.000Z | 2022-03-30T07:41:33.000Z | spinta/formats/html/commands.py | sirex/spinta | 77a10e201f8cdc63143fce7996fd0898acb1ff58 | [
"MIT"
] | 1 | 2019-04-01T09:54:27.000Z | 2019-04-01T09:54:27.000Z | import dataclasses
import datetime
from decimal import Decimal
from typing import Any
from typing import Dict
from typing import Generic
from typing import Iterable
from typing import Iterator
from typing import List
from typing import Optional
from typing import TypeVar
import pkg_resources as pres
from itertools imp... | 25.39 | 102 | 0.646711 | import dataclasses
import datetime
from decimal import Decimal
from typing import Any
from typing import Dict
from typing import Generic
from typing import Iterable
from typing import Iterator
from typing import List
from typing import Optional
from typing import TypeVar
import pkg_resources as pres
from itertools imp... | true | true |
1c097f075b9185fe80801b2764f84a6281691419 | 839 | py | Python | pymoo/model/individual.py | Electr0phile/pymoo | 652428473cc68b6d9deada3792635bc8a831b255 | [
"Apache-2.0"
] | 11 | 2018-05-22T17:38:02.000Z | 2022-02-28T03:34:33.000Z | pymoo/model/individual.py | Asurada2015/pymoo | 023a787d0b78813e789f170a3e94b2de85605aff | [
"Apache-2.0"
] | null | null | null | pymoo/model/individual.py | Asurada2015/pymoo | 023a787d0b78813e789f170a3e94b2de85605aff | [
"Apache-2.0"
] | 2 | 2018-05-29T21:16:52.000Z | 2021-03-26T10:10:45.000Z | import copy
class Individual:
def __init__(self, X=None, F=None, CV=None, G=None, feasible=None, **kwargs) -> None:
self.X = X
self.F = F
self.CV = CV
self.G = G
self.feasible = feasible
self.data = kwargs
self.attr = set(self.__dict__.keys())
def has(... | 23.305556 | 89 | 0.531585 | import copy
class Individual:
def __init__(self, X=None, F=None, CV=None, G=None, feasible=None, **kwargs) -> None:
self.X = X
self.F = F
self.CV = CV
self.G = G
self.feasible = feasible
self.data = kwargs
self.attr = set(self.__dict__.keys())
def has(... | true | true |
1c097f428475e59eca34fb12f7448cf94c343eed | 3,114 | py | Python | chris_backend/collectionjson/tests/views.py | rudolphpienaar/ChRIS_ultron_backEnd | 5de4e255fb151ac7a6f900327704831da11dcd1f | [
"MIT"
] | 26 | 2016-05-26T14:09:35.000Z | 2022-01-28T19:12:43.000Z | chris_backend/collectionjson/tests/views.py | rudolphpienaar/ChRIS_ultron_backEnd | 5de4e255fb151ac7a6f900327704831da11dcd1f | [
"MIT"
] | 168 | 2016-06-24T11:07:15.000Z | 2022-03-21T12:33:43.000Z | chris_backend/collectionjson/tests/views.py | rudolphpienaar/ChRIS_ultron_backEnd | 5de4e255fb151ac7a6f900327704831da11dcd1f | [
"MIT"
] | 45 | 2017-08-16T16:41:40.000Z | 2022-03-31T18:12:14.000Z | from six.moves.urllib.parse import urljoin
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework.views import APIView
from rest_framework.viewsets import ReadOnlyModelViewSet, ModelViewSet
from rest_framework.response import Response
from rest_framework import status
from rest_framework.ex... | 29.657143 | 89 | 0.739884 | from six.moves.urllib.parse import urljoin
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework.views import APIView
from rest_framework.viewsets import ReadOnlyModelViewSet, ModelViewSet
from rest_framework.response import Response
from rest_framework import status
from rest_framework.ex... | true | true |
1c09812468daca6a992e56966b6459731b1c9388 | 30,769 | py | Python | kats/models/ensemble/kats_ensemble.py | bbahar/Kats | 671f710b4c059bae17e90d28dd7b8470afadf49b | [
"MIT"
] | null | null | null | kats/models/ensemble/kats_ensemble.py | bbahar/Kats | 671f710b4c059bae17e90d28dd7b8470afadf49b | [
"MIT"
] | null | null | null | kats/models/ensemble/kats_ensemble.py | bbahar/Kats | 671f710b4c059bae17e90d28dd7b8470afadf49b | [
"MIT"
] | null | null | null | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Kats ensemble model
Implementation of the Kats ensemble model. It starts from seasonality detection, if seasonality detected, it
continu... | 36.717184 | 123 | 0.576489 |
from __future__ import annotations
import logging
import math
import multiprocessing
import sys
from copy import copy
from multiprocessing import cpu_count
from typing import Any, Callable, Dict, Optional, Sequence, Tuple, Type, Union
import numpy as np
import pandas as pd
from kats.consts import TimeSeriesData, Pa... | true | true |
1c0981c9e2813964ac706dce9cbe99c5e9551bf2 | 7,902 | py | Python | services/common/AccountsResetPassword.py | usnistgov/SpectrumBrowser | de398cb1e4ad4669e81a9504bbd32b1fd167841e | [
"BSD-Source-Code"
] | 10 | 2016-12-12T11:40:49.000Z | 2021-11-30T01:28:26.000Z | services/common/AccountsResetPassword.py | usnistgov/SpectrumBrowser | de398cb1e4ad4669e81a9504bbd32b1fd167841e | [
"BSD-Source-Code"
] | null | null | null | services/common/AccountsResetPassword.py | usnistgov/SpectrumBrowser | de398cb1e4ad4669e81a9504bbd32b1fd167841e | [
"BSD-Source-Code"
] | 4 | 2016-10-21T19:16:32.000Z | 2021-08-25T14:41:10.000Z | # -*- coding: utf-8 -*-
#
#This software was developed by employees of the National Institute of
#Standards and Technology (NIST), and others.
#This software has been contributed to the public domain.
#Pursuant to title 15 Untied States Code Section 105, works of NIST
#employees are not subject to copyright protection ... | 45.154286 | 132 | 0.632878 |
import random
import threading
import util
import SendMail
import time
import Accounts
import Config
import AccountLock
import DbCollections
from Defines import EXPIRE_TIME
from Defines import SECONDS_PER_DAY
from Defines import SECONDS_PER_HOUR
from Defines import ACCOUNT_EMAIL_ADDRESS
from Defines import ACCOUNT_PAS... | false | true |
1c0983f800df630244e16ba1c1b0fb2e5fbdb209 | 2,320 | py | Python | setup.py | Asiier/pip-review | 3c29847131b5d0b78cb0024eb882eca53bfcd6a8 | [
"BSD-3-Clause"
] | 457 | 2015-10-07T02:58:21.000Z | 2022-03-11T12:38:27.000Z | setup.py | Asiier/pip-review | 3c29847131b5d0b78cb0024eb882eca53bfcd6a8 | [
"BSD-3-Clause"
] | 90 | 2015-11-21T10:35:29.000Z | 2022-02-16T15:40:25.000Z | setup.py | Asiier/pip-review | 3c29847131b5d0b78cb0024eb882eca53bfcd6a8 | [
"BSD-3-Clause"
] | 37 | 2015-11-20T18:11:19.000Z | 2022-03-02T13:36:45.000Z | """ pip-review lets you smoothly manage all available PyPI updates. """
from setuptools import setup
setup(
name='pip-review',
version='1.1.0',
url='https://github.com/jgonggrijp/pip-review',
license='BSD',
author='Julian Gonggrijp, Vincent Driessen',
author_email='j.gonggrijp@gmail.com',
... | 35.692308 | 73 | 0.576293 |
from setuptools import setup
setup(
name='pip-review',
version='1.1.0',
url='https://github.com/jgonggrijp/pip-review',
license='BSD',
author='Julian Gonggrijp, Vincent Driessen',
author_email='j.gonggrijp@gmail.com',
description=__doc__.strip('\n'),
long_description=open('README.rst'... | true | true |
1c098409610bcaa57e3f1787a3d225ce8f0c5f8b | 5,718 | py | Python | homeassistant/components/skybeacon/sensor.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 3 | 2020-01-21T18:09:09.000Z | 2022-01-17T08:06:03.000Z | homeassistant/components/skybeacon/sensor.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 39 | 2016-12-16T12:40:34.000Z | 2017-02-13T17:53:42.000Z | homeassistant/components/skybeacon/sensor.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 4 | 2019-10-15T21:03:53.000Z | 2020-05-27T19:53:20.000Z | """Support for Skybeacon temperature/humidity Bluetooth LE sensors."""
import logging
import threading
from uuid import UUID
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_MAC,
CONF_NAME,
EVENT_HOMEASSISTANT_STOP,
STATE_UNKNO... | 30.414894 | 86 | 0.61525 | import logging
import threading
from uuid import UUID
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_MAC,
CONF_NAME,
EVENT_HOMEASSISTANT_STOP,
STATE_UNKNOWN,
TEMP_CELSIUS,
)
import homeassistant.helpers.config_validation ... | true | true |
1c09858d8b282ee4c353f999753fa51a0996ee9b | 3,190 | py | Python | tests/integration/states/test_folder.py | dmurphy18/salt-ext-modules-vmware | 93342bfed2261c2f41232ff14d6cc0fb731b4d49 | [
"Apache-2.0"
] | null | null | null | tests/integration/states/test_folder.py | dmurphy18/salt-ext-modules-vmware | 93342bfed2261c2f41232ff14d6cc0fb731b4d49 | [
"Apache-2.0"
] | null | null | null | tests/integration/states/test_folder.py | dmurphy18/salt-ext-modules-vmware | 93342bfed2261c2f41232ff14d6cc0fb731b4d49 | [
"Apache-2.0"
] | 1 | 2021-12-15T02:46:59.000Z | 2021-12-15T02:46:59.000Z | # Copyright 2021 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0
import pytest
import saltext.vmware.states.folder as folder
def test_create_folder_test(patch_salt_globals_folder_state_test):
"""
test create folder in test mode
"""
ret = folder.manage("test_folder_state", "create", "Datacenter", "v... | 35.444444 | 99 | 0.68652 | import pytest
import saltext.vmware.states.folder as folder
def test_create_folder_test(patch_salt_globals_folder_state_test):
ret = folder.manage("test_folder_state", "create", "Datacenter", "vm")
assert ret["result"] == True
assert ret["comment"] == "These options are set to change."
assert ret["cha... | true | true |
1c0986b025acc8a9e144ee6788bf04d5c68f1ae9 | 229,283 | py | Python | pandas/tests/test_indexing.py | wjt/pandas | 0813a3359a7a946ee5f9246a5d49a933ff130f8e | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | pandas/tests/test_indexing.py | wjt/pandas | 0813a3359a7a946ee5f9246a5d49a933ff130f8e | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | pandas/tests/test_indexing.py | wjt/pandas | 0813a3359a7a946ee5f9246a5d49a933ff130f8e | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# pylint: disable-msg=W0612,E1101
import sys
import nose
import itertools
import warnings
from datetime import datetime
from pandas.compat import range, lrange, lzip, StringIO, lmap, map
from pandas.tslib import NaT
from numpy import nan
from numpy.random import randn
import numpy as np
import... | 35.898387 | 121 | 0.483049 | import sys
import nose
import itertools
import warnings
from datetime import datetime
from pandas.compat import range, lrange, lzip, StringIO, lmap, map
from pandas.tslib import NaT
from numpy import nan
from numpy.random import randn
import numpy as np
import pandas as pd
import pandas.core.common as com
from pandas... | true | true |
1c0986e2970c4464d2937e3f886f2ee33eab27e3 | 78 | py | Python | run.py | yahyasaadi/userStory | 7233942c594d5c26c34a6b886be6f02e94469583 | [
"MIT"
] | null | null | null | run.py | yahyasaadi/userStory | 7233942c594d5c26c34a6b886be6f02e94469583 | [
"MIT"
] | null | null | null | run.py | yahyasaadi/userStory | 7233942c594d5c26c34a6b886be6f02e94469583 | [
"MIT"
] | null | null | null | from user_story import app
if __name__ == '__main__':
app.run(debug=True) | 19.5 | 26 | 0.717949 | from user_story import app
if __name__ == '__main__':
app.run(debug=True) | true | true |
1c0987084159f636bd425581a27ccc8a321061e9 | 2,161 | py | Python | cdr_plugin_folder_to_folder/utils/file_utils.py | lucia15/cdr-plugin-folder-to-folder | 6dc245086d613a07e0fc63057d1ca1da965feccd | [
"Apache-2.0"
] | null | null | null | cdr_plugin_folder_to_folder/utils/file_utils.py | lucia15/cdr-plugin-folder-to-folder | 6dc245086d613a07e0fc63057d1ca1da965feccd | [
"Apache-2.0"
] | null | null | null | cdr_plugin_folder_to_folder/utils/file_utils.py | lucia15/cdr-plugin-folder-to-folder | 6dc245086d613a07e0fc63057d1ca1da965feccd | [
"Apache-2.0"
] | 1 | 2022-02-21T15:48:51.000Z | 2022-02-21T15:48:51.000Z | import os
import os.path
import shutil
import base64
class FileService:
@staticmethod
def copy_file(src,dst):
try:
shutil.copyfile(src, dst)
except Exception as error:
raise error
@staticmethod
def copy_folder(src,dest):
try:
shutil.copytree... | 25.423529 | 65 | 0.572883 | import os
import os.path
import shutil
import base64
class FileService:
@staticmethod
def copy_file(src,dst):
try:
shutil.copyfile(src, dst)
except Exception as error:
raise error
@staticmethod
def copy_folder(src,dest):
try:
shutil.copytree... | true | true |
1c098834325026b1c487d0138d1571e4c192218a | 5,399 | py | Python | bot/exts/utils/jams.py | mudkipdev/pydis-bot | 234fba49e039fc4c5c8421162e803b1be3d0d33c | [
"MIT",
"BSD-3-Clause"
] | 1 | 2020-01-26T08:31:28.000Z | 2020-01-26T08:31:28.000Z | bot/exts/utils/jams.py | Ezamey/bot | 0b7a1be1dd57a464fc79fcb235b79d75bec43f99 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | bot/exts/utils/jams.py | Ezamey/bot | 0b7a1be1dd57a464fc79fcb235b79d75bec43f99 | [
"MIT",
"BSD-3-Clause"
] | 1 | 2020-06-12T09:15:05.000Z | 2020-06-12T09:15:05.000Z | import logging
import typing as t
from discord import CategoryChannel, Guild, Member, PermissionOverwrite, Role
from discord.ext import commands
from more_itertools import unique_everseen
from bot.bot import Bot
from bot.constants import Roles
log = logging.getLogger(__name__)
MAX_CHANNELS = 50
CATEGORY_NAME = "Cod... | 35.993333 | 119 | 0.634377 | import logging
import typing as t
from discord import CategoryChannel, Guild, Member, PermissionOverwrite, Role
from discord.ext import commands
from more_itertools import unique_everseen
from bot.bot import Bot
from bot.constants import Roles
log = logging.getLogger(__name__)
MAX_CHANNELS = 50
CATEGORY_NAME = "Cod... | true | true |
1c0988aa4a977dac18d7d9c22759b9d644fadf6b | 21,036 | py | Python | tensorflow/python/data/ops/readers.py | lambdabaa/tensorflow | b7e7addbd06c3ba414565f1cd50d734a45f6e12d | [
"Apache-2.0"
] | 26 | 2019-11-10T15:33:34.000Z | 2022-03-24T19:56:57.000Z | tensorflow/python/data/ops/readers.py | lambdabaa/tensorflow | b7e7addbd06c3ba414565f1cd50d734a45f6e12d | [
"Apache-2.0"
] | 1 | 2019-08-15T02:49:21.000Z | 2019-09-04T10:10:59.000Z | tensorflow/python/data/ops/readers.py | lambdabaa/tensorflow | b7e7addbd06c3ba414565f1cd50d734a45f6e12d | [
"Apache-2.0"
] | 6 | 2020-03-29T11:10:53.000Z | 2021-06-14T05:39:14.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 40.453846 | 106 | 0.691053 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.data.ops import dataset_ops
from tensorflow.python.data.util import convert
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.pyth... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.