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
tests/providers/google/cloud/hooks/test_secret_manager.py
ChaseKnowlden/airflow
15,947
12642692
<reponame>ChaseKnowlden/airflow # # 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....
core/layout/strategy/VerticalFlowStrategy.py
gregbugaj/TextGenerator
166
12642705
from core.layout.strategy import Strategy class VerticalFlowStrategy(Strategy): """ 生成一个竖直流式排布的文本贴图布局 """ def logic(self, block_group, next_block) -> bool: init_x = block_group.group_box[0] init_y = block_group.group_box[1] next_x = init_x next_y = init_y max_...
model_compiler/tests/model_compiler/compilers/test_tf_model_to_saved_model.py
yuanliya/Adlik
548
12642708
<filename>model_compiler/tests/model_compiler/compilers/test_tf_model_to_saved_model.py<gh_stars>100-1000 # Copyright 2019 ZTE corporation. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 from unittest import TestCase import tensorflow as tf import model_compiler.compilers.tf_model_to_saved_model as compi...
newm/overlay/overlay.py
sadrach-cl/newm
265
12642737
from __future__ import annotations from typing import Optional, TYPE_CHECKING import logging from pywm.touchpad.gestures import Gesture if TYPE_CHECKING: from ..state import LayoutState from ..layout import Layout logger = logging.getLogger(__name__) class Overlay: def __init__(self, layout: Layout) ->...
ple/games/monsterkong/coin.py
jsalvatier/PyGame-Learning-Environment
959
12642759
<filename>ple/games/monsterkong/coin.py __author__ = '<NAME>' import pygame import os from .onBoard import OnBoard class Coin(OnBoard): """ This class defines all our coins. Each coin will increase our score by an amount of 'value' We animate each coin with 5 images A coin inherits from the OnBoar...
examples/ner/utils.py
nlpaueb/GreekBERT
117
12642770
<reponame>nlpaueb/GreekBERT def parse_ner_dataset_file(f): tokens = [] for i, l in enumerate(f): l_split = l.split() if len(l_split) == 0: yield tokens tokens.clear() continue if len(l_split) < 2: continue # todo: fix this else: ...
tutorials/W2D2_LinearSystems/solutions/W2D2_Tutorial2_Solution_30701e58.py
raxosiris/course-content
2,294
12642824
<reponame>raxosiris/course-content # hint: see np.diff() inter_switch_intervals = np.diff(switch_times) # plot inter-switch intervals with plt.xkcd(): plot_interswitch_interval_histogram(inter_switch_intervals)
tests/unit/test_plot_elements.py
olavolav/textplot
156
12642885
<filename>tests/unit/test_plot_elements.py import numpy as np # type: ignore from uniplot.plot_elements import character_for_2by2_pixels ###################################### # Testing: character_for_2by2_pixels # ###################################### def test_empty_square(): square = np.zeros([2, 2]) a...
python2/rosmln/src/rosmln/srv/__init__.py
seba90/pracmln
123
12642889
<filename>python2/rosmln/src/rosmln/srv/__init__.py from ._MLNInterface import *
examples/beamforming_time_domain.py
HemaZ/pyroomacoustics
915
12642912
""" This is a longer example that applies time domain beamforming towards a source of interest in the presence of a strong interfering source. """ from __future__ import division, print_function import os import numpy as np import matplotlib.pyplot as plt from scipy.io import wavfile import pyroomacoustics as pra fr...
tests/tissue_masks/test_luminosity_threshold_tissue_locator.py
BostonMeditechGroup/StainTools
197
12642926
<gh_stars>100-1000 import sys import unittest from unittest.mock import Mock import numpy as np sys.modules['spams'] = Mock() from staintools.tissue_masks.luminosity_threshold_tissue_locator import LuminosityThresholdTissueLocator from staintools.utils.exceptions import TissueMaskException class TestLuminosityThres...
cort/test/core/test_mention_extractor.py
leonardoboliveira/cort
141
12642946
import unittest import nltk from cort.core import documents from cort.core import mention_extractor from cort.core import mentions from cort.core import spans __author__ = 'smartschat' class TestMentionExtractor(unittest.TestCase): def setUp(self): self.real_example = """#begin document (bn/voa/02/voa...
tools/xrdb2dynamic_color.py
yous/iTerm2-Color-Schemes
21,573
12642974
<filename>tools/xrdb2dynamic_color.py #!/usr/bin/env python3 # This script converts xrdb (X11) color scheme format to xterm style # dynamic color OSC escape sequence scripts. # The generated scripts allow changing the theme of the terminal # on the fly. xterm, urxvt and wezterm are known to support these # sequences....
backend/data/jimm/models/layers/norm.py
MikeOwino/JittorVis
139
12643013
""" Copyright VIP Group Licensed under the Apache License, Version 2.0. Modify from https://github.com/rwightman/pytorch-image-models Original copyright of <NAME> below, modifications by VIP Group Hacked together by / copyright <NAME> """ import jittor as jt import jittor.nn as nn import jittor.nn as F ...
applications/nightly_build/test_segnet.py
TomWildenhain-Microsoft/keras-onnx
362
12643065
<gh_stars>100-1000 # SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import keras_segmentation from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../tests/')) from test_utils import run_image img_path = os.path.join(os.path.dirname(__file__), ...
exercises/ja/exc_03_06.py
Jette16/spacy-course
2,085
12643113
import spacy # カスタムコンポーネントを定義 def length_component(doc): # docの長さを取得 doc_length = ____ print(f"この文章は {doc_length} トークンの長さです。") # docを返す ____ # 小サイズの日本語モデルを読み込む nlp = spacy.load("ja_core_news_sm") # パイプラインの最初にコンポーネントを追加し、パイプラインの名前を表示 ____.____(____) print(nlp.pipe_names) # テキストを処理 doc = ____
bertModel.py
mangoeyes/FinBERT
194
12643173
<gh_stars>100-1000 from __future__ import print_function, division import torch import torch.nn as nn import torch.optim as optim from pytorch_pretrained_bert import BertTokenizer, BertModel, BertForMaskedLM, BertConfig class BertClassification(nn.Module): def __init__(self, weight_path, num_labels=2, vocab="b...
gtsfm/frontend/detector_descriptor/sift.py
swershrimpy/gtsfm
122
12643174
"""SIFT Detector-Descriptor implementation. The detector was proposed in 'Distinctive Image Features from Scale-Invariant Keypoints' and is implemented by wrapping over OpenCV's API. References: - https://www.cs.ubc.ca/~lowe/papers/ijcv04.pdf - https://docs.opencv.org/3.4.2/d5/d3c/classcv_1_1xfeatures2d_1_1SIFT.html ...
graphinvent/gnn/summation_mpnn.py
gooaah/GraphINVENT
211
12643205
<reponame>gooaah/GraphINVENT """ Defines the `SummationMPNN` class. """ # load general packages and functions from collections import namedtuple import torch class SummationMPNN(torch.nn.Module): """ Abstract `SummationMPNN` class. Specific models using this class are defined in `mpnn.py`; these are MNN, ...
tests/python/twitter/common/decorators/test_lru_cache.py
zhouyijiaren/commons
1,143
12643217
# ================================================================================================== # Copyright 2011 Twitter, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
Game8/modules/sprites/turret.py
ttkaixin1998/pikachupythongames
4,013
12643218
<gh_stars>1000+ ''' Function: 炮塔类 作者: Charles 微信公众号: Charles的皮卡丘 ''' import pygame from .arrow import Arrow '''炮塔类''' class Turret(pygame.sprite.Sprite): def __init__(self, turret_type, cfg): assert turret_type in range(3) pygame.sprite.Sprite.__init__(self) self.cfg = cfg ...
paas-ce/paas/esb/esb/component/base.py
renmcc/bk-PaaS
767
12643299
<reponame>renmcc/bk-PaaS # -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not u...
web/search/migrations/0001_initial.py
ChiChou/wiggle
110
12643323
# Generated by Django 2.2 on 2019-04-24 10:04 from django.db import migrations, models import django.db.models.deletion import libs.field class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Executable', ...
cloudml-template/examples/classification/census/trainer/metadata.py
tmatsuo/cloudml-samples
1,552
12643324
<reponame>tmatsuo/cloudml-samples<gh_stars>1000+ #!/usr/bin/env python # Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.a...
applications/cli/commands/predict/tests/test_stream.py
nparkstar/nauta
390
12643330
<filename>applications/cli/commands/predict/tests/test_stream.py<gh_stars>100-1000 # # Copyright (c) 2019 Intel 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...
moz_sp/extractors/foreign_key_extractor.py
sythello/TabularSemanticParsing
141
12643347
# encoding: utf-8 """ Copyright (c) 2020, salesforce.com, inc. All rights reserved. SPDX-License-Identifier: BSD-3-Clause For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause Traverse a SQL AST and extract table fields that have co-occurred in a conditional...
examples/pybullet/gym/pybullet_envs/examples/dominoes.py
felipeek/bullet3
9,136
12643357
import pybullet_data as pd import pybullet_utils as pu import pybullet from pybullet_utils import bullet_client as bc import time p = bc.BulletClient(connection_mode=pybullet.GUI) p.setAdditionalSearchPath(pd.getDataPath()) p.loadURDF("plane_transparent.urdf", useMaximalCoordinates=True) p #.setPhysicsEngineParameter...
test_autolens/analysis/test_subhalo.py
Jammy2211/AutoLens
114
12643364
import numpy as np import autofit as af import autolens as al from autolens.lens.subhalo import SubhaloResult class TestSubhaloResult: def test__result_derived_properties(self): lower_limit_lists = [[0.0, 0.0], [0.0, 0.5], [0.5, 0.0], [0.5, 0.5]] grid_search_result = af.GridSearchRe...
src/gamesbyexample/affinecipher.py
spp2/PythonStdioGames
736
12643365
<reponame>spp2/PythonStdioGames """Affine Cipher, by <NAME> <EMAIL> The affine cipher is a simple substitution cipher that uses addition and multiplication to encrypt and decrypt symbols. More info at: https://en.wikipedia.org/wiki/Affine_cipher This and other games are available at https://nostarch.com/XX Tags: large,...
sandbox/linux/bpf_dsl/golden/generate.py
zealoussnow/chromium
14,668
12643367
<reponame>zealoussnow/chromium<filename>sandbox/linux/bpf_dsl/golden/generate.py # Copyright 2015 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. import os import sys arches = ['i386', 'x86-64'] goldens = {} for fn in s...
tods/sk_interface/detection_algorithm/COF_skinterface.py
ZhuangweiKang/tods
544
12643405
import numpy as np from ..base import BaseSKI from tods.detection_algorithm.PyodCOF import COFPrimitive class COFSKI(BaseSKI): def __init__(self, **hyperparams): super().__init__(primitive=COFPrimitive, **hyperparams) self.fit_available = True self.predict_available = True self.produce_available = False
python_utils/__init__.py
xzabg/fast-adversarial
520
12643467
# -------------------------------------------------------- # Python Utils # Copyright (c) 2015 UC Berkeley # Licensed under The MIT License [see LICENSE for details] # Written by <NAME> # --------------------------------------------------------
rl_games/envs/test_network.py
Zhehui-Huang/rl_games
193
12643489
import torch from torch import nn import torch.nn.functional as F class TestNet(nn.Module): def __init__(self, params, **kwargs): nn.Module.__init__(self) actions_num = kwargs.pop('actions_num') input_shape = kwargs.pop('input_shape') num_inputs = 0 assert(type(input_shap...
halogen/mfbot.py
0xkyle/halogen
174
12643517
import argparse import glob import os from lib.parser import get_file from lib.generator import yara_image_rule_maker from lib.render import yara_print_rule class MFBot: """ Malicious File Bot Class """ def __init__(self) -> None: args = MFBot.parse_args() self.yara_base_file = a...
tests/correlation_test.py
sethvargo/vaex
337
12643523
import numpy as np import vaex def test_correlation(): df = vaex.example() # A single column pair xy = yx = df.correlation('x', 'y') xy_expected = np.corrcoef(df.x.values, df.y.values)[0,1] np.testing.assert_array_almost_equal(xy, xy_expected, decimal=5) np.testing.assert_array_almost_equal...
python/fate_client/flow_sdk/client/api/job.py
QuantumA/FATE
715
12643524
# # Copyright 2019 The FATE Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
python/src/nnabla/experimental/trainers/updater.py
daniel-falk/nnabla
2,792
12643527
# Copyright 2019,2020,2021 Sony 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...
software/vna_controller/adc_bbone_init.py
loxodes/Vector-Network-Analyzer
173
12643572
# script to bit-bang ad9864 initialiation over SPI for fixed 45 MHz IF # (use bit-banged SPI, initialization adc initialization only happens once # save the hardware SPI for more exciting things like controlling the synth) # currently hardcoded for assuming 26 MHz ref and adc clk import time import pdb from bbone_spi...
libnd4j/include/graph/generated/nd4j/graph/UIHistogram.py
rghwer/testdocs
13,006
12643581
<reponame>rghwer/testdocs<filename>libnd4j/include/graph/generated/nd4j/graph/UIHistogram.py # automatically generated by the FlatBuffers compiler, do not modify # namespace: graph import flatbuffers class UIHistogram(object): __slots__ = ['_tab'] @classmethod def GetRootAsUIHistogram(cls, buf, offset):...
networks/graph_cmr/utils/__init__.py
solomon-ma/PaMIR
374
12643584
from .saver import CheckpointSaver from .data_loader import CheckpointDataLoader from .base_trainer import BaseTrainer from .train_options import TrainOptions from .mesh import Mesh
tests/test_compile.py
strint/myia
222
12643629
from myia.abstract import from_value from myia.operations import ( array_getitem, array_setitem, bool_and, partial, primitives as P, scalar_add, tagged, ) from myia.pipeline import standard_pipeline, steps from myia.testing.common import MA, MB, Point from myia.testing.multitest import mt, r...
py/tests/unit/with_runtime_sparkling/test_w2v.py
krmartin/sparkling-water
990
12643637
<gh_stars>100-1000 # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"...
env/Lib/site-packages/argon2/_legacy.py
andresgreen-byte/Laboratorio-1--Inversion-de-Capital
193
12643649
<reponame>andresgreen-byte/Laboratorio-1--Inversion-de-Capital # SPDX-License-Identifier: MIT """ Legacy mid-level functions. """ import os from typing import Optional from ._password_hasher import ( DEFAULT_HASH_LENGTH, DEFAULT_MEMORY_COST, DEFAULT_PARALLELISM, DEFAULT_RANDOM_SALT_LENGTH, DEFAU...
chips/compiler/utils.py
dillonhuff/Chips-2.0
221
12643660
from numpy import uint32 from numpy import int32 from numpy import uint64 import struct def calculate_jumps(instructions, extract_constants=False): """change symbolic labels into numeric addresses""" # calculate the values of jump locations location = 0 labels = {} initial_contents = {} new_i...
home-assistant/custom_components/meteo-swiss/weather.py
twhite96/smart-home-setup
190
12643672
<filename>home-assistant/custom_components/meteo-swiss/weather.py<gh_stars>100-1000 from hamsclient import meteoSwissClient import datetime import logging import voluptuous as vol import re import sys import homeassistant.core as hass from homeassistant.components.weather import ( ATTR_FORECAST_CONDITION, ...
SAN/lib/cluster/cluster.py
yerang823/landmark-detection
612
12643676
############################################################## ### Copyright (c) 2018-present, <NAME> ### ### Style Aggregated Network for Facial Landmark Detection ### ### Computer Vision and Pattern Recognition, 2018 ### ############################################################## import num...
run.py
mwielgoszewski/jython-burp-api
134
12643715
# -*- coding: utf-8 -*- from java.lang import System from org.python.util import JLineConsole, PythonInterpreter import logging import os.path import sys import time def start_burp(options, *args): sys.path.extend([os.path.join('java', 'src'), options.burp]) from burp_extender import BurpExtender as MyBurp...
unittests/tools/test_blackduck_parser.py
M-Rod101/django-DefectDojo
249
12643724
<reponame>M-Rod101/django-DefectDojo<filename>unittests/tools/test_blackduck_parser.py from ..dojo_test_case import DojoTestCase, get_unit_tests_path from dojo.tools.blackduck.parser import BlackduckParser from dojo.models import Test from pathlib import Path class TestBlackduckHubParser(DojoTestCase): def test_b...
utils/lit/lit/ShCommands.py
clayne/DirectXShaderCompiler
1,192
12643756
<filename>utils/lit/lit/ShCommands.py<gh_stars>1000+ class Command: def __init__(self, args, redirects): self.args = list(args) self.redirects = list(redirects) def __repr__(self): return 'Command(%r, %r)' % (self.args, self.redirects) def __eq__(self, other): if not isinst...
plyer/platforms/android/gravity.py
EdwardCoventry/plyer
1,184
12643766
<filename>plyer/platforms/android/gravity.py ''' Android gravity --------------------- ''' from jnius import autoclass from jnius import cast from jnius import java_method from jnius import PythonJavaClass from plyer.facades import Gravity from plyer.platforms.android import activity Context = autoclass('android.con...
plugins/modules/oci_log_analytics_scheduled_task.py
slmjy/oci-ansible-collection
108
12643786
#!/usr/bin/python # Copyright (c) 2020, 2021 Oracle and/or its affiliates. # This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Apache License v2.0 # See LICENSE.TXT for d...
peering_manager/views/generics.py
jasjukaitis/peering-manager
127
12643791
import logging from django.conf import settings from django.contrib import messages from django.contrib.auth.mixins import ( PermissionRequiredMixin as _PermissionRequiredMixin, ) from django.contrib.contenttypes.models import ContentType from django.core.exceptions import FieldDoesNotExist, ValidationError from d...
atlas/foundations_core_cli/src/test/job_submission/test_config.py
DeepLearnI/atlas
296
12643797
<gh_stars>100-1000 from foundations_spec import * from foundations_core_cli.job_submission.config import load class TestJobSubmissionConfig(Spec): mock_config_listing_klass = let_patch_mock_with_conditional_return('foundations_core_cli.typed_config_listing.TypedConfigListing') exit_mock = let_patch_mock...
benchmarks/media-streaming/dataset/files/filegen/video_gen.py
jonasbn/cloudsuite
103
12643867
import re from subprocess import call import os from sys import argv from random import randint video_io_filenames ={} config_param_path = None video_file_info_path = None textpaths_dir = None output_videos_dir = None file_resolution_info = None videos_path = None videos_js_path = None def bytes_to_MB(number_of_bytes)...
habitat_baselines/motion_planning/motion_plan.py
srama2512/habitat-api
355
12643884
#!/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 glob import os import os.path as osp import sys import uuid from typing import Callable, List, Optional import n...
mmf/datasets/builders/vinvl/dataset.py
sisilmehta2000/mmf
3,252
12643887
<reponame>sisilmehta2000/mmf<gh_stars>1000+ # Copyright (c) Facebook, Inc. and its affiliates. import json import logging import random from mmf.datasets.mmf_dataset import MMFDataset logger = logging.getLogger(__name__) class VinVLDataset(MMFDataset): """The VinVL dataset is a dataset that augments an existin...
tools/android/modularization/convenience/lookup_dep.py
iridium-browser/iridium-browser
575
12643912
#!/usr/bin/env python3 # Copyright 2021 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. r'''Finds which build target(s) contain a particular Java class. This is a utility script for finding out which build target dependenc...
auto_editor/__init__.py
brighteyed/auto-editor
835
12643926
'''__init__.py''' __version__ = '21.40.2dev' version = '21w40b-dev'
att_classification/tflib/data/__init__.py
sageprogrammer/STGAN
405
12643983
from __future__ import absolute_import from __future__ import division from __future__ import print_function from tflib.data.dataset import * from tflib.data.disk_image import * from tflib.data.memory_data import * from tflib.data.tfrecord import * from tflib.data.tfrecord_creator import *
merge_two_sorted_lists/solution.py
mahimadubey/leetcode-python
528
12643991
""" Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. """ # Definition for singly-linked list. # class ListNode(object): # def __init__(self, x): # self.val = x # self.next = None class Solution(object): ...
deep-rl/lib/python2.7/site-packages/OpenGL/raw/GLES2/NV/framebuffer_blit.py
ShujaKhalid/deep-rl
210
12644010
<reponame>ShujaKhalid/deep-rl '''Autogenerated by xml_generate script, do not edit!''' from OpenGL import platform as _p, arrays # Code generation uses this from OpenGL.raw.GLES2 import _types as _cs # End users want this... from OpenGL.raw.GLES2._types import * from OpenGL.raw.GLES2 import _errors from OpenGL.constant...
ethtx/decoders/semantic/decoder.py
0xbhoori/ethtx
238
12644015
<reponame>0xbhoori/ethtx # Copyright 2021 DAI Foundation # # 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...
netutils_linux_hardware/memory.py
strizhechenko/netutils-linux
749
12644018
<filename>netutils_linux_hardware/memory.py # coding=utf-8 import yaml from six import iteritems from netutils_linux_hardware.grade import Grade from netutils_linux_hardware.parser import YAMLLike, Parser from netutils_linux_hardware.subsystem import Subsystem class Memory(Subsystem): """ Everything about Memory...
bf3s/algorithms/selfsupervision/fewshot_selfsupervision_rotation.py
alisure-fork/BF3S
130
12644027
<gh_stars>100-1000 import torch import bf3s.algorithms.algorithm as algorithm import bf3s.algorithms.fewshot.utils as fs_utils import bf3s.algorithms.selfsupervision.rotation_utils as rot_utils import bf3s.utils as utils class FewShotRotationSelfSupervision(algorithm.Algorithm): """Trains a few-shot model with t...
ptpython/filters.py
facingBackwards/ptpython
3,022
12644034
<reponame>facingBackwards/ptpython<gh_stars>1000+ from typing import TYPE_CHECKING from prompt_toolkit.filters import Filter if TYPE_CHECKING: from .python_input import PythonInput __all__ = ["HasSignature", "ShowSidebar", "ShowSignature", "ShowDocstring"] class PythonInputFilter(Filter): def __init__(self...
pokemongo_bot/walkers/polyline_walker.py
timgates42/PokemonGo-Bot
5,362
12644052
<gh_stars>1000+ from __future__ import absolute_import from geographiclib.geodesic import Geodesic from pokemongo_bot.walkers.step_walker import StepWalker from .polyline_generator import PolylineObjectHandler from pokemongo_bot.human_behaviour import random_alt_delta class PolylineWalker(StepWalker): def get_ne...
eod/plugins/yolox/models/neck/__init__.py
Helicopt/EOD
196
12644056
from .pafpn import YoloxPAFPN # noqa
tests/test_sentry.py
Smlep/fastapi-jsonrpc
155
12644061
<gh_stars>100-1000 """Test fixtures copied from https://github.com/getsentry/sentry-python/ TODO: move integration to sentry_sdk """ import pytest import sentry_sdk from sentry_sdk import Transport from sentry_sdk.utils import capture_internal_exceptions @pytest.fixture def probe(ep): @ep.method() def probe...
elex/__init__.py
jameswilkerson/elex
183
12644064
import os import requests import tempfile from cachecontrol import CacheControl from cachecontrol.caches import FileCache from elex.cachecontrol_heuristics import EtagOnlyCache __version__ = '2.4.3' _DEFAULT_CACHE_DIRECTORY = os.path.join(tempfile.gettempdir(), 'elex-cache') API_KEY = os.environ.get('AP_API_KEY', No...
dojo/db_migrations/0134_sonarque_cobaltio_removal.py
mtcolman/django-DefectDojo
249
12644086
# Generated by Django 3.1.13 on 2021-11-04 06:26 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('dojo', '0133_finding_service'), ] operations = [ migrations.RemoveField( model_name='sonarqube_product', name='product', ...
docs/examples/robot_pots_2.py
codecademy-engineering/gpiozero
743
12644093
<reponame>codecademy-engineering/gpiozero<gh_stars>100-1000 from gpiozero import Robot, Motor, MCP3008 from gpiozero.tools import scaled from signal import pause robot = Robot(left=Motor(4, 14), right=Motor(17, 18)) left_pot = MCP3008(0) right_pot = MCP3008(1) robot.source = zip(scaled(left_pot, -1, 1), scaled(right...
authlib/oidc/core/__init__.py
minddistrict/authlib
3,172
12644117
<reponame>minddistrict/authlib """ authlib.oidc.core ~~~~~~~~~~~~~~~~~ OpenID Connect Core 1.0 Implementation. http://openid.net/specs/openid-connect-core-1_0.html """ from .models import AuthorizationCodeMixin from .claims import ( IDToken, CodeIDToken, ImplicitIDToken, HybridIDToken, UserIn...
flow/python/S3DET.py
magical-eda/MAGICAL
119
12644119
# # @file S3DET.py # @author <NAME> # @date 10/02/2019 # @brief The class for generating system symmetry constraints using graph similarity # import magicalFlow import networkx as nx from itertools import combinations import GraphSim import matplotlib.pyplot as plt clk_set = {"clk", "clksb", "clks_boost", "clkb", "clk...
tools/ipc_fuzzer/play_testcase.py
kjthegod/chromium
231
12644130
#!/usr/bin/env python # Copyright 2013 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. """Wrapper around chrome. Replaces all the child processes (renderer, GPU, plugins and utility) with the IPC fuzzer. The fuzzer will t...
setup.py
alpxp/co2meter
232
12644145
<filename>setup.py from setuptools import setup GITHUB_URL = 'http://github.com/vfilimonov/co2meter' exec(open('co2meter/_version.py').read()) # Long description to be published in PyPi LONG_DESCRIPTION = """ **CO2meter** is a Python interface to the USB CO2 monitor with monitoring and logging tools, flask web-serve...
src/main/python/tensorframes/core_test.py
ai2008/-
789
12644167
from __future__ import print_function from pyspark import SparkContext from pyspark.sql import DataFrame, SQLContext from pyspark.sql import Row from pyspark.sql.functions import col import tensorflow as tf import pandas as pd import tensorframes as tfs from tensorframes.core import _java_api class TestCore(object)...
tests/test_agent.py
cdowney/python-nomad
109
12644197
import pytest import os from nomad.api import exceptions as nomad_exceptions # integration tests requires nomad Vagrant VM or Binary running def test_get_agent(nomad_setup): assert isinstance(nomad_setup.agent.get_agent(), dict) == True def test_get_members(nomad_setup): m = nomad_setup.agent.get_members() ...
third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/localpaths.py
wenfeifei/miniblink49
5,964
12644202
<reponame>wenfeifei/miniblink49 import os import sys here = os.path.abspath(os.path.split(__file__)[0]) repo_root = os.path.abspath(os.path.join(here, os.pardir)) sys.path.insert(0, os.path.join(repo_root, "tools")) sys.path.insert(0, os.path.join(repo_root, "tools", "six")) sys.path.insert(0, os.path.join(repo_root,...
tensorflow_graphics/projects/points_to_3Dobjects/utils/plot.py
Liang813/graphics
2,759
12644213
# Copyright 2020 The TensorFlow 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
couchbase/tests_v3/cases/analyticsmgmt_t.py
couchbase/couchbase-python-client
189
12644233
# -*- coding:utf-8 -*- # # Copyright 2020, Couchbase, 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 re...
tests/test/coverage/test_ternery_branches.py
x3devships/brownie
1,595
12644234
#!/usr/bin/python3 def test_ternery1(evmtester, branch_results): evmtester.terneryBranches(1, True, False, False, False) results = branch_results() assert [2582, 2583] in results[True] assert [2610, 2611] in results[False] evmtester.terneryBranches(1, False, False, False, False) results = bra...
tests/utils/test_capture_stdout.py
ai-fast-track/mantisshrimp
580
12644235
<reponame>ai-fast-track/mantisshrimp<gh_stars>100-1000 from icevision.all import * def test_capture_stdout_simple(): with CaptureStdout() as out: print("mantis") print("shrimp") assert out == ["mantis", "shrimp"] def test_capture_stdout_propagate(): with CaptureStdout() as out1: ...
pylayers/mobility/ban/test/test_body.py
usmanwardag/pylayers
143
12644247
from pylayers.mobility.ban.body import * from pylayers.mobility.trajectory import * t = Trajectory() bc = Body()
src/ethereum/tangerine_whistle/utils/__init__.py
petertdavies/execution-specs
102
12644275
<reponame>petertdavies/execution-specs """ Tangerine Whistle Utility Functions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. contents:: Table of Contents :backlinks: none :local: Introduction ------------ Utility functions used in this tangerine whistle version of specification. """
tools/rust_analyzer/deps.bzl
yesudeep/rules_rust
349
12644283
<filename>tools/rust_analyzer/deps.bzl<gh_stars>100-1000 """ The dependencies for running the gen_rust_project binary. """ load("//tools/rust_analyzer/raze:crates.bzl", "rules_rust_tools_rust_analyzer_fetch_remote_crates") def rust_analyzer_deps(): rules_rust_tools_rust_analyzer_fetch_remote_crates() # For legac...
tools/vis_utils.py
PeterouZh/improved-nerfmm
153
12644284
from models.volume_rendering import volume_render import torch import numpy as np from tqdm import tqdm def get_rays_opencv_np(intrinsics: np.ndarray, c2w: np.ndarray, H: int, W: int): ''' ray batch sampling < opencv / colmap convention, standard pinhole camera > the camera is facing [+z] dir...
homeassistant/components/uvc/__init__.py
domwillcode/home-assistant
30,023
12644287
<reponame>domwillcode/home-assistant """The uvc component."""
Chapter02/indices.py
shoshan/Clean-Code-in-Python
402
12644295
<gh_stars>100-1000 """Indexes and slices Getting elements by an index or range """ import doctest def index_last(): """ >>> my_numbers = (4, 5, 3, 9) >>> my_numbers[-1] 9 >>> my_numbers[-3] 5 """ def get_slices(): """ >>> my_numbers = (1, 1, 2, 3, 5, 8, 13, 21) >>> my_numbers...
Lib/test/test_compiler/testcorpus/40_import.py
diogommartins/cinder
1,886
12644316
<filename>Lib/test/test_compiler/testcorpus/40_import.py<gh_stars>1000+ import foo import foo2, bar import foo3 as baz import foo.bar.baz
isserviceup/helpers/exceptions.py
EvgeshaGars/is-service-up
182
12644355
from flask import jsonify from werkzeug.exceptions import HTTPException class ApiException(Exception): def __init__(self, message, status_code=400, **kwargs): super(ApiException, self).__init__() self.message = message self.status_code = status_code self.extra = kwargs def format...
tests/runtime/test_unbound_local_error.py
matan-h/friendly
287
12644374
<reponame>matan-h/friendly # More complex example than needed - used for documentation import friendly spam_missing_global = 1 spam_missing_both = 1 def outer_missing_global(): def inner(): spam_missing_global += 1 inner() def outer_missing_nonlocal(): spam_missing_nonlocal = 1 def inner(): ...
mayan/apps/locales/migrations/0002_auto_20210130_0324.py
nattangwiwat/Mayan-EDMS-recitation
343
12644407
from django.db import migrations def code_copy_locales(apps, schema_editor): UserLocaleProfile = apps.get_model( app_label='common', model_name='UserLocaleProfile' ) UserLocaleProfileNew = apps.get_model( app_label='locales', model_name='UserLocaleProfileNew' ) for locale_profile ...
airsenal/scripts/parse_fixtures.py
Tdarnell/AIrsenal
144
12644470
#!/usr/bin/env python """ quick'n'dirty script to parse text cut'n'pasted off the FPL site, and put into a csv file. Needs 'dateparser' package. """ import re import dateparser infile = open("../data/gameweeks.txt") with open("../data/fixtures.csv", "w") as outfile: outfile.write("gameweek,date,home_team,away...
itest/test_http_api.py
kooiot/siridb-server
349
12644478
<filename>itest/test_http_api.py<gh_stars>100-1000 import requests import json from testing import gen_points import asyncio import functools import random import time import math import re import qpack from testing import Client from testing import default_test_setup from testing import gen_data from testing import ge...
probtorch/objectives/__init__.py
alicanb/probtorch
876
12644492
<filename>probtorch/objectives/__init__.py<gh_stars>100-1000 from . import montecarlo from . import importance from . import marginal
test/runtime/test_vqeprogram.py
jschuhmac/qiskit-nature
132
12644501
# This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
tests/scripts/thread-cert/network_diag.py
AdityaHPatwardhan/openthread
2,962
12644526
#!/usr/bin/env python3 # # Copyright (c) 2020, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # ...
bcs-ui/backend/tests/resources/namespace/test_namespace_quota.py
laodiu/bk-bcs
599
12644537
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in co...
exp.voc/voc8.res50v3+.GCT/train.py
Yongjin-colin-choi/TorchSemiSeg
268
12644539
from __future__ import division import os.path as osp import os import sys import time import argparse import math from tqdm import tqdm import torch import torch.nn as nn import torch.nn.functional as F import torch.distributed as dist import torch.backends.cudnn as cudnn from config import config from dataloader im...
pfrl/nn/branched.py
g-votte/pfrl
824
12644550
<filename>pfrl/nn/branched.py import torch class Branched(torch.nn.Module): """Module that calls forward functions of child modules in parallel. When the `forward` method of this module is called, all the arguments are forwarded to each child module's `forward` method. The returned values from the c...