hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
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 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7901c3c67acc8690e6d2267cb89d926f7b9775e1 | 4,181 | py | Python | examples/policies.py | simplivity/simplivity-python | 737ee847ac95cf3a33721765e7d4efcc0a0152e1 | [
"Apache-2.0"
] | null | null | null | examples/policies.py | simplivity/simplivity-python | 737ee847ac95cf3a33721765e7d4efcc0a0152e1 | [
"Apache-2.0"
] | null | null | null | examples/policies.py | simplivity/simplivity-python | 737ee847ac95cf3a33721765e7d4efcc0a0152e1 | [
"Apache-2.0"
] | 3 | 2020-01-15T14:49:03.000Z | 2020-01-24T20:45:24.000Z | ###
# (C) Copyright [2019-2020] Hewlett Packard Enterprise Development LP
#
# 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 ... | 26.974194 | 104 | 0.702464 |
from simplivity.ovc_client import OVC
from simplivity.exceptions import HPESimpliVityException
import pprint
pp = pprint.PrettyPrinter(indent=4)
config = {
"ip": "<ovc_ip>",
"credentials": {
"username": "<username>",
"password": "<password>"
}
}
ovc = OVC(config)
policies = ov... | true | true |
7901c5187b7044265efe461875a621e1c571a518 | 8,214 | py | Python | vagrant_files/generator/files/databases/druid_cl5_rf1.py | TSDBBench/Overlord | d72b6927ceaf6631f5b07f411e34bec9904158c4 | [
"Apache-2.0"
] | 6 | 2017-07-05T16:59:16.000Z | 2020-07-01T10:17:09.000Z | vagrant_files/generator/files/databases/druid_cl5_rf1.py | TSDBBench/Overlord | d72b6927ceaf6631f5b07f411e34bec9904158c4 | [
"Apache-2.0"
] | 8 | 2017-11-03T13:36:53.000Z | 2021-09-05T11:05:17.000Z | vagrant_files/generator/files/databases/druid_cl5_rf1.py | TSDBBench/Overlord | d72b6927ceaf6631f5b07f411e34bec9904158c4 | [
"Apache-2.0"
] | 6 | 2016-11-10T12:56:41.000Z | 2018-06-19T21:53:58.000Z | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
__author__ = 'Andreas Bader'
__version__ = "0.01"
# db_folders -> List of DB Folder (for space check)
# db_client -> name of ycsb client
# db_args -> special ycsb arguments for this db
# db_name -> name of this db (e.g. for workload file)
# db_desc -> more detailed name/... | 83.816327 | 230 | 0.660701 |
__author__ = 'Andreas Bader'
__version__ = "0.01"
def getDict():
dbConfig={}
dbConfig["db_folders"]=["/tmp/druid/indexCache", "/tmp/persistent/zk_druid", "/tmp/persistent/task/", "/tmp/druid/localStorage", "/var/lib/mysql"]
dbConfig["db_client"]="druid"
dbConfig... | true | true |
7901c635b9ceb8544fdc9593b965c809ae23da78 | 4,227 | py | Python | pysnmp-with-texts/Nortel-MsCarrier-MscPassport-ExtensionsMIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/Nortel-MsCarrier-MscPassport-ExtensionsMIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/Nortel-MsCarrier-MscPassport-ExtensionsMIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module Nortel-MsCarrier-MscPassport-ExtensionsMIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Nortel-MsCarrier-MscPassport-ExtensionsMIB
# Produced by pysmi-0.3.4 at Wed May 1 14:29:54 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user ... | 114.243243 | 607 | 0.772652 |
Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueSizeConstraint, ConstraintsIntersection, SingleValueConstraint, ValueRangeConstraint, ConstraintsUnion = mibBuild... | true | true |
7901c67ce98b80bb45d71a8a82809845d3c6f033 | 1,401 | py | Python | src/apps/users/views/rest/client_address.py | leonardon473/my-dinner-backend | ae64fca37d102ce5bda7570be8680e03e9b142d8 | [
"MIT"
] | null | null | null | src/apps/users/views/rest/client_address.py | leonardon473/my-dinner-backend | ae64fca37d102ce5bda7570be8680e03e9b142d8 | [
"MIT"
] | null | null | null | src/apps/users/views/rest/client_address.py | leonardon473/my-dinner-backend | ae64fca37d102ce5bda7570be8680e03e9b142d8 | [
"MIT"
] | null | null | null | # -----------------------------------------------------------------------------
# Libraries
# -----------------------------------------------------------------------------
# Core libs
from typing import TYPE_CHECKING
# Third party libs
from rest_framework.generics import ListCreateAPIView, RetrieveUpdateDestroyAPIView... | 33.357143 | 83 | 0.443969 |
from typing import TYPE_CHECKING
from rest_framework.generics import ListCreateAPIView, RetrieveUpdateDestroyAPIView
from apps.users.models import ClientAddress
from apps.users.serializers.client_address import (
ClientAddressCreateSerializer,
ClientAddressRetrieveSerializer,
)
if TYPE_CHECKING:
p... | true | true |
7901c90c781e5c3ca570333b040cdaa196547fc9 | 2,794 | py | Python | scalene-triangle/libs/PDB_filegetter.py | dsw7/BridgingInteractions | 4ed55bb2009a424c4e306ede04f0bf3572331fae | [
"MIT"
] | 1 | 2021-09-16T01:48:20.000Z | 2021-09-16T01:48:20.000Z | scalene-triangle/libs/PDB_filegetter.py | dsw7/BridgingInteractions | 4ed55bb2009a424c4e306ede04f0bf3572331fae | [
"MIT"
] | null | null | null | scalene-triangle/libs/PDB_filegetter.py | dsw7/BridgingInteractions | 4ed55bb2009a424c4e306ede04f0bf3572331fae | [
"MIT"
] | null | null | null | # Written by David Weber
# dsw7@sfu.ca
"""
In this short namespace I house a class that connects to PDB and downloads
file over PDB file transfer protocol.
"""
# ------------------------------------------------------------------------------
import gzip
from os import remove, getcwd, path # built in
# m... | 28.222222 | 81 | 0.494273 |
import gzip
from os import remove, getcwd, path
try:
from urllib.request import urlretrieve, urlcleanup
except ImportError:
from urllib import urlretrieve, urlcleanup
ROOT = 'ftp://ftp.wwpdb.org/pub/pdb/data/structures/divided/pdb/{}/{}'
class PDBFile:
def __init__(self, code):
... | true | true |
7901c91a06af59b437ee73b9b9946d6eaf847d95 | 6,664 | py | Python | examples/03_sweep_linear.py | RedVoxInc/libquantum | 5e0d741e69be0ac1b94c018a4a0de99f4630deae | [
"Apache-2.0"
] | 2 | 2021-02-24T21:54:16.000Z | 2021-03-05T23:06:54.000Z | examples/03_sweep_linear.py | RedVoxInc/libquantum | 5e0d741e69be0ac1b94c018a4a0de99f4630deae | [
"Apache-2.0"
] | null | null | null | examples/03_sweep_linear.py | RedVoxInc/libquantum | 5e0d741e69be0ac1b94c018a4a0de99f4630deae | [
"Apache-2.0"
] | null | null | null | """
libquantum example 3: 03_sweep_linear.py
Construct classic linear chirp and illustrate CWT and STFT TRFs.
"""
import os
from pathlib import Path
import numpy as np
import scipy.io.wavfile
import matplotlib.pyplot as plt
from libquantum import atoms, entropy, scales, spectra, utils, synthetics
import libquantum.plo... | 44.13245 | 110 | 0.579232 |
import os
from pathlib import Path
import numpy as np
import scipy.io.wavfile
import matplotlib.pyplot as plt
from libquantum import atoms, entropy, scales, spectra, utils, synthetics
import libquantum.plot_templates.plot_time_frequency_reps as pltq
if __name__ == "__main__":
do_save_wave = False
... | true | true |
7901c99ab98015bba242cc58af0f02592b798a4d | 3,920 | py | Python | advbench/lib/meters.py | constrainedlearning/advbench | 68f9f6d77268aad45517ca84d383b996724cc976 | [
"MIT"
] | null | null | null | advbench/lib/meters.py | constrainedlearning/advbench | 68f9f6d77268aad45517ca84d383b996724cc976 | [
"MIT"
] | null | null | null | advbench/lib/meters.py | constrainedlearning/advbench | 68f9f6d77268aad45517ca84d383b996724cc976 | [
"MIT"
] | null | null | null | import time
try:
import wandb
wandb_log=True
except ImportError:
wandb_log=False
import numpy as np
from advbench.lib.plotting import plot_perturbed_wandb
from einops import rearrange
class AverageMeter:
"""Computes and stores the average and current value"""
def __init__(self, avg_mom=0.5):
... | 29.923664 | 135 | 0.53801 | import time
try:
import wandb
wandb_log=True
except ImportError:
wandb_log=False
import numpy as np
from advbench.lib.plotting import plot_perturbed_wandb
from einops import rearrange
class AverageMeter:
def __init__(self, avg_mom=0.5):
self.avg_mom = avg_mom
self.reset()
self... | true | true |
7901cb2909c12cdd0fa5ec1b07c3122248d3a5f7 | 7,766 | py | Python | tests/core/test_expectation_suite_crud_methods.py | lfpll/great_expectations | f61fa7c2e6e813cd5ff84ab7403e05271cada257 | [
"Apache-2.0"
] | 1 | 2020-04-10T18:07:58.000Z | 2020-04-10T18:07:58.000Z | tests/core/test_expectation_suite_crud_methods.py | lfpll/great_expectations | f61fa7c2e6e813cd5ff84ab7403e05271cada257 | [
"Apache-2.0"
] | null | null | null | tests/core/test_expectation_suite_crud_methods.py | lfpll/great_expectations | f61fa7c2e6e813cd5ff84ab7403e05271cada257 | [
"Apache-2.0"
] | null | null | null | import json
import pytest
from great_expectations.core import ExpectationConfiguration, ExpectationSuite
from .test_expectation_suite import baseline_suite, exp1, exp2, exp3, exp4
@pytest.fixture
def empty_suite():
return ExpectationSuite(
expectation_suite_name="warning",
expectations=[],
... | 32.224066 | 84 | 0.683492 | import json
import pytest
from great_expectations.core import ExpectationConfiguration, ExpectationSuite
from .test_expectation_suite import baseline_suite, exp1, exp2, exp3, exp4
@pytest.fixture
def empty_suite():
return ExpectationSuite(
expectation_suite_name="warning",
expectations=[],
... | true | true |
7901cb2da8fb1b2c446ba68ee208268baff173a2 | 1,624 | py | Python | QCompute/QuantumPlatform/ProcedureParams.py | rickyHong/Qcompute-repl | 588b46020af209938f370032185ee8fe3e300795 | [
"Apache-2.0"
] | null | null | null | QCompute/QuantumPlatform/ProcedureParams.py | rickyHong/Qcompute-repl | 588b46020af209938f370032185ee8fe3e300795 | [
"Apache-2.0"
] | null | null | null | QCompute/QuantumPlatform/ProcedureParams.py | rickyHong/Qcompute-repl | 588b46020af209938f370032185ee8fe3e300795 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf8 -*-
# Copyright (c) 2020 Baidu, 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... | 25.375 | 74 | 0.647783 |
class ProcedureParams:
def __init__(self):
self.paramsDict = {}
def __getitem__(self, index):
value = self.paramsDict.get(index)
if value is not None:
return value
value = ProcedureParamStorage(index)
self.paramsDict[index] = value
... | true | true |
7901cc2f39e597d9485cfcc2e34018f75346c3b1 | 8,760 | py | Python | src/graph_nheads_att_gan/train.py | jiangnanboy/gcn_for_prediction_of_protein_interactions | b2a9eb06cdfe0971d0c352299db1075ec4827dd9 | [
"Apache-2.0"
] | 1 | 2022-01-04T11:42:42.000Z | 2022-01-04T11:42:42.000Z | src/graph_nheads_att_gan/train.py | jiangnanboy/gcn_for_prediction_of_protein_interactions | b2a9eb06cdfe0971d0c352299db1075ec4827dd9 | [
"Apache-2.0"
] | null | null | null | src/graph_nheads_att_gan/train.py | jiangnanboy/gcn_for_prediction_of_protein_interactions | b2a9eb06cdfe0971d0c352299db1075ec4827dd9 | [
"Apache-2.0"
] | null | null | null | import scipy.sparse as sp
import numpy as np
import torch
import time
import os
from configparser import ConfigParser
import sys
sys.path.append('/home/shiyan/project/gcn_for_prediction_of_protein_interactions/')
from src.util.load_data import load_data, sparse_to_tuple, mask_test_edges, preprocess_graph
from src.uti... | 47.351351 | 192 | 0.574543 | import scipy.sparse as sp
import numpy as np
import torch
import time
import os
from configparser import ConfigParser
import sys
sys.path.append('/home/shiyan/project/gcn_for_prediction_of_protein_interactions/')
from src.util.load_data import load_data, sparse_to_tuple, mask_test_edges, preprocess_graph
from src.uti... | true | true |
7901ccb774253d7645d7cf53b030d4938891716d | 2,038 | py | Python | grom/ui/ui_multiRename.py | hovo1990/GROM | fd7d4753c7d0d6bdab94b625d45456690c5b4ea2 | [
"CNRI-Python"
] | 8 | 2015-04-16T12:07:07.000Z | 2020-05-31T09:06:27.000Z | grom/ui/ui_multiRename.py | egtai/GROM | fd7d4753c7d0d6bdab94b625d45456690c5b4ea2 | [
"CNRI-Python"
] | null | null | null | grom/ui/ui_multiRename.py | egtai/GROM | fd7d4753c7d0d6bdab94b625d45456690c5b4ea2 | [
"CNRI-Python"
] | 2 | 2019-03-06T14:48:58.000Z | 2021-07-28T08:05:28.000Z | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui_multi_rename_qt5.ui'
#
# Created: Thu Aug 14 17:13:08 2014
# by: PyQt5 UI code generator 5.2.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Multi_Rename_Dialog(object... | 48.52381 | 114 | 0.748773 |
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Multi_Rename_Dialog(object):
def setupUi(self, Multi_Rename_Dialog):
Multi_Rename_Dialog.setObjectName("Multi_Rename_Dialog")
Multi_Rename_Dialog.resize(194, 105)
Multi_Rename_Dialog.setMinimumSize(QtCore.QSize(194, 105))
... | true | true |
7901cdd575f6adcb8ec86589d3fa6b4b7c51d9e7 | 5,299 | py | Python | alipay/aop/api/domain/MybankPaymentTradeFinancingOrderRefundModel.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/MybankPaymentTradeFinancingOrderRefundModel.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/MybankPaymentTradeFinancingOrderRefundModel.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class MybankPaymentTradeFinancingOrderRefundModel(object):
def __init__(self):
self._amount = None
self._biz_no = None
self._currency_value = None
self._ext_info = None
... | 30.107955 | 79 | 0.578411 |
import json
from alipay.aop.api.constant.ParamConstants import *
class MybankPaymentTradeFinancingOrderRefundModel(object):
def __init__(self):
self._amount = None
self._biz_no = None
self._currency_value = None
self._ext_info = None
self._order_no = None
self._... | true | true |
7901cdf0112f00577707949029b10e7b8a57973e | 2,614 | py | Python | SpacyHu/SpacyHu/LemmatizerMorphAnalyzer.py | Prodinal/GateSpacyWrapping | 046c415eb22ce7c2cc4aaca904410f852e993974 | [
"MIT"
] | null | null | null | SpacyHu/SpacyHu/LemmatizerMorphAnalyzer.py | Prodinal/GateSpacyWrapping | 046c415eb22ce7c2cc4aaca904410f852e993974 | [
"MIT"
] | null | null | null | SpacyHu/SpacyHu/LemmatizerMorphAnalyzer.py | Prodinal/GateSpacyWrapping | 046c415eb22ce7c2cc4aaca904410f852e993974 | [
"MIT"
] | null | null | null | import spacy
from spacy.tokens import Doc, Span, Token
import urllib
import xml.etree.ElementTree as ET
import re
from SpacyHu.BaseSpacyHuComponent import BaseSpacyHuComponent
class HuLemmaMorph(BaseSpacyHuComponent):
def __init__(self,
nlp,
label='Morph',
url='h... | 36.305556 | 77 | 0.602142 | import spacy
from spacy.tokens import Doc, Span, Token
import urllib
import xml.etree.ElementTree as ET
import re
from SpacyHu.BaseSpacyHuComponent import BaseSpacyHuComponent
class HuLemmaMorph(BaseSpacyHuComponent):
def __init__(self,
nlp,
label='Morph',
url='h... | true | true |
7901ce20f3cfeffffbc33eaecd41256801f8807e | 1,664 | py | Python | setup.py | lapidshay/DEMON | c7eeeb22be279c9dd9a6555bae06702f369021ac | [
"BSD-2-Clause"
] | 1 | 2018-04-09T17:01:00.000Z | 2018-04-09T17:01:00.000Z | setup.py | KDDComplexNetworkAnalysis/DEMON | c32d80198a90c4d6c2165e34cffd79315aa764e7 | [
"BSD-2-Clause"
] | null | null | null | setup.py | KDDComplexNetworkAnalysis/DEMON | c32d80198a90c4d6c2165e34cffd79315aa764e7 | [
"BSD-2-Clause"
] | null | null | null | from setuptools import setup, find_packages
__author__ = 'Giulio Rossetti'
__license__ = "BSD 2 Clause"
__email__ = "giulio.rossetti@gmail.com"
# Get the long description from the README file
# with open(path.join(here, 'README.md'), encoding='utf-8') as f:
# long_description = f.read()
setup(name='demon',
... | 36.977778 | 109 | 0.615385 | from setuptools import setup, find_packages
__author__ = 'Giulio Rossetti'
__license__ = "BSD 2 Clause"
__email__ = "giulio.rossetti@gmail.com"
setup(name='demon',
version='2.0.4',
license='BSD-2-Clause',
description='Community Discovery algorithm',
url='https://github.com/GiulioRossetti/D... | true | true |
7901ce538a3da1b295edd54873a1c484b4a994be | 21,581 | py | Python | test/functional/feature_pruning.py | umkoin/umkoin | ba28fce6f6b22099ba7b900619653f9e342d3cd1 | [
"MIT"
] | 6 | 2018-02-28T22:23:46.000Z | 2020-02-13T13:49:44.000Z | test/functional/feature_pruning.py | umkoin/umkoin | ba28fce6f6b22099ba7b900619653f9e342d3cd1 | [
"MIT"
] | null | null | null | test/functional/feature_pruning.py | umkoin/umkoin | ba28fce6f6b22099ba7b900619653f9e342d3cd1 | [
"MIT"
] | 6 | 2018-02-05T12:51:25.000Z | 2020-04-26T10:42:49.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2020 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 the pruning code.
WARNING:
This test uses 4GB of disk space.
This test takes 30 mins or more (up ... | 44.866944 | 138 | 0.613781 |
import os
from test_framework.blocktools import create_coinbase
from test_framework.messages import CBlock
from test_framework.script import (
CScript,
OP_NOP,
OP_RETURN,
)
from test_framework.test_framework import UmkoinTestFramework
from test_framework.util import (
assert_equal,
assert_great... | true | true |
7901cf733b21a13444709d33afd7941197320ca2 | 11,162 | py | Python | ucr/core/architecture/head/rec_srn_head.py | DocYard-ai/UCR | 7618aa336f56e71d9fd8cdc2d591e3d138e3dc68 | [
"Apache-2.0"
] | 10 | 2021-04-06T15:57:20.000Z | 2021-11-14T23:00:13.000Z | ucr/core/architecture/head/rec_srn_head.py | felixdittrich92/UCR | 7618aa336f56e71d9fd8cdc2d591e3d138e3dc68 | [
"Apache-2.0"
] | 5 | 2021-04-22T10:28:17.000Z | 2022-03-02T07:47:53.000Z | ucr/core/architecture/head/rec_srn_head.py | felixdittrich92/UCR | 7618aa336f56e71d9fd8cdc2d591e3d138e3dc68 | [
"Apache-2.0"
] | 2 | 2021-04-30T10:27:51.000Z | 2021-08-02T15:12:10.000Z | # copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# Modifications copyright (c) 2021 DocYard 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
#
# ... | 33.620482 | 201 | 0.613241 |
from __future__ import absolute_import, division, print_function
from collections import OrderedDict
import torch
from torch import nn
from torch.nn import functional as F
from .self_attention import WrapEncoder, WrapEncoderForFeature
gradient_clip = 10
from functools import partial
class PVAM(nn... | true | true |
7901d10fa0fae95fc20ad66e101aa64dab9b3697 | 5,466 | py | Python | .config/polybar/weather/weather.py | NearHuscarl/dotfiles | c984e9d53f7a32dc98bdaf8a78788466e3b396ab | [
"BSD-3-Clause"
] | 4 | 2018-08-10T19:52:16.000Z | 2020-09-10T12:01:27.000Z | .config/polybar/weather/weather.py | NearHuscarl/dotfiles | c984e9d53f7a32dc98bdaf8a78788466e3b396ab | [
"BSD-3-Clause"
] | 3 | 2021-02-08T20:24:45.000Z | 2021-04-30T20:38:17.000Z | .config/polybar/weather/weather.py | NearHuscarl/dotfiles | c984e9d53f7a32dc98bdaf8a78788466e3b396ab | [
"BSD-3-Clause"
] | 2 | 2018-03-25T09:01:35.000Z | 2020-04-26T10:12:42.000Z | #!/bin/env python
""" Module to display weather info on polybar """
# -*- coding: utf-8 -*-
import argparse
import datetime
import logging
import os
import time
import requests
import importlib
# pylint: disable=redefined-builtin
from requests import ConnectionError
from requests.exceptions import HTTPError, Timeou... | 27.059406 | 94 | 0.662642 |
import argparse
import datetime
import logging
import os
import time
import requests
import importlib
from requests import ConnectionError
from requests.exceptions import HTTPError, Timeout
from util import color_polybar, color_bash as cb
class MyInternetIsShitty(Exception):
pass
def get_args():
parser = ar... | true | true |
7901d205c7f7e4d05a3a0cb476882753468eb403 | 14,065 | py | Python | UI_util.py | JiazeWang/lung_nodule_integ_viewer | fc996644d96c8f7fac631345539ce3ca01af7013 | [
"MIT"
] | null | null | null | UI_util.py | JiazeWang/lung_nodule_integ_viewer | fc996644d96c8f7fac631345539ce3ca01af7013 | [
"MIT"
] | null | null | null | UI_util.py | JiazeWang/lung_nodule_integ_viewer | fc996644d96c8f7fac631345539ce3ca01af7013 | [
"MIT"
] | null | null | null | import SimpleITK as sitk
import numpy as np
import torch
import math
import time
import sys
import cv2
from scipy.ndimage.interpolation import zoom
from torch.autograd import Variable
sys.path.append('../lung_nodule_detector')
from training.layers import nms
def load_itk_image(filename):
with open(filename) as f:... | 34.55774 | 135 | 0.572129 | import SimpleITK as sitk
import numpy as np
import torch
import math
import time
import sys
import cv2
from scipy.ndimage.interpolation import zoom
from torch.autograd import Variable
sys.path.append('../lung_nodule_detector')
from training.layers import nms
def load_itk_image(filename):
with open(filename) as f:... | false | true |
7901d2c50ce44e216f493b22e5238ee4b6c3f3d1 | 2,222 | py | Python | utils.py | glee1228/segment_temporal_context_aggregation | e5778f848f1cfd89bd1f77beb5e1b38a66a2f13d | [
"Apache-2.0"
] | 1 | 2022-03-15T18:17:45.000Z | 2022-03-15T18:17:45.000Z | utils.py | glee1228/segment_temporal_context_aggregation | e5778f848f1cfd89bd1f77beb5e1b38a66a2f13d | [
"Apache-2.0"
] | null | null | null | utils.py | glee1228/segment_temporal_context_aggregation | e5778f848f1cfd89bd1f77beb5e1b38a66a2f13d | [
"Apache-2.0"
] | null | null | null | import io
import os
import random
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from PIL import Image
def resize_axis(tensor, axis, new_size, fill_value=0, random_sampling=False):
"""Truncates or pads a tensor to new_size on on a given axis.
Truncate or extend tensor s... | 37.033333 | 131 | 0.633663 | import io
import os
import random
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from PIL import Image
def resize_axis(tensor, axis, new_size, fill_value=0, random_sampling=False):
tensor = torch.Tensor(tensor)
shape = list(tensor.shape)
pad_shape = shape[:]
pa... | true | true |
7901d3136560dfc43f1dec71eefcb769f082b0a4 | 2,373 | py | Python | trim/montecarlo/options/source.py | drix00/pytrim-montecarlo | 415d4dc5bcbbc6d4206bbfe3fed6c4978a65b926 | [
"Apache-2.0"
] | null | null | null | trim/montecarlo/options/source.py | drix00/pytrim-montecarlo | 415d4dc5bcbbc6d4206bbfe3fed6c4978a65b926 | [
"Apache-2.0"
] | 16 | 2019-09-05T21:25:48.000Z | 2019-09-08T22:05:20.000Z | trim/montecarlo/options/source.py | drix00/pytrim-montecarlo | 415d4dc5bcbbc6d4206bbfe3fed6c4978a65b926 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
.. py:currentmodule:: trim.montecarlo.source
.. moduleauthor:: Hendrix Demers <hendrix.demers@mail.mcgill.ca>
"""
# Copyright 2019 Hendrix Demers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance wi... | 30.423077 | 74 | 0.719343 |
from trim.montecarlo.math import Point
GROUP_SOURCE = "source"
GROUP_POSITIONS = "position (nm)"
GROUP_DIRECTION = "direction"
ATTRIBUTE_KINETIC_ENERGY = "kinetic energy (keV)"
ATTRIBUTE_MASS = "mass (amu)"
ATTRIBUTE_ATOMIC_NUMBER = "atomic number"
class Source:
def __init__(self):
... | true | true |
7901d3289ac21da3c40fb0353d39ac702827912e | 4,270 | py | Python | datadog_checks_dev/datadog_checks/dev/tooling/create.py | zaquaz/integrations-core | a7d41ac9b573ae52f13f265d11dc5050885aa62b | [
"BSD-3-Clause"
] | null | null | null | datadog_checks_dev/datadog_checks/dev/tooling/create.py | zaquaz/integrations-core | a7d41ac9b573ae52f13f265d11dc5050885aa62b | [
"BSD-3-Clause"
] | null | null | null | datadog_checks_dev/datadog_checks/dev/tooling/create.py | zaquaz/integrations-core | a7d41ac9b573ae52f13f265d11dc5050885aa62b | [
"BSD-3-Clause"
] | null | null | null | # (C) Datadog, Inc. 2018
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import os
import re
from datetime import datetime
from uuid import uuid4
from .utils import normalize_package_name
from ..utils import (
create_file,
dir_exists,
ensure_parent_dir_exists,
path_joi... | 30.719424 | 103 | 0.622951 |
import os
import re
from datetime import datetime
from uuid import uuid4
from .utils import normalize_package_name
from ..utils import (
create_file,
dir_exists,
ensure_parent_dir_exists,
path_join,
read_file,
read_file_binary,
write_file,
write_file_binary
)
TEMPLATES_DIR = path_jo... | true | true |
7901d4229ad529c05bf757e7cb3dd7ca1b424f4f | 11,995 | py | Python | web_reamer.py | febinrev/web_reamer | 4e584b2e63a34cc29518f42b1c799b979e70e51e | [
"MIT"
] | 1 | 2020-09-03T06:48:32.000Z | 2020-09-03T06:48:32.000Z | web_reamer.py | febinrev/web_reamer | 4e584b2e63a34cc29518f42b1c799b979e70e51e | [
"MIT"
] | null | null | null | web_reamer.py | febinrev/web_reamer | 4e584b2e63a34cc29518f42b1c799b979e70e51e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
import os
import re
import argparse
import requests
from bs4 import BeautifulSoup as bs
version=1.1
print("""\033[1;36m
╦ ╦╔═╗╔╗ ╦═╗╔═╗╔═╗╔╦╗╔═╗╦═╗
║║║║╣ ╠╩╗ ╠╦╝║╣ ╠═╣║║║║╣ ╠╦╝
╚╩╝╚═╝╚═╝────╩╚═╚═╝╩ ╩╩ ╩╚═╝╩╚═
🔗🔥🔗🔥🔗🔥🔗🔥🔗🔥🔗🔥🔗🔥🔗🔥
... | 31.816976 | 166 | 0.656857 |
import sys
import os
import re
import argparse
import requests
from bs4 import BeautifulSoup as bs
version=1.1
print("""\033[1;36m
╦ ╦╔═╗╔╗ ╦═╗╔═╗╔═╗╔╦╗╔═╗╦═╗
║║║║╣ ╠╩╗ ╠╦╝║╣ ╠═╣║║║║╣ ╠╦╝
╚╩╝╚═╝╚═╝────╩╚═╚═╝╩ ╩╩ ╩╚═╝╩╚═
🔗🔥🔗🔥🔗🔥🔗🔥🔗🔥🔗🔥🔗🔥🔗🔥
--> Code... | true | true |
7901d4e84e0f30b763cbb5693063eee5af659b6b | 1,255 | py | Python | vitalstyles/cli.py | appressoas/vitalstyles | e91de56c2f6402bcd8703d71abfcd505ac1a5901 | [
"BSD-3-Clause"
] | null | null | null | vitalstyles/cli.py | appressoas/vitalstyles | e91de56c2f6402bcd8703d71abfcd505ac1a5901 | [
"BSD-3-Clause"
] | null | null | null | vitalstyles/cli.py | appressoas/vitalstyles | e91de56c2f6402bcd8703d71abfcd505ac1a5901 | [
"BSD-3-Clause"
] | null | null | null | import argparse
import logging
from pprint import pformat
from . import guide
from . import settings
log = logging.getLogger(__name__)
def cli(settingsobject=None):
parser = argparse.ArgumentParser(description='Create a CSS/LESS/SASS style guide.')
if not settingsobject:
parser.add_argument('-f', '... | 29.880952 | 87 | 0.67012 | import argparse
import logging
from pprint import pformat
from . import guide
from . import settings
log = logging.getLogger(__name__)
def cli(settingsobject=None):
parser = argparse.ArgumentParser(description='Create a CSS/LESS/SASS style guide.')
if not settingsobject:
parser.add_argument('-f', '... | true | true |
7901d4f95411ca6514dce907d8c06b920e4dc8c7 | 3,672 | py | Python | infoblox_netmri/api/remote/models/spm_history_end_host_history_grid_remote.py | IngmarVG-IB/infoblox-netmri | b0c725fd64aee1890d83917d911b89236207e564 | [
"Apache-2.0"
] | null | null | null | infoblox_netmri/api/remote/models/spm_history_end_host_history_grid_remote.py | IngmarVG-IB/infoblox-netmri | b0c725fd64aee1890d83917d911b89236207e564 | [
"Apache-2.0"
] | null | null | null | infoblox_netmri/api/remote/models/spm_history_end_host_history_grid_remote.py | IngmarVG-IB/infoblox-netmri | b0c725fd64aee1890d83917d911b89236207e564 | [
"Apache-2.0"
] | null | null | null | from ..remote import RemoteModel
from infoblox_netmri.utils.utils import check_api_availability
class SpmHistoryEndHostHistoryGridRemote(RemoteModel):
"""
This table lists the end host history within the user specified period of time for a given end host.
| ``id:`` The internal NetMRI identifier of... | 30.857143 | 157 | 0.566176 | from ..remote import RemoteModel
from infoblox_netmri.utils.utils import check_api_availability
class SpmHistoryEndHostHistoryGridRemote(RemoteModel):
properties = ("id",
"FirstSeen",
"LastSeen",
"HostIPNumeric",
"HostIPAddress",
... | true | true |
7901d50f7fedfeb739023373fe99074d27094808 | 1,584 | py | Python | app/integrations/IntegrationDiscordDriver.py | josephmancuso/gbaleague-masonite2 | b3dd5ec3f20c07eaabcc3129b0c50379a946a82b | [
"MIT"
] | null | null | null | app/integrations/IntegrationDiscordDriver.py | josephmancuso/gbaleague-masonite2 | b3dd5ec3f20c07eaabcc3129b0c50379a946a82b | [
"MIT"
] | 3 | 2018-07-25T17:36:43.000Z | 2020-01-06T18:52:51.000Z | app/integrations/IntegrationDiscordDriver.py | josephmancuso/gbaleague-masonite2 | b3dd5ec3f20c07eaabcc3129b0c50379a946a82b | [
"MIT"
] | null | null | null | import requests
import os
class IntegrationDiscordDriver:
_scope = ''
_state = ''
def scopes(self, scopes):
pass
def send(self, request, state='', scopes=('identify',)):
self._scope = scopes
self._state = state
return request.redirect('https://discordapp.com/api/oaut... | 31.058824 | 151 | 0.576389 | import requests
import os
class IntegrationDiscordDriver:
_scope = ''
_state = ''
def scopes(self, scopes):
pass
def send(self, request, state='', scopes=('identify',)):
self._scope = scopes
self._state = state
return request.redirect('https://discordapp.com/api/oaut... | true | true |
7901d53d2e08763fe745142794119729afd1c8b7 | 15,783 | py | Python | wiselib2/Noise.py | WISE-Project/wiselib2 | 9daf7b3b72e81d154fe094c05000406ee203c3de | [
"MIT"
] | null | null | null | wiselib2/Noise.py | WISE-Project/wiselib2 | 9daf7b3b72e81d154fe094c05000406ee203c3de | [
"MIT"
] | null | null | null | wiselib2/Noise.py | WISE-Project/wiselib2 | 9daf7b3b72e81d154fe094c05000406ee203c3de | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Jul 07 14:08:31 2016
@author: Mic
"""
from __future__ import division
from wiselib2.must import *
import numpy as np
import wiselib2.Rayman as rm
Gauss1d = lambda x ,y : None
from scipy import interpolate as interpolate
from matplotlib import pyplot as plt
class PsdFuns:
... | 28.234347 | 310 | 0.563138 |
from __future__ import division
from wiselib2.must import *
import numpy as np
import wiselib2.Rayman as rm
Gauss1d = lambda x ,y : None
from scipy import interpolate as interpolate
from matplotlib import pyplot as plt
class PsdFuns:
@staticmethod
def Flat(x, *args):
N = len(x)
return np.zeros([1,N]) +1
@sta... | true | true |
7901d5795f2fc04bc8fb23c5e83916a13c572858 | 1,477 | py | Python | src/lib/interface.py | hgiesel/anki_text_wrapper | 6cc24d0785b6ea65816c1b633acaf00077cb6a7a | [
"MIT"
] | null | null | null | src/lib/interface.py | hgiesel/anki_text_wrapper | 6cc24d0785b6ea65816c1b633acaf00077cb6a7a | [
"MIT"
] | null | null | null | src/lib/interface.py | hgiesel/anki_text_wrapper | 6cc24d0785b6ea65816c1b633acaf00077cb6a7a | [
"MIT"
] | null | null | null | from typing import List, Literal, Union, Callable, Tuple
from dataclasses import dataclass, replace
from .config_types import (
TWInterface,
TWSettingStorage, TWSettingBool, TWSetting,
WrapType, Fields, AnkiModel, LabelText, WhichField, Tags, Falsifiable,
)
ScriptKeys = Literal[
'enabled',
'name'... | 26.854545 | 112 | 0.654705 | from typing import List, Literal, Union, Callable, Tuple
from dataclasses import dataclass, replace
from .config_types import (
TWInterface,
TWSettingStorage, TWSettingBool, TWSetting,
WrapType, Fields, AnkiModel, LabelText, WhichField, Tags, Falsifiable,
)
ScriptKeys = Literal[
'enabled',
'name'... | true | true |
7901d627b1a76729123800d05a8c8708c88f68cb | 1,234 | py | Python | var/spack/repos/builtin/packages/prank/package.py | robertsawko/spack | 135cf4835f5b646c4aaa0e2eb5552c80fc3a5ce8 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2019-09-15T23:55:48.000Z | 2019-09-15T23:55:48.000Z | var/spack/repos/builtin/packages/prank/package.py | vlkale/spack | 011b6e684d3978c956e5ea60d2982ccc0bac5d6d | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/prank/package.py | vlkale/spack | 011b6e684d3978c956e5ea60d2982ccc0bac5d6d | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2017-01-21T17:19:32.000Z | 2017-01-21T17:19:32.000Z | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Prank(Package):
"""A powerful multiple sequence alignment browser."""
homepage = "htt... | 34.277778 | 96 | 0.613452 |
from spack import *
class Prank(Package):
homepage = "http://wasabiapp.org/software/prank/"
url = "http://wasabiapp.org/download/prank/prank.source.170427.tgz"
version('170427', sha256='623eb5e9b5cb0be1f49c3bf715e5fabceb1059b21168437264bdcd5c587a8859')
depends_on('mafft')
depends_on('... | true | true |
7901d632bbec3cafeb8c4ffbe2ea51c8f4d51367 | 9,809 | py | Python | Packs/Intezer/Integrations/IntezerV2/IntezerV2.py | ryantoddtq/content | 50027658da7189e37e9514fc03057d1c1bc3209f | [
"MIT"
] | 2 | 2020-07-27T10:35:41.000Z | 2020-12-14T15:44:18.000Z | Packs/Intezer/Integrations/IntezerV2/IntezerV2.py | Axonius/content | e058add82b7422338015cf14591512b9aad4d3e9 | [
"MIT"
] | 22 | 2022-03-23T10:39:16.000Z | 2022-03-31T11:31:37.000Z | Packs/Intezer/Integrations/IntezerV2/IntezerV2.py | adambaumeister/content | c6808d0b13d00edc4cd6268793c2ae0c2e39aed6 | [
"MIT"
] | null | null | null | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
''' IMPORTS '''
import requests
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
API_KEY = demisto.getParam('APIKey')
SERVER_URL = 'https://analyze.intezer.com/api'
API_VERSION = '/v2-0'
BASE_... | 34.059028 | 118 | 0.672036 | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
import requests
requests.packages.urllib3.disable_warnings()
API_KEY = demisto.getParam('APIKey')
SERVER_URL = 'https://analyze.intezer.com/api'
API_VERSION = '/v2-0'
BASE_URL = SERVER_URL + API_VERSION
IS_AVAILABLE... | true | true |
7901d6e75c1f1c7e0b513ee5acacf722fd8de2fb | 368 | py | Python | tests/test_hangman.py | julia-shenshina/hangman | ecb6101932710e0d66c40f78c46a31fa8b257a63 | [
"MIT"
] | null | null | null | tests/test_hangman.py | julia-shenshina/hangman | ecb6101932710e0d66c40f78c46a31fa8b257a63 | [
"MIT"
] | null | null | null | tests/test_hangman.py | julia-shenshina/hangman | ecb6101932710e0d66c40f78c46a31fa8b257a63 | [
"MIT"
] | null | null | null | def test_positive_guess(patched_hangman):
decision = patched_hangman.guess("e")
assert decision is True
def test_negative_guess(patched_hangman):
decision = patched_hangman.guess("r")
assert decision is False
def test_none_guess(patched_hangman):
patched_hangman.guess("e")
decision = patched... | 24.533333 | 41 | 0.75 | def test_positive_guess(patched_hangman):
decision = patched_hangman.guess("e")
assert decision is True
def test_negative_guess(patched_hangman):
decision = patched_hangman.guess("r")
assert decision is False
def test_none_guess(patched_hangman):
patched_hangman.guess("e")
decision = patched... | true | true |
7901d80b9d016c3aae85d03ac9eafc1f59895465 | 890 | py | Python | posts/forms.py | BastaAditya/Quiver | a6d29ec67341bd9cdb8a193ce1efcfd699aa4a96 | [
"MIT"
] | 1 | 2020-07-22T18:51:16.000Z | 2020-07-22T18:51:16.000Z | posts/forms.py | BastaAditya/Quiver | a6d29ec67341bd9cdb8a193ce1efcfd699aa4a96 | [
"MIT"
] | 18 | 2020-02-13T23:04:20.000Z | 2021-03-31T19:25:43.000Z | posts/forms.py | BastaAditya/Quiver | a6d29ec67341bd9cdb8a193ce1efcfd699aa4a96 | [
"MIT"
] | 5 | 2020-06-11T17:28:20.000Z | 2021-12-20T18:36:04.000Z | from django.forms import ModelForm
from .models import Post, Comment
from loginsignup.utils import getBeaverInstance
class PostForm(ModelForm):
class Meta:
model = Post
exclude = ["likes", "posted_on", "post_creator"]
def checkPost(self, request):
if self.is_valid():
post ... | 26.176471 | 64 | 0.602247 | from django.forms import ModelForm
from .models import Post, Comment
from loginsignup.utils import getBeaverInstance
class PostForm(ModelForm):
class Meta:
model = Post
exclude = ["likes", "posted_on", "post_creator"]
def checkPost(self, request):
if self.is_valid():
post ... | true | true |
7901d96685e00b053a75a199f71593efd3026547 | 856 | py | Python | python_know/normal/demo9_7.py | xuguoliang1995/leetCodePython | 9e4a96efd21506e8b0443a52be16c1280643b48c | [
"Apache-2.0"
] | null | null | null | python_know/normal/demo9_7.py | xuguoliang1995/leetCodePython | 9e4a96efd21506e8b0443a52be16c1280643b48c | [
"Apache-2.0"
] | null | null | null | python_know/normal/demo9_7.py | xuguoliang1995/leetCodePython | 9e4a96efd21506e8b0443a52be16c1280643b48c | [
"Apache-2.0"
] | null | null | null | # 右侧加法和原处加法: __radd__和__iadd__
"""
__add__并不支持+运算符右侧使用实例对象。要实现一并编写__radd__方法。
只有当+右侧的对象是实例,而左边对象不是类实例时,Python才会调用__radd++,
在其他情况下则是由左侧对象调用__add__方法。
"""
class Commuter:
def __init__(self, val):
self.val = val
def __add__(self, other):
# 如果没有instance测试,当两个实例相加并且__add__触发
# __radd__的时候... | 19.454545 | 57 | 0.653037 |
class Commuter:
def __init__(self, val):
self.val = val
def __add__(self, other):
if isinstance(other, Commuter): other = other.val
print("add")
return self.val + other
def __radd__(self, other):
print("radd")
return other + sel... | true | true |
7901da3a7dd2558688492c5904687578e9214782 | 802 | py | Python | tests/plugins/task/test_nulltask.py | codito/pomito | aa936982737e5ffe8ff808197d0896ee6e5239a8 | [
"MIT"
] | 1 | 2019-09-10T16:06:50.000Z | 2019-09-10T16:06:50.000Z | tests/plugins/task/test_nulltask.py | codito/pomito | aa936982737e5ffe8ff808197d0896ee6e5239a8 | [
"MIT"
] | 3 | 2017-09-11T14:11:42.000Z | 2017-09-14T02:14:22.000Z | tests/plugins/task/test_nulltask.py | codito/pomito | aa936982737e5ffe8ff808197d0896ee6e5239a8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Tests for NullTask plugin."""
import unittest
from pomito.plugins.task import nulltask, TaskPlugin
class NullTaskTests(unittest.TestCase):
"""Tests for NullTask."""
def setUp(self):
self.task = nulltask.NullTask(None)
def test_nulltask_is_a_task_plugin(self):
... | 27.655172 | 67 | 0.724439 |
import unittest
from pomito.plugins.task import nulltask, TaskPlugin
class NullTaskTests(unittest.TestCase):
def setUp(self):
self.task = nulltask.NullTask(None)
def test_nulltask_is_a_task_plugin(self):
assert issubclass(nulltask.NullTask, TaskPlugin)
def test_nulltask_initialize_sh... | true | true |
7901db5ea6b000538c04931f432b84b72e194629 | 2,423 | py | Python | scripts/translations/base_string_script.py | scanshop/FirebaseUI-Android | bb90590a83dfe100052a77335fbda3b508c9df99 | [
"Apache-2.0"
] | 4,975 | 2015-07-20T20:04:54.000Z | 2022-03-31T05:18:32.000Z | scripts/translations/base_string_script.py | scanshop/FirebaseUI-Android | bb90590a83dfe100052a77335fbda3b508c9df99 | [
"Apache-2.0"
] | 1,807 | 2015-08-20T04:09:59.000Z | 2022-03-30T23:39:08.000Z | scripts/translations/base_string_script.py | scanshop/FirebaseUI-Android | bb90590a83dfe100052a77335fbda3b508c9df99 | [
"Apache-2.0"
] | 2,392 | 2015-09-02T07:04:53.000Z | 2022-03-31T05:18:34.000Z | # coding=UTF-8
import os
import re
import sys
class BaseStringScript:
# State
STATE_SEARCHING='STATE_SEARCHING'
STATE_IN_STR='STATE_IN_STR'
STATE_IN_PLUR='STATE_IN_PLUR'
# Tag types
TYPE_STR='TYPE_STR'
TYPE_PLUR='TYPE_PLUR'
# String tag start/end
START_STR = '<string'
END_STR = '</string'
# ... | 24.72449 | 66 | 0.626083 |
import os
import re
import sys
class BaseStringScript:
STATE_SEARCHING='STATE_SEARCHING'
STATE_IN_STR='STATE_IN_STR'
STATE_IN_PLUR='STATE_IN_PLUR'
TYPE_STR='TYPE_STR'
TYPE_PLUR='TYPE_PLUR'
START_STR = '<string'
END_STR = '</string'
START_PLUR='<plurals'
END_PLUR = '</plurals'
def... | true | true |
7901dce134864cb1364aac3ebffdeef195dbae26 | 1,855 | py | Python | opencv/pycv_tutorial/color_space.py | OYukiya/PyIntroduction | 4e799cacb858823ee7fcae9e38e2279c88daa7a7 | [
"MIT"
] | 31 | 2017-07-12T08:21:30.000Z | 2021-05-20T04:07:32.000Z | opencv/pycv_tutorial/color_space.py | szkny/PyIntroduction | 433142b25de36552867b209649b17113ca2e11c6 | [
"MIT"
] | null | null | null | opencv/pycv_tutorial/color_space.py | szkny/PyIntroduction | 433142b25de36552867b209649b17113ca2e11c6 | [
"MIT"
] | 10 | 2017-01-24T23:34:35.000Z | 2021-04-25T11:55:31.000Z |
# -*- coding: utf-8 -*-
## @package pycv_tutorial.color_space
#
# 画像処理: 色空間の変換
# @author tody
# @date 2016/06/27
import cv2
import matplotlib.pyplot as plt
# RGB画像の表示
def showImageRGB(image_file):
image_bgr = cv2.imread(image_file)
image_rgb = cv2.cvtColor(image_bgr, cv2.COLOR_BGR2RGB)
plt... | 19.123711 | 58 | 0.60593 |
yplot as plt
def showImageRGB(image_file):
image_bgr = cv2.imread(image_file)
image_rgb = cv2.cvtColor(image_bgr, cv2.COLOR_BGR2RGB)
plt.title('RGB')
plt.imshow(image_rgb)
plt.axis('off')
plt.show()
def showImageGray(image_file):
image_gray = cv2.imread(image_file, 0)
plt.title('G... | true | true |
7901dd2dffe1d105536f36bbc2799fcafdabae8e | 3,493 | py | Python | scripts/sample_quests.py | JohnnySun8/TextWorld | 9a54e9d642f7605a0f3ebba3285cdd04047975e2 | [
"MIT"
] | 307 | 2019-05-07T01:51:55.000Z | 2022-03-31T19:35:47.000Z | scripts/sample_quests.py | JohnnySun8/TextWorld | 9a54e9d642f7605a0f3ebba3285cdd04047975e2 | [
"MIT"
] | 84 | 2019-05-08T14:24:36.000Z | 2022-03-31T14:35:16.000Z | scripts/sample_quests.py | JohnnySun8/TextWorld | 9a54e9d642f7605a0f3ebba3285cdd04047975e2 | [
"MIT"
] | 70 | 2019-05-21T21:36:56.000Z | 2022-02-28T12:04:27.000Z | #!/usr/bin/env python
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license.
import os
import argparse
from os.path import join as pjoin
import numpy as np
import networkx as nx
from textworld.render import visualize
from textworld.generator import Game
from textworld.generat... | 32.95283 | 107 | 0.658746 |
import os
import argparse
from os.path import join as pjoin
import numpy as np
import networkx as nx
from textworld.render import visualize
from textworld.generator import Game
from textworld.generator.inform7 import Inform7Game
from textworld.generator.chaining import ChainingOptions
from textworld.generator.c... | true | true |
7901dd5186e46232ff6fef91c7950bde9a4ca0c1 | 2,374 | py | Python | torch_cluster/fps.py | zuru/pytorch_cluster | 442e8d9c8cec0c7621966dc45f9f7dd151209044 | [
"MIT"
] | 522 | 2018-01-13T13:20:39.000Z | 2022-03-30T08:59:13.000Z | torch_cluster/fps.py | zuru/pytorch_cluster | 442e8d9c8cec0c7621966dc45f9f7dd151209044 | [
"MIT"
] | 116 | 2018-04-09T11:57:10.000Z | 2022-03-28T07:56:26.000Z | torch_cluster/fps.py | zuru/pytorch_cluster | 442e8d9c8cec0c7621966dc45f9f7dd151209044 | [
"MIT"
] | 104 | 2018-02-11T13:57:09.000Z | 2022-03-22T11:24:15.000Z | from typing import Optional
import torch
from torch import Tensor
@torch.jit._overload # noqa
def fps(src, batch=None, ratio=None, random_start=True): # noqa
# type: (Tensor, Optional[Tensor], Optional[float], bool) -> Tensor
pass # pragma: no cover
@torch.jit._overload # noqa
def fps(src, batch=None, ... | 33.43662 | 78 | 0.617102 | from typing import Optional
import torch
from torch import Tensor
@torch.jit._overload
def fps(src, batch=None, ratio=None, random_start=True):
pass
@torch.jit._overload
def fps(src, batch=None, ratio=None, random_start=True):
pass
def fps(src: torch.Tensor, batch=None, ratio=None, ... | true | true |
7901dde09c5e17fb0a0f128f94e07d7d1cde44cf | 2,899 | py | Python | vizier/api/client/cli/command.py | VizierDB/web-api-async | e99f43df3df80ad5647f57d805c339257336ac73 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2019-10-21T03:01:39.000Z | 2020-06-05T01:43:00.000Z | vizier/api/client/cli/command.py | VizierDB/web-api-async | e99f43df3df80ad5647f57d805c339257336ac73 | [
"ECL-2.0",
"Apache-2.0"
] | 56 | 2019-07-12T21:16:03.000Z | 2020-11-06T23:29:22.000Z | vizier/api/client/cli/command.py | VizierDB/web-api-async | e99f43df3df80ad5647f57d805c339257336ac73 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2020-02-07T19:56:55.000Z | 2020-08-07T11:17:51.000Z | # Copyright (C) 2017-2019 New York University,
# University at Buffalo,
# Illinois Institute of Technology.
#
# 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 th... | 32.943182 | 79 | 0.588134 |
from abc import abstractmethod
from typing import List
class Command(object):
@abstractmethod
def eval(self, tokens: List[str]) -> bool:
raise NotImplementedError()
@abstractmethod
def help(self) -> None:
raise NotImplementedError()
def output(self, rows):
... | true | true |
7901e0e13cad3880c17746b9aae87b01553ab090 | 33,981 | py | Python | mmedit/models/inpaintors/vic/common.py | f74066357/Image_Inpainting | 1c89cdadcf420633d29136c8bdcbd280f2546769 | [
"Apache-2.0"
] | null | null | null | mmedit/models/inpaintors/vic/common.py | f74066357/Image_Inpainting | 1c89cdadcf420633d29136c8bdcbd280f2546769 | [
"Apache-2.0"
] | null | null | null | mmedit/models/inpaintors/vic/common.py | f74066357/Image_Inpainting | 1c89cdadcf420633d29136c8bdcbd280f2546769 | [
"Apache-2.0"
] | 2 | 2021-09-07T05:21:18.000Z | 2021-09-17T22:34:54.000Z | """
BasicSR/codes/dataops/common.py (8-Nov-20)
https://github.com/victorca25/BasicSR/blob/dev2/codes/dataops/common.py
"""
import os
import math
import pickle
import random
import numpy as np
import torch
import cv2
import logging
import copy
from torchvision.utils import make_grid
#from dataops.colors import *
from... | 38.010067 | 184 | 0.613872 |
import os
import math
import pickle
import random
import numpy as np
import torch
import cv2
import logging
import copy
from torchvision.utils import make_grid
from .colors import *
NotImplementedError('data_type [{:s}] is not recognized.'.format(data_type))
return env, paths
g.shape[2] == 3 and out_nc == 4... | true | true |
7901e150a7ff46090793627452f856bd146bba06 | 21,927 | py | Python | pandas/core/construction.py | gabriellm1/pandas | 020040b3b92516b445ddd8daba3b9818340e82d4 | [
"BSD-3-Clause"
] | 1 | 2020-10-29T17:32:26.000Z | 2020-10-29T17:32:26.000Z | pandas/core/construction.py | gabriellm1/pandas | 020040b3b92516b445ddd8daba3b9818340e82d4 | [
"BSD-3-Clause"
] | null | null | null | pandas/core/construction.py | gabriellm1/pandas | 020040b3b92516b445ddd8daba3b9818340e82d4 | [
"BSD-3-Clause"
] | 1 | 2022-03-08T15:07:11.000Z | 2022-03-08T15:07:11.000Z | """
Constructor functions intended to be shared by pd.array, Series.__init__,
and Index.__new__.
These should not depend on core.internals.
"""
from __future__ import annotations
from collections import abc
from typing import TYPE_CHECKING, Any, Optional, Sequence, Union, cast
import numpy as np
import numpy.ma as m... | 33.578867 | 88 | 0.626123 | from __future__ import annotations
from collections import abc
from typing import TYPE_CHECKING, Any, Optional, Sequence, Union, cast
import numpy as np
import numpy.ma as ma
from pandas._libs import lib
from pandas._libs.tslibs import IncompatibleFrequency, OutOfBoundsDatetime
from pandas._typing import AnyArrayLik... | true | true |
7901e1b6faf4a2c2a57f79c8da7a355cdd49b556 | 10,176 | py | Python | test/api_gw_test.py | fredliporace/cbers-2-stac | c92924b19289e0896ee676064250f9c8a758b674 | [
"Apache-2.0"
] | 11 | 2018-08-18T04:47:58.000Z | 2021-12-10T18:12:30.000Z | test/api_gw_test.py | fredliporace/cbers-2-stac | c92924b19289e0896ee676064250f9c8a758b674 | [
"Apache-2.0"
] | 71 | 2018-06-07T14:29:58.000Z | 2022-03-03T14:38:14.000Z | test/api_gw_test.py | fredliporace/cbers-2-stac | c92924b19289e0896ee676064250f9c8a758b674 | [
"Apache-2.0"
] | 1 | 2020-08-09T03:57:16.000Z | 2020-08-09T03:57:16.000Z | """api_gw_test"""
# Remove warnings when using pytest fixtures
# pylint: disable=redefined-outer-name
import json
from test.conftest import ENDPOINT_URL
# warning disabled, this is used as a pylint fixture
from test.elasticsearch_test import ( # pylint: disable=unused-import
es_client,
populate_es_test_case... | 30.376119 | 113 | 0.622445 |
import json
from test.conftest import ENDPOINT_URL
from test.elasticsearch_test import (
es_client,
populate_es_test_case_1,
)
from urllib.parse import urlencode
import boto3
import pytest
import requests
def to_localstack_url(api_id: str, url: str):
return url.replace("4566", f"4566/restapis/{ap... | true | true |
7901e1c5f397246379f72ceab53eea570b7b21af | 3,647 | py | Python | fastai/callback/neptune.py | PalaashAgrawal/fastai | 6148ff303d9b8a7fa8730ec01e81820af0515be3 | [
"Apache-2.0"
] | 23,140 | 2017-09-09T18:23:40.000Z | 2022-03-31T11:49:36.000Z | fastai/callback/neptune.py | PalaashAgrawal/fastai | 6148ff303d9b8a7fa8730ec01e81820af0515be3 | [
"Apache-2.0"
] | 3,077 | 2017-09-16T07:08:31.000Z | 2022-03-31T20:14:16.000Z | fastai/callback/neptune.py | PalaashAgrawal/fastai | 6148ff303d9b8a7fa8730ec01e81820af0515be3 | [
"Apache-2.0"
] | 8,740 | 2017-09-11T02:19:40.000Z | 2022-03-31T11:29:18.000Z | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/72_callback.neptune.ipynb (unless otherwise specified).
__all__ = ['NeptuneCallback']
# Cell
import tempfile
from ..basics import *
from ..learner import Callback
# Cell
import neptune
# Cell
class NeptuneCallback(Callback):
"Log losses, metrics, model weights, mo... | 46.75641 | 126 | 0.639155 |
__all__ = ['NeptuneCallback']
import tempfile
from ..basics import *
from ..learner import Callback
import neptune
class NeptuneCallback(Callback):
order = Recorder.order+1
def __init__(self, log_model_weights=True, keep_experiment_running=False):
self.log_model_weights = log_model_weights
... | true | true |
7901e25f00983d62b794779f94b90fceddb8c4ec | 3,226 | py | Python | test.py | tangku006/cnn-text-classification-tf-master | 510a39d2726a23b0b94a5e6f4fc83014b0e0fa30 | [
"Apache-2.0"
] | null | null | null | test.py | tangku006/cnn-text-classification-tf-master | 510a39d2726a23b0b94a5e6f4fc83014b0e0fa30 | [
"Apache-2.0"
] | null | null | null | test.py | tangku006/cnn-text-classification-tf-master | 510a39d2726a23b0b94a5e6f4fc83014b0e0fa30 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
import tensorflow as tf
import numpy as np
import os
import time
import datetime
import data_helpers
from text_cnn import TextCNN
from tensorflow.contrib import learn
# Parameters
# ==================================================
# Data loading params 语料文件路径定义
tf.flags.DEFINE... | 42.447368 | 125 | 0.725976 |
import tensorflow as tf
import numpy as np
import os
import time
import datetime
import data_helpers
from text_cnn import TextCNN
from tensorflow.contrib import learn
tf.flags.DEFINE_float("dev_sample_percentage", .1, "Percentage of the training data to use for validation")
tf.flags.DEFINE_string("po... | true | true |
7901e3292be28204f718d38f7f0373aaa955271b | 572 | py | Python | Session1_2018/coinChange.py | vedantc6/LCode | 43aec4da9cc22ef43e877a16dbee380b98d9089f | [
"MIT"
] | 1 | 2018-09-21T10:51:15.000Z | 2018-09-21T10:51:15.000Z | Session1_2018/coinChange.py | vedantc6/LCode | 43aec4da9cc22ef43e877a16dbee380b98d9089f | [
"MIT"
] | null | null | null | Session1_2018/coinChange.py | vedantc6/LCode | 43aec4da9cc22ef43e877a16dbee380b98d9089f | [
"MIT"
] | null | null | null | class Solution:
def coinChange(self, coins, amount):
"""
:type coins: List[int]
:type amount: int
:rtype: int
"""
# max value taken as amount+1 because in worst case, it can be amount - when denoms of only 1
res = [amount+1]*(amount+1)
res[0] = 0
... | 27.238095 | 101 | 0.461538 | class Solution:
def coinChange(self, coins, amount):
res = [amount+1]*(amount+1)
res[0] = 0
for i in range(1, amount+1):
for j in coins:
if j <= i:
res[i] = min(res[i], res[i-j] + 1)
if res[amount] > amount:
return -1
... | true | true |
7901e4b7f0c9a43f1cbd6ffb932d2b71f1d325e0 | 1,194 | py | Python | cracking-code-interview/chapter_03/3-3_stack_of_plates.py | italo-batista/problems-solving | f83ad34f0abebd52925c4020635556f20743ba06 | [
"MIT"
] | null | null | null | cracking-code-interview/chapter_03/3-3_stack_of_plates.py | italo-batista/problems-solving | f83ad34f0abebd52925c4020635556f20743ba06 | [
"MIT"
] | null | null | null | cracking-code-interview/chapter_03/3-3_stack_of_plates.py | italo-batista/problems-solving | f83ad34f0abebd52925c4020635556f20743ba06 | [
"MIT"
] | null | null | null | import sys
sys.path.append('./datastructures')
from datastructures import Stack, StackNode
class SetOfStacks:
LIMIT_PER_STACK = 2
def __init__(self):
self.main_stack = Stack()
def pop(self):
if self.is_empty():
return None
elif self._top_stack().is_empty():
... | 20.586207 | 45 | 0.600503 | import sys
sys.path.append('./datastructures')
from datastructures import Stack, StackNode
class SetOfStacks:
LIMIT_PER_STACK = 2
def __init__(self):
self.main_stack = Stack()
def pop(self):
if self.is_empty():
return None
elif self._top_stack().is_empty():
... | true | true |
7901e4cdbc5cbcad0949ab16d8975c98613f9659 | 785 | py | Python | pyp/wxrobot-master/config.py | ChriXChan/tools | 5c989d71d8ef621a9c36f3c0c92951ab59f01548 | [
"MIT"
] | null | null | null | pyp/wxrobot-master/config.py | ChriXChan/tools | 5c989d71d8ef621a9c36f3c0c92951ab59f01548 | [
"MIT"
] | null | null | null | pyp/wxrobot-master/config.py | ChriXChan/tools | 5c989d71d8ef621a9c36f3c0c92951ab59f01548 | [
"MIT"
] | null | null | null | """项目配置"""
# 图灵机器人,99元一月付费版,尽情享用!
tuling_api_key = '88f17f853d974387af64955bed9466f4'
# 自动回复
is_friend_auto_reply = False # 好友自动回复
is_group_reply = False # 此项表示群中是否回复
is_group_at_reply = False # 上一项开启后此项才生效
is_forward_revoke_msg = True # 开启防撤回模式
is_forward_group_at_msg = False # 转发群@我的消息
# 机器人主人
bot_master_name... | 25.322581 | 79 | 0.782166 |
tuling_api_key = '88f17f853d974387af64955bed9466f4'
is_friend_auto_reply = False
is_group_reply = False
is_group_at_reply = False
is_forward_revoke_msg = True
is_forward_group_at_msg = False
bot_master_name = ''
is_listen_friend = False
listen_friend_names = '猪哥'
listen_friend_groups = 'Python新手交流... | true | true |
7901e5694b45feb02e1544ec860de25f4dc1e15a | 32,665 | py | Python | mtools/util/logevent.py | sindbach/mtools | e65ce879cbcd6b7795ff6fd29e26a6d3b42a6c82 | [
"Apache-2.0"
] | null | null | null | mtools/util/logevent.py | sindbach/mtools | e65ce879cbcd6b7795ff6fd29e26a6d3b42a6c82 | [
"Apache-2.0"
] | 1 | 2018-04-17T05:37:29.000Z | 2018-04-17T05:37:29.000Z | mtools/util/logevent.py | sindbach/mtools | e65ce879cbcd6b7795ff6fd29e26a6d3b42a6c82 | [
"Apache-2.0"
] | null | null | null | #!/bin/python
import json
import re
import sys
from datetime import datetime
import dateutil.parser
from dateutil.tz import tzutc
from six.moves import range
from mtools.util.pattern import json2pattern
class DateTimeEncoder(json.JSONEncoder):
"""Custom datetime encoder for json output."""
def default(se... | 36.661055 | 125 | 0.54015 |
import json
import re
import sys
from datetime import datetime
import dateutil.parser
from dateutil.tz import tzutc
from six.moves import range
from mtools.util.pattern import json2pattern
class DateTimeEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, datetime):
retu... | true | true |
7901e5a0cbbea36c770fee5295b4b112fcac68f8 | 222,664 | py | Python | mesonbuild/interpreter.py | tolnaisz/meson | 37bade6f8760a4e443a8daddbcf6acd4e84b5eab | [
"Apache-2.0"
] | null | null | null | mesonbuild/interpreter.py | tolnaisz/meson | 37bade6f8760a4e443a8daddbcf6acd4e84b5eab | [
"Apache-2.0"
] | null | null | null | mesonbuild/interpreter.py | tolnaisz/meson | 37bade6f8760a4e443a8daddbcf6acd4e84b5eab | [
"Apache-2.0"
] | null | null | null | # Copyright 2012-2019 The Meson development team
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed... | 46.847044 | 197 | 0.609497 |
from . import mparser
from . import environment
from . import coredata
from . import dependencies
from . import mlog
from . import build
from . import optinterpreter
from . import compilers
from .wrap import wrap, WrapMode
from . import mesonlib
from .mesonlib import FileMode, MachineChoice, Popen_safe, li... | true | true |
7901e5ad83ca521c9c99a63ba0f973da0c734978 | 2,072 | py | Python | bumblebee/connections/urls.py | sthasam2/bumblebee-backend | 22057399f34cdc1edb0ef04e622c97df46532de3 | [
"Linux-OpenIB"
] | null | null | null | bumblebee/connections/urls.py | sthasam2/bumblebee-backend | 22057399f34cdc1edb0ef04e622c97df46532de3 | [
"Linux-OpenIB"
] | null | null | null | bumblebee/connections/urls.py | sthasam2/bumblebee-backend | 22057399f34cdc1edb0ef04e622c97df46532de3 | [
"Linux-OpenIB"
] | null | null | null | """
comment-crud
comment-list
comment-detail
"""
from django.urls import path
from bumblebee.connections.api.views.connection_views import (
AcceptFollowRequestView,
BlockUnblockView,
DeleteFollowerView,
DeleteFollowRequestView,
FollowUnfollowRequestUnrequestView,
MuteUnmuteView,
RetrieveB... | 23.280899 | 62 | 0.617761 |
from django.urls import path
from bumblebee.connections.api.views.connection_views import (
AcceptFollowRequestView,
BlockUnblockView,
DeleteFollowerView,
DeleteFollowRequestView,
FollowUnfollowRequestUnrequestView,
MuteUnmuteView,
RetrieveBlockedIDListView,
RetrieveConnectionListView,... | true | true |
7901e623cc885f2b3b8f8a9feec81785c4fda428 | 3,975 | py | Python | src/secondaires/navigation/equipage/volontes/tenir_gouvernail.py | stormi/tsunami | bdc853229834b52b2ee8ed54a3161a1a3133d926 | [
"BSD-3-Clause"
] | null | null | null | src/secondaires/navigation/equipage/volontes/tenir_gouvernail.py | stormi/tsunami | bdc853229834b52b2ee8ed54a3161a1a3133d926 | [
"BSD-3-Clause"
] | null | null | null | src/secondaires/navigation/equipage/volontes/tenir_gouvernail.py | stormi/tsunami | bdc853229834b52b2ee8ed54a3161a1a3133d926 | [
"BSD-3-Clause"
] | null | null | null | # -*-coding:Utf-8 -*
# Copyright (c) 2013 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# lis... | 37.857143 | 79 | 0.686289 |
import re
from secondaires.navigation.equipage.ordres.tenir_gouvernail import \
TenirGouvernail as OrdreTenirGouvernail
from secondaires.navigation.equipage.ordres.long_deplacer import LongDeplacer
from secondaires.navigation.equipage.volonte import Volonte
class TenirGouvernail... | true | true |
7901e656363d5b25cd254636df77374db1493797 | 1,826 | py | Python | Aula18/rev3.py | marcelabbc07/TrabalhosPython | 91734d13110e4dee12a532dfd7091e36394a6449 | [
"MIT"
] | null | null | null | Aula18/rev3.py | marcelabbc07/TrabalhosPython | 91734d13110e4dee12a532dfd7091e36394a6449 | [
"MIT"
] | null | null | null | Aula18/rev3.py | marcelabbc07/TrabalhosPython | 91734d13110e4dee12a532dfd7091e36394a6449 | [
"MIT"
] | null | null | null | # A lista a seguir possui mais uma lista interna, a lista de preços.
# A lista de preços possui 3 sublistas dentro dela com os preços dos produtos.
# para exemplificar, o preço do mamão é de 10.00 - alface crespa é de 2.99 e o feijão 9.0
# Será solicitado o preço de alguns produtos. para imprimir deve ser por f-string ... | 40.577778 | 114 | 0.637459 |
lista = [['frutas','verduras','legumes','preço'],
['mamão','abacaxi','laranja','uva','pera','maçã','vergamota'],
['alface crespa', 'alface lisa','rucula','almerão','repolho','salsinha',],
['feijão', 'erviha', 'lentilha','vagem','feijão branco','gão de bico','soja'],
... | true | true |
7901e6ac29a993642ab10b26b7f8d1f1b51240a1 | 263 | py | Python | trader/joins/admin.py | volkandkaya/trader | e5013e97a29528e7c0280eeac632a65e4fe0a8af | [
"MIT"
] | null | null | null | trader/joins/admin.py | volkandkaya/trader | e5013e97a29528e7c0280eeac632a65e4fe0a8af | [
"MIT"
] | null | null | null | trader/joins/admin.py | volkandkaya/trader | e5013e97a29528e7c0280eeac632a65e4fe0a8af | [
"MIT"
] | null | null | null | from django.contrib import admin
# Register your models here.
from .models import Join
class JoinAdmin(admin.ModelAdmin):
list_display = ['email', 'friend', 'timestamp', 'updated']
class Meta:
model = Join
admin.site.register(Join, JoinAdmin)
| 20.230769 | 62 | 0.707224 | from django.contrib import admin
from .models import Join
class JoinAdmin(admin.ModelAdmin):
list_display = ['email', 'friend', 'timestamp', 'updated']
class Meta:
model = Join
admin.site.register(Join, JoinAdmin)
| true | true |
7901e761d9f518c04e6a5296199f880c8a1b263f | 66,327 | py | Python | numba/core/pythonapi.py | blair1306/numba | 3b9647d17d653abac15363da604eeb804dbdd15a | [
"BSD-2-Clause"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | numba/core/pythonapi.py | blair1306/numba | 3b9647d17d653abac15363da604eeb804dbdd15a | [
"BSD-2-Clause"
] | 11 | 2020-08-09T02:30:14.000Z | 2022-03-12T00:50:14.000Z | numba/core/pythonapi.py | blair1306/numba | 3b9647d17d653abac15363da604eeb804dbdd15a | [
"BSD-2-Clause"
] | 11 | 2020-07-12T16:18:07.000Z | 2022-02-05T16:48:35.000Z | from collections import namedtuple
import contextlib
import pickle
import hashlib
from llvmlite import ir
from llvmlite.llvmpy.core import Type, Constant
import llvmlite.llvmpy.core as lc
import ctypes
from numba import _helperlib
from numba.core import (
types, utils, config, lowering, cgutils, imputils, seriali... | 40.028365 | 93 | 0.614591 | from collections import namedtuple
import contextlib
import pickle
import hashlib
from llvmlite import ir
from llvmlite.llvmpy.core import Type, Constant
import llvmlite.llvmpy.core as lc
import ctypes
from numba import _helperlib
from numba.core import (
types, utils, config, lowering, cgutils, imputils, seriali... | true | true |
7901e8af03dd49d8f1599fc5c8694eb98d8de135 | 123,288 | py | Python | arelle/plugin/loadFromExcel.py | CapoeiraShaolin1/Arelle | 260fde1cfc99be690ce9ea6853e05884dcfd2594 | [
"Apache-2.0"
] | 1 | 2021-07-01T17:52:12.000Z | 2021-07-01T17:52:12.000Z | arelle/plugin/loadFromExcel.py | themrinalsinha/Arelle | f4a3c55846253c02c25db2280cf27292f1cf96c1 | [
"Apache-2.0"
] | 3 | 2021-01-07T23:36:40.000Z | 2021-12-13T20:43:27.000Z | arelle/plugin/loadFromExcel.py | themrinalsinha/Arelle | f4a3c55846253c02c25db2280cf27292f1cf96c1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
loadFromExcel.py is an example of a plug-in that will load an extension taxonomy from Excel
input and optionally save an (extension) DTS.
(c) Copyright 2013 Mark V Systems Limited, All rights reserved.
'''
import os, io, sys, time, re, traceback, json, posixpath
from fnmatch import fnmatch... | 61.984917 | 187 | 0.503301 |
import os, io, sys, time, re, traceback, json, posixpath
from fnmatch import fnmatch
from collections import defaultdict, OrderedDict
from arelle import PythonUtil, XbrlConst, ModelDocument, UrlUtil
from arelle.PythonUtil import OrderedDefaultDict, OrderedSet
from arelle.ModelDocument import Type, create as createMod... | true | true |
7901e9e62fed81e76333d88028ff97cf25b274f1 | 25,423 | py | Python | tests/test_queryset.py | spacemanspiff2007/tortoise-orm | 2591bd1cae75236779c21be559bf191fcc41ffe2 | [
"Apache-2.0"
] | null | null | null | tests/test_queryset.py | spacemanspiff2007/tortoise-orm | 2591bd1cae75236779c21be559bf191fcc41ffe2 | [
"Apache-2.0"
] | null | null | null | tests/test_queryset.py | spacemanspiff2007/tortoise-orm | 2591bd1cae75236779c21be559bf191fcc41ffe2 | [
"Apache-2.0"
] | null | null | null | from tests.testmodels import Event, IntFields, MinRelation, Node, Reporter, Team, Tournament, Tree
from tortoise import Tortoise
from tortoise.contrib import test
from tortoise.exceptions import (
DoesNotExist,
FieldError,
IntegrityError,
MultipleObjectsReturned,
ParamsError,
)
from tortoise.express... | 40.353968 | 100 | 0.619911 | from tests.testmodels import Event, IntFields, MinRelation, Node, Reporter, Team, Tournament, Tree
from tortoise import Tortoise
from tortoise.contrib import test
from tortoise.exceptions import (
DoesNotExist,
FieldError,
IntegrityError,
MultipleObjectsReturned,
ParamsError,
)
from tortoise.express... | true | true |
7901ea333d5165e5889b2bbfea30ba4301065462 | 33 | py | Python | app/api/rates/__init__.py | erkandem/rates_app | d7f8eaf9aeb606edb14f8e6766fe644319191037 | [
"MIT"
] | null | null | null | app/api/rates/__init__.py | erkandem/rates_app | d7f8eaf9aeb606edb14f8e6766fe644319191037 | [
"MIT"
] | null | null | null | app/api/rates/__init__.py | erkandem/rates_app | d7f8eaf9aeb606edb14f8e6766fe644319191037 | [
"MIT"
] | null | null | null | from .euro import api as euro_ns
| 16.5 | 32 | 0.787879 | from .euro import api as euro_ns
| true | true |
7901ea9f970a56936e3d9a1d4eaa2dfca3a7c203 | 9,906 | py | Python | _ext.py | cyco/osgameclones | 7c11e8128f14efb182fe2d391d5ccb91bd55082c | [
"CC-BY-4.0",
"MIT"
] | null | null | null | _ext.py | cyco/osgameclones | 7c11e8128f14efb182fe2d391d5ccb91bd55082c | [
"CC-BY-4.0",
"MIT"
] | null | null | null | _ext.py | cyco/osgameclones | 7c11e8128f14efb182fe2d391d5ccb91bd55082c | [
"CC-BY-4.0",
"MIT"
] | null | null | null | import copy
import sys
import pprint
import os, os.path as op
from datetime import date, datetime, timedelta
from collections import OrderedDict
from functools import partial
from urllib.parse import urlparse
import yaml
from natsort import natsorted, ns
from pykwalify.core import Core
def abort(msg):
sys.stderr... | 32.058252 | 259 | 0.569352 | import copy
import sys
import pprint
import os, os.path as op
from datetime import date, datetime, timedelta
from collections import OrderedDict
from functools import partial
from urllib.parse import urlparse
import yaml
from natsort import natsorted, ns
from pykwalify.core import Core
def abort(msg):
sys.stderr... | true | true |
7901eb0fa2d34276c12c21fe340944d342e953ee | 12,417 | py | Python | lithops/job/job.py | pablogs98/lithops | ab73af96d168b17594477d36195c652ec58199da | [
"Apache-2.0"
] | null | null | null | lithops/job/job.py | pablogs98/lithops | ab73af96d168b17594477d36195c652ec58199da | [
"Apache-2.0"
] | null | null | null | lithops/job/job.py | pablogs98/lithops | ab73af96d168b17594477d36195c652ec58199da | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2018 PyWren Team
# (C) Copyright IBM Corp. 2020
# (C) Copyright Cloudlab URV 2020
#
# 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-... | 41.115894 | 108 | 0.67464 |
import time
import pickle
import logging
from lithops import utils
from lithops.job.partitioner import create_partitions
from lithops.utils import is_object_processing_function, sizeof_fmt
from lithops.storage.utils import create_func_key, create_agg_data_key
from lithops.job.serialize import Seriali... | true | true |
7901eb0fc2ac903ef84d28f8fdfcc366ca81912e | 811 | py | Python | Code/word_jumble.py | Nyapal/CS1.3 | 2e10953bd141d02694ac90e50c0af3f40f8c0924 | [
"MIT"
] | null | null | null | Code/word_jumble.py | Nyapal/CS1.3 | 2e10953bd141d02694ac90e50c0af3f40f8c0924 | [
"MIT"
] | 4 | 2020-02-18T00:09:46.000Z | 2020-03-10T21:05:48.000Z | Code/word_jumble.py | Nyapal/CS1.3 | 2e10953bd141d02694ac90e50c0af3f40f8c0924 | [
"MIT"
] | null | null | null | class Jumble(object):
def __init__(self):
self.dict = self.make_dict()
def make_dict(self):
dic = {}
f = open('/usr/share/dict/words', 'r')
for word in f:
word = word.strip().lower()
sort = ''.join(sorted(word))
dic[sort] = word
return dic
def unjumble(self, lst):
for ... | 26.16129 | 49 | 0.59926 | class Jumble(object):
def __init__(self):
self.dict = self.make_dict()
def make_dict(self):
dic = {}
f = open('/usr/share/dict/words', 'r')
for word in f:
word = word.strip().lower()
sort = ''.join(sorted(word))
dic[sort] = word
return dic
def unjumble(self, lst):
for ... | true | true |
7901eb4e813bc62439b385f6f317294cffa84a67 | 3,862 | py | Python | env/Lib/site-packages/sqlalchemy/dialects/oracle/provision.py | aammjian/cotton | f72b814f795f79a4054688e465c8b0ae5560f3b7 | [
"Apache-2.0"
] | 5,079 | 2015-01-01T03:39:46.000Z | 2022-03-31T07:38:22.000Z | env/Lib/site-packages/sqlalchemy/dialects/oracle/provision.py | aammjian/cotton | f72b814f795f79a4054688e465c8b0ae5560f3b7 | [
"Apache-2.0"
] | 1,623 | 2015-01-01T08:06:24.000Z | 2022-03-30T19:48:52.000Z | env/Lib/site-packages/sqlalchemy/dialects/oracle/provision.py | aammjian/cotton | f72b814f795f79a4054688e465c8b0ae5560f3b7 | [
"Apache-2.0"
] | 2,033 | 2015-01-04T07:18:02.000Z | 2022-03-28T19:55:47.000Z | from ... import create_engine
from ... import exc
from ...engine import url as sa_url
from ...testing.provision import configure_follower
from ...testing.provision import create_db
from ...testing.provision import drop_db
from ...testing.provision import follower_url_from_main
from ...testing.provision import log
from ... | 34.792793 | 78 | 0.651217 | from ... import create_engine
from ... import exc
from ...engine import url as sa_url
from ...testing.provision import configure_follower
from ...testing.provision import create_db
from ...testing.provision import drop_db
from ...testing.provision import follower_url_from_main
from ...testing.provision import log
from ... | true | true |
7901ec460b66a712ed8b79d133890a9061c52085 | 4,337 | py | Python | spiders/a55_crawl.py | senlyu163/crawler | ecf95f7b356c726922b5e5d90000fda3e16ae90d | [
"Apache-2.0"
] | null | null | null | spiders/a55_crawl.py | senlyu163/crawler | ecf95f7b356c726922b5e5d90000fda3e16ae90d | [
"Apache-2.0"
] | null | null | null | spiders/a55_crawl.py | senlyu163/crawler | ecf95f7b356c726922b5e5d90000fda3e16ae90d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import scrapy
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import CrawlSpider, Rule
from scrapy_splash import SplashRequest
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import sys
from ..utils import extract_CN_from_content
from .... | 41.701923 | 121 | 0.572516 |
import scrapy
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import CrawlSpider, Rule
from scrapy_splash import SplashRequest
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import sys
from ..utils import extract_CN_from_content
from ..items import ScrapySpi... | true | true |
7901ecb76b0a2b423dce5989be647783db851010 | 751 | py | Python | threathunter_common_python/test/testphone.py | threathunterX/python_lib | e2d4052de04c82cb7bccd08042f28db824cab442 | [
"Apache-2.0"
] | 2 | 2019-03-17T04:03:08.000Z | 2019-05-01T09:42:23.000Z | threathunter_common_python/test/testphone.py | threathunterX/python_lib | e2d4052de04c82cb7bccd08042f28db824cab442 | [
"Apache-2.0"
] | null | null | null | threathunter_common_python/test/testphone.py | threathunterX/python_lib | e2d4052de04c82cb7bccd08042f28db824cab442 | [
"Apache-2.0"
] | 4 | 2019-06-24T05:47:24.000Z | 2020-09-29T05:00:31.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from threathunter_common.geo.phonelocator import *
__author__ = "nebula"
def test_phone():
print check_phone_number("+13482345020", None)
assert check_phone_number("13482345020", 'CN')
assert not check_phone_number("+134823450", None)
print get_carrier("... | 24.225806 | 53 | 0.679095 |
from threathunter_common.geo.phonelocator import *
__author__ = "nebula"
def test_phone():
print check_phone_number("+13482345020", None)
assert check_phone_number("13482345020", 'CN')
assert not check_phone_number("+134823450", None)
print get_carrier("13482121123", 'CN')
print get_carrier("1... | false | true |
7901ee355af4c47981a157ca6ec9680464390f97 | 11,439 | py | Python | Task2/Client_dev.py | Aiemu/CourseCN-Proj-RTP | 3cac199dcada9c96eaeb2f28fbfbe1b55d6bd02c | [
"MIT"
] | null | null | null | Task2/Client_dev.py | Aiemu/CourseCN-Proj-RTP | 3cac199dcada9c96eaeb2f28fbfbe1b55d6bd02c | [
"MIT"
] | null | null | null | Task2/Client_dev.py | Aiemu/CourseCN-Proj-RTP | 3cac199dcada9c96eaeb2f28fbfbe1b55d6bd02c | [
"MIT"
] | null | null | null | import socket, threading, sys, traceback, os, tkinter
from ui import Ui_MainWindow
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5 import QtCore, QtGui, QtWidgets
from tkinter import *
from PIL import Image, ImageTk
from tkinter import messagebox, Tk
from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_I... | 38.13 | 148 | 0.559577 | import socket, threading, sys, traceback, os, tkinter
from ui import Ui_MainWindow
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5 import QtCore, QtGui, QtWidgets
from tkinter import *
from PIL import Image, ImageTk
from tkinter import messagebox, Tk
from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_I... | true | true |
7901ef919420395bd2c98b4da2de6f7d45324374 | 4,958 | py | Python | modules/ptboard/__init__.py | iigxdehuli/PT-help-server | 2bc76564116e1135b2efcc02595310e7b8c6047d | [
"MIT"
] | 155 | 2018-01-13T12:05:06.000Z | 2022-02-25T08:04:24.000Z | modules/ptboard/__init__.py | iigxdehuli/PT-help-server | 2bc76564116e1135b2efcc02595310e7b8c6047d | [
"MIT"
] | 23 | 2018-01-10T09:06:36.000Z | 2020-09-22T00:35:42.000Z | modules/ptboard/__init__.py | iigxdehuli/PT-help-server | 2bc76564116e1135b2efcc02595310e7b8c6047d | [
"MIT"
] | 100 | 2018-01-08T10:43:30.000Z | 2021-12-24T06:24:47.000Z | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# Copyright (c) 2017-2020 Rhilip <rhilipruan@gmail.com>
import re
import time
from flask import Blueprint, request, jsonify
from app import mysql, app, cache
from pymysql import escape_string
ptboard_blueprint = Blueprint('ptboard', __name__)
search_default = app.config.get... | 35.669065 | 114 | 0.656313 |
import re
import time
from flask import Blueprint, request, jsonify
from app import mysql, app, cache
from pymysql import escape_string
ptboard_blueprint = Blueprint('ptboard', __name__)
search_default = app.config.get("PTBOARD_SEARCH", "")
site_default = app.config.get("PTBOARD_SITE", "")
no_site_default = app.c... | true | true |
7901efaec7f53f1176ace988ca5c872964685c57 | 12,058 | py | Python | sdks/python/client/argo_workflows/model/lifecycle_handler.py | BearerPipelineTest/argo-workflows | ecd91b1c4215a2ab8742f7c43eaade98a1d47eba | [
"Apache-2.0"
] | 1 | 2022-02-24T01:45:03.000Z | 2022-02-24T01:45:03.000Z | sdks/python/client/argo_workflows/model/lifecycle_handler.py | BearerPipelineTest/argo-workflows | ecd91b1c4215a2ab8742f7c43eaade98a1d47eba | [
"Apache-2.0"
] | 18 | 2022-02-01T23:09:58.000Z | 2022-03-31T23:28:41.000Z | sdks/python/client/argo_workflows/model/lifecycle_handler.py | BearerPipelineTest/argo-workflows | ecd91b1c4215a2ab8742f7c43eaade98a1d47eba | [
"Apache-2.0"
] | null | null | null | """
Argo Workflows API
Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/ # noqa: E501
The version of the OpenAPI document: VERSION
Generated by: https://openapi-g... | 44.007299 | 206 | 0.579366 |
import re
import sys
from argo_workflows.model_utils import (
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
)
fro... | true | true |
7901f032a000f62e27cc566898a31918f4a99544 | 3,111 | py | Python | ETL-data-with-postgres/etl.py | cdiswine/data-engineering-nanodegree | a5895e3ba2f94128a16b9da6d07327451bacb173 | [
"MIT"
] | null | null | null | ETL-data-with-postgres/etl.py | cdiswine/data-engineering-nanodegree | a5895e3ba2f94128a16b9da6d07327451bacb173 | [
"MIT"
] | null | null | null | ETL-data-with-postgres/etl.py | cdiswine/data-engineering-nanodegree | a5895e3ba2f94128a16b9da6d07327451bacb173 | [
"MIT"
] | null | null | null | import os
import glob
import psycopg2
import pandas as pd
import numpy as np
from sql_queries import *
def process_song_file(cur, filepath):
# open song file
df = pd.read_json(filepath, lines = True)
# insert song record
song_data = df[["song_id", "title", "artist_id", "year", "duration"]].values[0]
... | 32.40625 | 119 | 0.641916 | import os
import glob
import psycopg2
import pandas as pd
import numpy as np
from sql_queries import *
def process_song_file(cur, filepath):
df = pd.read_json(filepath, lines = True)
song_data = df[["song_id", "title", "artist_id", "year", "duration"]].values[0]
cur.execute(song_table_insert, s... | true | true |
7901f082786cfa18d39230194f4199dad5d96bce | 2,100 | py | Python | spider.py | yeonzi/163course_spider | 238731f55320e885ea5300059b82e347e48b8845 | [
"MIT"
] | null | null | null | spider.py | yeonzi/163course_spider | 238731f55320e885ea5300059b82e347e48b8845 | [
"MIT"
] | null | null | null | spider.py | yeonzi/163course_spider | 238731f55320e885ea5300059b82e347e48b8845 | [
"MIT"
] | null | null | null | #!/usr/bin/python
#coding:utf-8
import time
import json
import requests
from selenium import webdriver
filename = 'a.csv'
url = 'http://www.icourse163.org/university/view/all.htm#/'
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0', 'Accept': 'text/html,applicat... | 32.307692 | 183 | 0.645714 |
import time
import json
import requests
from selenium import webdriver
filename = 'a.csv'
url = 'http://www.icourse163.org/university/view/all.htm#/'
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0', 'Accept': 'text/html,application/xhtml+xml,application/xml;... | true | true |
7901f195922865b42cc3498967ba347cca40919e | 5,086 | py | Python | openstack/message/v2/queue.py | allenLew1991/openstacksdk | 445a5491db0d701bf1e01290014abcd38a11a41a | [
"Apache-2.0"
] | null | null | null | openstack/message/v2/queue.py | allenLew1991/openstacksdk | 445a5491db0d701bf1e01290014abcd38a11a41a | [
"Apache-2.0"
] | null | null | null | openstack/message/v2/queue.py | allenLew1991/openstacksdk | 445a5491db0d701bf1e01290014abcd38a11a41a | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 38.240602 | 78 | 0.624853 |
import uuid
from openstack import resource
class Queue(resource.Resource):
location = resource.Header("location")
resources_key = "queues"
base_path = "/queues"
allow_create = True
allow_list = True
allow_fetch = True
allow_delete = True
... | true | true |
7901f32508d570308256e3c16671ca7e2216c254 | 443 | py | Python | src/ambianic/device.py | ivelin/ambianic-edge | a0cbb2a2369024735ea896b15b93d3d50d58cac1 | [
"Apache-2.0"
] | 95 | 2019-12-12T02:20:40.000Z | 2022-03-30T18:23:52.000Z | src/ambianic/device.py | ambianic/ambianic | cad14a3ae8a2149c9e17e1bd41ee7d1b75568271 | [
"Apache-2.0"
] | 313 | 2019-11-04T21:31:26.000Z | 2022-01-01T11:00:38.000Z | src/ambianic/device.py | ambianic/ambianic | cad14a3ae8a2149c9e17e1bd41ee7d1b75568271 | [
"Apache-2.0"
] | 49 | 2020-02-28T22:09:36.000Z | 2022-03-23T03:26:33.000Z | """Base classes for an Ambianic Edge device abstraction"""
from pydantic import BaseModel, Field
class DeviceInfo(BaseModel):
version: str = Field(None, description="Ambianic Edge software version.")
display_name: str = Field(
None, description="User friendly display name for this device."
)
n... | 34.076923 | 80 | 0.722348 | from pydantic import BaseModel, Field
class DeviceInfo(BaseModel):
version: str = Field(None, description="Ambianic Edge software version.")
display_name: str = Field(
None, description="User friendly display name for this device."
)
notifications_enabled: bool = Field(
False, descript... | true | true |
7901f3b4ea1cec4c15b29d2c80e86faad3993e13 | 409 | py | Python | tutorial/grid_data_demo_run.py | viz4biz/PyDataNYC2015 | 066154ea9f1837c355e6108a28b85889f3020da3 | [
"Apache-2.0"
] | 11 | 2015-11-11T13:57:21.000Z | 2019-08-14T15:53:43.000Z | tutorial/grid_data_demo_run.py | viz4biz/PyDataNYC2015 | 066154ea9f1837c355e6108a28b85889f3020da3 | [
"Apache-2.0"
] | null | null | null | tutorial/grid_data_demo_run.py | viz4biz/PyDataNYC2015 | 066154ea9f1837c355e6108a28b85889f3020da3 | [
"Apache-2.0"
] | 6 | 2015-11-11T13:57:25.000Z | 2018-09-12T07:53:03.000Z | """
Mplot demo runner
"""
import enaml
from enaml.qt.qt_application import QtApplication
def run_demo():
with enaml.imports():
#from griddata_demo_ui import Main
from griddata_demo_model_ui import Main
app = QtApplication()
view = Main(custom_title='Matplotlib demo', mplot_style='darkis... | 17.041667 | 70 | 0.691932 |
import enaml
from enaml.qt.qt_application import QtApplication
def run_demo():
with enaml.imports():
from griddata_demo_model_ui import Main
app = QtApplication()
view = Main(custom_title='Matplotlib demo', mplot_style='darkish')
view.show()
app.start()
run_demo()
| true | true |
7901f431e59b465571dab45305550b18d3198ad3 | 6,293 | py | Python | bin/fixup_oslogin_v1_keywords.py | fahmiduldul/tmdb | a80e441a98273a9ba823c52638b381da26c3adfe | [
"MIT"
] | null | null | null | bin/fixup_oslogin_v1_keywords.py | fahmiduldul/tmdb | a80e441a98273a9ba823c52638b381da26c3adfe | [
"MIT"
] | null | null | null | bin/fixup_oslogin_v1_keywords.py | fahmiduldul/tmdb | a80e441a98273a9ba823c52638b381da26c3adfe | [
"MIT"
] | 1 | 2022-03-09T03:17:22.000Z | 2022-03-09T03:17:22.000Z | #!/Users/fahmi.abdulaziz/PycharmProjects/tmdb/bin/python3.8
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/l... | 34.576923 | 88 | 0.630701 |
import argparse
import os
import libcst as cst
import pathlib
import sys
from typing import (Any, Callable, Dict, List, Sequence, Tuple)
def partition(
predicate: Callable[[Any], bool],
iterator: Sequence[Any]
) -> Tuple[List[Any], List[Any]]:
results = ([], [])
for i in iterator:
... | true | true |
7901f4c8582b1321cbc6a3da41a1b1158f064b3d | 2,432 | py | Python | multipleterm.py | sylvainmouquet/multipleterm | 427f223cfda53ef88872678c6d81ec35cb972770 | [
"MIT"
] | null | null | null | multipleterm.py | sylvainmouquet/multipleterm | 427f223cfda53ef88872678c6d81ec35cb972770 | [
"MIT"
] | null | null | null | multipleterm.py | sylvainmouquet/multipleterm | 427f223cfda53ef88872678c6d81ec35cb972770 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
import subprocess
try:
import gtk
except:
print >> sys.stderr, "You need to install the python gtk bindings"
sys.exit(1)
# import vte
try:
import vte
except:
error = gtk.MessageDialog (None, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK,
'You need to install... | 27.325843 | 153 | 0.576891 |
import sys
import subprocess
try:
import gtk
except:
print >> sys.stderr, "You need to install the python gtk bindings"
sys.exit(1)
try:
import vte
except:
error = gtk.MessageDialog (None, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK,
'You need to install python bindings for libvte')
... | false | true |
7901f568e227dd7dab0639e6d05af4c5fcda55c2 | 8,861 | py | Python | pubmedpy/tests/test_pmc_oai.py | dhimmel/pubmedpy | 9d716768f5ab798ec448154588e4fd99afd7584a | [
"BlueOak-1.0.0"
] | 7 | 2019-11-13T09:14:19.000Z | 2022-03-09T01:35:06.000Z | pubmedpy/tests/test_pmc_oai.py | dhimmel/pubmedpy | 9d716768f5ab798ec448154588e4fd99afd7584a | [
"BlueOak-1.0.0"
] | 2 | 2020-08-24T15:05:57.000Z | 2020-10-21T04:12:56.000Z | pubmedpy/tests/test_pmc_oai.py | dhimmel/pubmedpy | 9d716768f5ab798ec448154588e4fd99afd7584a | [
"BlueOak-1.0.0"
] | 1 | 2021-02-18T00:01:09.000Z | 2021-02-18T00:01:09.000Z | import pathlib
from lxml import etree
import requests
import pytest
from ..pmc_oai import get_sets_for_pmcid, extract_authors_from_article
directory = pathlib.Path(__file__).parent
def test_get_sets_for_pmcid():
set_specs = get_sets_for_pmcid("PMC2092437")
assert "bmcbioi" in set_specs
assert "pmc-ope... | 34.344961 | 172 | 0.621262 | import pathlib
from lxml import etree
import requests
import pytest
from ..pmc_oai import get_sets_for_pmcid, extract_authors_from_article
directory = pathlib.Path(__file__).parent
def test_get_sets_for_pmcid():
set_specs = get_sets_for_pmcid("PMC2092437")
assert "bmcbioi" in set_specs
assert "pmc-ope... | true | true |
7901f57fe02e6fa850f845939ebf87c16e12624a | 2,221 | py | Python | airflow/contrib/sensors/emr_base_sensor.py | shrutimantri/airflow | 61eaaacd20ab0f743786df895cf8f232b3b2a48c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 15 | 2017-04-06T09:01:50.000Z | 2021-10-02T13:54:31.000Z | airflow/contrib/sensors/emr_base_sensor.py | shrutimantri/airflow | 61eaaacd20ab0f743786df895cf8f232b3b2a48c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 26 | 2019-08-05T13:44:11.000Z | 2022-03-30T10:06:18.000Z | airflow/contrib/sensors/emr_base_sensor.py | shrutimantri/airflow | 61eaaacd20ab0f743786df895cf8f232b3b2a48c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 21 | 2017-08-20T03:01:05.000Z | 2021-09-07T06:47:51.000Z | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | 36.409836 | 85 | 0.701036 |
from airflow.sensors.base_sensor_operator import BaseSensorOperator
from airflow.utils import apply_defaults
from airflow.exceptions import AirflowException
class EmrBaseSensor(BaseSensorOperator):
ui_color = '#66c3ff'
@apply_defaults
def __init__(
self,
aws_conn... | true | true |
7901f866a2b390b84cd531e9660dfa586136c759 | 404 | py | Python | yfinance_trending.py | pikamegan/GMS-hackathon | 1a4e0bfc0912120c812470be8b84282695834f60 | [
"MIT"
] | null | null | null | yfinance_trending.py | pikamegan/GMS-hackathon | 1a4e0bfc0912120c812470be8b84282695834f60 | [
"MIT"
] | null | null | null | yfinance_trending.py | pikamegan/GMS-hackathon | 1a4e0bfc0912120c812470be8b84282695834f60 | [
"MIT"
] | null | null | null | import requests
url = "https://apidojo-yahoo-finance-v1.p.rapidapi.com/market/get-trending-tickers"
querystring = {"region":"US"}
headers = {
'x-rapidapi-host': "apidojo-yahoo-finance-v1.p.rapidapi.com",
'x-rapidapi-key': "86bb0847c2msh62ec4f10fcc7ed9p17aea2jsn6b82733f81a1"
}
response = reque... | 28.857143 | 84 | 0.717822 | import requests
url = "https://apidojo-yahoo-finance-v1.p.rapidapi.com/market/get-trending-tickers"
querystring = {"region":"US"}
headers = {
'x-rapidapi-host': "apidojo-yahoo-finance-v1.p.rapidapi.com",
'x-rapidapi-key': "86bb0847c2msh62ec4f10fcc7ed9p17aea2jsn6b82733f81a1"
}
response = reque... | true | true |
7901f8712e7c9a9d62614608e1db94ba004f877a | 3,488 | py | Python | a2ml/api/auger/model.py | augerai/a2ml | 9d9ce0ac1b51cc81f1cb5ae331c4523131bc6a86 | [
"Apache-2.0"
] | 30 | 2019-07-01T13:23:27.000Z | 2022-03-16T21:19:33.000Z | a2ml/api/auger/model.py | augerai/a2ml | 9d9ce0ac1b51cc81f1cb5ae331c4523131bc6a86 | [
"Apache-2.0"
] | 234 | 2019-07-04T13:56:15.000Z | 2021-11-04T10:12:55.000Z | a2ml/api/auger/model.py | augerai/a2ml | 9d9ce0ac1b51cc81f1cb5ae331c4523131bc6a86 | [
"Apache-2.0"
] | 13 | 2019-07-04T14:00:34.000Z | 2020-07-13T11:18:44.000Z | from .impl.cloud.rest_api import RestApi
from .impl.decorators import with_project
from a2ml.api.utils.decorators import error_handler, authenticated
from .impl.model import Model
from .credentials import Credentials
class AugerModel(object):
def __init__(self, ctx):
self.ctx = ctx
self.credential... | 38.32967 | 138 | 0.711869 | from .impl.cloud.rest_api import RestApi
from .impl.decorators import with_project
from a2ml.api.utils.decorators import error_handler, authenticated
from .impl.model import Model
from .credentials import Credentials
class AugerModel(object):
def __init__(self, ctx):
self.ctx = ctx
self.credential... | true | true |
7901f88050817b7d944fde8456d5af6133e7ce35 | 723 | py | Python | app/main/forms.py | edumorris/pomodoro | cde372be1d5c37dd8221ebd40b684d07fbb472b5 | [
"MIT"
] | null | null | null | app/main/forms.py | edumorris/pomodoro | cde372be1d5c37dd8221ebd40b684d07fbb472b5 | [
"MIT"
] | null | null | null | app/main/forms.py | edumorris/pomodoro | cde372be1d5c37dd8221ebd40b684d07fbb472b5 | [
"MIT"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms import StringField,PasswordField,SubmitField, ValidationError, BooleanField, TextAreaField,SelectField
from wtforms.validators import Required,Email,EqualTo
from ..models import User
class CommentForm(FlaskForm):
comment = TextAreaField('Your comment:', validators=[Requ... | 48.2 | 158 | 0.75657 | from flask_wtf import FlaskForm
from wtforms import StringField,PasswordField,SubmitField, ValidationError, BooleanField, TextAreaField,SelectField
from wtforms.validators import Required,Email,EqualTo
from ..models import User
class CommentForm(FlaskForm):
comment = TextAreaField('Your comment:', validators=[Requ... | true | true |
7901fa1cbb65084bec19ce9b5114920ec080192e | 698 | py | Python | Python/climbing-stairs.py | buptcszh/LeetCode | f0cf11fee2f01b8d166a5d210c5006154e0cde2e | [
"MIT"
] | 3 | 2020-11-04T01:01:23.000Z | 2022-01-10T14:23:04.000Z | Python/climbing-stairs.py | buptcszh/LeetCode | f0cf11fee2f01b8d166a5d210c5006154e0cde2e | [
"MIT"
] | null | null | null | Python/climbing-stairs.py | buptcszh/LeetCode | f0cf11fee2f01b8d166a5d210c5006154e0cde2e | [
"MIT"
] | 3 | 2017-10-09T00:15:30.000Z | 2020-05-12T23:52:41.000Z | # Time: O(n)
# Space: O(1)
#
# You are climbing a stair case. It takes n steps to reach to the top.
#
# Each time you can either climb 1 or 2 steps.
# In how many distinct ways can you climb to the top?
class Solution:
"""
:type n: int
:rtype: int
"""
def climbStairs(self, n):
prev, cur... | 22.516129 | 70 | 0.561605 |
class Solution:
"""
:type n: int
:rtype: int
"""
def climbStairs(self, n):
prev, current = 0, 1
for i in xrange(n):
prev, current = current, prev + current,
return current
def climbStairs1(self, n):
if n == 1:
return 1
if... | false | true |
7901fa6264ca55182e1c5eb41d5b5639610722a6 | 224 | py | Python | face_recognition/__init__.py | Jones174/Testrepo | b391468e92bf78337673bc60be884644bafa7eae | [
"MIT"
] | 19 | 2017-07-19T17:44:44.000Z | 2021-12-23T05:56:01.000Z | face_recognition/__init__.py | Jones174/Testrepo | b391468e92bf78337673bc60be884644bafa7eae | [
"MIT"
] | 3 | 2020-10-05T14:47:27.000Z | 2021-09-07T13:05:05.000Z | face_recognition/__init__.py | Jones174/Testrepo | b391468e92bf78337673bc60be884644bafa7eae | [
"MIT"
] | 7 | 2020-06-21T20:43:53.000Z | 2021-09-07T11:55:23.000Z | # -*- coding: utf-8 -*-
__author__ = """Adam Geitgey"""
__email__ = 'ageitgey@gmail.com'
__version__ = '0.1.0'
from .api import load_image_file, face_locations, face_landmarks, face_encodings, compare_faces, face_distance
| 28 | 110 | 0.741071 |
__author__ = """Adam Geitgey"""
__email__ = 'ageitgey@gmail.com'
__version__ = '0.1.0'
from .api import load_image_file, face_locations, face_landmarks, face_encodings, compare_faces, face_distance
| true | true |
7901fad835676fe2caacdaecfd63c9bb22d1e158 | 3,979 | py | Python | benchmarks/lasso_replicas/bench_plot_lasso_path_83.py | Giannos-G/scikit-learn_modified | 03df71bbea1bcb3423262b711191552420422cda | [
"BSD-3-Clause"
] | 1 | 2022-03-03T23:54:50.000Z | 2022-03-03T23:54:50.000Z | benchmarks/lasso_replicas/bench_plot_lasso_path_83.py | Giannos-G/scikit-learn_modified | 03df71bbea1bcb3423262b711191552420422cda | [
"BSD-3-Clause"
] | null | null | null | benchmarks/lasso_replicas/bench_plot_lasso_path_83.py | Giannos-G/scikit-learn_modified | 03df71bbea1bcb3423262b711191552420422cda | [
"BSD-3-Clause"
] | null | null | null | """Benchmarks of Lasso regularization path computation using Lars and CD
The input data is mostly low rank but is a fat infinite tail.
"""
from collections import defaultdict
import gc
import sys
from time import time
import numpy as np
from sklearn.linear_model import lars_path, lars_path_gram
from sklearn.linear_m... | 34.301724 | 76 | 0.563961 | from collections import defaultdict
import gc
import sys
from time import time
import numpy as np
from sklearn.linear_model import lars_path, lars_path_gram
from sklearn.linear_model import lasso_path
from sklearn.datasets import make_regression
def compute_bench(samples_range, features_range):
it = 0
res... | true | true |
7901fd13db9a01ba1cec85c30a28a62cbd3aa085 | 1,088 | py | Python | kubernetes/test/test_v1_scale_io_persistent_volume_source.py | iguazio/python | c2684bb479d44a49a2010ec4ede5ffa7b17349dd | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_v1_scale_io_persistent_volume_source.py | iguazio/python | c2684bb479d44a49a2010ec4ede5ffa7b17349dd | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_v1_scale_io_persistent_volume_source.py | iguazio/python | c2684bb479d44a49a2010ec4ede5ffa7b17349dd | [
"Apache-2.0"
] | 1 | 2019-01-10T11:13:52.000Z | 2019-01-10T11:13:52.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.13.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
i... | 24.177778 | 112 | 0.742647 |
from __future__ import absolute_import
import os
import sys
import unittest
import kubernetes.client
from kubernetes.client.rest import ApiException
from kubernetes.client.models.v1_scale_io_persistent_volume_source import V1ScaleIOPersistentVolumeSource
class TestV1ScaleIOPersistentVolumeSource(unittest.TestCa... | true | true |
7901fd5e6782e5ea4e57747c9d931ddc4508f949 | 2,036 | py | Python | package/spack-glew/package.py | ctuning/ck-spack | 307934efce1be2d4f104251275c82fbc70127105 | [
"BSD-3-Clause"
] | 1 | 2018-07-17T07:45:09.000Z | 2018-07-17T07:45:09.000Z | package/spack-glew/package.py | ctuning/ck-spack | 307934efce1be2d4f104251275c82fbc70127105 | [
"BSD-3-Clause"
] | null | null | null | package/spack-glew/package.py | ctuning/ck-spack | 307934efce1be2d4f104251275c82fbc70127105 | [
"BSD-3-Clause"
] | null | null | null | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | 38.415094 | 95 | 0.63556 | true | true | |
7901fe6ac320f868b9f6379bf974bacc48b8b001 | 18,801 | py | Python | old_stuff/harold/_time_domain.py | weightan/quaternion_polynomials | 50d00bb883c4a4249f13154cffcb459a1319ecb9 | [
"MIT"
] | 154 | 2015-05-11T03:33:54.000Z | 2022-02-23T23:34:28.000Z | old_stuff/harold/_time_domain.py | weightan/quaternion_polynomials | 50d00bb883c4a4249f13154cffcb459a1319ecb9 | [
"MIT"
] | 43 | 2015-05-11T10:35:43.000Z | 2022-02-22T10:02:10.000Z | old_stuff/harold/_time_domain.py | weightan/quaternion_polynomials | 50d00bb883c4a4249f13154cffcb459a1319ecb9 | [
"MIT"
] | 22 | 2015-06-01T21:32:57.000Z | 2021-09-27T13:35:38.000Z | import numpy as np
from numpy import (reciprocal, einsum, maximum, minimum, zeros_like,
atleast_1d, squeeze)
from scipy.linalg import eig, eigvals, matrix_balance, norm
from harold._classes import Transfer, transfer_to_state
from harold._discrete_funcs import discretize
from harold._arg_utils import ... | 37.602 | 79 | 0.604489 | import numpy as np
from numpy import (reciprocal, einsum, maximum, minimum, zeros_like,
atleast_1d, squeeze)
from scipy.linalg import eig, eigvals, matrix_balance, norm
from harold._classes import Transfer, transfer_to_state
from harold._discrete_funcs import discretize
from harold._arg_utils import ... | true | true |
7901ff17cd3616c64108bab6ef18e9d01f5c3274 | 817 | py | Python | tests/bomb1.py | thefab/restful-distributed-lock-manager | 68e775a956c52dd770e68e15f731a12d756e4103 | [
"MIT"
] | 18 | 2015-01-24T15:54:33.000Z | 2022-01-05T13:08:46.000Z | tests/bomb1.py | thefab/restful-distributed-lock-manager | 68e775a956c52dd770e68e15f731a12d756e4103 | [
"MIT"
] | 3 | 2016-05-19T09:47:53.000Z | 2019-01-03T14:07:18.000Z | tests/bomb1.py | thefab/restful-distributed-lock-manager | 68e775a956c52dd770e68e15f731a12d756e4103 | [
"MIT"
] | 6 | 2018-03-13T13:53:19.000Z | 2021-11-14T14:32:53.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from multiprocessing import Pool
import requests
PROCESS_POOL_SIZE = 10
REQUESTS = 10000
BASE_URL = "http://localhost:8888"
RESOURCE_NAME = "resource"
def f(process_number):
resource_name = RESOURCE_NAME
raw_body = '{"title": "%i", "lifetime": 300, "wait": 20}' ... | 30.259259 | 81 | 0.679315 |
from multiprocessing import Pool
import requests
PROCESS_POOL_SIZE = 10
REQUESTS = 10000
BASE_URL = "http://localhost:8888"
RESOURCE_NAME = "resource"
def f(process_number):
resource_name = RESOURCE_NAME
raw_body = '{"title": "%i", "lifetime": 300, "wait": 20}' % process_number
r = requests.post("%s/l... | true | true |
7901ff7b12e14a5ed2137abf84f344f77316038f | 3,854 | py | Python | motor/frameworks/tornado/__init__.py | smurfix/motor | 67cdcd9b9ae7f966e957113ca9b283f4b2c53b28 | [
"Apache-2.0"
] | null | null | null | motor/frameworks/tornado/__init__.py | smurfix/motor | 67cdcd9b9ae7f966e957113ca9b283f4b2c53b28 | [
"Apache-2.0"
] | null | null | null | motor/frameworks/tornado/__init__.py | smurfix/motor | 67cdcd9b9ae7f966e957113ca9b283f4b2c53b28 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014-2016 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 27.140845 | 78 | 0.704203 |
import functools
import os
import tornado.process
import warnings
from concurrent.futures import ThreadPoolExecutor
from tornado import concurrent, gen, ioloop, version as tornado_version
from tornado.gen import chain_future, coroutine
from .. import DummySession as Session
try:
import contextv... | true | true |
7902014a279ae8fdb91383784f4c8104db26782c | 1,206 | py | Python | rhasspy_skills_cli/tests/test_app.py | razzo04/rhasspy-skills-cli | 01cff9b3f1eee07902fbc04783aeb237fe98768e | [
"MIT"
] | null | null | null | rhasspy_skills_cli/tests/test_app.py | razzo04/rhasspy-skills-cli | 01cff9b3f1eee07902fbc04783aeb237fe98768e | [
"MIT"
] | null | null | null | rhasspy_skills_cli/tests/test_app.py | razzo04/rhasspy-skills-cli | 01cff9b3f1eee07902fbc04783aeb237fe98768e | [
"MIT"
] | null | null | null | import click
from typer.testing import CliRunner
import pytest
import os
from pathlib import Path
from ..main import install
from pytest_httpx import HTTPXMock
runner = CliRunner()
def get_test_resource(name: str) -> Path:
return Path(os.path.join(os.path.dirname(__file__), "testresources", name))
def test_ins... | 25.659574 | 79 | 0.619403 | import click
from typer.testing import CliRunner
import pytest
import os
from pathlib import Path
from ..main import install
from pytest_httpx import HTTPXMock
runner = CliRunner()
def get_test_resource(name: str) -> Path:
return Path(os.path.join(os.path.dirname(__file__), "testresources", name))
def test_ins... | true | true |
7902027bd17bd5449f1cb27614e7291f76386885 | 1,791 | py | Python | zeeguu_core/crowd_translations/__init__.py | C0DK/Zeeguu-Core | 55b6a7ce1223f368614fb7e5dd9e53d4e46ae69e | [
"MIT"
] | null | null | null | zeeguu_core/crowd_translations/__init__.py | C0DK/Zeeguu-Core | 55b6a7ce1223f368614fb7e5dd9e53d4e46ae69e | [
"MIT"
] | null | null | null | zeeguu_core/crowd_translations/__init__.py | C0DK/Zeeguu-Core | 55b6a7ce1223f368614fb7e5dd9e53d4e46ae69e | [
"MIT"
] | null | null | null | from sqlalchemy.orm.exc import NoResultFound
from zeeguu_core.model import User, Language, UserWord, Text, Bookmark
def own_or_crowdsourced_translation(user, word: str, from_lang_code: str, context: str):
own_past_translation = get_own_past_translation(user, word, from_lang_code, context)
if own_past_trans... | 31.982143 | 91 | 0.685092 | from sqlalchemy.orm.exc import NoResultFound
from zeeguu_core.model import User, Language, UserWord, Text, Bookmark
def own_or_crowdsourced_translation(user, word: str, from_lang_code: str, context: str):
own_past_translation = get_own_past_translation(user, word, from_lang_code, context)
if own_past_trans... | true | true |
790202c43ee119e0b0769b912e21e567661b64b9 | 25,739 | py | Python | tools/run_tests/performance/massage_qps_stats.py | 4con/grpc-win-xp | 26e73cad8721030ada9b5765bea627376ccaef9e | [
"Apache-2.0"
] | 91 | 2018-11-24T05:33:58.000Z | 2022-03-16T05:58:05.000Z | tools/run_tests/performance/massage_qps_stats.py | 4con/grpc-win-xp | 26e73cad8721030ada9b5765bea627376ccaef9e | [
"Apache-2.0"
] | 11 | 2019-06-02T23:50:17.000Z | 2022-02-04T23:58:56.000Z | tools/run_tests/performance/massage_qps_stats.py | 4con/grpc-win-xp | 26e73cad8721030ada9b5765bea627376ccaef9e | [
"Apache-2.0"
] | 18 | 2018-11-24T10:35:29.000Z | 2021-04-22T07:22:10.000Z | # Copyright 2017 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 54.76383 | 118 | 0.661875 |
import massage_qps_stats_helpers
def massage_qps_stats(scenario_result):
for stats in scenario_result["serverStats"] + scenario_result["clientStats"]:
if "coreStats" not in stats: return
core_stats = stats["coreStats"]
del stats["coreStats"]
stats["core_client_calls... | true | true |
790202e73857055b473af492c794cada47a6f534 | 283 | py | Python | tests/test.py | monkeyusage/duplicates | 73635259342c2d6ee66de6197a9be2fc8175b67f | [
"MIT"
] | null | null | null | tests/test.py | monkeyusage/duplicates | 73635259342c2d6ee66de6197a9be2fc8175b67f | [
"MIT"
] | null | null | null | tests/test.py | monkeyusage/duplicates | 73635259342c2d6ee66de6197a9be2fc8175b67f | [
"MIT"
] | null | null | null | import sys
sys.path.append('../scripts')
from detect_duplicates import df
def test_nan_names():
assert df.name.isnull().sum() == 0
def test_dup_pid():
assert df.patient_id.duplicated().sum() == 0
def test_phone_dup():
assert df.phone_number.duplicated().sum() == 0 | 23.583333 | 50 | 0.689046 | import sys
sys.path.append('../scripts')
from detect_duplicates import df
def test_nan_names():
assert df.name.isnull().sum() == 0
def test_dup_pid():
assert df.patient_id.duplicated().sum() == 0
def test_phone_dup():
assert df.phone_number.duplicated().sum() == 0 | true | true |
79020397743da07961d1fcabb837c88c78e08d89 | 1,558 | py | Python | scraper/apis/wikipedia.py | antimike/citation-scraper | f9c9749cac683394e1401731a31579bf1756c130 | [
"MIT"
] | null | null | null | scraper/apis/wikipedia.py | antimike/citation-scraper | f9c9749cac683394e1401731a31579bf1756c130 | [
"MIT"
] | null | null | null | scraper/apis/wikipedia.py | antimike/citation-scraper | f9c9749cac683394e1401731a31579bf1756c130 | [
"MIT"
] | null | null | null | import wikipedia as wiki
from ..parsing import get_wiki_page_id, get_wiki_lines, get_wiki_sections
def get_wiki_references(url, outfile=None):
"""get_wiki_references.
Extracts references from predefined sections of wiki page
Uses `urlscan`, `refextract`, `doi`, `wikipedia`, and `re` (for ArXiv URLs)
:... | 41 | 94 | 0.622593 | import wikipedia as wiki
from ..parsing import get_wiki_page_id, get_wiki_lines, get_wiki_sections
def get_wiki_references(url, outfile=None):
def _check(l):
return (not l['doi'] or l['doi'] == l['refs'][-1]['doi']) \
and (not l['arxiv'] or l['arxiv'] == l['refs'][-1]['arxiv'])
page = wiki.... | true | true |
790203d7f5131f002db428b0f81e71d0bcd5b012 | 10,315 | py | Python | d2go/setup.py | ananthsub/d2go | 8c3618d9e73518d32350ab4e6d0fb6509c9e08b6 | [
"Apache-2.0"
] | null | null | null | d2go/setup.py | ananthsub/d2go | 8c3618d9e73518d32350ab4e6d0fb6509c9e08b6 | [
"Apache-2.0"
] | null | null | null | d2go/setup.py | ananthsub/d2go | 8c3618d9e73518d32350ab4e6d0fb6509c9e08b6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import argparse
import logging
import os
import time
import detectron2.utils.comm as comm
import torch
from d2go.config import (
CfgNode as CN,
auto_scale_world_size,
reroute_config_path,
temp_defrost,
)
fro... | 31.544343 | 88 | 0.654678 |
import argparse
import logging
import os
import time
import detectron2.utils.comm as comm
import torch
from d2go.config import (
CfgNode as CN,
auto_scale_world_size,
reroute_config_path,
temp_defrost,
)
from d2go.distributed import get_local_rank, get_num_processes_per_machine
from d2go.runner imp... | true | true |
7902045a8bcac920a9e2f9d298a662706cdcfa87 | 7,289 | py | Python | train.py | petersvenningsson/radar-Bayesian-human-motion | 728db0f39c107faccf9d711670177aac74456e3f | [
"MIT"
] | 1 | 2022-02-01T20:42:24.000Z | 2022-02-01T20:42:24.000Z | train.py | petersvenningsson/radar-Bayesian-human-motion | 728db0f39c107faccf9d711670177aac74456e3f | [
"MIT"
] | null | null | null | train.py | petersvenningsson/radar-Bayesian-human-motion | 728db0f39c107faccf9d711670177aac74456e3f | [
"MIT"
] | null | null | null | import argparse
import numpy as np
from sklearn.metrics import accuracy_score, jaccard_score, balanced_accuracy_score
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import dataloader
import track
from classifiers import ObservationsConditionsClassifier
from classifiers import ClassifierComp... | 40.949438 | 189 | 0.664563 | import argparse
import numpy as np
from sklearn.metrics import accuracy_score, jaccard_score, balanced_accuracy_score
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import dataloader
import track
from classifiers import ObservationsConditionsClassifier
from classifiers import ClassifierComp... | true | true |
790204c38aa70d72bd8331ea5ca48df4c3df59c3 | 1,214 | py | Python | apps/user/admin.py | guoxianru/newcoder | be3354c8be7c0202c0c587633a9d766fd95fb682 | [
"Apache-2.0"
] | 5 | 2019-03-19T06:41:54.000Z | 2020-04-07T17:16:11.000Z | apps/user/admin.py | guoxianru/newcoder2.0 | 9e46156fa68d98d3c23762227a5ee1d84db3f322 | [
"Apache-2.0"
] | 3 | 2020-06-05T20:41:45.000Z | 2021-06-11T02:45:32.000Z | apps/user/admin.py | guoxianru/newcoder | be3354c8be7c0202c0c587633a9d766fd95fb682 | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from user.models import *
# 此处设置页面头部标题
admin.site.site_title = '新码农站点后台'
# 此处设置页面显示标题
admin.site.site_header = '新码农后台管理系统'
@admin.register(User)
class Useradmin(admin.ModelAdmin):
list_display = ['id', 'username', 'password', 'nickname', 'birthday', 'gender', 'photo', 'phone', '... | 30.35 | 118 | 0.666392 | from django.contrib import admin
from user.models import *
admin.site.site_title = '新码农站点后台'
admin.site.site_header = '新码农后台管理系统'
@admin.register(User)
class Useradmin(admin.ModelAdmin):
list_display = ['id', 'username', 'password', 'nickname', 'birthday', 'gender', 'photo', 'phone', 'email', 'desc',
... | true | true |
790204ded8ffd476a486cba293fe42182d914606 | 199,114 | py | Python | pycdf/__init__.py | cpiker/condaCDF | 58f0c15fa387798f49c0372cc33d3639d997112d | [
"Unlicense"
] | null | null | null | pycdf/__init__.py | cpiker/condaCDF | 58f0c15fa387798f49c0372cc33d3639d997112d | [
"Unlicense"
] | 2 | 2020-04-07T21:20:11.000Z | 2021-03-26T16:29:19.000Z | pycdf/__init__.py | das-developers/condaCDF | 58f0c15fa387798f49c0372cc33d3639d997112d | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
das developers note:
This a is modification of the original SpacePy pycdf package. All
refereneces to the greater spacepy package have been removed to create
a small standalone module.
--cwp 2018-10-18
The libcdf.so location code has been changed to f... | 37.378262 | 118 | 0.572838 |
__contact__ = 'Jon Niehof, Jonathan.Niehof@unh.edu'
try:
from collections.abc import MutableMapping, MutableSequence
except ImportError:
from collections import MutableMapping, MutableSequence
import ctypes
import ctypes.util
import datetime
import operator
import os
import os.path
import shutil
import sys... | true | true |
79020526110a259e64dcd1691022d309d2e30800 | 776 | py | Python | queue-with-stacks/queue_with_stacks.py | brandonholderman/data-structures-and-algorithms | 9b9aa0eac1fe305d9655537c90a24dd263a42df9 | [
"MIT"
] | null | null | null | queue-with-stacks/queue_with_stacks.py | brandonholderman/data-structures-and-algorithms | 9b9aa0eac1fe305d9655537c90a24dd263a42df9 | [
"MIT"
] | null | null | null | queue-with-stacks/queue_with_stacks.py | brandonholderman/data-structures-and-algorithms | 9b9aa0eac1fe305d9655537c90a24dd263a42df9 | [
"MIT"
] | null | null | null | from stack import Stack as s
class Queue:
def __init__(self, iter=[]):
self.stack_one = s()
self.stack_two = s()
self._len = 0
for item in iter:
self.enqueue(item)
def enqueue(self, value):
if value:
self.stack_one.push(value)
self.... | 25.866667 | 57 | 0.501289 | from stack import Stack as s
class Queue:
def __init__(self, iter=[]):
self.stack_one = s()
self.stack_two = s()
self._len = 0
for item in iter:
self.enqueue(item)
def enqueue(self, value):
if value:
self.stack_one.push(value)
self.... | true | true |
790205a660a3e83ae739a120a62f77b28f028bee | 4,553 | py | Python | readers/myU3.py | dayne/mini-monitor | 7d6cc8af8877152a04a6deeb9940101f9dcade56 | [
"Apache-2.0"
] | null | null | null | readers/myU3.py | dayne/mini-monitor | 7d6cc8af8877152a04a6deeb9940101f9dcade56 | [
"Apache-2.0"
] | null | null | null | readers/myU3.py | dayne/mini-monitor | 7d6cc8af8877152a04a6deeb9940101f9dcade56 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python2.6
'''
Creates a MyU3 class that adds higher-level functionality to the base
LabJack U3 class.
'''
from __future__ import division
import u3
from time import sleep
import math
def getU3(**kargs):
'''Returns an open MyU3 object but retries until successful if errors occur.'''
while True:
... | 32.29078 | 84 | 0.597408 |
'''
Creates a MyU3 class that adds higher-level functionality to the base
LabJack U3 class.
'''
from __future__ import division
import u3
from time import sleep
import math
def getU3(**kargs):
'''Returns an open MyU3 object but retries until successful if errors occur.'''
while True:
try:
retu... | false | true |
7902063976a16a516504664ce8b3bf5438d73a18 | 32,476 | py | Python | contrib/cli_scripts/nodemeisterlib.py | coxmediagroup/nodemeister | ecfd2c04f516b1ea022c55ce4372976055a39e5f | [
"Apache-2.0"
] | null | null | null | contrib/cli_scripts/nodemeisterlib.py | coxmediagroup/nodemeister | ecfd2c04f516b1ea022c55ce4372976055a39e5f | [
"Apache-2.0"
] | null | null | null | contrib/cli_scripts/nodemeisterlib.py | coxmediagroup/nodemeister | ecfd2c04f516b1ea022c55ce4372976055a39e5f | [
"Apache-2.0"
] | null | null | null | """
Some common functions for interfacing with the
NodeMeister REST API.
"""
import requests
import anyjson
import re
import logging
MISSING_ITEM = '-'
DIFF_MARKER = ">"
try:
logger.debug("importing nodemeisterlib")
except NameError:
FORMAT = "[%(levelname)s %(filename)s:%(lineno)s - %(funcName)20s() ] %(mes... | 35.338411 | 168 | 0.634253 |
import requests
import anyjson
import re
import logging
MISSING_ITEM = '-'
DIFF_MARKER = ">"
try:
logger.debug("importing nodemeisterlib")
except NameError:
FORMAT = "[%(levelname)s %(filename)s:%(lineno)s - %(funcName)20s() ] %(message)s"
logging.basicConfig(level=logging.ERROR, format=FORMAT)
logge... | true | true |
7902068c2c80cf2e8ba0a0dd8b6fb2489ee8b432 | 1,165 | py | Python | 0844_backspace_string_compare.py | subwaymatch/leetcode | 2592ba2e55682fd54d0060c5b1ff1b8469ba7916 | [
"MIT"
] | null | null | null | 0844_backspace_string_compare.py | subwaymatch/leetcode | 2592ba2e55682fd54d0060c5b1ff1b8469ba7916 | [
"MIT"
] | null | null | null | 0844_backspace_string_compare.py | subwaymatch/leetcode | 2592ba2e55682fd54d0060c5b1ff1b8469ba7916 | [
"MIT"
] | null | null | null | class Solution:
def backspaceCompare(self, S: str, T: str) -> bool:
s_bcount, t_bcount = 0, 0
s_idx, t_idx = len(S) - 1, len(T) - 1
while s_idx >= 0 or t_idx >= 0:
while s_idx >= 0:
if S[s_idx] == '#':
s_bcount += 1
... | 29.125 | 74 | 0.318455 | class Solution:
def backspaceCompare(self, S: str, T: str) -> bool:
s_bcount, t_bcount = 0, 0
s_idx, t_idx = len(S) - 1, len(T) - 1
while s_idx >= 0 or t_idx >= 0:
while s_idx >= 0:
if S[s_idx] == '#':
s_bcount += 1
... | true | true |
790207282ca331068c3a54864207948571b5a342 | 10,406 | py | Python | puffmarker/input/import_RICE_pilot_data.py | nsaleheen/puffmarker_plus_plus | 36201b3f95c8a5cb39f744ae65a01ec5f5abf36d | [
"MIT"
] | null | null | null | puffmarker/input/import_RICE_pilot_data.py | nsaleheen/puffmarker_plus_plus | 36201b3f95c8a5cb39f744ae65a01ec5f5abf36d | [
"MIT"
] | 1 | 2021-04-10T19:39:00.000Z | 2021-04-10T19:39:00.000Z | puffmarker/input/import_RICE_pilot_data.py | nsaleheen/puffmarker_plus_plus | 36201b3f95c8a5cb39f744ae65a01ec5f5abf36d | [
"MIT"
] | null | null | null | # import datetime, time
from typing import List
from datetime import datetime, timedelta
import pytz
import os
from puffmarker.domain.datapoint import DataPoint
from puffmarker.input.import_stream_processor_inputs import load_data, load_data_offset
data_dir = '/home/nsaleheen/data/rice_ema_puffmarker_activity_loc/'
# ... | 36.25784 | 148 | 0.591486 |
from typing import List
from datetime import datetime, timedelta
import pytz
import os
from puffmarker.domain.datapoint import DataPoint
from puffmarker.input.import_stream_processor_inputs import load_data, load_data_offset
data_dir = '/home/nsaleheen/data/rice_ema_puffmarker_activity_loc/'
smoking_self_report_fil... | true | true |
790208024d887b2aff748f478010a86fbfd452eb | 1,210 | py | Python | pandapower/pypower/pqcost.py | Zamwell/pandapower | ce51946342109e969b87b60c8883d7eec02d3060 | [
"BSD-3-Clause"
] | 221 | 2015-01-03T23:18:11.000Z | 2022-03-27T10:21:40.000Z | pandapower/pypower/pqcost.py | lvzhibai/pandapower | 24ed3056558887cc89f67d15b5527523990ae9a1 | [
"BSD-3-Clause"
] | 126 | 2017-02-15T17:09:08.000Z | 2018-07-16T13:25:15.000Z | pandapower/pypower/pqcost.py | gdgarcia/pandapower | 630e3278ca012535f78282ae73f1b86f3fe932fc | [
"BSD-3-Clause"
] | 114 | 2015-02-02T15:07:38.000Z | 2022-03-22T17:01:55.000Z | # Copyright (c) 1996-2015 PSERC. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
"""Splits the gencost variable into two pieces if costs are given for Qg.
"""
from sys import stderr
from numpy import array, arange
def pqcost(gencost, ng, on... | 31.842105 | 77 | 0.66281 |
from sys import stderr
from numpy import array, arange
def pqcost(gencost, ng, on=None):
if on is None:
on = arange(ng)
if gencost.shape[0] == ng:
pcost = gencost[on, :]
qcost = array([])
elif gencost.shape[0] == 2 * ng:
pcost = gencost[on, :]
qcost = gencost... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.