max_stars_repo_path string | max_stars_repo_name string | max_stars_count int64 | id string | content string | add_param_types int64 | add_return_types int64 | add_class_field_types int64 | add_instance_field_types int64 | add_total int64 | add_error int64 |
|---|---|---|---|---|---|---|---|---|---|---|
modules/importers/MatconvFileImporter.py | lluisgomez/DeepRosetta | 166 | 1630919 | import os
from core.BaseImporter import BaseImporter
from scipy.io import loadmat
import yaml
class Importer(BaseImporter):
def __init__(self):
with open('./modules/config/Matconv/equivalences.yaml', 'r') as infile:
self.equivalences = yaml.load(infile)
self.bottom: None = None
def... | 0 | 2 | 0 | 1 | 3 | 0 |
tests/test_io_midi.py | rvega/isobar | 241 | 1630932 | import isobar as iso
from isobar.io.midi import MidiInputDevice, MidiOutputDevice
import pytest
import time
from . import dummy_timeline
VIRTUAL_DEVICE_NAME = "Virtual Device"
no_midi = False
try:
midi_out = iso.MidiOutputDevice()
except iso.DeviceNotFoundException:
no_midi = True
@pytest.mark.skipif(no_midi... | 0 | 0 | 0 | 0 | 0 | 0 |
tensorflow_federated/python/simulation/datasets/client_data.py | zhihansh/federated-oss | 1,918 | 1630947 | # Copyright 2018, The TensorFlow Federated 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 o... | 19 | 21 | 0 | 2 | 42 | 0 |
test/python_rules/cx_oracle_darwin_build_test.py | samwestmoreland/please | 1,992 | 1630952 | <reponame>samwestmoreland/please
import time
import unittest
class CxOracleTest(unittest.TestCase):
def test_import(self):
start = time.time()
import cx_Oracle
end = time.time()
print('Imported cx_Oracle version %s in %0.2fs' % (cx_Oracle.__version__, end - start))
| 0 | 0 | 0 | 0 | 0 | 0 |
pyabsa/core/atepc/__init__.py | froth-synthesio/PyABSA | 199 | 1630963 | # -*- coding: utf-8 -*-
# file: __init__.py
# time: 2021/5/21 0021
# author: yangheng <<EMAIL>>
# github: https://github.com/yangheng95
# Copyright (C) 2021. All Rights Reserved.
from pyabsa.core.atepc.models import (lcfs_atepc,
lcfs_atepc_large,
... | 0 | 0 | 0 | 0 | 0 | 0 |
flask__webservers/simple_upload_server/test.py | DazEB2/SimplePyScripts | 117 | 1630997 | <gh_stars>100-1000
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
# Отправка файла на сервер
import requests
rs = requests.post('http://localhost:6000', files={'file': open('disk_info.txt', 'rb')})
print(rs)
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/unittests/utils/test_win_reg_utils.py | buddwm/hubble | 363 | 1631010 | # -*- coding: utf-8 -*-
from tests.support.helpers import destructiveTest, generate_random_name
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, patch
from tests.support.unit import TestCase, skipIf
import hubblestack.utils.platform
import hubblestack.utils.win_reg as win_reg
UNICODE_KEY = 'Unicode Key \N{TRA... | 0 | 0 | 0 | 0 | 0 | 0 |
instabot/bot/state/bot_cache.py | thangthattha88/instabot | 3,852 | 1631013 | <filename>instabot/bot/state/bot_cache.py
from instabot.singleton import Singleton
class BotCache(object):
__metaclass__ = Singleton
def __init__(self):
self.following = None
self.followers = None
self.user_infos = {} # User info cache
self.usernames = {} # `username` to `us... | 0 | 0 | 0 | 0 | 0 | 0 |
fireant/middleware/__init__.py | mikeengland/fireant | 122 | 1631019 | from .concurrency import ThreadPoolConcurrencyMiddleware
from .decorators import log_middleware
| 0 | 0 | 0 | 0 | 0 | 0 |
pandera/__init__.py | benkeesey/pandera | 1,134 | 1631039 | <filename>pandera/__init__.py
"""A flexible and expressive pandas validation library."""
import platform
from pandera.dtypes import (
Bool,
Category,
Complex,
Complex64,
Complex128,
DataType,
DateTime,
Float,
Float16,
Float32,
Float64,
Int,
Int8,
Int16,
Int32... | 0 | 0 | 0 | 0 | 0 | 0 |
batchflow/research/domain.py | analysiscenter/dataset | 101 | 1631042 | from __future__ import annotations
""" Domain of parameters to generate configs. """
from itertools import product, islice
from collections import OrderedDict
from copy import copy, deepcopy
from pprint import pformat
import numpy as np
from .utils import must_execute, to_list
from .. import Config, Sampler, make_rng... | 13 | 33 | 0 | 14 | 60 | 0 |
library/python/runtime_py3/test/traceback/mod/__init__.py | HeyLey/catboost | 6,989 | 1631060 | <gh_stars>1000+
def modfunc(f):
# lalala
f() # call back to caller
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_crash.py | acpaquette/deepstate | 684 | 1631065 | from __future__ import print_function
import deepstate_base
import logrun
class CrashTest(deepstate_base.DeepStateTestCase):
def run_deepstate(self, deepstate):
(r, output) = logrun.logrun([deepstate, "build/examples/Crash"],
"deepstate.out", 1800)
self.assertEqual(r, 0)
self.assertTr... | 0 | 0 | 0 | 0 | 0 | 0 |
02_canSniffer_GUI/HideOldPackets.py | Scriptman/canDrive | 165 | 1631076 | <reponame>Scriptman/canDrive<filename>02_canSniffer_GUI/HideOldPackets.py
from PyQt5.QtCore import QThread, pyqtSignal
class HideOldPacketsThread(QThread):
hideOldPacketsSignal = pyqtSignal()
def __init__(self):
super(HideOldPacketsThread, self).__init__()
self.isRunning = False
self.... | 0 | 0 | 0 | 0 | 0 | 0 |
dataset/Parsers/JTA.py | BoPang1996/TubeTK | 142 | 1631095 | <reponame>BoPang1996/TubeTK
import os
import os.path
import cv2
import numpy as np
import random
import pickle
from PIL import Image, ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
class GTSingleParser_JTA:
def __init__(self, folder,
forward_frames=8,
frame_stride=1,
... | 0 | 0 | 0 | 0 | 0 | 0 |
pyworkshop/2_intermediate_python/chapter3/exercise_part2.py | profread/python | 389 | 1631105 | <reponame>profread/python
class Vehicle:
number_of_wheels = 4
def __init__(self, make, model, fuel="gas"):
self.make = make
self.model = model
self.fuel = fuel
daily_driver = Vehicle("Subaru", "Crosstrek")
daily_driver.number_of_wheels = 3
# Instance variables
print(f"I drive a {dai... | 0 | 0 | 0 | 0 | 0 | 0 |
codingame/easy/MIME Type.py | DazEB2/SimplePyScripts | 117 | 1631109 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
import sys
import math
# Auto-generated code below aims at helping you parse
# the standard input according to the problem statement.
ext_mime_dict = dict()
files = list()
n = int(input()) # Number of elements which make up the association ta... | 0 | 0 | 0 | 0 | 0 | 0 |
imagenet/training.py | hellotem/fixmatch | 876 | 1631111 | <gh_stars>100-1000
# Copyright 2019 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 0 | 0 | 0 | 0 | 0 | 0 |
torchdrug/datasets/opv.py | wconnell/torchdrug | 772 | 1631145 | <reponame>wconnell/torchdrug<filename>torchdrug/datasets/opv.py
import os
import csv
import math
from collections import defaultdict
from tqdm import tqdm
from torch.utils import data as torch_data
from torchdrug import data, utils
from torchdrug.core import Registry as R
from torchdrug.utils import doc
@R.register... | 0 | 0 | 0 | 0 | 0 | 0 |
samples/subscription/billing_plans/get_all.py | Hey-Marvelous/PayPal-Python-SDK | 653 | 1631150 | <filename>samples/subscription/billing_plans/get_all.py
from paypalrestsdk import BillingPlan
import logging
logging.basicConfig(level=logging.INFO)
history = BillingPlan.all(
{"status": "CREATED", "page_size": 5, "page": 1, "total_required": "yes"})
print(history)
print("List BillingPlan:")
for plan in history.p... | 0 | 0 | 0 | 0 | 0 | 0 |
f5/bigip/tm/auth/test/unit/test_radius_server.py | nghia-tran/f5-common-python | 272 | 1631157 | # Copyright 2017 F5 Networks 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 writi... | 0 | 1 | 0 | 0 | 1 | 0 |
nn_viz.py | mig029/SnakeAI | 181 | 1631208 | from PyQt5 import QtGui, QtCore, QtWidgets
from PyQt5.QtCore import Qt
import sys
from typing import List
from neural_network import *
from snake import Snake
class NeuralNetworkViz(QtWidgets.QWidget):
def __init__(self, parent, snake: Snake):
super().__init__(parent)
self.snake = snake... | 3 | 2 | 0 | 3 | 8 | 0 |
fedlearner/common/hooks.py | Hsy-Intel/fedlearner | 772 | 1631209 | <reponame>Hsy-Intel/fedlearner
# Copyright 2021 The FedLearner Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0... | 0 | 0 | 0 | 0 | 0 | 0 |
kafka_utils/util/monitoring.py | dbgrigsby/kafka-utils | 302 | 1631224 | # -*- coding: utf-8 -*-
# Copyright 2016 Yelp 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 ... | 1 | 5 | 0 | 0 | 6 | 0 |
hikyuu/admin/widget/Ui_HkuXueqiuAccountWidget.py | kknet/hikyuu | 1,283 | 1631305 | <filename>hikyuu/admin/widget/Ui_HkuXueqiuAccountWidget.py<gh_stars>1000+
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'Ui_HkuXueqiuAccountWidget.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again.... | 0 | 0 | 0 | 0 | 0 | 0 |
weixin/scraping.py | xicheng645/web_scraping_and_data_analysis | 118 | 1631332 | <filename>weixin/scraping.py
# -*- coding: utf-8 -*-
# author: zhengk
from selenium import webdriver
import time
import logging
import csv
import random
import json
import os
logging.basicConfig(level=logging.INFO,#控制台打印的日志级别
filename='weixin.log',
filemode='a',##模式,有w和a,w就是写模式,... | 0 | 0 | 0 | 0 | 0 | 0 |
InstantLyrics.py | CaneLP/instant-lyrics | 219 | 1631334 | from src.appIndicator import AppIndicator
if __name__ == "__main__":
app = AppIndicator()
| 0 | 0 | 0 | 0 | 0 | 0 |
test/test_textwrapper.py | Kevinrp01/python-tabulate | 1,195 | 1631352 | # -*- coding: utf-8 -*-
"""Discretely test functionality of our custom TextWrapper"""
from __future__ import unicode_literals
from tabulate import _CustomTextWrap as CTW
from textwrap import TextWrapper as OTW
from common import skip, assert_equal
def test_wrap_multiword_non_wide():
"""TextWrapper: non-wide ch... | 0 | 0 | 0 | 0 | 0 | 0 |
doc/_sphinxext/lbm_ext.py | Mopolino8/pylbm | 106 | 1631400 | import notebookgenerator
def init():
print('Generating notebooks.')
notebookgenerator.main()
def clean(app, *args):
print('Remove rst notebook files.')
#notebookgenerator.clean()
def setup(app):
init()
app.connect('build-finished', clean)
| 0 | 0 | 0 | 0 | 0 | 0 |
srunner/metrics/examples/basic_metric.py | samnichols-cpc/scenario_runner | 447 | 1631417 | <filename>srunner/metrics/examples/basic_metric.py
#!/usr/bin/env python
# Copyright (c) 2020 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""
This module provide Ba... | 0 | 0 | 0 | 0 | 0 | 0 |
apps/web/netflix.py | zachbarrow/talon_community | 125 | 1631419 | from talon.voice import Context
from . import browser
from ...misc import audio
context = Context(
"netflix", func=browser.url_matches_func("https://www.netflix.com/.*")
)
context.keymap(
{"full screen": [lambda m: audio.set_volume(100), browser.send_to_page("f")]}
)
| 0 | 0 | 0 | 0 | 0 | 0 |
sdk/metricsadvisor/azure-ai-metricsadvisor/tests/async_tests/test_hooks_async.py | rsdoherty/azure-sdk-for-python | 2,728 | 1631424 | <filename>sdk/metricsadvisor/azure-ai-metricsadvisor/tests/async_tests/test_hooks_async.py
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license informati... | 0 | 0 | 0 | 0 | 0 | 0 |
RecoMET/METFilters/python/EcalDeadCellTriggerPrimitiveFilter_cfi.py | ckamtsikis/cmssw | 852 | 1631446 | <filename>RecoMET/METFilters/python/EcalDeadCellTriggerPrimitiveFilter_cfi.py
import FWCore.ParameterSet.Config as cms
EcalDeadCellTriggerPrimitiveFilter = cms.EDFilter(
'EcalDeadCellTriggerPrimitiveFilter',
# when activated, the filter does not filter event.
# the filter is however storing a bool in the ... | 0 | 0 | 0 | 0 | 0 | 0 |
txdav/common/datastore/upgrade/sql/upgrade.py | backwardn/ccs-calendarserver | 462 | 1631464 | <filename>txdav/common/datastore/upgrade/sql/upgrade.py
# -*- test-case-name: txdav.common.datastore.upgrade.sql.test -*-
##
# Copyright (c) 2010-2017 Apple 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.
# ... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/smoke/organizations/locations/roles/schedules/shifts/test_schedule_shifts.py | Joey-Wondersign/Staffjoy-suite-Joey | 890 | 1631477 | <filename>tests/smoke/organizations/locations/roles/schedules/shifts/test_schedule_shifts.py<gh_stars>100-1000
from tests.smoke.organizations.locations.roles.schedules.shifts.base_schedule_shift import BaseScheduleShift
class TestScheduleShifts(BaseScheduleShift):
def setUp(self):
# (if you are copying an... | 0 | 0 | 0 | 0 | 0 | 0 |
exploit_nss_manual.py | marcostolosa/CVE-2021-3156 | 473 | 1631483 | #!/usr/bin/python3
'''
Exploit for CVE-2021-3156 by sleepya
Simplified version of exploit_nss.py for easy understanding.
- Remove all checking code
- Remove embeded library
- Manual a number of services before group line
This exploit requires:
- glibc with tcache
- nscd service is not running
'''
import os
SUDO_PATH... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/ttrace_parser/scripts/ttrace_tinyaraDump.py | ziyik/TizenRT-1 | 511 | 1631523 | <gh_stars>100-1000
#!/usr/bin/python
###########################################################################
#
# Copyright (c) 2017 The Chromium Authors. All rights reserved.
# Copyright 2017 Samsung Electronics All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not u... | 0 | 0 | 0 | 0 | 0 | 0 |
corehq/apps/cachehq/invalidate.py | dimagilg/commcare-hq | 471 | 1631531 | <reponame>dimagilg/commcare-hq
from memoized import memoized
from corehq.pillows.cacheinvalidate import CacheInvalidateProcessor
@memoized
def _get_cache_processor():
return CacheInvalidateProcessor()
def invalidate_document(document, deleted=False):
"""
Invalidates a document in the cached_core cachin... | 0 | 0 | 0 | 0 | 0 | 0 |
src/genie/libs/parser/iosxe/tests/ShowMplsInterface/cli/equal/golden_output_expected.py | balmasea/genieparser | 204 | 1631552 | <gh_stars>100-1000
expected_output = {
"vrf": {
"default": {
"interfaces": {
"GigabitEthernet6": {
"ip": "yes",
"tunnel": "no",
"session": "ldp",
"bgp": "no",
"static": "no",
... | 0 | 0 | 0 | 0 | 0 | 0 |
nidaqmx/_task_modules/timing.py | stafak/nidaqmx-python | 252 | 1631559 | <filename>nidaqmx/_task_modules/timing.py
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import ctypes
import numpy
from nidaqmx._lib import lib_importer, ctypes_byte_str, c_bool32
from nidaqmx.system.physical_channe... | 0 | 0 | 0 | 0 | 0 | 0 |
parlai/chat_service/core/world_runner.py | zl930216/ParlAI | 9,228 | 1631584 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import time
import datetime
from concurrent import futures
import parlai.chat_service.utils.logging as log... | 1 | 6 | 0 | 4 | 11 | 0 |
tests/testproject/settings.py | merc1er/django-analytical | 454 | 1631594 | """
django-analytical testing settings.
"""
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
INSTALLED_APPS = [
'django.contrib.sites',
'django.contrib.contenttypes',
'django.contrib.auth',
'analytical',
]
SECRET_KEY = 'testing'
MIDDL... | 0 | 0 | 0 | 0 | 0 | 0 |
JavHelper/core/deluge_downloader.py | ddd354/JAVOneStop | 331 | 1631609 | <gh_stars>100-1000
import requests
import json
from datetime import datetime
import re
from blitzdb.document import DoesNotExist
from time import sleep
from traceback import print_exc
from JavHelper.core.backend_translation import BackendTranslation
from JavHelper.core.ini_file import return_default_config_string
if ... | 0 | 0 | 0 | 0 | 0 | 0 |
autosklearn/metalearning/metalearning/metrics/misc.py | Louquinze/auto-sklearn | 6,390 | 1631621 | <gh_stars>1000+
import sklearn.utils
def get_random_metric(random_state=1):
random_state = sklearn.utils.check_random_state(random_state)
def _random(d1, d2):
return random_state.random_sample()
return _random
| 0 | 0 | 0 | 0 | 0 | 0 |
docs/snippets/ov_layout.py | ryanloney/openvino-1 | 1,127 | 1631634 | # Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
# ! [ov:layout:simple]
from openvino.runtime import Layout
layout = Layout('NCHW')
# ! [ov:layout:simple]
# ! [ov:layout:complex]
# Each dimension has name separated by comma
# Layout is wrapped with square brackets
layout = Layout('[t... | 0 | 0 | 0 | 0 | 0 | 0 |
tensorflow/python/kernel_tests/strings_ops/string_format_op_test.py | EricRemmerswaal/tensorflow | 190,993 | 1631648 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/base.py | riga/tensorfunk | 387 | 1631674 | # -*- coding: utf-8 -*-
import os
import sys
import unittest
import tensorflow as tf
# adjust the path to import tfdeploy
base = os.path.normpath(os.path.join(os.path.abspath(__file__), "../.."))
sys.path.append(base)
import tfdeploy as td
# setup
td.setup(tf)
class TestCase(unittest.TestCase):
def __init_... | 0 | 1 | 0 | 1 | 2 | 0 |
strategies/gekko-japonicus-master/promoterz/evolutionToolbox.py | tobby2002/tradyai-api | 229 | 1631703 | <gh_stars>100-1000
#!/bin/python
from deap import base
def getExtraTools(HallOfFame, W):
T = base.Toolbox()
T.register('q')
| 0 | 0 | 0 | 0 | 0 | 0 |
aries_cloudagent/resolver/__init__.py | kuraakhilesh8230/aries-cloudagent-python | 247 | 1631730 | <filename>aries_cloudagent/resolver/__init__.py
"""Interfaces and base classes for DID Resolution."""
import logging
from ..config.injection_context import InjectionContext
from ..config.provider import ClassProvider
from .did_resolver_registry import DIDResolverRegistry
LOGGER = logging.getLogger(__name__)
async... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/tools/protocol/requests/test_list_offset_v2.py | akashvacher/kafka-tools | 578 | 1631734 | import unittest
from kafka.tools.protocol.requests import ArgumentError
from kafka.tools.protocol.requests.list_offset_v2 import ListOffsetV2Request
class ListOffsetV1RequestTest(unittest.TestCase):
def test_process_arguments(self):
val = ListOffsetV2Request.process_arguments(['-1', 'false', 'topicname',... | 0 | 0 | 0 | 0 | 0 | 0 |
petl/petl_factory.py | jxhe/unify-parameter-efficient-tuning | 101 | 1631737 | <reponame>jxhe/unify-parameter-efficient-tuning<filename>petl/petl_factory.py
import torch
import torch.nn as nn
import torch.nn.functional as F
import math
from transformers import RobertaConfig
def init_lisa_params(module):
std = 1e-20
if isinstance(module, nn.Linear):
module.weight.data.normal_(mea... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/mxnet/test_hook_save_config.py | NRauschmayr/sagemaker-debugger | 133 | 1631751 | <filename>tests/mxnet/test_hook_save_config.py<gh_stars>100-1000
# Standard Library
import os
import shutil
from datetime import datetime
# First Party
from smdebug.mxnet import SaveConfig
from smdebug.mxnet.hook import Hook as t_hook
# Local
from .mnist_gluon_model import run_mnist_gluon_model
def test_save_config... | 0 | 0 | 0 | 0 | 0 | 0 |
courses/backend/django-for-everybody/Web Application Technologies and Django/resources/dj4e-samples/getpost/urls.py | Nahid-Hassan/fullstack-software-development | 297 | 1631793 | <reponame>Nahid-Hassan/fullstack-software-development<filename>courses/backend/django-for-everybody/Web Application Technologies and Django/resources/dj4e-samples/getpost/urls.py
from django.urls import path
from . import views
from django.views.generic import TemplateView
urlpatterns = [
path('', TemplateView.as_... | 0 | 0 | 0 | 0 | 0 | 0 |
hummingbot/core/utils/tracking_nonce.py | pecuniafinance/hummingbot | 542 | 1631809 | <filename>hummingbot/core/utils/tracking_nonce.py
import time
_last_tracking_nonce: int = 0
_last_tracking_nonce_low_res: int = 0
def get_tracking_nonce() -> int:
global _last_tracking_nonce
nonce = int(time.time() * 1e6)
_last_tracking_nonce = nonce if nonce > _last_tracking_nonce else _last_tracking_no... | 0 | 0 | 0 | 0 | 0 | 0 |
openbook_follows/migrations/0004_auto_20181023_1352.py | TamaraAbells/okuna-api | 164 | 1631847 | <gh_stars>100-1000
# Generated by Django 2.1.2 on 2018-10-23 11:52
from django.conf import settings
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('openbook_follows', '0003_auto_20181023_1331'),... | 0 | 0 | 0 | 0 | 0 | 0 |
AppServer/lib/django-1.2/tests/regressiontests/comment_tests/tests/feed_tests.py | loftwah/appscale | 790 | 1631848 | import warnings
from django.test.utils import get_warnings_state, restore_warnings_state
from regressiontests.comment_tests.tests import CommentTestCase
class CommentFeedTests(CommentTestCase):
urls: str = 'regressiontests.comment_tests.urls'
feed_url: str = '/rss/comments/'
def test_feed(self):
... | 0 | 0 | 3 | 0 | 3 | 0 |
Parameterized_Network/parameterized.py | weihaoxie/FastImageProcessing | 292 | 1631864 | from __future__ import annotations
from __future__ import division
import os,time,cv2
import tensorflow as tf
import tensorflow.contrib.slim as slim
import numpy as np
def lrelu(x) -> object:
return tf.maximum(x*0.2,x)
def identity_initializer() -> object:
def _initializer(shape, dtype=tf.float32, partition_i... | 1 | 6 | 0 | 0 | 7 | 0 |
organize/actions/shell.py | rawdamedia/organize | 1,231 | 1631869 | import logging
import subprocess
from typing import Mapping
from .action import Action
logger = logging.getLogger(__name__)
class Shell(Action):
"""
Executes a shell command
:param str cmd: The command to execute.
Example:
- (macOS) Open all pdfs on your desktop:
.. code-block:: ya... | 2 | 3 | 0 | 0 | 5 | 0 |
photutils/aperture/tests/test_mask.py | rosteen/photutils | 167 | 1631885 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests for the mask module.
"""
import astropy.units as u
import numpy as np
from numpy.testing import assert_allclose, assert_almost_equal
import pytest
from ..bounding_box import BoundingBox
from ..circle import CircularAperture, CircularAnnulus
fro... | 0 | 0 | 0 | 0 | 0 | 0 |
modules/model_alignment.py | shubham303/Abinet_HI | 230 | 1631892 | <reponame>shubham303/Abinet_HI
import torch
import torch.nn as nn
from fastai.vision import *
from modules.model import Model, _default_tfmer_cfg
class BaseAlignment(Model):
def __init__(self, config):
super().__init__(config)
d_model = ifnone(config.model_alignment_d_model, _default_tfmer_cfg['d... | 0 | 0 | 0 | 0 | 0 | 0 |
zentral/contrib/inventory/exporters/es_machine_snapshots.py | arubdesu/zentral | 634 | 1631893 | import logging
from django.utils import timezone
from elasticsearch import Elasticsearch, NotFoundError, RequestError
from zentral.core.exceptions import ImproperlyConfigured
from .base import BaseExporter
logger = logging.getLogger("zentral.contrib.inventory.exporters.es_machine_snapshots")
MAX_EXPORTS_COUNT = 3
ES... | 0 | 1 | 1 | 0 | 2 | 0 |
test_autolens/imaging/plot/test_fit_imaging_plotters.py | Jammy2211/AutoLens | 114 | 1631909 | <reponame>Jammy2211/AutoLens
from os import path
import pytest
import autolens.plot as aplt
directory = path.dirname(path.realpath(__file__))
@pytest.fixture(name="plot_path")
def make_fit_imaging_plotter_setup():
return path.join(
"{}".format(path.dirname(path.realpath(__file__))), "files"... | 0 | 0 | 0 | 0 | 0 | 0 |
utils/emails.py | goztrk/django-htk | 206 | 1631914 | # Python Standard Library Imports
import copy
import re
import time
def normalize_email(email) -> object:
normalized = email.strip().lower()
return normalized
def email_permutator(domain, first_name: str='', middle_name: str='', last_name: str='') -> object:
"""Generate common possible permutations of em... | 6 | 4 | 0 | 0 | 10 | 0 |
book/src/ch04/tests/test_ocp.py | zangyuchen2008/Clean-Code-in-Python-Second-Edition | 133 | 1631924 | """Clean code in Python - Second edition
Chapter 04, the SOLID principles
Tests for the Open/Closed Principle (OCP) examples 1 through 3
"""
import unittest
from openclosed_1 import SystemMonitor as SystemMonitor1
from openclosed_2 import SystemMonitor as SystemMonitor2
from openclosed_3 import SystemMonitor as Syste... | 0 | 0 | 2 | 0 | 2 | 0 |
mechanize/_version.py | rockonedege/mechanize | 631 | 1631941 | "0.4.7"
string_version = "0.4.7"
__version__ = (0, 4, 7, None, None)
| 0 | 0 | 0 | 0 | 0 | 0 |
recipes/ssht/all/conanfile.py | rockandsalt/conan-center-index | 562 | 1631972 | from conans import CMake, ConanFile, tools
from conans.errors import ConanInvalidConfiguration
from glob import glob
import os
class SshtConan(ConanFile):
name: str = "ssht"
license: str = "GPL-3.0-or-later"
url: str = "https://github.com/conan-io/conan-center-index"
homepage: str = "https://github.c... | 0 | 3 | 12 | 0 | 15 | 0 |
tests/run_most_nbs.py | tanjie123/hello-ltr | 109 | 1631995 | from notebook_test_case import NotebooksTestCase
import unittest
class RunMostNotebooksTestCase(NotebooksTestCase):
TEST_PATHS: list[str] = ['./notebooks/',
'./notebooks/solr/tmdb',
'./notebooks/elasticsearch/tmdb',
'./notebooks/elasticsearch/osc-blog']
I... | 0 | 2 | 2 | 0 | 4 | 0 |
tests/tasks/logger.py | fredstro/mrq | 745 | 1632005 | from mrq.task import Task
from mrq.context import log
import sys
PY3 = sys.version_info > (3,)
class Simple(Task):
def run(self, params) -> bool:
# Some systems may be configured like this.
if not PY3 and params.get("utf8_sys_stdout"):
import codecs
import sys
... | 0 | 1 | 0 | 0 | 1 | 0 |
src/visualize_coco_dataloader.py | ParikhKadam/part-affinity | 110 | 1632023 | from opts.viz_opts import VizOpts
from data_process.coco import CocoDataSet
from visualization.visualize import visualize_masks, visualize_keypoints, visualize_heatmap, visualize_paf
from data_process.coco_process_utils import BODY_PARTS
if __name__ == '__main__':
opts = VizOpts().parse()
for split in ['train'... | 0 | 0 | 0 | 0 | 0 | 0 |
modules/dbnd-airflow-monitor/src/airflow_monitor/multiserver/runners/__init__.py | busunkim96/dbnd | 224 | 1632067 | <reponame>busunkim96/dbnd<gh_stars>100-1000
from airflow_monitor.multiserver.runners.multi_process_runner import MultiProcessRunner
from airflow_monitor.multiserver.runners.sequential_runner import SequentialRunner
RUNNER_FACTORY = {
"seq": SequentialRunner,
"mp": MultiProcessRunner,
}
| 0 | 0 | 0 | 0 | 0 | 0 |
Projects/youtube-gesture-dataset/script/motion_preprocessor.py | DanielMabadeje/Artificial-Intelligence-Deep-Learning-Machine-Learning-Tutorials | 3,266 | 1632069 | # ------------------------------------------------------------------------------
# Copyright (c) ETRI. All rights reserved.
# Licensed under the BSD 3-Clause License.
# This file is part of Youtube-Gesture-Dataset, a sub-project of AIR(AI for Robots) project.
# You can refer to details of AIR project at https://aiforro... | 3 | 10 | 0 | 1 | 14 | 0 |
discum/utils/nonce.py | deepestML/Discord-S.C.U.M | 383 | 1632082 | <reponame>deepestML/Discord-S.C.U.M<gh_stars>100-1000
import time, datetime
def calculateNonce(date="now"):
if date == "now":
date = datetime.datetime.now()
unixts = time.mktime(date.timetuple())
return str((int(unixts)*1000-1420070400000)*4194304) | 0 | 0 | 0 | 0 | 0 | 0 |
myia/operations/__init__.py | strint/myia | 222 | 1632109 | <reponame>strint/myia<filename>myia/operations/__init__.py
"""Myia operations."""
###############################################################################
# THIS FILE IS GENERATED AUTOMATICALLY. DO NOT EDIT! #
# To regenerate this file, run `python scripts/regen.py` ... | 0 | 0 | 0 | 0 | 0 | 0 |
torcms/model/post_model.py | bukun/TorCMS | 243 | 1632119 | <reponame>bukun/TorCMS
# -*- coding:utf-8 -*-
'''
Model for Posts.
'''
import time
from datetime import datetime
import peewee
import tornado.escape
from config import CMS_CFG, DB_CFG
from torcms.core import tools
from torcms.model.abc_model import MHelper
from torcms.model.core_tab import (TabCollect, TabEvaluation,... | 0 | 0 | 0 | 0 | 0 | 0 |
dataprofiler/dp_logging.py | danish-deepsource/DataProfiler | 690 | 1632143 | <reponame>danish-deepsource/DataProfiler<gh_stars>100-1000
import logging
import threading
import sys
_dp_logger = None
_dp_logger_lock = threading.Lock()
def get_logger():
"""Access DataProfiler-specific logger"""
global _dp_logger
# Return _logger if initialized
if _dp_logger:
return _dp_l... | 0 | 0 | 0 | 0 | 0 | 0 |
solution/shortest_path/1719/main.py | jungyoonoh/baekjoon-1 | 2,236 | 1632173 | # Authored by : yj2221
# Co-authored by : -
# Link : http://boj.kr/480b70b04e3b4f5c8dd567bf3bde859c
import heapq
import sys
def input() -> object:
return sys.stdin.readline().rstrip()
n, m = map(int, input().split())
graph = {i:{} for i in range(1, n+1)}
for _ in range(m):
a, b, t = map(int, input().split())... | 0 | 2 | 0 | 0 | 2 | 0 |
ThirdParty/mono/repo/packaging/MacSDK/mono-llvm.py | Marsel24/fonline | 172 | 1632174 | <filename>ThirdParty/mono/repo/packaging/MacSDK/mono-llvm.py
import os
class MonoLlvmPackage (GitHubPackage):
def __init__(self):
GitHubPackage.__init__(self, 'mono', 'llvm', '3.0',
revision='0b3cb8ac12cd839f8110775d4085e822e8af4d7b',
configur... | 0 | 0 | 0 | 0 | 0 | 0 |
Chapter9/hd5pandareader.py | buiksat/Learn-Algorithmic-Trading | 449 | 1632208 | <gh_stars>100-1000
#!/bin/python3
import pandas as pd
import numpy as np
from pandas_datareader import data
import matplotlib.pyplot as plt
import h5py
def load_financial_data(start_date, end_date,output_file):
try:
df = pd.read_pickle(output_file)
print('File data found...reading GOOG data')
e... | 0 | 0 | 0 | 0 | 0 | 0 |
ambiente_virtual/Lib/site-packages/alembic/testing/schemacompare.py | PI-UNIVESP-Penapolis/PRODEA | 358 | 1632212 | from sqlalchemy import schema
from sqlalchemy import util
class CompareTable:
def __init__(self, table):
self.table = table
def __eq__(self, other) -> bool:
if self.table.name != other.name or self.table.schema != other.schema:
return False
for c1, c2 in util.zip_longest(... | 0 | 14 | 0 | 0 | 14 | 0 |
tests/changes/models/test_snapshot.py | vault-the/changes | 443 | 1632286 | <reponame>vault-the/changes
from changes.config import db
from changes.models.project import ProjectOption
from changes.models.snapshot import Snapshot, SnapshotImage, SnapshotStatus
from changes.testutils.cases import TestCase
class TestSnapshotTestCase(TestCase):
def test_snapshot_change_status(self):
p... | 0 | 0 | 0 | 0 | 0 | 0 |
test/tokenize/t38.py | timmartin/skulpt | 2,671 | 1632293 | <gh_stars>1000+
def k(x):
x += 2
x += 5
| 0 | 0 | 0 | 0 | 0 | 0 |
proxy/get_proxy_url.py | nostro-im/pipelines | 2,860 | 1632357 | <reponame>nostro-im/pipelines
#!/usr/bin/env python3
# Copyright 2019 The Kubeflow 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
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/framework/PostProcessors/BasicStatistics/notMultipleLinear/linearModel.py | rinelson456/raven | 159 | 1632363 | # Copyright 2017 Battelle Energy Alliance, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | 0 | 0 | 0 | 0 | 0 | 0 |
rest_registration/api/views/__init__.py | gcbirzan/django-rest-registration | 329 | 1632450 | <filename>rest_registration/api/views/__init__.py<gh_stars>100-1000
from .change_password import change_password # noqa
from .login import login, logout # noqa
from .profile import profile # noqa
from .register import register, verify_registration # noqa
from .register_email import register_email, verify_email # n... | 0 | 0 | 0 | 0 | 0 | 0 |
cea/interfaces/cli/excel_to_dbf.py | architecture-building-systems/cea-toolbox | 121 | 1632473 | """
Use the py:mod:`cea.utilities.dbf` module to convert an excel file to a dbf file.
"""
import os
import cea.config
import cea.inputlocator
import cea.utilities.dbf
def main(config):
"""
Convert an Excel file (*.xls) to a DBF file (*.dbf). The configuration uses the section ``dbf-tools`` with
the pa... | 0 | 0 | 0 | 0 | 0 | 0 |
src/utils/evaluation_utils.py | phuonghx/RTM3D | 268 | 1632474 | <gh_stars>100-1000
"""
# -*- coding: utf-8 -*-
-----------------------------------------------------------------------------------
# Author: <NAME>
# DoC: 2020.08.10
# email: <EMAIL>
-----------------------------------------------------------------------------------
# Description: The utils for evaluation
# Refer from:... | 0 | 0 | 0 | 0 | 0 | 0 |
Code/Chenglong/feature_match.py | ChenglongChen/Kaggle_Homedepot | 465 | 1632483 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
"""
@author: <NAME> <<EMAIL>>
@brief: match based features
"""
import re
import string
import numpy as np
import pandas as pd
import config
from utils import dist_utils, ngram_utils, nlp_utils, np_utils
from utils import logging_utils, time_utils, pkl_utils
from feature_ba... | 0 | 0 | 0 | 0 | 0 | 0 |
test-data/unit/plugins/noentry.py | jag426/mypy | 12,496 | 1632505 | # empty plugin
| 0 | 0 | 0 | 0 | 0 | 0 |
src/oci/blockchain/models/create_blockchain_platform_details.py | Manny27nyc/oci-python-sdk | 249 | 1632526 | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 0 | 14 | 0 | 13 | 27 | 0 |
Additional_File/15_AutoLogin/autologin.py | nomrsavage/Discord-All-Tools-In-One | 197 | 1632530 | import os, sys, time, os.path, pyperclip, pyautogui, ctypes
from colorama import Fore
from selenium import webdriver
def autologin() :
os.system('cls' if os.name == 'nt' else 'clear')
autologintitle()
print(f"""{y}[{w}+{y}]{w} Enter the token of the account you want to connect to""")
entertoken... | 0 | 0 | 0 | 0 | 0 | 0 |
src/quart/flask_patch/app.py | pgjones/quart | 1,085 | 1632532 | <reponame>pgjones/quart<gh_stars>1000+
# The aim is to replace the Quart class exception handling defaults to
# allow for Werkzeug HTTPExceptions to be considered in a special way
# (like the quart HTTPException). In addition a Flask reference is
# created.
from __future__ import annotations
from functools import wrap... | 0 | 0 | 0 | 0 | 0 | 0 |
test/stream-monitor/test/test_log_stream.py | arunrordell/RackHD | 451 | 1632538 | from __future__ import annotations
"""
Copyright (c) 2017 Dell Inc. or its subsidiaries. All Rights Reserved.
"""
import plugin_test_helper
import unittest
from log_stream_helper import TempLogfileChecker
class TestSMPLoggingSingleOk(plugin_test_helper.resolve_helper_class()):
suitepath = plugin_test_helper.resol... | 1 | 1 | 122 | 0 | 124 | 0 |
AHT20_OLED/code.py | gamblor21/Adafruit_Learning_System_Guides | 665 | 1632555 | """ Example for using the AHT20 and OLED with CircuitPython and the Adafruit library"""
import time
import board
import busio
import adafruit_ahtx0
# OLED
import displayio
import terminalio
from adafruit_display_text import label
import adafruit_displayio_ssd1306
displayio.release_displays()
i2c = busio.I2C(board.S... | 0 | 0 | 0 | 0 | 0 | 0 |
base/site-packages/redis_model/queue.py | edisonlz/fastor | 285 | 1632572 | #encoding = utf-8
import sys, os
import time
#import cjson
from redis_model.redis_client import RQueueClient
import json
import sys, traceback
import logging
class RedisQueue(object):
""" Redis Message Queue """
redis = RQueueClient.getInstance().redis
def __init__(self, key):
""" Need Message Q... | 0 | 0 | 0 | 0 | 0 | 0 |
py/google/fhir/stu3/primitive_handler.py | swrobel/fhir | 648 | 1632606 | #
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 5 | 24 | 1 | 0 | 30 | 0 |
tests/builtins/test_all.py | VeliborKrivokuca/batavia | 1,256 | 1632625 | from .. utils import TranspileTestCase, BuiltinFunctionTestCase
class AllTests(TranspileTestCase):
def test_all(self):
self.assertCodeExecution("print(all([None, True, False]))")
def test_all_true(self):
self.assertCodeExecution("print(all([1,True,3]))")
def test_all_false(self):
... | 0 | 0 | 1 | 0 | 1 | 0 |
tools/mo/unit_tests/mo/middle/L2NormFusing_test.py | ryanloney/openvino-1 | 1,127 | 1632653 | # Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import unittest
import numpy as np
from generator import generator, generate
from openvino.tools.mo.middle.L2NormFusing import L2NormToNorm
from openvino.tools.mo.front.common.partial_infer.utils import int64_array
from openvino.tools.... | 0 | 0 | 0 | 0 | 0 | 0 |
test/lib/mayaUsd/nodes/testHdImagingShape.py | ika-rporter/maya-usd | 507 | 1632691 | <filename>test/lib/mayaUsd/nodes/testHdImagingShape.py
#!/usr/bin/env mayapy
#
# Copyright 2020 Pixar
#
# 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/LI... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/syntax/def_positional_after_keyword_arg.py | matan-h/friendly | 287 | 1632710 | """Should raise SyntaxError: positional argument follows keyword argument
"""
test(a=1, b)
| 0 | 0 | 0 | 0 | 0 | 0 |
sdk/python/pulumi_azure/containerservice/registry_scope_map.py | henriktao/pulumi-azure | 109 | 1632723 | <reponame>henriktao/pulumi-azure
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequenc... | 0 | 0 | 0 | 0 | 0 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.