hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f179aeade8cd665162c97b36f563c6fb746edcec | 2,125 | py | Python | tests/unit/resolution_resolvelib/conftest.py | PreVeil/pip | 286cb388bfbc7df6b4b05277c85f6e49e3e291d3 | [
"MIT"
] | 1 | 2020-04-21T08:58:10.000Z | 2020-04-21T08:58:10.000Z | tests/unit/resolution_resolvelib/conftest.py | PreVeil/pip | 286cb388bfbc7df6b4b05277c85f6e49e3e291d3 | [
"MIT"
] | null | null | null | tests/unit/resolution_resolvelib/conftest.py | PreVeil/pip | 286cb388bfbc7df6b4b05277c85f6e49e3e291d3 | [
"MIT"
] | 1 | 2020-05-03T01:11:08.000Z | 2020-05-03T01:11:08.000Z | import pytest
from pip._internal.cli.req_command import RequirementCommand
from pip._internal.commands.install import InstallCommand
from pip._internal.index.collector import LinkCollector
from pip._internal.index.package_finder import PackageFinder
# from pip._internal.models.index import PyPI
from pip._internal.mode... | 31.25 | 78 | 0.709176 |
8e3b2794bef6d625e9a6960fefc6b6e961906776 | 13,698 | py | Python | sharpy/solvers/staticcoupledrbm.py | ostodieck/sharpy | b85aa1c001a0ec851af4eb259cce7c01dfa68b9e | [
"BSD-3-Clause"
] | 1 | 2020-07-27T05:15:35.000Z | 2020-07-27T05:15:35.000Z | sharpy/solvers/staticcoupledrbm.py | briandesilva/sharpy | aed86428ff88fd14d36cabd91cf7e04b5fc9a39a | [
"BSD-3-Clause"
] | null | null | null | sharpy/solvers/staticcoupledrbm.py | briandesilva/sharpy | aed86428ff88fd14d36cabd91cf7e04b5fc9a39a | [
"BSD-3-Clause"
] | null | null | null | import ctypes as ct
import numpy as np
import sharpy.aero.utils.mapping as mapping
import sharpy.utils.cout_utils as cout
import sharpy.utils.solver_interface as solver_interface
from sharpy.utils.solver_interface import solver, BaseSolver
import sharpy.utils.settings as settings
import sharpy.utils.algebra as algebr... | 45.059211 | 129 | 0.632063 |
4de6a160fd3067912c5b297d9ef663ee7e735321 | 1,081 | py | Python | app/grandchallenge/evaluation/migrations/0030_auto_20200702_0845.py | njmhendrix/grand-challenge.org | 9bc36f5e26561a78bd405e8ea5e4c0f86c95f011 | [
"Apache-2.0"
] | null | null | null | app/grandchallenge/evaluation/migrations/0030_auto_20200702_0845.py | njmhendrix/grand-challenge.org | 9bc36f5e26561a78bd405e8ea5e4c0f86c95f011 | [
"Apache-2.0"
] | null | null | null | app/grandchallenge/evaluation/migrations/0030_auto_20200702_0845.py | njmhendrix/grand-challenge.org | 9bc36f5e26561a78bd405e8ea5e4c0f86c95f011 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.0.8 on 2020-07-02 08:45
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("evaluation", "0029_auto_20200622_1306"),
]
operations = [
migrations.AddField(
model_... | 29.216216 | 127 | 0.572618 |
4e5110b4a298daed7101ea045848346bc98b09de | 3,522 | py | Python | practises/best-trading-by-year.py | m860/data-analysis-with-python | e96a5ae79913d7805383ea3dfb8dcc731c60681d | [
"MIT"
] | null | null | null | practises/best-trading-by-year.py | m860/data-analysis-with-python | e96a5ae79913d7805383ea3dfb8dcc731c60681d | [
"MIT"
] | null | null | null | practises/best-trading-by-year.py | m860/data-analysis-with-python | e96a5ae79913d7805383ea3dfb8dcc731c60681d | [
"MIT"
] | null | null | null | from classes import Stock, format
import numpy as np
import os
from datetime import date, timedelta
from dateutil.parser import parse
import sys
from multiprocessing import Pool
import time
import json
stock = Stock()
raterange = np.arange(0.02, 0.5, 0.001)[::-1]
def getFiles(dirname):
files = None
for dirpa... | 28.868852 | 104 | 0.536343 |
1c997f153ba0303369de0741fff1d8b21ab7630a | 5,790 | py | Python | test/functional/wallet_txn_doublespend.py | Bits-Coin/bits-coin | dd8220018f5582e76d43e8c52bd323524e495d8c | [
"MIT"
] | 2 | 2021-11-17T23:05:13.000Z | 2021-11-17T23:05:32.000Z | test/functional/wallet_txn_doublespend.py | Bits-Coin/bits-coin | dd8220018f5582e76d43e8c52bd323524e495d8c | [
"MIT"
] | null | null | null | test/functional/wallet_txn_doublespend.py | Bits-Coin/bits-coin | dd8220018f5582e76d43e8c52bd323524e495d8c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2009-2019 The Bitcoin Core developers
# Copyright (c) 2014-2019 The BitsCoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the wallet accounts properly when there is ... | 42.262774 | 111 | 0.658895 |
36e7e59438f994e3c995a2ba654333f716a2241c | 6,207 | py | Python | ppcls/modeling/architectures/resnet_vc.py | cq2019git/PaddleClas | 10326f0d0b89dc5aaf711fd0b9f45f6557007208 | [
"Apache-2.0"
] | 13 | 2020-09-09T12:23:36.000Z | 2022-03-16T09:42:07.000Z | ppcls/modeling/architectures/resnet_vc.py | cq2019git/PaddleClas | 10326f0d0b89dc5aaf711fd0b9f45f6557007208 | [
"Apache-2.0"
] | null | null | null | ppcls/modeling/architectures/resnet_vc.py | cq2019git/PaddleClas | 10326f0d0b89dc5aaf711fd0b9f45f6557007208 | [
"Apache-2.0"
] | 5 | 2020-09-14T07:35:39.000Z | 2021-12-22T02:03:31.000Z | #copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
#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 l... | 31.830769 | 92 | 0.520864 |
a822bb57f58673b08ead1160f00bca91ecce3710 | 42,953 | py | Python | testing/test_debugging.py | aminalaee/pytest | e01231c215e0d4150cea8d08f57bd65f1a88b964 | [
"MIT"
] | 9,225 | 2015-06-15T21:56:14.000Z | 2022-03-31T20:47:38.000Z | testing/test_debugging.py | aminalaee/pytest | e01231c215e0d4150cea8d08f57bd65f1a88b964 | [
"MIT"
] | 7,794 | 2015-06-15T21:06:34.000Z | 2022-03-31T10:56:54.000Z | testing/test_debugging.py | aminalaee/pytest | e01231c215e0d4150cea8d08f57bd65f1a88b964 | [
"MIT"
] | 2,598 | 2015-06-15T21:42:39.000Z | 2022-03-29T13:48:22.000Z | import os
import sys
from typing import List
import _pytest._code
import pytest
from _pytest.debugging import _validate_usepdb_cls
from _pytest.monkeypatch import MonkeyPatch
from _pytest.pytester import Pytester
try:
# Type ignored for Python <= 3.6.
breakpoint # type: ignore
except NameError:
SUPPORTS_... | 32.344127 | 97 | 0.544386 |
b93ddd4c659b7a31d8188c948e5216efcf0a4373 | 5,289 | py | Python | lungmask/mask.py | tp61/lungmask | 5d12abf2b9a500da1b6abeae6711628a8081b97c | [
"Apache-2.0"
] | null | null | null | lungmask/mask.py | tp61/lungmask | 5d12abf2b9a500da1b6abeae6711628a8081b97c | [
"Apache-2.0"
] | null | null | null | lungmask/mask.py | tp61/lungmask | 5d12abf2b9a500da1b6abeae6711628a8081b97c | [
"Apache-2.0"
] | null | null | null | import numpy as np
import torch
from lungmask import utils
import SimpleITK as sitk
from .resunet import UNet
import warnings
import sys
from tqdm import tqdm
import skimage
import logging
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
warnings.filterwarnings("ignore", category=UserWarning)
# stores urls ... | 43.352459 | 174 | 0.665532 |
e6d7ab2f52cc06d8408dd17501d0fee3a59e8ce6 | 30,197 | py | Python | 2_LUCIR_+DC/class_incremental_cosine_imagenet.py | lywang3081/MRDC | 7f8ec5060495560d6e307d89341ccf5598dcb85b | [
"MIT"
] | 1 | 2022-03-18T04:46:01.000Z | 2022-03-18T04:46:01.000Z | 2_LUCIR_+DC/class_incremental_cosine_imagenet.py | lywang3081/MRDC | 7f8ec5060495560d6e307d89341ccf5598dcb85b | [
"MIT"
] | null | null | null | 2_LUCIR_+DC/class_incremental_cosine_imagenet.py | lywang3081/MRDC | 7f8ec5060495560d6e307d89341ccf5598dcb85b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.optim import lr_scheduler
import torchvision
from torchvision import datasets, models, transforms
from torch.autograd import Variable
import numpy as np
import time
import os
im... | 54.70471 | 181 | 0.628076 |
dbe947e310ce4320f5ce181c46b6a5dc8dda8f83 | 2,299 | py | Python | core/turing_machine.py | mjutzi/TikzTuringSimulator | 2d0a54d5fc13bb1b80e903ad304809a49e8d99e7 | [
"Apache-2.0"
] | 3 | 2017-07-02T12:45:46.000Z | 2020-08-14T19:43:43.000Z | core/turing_machine.py | mjutzi/TikzTuringSimulator | 2d0a54d5fc13bb1b80e903ad304809a49e8d99e7 | [
"Apache-2.0"
] | null | null | null | core/turing_machine.py | mjutzi/TikzTuringSimulator | 2d0a54d5fc13bb1b80e903ad304809a49e8d99e7 | [
"Apache-2.0"
] | null | null | null | class InvalidCharacterException(Exception):
def __init__(self, chars):
super(InvalidCharacterException, self).__init__('\'{}\' are not in alphabet.'.format(chars))
class TuringMachine:
def __init__(self, num_of_tapes, initial_state, final_states, transition_graph, alphabet=None):
self.__num_of... | 40.333333 | 123 | 0.68595 |
f1693080896fedda21bacc58a70edc998dfed039 | 6,015 | py | Python | tests/test_transport.py | alexdz18/pymysensors | 41d002b5c9f4b2594147b72178de2fc2293fdb89 | [
"MIT"
] | 66 | 2015-05-29T16:15:29.000Z | 2022-01-07T14:06:24.000Z | tests/test_transport.py | alexdz18/pymysensors | 41d002b5c9f4b2594147b72178de2fc2293fdb89 | [
"MIT"
] | 95 | 2015-04-07T17:46:25.000Z | 2022-01-24T17:16:18.000Z | tests/test_transport.py | alexdz18/pymysensors | 41d002b5c9f4b2594147b72178de2fc2293fdb89 | [
"MIT"
] | 59 | 2015-04-03T02:06:05.000Z | 2022-01-19T17:03:17.000Z | """Test the gateway transport."""
from unittest import mock
import pytest
from mysensors import Gateway
from mysensors.task import SyncTasks
from mysensors.transport import BaseMySensorsProtocol, Transport
# pylint: disable=redefined-outer-name
@pytest.fixture
def connection_transport():
"""Return a mock conne... | 37.59375 | 88 | 0.76542 |
179e82083888108d775213e1d8129d1a405d9ef9 | 7,688 | py | Python | saleor/graphql/payment/types.py | VALKYR-Developers/saleor | adc189d429199b9e0203726102a50d5673bafece | [
"CC-BY-4.0"
] | 1 | 2022-02-21T07:17:08.000Z | 2022-02-21T07:17:08.000Z | saleor/graphql/payment/types.py | VALKYR-Developers/saleor | adc189d429199b9e0203726102a50d5673bafece | [
"CC-BY-4.0"
] | 81 | 2021-10-11T04:26:07.000Z | 2022-03-28T04:46:43.000Z | saleor/graphql/payment/types.py | VALKYR-Developers/saleor | adc189d429199b9e0203726102a50d5673bafece | [
"CC-BY-4.0"
] | null | null | null | import graphene
from graphene import relay
from ...core.exceptions import PermissionDenied
from ...core.permissions import OrderPermissions
from ...core.tracing import traced_resolver
from ...payment import models
from ..checkout.dataloaders import CheckoutByTokenLoader
from ..core.connection import CountableConnectio... | 35.925234 | 86 | 0.69732 |
060153ef84c8610221f2a7f942344021755bfe92 | 365 | py | Python | Numbers genenne.py | SixLeopard/Python-Random-NUmber-Generator | 7c66d97f9a4332f26228685f575c170f9bd6e191 | [
"MIT"
] | 2 | 2019-03-04T02:55:02.000Z | 2019-05-03T01:47:03.000Z | Numbers genenne.py | SixLeopard/Python-Random-NUmber-Generator | 7c66d97f9a4332f26228685f575c170f9bd6e191 | [
"MIT"
] | null | null | null | Numbers genenne.py | SixLeopard/Python-Random-NUmber-Generator | 7c66d97f9a4332f26228685f575c170f9bd6e191 | [
"MIT"
] | 2 | 2021-02-08T16:34:48.000Z | 2021-02-22T21:38:07.000Z | import random
yes = "yes"
f = open('Numbes.txt','w')
while yes == "yes":
lol = str(random.randint(100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,999999999999999999999999999999999999999999999999999999999990000000000000000000000000000000000000... | 45.625 | 267 | 0.838356 |
457231d003ea1a8b76943cf2f42c248da0a739cd | 2,090 | py | Python | vsts/vsts/service_endpoint/v4_1/models/service_endpoint_request.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | vsts/vsts/service_endpoint/v4_1/models/service_endpoint_request.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | vsts/vsts/service_endpoint/v4_1/models/service_endpoint_request.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 61.470588 | 136 | 0.677033 |
8dfa233ca37cab45453777290536b806d1e5cd3f | 6,326 | py | Python | rlalgos/tf/mf/dqn.py | vermouth1992/rl-util | 4c06ab8f5c96a44e58f88cf30146bcb837057112 | [
"Apache-2.0"
] | null | null | null | rlalgos/tf/mf/dqn.py | vermouth1992/rl-util | 4c06ab8f5c96a44e58f88cf30146bcb837057112 | [
"Apache-2.0"
] | null | null | null | rlalgos/tf/mf/dqn.py | vermouth1992/rl-util | 4c06ab8f5c96a44e58f88cf30146bcb837057112 | [
"Apache-2.0"
] | null | null | null | """
Deep Q Network for low-dimensional observation space
"""
import rlutils.tf as rlu
import tensorflow as tf
from rlutils.infra.runner import TFOffPolicyRunner, run_func_as_main
from rlutils.interface.agent import Agent
def gather_q_values(q_values, actions):
batch_size = tf.shape(actions)[0]
idx = tf.stac... | 37.654762 | 109 | 0.619823 |
8d03c89243f5e99160f9f82d96d06f87635f74b7 | 4,301 | py | Python | openmdao.lib/src/openmdao/lib/drivers/newton_solver.py | mjfwest/OpenMDAO-Framework | a5521f47ad7686c25b203de74e1c7dff5fd7a52b | [
"Apache-2.0"
] | 69 | 2015-01-02T19:10:08.000Z | 2021-11-14T04:42:28.000Z | openmdao.lib/src/openmdao/lib/drivers/newton_solver.py | jcchin/OpenMDAO-Framework | 038e89b06da1c74f00918f4c6fbd8bd365e25657 | [
"Apache-2.0"
] | 3 | 2015-01-15T23:08:18.000Z | 2015-03-11T16:57:35.000Z | openmdao.lib/src/openmdao/lib/drivers/newton_solver.py | jcchin/OpenMDAO-Framework | 038e89b06da1c74f00918f4c6fbd8bd365e25657 | [
"Apache-2.0"
] | 31 | 2015-09-16T00:37:35.000Z | 2022-01-10T06:27:55.000Z | """
A python Newton solver with line-search adapation of the relaxation parameter.
"""
# pylint: disable=C0103
#public symbols
__all__ = ['NewtonSolver']
import numpy
from openmdao.main.mpiwrap import MPI, get_norm
# pylint: disable=E0611, F0401
from openmdao.main.case import Case
from openmdao.main.driver import D... | 31.859259 | 81 | 0.601023 |
b0530fe355cdb6f77a3fb25eddafbab663c026c4 | 51,822 | py | Python | docs.py | raccoongang/openprocurement.tender.openuadefense | 66976b86ca0f82a731eebe7274cafd87f81d8f13 | [
"Apache-2.0"
] | null | null | null | docs.py | raccoongang/openprocurement.tender.openuadefense | 66976b86ca0f82a731eebe7274cafd87f81d8f13 | [
"Apache-2.0"
] | 40 | 2016-03-18T09:55:05.000Z | 2018-03-19T15:23:20.000Z | docs.py | raccoongang/openprocurement.tender.openuadefense | 66976b86ca0f82a731eebe7274cafd87f81d8f13 | [
"Apache-2.0"
] | 17 | 2016-03-18T09:46:47.000Z | 2018-05-25T07:50:55.000Z | # -*- coding: utf-8 -*-
import json
import os
from datetime import timedelta
import openprocurement.tender.openuadefense.tests.base as base_test
from openprocurement.api.models import get_now
from openprocurement.api.tests.base import PrefixedRequestClass
from openprocurement.tender.openuadefense.tests.tender import B... | 49.307326 | 201 | 0.590078 |
c814ca030daf686e625a783cb59ca914c9d0ef7e | 4,325 | py | Python | contrib/seeds/generate-seeds.py | StutzCoin/stutz | b7db01cff055e7dc4b07317732fc990a46161956 | [
"MIT"
] | null | null | null | contrib/seeds/generate-seeds.py | StutzCoin/stutz | b7db01cff055e7dc4b07317732fc990a46161956 | [
"MIT"
] | null | null | null | contrib/seeds/generate-seeds.py | StutzCoin/stutz | b7db01cff055e7dc4b07317732fc990a46161956 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2017 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.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the dir... | 31.34058 | 98 | 0.581272 |
a864fd51200177b1f4d2b2fd19f7730461cb094f | 1,981 | py | Python | examples/scan_ble.py | nobrin/omron-2jcie-bu01 | 7570eb55c4f3f371cce999fbff5bd3dfcd34e424 | [
"MIT"
] | 1 | 2021-10-20T06:11:50.000Z | 2021-10-20T06:11:50.000Z | examples/scan_ble.py | nobrin/omron-2jcie-bu01 | 7570eb55c4f3f371cce999fbff5bd3dfcd34e424 | [
"MIT"
] | null | null | null | examples/scan_ble.py | nobrin/omron-2jcie-bu01 | 7570eb55c4f3f371cce999fbff5bd3dfcd34e424 | [
"MIT"
] | 1 | 2021-07-12T15:57:47.000Z | 2021-07-12T15:57:47.000Z | #!/usr/bin/env python3
""" NOTE: Bluez 5.50 may not return all every received messages.
Data seems to be detected every 11 seconds.
In mode 0x03, ADV_IND and ADV_RSP are not always aligned.
So, it seems that complete data can only be obtained once in a white.
The acquisition intervals was between 44 to ... | 31.444444 | 81 | 0.684503 |
837e1e94f34b4c0c3baee5ecd3a45132fe97f995 | 1,088 | py | Python | Game/Dados/dadosDoJogo.py | almerindopaixao/GameOfHeroes | 46a20f236caa4a5eef1f7dfe58e4add6d1787e3c | [
"MIT"
] | 1 | 2020-04-14T04:16:02.000Z | 2020-04-14T04:16:02.000Z | Game/Dados/dadosDoJogo.py | almerindopaixao/GameOfHeroes | 46a20f236caa4a5eef1f7dfe58e4add6d1787e3c | [
"MIT"
] | null | null | null | Game/Dados/dadosDoJogo.py | almerindopaixao/GameOfHeroes | 46a20f236caa4a5eef1f7dfe58e4add6d1787e3c | [
"MIT"
] | null | null | null | from time import sleep
import json
def carregarJogo(player):
"""
Função que carrega o jogo
"""
try:
jogoSalvo = open('jogoSalvo.json', 'rb')
jogoSalvo.close()
except IOError:
print('\033[1;31mNão foi encontrado nenhum jogo Salvo\033[m')
return
with open('jogoSa... | 23.148936 | 69 | 0.589154 |
bc32c5f1d7965d118d526013de34b62b3276010b | 20,129 | py | Python | Installation/tests/test_spectrogram.py | pmatosevic/nnAudio | bf7a6392b32f11294d677cba1920886f5b321730 | [
"MIT"
] | null | null | null | Installation/tests/test_spectrogram.py | pmatosevic/nnAudio | bf7a6392b32f11294d677cba1920886f5b321730 | [
"MIT"
] | null | null | null | Installation/tests/test_spectrogram.py | pmatosevic/nnAudio | bf7a6392b32f11294d677cba1920886f5b321730 | [
"MIT"
] | null | null | null | import pytest
import librosa
import torch
from scipy.signal import chirp, sweep_poly
import sys
sys.path.insert(0, './')
from nnAudio.Spectrogram import *
from parameters import *
import warnings
gpu_idx=0 # Choose which GPU to use
# If GPU is avaliable, also test on GPU
if torch.cuda.is_available():
device_args... | 44.23956 | 119 | 0.622386 |
655ecca9098cc69f81b455c4453a49e74ad86738 | 111 | py | Python | CAIL2020/cocr/torchocr/networks/__init__.py | ShenDezhou/CAIL | c4cfa98ab4ecedbce34a7a5a186830486047540c | [
"Apache-2.0"
] | 71 | 2020-07-16T01:49:27.000Z | 2022-03-27T16:55:00.000Z | CAIL2020/cocr/torchocr/networks/__init__.py | ShenDezhou/CAIL | c4cfa98ab4ecedbce34a7a5a186830486047540c | [
"Apache-2.0"
] | 11 | 2020-09-18T14:26:25.000Z | 2022-02-09T23:49:33.000Z | CAIL2020/cocr/torchocr/networks/__init__.py | ShenDezhou/CAIL | c4cfa98ab4ecedbce34a7a5a186830486047540c | [
"Apache-2.0"
] | 16 | 2020-07-15T07:24:30.000Z | 2022-03-19T05:41:11.000Z | from .architectures import build_model
from .losses import build_loss
__all__ = ['build_model', 'build_loss']
| 22.2 | 39 | 0.792793 |
ebf0c448e1090e2ba5bf8fcdd9dbc9de50e99700 | 2,331 | py | Python | sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_generated/v7_3/aio/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_generated/v7_3/aio/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_generated/v7_3/aio/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 44.826923 | 108 | 0.677392 |
00695b11eaa0f54c472c58ec84f6ed5d4f600810 | 499 | py | Python | plotly/validators/histogram2dcontour/stream/_token.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 2 | 2020-03-24T11:41:14.000Z | 2021-01-14T07:59:43.000Z | plotly/validators/histogram2dcontour/stream/_token.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | null | null | null | plotly/validators/histogram2dcontour/stream/_token.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 4 | 2019-06-03T14:49:12.000Z | 2022-01-06T01:05:12.000Z | import _plotly_utils.basevalidators
class TokenValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name='token',
parent_name='histogram2dcontour.stream',
**kwargs
):
super(TokenValidator, self).__init__(
plotly_name=plotly_na... | 23.761905 | 67 | 0.581162 |
022a482c6b203eec3b9185820554348a0cfdad75 | 699 | py | Python | graphics_in_the_admin_panel_project/graphics_in_the_admin_panel_application/parser.py | Jenek209/4a0f9bca3ce79bd9b0a5fa6a95e134d0 | 15295b50cad1e8fe574ba056486a28ae990e251a | [
"MIT"
] | null | null | null | graphics_in_the_admin_panel_project/graphics_in_the_admin_panel_application/parser.py | Jenek209/4a0f9bca3ce79bd9b0a5fa6a95e134d0 | 15295b50cad1e8fe574ba056486a28ae990e251a | [
"MIT"
] | null | null | null | graphics_in_the_admin_panel_project/graphics_in_the_admin_panel_application/parser.py | Jenek209/4a0f9bca3ce79bd9b0a5fa6a95e134d0 | 15295b50cad1e8fe574ba056486a28ae990e251a | [
"MIT"
] | null | null | null | import ast
import operator as op
# supported operators
operators = {ast.Add: op.add, ast.Sub: op.sub, ast.Mult: op.mul,
ast.Div: op.truediv, ast.Pow: op.pow, ast.BitXor: op.xor,
ast.USub: op.neg}
def eval_expr(expr):
return eval_(ast.parse(expr, mode='eval').body)
def eval_(node):
... | 31.772727 | 76 | 0.638054 |
f0c3ed812ee088a4ffb5301b93896a79122fa54c | 3,453 | py | Python | microquake/core/helpers/velocity.py | jeanphilippemercier/microquake | 0b9d07be11eddd64619e46939c320487531602a3 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | microquake/core/helpers/velocity.py | jeanphilippemercier/microquake | 0b9d07be11eddd64619e46939c320487531602a3 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | microquake/core/helpers/velocity.py | jeanphilippemercier/microquake | 0b9d07be11eddd64619e46939c320487531602a3 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | from os import environ, path
import numpy as np
from microquake.core.data.grid import create, read_grid
from microquake.core.settings import settings
def get_current_velocity_model_id(phase='P'):
"""
Return the velocity model ID for a specificed phase
:param phase: phase (possible values 'P', 'S'
:... | 32.885714 | 114 | 0.601216 |
1380be3207ee175f852fa49395d105708969ec55 | 603 | py | Python | ozpcenter/models/custom_field_type.py | emosher/ozp-backend | d31d00bb8a28a8d0c999813f616b398f41516244 | [
"Apache-2.0"
] | 1 | 2018-10-05T17:03:01.000Z | 2018-10-05T17:03:01.000Z | ozpcenter/models/custom_field_type.py | emosher/ozp-backend | d31d00bb8a28a8d0c999813f616b398f41516244 | [
"Apache-2.0"
] | 1 | 2017-01-06T19:20:32.000Z | 2017-01-06T19:20:32.000Z | ozpcenter/models/custom_field_type.py | emosher/ozp-backend | d31d00bb8a28a8d0c999813f616b398f41516244 | [
"Apache-2.0"
] | 7 | 2016-12-16T15:42:05.000Z | 2020-09-05T01:11:27.000Z | from django.db import models
from .external_model import ExternalModel
class CustomFieldType(ExternalModel):
"""
Custom Field Type
Defines the what kind of field a Custom Field will represent
"""
class Meta:
db_table = 'custom_field_type'
name = models.CharField(max_length=50)
... | 23.192308 | 70 | 0.708126 |
4c047db4ad3a12d4494173e2ef91fa044d2614a7 | 1,715 | py | Python | Menchetti/NN_model/predict_one.py | LucaLand/SistemiDigitaliM20-21 | e900327cc905d21caae72c42ec027f991b6ac2d9 | [
"MIT"
] | 9 | 2021-02-07T22:53:34.000Z | 2022-03-14T21:47:30.000Z | Menchetti/NN_model/predict_one.py | LucaLand/SistemiDigitaliM20-21 | e900327cc905d21caae72c42ec027f991b6ac2d9 | [
"MIT"
] | null | null | null | Menchetti/NN_model/predict_one.py | LucaLand/SistemiDigitaliM20-21 | e900327cc905d21caae72c42ec027f991b6ac2d9 | [
"MIT"
] | 18 | 2021-02-07T18:30:47.000Z | 2022-01-22T16:57:40.000Z | #DA FAREEEEE
import tensorflow as tf
import numpy as np
import pandas as pd
import cv2
import sys
sys.path.append('../../')
from utils.DBR_utils import get_dog_from_predictions, resize_square_image_keep_ratio_border, print_human_readable_dog_cli
from Network import DBR_Network
# -- Variabili globali --
# Paths
mode... | 32.358491 | 126 | 0.739942 |
6d3b8d6b83bfb2097173706f11fb4065eb0610c6 | 2,110 | py | Python | irctest/server_tests/away_notify.py | FiskFan1999/ergochat_irctest | da005d7d2492bf31c4bdeb46108240766c69d0ad | [
"MIT"
] | 16 | 2015-12-20T16:24:54.000Z | 2021-06-03T18:00:03.000Z | irctest/server_tests/away_notify.py | FiskFan1999/ergochat_irctest | da005d7d2492bf31c4bdeb46108240766c69d0ad | [
"MIT"
] | 66 | 2015-12-20T00:23:25.000Z | 2021-08-14T09:57:04.000Z | irctest/server_tests/away_notify.py | FiskFan1999/ergochat_irctest | da005d7d2492bf31c4bdeb46108240766c69d0ad | [
"MIT"
] | 3 | 2021-12-04T21:18:41.000Z | 2022-03-22T01:42:36.000Z | """
<https://ircv3.net/specs/extensions/away-notify-3.1>
"""
from irctest import cases
class AwayNotifyTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
@cases.mark_capabilities("away-notify")
def testAwayNotify(self):
"""Basic away-notify test."""
self.connectClient("foo", capabil... | 33.492063 | 88 | 0.609005 |
8aca6afefb6f90cafb3da7266eac8c7539659933 | 11,495 | py | Python | varnish.py | 360youlun/python-varnish | 6dd614f3081e277e7ce23fa6a6fb1ca45c914e43 | [
"BSD-3-Clause"
] | 1 | 2015-04-29T06:12:33.000Z | 2015-04-29T06:12:33.000Z | varnish.py | 360youlun/python-varnish | 6dd614f3081e277e7ce23fa6a6fb1ca45c914e43 | [
"BSD-3-Clause"
] | null | null | null | varnish.py | 360youlun/python-varnish | 6dd614f3081e277e7ce23fa6a6fb1ca45c914e43 | [
"BSD-3-Clause"
] | null | null | null | """
Simple Python interface for the Varnish management port.
Tested against
Varnish v3.0.2
Varnish Cache CLI 1.0
Supports the following commands
help [command]
ping [timestamp]
auth response
quit
status
start
stop
vcl.load <configname> <filename>
vcl.inline <configname> <quoted_VCLstring>
vcl.use <configname... | 34.728097 | 110 | 0.590779 |
6f407ba37eb27fe2e3538737619ce69f3da960e8 | 10,542 | py | Python | qiskit/opflow/gradients/derivative_base.py | Roshan-Thomas/qiskit-terra | 77219b5c7b7146b1545c5e5190739b36f4064b2f | [
"Apache-2.0"
] | 1,599 | 2018-07-10T10:59:12.000Z | 2022-03-31T23:56:25.000Z | qiskit/opflow/gradients/derivative_base.py | Roshan-Thomas/qiskit-terra | 77219b5c7b7146b1545c5e5190739b36f4064b2f | [
"Apache-2.0"
] | 5,244 | 2018-07-10T06:20:13.000Z | 2022-03-31T22:18:48.000Z | qiskit/opflow/gradients/derivative_base.py | Roshan-Thomas/qiskit-terra | 77219b5c7b7146b1545c5e5190739b36f4064b2f | [
"Apache-2.0"
] | 1,409 | 2018-07-10T02:16:12.000Z | 2022-03-31T09:01:32.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... | 43.925 | 99 | 0.643426 |
f1be8685e57b96e685ef0f775010459c86235f0a | 7,884 | py | Python | src/python/api/element_test.py | AustralianDisabilityLimited/incubator-wave | 0858e0c60b42e2cac38aed44d8b16f9e8bcb377a | [
"MIT"
] | null | null | null | src/python/api/element_test.py | AustralianDisabilityLimited/incubator-wave | 0858e0c60b42e2cac38aed44d8b16f9e8bcb377a | [
"MIT"
] | null | null | null | src/python/api/element_test.py | AustralianDisabilityLimited/incubator-wave | 0858e0c60b42e2cac38aed44d8b16f9e8bcb377a | [
"MIT"
] | null | null | null | #!/usr/bin/python2.4
#
# 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
# "L... | 36 | 81 | 0.67174 |
2fef585f03f53a3bd585fce4cda87a28a6522376 | 861 | py | Python | train_test_split.py | KennethTBarrett/Decision-Tree-Algorithm-LSCS | a729ad640f03d867c8e7b6117d4339f9d1f2a5c9 | [
"MIT"
] | null | null | null | train_test_split.py | KennethTBarrett/Decision-Tree-Algorithm-LSCS | a729ad640f03d867c8e7b6117d4339f9d1f2a5c9 | [
"MIT"
] | null | null | null | train_test_split.py | KennethTBarrett/Decision-Tree-Algorithm-LSCS | a729ad640f03d867c8e7b6117d4339f9d1f2a5c9 | [
"MIT"
] | null | null | null | import random
def train_test_split(df, test_size):
"""Randomly selects data, and splits it based upon
the specified test size.
Usage: `train_test_split(df, test_size)`
Returns training and testing data.
If a float is input as test_size, it's treated as percentage."""
#... | 37.434783 | 79 | 0.653891 |
db50bb9fe39090636ef96bb1a2a0d70439ad8f8d | 1,056 | py | Python | _sadm/plugin/os/pkg/debian/deploy.py | jrmsdev/pysadm | 0d6b3f0c8d870d83ab499c8d9487ec8e3a89fc37 | [
"BSD-3-Clause"
] | 1 | 2019-10-15T08:37:56.000Z | 2019-10-15T08:37:56.000Z | _sadm/plugin/os/pkg/debian/deploy.py | jrmsdev/pysadm | 0d6b3f0c8d870d83ab499c8d9487ec8e3a89fc37 | [
"BSD-3-Clause"
] | null | null | null | _sadm/plugin/os/pkg/debian/deploy.py | jrmsdev/pysadm | 0d6b3f0c8d870d83ab499c8d9487ec8e3a89fc37 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) Jeremías Casteglione <jrmsdev@gmail.com>
# See LICENSE file.
from os import environ
from _sadm.utils.cmd import call, callCheck
from .check import check
__all__ = ['deploy']
_cmdenv = environ.copy()
_cmdenv['DEBIAN_FRONTEND'] = 'noninteractive'
def deploy(env):
if env.settings.getboolean('os.pkg'... | 22.956522 | 80 | 0.639205 |
72cc344455810f1c2e6680d4982e13fb6ade5d26 | 1,479 | py | Python | dedomeno/houses/migrations/0093_auto_20170109_1615.py | ginopalazzo/dedomeno | e43df365849102016c8819b2082d2cde9109360f | [
"MIT"
] | 38 | 2018-03-19T12:52:17.000Z | 2022-02-17T14:45:57.000Z | dedomeno/houses/migrations/0093_auto_20170109_1615.py | ginopalazzo/dedomeno | e43df365849102016c8819b2082d2cde9109360f | [
"MIT"
] | 7 | 2020-02-11T23:01:40.000Z | 2020-08-06T13:30:58.000Z | dedomeno/houses/migrations/0093_auto_20170109_1615.py | ginopalazzo/dedomeno | e43df365849102016c8819b2082d2cde9109360f | [
"MIT"
] | 12 | 2019-02-23T22:10:34.000Z | 2022-03-24T12:01:38.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-01-09 15:15
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('houses', '0092_office_warehouse'),
]
operations = ... | 35.214286 | 194 | 0.583502 |
e39a3462673f9ed38dd61a0d2d9b7f97c656b1fc | 1,412 | py | Python | cbmod/currency/views/wizard/page.py | coinbox/coinbox-mod-currency | e6b2141824fb2a64e74bcb3e7068da8d9d9aaf2c | [
"MIT"
] | 1 | 2015-11-27T20:59:21.000Z | 2015-11-27T20:59:21.000Z | cbmod/currency/views/wizard/page.py | coinbox/coinbox-mod-currency | e6b2141824fb2a64e74bcb3e7068da8d9d9aaf2c | [
"MIT"
] | null | null | null | cbmod/currency/views/wizard/page.py | coinbox/coinbox-mod-currency | e6b2141824fb2a64e74bcb3e7068da8d9d9aaf2c | [
"MIT"
] | null | null | null | from PySide import QtGui
import cbpos
logger = cbpos.get_logger(__name__)
from cbmod.currency.models import Currency
from cbmod.currency.views import CurrenciesPage
from cbmod.base.views.wizard import BaseWizardPage
class CurrencySetupWizardPage(BaseWizardPage):
def __init__(self, parent=None):
super(... | 30.042553 | 124 | 0.616856 |
b3dca57161b55524b497171029abecaf1df84485 | 2,327 | py | Python | src/model.py | SimardeepKaur/Workflows_Group_306 | 33471dfdd17c65dd67f02af7771320606d0c5fa7 | [
"MIT"
] | null | null | null | src/model.py | SimardeepKaur/Workflows_Group_306 | 33471dfdd17c65dd67f02af7771320606d0c5fa7 | [
"MIT"
] | null | null | null | src/model.py | SimardeepKaur/Workflows_Group_306 | 33471dfdd17c65dd67f02af7771320606d0c5fa7 | [
"MIT"
] | null | null | null |
#author : Simardeep Kaur
#date : 25 January, 2020
""" Runs classification model on the cleaned data to get the accuarcy on the test results
Usage: src/model.py --train_file=<train_file> --test_file=<test_file>
"""
import pandas as pd
import numpy as np
import altair as alt
from sklearn.ensemble import RandomForest... | 26.747126 | 89 | 0.691448 |
c973e2a8ca43878db2224580d1d51ca9afcf9ab8 | 292,894 | py | Python | sdk/python/pulumi_azure_native/network/v20170301/_inputs.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20170301/_inputs.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20170301/_inputs.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 43.385276 | 382 | 0.663127 |
d3dfbaf5739105f8f181f8a4bb1260c0444f20bd | 368 | py | Python | Aula19/ex06.py | danicon/MD3-Curso_Python | 3d419d440d3b28adb5c019268f4b217e7d0ce45a | [
"MIT"
] | null | null | null | Aula19/ex06.py | danicon/MD3-Curso_Python | 3d419d440d3b28adb5c019268f4b217e7d0ce45a | [
"MIT"
] | null | null | null | Aula19/ex06.py | danicon/MD3-Curso_Python | 3d419d440d3b28adb5c019268f4b217e7d0ce45a | [
"MIT"
] | null | null | null | result = {}
result['nome'] = str(input('Nome: '))
result['media'] = float(input(f'Média do {result["nome"]}: '))
if result['media'] >= 7:
result['situacao'] = 'Aprovado'
elif 5 <= result['media'] < 7:
result['situacao'] = 'Recuperação'
else:
result['situacao'] = 'Reprovado'
print(30*'-=')
for k, v in resu... | 24.533333 | 62 | 0.576087 |
84e29ca5cef603617b3bb7df0841c268ad37cadd | 3,813 | py | Python | dashboard/04.implementation/Django/backend/base/migrations/0002_order_orderitem_review_shippingaddress.py | BU-Spark/Justice-Media-co-Lab-NAACP-GBH-Media-Bias-project | b9dd7e41bc4a0fc51df0433f9af49e36427e8abd | [
"MIT"
] | 1 | 2021-02-12T22:57:46.000Z | 2021-02-12T22:57:46.000Z | dashboard/04.implementation/Django/backend/base/migrations/0002_order_orderitem_review_shippingaddress.py | BU-Spark/Justice-Media-co-Lab-NAACP-GBH-Media-Bias-project | b9dd7e41bc4a0fc51df0433f9af49e36427e8abd | [
"MIT"
] | null | null | null | dashboard/04.implementation/Django/backend/base/migrations/0002_order_orderitem_review_shippingaddress.py | BU-Spark/Justice-Media-co-Lab-NAACP-GBH-Media-Bias-project | b9dd7e41bc4a0fc51df0433f9af49e36427e8abd | [
"MIT"
] | 2 | 2021-02-26T08:02:02.000Z | 2021-02-27T20:09:34.000Z | # Generated by Django 3.1.7 on 2021-03-27 01:40
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('base', '0001_initial'),
... | 55.26087 | 133 | 0.608969 |
ab48fa2e650af29ce57660a5691a71df7aa25f70 | 31,700 | py | Python | os_win/tests/unit/utils/storage/virtdisk/test_vhdutils.py | mail2nsrajesh/os-win | b5ee321a097ddc96ea9c7a652a19d88215eab996 | [
"Apache-2.0"
] | null | null | null | os_win/tests/unit/utils/storage/virtdisk/test_vhdutils.py | mail2nsrajesh/os-win | b5ee321a097ddc96ea9c7a652a19d88215eab996 | [
"Apache-2.0"
] | null | null | null | os_win/tests/unit/utils/storage/virtdisk/test_vhdutils.py | mail2nsrajesh/os-win | b5ee321a097ddc96ea9c7a652a19d88215eab996 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 Cloudbase Solutions Srl
#
# 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 ... | 41.546527 | 79 | 0.672145 |
a9a2f166618e90394f1b3acea8b1edac02eebb9d | 1,710 | py | Python | minn/contrib/functions/activation.py | chantera/minn | ceb838a5ce6da76eefad270c37137b9c3e6e3240 | [
"MIT"
] | 1 | 2019-05-27T13:46:06.000Z | 2019-05-27T13:46:06.000Z | minn/contrib/functions/activation.py | chantera/minn | ceb838a5ce6da76eefad270c37137b9c3e6e3240 | [
"MIT"
] | null | null | null | minn/contrib/functions/activation.py | chantera/minn | ceb838a5ce6da76eefad270c37137b9c3e6e3240 | [
"MIT"
] | null | null | null | from minn.contrib.devices import get_device_from_array
from minn.core import FunctionNode
class Sigmoid(FunctionNode):
def forward(self, x):
x, = x
xp = get_device_from_array(x).xp
half = x.dtype.type(0.5)
y = xp.tanh(x * half) * half + half
return y,
def backward(sel... | 21.923077 | 76 | 0.549708 |
b535ef992ef54ec5b26dc055d0bc18ae45093f96 | 378 | py | Python | utils/callbacks/error_processing_callbacks.py | harshitandro/Python-Instrumentator | f5185a814c6b7ecda5f2571846397bec2fa1b2f1 | [
"Apache-2.0"
] | 1 | 2020-03-11T20:56:41.000Z | 2020-03-11T20:56:41.000Z | utils/callbacks/error_processing_callbacks.py | harshitandro/Python-Instrumentator | f5185a814c6b7ecda5f2571846397bec2fa1b2f1 | [
"Apache-2.0"
] | null | null | null | utils/callbacks/error_processing_callbacks.py | harshitandro/Python-Instrumentator | f5185a814c6b7ecda5f2571846397bec2fa1b2f1 | [
"Apache-2.0"
] | 1 | 2020-03-05T07:42:21.000Z | 2020-03-05T07:42:21.000Z | import threading
def django_err_processing_callback(source, threadID, type, value, traceback):
pass
def django_static_err_processing_callback(source, threadID, type, value, traceback):
pass
def flask_err_processing_callback(source, threadID, type, value, traceback):
pass
def empty_err_processing_call... | 21 | 84 | 0.783069 |
a7d44b466712b7ad775216340074571ed9448d5f | 1,504 | py | Python | conftest.py | karolinepauls/pytest-kafka | 9a91408f8de0f841b3da2e077fc50eae47282771 | [
"MIT"
] | 1 | 2019-10-25T07:12:37.000Z | 2019-10-25T07:12:37.000Z | conftest.py | karolinepauls/pytest-kafka | 9a91408f8de0f841b3da2e077fc50eae47282771 | [
"MIT"
] | null | null | null | conftest.py | karolinepauls/pytest-kafka | 9a91408f8de0f841b3da2e077fc50eae47282771 | [
"MIT"
] | null | null | null | """Test setup."""
from typing import Optional
import pytest # type: ignore
from test_pytest_kafka import test_custom_kill
EXPECTED_TEARDOWN_ON_KILL = 0.2
test_custom_kill_duration = None # type: Optional[float]
def _test_custom_kill_slow_teardown() -> bool:
return (test_custom_kill_duration is not None
... | 34.181818 | 100 | 0.703457 |
b2ecb9c33f82ac35e4f3349a8f3bce4bd22e4426 | 3,268 | py | Python | src/main.py | alwayslivid/ShellBot | 381d7c663ebc365af6069d74b127c52beb7ffbf6 | [
"MIT"
] | 1 | 2019-01-04T14:37:07.000Z | 2019-01-04T14:37:07.000Z | src/main.py | AlwaysLivid/Discord-ShellBot | 381d7c663ebc365af6069d74b127c52beb7ffbf6 | [
"MIT"
] | 1 | 2019-03-03T14:25:04.000Z | 2019-03-03T14:25:04.000Z | src/main.py | AlwaysLivid/Discord-ShellBot | 381d7c663ebc365af6069d74b127c52beb7ffbf6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
@author: AlwaysLivid
@description: Perform administrative tasks remotely via Discord, without the need of port forwarding and other complicated networking stuff.
'''
print("""
.__ .__ .__ ___. __
_____| |__ ____ | | | |\\_ |__ ___... | 33.690722 | 166 | 0.609241 |
7bc896eb97ebfa8768a40e3b4f3c4cbc5da4d274 | 3,297 | py | Python | tests/unit/test_preprocess.py | rsadaphule/nlp | a1241df90620e6e17e9f322621313ead4aa890f1 | [
"MIT"
] | 4,407 | 2019-10-29T21:35:19.000Z | 2022-03-31T13:56:37.000Z | tests/unit/test_preprocess.py | shubham9g17/nlp-recipes | a5cd2303187239799ae0b1597a7c16eb99a97108 | [
"MIT"
] | 134 | 2019-10-30T23:38:59.000Z | 2022-03-01T11:42:53.000Z | tests/unit/test_preprocess.py | shubham9g17/nlp-recipes | a5cd2303187239799ae0b1597a7c16eb99a97108 | [
"MIT"
] | 726 | 2019-10-31T15:21:52.000Z | 2022-03-31T10:18:22.000Z | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import pytest
import pandas as pd
import numpy as np
import utils_nlp.dataset.preprocess as preprocess
@pytest.fixture(scope="module")
def df_sentences():
sentences = np.array(
[
"The man is playing... | 30.813084 | 78 | 0.635729 |
c08f1ae060142be0e1d618a71a902a0ba47ddec5 | 7,563 | py | Python | mysite/settings.py | mush42/mushy-mezzanine-on-openshift | 4ceada506fc85920df66c0e13cb2b8815ade4fb9 | [
"MIT"
] | null | null | null | mysite/settings.py | mush42/mushy-mezzanine-on-openshift | 4ceada506fc85920df66c0e13cb2b8815ade4fb9 | [
"MIT"
] | null | null | null | mysite/settings.py | mush42/mushy-mezzanine-on-openshift | 4ceada506fc85920df66c0e13cb2b8815ade4fb9 | [
"MIT"
] | null | null | null | # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
import socket
#########
# PATHS #
#########
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Full filesystem path to the project.
PROJECT_APP_PATH = os.path.dirname(os.path.abspath(__file__))
PROJECT_APP = os.path... | 32.04661 | 93 | 0.709903 |
62b1a9876a61ba0af2219f7e8683df46e856b340 | 606 | py | Python | shared-data/python/opentrons_shared_data/__init__.py | knownmed/opentrons | d02eb3c6cbf9f1c8c05c5e9e1dac30a92a8c5e6c | [
"Apache-2.0"
] | 235 | 2017-10-27T20:37:27.000Z | 2022-03-30T14:09:49.000Z | shared-data/python/opentrons_shared_data/__init__.py | knownmed/opentrons | d02eb3c6cbf9f1c8c05c5e9e1dac30a92a8c5e6c | [
"Apache-2.0"
] | 8,425 | 2017-10-26T15:25:43.000Z | 2022-03-31T23:54:26.000Z | shared-data/python/opentrons_shared_data/__init__.py | knownmed/opentrons | d02eb3c6cbf9f1c8c05c5e9e1dac30a92a8c5e6c | [
"Apache-2.0"
] | 130 | 2017-11-09T21:02:37.000Z | 2022-03-15T18:01:24.000Z | """A Python package wrapping json config definitions for the Opentrons stack.
This package should never be installed on its own, only as a dependency of
the main opentrons package
"""
import os
import json
from .load import get_shared_data_root, load_shared_data
HERE = os.path.abspath(os.path.dirname(__file__))
tr... | 26.347826 | 77 | 0.744224 |
b6d7c634a8b64f4dfadb7191136fe4df64c84160 | 3,021 | py | Python | workflows/cloudify_system_workflows/snapshots/constants.py | ilan-WS/cloudify-manager | 510d8a277c848db351f38fc5b264806b2cb36d0b | [
"Apache-2.0"
] | null | null | null | workflows/cloudify_system_workflows/snapshots/constants.py | ilan-WS/cloudify-manager | 510d8a277c848db351f38fc5b264806b2cb36d0b | [
"Apache-2.0"
] | 2 | 2021-05-31T15:12:21.000Z | 2021-05-31T19:03:05.000Z | workflows/cloudify_system_workflows/snapshots/constants.py | ilan-WS/cloudify-manager | 510d8a277c848db351f38fc5b264806b2cb36d0b | [
"Apache-2.0"
] | null | null | null | ########
# Copyright (c) 2015 GigaSpaces Technologies Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | 36.39759 | 79 | 0.777557 |
1744be46e92ec86e4b62db54f0e5e7e0c1aeee63 | 414 | py | Python | handlers/cancel.py | Kvm99/Pressure-Bot- | 4dc5c850f12265dd89150891c2e383c9c32d421f | [
"BSD-3-Clause"
] | null | null | null | handlers/cancel.py | Kvm99/Pressure-Bot- | 4dc5c850f12265dd89150891c2e383c9c32d421f | [
"BSD-3-Clause"
] | 208 | 2019-12-06T12:48:58.000Z | 2022-03-28T21:10:35.000Z | handlers/cancel.py | Kvm99/Telegram-Pressurebot | 4dc5c850f12265dd89150891c2e383c9c32d421f | [
"BSD-3-Clause"
] | null | null | null | from buttons import start_markup
from states import States
def cancel(update, context):
"""
close the conversation,
return START possition of the conversation handler
"""
text = (
"Bye! I hope we can talk again some day."
)
context.bot.send_message(
chat_id=update.message.c... | 21.789474 | 54 | 0.664251 |
4a5ef6d8249163ebb599e2d31e98a5c96a029955 | 76 | py | Python | getnotes/util.py | GeneriedJenelle/crossed-cogs-world | b31c398a7c4863cd588271a85140144babf25d11 | [
"MIT"
] | 3 | 2020-04-05T20:29:34.000Z | 2022-01-05T15:27:53.000Z | getnotes/util.py | GeneriedJenelle/crossed-cogs-world | b31c398a7c4863cd588271a85140144babf25d11 | [
"MIT"
] | 7 | 2020-01-17T09:44:00.000Z | 2022-03-06T12:37:23.000Z | getnotes/util.py | GeneriedJenelle/crossed-cogs-world | b31c398a7c4863cd588271a85140144babf25d11 | [
"MIT"
] | 8 | 2020-04-24T04:31:03.000Z | 2022-03-09T15:09:46.000Z | import re
def key_to_ckey(key):
return re.sub('[^A-Za-z0-9]+', '', key) | 19 | 40 | 0.592105 |
ac5eb93cf475b64237dfde5408e2fd066264a859 | 9,472 | py | Python | emissions_calculator/phase1_emissions_calculator/subcomp_b_process_emissions_factors.py | NW-Demand-Response-Emissions-Impacts/emissions_calculator | d4ed609eaf7503c02d83456148f6e0b5ca135050 | [
"MIT"
] | null | null | null | emissions_calculator/phase1_emissions_calculator/subcomp_b_process_emissions_factors.py | NW-Demand-Response-Emissions-Impacts/emissions_calculator | d4ed609eaf7503c02d83456148f6e0b5ca135050 | [
"MIT"
] | 1 | 2021-11-04T16:00:00.000Z | 2021-11-04T16:00:00.000Z | emissions_calculator/phase1_emissions_calculator/subcomp_b_process_emissions_factors.py | NW-Demand-Response-Emissions-Impacts/Main | d4ed609eaf7503c02d83456148f6e0b5ca135050 | [
"MIT"
] | 2 | 2021-12-07T21:22:28.000Z | 2021-12-09T17:33:13.000Z | """
subcomp_b_process_emissions_factors.py
Read output emissions rates and DR hours from subcomponent a.
For all DR plans (e.g. old bins, new bins),
return seasonal and annual emissions rates averages
only for days with DR, averaged 2022-2041.
Also return seasonal and annual emissions rates averages
for all days in ... | 36.015209 | 88 | 0.656883 |
85cb3c7c7f94a6f1a7f88e229c9fd88167e7c60b | 9,680 | py | Python | 3 calcGUI/calcGUI.py | rbrownsr/pythonteachingcode | ba2724da9059877a16711452024d366740e35940 | [
"MIT"
] | null | null | null | 3 calcGUI/calcGUI.py | rbrownsr/pythonteachingcode | ba2724da9059877a16711452024d366740e35940 | [
"MIT"
] | null | null | null | 3 calcGUI/calcGUI.py | rbrownsr/pythonteachingcode | ba2724da9059877a16711452024d366740e35940 | [
"MIT"
] | null | null | null | from tkinter import *
from math import sqrt as sqr
from math import sin as Sin
class Application(Frame):
"""
An example of a calculator app developed using the
Tkinter GUI.
"""
def __init__(self, master):
"""
Initializes the frame.
:param master: root.Tk()
"""
... | 43.214286 | 115 | 0.596178 |
75c7b768139308e683ae232a5ddf90814bc58f46 | 3,390 | py | Python | third_party/gsutil/gslib/tests/test_file_part.py | tingshao/catapult | a8fe19e0c492472a8ed5710be9077e24cc517c5c | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | third_party/gsutil/gslib/tests/test_file_part.py | tingshao/catapult | a8fe19e0c492472a8ed5710be9077e24cc517c5c | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | third_party/gsutil/gslib/tests/test_file_part.py | tingshao/catapult | a8fe19e0c492472a8ed5710be9077e24cc517c5c | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | # -*- coding: utf-8 -*-
# Copyright 2013 Google Inc. 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 require... | 31.682243 | 79 | 0.689971 |
50dd05cc0b92785186bd922ca788d23124c3d45b | 380 | py | Python | dataworkspace/dataworkspace/apps/applications/migrations/0009_auto_20200610_1318.py | uktrade/jupyterhub-data-auth-admin | 91544f376209a201531f4dbfb8faad1b8ada18c9 | [
"MIT"
] | 1 | 2019-06-10T08:22:56.000Z | 2019-06-10T08:22:56.000Z | dataworkspace/dataworkspace/apps/applications/migrations/0009_auto_20200610_1318.py | uktrade/jupyterhub-data-auth-admin | 91544f376209a201531f4dbfb8faad1b8ada18c9 | [
"MIT"
] | 2 | 2019-05-17T13:10:42.000Z | 2019-06-17T10:48:46.000Z | dataworkspace/dataworkspace/apps/applications/migrations/0009_auto_20200610_1318.py | uktrade/jupyterhub-data-auth-admin | 91544f376209a201531f4dbfb8faad1b8ada18c9 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.5 on 2020-06-10 13:18
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("applications", "0008_auto_20200519_1245")]
operations = [
migrations.RemoveField(model_name="applicationtemplate", name="user_access_type"),
migrations.D... | 27.142857 | 90 | 0.736842 |
b26f4ab2516db7b179a1808e7c21aa0fe0065369 | 279 | py | Python | game/main.py | PictElm/Kaafhet | f9e2a1fac1db1f5ebb377eef91c938db0b997770 | [
"Apache-2.0"
] | null | null | null | game/main.py | PictElm/Kaafhet | f9e2a1fac1db1f5ebb377eef91c938db0b997770 | [
"Apache-2.0"
] | null | null | null | game/main.py | PictElm/Kaafhet | f9e2a1fac1db1f5ebb377eef91c938db0b997770 | [
"Apache-2.0"
] | null | null | null | # -*- coding: latin-1 -*-
"""
Created on Mon Feb 22 15:37:08 2016
@author: Celestin
"""
from Kaafhet.Inter import register, run, makeDefaultWorld, counter, display
from sac import sac
from gro import gro
register(sac)
register(gro)
run(makeDefaultWorld(), counter, display)
| 16.411765 | 75 | 0.727599 |
c91c833a5199b9948338ce062c1148a7d6877f84 | 468 | py | Python | mytest/annoPropertyTest.py | liangjie18430/flask_test_myself | 8923e058d834d6ab7326f869b945601c13674105 | [
"BSD-3-Clause"
] | null | null | null | mytest/annoPropertyTest.py | liangjie18430/flask_test_myself | 8923e058d834d6ab7326f869b945601c13674105 | [
"BSD-3-Clause"
] | null | null | null | mytest/annoPropertyTest.py | liangjie18430/flask_test_myself | 8923e058d834d6ab7326f869b945601c13674105 | [
"BSD-3-Clause"
] | null | null | null | class Student(object):
@property
def birth(self):
return self._birth
@birth.setter
def birth(self, value):
self._birth = value
@property
def age(self):
return 2015 - self._birth
def __call__(self, *args, **kwargs):
pass
if __name__ == '__main__':
s = S... | 18.72 | 40 | 0.566239 |
2f84eaef856a77cda610aac50eaebe5e45f8f08e | 10,054 | py | Python | wjn-source/contrib/spendfrom/spendfrom.py | WJNLLC/WJN | 39475229d0ab1239b31bdfd7f2ea7672e08b70a0 | [
"MIT"
] | null | null | null | wjn-source/contrib/spendfrom/spendfrom.py | WJNLLC/WJN | 39475229d0ab1239b31bdfd7f2ea7672e08b70a0 | [
"MIT"
] | null | null | null | wjn-source/contrib/spendfrom/spendfrom.py | WJNLLC/WJN | 39475229d0ab1239b31bdfd7f2ea7672e08b70a0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Use the raw transactions API to spend bitcoins received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a bitcoind or Bit... | 37.514925 | 111 | 0.632286 |
8c510aa6fbc27d5872a2121bfaeb8db8ebbdb5ec | 1,140 | py | Python | theia/ide/admin/cli/setup.py | ShubhamGG/Anubis | 2c538ef258a1edf5463596a33bc66caa2ef7e35b | [
"MIT"
] | 87 | 2021-11-08T10:58:26.000Z | 2022-03-31T19:02:47.000Z | theia/ide/admin/cli/setup.py | efaraz27/Anubis | 40a12933877df7f39dd75ca26148858774fcda7b | [
"MIT"
] | 114 | 2021-06-27T08:37:43.000Z | 2021-10-24T00:51:01.000Z | theia/ide/admin/cli/setup.py | efaraz27/Anubis | 40a12933877df7f39dd75ca26148858774fcda7b | [
"MIT"
] | 15 | 2021-06-27T07:26:51.000Z | 2021-10-06T18:42:39.000Z | #!/usr/bin/env python
"""The setup script."""
from setuptools import setup, find_packages
requirements = ['Click>=7.0', 'requests', 'pyyaml']
setup_requirements = []
test_requirements = []
setup(
author="John McCann Cunniff Jr.",
python_requires='>=3.5',
classifiers=[
'Development Status :: 2 -... | 27.142857 | 59 | 0.621053 |
75afc6d68dad97d51c48c478fcaba0828167f015 | 10,300 | py | Python | netmiko/snmp_autodetect.py | soaliou1/Automation | 86fa8eed5ffa7af8f21ca7b503f44fc0d3d5ed2c | [
"MIT"
] | null | null | null | netmiko/snmp_autodetect.py | soaliou1/Automation | 86fa8eed5ffa7af8f21ca7b503f44fc0d3d5ed2c | [
"MIT"
] | null | null | null | netmiko/snmp_autodetect.py | soaliou1/Automation | 86fa8eed5ffa7af8f21ca7b503f44fc0d3d5ed2c | [
"MIT"
] | null | null | null | """
This module is used to auto-detect the type of a device in order to automatically create a
Netmiko connection.
The will avoid to hard coding the 'device_type' when using the ConnectHandler factory function
from Netmiko.
Example:
------------------
from netmiko.snmp_autodetect import SNMPDetect
my_snmp = SNMPDete... | 38.432836 | 98 | 0.597476 |
8290fb4e3e1ffa574a24249511242b82a913a4ca | 10,009 | py | Python | code/rnn_seq2seq/src/args.py | arkilpatel/SVAMP | 6f09ab516ab06c18e948c0325236e84e80b5d4bd | [
"MIT"
] | 39 | 2021-04-08T01:24:36.000Z | 2022-03-12T06:51:33.000Z | code/rnn_seq2seq/src/args.py | intflow/SVAMP | 10731d8ea489f4eb8e12e35c6c2781f8d837866a | [
"MIT"
] | 8 | 2021-04-12T08:02:05.000Z | 2022-03-07T06:36:39.000Z | code/rnn_seq2seq/src/args.py | intflow/SVAMP | 10731d8ea489f4eb8e12e35c6c2781f8d837866a | [
"MIT"
] | 11 | 2021-04-08T01:24:41.000Z | 2021-12-15T22:51:51.000Z | import argparse
### Add Early Stopping ###
def build_parser():
# Data loading parameters
parser = argparse.ArgumentParser(description='Run Single sequence model')
# Mode specifications
parser.add_argument('-mode', type=str, default='train', choices=['train', 'test', 'conf'], help='Modes: train, test, co... | 79.436508 | 191 | 0.748726 |
991bcc19ddfadf3c69f56dfbb98d0a50d0d9e05a | 47 | py | Python | learning_to_adapt/utils/__init__.py | ondrejklejch/learning_to_adapt | 6de0b98370769596da16a1688582925ea2e1fa29 | [
"Apache-2.0"
] | 18 | 2019-10-24T04:42:16.000Z | 2021-11-24T03:07:59.000Z | learning_to_adapt/utils/__init__.py | choko/learning_to_adapt | 6de0b98370769596da16a1688582925ea2e1fa29 | [
"Apache-2.0"
] | null | null | null | learning_to_adapt/utils/__init__.py | choko/learning_to_adapt | 6de0b98370769596da16a1688582925ea2e1fa29 | [
"Apache-2.0"
] | 4 | 2018-08-31T01:08:50.000Z | 2019-05-10T12:12:57.000Z | from data_generator import *
from lda import *
| 15.666667 | 28 | 0.787234 |
b1bd38b6a3205832d684b4ab52cc2c88d09a773c | 3,596 | py | Python | Python/linked_list.py | Rohit01-pro/All_Program_helper | 86b75ecc4ecb095f11e46e6f80c660e27dd22f27 | [
"MIT"
] | 16 | 2021-10-03T11:15:49.000Z | 2021-10-31T04:40:24.000Z | Python/linked_list.py | Rohit01-pro/All_Program_helper | 86b75ecc4ecb095f11e46e6f80c660e27dd22f27 | [
"MIT"
] | 232 | 2021-10-02T14:51:43.000Z | 2021-11-14T08:23:27.000Z | Python/linked_list.py | Rohit01-pro/All_Program_helper | 86b75ecc4ecb095f11e46e6f80c660e27dd22f27 | [
"MIT"
] | 166 | 2021-10-02T13:56:34.000Z | 2021-10-31T17:56:34.000Z | #Structure for Node
class Node:
def __init__(self, data):
self.data = data
self.next = None
#Class representing different methods of Linked List
class LinkedList:
def __init__(self):
self.head = None
def display(self):
if self.head == None:
print('No elements in... | 27.037594 | 66 | 0.486096 |
7ff59e3d355415ace866a9d97d846fa789ea99c5 | 451 | py | Python | training/callbacks/early_stopping.py | Jav1d/Generative_Models | b7578b5277488ebd212a50d1c22a5c9708f4c311 | [
"MIT"
] | null | null | null | training/callbacks/early_stopping.py | Jav1d/Generative_Models | b7578b5277488ebd212a50d1c22a5c9708f4c311 | [
"MIT"
] | null | null | null | training/callbacks/early_stopping.py | Jav1d/Generative_Models | b7578b5277488ebd212a50d1c22a5c9708f4c311 | [
"MIT"
] | null | null | null | import tensorflow as tf
EarlyStopping = lambda: tf.keras.callbacks.EarlyStopping(
monitor='loss',
min_delta=1e-12,
patience=50,
... | 56.375 | 74 | 0.299335 |
35dce234aff5d4c8f3d978fe12d6449e759b7fea | 2,834 | py | Python | networks/base.py | ypotdevin/randomized-defenses | 34bc3cbe8e3178dd8a6f7abae927b10c9ae4bad9 | [
"MIT"
] | null | null | null | networks/base.py | ypotdevin/randomized-defenses | 34bc3cbe8e3178dd8a6f7abae927b10c9ae4bad9 | [
"MIT"
] | 2 | 2021-10-06T12:33:54.000Z | 2021-10-06T12:35:16.000Z | networks/base.py | ypotdevin/randomized-defenses | 34bc3cbe8e3178dd8a6f7abae927b10c9ae4bad9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
This module consists of network class definitions, used to hide implementation
details of used deep learning libraries.
"""
from abc import ABC, abstractmethod
import numpy as np
class Network(ABC):
"""
This class hides the functional API of (e.g.) Keras models and reduces the
... | 29.216495 | 80 | 0.591743 |
496276200bc5975052e93ec3c8d6cdc1f0684df6 | 807 | py | Python | siteframe/migrations/0002_article.py | Tian-rg/easysite | 6a34cb373e43c263e98dceae47f41c99b28803f1 | [
"MIT"
] | null | null | null | siteframe/migrations/0002_article.py | Tian-rg/easysite | 6a34cb373e43c263e98dceae47f41c99b28803f1 | [
"MIT"
] | null | null | null | siteframe/migrations/0002_article.py | Tian-rg/easysite | 6a34cb373e43c263e98dceae47f41c99b28803f1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-12-03 17:01
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('siteframe', '0001_initial'),
]
operations = [
migrations.CreateModel(
... | 31.038462 | 114 | 0.60223 |
c174d6009cc6841aa09f4cf656ebd7862d5e7f1f | 501 | py | Python | web_app/code_analysis/migrations/0014_problem_date_submitted.py | Lockers13/codagio | cfe9325cb3c207f7728db3c287439ce761ffea14 | [
"MIT"
] | 2 | 2021-01-16T13:42:14.000Z | 2021-03-03T19:36:47.000Z | web_app/code_analysis/migrations/0014_problem_date_submitted.py | Lockers13/codagio | cfe9325cb3c207f7728db3c287439ce761ffea14 | [
"MIT"
] | null | null | null | web_app/code_analysis/migrations/0014_problem_date_submitted.py | Lockers13/codagio | cfe9325cb3c207f7728db3c287439ce761ffea14 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.5 on 2021-03-21 18:49
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('code_analysis', '0013_remove_problem_category'),
]
operations = [
migrations.AddField(
model_name='problem',
... | 23.857143 | 95 | 0.626747 |
d6437947723e675d7cb009e138963bc7ad380ed4 | 362 | py | Python | config.py | LdyOn/12306 | d9824231acdf268a308762489eb33feff02b01c6 | [
"Apache-2.0"
] | 2 | 2021-04-16T02:40:58.000Z | 2021-04-17T04:11:47.000Z | config.py | LdyOn/12306 | d9824231acdf268a308762489eb33feff02b01c6 | [
"Apache-2.0"
] | 2 | 2021-04-17T08:37:24.000Z | 2021-05-10T09:10:51.000Z | config.py | LdyOn/12306 | d9824231acdf268a308762489eb33feff02b01c6 | [
"Apache-2.0"
] | 1 | 2021-04-16T07:56:52.000Z | 2021-04-16T07:56:52.000Z | import re
class Config():
"""配置文件"""
def __init__(self):
self.config = {}
self.read_setting()
# 从配置文件读取配置
def read_setting(self):
s_file = open("setting.ini", encoding='UTF-8')
lines = s_file.readlines()
for x in lines:
if re.match(";", x) == None :
x = x.strip('\n')
s = x.split("=")
self.... | 17.238095 | 48 | 0.574586 |
712e367553d38eb89864bd7855267afad1040608 | 26,024 | py | Python | idtt/wp2tt/__init__.py | ErezVolk/evstuff | a79ba23773c41ed445107cffd235747a84bb4ff1 | [
"MIT"
] | 1 | 2018-11-05T08:52:41.000Z | 2018-11-05T08:52:41.000Z | idtt/wp2tt/__init__.py | ErezVolk/evstuff | a79ba23773c41ed445107cffd235747a84bb4ff1 | [
"MIT"
] | null | null | null | idtt/wp2tt/__init__.py | ErezVolk/evstuff | a79ba23773c41ed445107cffd235747a84bb4ff1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""A utility to convert word processor files (.docx, .odt) to InDesign's Tagged Text."""
import argparse
import collections
import configparser
import contextlib
import itertools
import logging
import os
import re
import shlex
import shutil
import sys
import attr
from wp2tt.version import WP2TT... | 38.158358 | 107 | 0.595566 |
f1878dcd10c27f22a30cb339a07fa33921ada3b8 | 433 | py | Python | plotly/validators/sankey/_name.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/validators/sankey/_name.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 27 | 2020-04-28T21:23:12.000Z | 2021-06-25T15:36:38.000Z | plotly/validators/sankey/_name.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | import _plotly_utils.basevalidators
class NameValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name='name', parent_name='sankey', **kwargs):
super(NameValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_ty... | 30.928571 | 75 | 0.644342 |
ce1ca6eb08c6d2dfbe9ca41e2607b1b10f9d00ff | 2,746 | py | Python | line/line/inverse4.py | liuboyan122/working-line | abd68e7e19fd341d5f90d42fd25f7ec83c75383b | [
"Apache-2.0"
] | null | null | null | line/line/inverse4.py | liuboyan122/working-line | abd68e7e19fd341d5f90d42fd25f7ec83c75383b | [
"Apache-2.0"
] | null | null | null | line/line/inverse4.py | liuboyan122/working-line | abd68e7e19fd341d5f90d42fd25f7ec83c75383b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import rclpy
from rclpy.node import Node
from builtin_interfaces.msg import Duration
from trajectory_msgs.msg import JointTrajectory , JointTrajectoryPoint
from ament_index_python.packages import get_package_share_directory
import ikpy.chain
import sys
import numpy as np
import os
... | 29.847826 | 110 | 0.615805 |
0e180a8fc5561a83a5ecb59ee88f64279bcaee94 | 1,712 | py | Python | marl_coop/utils/plot.py | PierreMsy/DRL_cooperation | 0385f4c88857659f44ddd5fc8c5c6c33344a38cc | [
"MIT"
] | 1 | 2022-01-05T14:04:29.000Z | 2022-01-05T14:04:29.000Z | marl_coop/utils/plot.py | PierreMsy/DRL_cooperation | 0385f4c88857659f44ddd5fc8c5c6c33344a38cc | [
"MIT"
] | null | null | null | marl_coop/utils/plot.py | PierreMsy/DRL_cooperation | 0385f4c88857659f44ddd5fc8c5c6c33344a38cc | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
def plot_scores(dic_scores, window_size=20, target_score=None, axe=None, colors=None, title=None):
"""
Plot the global scores of the agents in function of the number of episodes.
Args:
dic_scores (dict): pandas DataFrame of the scores by run key.... | 39.813953 | 99 | 0.639603 |
5cc046a5eb3ee3f0a2923da120e6f5492763effb | 4,801 | py | Python | lnbits/wallets/opennode.py | taxmeifyoucan/lnbits | 19ae1ddf0d50b507135c418af9d5becc336d5ce3 | [
"MIT"
] | 258 | 2020-04-27T21:36:21.000Z | 2021-10-30T23:24:48.000Z | lnbits/wallets/opennode.py | taxmeifyoucan/lnbits | 19ae1ddf0d50b507135c418af9d5becc336d5ce3 | [
"MIT"
] | 283 | 2020-04-27T17:23:12.000Z | 2021-11-01T10:07:20.000Z | lnbits/wallets/opennode.py | taxmeifyoucan/lnbits | 19ae1ddf0d50b507135c418af9d5becc336d5ce3 | [
"MIT"
] | 109 | 2020-04-28T06:00:17.000Z | 2021-10-13T02:48:28.000Z | import trio
import hmac
import httpx
from http import HTTPStatus
from os import getenv
from typing import Optional, AsyncGenerator
from quart import request, url_for
from .base import (
StatusResponse,
InvoiceResponse,
PaymentResponse,
PaymentStatus,
Wallet,
Unsupported,
)
class OpenNodeWalle... | 32.883562 | 84 | 0.570923 |
7edb5b16ce77ada6f248403d2ed93f04155d06a3 | 10,549 | py | Python | pandas/core/util/hashing.py | vimalromeo/pandas | 7c14e4f14aff216be558bf5d4d2d00b4838c2360 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 69 | 2020-03-31T06:40:17.000Z | 2022-02-25T11:48:18.000Z | venv/lib/python3.7/site-packages/pandas/core/util/hashing.py | John1001Song/Big-Data-Robo-Adviser | 9444dce96954c546333d5aecc92a06c3bfd19aa5 | [
"MIT"
] | 8 | 2019-12-04T23:44:11.000Z | 2022-02-10T08:31:40.000Z | venv/lib/python3.7/site-packages/pandas/core/util/hashing.py | John1001Song/Big-Data-Robo-Adviser | 9444dce96954c546333d5aecc92a06c3bfd19aa5 | [
"MIT"
] | 28 | 2020-04-15T15:24:17.000Z | 2021-12-26T04:05:02.000Z | """
data hash pandas / numpy objects
"""
import itertools
import numpy as np
from pandas._libs import hashing, tslib
from pandas.core.dtypes.generic import (
ABCMultiIndex,
ABCIndexClass,
ABCSeries,
ABCDataFrame)
from pandas.core.dtypes.common import (
is_categorical_dtype, is_list_like)
from panda... | 31.678679 | 92 | 0.604133 |
81deff619312d45862113f15252dbb408e17e49a | 20,607 | py | Python | niftynet/layer/crf.py | alanpeixinho/NiftyNet | 9a17022a71985974f9e5ca992c765d55860fdd7d | [
"Apache-2.0"
] | null | null | null | niftynet/layer/crf.py | alanpeixinho/NiftyNet | 9a17022a71985974f9e5ca992c765d55860fdd7d | [
"Apache-2.0"
] | null | null | null | niftynet/layer/crf.py | alanpeixinho/NiftyNet | 9a17022a71985974f9e5ca992c765d55860fdd7d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Re-implementation of [1] in Tensorflow for volumetric image processing.
[1] Zheng et al.
"Conditional random fields as recurrent neural networks." ICCV 2015.
https://arxiv.org/abs/1502.03240
"""
from __future__ import absolute_import, print_function
import numpy as np
import tensorflow as ... | 38.662289 | 93 | 0.637647 |
2ab698b9ee69870da9d70ee982fff61a7efee14a | 2,200 | py | Python | rlgraph/agents/random_agent.py | RLGraph/RLGraph | 428fc136a9a075f29a397495b4226a491a287be2 | [
"Apache-2.0"
] | 290 | 2018-07-29T15:30:57.000Z | 2022-03-19T02:46:53.000Z | rlgraph/agents/random_agent.py | RLGraph/RLGraph | 428fc136a9a075f29a397495b4226a491a287be2 | [
"Apache-2.0"
] | 76 | 2018-10-19T08:42:01.000Z | 2020-05-03T08:34:21.000Z | rlgraph/agents/random_agent.py | RLGraph/RLGraph | 428fc136a9a075f29a397495b4226a491a287be2 | [
"Apache-2.0"
] | 41 | 2018-10-30T07:05:05.000Z | 2022-03-01T08:28:24.000Z | # Copyright 2018/2019 The RLgraph 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 appli... | 37.931034 | 119 | 0.683636 |
d3008e8dc00832476b28d24880a822d71170e5c7 | 666 | py | Python | src/test/directory_lister_test.py | pgecsenyi/fst | 1d4f579fb3cccd022fe1ab0e61aa00693e7234c1 | [
"MIT"
] | 1 | 2019-12-04T20:35:34.000Z | 2019-12-04T20:35:34.000Z | src/test/directory_lister_test.py | pgecsenyi/router-fs | 1d4f579fb3cccd022fe1ab0e61aa00693e7234c1 | [
"MIT"
] | null | null | null | src/test/directory_lister_test.py | pgecsenyi/router-fs | 1d4f579fb3cccd022fe1ab0e61aa00693e7234c1 | [
"MIT"
] | null | null | null | import unittest
from unittest.mock import patch
from filesystem.transformation.directory_lister import DirectoryLister
class DirectoryListerTest(unittest.TestCase):
@patch('os.walk')
def test_list_directory(self, mock_walk):
dirpath = '/home/root/doc/fruits'
expected_files = [dirpath + '/app... | 33.3 | 77 | 0.71021 |
381e76294379ee6653bae33ffd292b0674b44964 | 6,228 | py | Python | renderer-process/py/script3.py | SenorProject/Fileception | f94c92187d9d60d4168e708a1bba436442ff2adc | [
"MIT"
] | null | null | null | renderer-process/py/script3.py | SenorProject/Fileception | f94c92187d9d60d4168e708a1bba436442ff2adc | [
"MIT"
] | null | null | null | renderer-process/py/script3.py | SenorProject/Fileception | f94c92187d9d60d4168e708a1bba436442ff2adc | [
"MIT"
] | 1 | 2021-08-10T20:54:20.000Z | 2021-08-10T20:54:20.000Z | #!/usr/bin/python
#
# Fileception: Angecryption CLI tool
#
# Written for Python 3
#
# Pedro Sicilia, Mustafa Mohamed, Jacob Frank, Kevin Thomas, Omar Nasir
# CIS4914 Senior Project
#
#
# Usage: ./script3 [hidden.pdf] [cover.pdf] [combined.pdf] [Generate key]
# -Output file combined.pdf will contain encrypted data... | 26.615385 | 132 | 0.566635 |
75ec090fc9f80765b7bd28889944deeb4de930c2 | 205 | py | Python | setup.py | alchermd/headlines | bb19459f570e05691f05654633e7615ed2d84085 | [
"MIT"
] | 1 | 2017-12-20T01:27:49.000Z | 2017-12-20T01:27:49.000Z | setup.py | alchermd/headlines | bb19459f570e05691f05654633e7615ed2d84085 | [
"MIT"
] | 4 | 2017-10-22T15:18:30.000Z | 2017-10-27T18:48:56.000Z | setup.py | alchermd/headlines | bb19459f570e05691f05654633e7615ed2d84085 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name="headlines",
version="0.1",
packages=["headlines"],
install_requires=[
"flask",
"requests"
],
include_package_data=True,
) | 17.083333 | 30 | 0.595122 |
9b2214994ebbabce9640a0c5054f817efc819add | 6,066 | py | Python | pibooth/config/menu.py | chapipo/pibooth | a1a77e03b383f94c2a4c0406afee8221a75b3090 | [
"MIT"
] | null | null | null | pibooth/config/menu.py | chapipo/pibooth | a1a77e03b383f94c2a4c0406afee8221a75b3090 | [
"MIT"
] | 1 | 2019-12-13T18:29:47.000Z | 2019-12-13T18:29:47.000Z | pibooth/config/menu.py | chapipo/pibooth | a1a77e03b383f94c2a4c0406afee8221a75b3090 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Pibooth config menu.
"""
import pygame
import pygameMenu as pgm
from pygameMenu import controls as pgmctrl
from pygameMenu import events as pgmevt
from pibooth import fonts
from pibooth.config.parser import DEFAULT
pgmctrl.KEY_BACK = pygame.K_ESCAPE
def _find(choices, value):
"""Fin... | 38.150943 | 92 | 0.479558 |
1fa4870af0ebd3fc3d849b446e62127c9ecbb433 | 1,469 | py | Python | src/ospeople/scrape/nc.py | Rypo/people | 34cf10bf10313f154f5065dde578bed9b4127ae8 | [
"CC0-1.0"
] | null | null | null | src/ospeople/scrape/nc.py | Rypo/people | 34cf10bf10313f154f5065dde578bed9b4127ae8 | [
"CC0-1.0"
] | null | null | null | src/ospeople/scrape/nc.py | Rypo/people | 34cf10bf10313f154f5065dde578bed9b4127ae8 | [
"CC0-1.0"
] | null | null | null | from spatula import HtmlPage, HtmlListPage, CSS
from ..models.committees import ScrapeCommittee
class CommitteeDetail(HtmlPage):
example_source = "https://www.ncleg.gov/Committees/CommitteeInfo/SenateStanding/1162"
def get_role(self, text):
if text.endswith("s"):
text = text[:-1]
... | 29.979592 | 93 | 0.627638 |
d4f3f8df2f1080c4e6ff34a135c097aa88a362ba | 12,282 | py | Python | src/cuteSV/cuteSV_resolveINDEL.py | bnoyvert/cuteSV | 58ca0fa051f80f716ef69a39924102abdd4249a0 | [
"MIT"
] | null | null | null | src/cuteSV/cuteSV_resolveINDEL.py | bnoyvert/cuteSV | 58ca0fa051f80f716ef69a39924102abdd4249a0 | [
"MIT"
] | null | null | null | src/cuteSV/cuteSV_resolveINDEL.py | bnoyvert/cuteSV | 58ca0fa051f80f716ef69a39924102abdd4249a0 | [
"MIT"
] | null | null | null | import sys
import numpy as np
from collections import Counter
from cuteSV.cuteSV_genotype import cal_GL, cal_CIPOS, threshold_ref_count, count_coverage
import time
'''
*******************************************
TO DO LIST
*******************************************
1. Identify DP with samfile pointer;
2. Add CI... | 28.830986 | 94 | 0.544537 |
664051c14160506337dbb2c05bc94647b9517e0a | 1,074 | py | Python | mne/datasets/spm_face/spm_data.py | Anevar/mne-python | 15b19ed6b9364ae4787f0df2fd7e689b3c0a30bb | [
"BSD-3-Clause"
] | null | null | null | mne/datasets/spm_face/spm_data.py | Anevar/mne-python | 15b19ed6b9364ae4787f0df2fd7e689b3c0a30bb | [
"BSD-3-Clause"
] | null | null | null | mne/datasets/spm_face/spm_data.py | Anevar/mne-python | 15b19ed6b9364ae4787f0df2fd7e689b3c0a30bb | [
"BSD-3-Clause"
] | 1 | 2019-10-23T06:11:28.000Z | 2019-10-23T06:11:28.000Z | # Authors: Denis Engemann <d.engemann@fz-juelich.de>
#
# License: BSD Style.
import numpy as np
from ...utils import get_config, verbose
from ...fixes import partial
from ..utils import has_dataset, _data_path, _doc
has_spm_data = partial(has_dataset, name='spm')
@verbose
def data_path(path=None, force_update=Fal... | 30.685714 | 74 | 0.654562 |
223254a99bb002650fb736223ce11cae966b956c | 3,040 | py | Python | coregistration/eolearn/tests/test_coregistration.py | mohammadrezabk/eo-learn | 8de3cfd64e74c1e4832e585954cdbf0ee9676eb3 | [
"MIT"
] | null | null | null | coregistration/eolearn/tests/test_coregistration.py | mohammadrezabk/eo-learn | 8de3cfd64e74c1e4832e585954cdbf0ee9676eb3 | [
"MIT"
] | null | null | null | coregistration/eolearn/tests/test_coregistration.py | mohammadrezabk/eo-learn | 8de3cfd64e74c1e4832e585954cdbf0ee9676eb3 | [
"MIT"
] | null | null | null | """
Credits:
Copyright (c) 2017-2019 Matej Aleksandrov, Matej Batič, Andrej Burja, Eva Erzin (Sinergise)
Copyright (c) 2017-2019 Grega Milčinski, Matic Lubej, Devis Peresutti, Jernej Puc, Tomislav Slijepčević (Sinergise)
Copyright (c) 2017-2019 Blaž Sovdat, Nejc Vesel, Jovan Višnjić, Anže Zupanc, Lojze Žust (Sinergise)... | 44.705882 | 115 | 0.600329 |
0021df6e7b79e8340120e3a857170ffa947bc0af | 47,596 | py | Python | pdb2pqr-1.9.0/scons/scons-local-2.3.0/SCons/Action.py | Acpharis/protein_prep | 8cc2f0caedefd5a3fdaa764ed013c2660a4df1b8 | [
"BSD-3-Clause"
] | 9 | 2016-08-17T06:52:10.000Z | 2020-04-28T04:20:07.000Z | pdb2pqr-1.9.0/scons/scons-local-2.3.0/SCons/Action.py | Acpharis/protein_prep | 8cc2f0caedefd5a3fdaa764ed013c2660a4df1b8 | [
"BSD-3-Clause"
] | null | null | null | pdb2pqr-1.9.0/scons/scons-local-2.3.0/SCons/Action.py | Acpharis/protein_prep | 8cc2f0caedefd5a3fdaa764ed013c2660a4df1b8 | [
"BSD-3-Clause"
] | 1 | 2021-03-03T23:20:25.000Z | 2021-03-03T23:20:25.000Z | """SCons.Action
This encapsulates information about executing any sort of action that
can build one or more target Nodes (typically files) from one or more
source Nodes (also typically files) given a specific Environment.
The base class here is ActionBase. The base class supplies just a few
OO utility methods and so... | 37.834658 | 134 | 0.605555 |
14321e804e2bc8a41a2004cfb9b0191664a4f0d4 | 5,419 | py | Python | MP_WN_WE/util.py | albpurpura/PE4IR | 54c5d471181cdb64225ecd738577b9f1f94c8d24 | [
"Apache-2.0"
] | null | null | null | MP_WN_WE/util.py | albpurpura/PE4IR | 54c5d471181cdb64225ecd738577b9f1f94c8d24 | [
"Apache-2.0"
] | null | null | null | MP_WN_WE/util.py | albpurpura/PE4IR | 54c5d471181cdb64225ecd738577b9f1f94c8d24 | [
"Apache-2.0"
] | null | null | null | """
Author: Alberto Purpura
Copyright: (C) 2019-2020 <http://www.dei.unipd.it/
Department of Information Engineering> (DEI), <http://www.unipd.it/ University of Padua>, Italy
License: <http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0>
"""
import csv
import io
import json
import o... | 31.876471 | 142 | 0.639417 |
1522de44aaa5c4d600c314ae6aa76af83a9b1967 | 10,493 | py | Python | jaxnerf/nerf/utils.py | deepneuralmachine/google-research | d2ce2cf0f5c004f8d78bfeddf6e88e88f4840231 | [
"Apache-2.0"
] | null | null | null | jaxnerf/nerf/utils.py | deepneuralmachine/google-research | d2ce2cf0f5c004f8d78bfeddf6e88e88f4840231 | [
"Apache-2.0"
] | null | null | null | jaxnerf/nerf/utils.py | deepneuralmachine/google-research | d2ce2cf0f5c004f8d78bfeddf6e88e88f4840231 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 36.182759 | 80 | 0.665682 |
fd79feec1c57882c07af8e5d006d140dc0123589 | 2,632 | py | Python | esphome/cpp_helpers.py | TheEggi/esphomeyaml | 98e8cc1edc7b29891e8100eb484922e5c2d4fc33 | [
"MIT"
] | null | null | null | esphome/cpp_helpers.py | TheEggi/esphomeyaml | 98e8cc1edc7b29891e8100eb484922e5c2d4fc33 | [
"MIT"
] | null | null | null | esphome/cpp_helpers.py | TheEggi/esphomeyaml | 98e8cc1edc7b29891e8100eb484922e5c2d4fc33 | [
"MIT"
] | null | null | null | from esphome.const import CONF_INVERTED, CONF_MODE, CONF_NUMBER, CONF_SETUP_PRIORITY, \
CONF_UPDATE_INTERVAL, CONF_TYPE_ID
from esphome.core import coroutine, ID, CORE
from esphome.cpp_generator import RawExpression, add, get_variable
from esphome.cpp_types import App, GPIOPin
from esphome.py_compat import text_typ... | 32.097561 | 90 | 0.707447 |
399fc2d7baced1a75069e3414f24ee4738871b6f | 2,467 | py | Python | crossmap/sparsevector.py | tkonopka/crossmap | 237e4319a77281490c4e037918977230fea43d7e | [
"MIT"
] | 1 | 2021-08-12T11:40:10.000Z | 2021-08-12T11:40:10.000Z | crossmap/sparsevector.py | tkonopka/crossmap | 237e4319a77281490c4e037918977230fea43d7e | [
"MIT"
] | null | null | null | crossmap/sparsevector.py | tkonopka/crossmap | 237e4319a77281490c4e037918977230fea43d7e | [
"MIT"
] | null | null | null | """
Handling sparse data using dicts
This class encode sparse vectors as a dictionary. The objective
is to have decent space efficiency and allow quicker addition than csr_matrix.
"""
from numpy import array, int32, float64
from .csr import threshold_csr_arrays, csr_vector
class Sparsevector:
def __init__(self... | 28.686047 | 78 | 0.580867 |
820b06e3200a786d55f69dcd7ee00931d61cef2b | 2,318 | py | Python | Color Selection/Color Selection and Region masking.py | wgcv/SelfDrivingCars-Demo | 3b418cd444a9eea80a5403a553caf955965577e3 | [
"MIT"
] | null | null | null | Color Selection/Color Selection and Region masking.py | wgcv/SelfDrivingCars-Demo | 3b418cd444a9eea80a5403a553caf955965577e3 | [
"MIT"
] | null | null | null | Color Selection/Color Selection and Region masking.py | wgcv/SelfDrivingCars-Demo | 3b418cd444a9eea80a5403a553caf955965577e3 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
from PIL import Image
# Read in the image and print out some stats
im = np.asarray(Image.open('test.jpg'))
image = im
#image = mpimg.imread('test.png')
# Grab the x and y size and make a copy of the image
ysize = image.shape[0]
xsize =... | 38 | 96 | 0.692839 |
074a5fb7865c2fac90f131586a9b8fdb4e6c5335 | 853 | py | Python | doc/source/contributor/create/examples/resource/fake.py | nicolasochem/openstacksdk | 34ea72ce5b0b7f16a038ca57b2a9f1ec2f90ce00 | [
"Apache-2.0"
] | null | null | null | doc/source/contributor/create/examples/resource/fake.py | nicolasochem/openstacksdk | 34ea72ce5b0b7f16a038ca57b2a9f1ec2f90ce00 | [
"Apache-2.0"
] | null | null | null | doc/source/contributor/create/examples/resource/fake.py | nicolasochem/openstacksdk | 34ea72ce5b0b7f16a038ca57b2a9f1ec2f90ce00 | [
"Apache-2.0"
] | null | null | null | # Apache 2 header omitted for brevity
from openstack.fake import fake_service
from openstack import resource
class Fake(resource.Resource):
resource_key = "resource"
resources_key = "resources"
base_path = "/fake"
service = fake_service.FakeService()
allow_create = True
allow_get = True
... | 29.413793 | 60 | 0.689332 |
32131c595967b875f3d22a593dbcb536538ad23a | 3,897 | py | Python | graphzoom/graphsage_utils.py | NIRVANALAN/GraphZoom | 32afa35324bf699d754508dbfcc727855a4e9878 | [
"BSD-3-Clause"
] | null | null | null | graphzoom/graphsage_utils.py | NIRVANALAN/GraphZoom | 32afa35324bf699d754508dbfcc727855a4e9878 | [
"BSD-3-Clause"
] | null | null | null | graphzoom/graphsage_utils.py | NIRVANALAN/GraphZoom | 32afa35324bf699d754508dbfcc727855a4e9878 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function
from pathlib import Path
import numpy as np
import random
import json
import sys
import os
import networkx as nx
from networkx.readwrite import json_graph
# version_info = list(map(int, nx.__version__.split('.')))
# major = version_info[0]
# minor = version_info[1]
# assert (majo... | 35.108108 | 103 | 0.604054 |
2b12567c777c0822a49e01c50777a6c82e837378 | 11,557 | py | Python | conans/client/profile_loader.py | ssaavedra/conan | e15dc7902fbbeaf469798a3b9948ead1ecfc8e3c | [
"MIT"
] | 1 | 2021-08-05T15:33:08.000Z | 2021-08-05T15:33:08.000Z | conans/client/profile_loader.py | ssaavedra/conan | e15dc7902fbbeaf469798a3b9948ead1ecfc8e3c | [
"MIT"
] | 9 | 2017-10-07T06:23:10.000Z | 2021-06-29T15:22:27.000Z | conans/client/profile_loader.py | ssaavedra/conan | e15dc7902fbbeaf469798a3b9948ead1ecfc8e3c | [
"MIT"
] | 1 | 2022-03-23T18:07:31.000Z | 2022-03-23T18:07:31.000Z | import os
from collections import OrderedDict, defaultdict
from conans.errors import ConanException, ConanV2Exception
from conans.model.env_info import EnvValues, unquote
from conans.model.options import OptionsValues
from conans.model.profile import Profile
from conans.model.ref import ConanFileReference
from conans.... | 38.652174 | 101 | 0.642554 |
02435678750a957052494d47c1eaf144f2689671 | 252 | py | Python | manage.py | Seulki-You/HCI_Chatbot | 46063f21ffebbe4ee46f3c58f0325d73eb3f69c2 | [
"MIT"
] | null | null | null | manage.py | Seulki-You/HCI_Chatbot | 46063f21ffebbe4ee46f3c58f0325d73eb3f69c2 | [
"MIT"
] | null | null | null | manage.py | Seulki-You/HCI_Chatbot | 46063f21ffebbe4ee46f3c58f0325d73eb3f69c2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "SSUperBot.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| 22.909091 | 73 | 0.77381 |
6ddc3c6cea20985c470c6f45e39dee0558ee3186 | 2,198 | py | Python | yield.py | dhqdqk/python3-learn | 6711bcb289e319f18409bc5a3c951e9998192894 | [
"Apache-2.0"
] | null | null | null | yield.py | dhqdqk/python3-learn | 6711bcb289e319f18409bc5a3c951e9998192894 | [
"Apache-2.0"
] | null | null | null | yield.py | dhqdqk/python3-learn | 6711bcb289e319f18409bc5a3c951e9998192894 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#coding:utf-8
import asyncio
'''
协程,又称微线程,纤程。英文名Coroutine。
asyncio是Python 3.4版本引入的标准库,直接内置了对异步IO的支持。
用asyncio提供的@asyncio.coroutine可以把一个generator标记为coroutine类型,
然后在coroutine内部用yield from调用另一个coroutine实现异步操作
为了简化并更好地标识异步IO,从Python 3.5开始引入了新的语法async和await,可以让coroutine的代码更简洁易读
aiohttp是py3.5添加的处理ht... | 27.135802 | 71 | 0.585987 |
b29d48e0146be1cb72983dcc77e1b6f8568f2a71 | 13,651 | py | Python | lib/galaxy/managers/users.py | ramezrawas/galaxy-1 | c03748dd49c060a68d07bce56eae33e0ba154414 | [
"CC-BY-3.0"
] | 6 | 2018-11-03T22:43:35.000Z | 2022-02-15T17:51:33.000Z | lib/galaxy/managers/users.py | ramezrawas/galaxy-1 | c03748dd49c060a68d07bce56eae33e0ba154414 | [
"CC-BY-3.0"
] | 7 | 2016-12-07T22:19:37.000Z | 2019-01-30T15:04:26.000Z | lib/galaxy/managers/users.py | ramezrawas/galaxy-1 | c03748dd49c060a68d07bce56eae33e0ba154414 | [
"CC-BY-3.0"
] | 10 | 2017-04-10T21:40:22.000Z | 2022-02-21T16:50:10.000Z | """
Manager and Serializer for Users.
"""
import sqlalchemy
from galaxy import model
from galaxy import exceptions
from galaxy import util
from galaxy.managers import base
from galaxy.managers import deletable
from galaxy.managers import api_keys
from galaxy.security import validate_user_input
import logging
log = ... | 36.5 | 117 | 0.614021 |
2ef8c489181d5ecaa9d31010919d08f64313b887 | 7,842 | py | Python | interpolation.py | NREL/dw-tap-api | db3322189937f10355ba4e634421004ff2f7b5bb | [
"BSD-3-Clause"
] | null | null | null | interpolation.py | NREL/dw-tap-api | db3322189937f10355ba4e634421004ff2f7b5bb | [
"BSD-3-Clause"
] | null | null | null | interpolation.py | NREL/dw-tap-api | db3322189937f10355ba4e634421004ff2f7b5bb | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Class that manages vertical interpolations.
A class which will associate a set of model points with a desired point to
be interpolated. The class keeps the state of interpolation in the attribute
called model points.
A set of model points will first contain the set of all TS (x,y,z)
and the... | 45.859649 | 106 | 0.582632 |
406d04f2c0f7920ffc184bd32d3094740322f618 | 605 | py | Python | distributed_social_network/api/migrations/0006_node.py | CMPUT404F21-TEAM-PROJECT/cmput404-group-project | 5fc929f6bd22d41dc73734d34b1563bcfdc87f27 | [
"Apache-2.0"
] | 1 | 2022-02-10T05:50:19.000Z | 2022-02-10T05:50:19.000Z | distributed_social_network/api/migrations/0006_node.py | CMPUT404F21-TEAM-PROJECT/cmput404-group-project | 5fc929f6bd22d41dc73734d34b1563bcfdc87f27 | [
"Apache-2.0"
] | 43 | 2022-02-08T00:59:49.000Z | 2022-03-14T00:10:01.000Z | distributed_social_network/api/migrations/0006_node.py | CMPUT404F21-TEAM-PROJECT/cmput404-group-project | 5fc929f6bd22d41dc73734d34b1563bcfdc87f27 | [
"Apache-2.0"
] | 1 | 2022-03-17T22:11:38.000Z | 2022-03-17T22:11:38.000Z | # Generated by Django 3.2.7 on 2022-03-20 01:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0005_alter_followrequest_unique_together_and_more'),
]
operations = [
migrations.CreateModel(
name='Node',
fi... | 27.5 | 117 | 0.596694 |
8ad7117bc9491e79bc6343b9dcf90bf6ac309029 | 3,119 | py | Python | price/settings.py | kirikitty/scrapy-phone-price | bd7fae4a3f426283b61c10e26f3cbafc5f318dcd | [
"MIT"
] | null | null | null | price/settings.py | kirikitty/scrapy-phone-price | bd7fae4a3f426283b61c10e26f3cbafc5f318dcd | [
"MIT"
] | null | null | null | price/settings.py | kirikitty/scrapy-phone-price | bd7fae4a3f426283b61c10e26f3cbafc5f318dcd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Scrapy settings for price project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/latest/t... | 34.274725 | 109 | 0.77589 |
8fad0df05a0bf2cdbe98dee004131f1debf283dc | 237 | py | Python | Constructor.py | pprathameshmore/PythonLearning | 593bad64950afc9d39b289068402a6fc83e36df2 | [
"MIT"
] | null | null | null | Constructor.py | pprathameshmore/PythonLearning | 593bad64950afc9d39b289068402a6fc83e36df2 | [
"MIT"
] | 1 | 2018-03-01T15:38:56.000Z | 2018-03-01T18:40:59.000Z | Constructor.py | pprathameshmore/PythonLearning | 593bad64950afc9d39b289068402a6fc83e36df2 | [
"MIT"
] | 1 | 2018-03-01T15:13:44.000Z | 2018-03-01T15:13:44.000Z | #@Author Prathamesh More
class ConstructorDemo:
name = ""
def __init__(self, name):
print("Printing from Constructor")
ConstructorDemo.name = name
print(name)
c = ConstructorDemo('Prathamesh More') | 14.8125 | 42 | 0.64557 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.