max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 7 115 | max_stars_count int64 101 368k | id stringlengths 2 8 | content stringlengths 6 1.03M |
|---|---|---|---|---|
pynubank/__init__.py | danizord/pynubank | 744 | 53678 | from .exception import NuRequestException, NuException
from .nubank import Nubank
from .utils.mock_http import MockHttpClient
from .utils.http import HttpClient
from .utils.discovery import DISCOVERY_URL
def is_alive(client: HttpClient = None) -> bool:
if client is None:
client = HttpClient()
respons... |
docs/tutorials/masking_audio_signals.py | ZhaoJY1/nussl | 259 | 53721 | # ---
# jupyter:
# jupytext:
# formats: ipynb,py:light
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.5.1
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# Separation via Time-Fre... |
content/test/gpu/gpu_tests/info_collection_test.py | zipated/src | 2,151 | 53726 | <reponame>zipated/src
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from gpu_tests import gpu_integration_test
from gpu_tests.gpu_test_expectations import GpuTestExpectations
import sys
# There are no ... |
docs/circuit.py | smishraIOV/ri-aggregation | 1,274 | 53754 | <reponame>smishraIOV/ri-aggregation
# Citcuit pseudocode
# Data structures
struct op:
# operation data
tx_type: # type of transaction, see the list: https://docs.google.com/spreadsheets/d/1ejK1MJfVehcwjgjVDFD3E2k1EZ7auqbG_y0DKidS9nA/edit#gid=0
chunk: # op chunk number (0..3)
... |
ProofOfConcepts/Vision/OpenMvStereoVision/src/target_code/get_calibration_images_remote_side.py | WoodData/EndpointAI | 190 | 53845 | import image, network, rpc, sensor, struct
import time
import micropython
from pyb import Pin
from pyb import LED
red_led = LED(1)
green_led = LED(2)
blue_led = LED(3)
ir_led = LED(4)
def led_control(x):
if (x&1)==0: red_led.off()
elif (x&1)==1: red_led.on()
if (x&2)==0: green_led.off()
eli... |
textclf/tester/__init__.py | lswjkllc/textclf | 146 | 53851 | <gh_stars>100-1000
from .ml_tester import MLTester
from .dl_tester import DLTester
|
testapps/PY/test_partial.py | naver/pinpoint-c-agent | 178 | 53853 | <gh_stars>100-1000
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from pinpointPy.CommonPlugin import PinpointCommonPlugin
@PinpointCommonPlugin( __name__+".func1")
def func1(a, b="Wool"):
return a + b
|
util/logging.py | PJunhyuk/exercise-pose-guide | 161 | 53870 | <reponame>PJunhyuk/exercise-pose-guide
import logging
def setup_logging():
FORMAT = '%(asctime)-15s %(message)s'
logging.basicConfig(filename='log.txt', filemode='w',
datefmt='%Y-%m-%d %H:%M:%S',
level=logging.INFO, format=FORMAT)
console = logging.StreamHan... |
python/ql/test/3/library-tests/PointsTo/regressions/subprocess-assert/mwe_failure.py | vadi2/codeql | 4,036 | 53890 | <reponame>vadi2/codeql<filename>python/ql/test/3/library-tests/PointsTo/regressions/subprocess-assert/mwe_failure.py
import subprocess
assert subprocess.call(['run-backup']) == 0
class TestCase:
pass
class MyTest(TestCase):
pass
# found by /home/rasmus/code/ql/python/ql/test/query-tests/Statements/asserts/As... |
orchestra/tests/management_commands/test_migrate_certifications.py | code-review-doctor/orchestra | 444 | 53914 | from unittest.mock import patch
from django.core.management import call_command
from django.core.management.base import CommandError
from orchestra.tests.helpers import OrchestraTestCase
class MigrateCertificationsTestCase(OrchestraTestCase):
patch_path = ('orchestra.management.commands.'
'mig... |
src/hg/utils/otto/nextstrainNcov/newick.py | andypohl/kent | 171 | 53934 | # Parse Newick-formatted file into tree of { 'kids': [], 'label': '', 'length': '' }
import logging
from utils import die
def skipSpaces(treeString, offset):
while (offset != len(treeString) and treeString[offset].isspace()):
offset += 1
return offset
def parseQuoted(treeString, offset):
"""Read ... |
zeus/vcs/asserts.py | conrad-kronos/zeus | 221 | 53951 | def assert_revision(revision, author=None, message=None):
"""Asserts values of the given fields in the provided revision.
:param revision: The revision to validate
:param author: that must be present in the ``revision``
:param message: message substring that must be present in ``revision``
"""
... |
test/test_gradcam_guided_backprop.py | giladcohen/darkon | 254 | 54003 | # Copyright 2017 Neosapience, 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 wri... |
03_SweynTooth/libs/scapy/contrib/automotive/gm/gmlanutils.py | Charmve/BLE-Security-Att-Def | 149 | 54053 | #! /usr/bin/env python
# This file is part of Scapy
# See http://www.secdev.org/projects/scapy for more information
# Copyright (C) <NAME> <<EMAIL>>
# Copyright (C) <NAME> <<EMAIL>>
# This program is published under a GPLv2 license
# scapy.contrib.description = GMLAN Utilities
# scapy.contrib.status = loads
import t... |
adet/modeling/blendmask/__init__.py | manusheoran/AdelaiDet_DA | 2,597 | 54091 | <reponame>manusheoran/AdelaiDet_DA
from .basis_module import build_basis_module
from .blendmask import BlendMask
|
Chapter 14/code/ocr.py | shivampotdar/Artificial-Intelligence-with-Python | 387 | 54092 | <gh_stars>100-1000
import numpy as np
import neurolab as nl
# Define the input file
input_file = 'letter.data'
# Define the number of datapoints to
# be loaded from the input file
num_datapoints = 50
# String containing all the distinct characters
orig_labels = 'omandig'
# Compute the number of distinct characters... |
clover/examples/gps.py | lvsoft/clover | 146 | 54139 | # Information: https://clover.coex.tech/en/simple_offboard.html#navigateglobal
import rospy
from clover import srv
from std_srvs.srv import Trigger
import math
rospy.init_node('flight')
get_telemetry = rospy.ServiceProxy('get_telemetry', srv.GetTelemetry)
navigate = rospy.ServiceProxy('navigate', srv.Navigate)
navig... |
grr/client/grr_response_client/client_actions/windows/pipes_test.py | khanhgithead/grr | 4,238 | 54203 | #!/usr/bin/env python
import contextlib
import os
import platform
from typing import Iterator
from typing import Optional
import uuid
from absl.testing import absltest
from grr_response_client.client_actions.windows import pipes
if platform.system() == "Windows":
# pylint: disable=g-import-not-at-top
# pytype: d... |
slack_sdk/web/__init__.py | priya1puresoftware/python-slack-sdk | 2,486 | 54253 | <gh_stars>1000+
"""The Slack Web API allows you to build applications that interact with Slack
in more complex ways than the integrations we provide out of the box."""
from .client import WebClient # noqa
from .slack_response import SlackResponse # noqa
|
hata/discord/http/headers.py | Multiface24111/hata | 173 | 54286 | __all__ = ()
from ...backend.utils import istr
AUDIT_LOG_REASON = istr('X-Audit-Log-Reason')
RATE_LIMIT_REMAINING = istr('X-RateLimit-Remaining')
RATE_LIMIT_RESET = istr('X-RateLimit-Reset')
RATE_LIMIT_RESET_AFTER = istr('X-RateLimit-Reset-After')
RATE_LIMIT_LIMIT = istr('X-RateLimit-Limit')
# to send
RATE_LIMIT_PR... |
proxyclient/tools/reboot.py | EricRabil/m1n1 | 1,604 | 54289 | <filename>proxyclient/tools/reboot.py<gh_stars>1000+
#!/usr/bin/env python3
# SPDX-License-Identifier: MIT
import sys, pathlib
sys.path.append(str(pathlib.Path(__file__).resolve().parents[1]))
from m1n1.setup import *
p.reboot()
|
py/manipulation/props/object_collection.py | wx-b/dm_robotics | 128 | 54320 | # Copyright 2020 DeepMind Technologies Limited.
#
# 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 ag... |
maketrainingimages.py | leidix/images-to-osm | 487 | 54356 | <filename>maketrainingimages.py
import imagestoosm.config as cfg
import os
import QuadKey.quadkey as quadkey
import numpy as np
import shapely.geometry as geometry
from skimage import draw
from skimage import io
import csv
minFeatureClip = 0.3
# make the training data images
# construct index of osm data, each point... |
changes/api/task_details.py | vault-the/changes | 443 | 54413 | <gh_stars>100-1000
from __future__ import absolute_import
from changes.api.base import APIView
from changes.models.task import Task
class TaskDetailsAPIView(APIView):
def _collect_children(self, task):
children = Task.query.filter(
Task.parent_id == task.task_id,
)
results = [... |
tasks/__init__.py | brmson/sts-data | 690 | 54434 | <gh_stars>100-1000
from __future__ import print_function
from __future__ import division
import importlib
from keras.layers.core import Activation
from keras.models import Graph
import numpy as np
import random
import traceback
import pysts.loader as loader
from pysts.kerasts import graph_input_slice, graph_input_pru... |
src/sort/0791.custom-sort-string/custom-sort-string.py | lyphui/Just-Code | 782 | 54445 | <gh_stars>100-1000
class Solution:
def customSortString(self, S: str, T: str) -> str:
return ''.join(sorted(list(T), key=lambda x:S.find(x))) |
tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/utest/data.py | YangHao666666/hawq | 450 | 54453 | <gh_stars>100-1000
import exceptions
class Data:
class DataError(exceptions.ValueError): pass
def __init__(self, value):
self.value = value
def get_value(self):
return self.value
|
OnlineStudy/utils/middlewares.py | NanRenTeam-9/MongoMicroCourse | 132 | 54493 | from django.utils.deprecation import MiddlewareMixin
class MyCors(MiddlewareMixin):
def process_response(self, requesst, response):
response['Access-Control-Allow-Origin'] = '*'
if requesst.method == 'OPTIONS':
response["Access-Control-Allow-Headers"] = "*"
response['Access... |
vectorbt/base/__init__.py | haxdds/vectorbt | 1,787 | 54494 | # Copyright (c) 2021 <NAME>. All rights reserved.
# This code is licensed under Apache 2.0 with Commons Clause license (see LICENSE.md for details)
"""Modules with base classes and utilities for pandas objects, such as broadcasting."""
from vectorbt.base.array_wrapper import ArrayWrapper
__all__ = [
'ArrayWrappe... |
music21/sorting.py | cuthbertLab/music21 | 1,449 | 54499 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Name: sorting.py
# Purpose: Music21 class for sorting
#
# Authors: <NAME>
#
# Copyright: Copyright © 2014-2015 <NAME> and the music21
# Project
# License: BSD, see license.tx... |
pinball/master/blessed_version.py | DotModus/pinball | 1,143 | 54504 | # Copyright 2015, Pinterest, 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 writ... |
mac/pyobjc-framework-Quartz/Examples/Programming with Quartz/BasicDrawing/ColorAndGState.py | albertz/music-player | 132 | 54514 | import sys
from Quartz import *
import Utilities
import array
def doColorSpaceFillAndStroke(context):
theColorSpace = Utilities.getTheCalibratedRGBColorSpace()
opaqueRed = ( 0.663, 0.0, 0.031, 1.0 ) # red,green,blue,alpha
aBlue = ( 0.482, 0.62, 0.871, 1.0 ) # red,green,blue,alpha
# Set the fill ... |
tinynumpy/benchmark.py | Kramer84/tinynumpy | 168 | 54556 | <reponame>Kramer84/tinynumpy<filename>tinynumpy/benchmark.py
# -*- coding: utf-8 -*-
# Copyright (c) 2014, <NAME> and <NAME>
# tinynumpy is distributed under the terms of the MIT License.
""" Benchmarks for tinynumpy
Findings:
* A list of floats costs about 33 bytes per float
* A list if ints costs anout 41 bytes pe... |
tests/test_config.py | Hellowlol/bw_plex | 371 | 54575 | <reponame>Hellowlol/bw_plex
import os
from conftest import TEST_DATA
from bw_plex.config import read_or_make
def test_config():
conf = read_or_make(os.path.join(TEST_DATA, 'test_config.ini'))
assert 'level' not in conf['general']
assert conf['general']['loglevel'] == 'info'
|
cami/scripts/windows.py | hugmyndakassi/hvmi | 677 | 54601 | #
# Copyright (c) 2020 Bitdefender
# SPDX-License-Identifier: Apache-2.0
#
import yaml
import struct
import os
import crc32
from options import get_options_for_os_version
from objects import CamiYAMLObject, CamiObject, CamiAtom, CamiDataTable, FilePointerException, get_all_objects
from common import IntrocoreVersion
fr... |
Chapter08/src/config.py | jvstinian/Python-Reinforcement-Learning-Projects | 114 | 54607 | child_network_params = {
"learning_rate": 3e-5,
"max_epochs": 100,
"beta": 1e-3,
"batch_size": 20
}
controller_params = {
"max_layers": 3,
"components_per_layer": 4,
'beta': 1e-4,
'max_episodes': 2000,
"num_children_per_episode": 10
}
|
Project 14 -- Deep Cardiac Segmentation/rvseg/models/__init__.py | Vauke/Deep-Neural-Networks-HealthCare | 274 | 54629 | <reponame>Vauke/Deep-Neural-Networks-HealthCare
from .convunet import unet
from .dilatedunet import dilated_unet
from .dilateddensenet import dilated_densenet, dilated_densenet2, dilated_densenet3
|
hdlConvertor/__init__.py | the-moog/hdlConvertor | 184 | 54649 | from ._hdlConvertor import HdlConvertorPy as HdlConvertor, ParseException |
optimus/engines/cudf/cudf.py | Pcosmin/Optimus | 1,045 | 54651 | class CUDF:
def __init__(self):
self._cudf = None
|
docs/source/platformdirective.py | mgrundy/sikuli | 1,292 | 54656 | <gh_stars>1000+
from sphinx import addnodes
from sphinx.util.compat import Directive
from sphinx.util.compat import make_admonition
from docutils import nodes
class platform_node(nodes.Admonition, nodes.Element): pass
class PlatformDirective(Directive):
has_content = True
required_arguments = 1
optional_a... |
plugins/example_collector/test/test_config.py | someengineering/resoto | 126 | 54664 | from resotolib.config import Config
from resoto_plugin_example_collector import ExampleCollectorPlugin
def test_config():
config = Config("dummy", "dummy")
ExampleCollectorPlugin.add_config(config)
Config.init_default_config()
# assert Config.example.region is None
|
WebMirror/OutputFilters/SeriesPageCommon.py | fake-name/ReadableWebProxy | 193 | 54691 | <gh_stars>100-1000
import json
import os.path
import cachetools
MIN_RATING_STARS = 2.5
# * 2 to convert from stars to 0-10 range actually used
MIN_RATING_FLOAT = MIN_RATING_STARS * 2
MIN_RATE_CNT = 3
MIN_CHAPTERS = 4
@cachetools.cached(cachetools.TTLCache(100, 60*5))
def _load_lut_internal():
outf = ... |
script_training.py | vartikagpt10/memae-anomaly-detection | 297 | 54734 | import os
import utils
import torch
import torch.nn as nn
from torchvision import transforms
from torch.utils.data import DataLoader
import numpy as np
import data
import scipy.io as sio
from options.training_options import TrainOptions
import utils
import time
from models import AutoEncoderCov3D, AutoEncoderCov3DMem
f... |
flowtorch/distributions/__init__.py | sankethvedula/flowtorch | 207 | 54737 | # Copyright (c) Meta Platforms, Inc
"""
Warning: This file was generated by flowtorch/scripts/generate_imports.py
Do not modify or delete!
"""
from flowtorch.distributions.flow import Flow
from flowtorch.distributions.neals_funnel import NealsFunnel
__all__ = ["Flow", "NealsFunnel"]
|
test/fixtures/python/corpus/assignment.B.py | matsubara0507/semantic | 8,844 | 54738 | <gh_stars>1000+
a, b = 2, 1
c = 1
b, = 1, 2
|
ckan/tests/config/test_middleware.py | jbrown-xentity/ckan | 2,805 | 54746 | # encoding: utf-8
import pytest
import six
from flask import Blueprint
import ckan.plugins as p
from ckan.common import config, _
class MockRoutingPlugin(p.SingletonPlugin):
p.implements(p.IBlueprint)
def get_blueprint(self):
# Create Blueprint for plugin
blueprint = Blueprint(self.name, s... |
designate/tests/unit/scheduler/test_permutations.py | mrlesmithjr/designate | 145 | 54758 | # 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... |
src/genie/libs/parser/iosxe/tests/ShowSnmpMib/cli/equal/golden_output1_expected.py | balmasea/genieparser | 204 | 54777 | expected_output = {
"aal5VccEntry": {"3": {}, "4": {}, "5": {}},
"aarpEntry": {"1": {}, "2": {}, "3": {}},
"adslAtucChanConfFastMaxTxRate": {},
"adslAtucChanConfFastMinTxRate": {},
"adslAtucChanConfInterleaveMaxTxRate": {},
"adslAtucChanConfInterleaveMinTxRate": {},
"adslAtucChanConfMaxInter... |
testing/resources/test_pmatrixprint.py | timgates42/processing.py | 1,224 | 54798 | <filename>testing/resources/test_pmatrixprint.py
a = PMatrix3D()
a.print()
exit()
|
object_detection/serving_script/predict.py | qq2016/kubeflow_learning | 1,165 | 54821 | """ Script to send prediction request.
Usage:
python predict.py --url=YOUR_KF_HOST/models/coco --input_image=YOUR_LOCAL_IMAGE
--output_image=OUTPUT_IMAGE_NAME.
This will save the prediction result as OUTPUT_IMAGE_NAME.
The output image is the input image with the detected bounding boxes.
"""
import argparse
imp... |
src/third_party/swiftshader/third_party/subzero/pydir/gen_test_arith_ll.py | rhencke/engine | 2,151 | 54879 | <filename>src/third_party/swiftshader/third_party/subzero/pydir/gen_test_arith_ll.py
def mangle(op, op_type, signed):
# suffixMap gives the C++ name-mangling suffixes for a function that takes two
# arguments of the given type. The first entry is for the unsigned version of
# the type, and the second entry is fo... |
postprocess/cross_cpu_cluster_graph.py | Reinazhard/freqbench | 121 | 54906 | <gh_stars>100-1000
#!/usr/bin/env python3
import json
import csv
import sys
import matplotlib.pyplot as plt
CPU_LABELS = {
1: "Little",
4: "Big",
6: "Big",
7: "Prime"
}
COL_LABELS = {
"power_mean": "Power (mW)",
"coremark_score": "Performance (iter/s)",
"energy_joules": "Energy (J)",
... |
fabfile.py | fakegit/Lulu | 922 | 54913 | <filename>fabfile.py
# coding=utf-8
from fabric.api import (
local,
)
def test(proxy=False):
cmd = 'PYTHONPATH=./ {} coverage run tests/runtests.py'.format(
'proxychains4 -q' if proxy else ''
)
local(cmd)
def test_download(func):
'''
fab test_download:acfun
'''
cmd = (
... |
service/util/log.py | mutouxia/kamiFaka | 717 | 54920 | <reponame>mutouxia/kamiFaka
import time
# 定义日志记录器
# import sys
# def get_cur_info():
# return sys._getframe().f_code.co_filename + ' 第' + str(sys._getframe().f_lineno)+'行'
# 获取具体路径位置
# get_cur_info()
def log(msg):
with open('service.log','a',encoding='utf=8') as f:
f.write('\n' + time.strftime("%Y-... |
facedancer/devices/keyboard.py | mrh1997/Facedancer | 345 | 54937 | <gh_stars>100-1000
# pylint: disable=unused-wildcard-import, wildcard-import
#
# This file is part of FaceDancer.
#
import asyncio
from typing import Iterable
from . import default_main
from ..future import *
from ..classes.hid.usage import *
from ..clas... |
lib/datasets/wider/convert_face_to_coco.py | AruniRC/detectron-self-train | 128 | 54939 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import h5py
import json
import os
import scipy.misc
import sys
import re
import fnmatch
import datetime
from PIL import Image
import numpy as np
'''
sr... |
sched/adaptdl_sched/supervisor.py | jessezbj/adaptdl | 294 | 55002 | # Copyright 2020 Petuum, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
cvxpy/utilities/eigvals.py | QiuWJX/cvxpy | 556 | 55013 | <filename>cvxpy/utilities/eigvals.py
import numpy as np
import scipy.sparse as spar
import scipy.sparse.linalg as sparla
def is_psd_within_tol(A, tol):
"""
Return True if we can certify that A is PSD (up to tolerance "tol").
First we check if A is PSD according to the Gershgorin Circle Theorem.
If G... |
jsuarez/extra/embyr_deprecated/embyr/tests/loaders/test_objloader.py | jarbus/neural-mmo | 1,450 | 55025 | import unittest
from kivy3.loaders import OBJLoader
class OBJLoaderTest(unittest.TestCase):
pass
if __name__ == '__main__':
unittest.main()
|
AutotestWebD/apps/myadmin/service/TeamPermissionRelationService.py | yangjourney/sosotest | 422 | 55061 | <filename>AutotestWebD/apps/myadmin/service/TeamPermissionRelationService.py
from all_models.models import TbAdminTeamPermissionRelation
class TeamPermissionRelationService(object):
@staticmethod
def updateTeamPermission(teamPermissionData):
tbModel = TbAdminTeamPermissionRelation.objects.filter(id=te... |
vedadet/criteria/losses/builder.py | jie311/vedadet | 424 | 55110 | from vedacore.misc import build_from_cfg, registry
def build_loss(cfg):
return build_from_cfg(cfg, registry, 'loss')
|
cli/tests/commands/job/test_run.py | gaybro8777/klio | 705 | 55187 | <filename>cli/tests/commands/job/test_run.py
# Copyright 2019-2020 Spotify AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
python/example_code/pinpoint-email/test/test_pinpoint_send_email_message_email_api.py | iconara/aws-doc-sdk-examples | 5,166 | 55211 | <reponame>iconara/aws-doc-sdk-examples<filename>python/example_code/pinpoint-email/test/test_pinpoint_send_email_message_email_api.py<gh_stars>1000+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Unit tests for pinpoint_send_email_message_email_api.py.
""... |
data_preparation/make_vad_inputs.py | dweekly/libri-light | 246 | 55225 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import os
from pathlib import Path
import torchaudio
import progressbar
import argparse
import torch
import tqdm
def findAllSeqs(dirName,
extension='.flac',
loadCache=False):
r"""
Lists all the sequences wit... |
homeassistant/components/kef/__init__.py | domwillcode/home-assistant | 30,023 | 55237 | <gh_stars>1000+
"""The KEF Wireless Speakers component."""
|
VA/main/config.py | YuJaceKim/Activity-Recognition-with-Combination-of-Deeply-Learned-Visual-Attention-and-Pose-Estimation | 343 | 55252 | <filename>VA/main/config.py
import numpy as np
import keras.backend as K
K.set_image_data_format('channels_last')
class DataConfig(object):
"""Input frame configuration and data augmentation setup."""
def __init__(self, crop_resolution=(256, 256), image_channels=(3,),
angles=[0], fixed_angle=0,
... |
homeassistant/components/trend/__init__.py | MrDelik/core | 30,023 | 55255 | """A sensor that monitors trends in other components."""
from homeassistant.const import Platform
DOMAIN = "trend"
PLATFORMS = [Platform.BINARY_SENSOR]
|
deslib/base.py | vishalbelsare/DESlib | 310 | 55266 | <reponame>vishalbelsare/DESlib<gh_stars>100-1000
# coding=utf-8
# Author: <NAME> <<EMAIL>>
#
# License: BSD 3 clause
import functools
import math
import warnings
from abc import abstractmethod, ABCMeta
import numpy as np
from scipy.stats import mode
from sklearn.base import BaseEstimator, ClassifierMixin
from sklea... |
DaPy/methods/classifiers/classifier.py | huihui7987/DaPy | 552 | 55273 | from DaPy.core import Series, SeriesSet
from DaPy.core import is_seq
from copy import copy
def proba2label(seq, labels):
if hasattr(seq, 'shape') is False:
seq = SeriesSet(seq)
if seq.shape[1] > 1:
return clf_multilabel(seq, labels)
return clf_binlabel(seq, labels)
def clf_multilabel(seq,... |
tests3/issue802.py | TmaxTW/pyodbc | 2,419 | 55307 | """
This tests ensures that there is no memory leakage
when params.cpp:ExecuteMulti function does conversion of Unicode to Bytes.
In ExecuteMulti function after DoExecute label
SQLExecute returns
One scenario where SQLParamData function will be used is when there is a varchar(max),
a parameter with an unknown size i... |
sparse_operation_kit/sparse_operation_kit/embeddings/get_embedding_op.py | ShaunHeNJU/DeepRec-1 | 292 | 55327 | """
Copyright (c) 2021, NVIDIA CORPORATION.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... |
plugins/syntax_dev/completions.py | thom1729-forks/PackageDev | 288 | 55338 | <gh_stars>100-1000
import re
import sublime
import sublime_plugin
from ..lib.scope_data import COMPILED_HEADS
from ..lib import syntax_paths
from ..lib import inhibit_word_completions
__all__ = (
'SyntaxDefCompletionsListener',
'PackagedevCommitScopeCompletionCommand'
)
# a list of kinds used to denote the... |
exporter/operators/delete_export_collection.py | drewcassidy/blender-tools | 311 | 55347 | """Operator to delete an Export Collection by name."""
from bpy.props import StringProperty
from bpy.types import Operator
from ..functions import get_export_collection_by_name
class EmbarkDeleteExportCollection(Operator): # pylint: disable=too-few-public-methods
"""Deletes the named Export Collection, but lea... |
tests/unicode/unicode_index.py | learnforpractice/micropython-cpp | 13,648 | 55353 | <filename>tests/unicode/unicode_index.py
print("Привет".find("т"))
print("Привет".find("П"))
print("Привет".rfind("т"))
print("Привет".rfind("П"))
print("Привет".index("т"))
print("Привет".index("П"))
|
bin/config.py | database64128/rclone | 18,121 | 55370 | <filename>bin/config.py
#!/usr/bin/env python3
"""
Test program to demonstrate the remote config interfaces in
rclone.
This program can simulate
rclone config create
rclone config update
rclone config password - NOT implemented yet
rclone authorize - NOT implemented yet
Pass the desired action ... |
Contributions/PowerRecursion.py | sattwik21/Hacktoberfest2021-1 | 215 | 55377 | <reponame>sattwik21/Hacktoberfest2021-1<filename>Contributions/PowerRecursion.py<gh_stars>100-1000
# Calculates a^b
def power(a, b):
if b == 0:
return 1
b -= 1
return a*power(a, b)
x = int(input())
y = int(input())
print(power(x, y))
|
tensorboard/data/server/pip_package/install.py | Digitaltransform/tensorboard | 6,139 | 55387 | <reponame>Digitaltransform/tensorboard<gh_stars>1000+
# Copyright 2020 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.o... |
Basic/Calculate Factorial of A Number/SolutionByEnthusiastDeveloper.py | rajethanm4/Programmers-Community | 261 | 55391 | '''
Program Description: Calculate factorial of a given number
'''
def calculate_factorial(n):
if n == 0:
return 1
if n < 0:
raise ValueError
fact = 1
for x in range(1,n+1):
fact *= x
return fact
print('N = ', end='')
try:
result = calculate_factorial(int(input()))
print('Output =', result)
except Val... |
python/runtime/local/submitter_test.py | ikingye/sqlflow | 4,742 | 55406 | <reponame>ikingye/sqlflow
# Copyright 2020 The SQLFlow 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 re... |
python/ql/test/query-tests/Classes/incomplete-ordering/incomplete_ordering.py | vadi2/codeql | 4,036 | 55407 | <reponame>vadi2/codeql
#Incomplete ordering
class PartOrdered(object):
def __eq__(self, other):
return self is other
def __ne__(self, other):
return self is not other
def __hash__(self):
return id(self)
def __lt__(self, other):
return False
#Don't blame a sub-class f... |
onedrive/cli_tool.py | timgates42/python-onedrive | 130 | 55408 | <reponame>timgates42/python-onedrive
#!/usr/bin/env python2
#-*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import itertools as it, operator as op, functools as ft
from os.path import dirname, basename, exists, isdir, join, abspath
from posixpath import join as ujoin, dirname as udirname... |
tests/utils/test_image_utils.py | swershrimpy/gtsfm | 122 | 55438 | import numpy as np
from gtsam import SfmTrack
from gtsfm.common.image import Image
import gtsfm.utils.images as image_utils
def test_get_average_point_color():
""" Ensure 3d point color is computed as mean of RGB per 2d measurement."""
# random point; 2d measurements below are dummy locations (not actual pro... |
scripts/vis_urdf.py | lianghongzhuo/urdfpy | 122 | 55464 | """
Script for visualizing a robot from a URDF.
Author: <NAME>
"""
import argparse
import urdfpy
if __name__ == '__main__':
# Parse Args
parser = argparse.ArgumentParser(
description='Visualize a robot from a URDF file'
)
parser.add_argument('urdf', type=str,
help='Pat... |
collectors/PDChaos.py | gfek/Lepus | 218 | 55466 | import requests
from json import loads
from termcolor import colored
from configparser import RawConfigParser
def init(domain):
PDCH = []
print(colored("[*]-Searching Project Discovery Chaos...", "yellow"))
parser = RawConfigParser()
parser.read("config.ini")
CHAOS_KEY = parser.get("PDChaos", "CHAOS_API_KEY")
... |
env/Lib/site-packages/OpenGL/GLES2/ANGLE/program_binary.py | 5gconnectedbike/Navio2 | 210 | 55469 | '''OpenGL extension ANGLE.program_binary
This module customises the behaviour of the
OpenGL.raw.GLES2.ANGLE.program_binary to provide a more
Python-friendly API
Overview (from the spec)
This extension makes available a program binary format,
PROGRAM_BINARY_ANGLE. It enables retrieving and loading of pre-linked
... |
src/opts/base_opts.py | ParikhKadam/part-affinity | 110 | 55517 | import argparse
import os
class Opts:
def __init__(self):
self.parser = argparse.ArgumentParser()
def init(self):
self.parser.add_argument('-expID', default='default', help='Experiment ID')
self.parser.add_argument('-data', default='default', help='Input data folder')
self.pars... |
flatdata-generator/tests/generators/py_expectations/archives/empty.py | gferon/flatdata | 140 | 55526 | class n_A(flatdata.archive.Archive):
_SCHEMA = """namespace n {
archive A
{
}
}
"""
_NAME = "A"
_RESOURCES = {
"A.archive" : flatdata.archive.ResourceSignature(
container=flatdata.resources.RawData,
initializer=None,
schema=_SCHEMA,
is_optional=False,... |
tests/unit/operations/test_spotops.py | senstb/aws-elastic-beanstalk-cli | 110 | 55580 | # Copyright 2019 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... |
core/process_mask.py | liruilong940607/A-NeRF | 110 | 55583 | <reponame>liruilong940607/A-NeRF
import os
from io import BytesIO
import tarfile
import tempfile
from six.moves import urllib
import time
import numpy as np
from PIL import Image
import cv2, pdb, glob, argparse
import tensorflow as tf
# code borrowed from: https://github.com/senguptaumd/Background-Matting/blob/maste... |
rest_api_models.py | Bariumm/Stocks-Pattern-Analyzer | 136 | 55589 | <filename>rest_api_models.py
from datetime import datetime
from typing import List, Optional
from pydantic import BaseModel
class SuccessResponse(BaseModel):
message: str = "Successful"
class SearchWindowSizeResponse(BaseModel):
sizes: List[int]
class AvailableSymbolsResponse(BaseModel):
symbols: Lis... |
metrics/mahalanobis/mahalanobis.py | MitchellTesla/datasets | 3,395 | 55593 | # Copyright 2021 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.... |
Core/third_party/JavaScriptCore/wasm/generateWasmB3IRGeneratorInlinesHeader.py | InfiniteSynthesis/lynx-native | 677 | 55638 | #!/usr/bin/env python
# Copyright (C) 2016 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:n
#
# 1. Redistributions of source code must retain the above copyright
# notice, this li... |
tafl/pitTafl.py | user01/alpha-zero-general | 2,836 | 55682 | <filename>tafl/pitTafl.py<gh_stars>1000+
# Note: Run this file from Arena directory (the one above /tafl)
import Arena
from MCTS import MCTS
from tafl.TaflGame import TaflGame, display
from tafl.TaflPlayers import *
#from tafl.keras.NNet import NNetWrapper as NNet
import numpy as np
from utils import *
"""
use this... |
1000-1100q/1044.py | rampup01/Leetcode | 990 | 55684 | '''
Given a string S, consider all duplicated substrings: (contiguous) substrings of S that occur 2 or more times. (The occurrences may overlap.)
Return any duplicated substring that has the longest possible length. (If S does not have a duplicated substring, the answer is "".)
Example 1:
Input: "banana"
Output... |
rls/nn/mixers/qatten.py | StepNeverStop/RLs | 371 | 55729 | import numpy as np
import torch as th
import torch.nn as nn
from rls.nn.mlps import MLP
from rls.nn.represent_nets import RepresentationNetwork
class QattenMixer(nn.Module):
def __init__(self,
n_agents: int,
state_spec,
rep_net_params,
agent_o... |
runtime/stdlib/json.py | cheery/lever | 136 | 55760 | <filename>runtime/stdlib/json.py
## Just the JSON decoder, because I only need a decoder for now.
#from rpython.rlib.unicodedata import unicodedb_6_2_0 as unicodedb
from rpython.rlib.listsort import make_timsort_class
from rpython.rlib import rfile
from rpython.rlib.rstring import UnicodeBuilder
from rpython.rlib.objec... |
sergeant/encoder/compressor/__init__.py | adir-intsights/sergeant | 152 | 55796 | from . import _compressor
from . import bzip2
from . import gzip
from . import lzma
from . import zlib
|
src/python/makeGraphs.py | neoremind/luceneutil | 164 | 55817 | <reponame>neoremind/luceneutil
import responseTimeGraph
import loadGraphActualQPS
import sys
import re
import os
reQPS = re.compile(r'\.qps([\.0-9]+)(\.|$)')
rePCT = re.compile(r'\.pct([\.0-9]+)$')
def main(maxQPS = None):
logsDir = sys.argv[1]
warmupSec = int(sys.argv[2])
reportsDir = sys.argv[3]
if maxQPS ... |
grove/grove_sound_sensor.py | Mehmet-Erkan/grove.py | 122 | 55840 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# The MIT License (MIT)
#
# Grove Base Hat for the Raspberry Pi, used to connect grove sensors.
# Copyright (C) 2018 Seeed Technology Co.,Ltd.
'''
This is the code for
- `Grove - Sound Sensor <https://www.seeedstudio.com/Grove-Sound-Sensor-p-752.html>`_
Examples:
... |
examples/ubercorn-rainbow-2x1.py | Robtom5/unicorn-hat-hd | 157 | 55894 | #!/usr/bin/env python
import colorsys
import math
import time
import unicornhathd
print("""Ubercorn rainbow 2x1
An example of how to use a 2-wide by 1-tall pair of Ubercorn matrices.
Press Ctrl+C to exit!
""")
unicornhathd.brightness(0.6)
# Enable addressing for Ubercorn matrices
unicornhathd.enable_addressing... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.