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
extraPackages/matplotlib-3.0.3/examples/subplots_axes_and_figures/gridspec_multicolumn.py
dolboBobo/python3_ios
130
11024070
<gh_stars>100-1000 """ ======================================================= Using Gridspec to make multi-column/row subplot layouts ======================================================= `.GridSpec` is a flexible way to layout subplot grids. Here is an example with a 3x3 grid, and axes spanning all three columns,...
sahara/tests/unit/service/validation/test_validation.py
openstack/sahara
161
11024075
<reponame>openstack/sahara # Copyright (c) 2016 Mirantis 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 applicab...
test/run/t297.py
timmartin/skulpt
2,671
11024084
<filename>test/run/t297.py # Test the behaviour of sets l = [1,2,3,4,1,1] print l s = set(l) # Test the addition and removal of items print len(s), s s.add(100) print len(s), s s.discard(2) print len(s), s
test/test_types_plugin.py
jcassette/beets
7,731
11024089
# This file is part of beets. # Copyright 2016, <NAME>. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, ...
blackboxprotobuf/lib/types/__init__.py
thanasakos/blackboxprotobuf
261
11024128
<reponame>thanasakos/blackboxprotobuf """This module contains classes/methods for decoding individual types. Grouped into general categories of wire type """ from .type_maps import *
tests/testnet/aio/test_wallet.py
silverchen0402/python-bitshares
102
11024147
# -*- coding: utf-8 -*- import pytest import logging from bitshares.aio.asset import Asset from bitshares.aio.account import Account log = logging.getLogger("grapheneapi") log.setLevel(logging.DEBUG) @pytest.mark.asyncio async def test_aio_wallet_key(bitshares, default_account): """Check whether wallet contains...
btalib/indicators/cmo.py
demattia/bta-lib
352
11024158
<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: utf-8; py-indent-offset:4 -*- ############################################################################### # Copyright (C) 2020 <NAME> # Use of this source code is governed by the MIT License ######################################################################...
rupo/files/reader.py
dagrigorev/rupo
171
11024194
<gh_stars>100-1000 # -*- coding: utf-8 -*- # Автор: <NAME> # Описание: Считыватель файлов разных расширений. import os import xml.etree.ElementTree as etree import json from enum import Enum from typing import Iterator from rupo.main.markup import Markup from rupo.metre.metre_classifier import MetreClassifier from ru...
emukit/quadrature/methods/wsabi.py
amzn/emukit
272
11024198
<gh_stars>100-1000 """WSABI model as in Gunter et al. 2014""" import numpy as np from ..interfaces.base_gp import IBaseGaussianProcess from . import BoundedBayesianQuadrature class WSABIL(BoundedBayesianQuadrature): r"""Warped Sequential Active Bayesian Integration with linear approximation (WSABI-L). The...
pajbot/web/routes/api/playsound.py
JoachimFlottorp/pajbot
128
11024228
from typing import Optional import json import logging from dataclasses import dataclass from pajbot.managers.adminlog import AdminLogManager from pajbot.managers.db import DBManager from pajbot.models.playsound import Playsound from pajbot.models.sock import SocketClientManager from pajbot.modules import PlaysoundMo...
docs/examples/robot_2.py
codecademy-engineering/gpiozero
743
11024237
from gpiozero import Robot, Motor, DistanceSensor from signal import pause sensor = DistanceSensor(23, 24, max_distance=1, threshold_distance=0.2) robot = Robot(left=Motor(4, 14), right=Motor(17, 18)) sensor.when_in_range = robot.backward sensor.when_out_of_range = robot.stop pause()
networks/encoders/resnest/resnet.py
yoxu515/aot-benchmark
105
11024262
import math import torch.nn as nn from .splat import SplAtConv2d, DropBlock2D from utils.learning import freeze_params __all__ = ['ResNet', 'Bottleneck'] _url_format = 'https://s3.us-west-1.wasabisys.com/resnest/torch/{}-{}.pth' _model_sha256 = {name: checksum for checksum, name in []} def short_hash(name): i...
release/stubs.min/System/Net/__init___parts/WriteStreamClosedEventArgs.py
htlcnn/ironpython-stubs
182
11024277
class WriteStreamClosedEventArgs(EventArgs): """ WriteStreamClosedEventArgs() """ Error=property(lambda self: object(),lambda self,v: None,lambda self: None) """Get: Error(self: WriteStreamClosedEventArgs) -> Exception """
packages/pyright-internal/src/tests/samples/inconsistentSpaceTab.py
sasano8/pyright
4,391
11024325
<gh_stars>1000+ # This sample tests the tokenizer's ability to detect inconsistent # use of tab and spaces in a way that's ambiguous. def main(jsonIn): print("a") # This should generate an error because of inconsistent use of # tabs and spaces. print("b")
main.py
moumen-soliman/browser-bug-search
120
11024336
<reponame>moumen-soliman/browser-bug-search # -*- coding: utf-8 -*- # Copyright 2013 Google 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...
pypykatz/lsadecryptor/packages/livessp/templates.py
wisdark/pypykatz
1,861
11024346
<gh_stars>1000+ #!/usr/bin/env python3 # # Author: # <NAME> (@skelsec) # import io #from minidump.win_datatypes import * from pypykatz.commons.common import KatzSystemArchitecture from pypykatz.commons.win_datatypes import POINTER, ULONG, \ KIWI_GENERIC_PRIMARY_CREDENTIAL, PVOID, DWORD, LUID, LSA_UNICODE_STRING from ...
03_regression/src/spark_kaggle_starter/get_type_lists.py
austinfrazer/GWU_data_mining
229
11024361
def get_type_lists(frame, rejects=['Id', 'ID','id'],frame_type='h2o'): """Creates lists of numeric and categorical variables. :param frame: The frame from which to determine types. :param rejects: Variable names not to be included in returned lists. :param frame_type: The type of frame being used. Acc...
xsd-fu/python/genshi/filters/tests/test_html.py
jburel/ome-model
476
11024374
# -*- coding: utf-8 -*- # # Copyright (C) 2006-2009 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://genshi.edgewall.org/wiki/License. # # This software consist...
demo_app/apps/service/models/urlslink.py
A-tiantian/xadmin_bugfix
120
11024385
from django.db import models from apps import CHAR_MIN_LENGTH class UrlsLink(models.Model): name = models.CharField(verbose_name='名称', max_length=CHAR_MIN_LENGTH, default=True, null=True) class Meta: verbose_name = '超级链接' verbose_name_plural = '超级链接' class AppUrlLink(UrlsLink): class M...
tests/pytests/functional/modules/state/requisites/test_watch.py
tomdoherty/salt
9,425
11024387
import pytest import salt.utils.platform from . import normalize_ret pytestmark = [ pytest.mark.windows_whitelisted, ] def test_watch_in(state, state_tree): """ test watch_in requisite when there is a success """ sls_contents = """ return_changes: test.succeed_with_changes: - w...
Algo and DSA/LeetCode-Solutions-master/Python/number-of-ways-to-rearrange-sticks-with-k-sticks-visible.py
Sourav692/FAANG-Interview-Preparation
3,269
11024397
# Time: O(n * k) # Space: O(k) class Solution(object): def rearrangeSticks(self, n, k): """ :type n: int :type k: int :rtype: int """ MOD = 10**9+7 dp = [[0 for _ in xrange(k+1)] for _ in xrange(2)] dp[1][1] = 1 for i in xrange(2, n+1): ...
src/view/index.py
fy0/fpage
292
11024416
# coding:utf-8 from view import route, url_for, View @route('/', name='index') class Index(View): def get(self): self.render() @route('/jump_test', name='jump') class Jump(View): def get(self): self.messages.error('Message Test: Error!!') self.messages.error('中文测试') self.red...
benchexec/tools/legion-symcc.py
fhowar/benchexec
137
11024420
<gh_stars>100-1000 # This file is part of BenchExec, a framework for reliable benchmarking: # https://github.com/sosy-lab/benchexec # # SPDX-FileCopyrightText: 2007-2020 <NAME> <https://www.sosy-lab.org> # # SPDX-License-Identifier: Apache-2.0 import benchexec.tools.template from benchexec.tools.sv_benchmarks_util imp...
aerosandbox/numpy/test_numpy/test_calculus.py
raihaan123/AeroSandbox
322
11024429
import aerosandbox.numpy as np import pytest def test_diff(): a = np.arange(100) assert np.all( np.diff(a) == pytest.approx(1) ) def test_trapz(): a = np.arange(100) assert np.diff(np.trapz(a)) == pytest.approx(1) def test_invertability_of_diff_trapz(): a = np.sin(np.arange(10)) ...
metadata2CSV.py
666youlemengtian/AI
143
11024430
<filename>metadata2CSV.py<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: utf-8 -*- # @Author: <NAME> # @Email: <EMAIL> # @Github username: @codeorbit # @Last Modified by: <NAME> # @Last Modified time: 2016-06-28 import csv import gzip def creatingCSV(row): fobj = open("metadata2CSV.csv", "a") try: p...
tools/inspect_checkpoint.py
Woffee/deformer
114
11024432
<filename>tools/inspect_checkpoint.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- import argparse import re import sys import numpy as np import tensorflow as tf def main(args): checkpoint_path = args.checkpoint_path variable_names = args.variable_names if not variable_names: variables = tf....
douyin/__init__.py
miaotiaotech/DouYin
657
11024438
<gh_stars>100-1000 import douyin.hot import douyin.handlers import douyin.downloaders
unittests/NAPI/js-native-api/test_typedarray/binding.gyp
ScriptBox99/microsoft-hermes-windows
1,666
11024440
<gh_stars>1000+ { "targets": [ { "target_name": "test_typedarray", "sources": [ "../entry_point.c", "test_typedarray.c" ] } ] }
utils/joint.py
fsanges/glTools
165
11024444
import maya.cmds as mc import maya.OpenMaya as OpenMaya import glTools.utils.base import glTools.utils.channelState import glTools.utils.mathUtils import glTools.utils.matrix import glTools.utils.stringUtils import glTools.utils.transform import math def isJoint(joint): ''' Check if the specified object is a vali...
qiskit/ignis/verification/topological_codes/circuits.py
jakelishman/qiskit-ignis
182
11024463
<reponame>jakelishman/qiskit-ignis<gh_stars>100-1000 # -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2019. # # 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...
setup.py
vparent/pytyle3
128
11024468
import os import os.path import sys from distutils import sysconfig from distutils.core import setup try: import xpybutil except: print '' print 'pytyle3 requires xpybutil' print 'See: https://github.com/BurntSushi/xpybutil' sys.exit(1) setup( name = 'pytyle3', author = '<NAME>', auth...
mpunet/errors/image_errors.py
alexsosn/MultiPlanarUNet
156
11024469
<filename>mpunet/errors/image_errors.py class NoLabelFileError(AttributeError): pass class ReadOnlyAttributeError(AttributeError): pass
python/graphscope/nx/tests/algorithms/forward/node_classification/test_local_and_global_consistency.py
LI-Mingyu/GraphScope-MY
1,521
11024513
<reponame>LI-Mingyu/GraphScope-MY import networkx.algorithms.node_classification.tests.test_local_and_global_consistency import pytest from graphscope.nx.utils.compat import import_as_graphscope_nx import_as_graphscope_nx( networkx.algorithms.node_classification.tests.test_local_and_global_consistency, decora...
var/spack/repos/builtin/packages/sentencepiece/package.py
LiamBindle/spack
2,360
11024516
<reponame>LiamBindle/spack # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) class Sentencepiece(CMakePackage): """Unsupervised text tokenizer for Neural Network-based...
bagua_core/bagua_install_deps.py
mmathys/bagua
635
11024533
import os import platform import shutil import tempfile import urllib.request import pathlib from tqdm import tqdm _nccl_records = [] library_records = {} class DownloadProgressBar(tqdm): def update_to(self, b=1, bsize=1, tsize=None): if tsize is not None: self.total = tsize self.upd...
blender/nodes/color/__init__.py
yuanming-hu/elements
265
11024538
<filename>blender/nodes/color/__init__.py from .bright_contrast import * from .gamma import * from .invert import * from .mix_rgb import *
Contents/Libraries/Shared/plex/interfaces/channel.py
jippo015/Sub-Zero.bundle
1,553
11024557
<filename>Contents/Libraries/Shared/plex/interfaces/channel.py from plex.interfaces.core.base import Interface class ChannelInterface(Interface): path = 'channels' def all(self): raise NotImplementedError()
PhysicsTools/HepMCCandAlgos/python/modelfilter_cfi.py
ckamtsikis/cmssw
852
11024562
import FWCore.ParameterSet.Config as cms modelSelector = cms.EDFilter('ModelFilter', source = cms.InputTag("source"), modelTag = cms.string("T2tt"), parameterMins = cms.vdouble(-99999999,-99999999), para...
homeassistant/components/mqtt/device_trigger.py
liangleslie/core
30,023
11024577
"""Provides device automations for MQTT.""" from __future__ import annotations from collections.abc import Callable import logging from typing import cast import attr import voluptuous as vol from homeassistant.components.automation import ( AutomationActionType, AutomationTriggerInfo, ) from homeassistant.c...
test_suite/suite/test05/test.py
joncatanio/cannoli
755
11024596
<reponame>joncatanio/cannoli class First: def __init__(self, second): self.x = 5 self.second = second class Second: def __init__(self): self.y = 10 def some_func(self): print("funky funk") def print_content(self): print("print_content -- self.y: " + str(self.y)) def main():...
src/test/breakpoint_consistent.py
jalapenopuzzle/rr
5,156
11024634
from util import * send_gdb('b C') expect_gdb('Breakpoint 1') send_gdb('b main') expect_gdb('Breakpoint 2') send_gdb('c') expect_gdb('Breakpoint 2, main') send_gdb('cond 1 rand()&1 < 10') send_gdb('c') expect_rr('calling C') expect_gdb('Breakpoint 1, C') send_gdb('check') send_gdb('c') expect_rr('finished C') o...
dask_ml/linear_model/utils.py
GueroudjiAmal/dask-ml
803
11024642
<gh_stars>100-1000 """ """ import dask.array as da import dask.dataframe as dd import numpy as np from multipledispatch import dispatch @dispatch(dd._Frame) def exp(A): return da.exp(A) @dispatch(dd._Frame) def absolute(A): return da.absolute(A) @dispatch(dd._Frame) def sign(A): return da.sign(A) @d...
obfsproxy/transports/scramblesuit/ticket.py
Samdney/obfsproxy
101
11024654
<filename>obfsproxy/transports/scramblesuit/ticket.py #!/usr/bin/env python """ This module provides a session ticket mechanism. The implemented mechanism is a subset of session tickets as proposed for TLS in RFC 5077. The format of a 112-byte ticket is: +------------+------------------+--------------+ | 16-byte I...
modules/templates/locations/KG/config.py
whanderley/eden
205
11024655
# -*- coding: utf-8 -*- from gluon import current def config(settings): """ Template settings for Kyrgyzstan - designed to be used in a Cascade with an application template """ #T = current.T # Pre-Populate settings.base.prepopulate.append("locations/KG") # Uncomment to rest...
IOMC/Input/test/testReader_cfg.py
ckamtsikis/cmssw
852
11024678
#!/usr/bin/env cmsRun import FWCore.ParameterSet.Config as cms process = cms.Process("GEN") process.source = cms.Source("MCFileSource", fileNames = cms.untracked.vstring('file:GenEvent_ASCII.dat') ) process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(-1)) process.load("FWCore.MessageService.Message...
livecode/cast_columns_to_numeric.py
pragnesh-ai/driverlessai-recipes
194
11024696
"""Cast columns to numeric values. Columns may have small fraction of non-numeric values""" # Cast columns with mostly numeric values to new numeric columns. # Fraction of non-numeric values (per column) equal or below a threshold defined is allowed before casting. # Non-numeric values are ignored and mapped to null v...
quicklogic/pp3/utils/timing.py
bl0x/symbiflow-arch-defs
183
11024738
<gh_stars>100-1000 import statistics from copy import deepcopy from collections import defaultdict, namedtuple from data_structs import VprSwitch, MuxEdgeTiming, DriverTiming, SinkTiming from utils import yield_muxes, add_named_item # ============================================================================= de...
seahub/organizations/api/admin/user_set_password.py
samuelduann/seahub
420
11024780
# Copyright (c) 2012-2016 Seafile Ltd. import logging from types import FunctionType from rest_framework import status from rest_framework.views import APIView from rest_framework.response import Response from rest_framework.authentication import SessionAuthentication from seaserv import ccnet_api from seahub.api2.p...
widgets/generic_calendar_ctrl/perl_codegen.py
ardovm/wxGlade
225
11024790
<filename>widgets/generic_calendar_ctrl/perl_codegen.py """ Perl generator functions for wxGenericCalendarCtrl objects @copyright: 2012 <NAME> @copyright: 2014 <NAME> @copyright: 2015 <NAME> @license: MIT (see LICENSE.txt) - THIS PROGRAM COMES WITH NO WARRANTY """ import common import wcodegen class PerlGenericCale...
ingestion-and-query-tests/query-test.py
vijayraavi/elasticsearch
442
11024800
<filename>ingestion-and-query-tests/query-test.py #!/usr/bin/env python import sys import configparser import platform from subprocess import call import datetime def main(args=None): datetimeformatted = datetime.datetime.now().strftime('%Y%m%d%H%M') config = configparser.ConfigParser() config.sectio...
tools/mesh.py
fsanges/glTools
165
11024825
import maya.cmds as mc import glTools.data.meshData import glTools.utils.component import glTools.utils.mesh # --- # TODO - Add option to rebuild userdefined attrs and connections on replace # --- def reconstructMesh(mesh,replace=False): ''' Reconstruct mesh using meshData data class. @param mesh: The mesh objec...
generalization/synthesization/coarse_dirichlet.py
garyxcheng/federated
330
11024836
# Copyright 2021, 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...
tensorflow_toolkit/action_detection/action_detection/nn/monitors/detector_monitor.py
morkovka1337/openvino_training_extensions
256
11024839
<filename>tensorflow_toolkit/action_detection/action_detection/nn/monitors/detector_monitor.py # 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:...
extra/src/autogluon/extra/model_zoo/models/utils.py
zhiqiangdon/autogluon
4,462
11024844
<filename>extra/src/autogluon/extra/model_zoo/models/utils.py<gh_stars>1000+ import math from mxnet.gluon import nn from mxnet.gluon.block import HybridBlock __all__ = ['round_repeats', 'round_filters', 'SamePadding', 'Swish', '_add_conv', '_update_input_size'] def round_repeats(repeats, depth_coefficient=...
lib/python/frugal/server/http_server.py
ariasheets-wk/frugal
144
11024886
<filename>lib/python/frugal/server/http_server.py # Copyright 2017 Workiva # 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 ...
paas-ce/paas/esb/components/bk/apisv2/cc/search_host.py
renmcc/bk-PaaS
767
11024894
<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...
RecoMuon/MuonIsolationProducers/python/trackExtractorBlocks_cff.py
ckamtsikis/cmssw
852
11024972
import FWCore.ParameterSet.Config as cms # -*-TCL-*- MIsoTrackExtractorCtfBlock = cms.PSet( Diff_z = cms.double(0.2), inputTrackCollection = cms.InputTag("generalTracks"), BeamSpotLabel = cms.InputTag("offlineBeamSpot"), ComponentName = cms.string('TrackExtractor'), DR_Max = cms.double(0.5), Di...
metadata-ingestion/src/datahub/utilities/urns/corpuser_urn.py
ShubhamThakre/datahub
1,603
11024989
from typing import List from datahub.utilities.urns.error import InvalidUrnError from datahub.utilities.urns.urn import Urn class CorpuserUrn(Urn): """ expected corp user urn format: urn:li:corpuser:<corpuser_id>. example: "urn:li:corpuser:tom" """ ENTITY_TYPE: str = "corpuser" def __init__( ...
script/test.py
fxia22/stn.pytorch
596
11024996
from __future__ import print_function import torch import numpy as np import torch.nn as nn from torch.autograd import Variable from modules.stn import STN from modules.gridgen import AffineGridGen, CylinderGridGen, CylinderGridGenV2, DenseAffine3DGridGen, DenseAffine3DGridGen_rotate import time nframes = 64 height...
robustnessgym/slicebuilders/subpopulations/lexical_overlap.py
jessevig/robustness-gym
399
11024997
<reponame>jessevig/robustness-gym from typing import List import numpy as np from robustnessgym.core.operation import lookup from robustnessgym.core.slice import SliceDataPanel as DataPanel from robustnessgym.ops.spacy import SpacyOp from robustnessgym.slicebuilders.subpopulations.score import ScoreSubpopulation cl...
tests/plugins/trackers/kinozal/test_kinozaltracker_upgrade.py
DmitryRibalka/monitorrent
465
11025002
import pytz from monitorrent.plugins.trackers.kinozal import upgrade, get_current_version from sqlalchemy import Column, Integer, String, MetaData, Table, ForeignKey from datetime import datetime from monitorrent.db import UTCDateTime from tests import UpgradeTestCase from monitorrent.plugins.trackers import Topic cl...
hfnet/models/lfnet_utils/inference.py
maxtomCMU/hfnet
555
11025026
<filename>hfnet/models/lfnet_utils/inference.py import tensorflow as tf from .det_tools import ( instance_normalization, end_of_frame_masks, spatial_softmax, non_max_suppression, make_top_k_sparse_tensor, extract_keypoints, batch_gather_keypoints, soft_argmax_2d, nearest_neighbors, soft_max_and_argmax_1...
tests/convs_test.py
gglin001/poptorch
128
11025047
#!/usr/bin/env python3 # Copyright (c) 2020 Graphcore Ltd. All rights reserved. import unittest.mock import torch import pytest import poptorch import helpers # Convolutions. convolutions = [ torch.nn.Conv1d, torch.nn.Conv2d, torch.nn.Conv3d, torch.nn.ConvTranspose1d, torch.nn.ConvTranspose2d, ...
docs_src/tutorial/fastapi/teams/tutorial001.py
javivdm/sqlmodel
5,490
11025050
from typing import List, Optional from fastapi import Depends, FastAPI, HTTPException, Query from sqlmodel import Field, Relationship, Session, SQLModel, create_engine, select class TeamBase(SQLModel): name: str = Field(index=True) headquarters: str class Team(TeamBase, table=True): id: Optional[int] =...
src/mesh/azext_mesh/servicefabricmesh/mgmt/servicefabricmesh/models/container_instance_view.py
Mannan2812/azure-cli-extensions
207
11025080
<reponame>Mannan2812/azure-cli-extensions # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microso...
release/stubs.min/Autodesk/Revit/UI/__init___parts/ColorSelectionDialog.py
htlcnn/ironpython-stubs
182
11025081
<gh_stars>100-1000 class ColorSelectionDialog(object,IDisposable): """ Allows display of the Revit Color dialog. ColorSelectionDialog() """ def Dispose(self): """ Dispose(self: ColorSelectionDialog) """ pass def ReleaseUnmanagedResources(self,*args): """ ReleaseUnmanagedResources(self: Color...
examples/src/dbnd_examples/dbnd_airflow/monitoring_templates/redshift_table_monitor_template.py
busunkim96/dbnd
224
11025082
<reponame>busunkim96/dbnd<filename>examples/src/dbnd_examples/dbnd_airflow/monitoring_templates/redshift_table_monitor_template.py import os from warnings import warn import airflow from airflow import DAG from airflow.hooks.postgres_hook import PostgresHook from airflow.operators.dummy_operator import DummyOperator...
lang-python/src/test/resources/tiny_py_interpreter/tinypy/tests/parens.py
nrs011/steady
357
11025110
test = { 'first' : 1, 'second' : 2, 'third' : 'dsfasdf', } hey = [ 999, 888, 777, 666, # 'test test' "comment"" test '''''''' 555, 444 ] print(test['first']) print(test['third']) print(len(test), len(hey)) for x in hey: print(x) i = 0 while i < len(hey): print...
h2o-py/tests/testdir_jira/pyunit_pubdev_4995.py
ahmedengu/h2o-3
6,098
11025152
<filename>h2o-py/tests/testdir_jira/pyunit_pubdev_4995.py #!/usr/bin/env python # -*- encoding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals import h2o from tests import pyunit_utils from h2o.estimators.aggregator import H2OAggregatorEstimator from h2o.exceptions import...
scratchgan/discriminator_nets.py
mitchchristow/deepmind-research
10,110
11025163
# Copyright 2019 DeepMind Technologies Limited and 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 applic...
Lib/test/test_ctypes.py
gerph/cpython
2,441
11025191
import unittest from test.support import import_module ctypes_test = import_module('ctypes.test') load_tests = ctypes_test.load_tests if __name__ == "__main__": unittest.main()
osf_tests/management_commands/test_start_sloan_phase.py
gaybro8777/osf.io
628
11025192
import pytest from django.core.management import call_command from osf_tests.factories import ( AuthUserFactory ) from waffle.models import ( Switch, Flag ) @pytest.mark.django_db class TestStartSloanPhase: @pytest.fixture() def user(self): user = AuthUserFactory() user.add_syste...
resotolib/resotolib/core/query.py
MrMarvin/cloudkeeper
316
11025199
<filename>resotolib/resotolib/core/query.py<gh_stars>100-1000 import requests import json from urllib.parse import urlencode from resotolib.graph import Graph, sanitize from resotolib.graph.export import node_from_dict, node_to_dict from resotolib.args import ArgumentParser from resotolib.logging import log from resoto...
plugins/softraid/softraid.py
ajenti/ajen
3,777
11025202
class RAIDDevice(): """ Basic class to store raid devices details. """ def __init__(self): self.name = '' self.up = False self.failed = False self.spared = False self.down = False self.index = 0 class RAIDArray(): """ Basic class to store raid a...
scripts/irods/test/replica_status_test.py
JustinKyleJames/irods
333
11025220
<gh_stars>100-1000 from __future__ import print_function import os from . import command from .. import lib #repl_statuses = ['X', '&', '?'] repl_statuses = ['X', '&'] def setup_replicas(cls, scenario): initial_replicas = scenario['start'] ordered_keys = sorted(initial_replicas) replica_zero_resource = ...
benchmark_agent.py
seikurou/LearningByCheating
116
11025224
import argparse import time from pathlib import Path from benchmark import make_suite, get_suites, ALL_SUITES from benchmark.run_benchmark import run_benchmark import bird_view.utils.bz_utils as bzu def _agent_factory_hack(model_path, config, autopilot): """ These imports before carla.Client() cause seg fa...
scripts/data_download/school_census/create_files.py
joelvisroman/dataviva-site
126
11025227
<filename>scripts/data_download/school_census/create_files.py # -*- coding: utf-8 -*- ''' python scripts/data_download/school_census/create_files.py en scripts/data/school_census/en/ 2007 ''' from collections import namedtuple import os import sys import logging import imp def local_imports(): global common, ...
myimports/bar_abs.py
noirqs/PyImports
118
11025260
# `bar_abs` imports Foo using absolute imports from myimports.foo import Foo class Bar(object): def foo(self, ): return Foo().bar()
intake/catalog/tests/test_discovery.py
raybellwaves/intake
578
11025291
<filename>intake/catalog/tests/test_discovery.py import copy import glob import os import pytest import sys from ..local import YAMLFilesCatalog, MergedCatalog, EntrypointsCatalog def test_catalog_discovery(): basedir = os.path.dirname(__file__) yaml_glob = os.path.join(basedir, 'catalog_search', '*.yml') ...
gubernator/github/periodic_sync_test.py
Noahhoetger2001/test-infra
3,390
11025294
#!/usr/bin/env python # Copyright 2018 The Kubernetes 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 appli...
colour/characterisation/datasets/cameras/__init__.py
rift-labs-developer/colour
1,380
11025344
# -*- coding: utf-8 -*- """ References ---------- - :cite:`Darrodi2015a` : <NAME>., <NAME>., <NAME>., & <NAME>. (2015). Reference data set for camera spectral sensitivity estimation. Journal of the Optical Society of America A, 32(3), 381. doi:10.1364/JOSAA.32.000381 """ from .dslr import MSDS_CAMERA_SEN...
self-paced-labs/vertex-ai/vertex-pipelines/tfx/tfx_taxifare_tips/model_training/preprocessing.py
memeyankm/training-data-analyst
6,140
11025373
"""TensorFlow Transform preprocessing function.""" import tensorflow as tf import tensorflow_transform as tft from tfx_taxifare_tips.model_training import features def preprocessing_fn(inputs): """tf.transform's callback function for preprocessing inputs. Args: inputs: map from feature keys to raw not...
nuplan/planning/nuboard/base/base_tab.py
motional/nuplan-devkit
128
11025425
import logging import pathlib from typing import Any, List, Optional from bokeh.document.document import Document from bokeh.models import CheckboxGroup, MultiChoice from nuplan.planning.nuboard.base.data_class import SelectedMetricStatisticDataFrame, SimulationScenarioKey from nuplan.planning.nuboard.base.experiment...
plugins/datetime/main.py
ajenti/ajen
3,777
11025428
<gh_stars>1000+ from jadi import component from aj.auth import PermissionProvider from aj.plugins.core.api.sidebar import SidebarItemProvider @component(SidebarItemProvider) class ItemProvider(SidebarItemProvider): def __init__(self, context): self.context = context def provide(self): return...
bookwyrm/tests/views/inbox/test_inbox_create.py
mouse-reeve/fedireads
270
11025443
""" tests incoming activities""" import json import pathlib from unittest.mock import patch from django.test import TestCase from bookwyrm import models, views from bookwyrm.activitypub import ActivitySerializerError # pylint: disable=too-many-public-methods @patch("bookwyrm.models.activitypub_mixin.broadcast_task....
tests/test_file_watcher.py
htmue/LSP
648
11025460
from LSP.plugin import FileWatcher from LSP.plugin import FileWatcherEvent from LSP.plugin import FileWatcherEventType from LSP.plugin import FileWatcherProtocol from LSP.plugin.core.file_watcher import file_watcher_event_type_to_lsp_file_change_type from LSP.plugin.core.file_watcher import register_file_watcher_implem...
dataset/forced_alignment/align.py
FilthyFrankTheGoanimator/Voice
556
11025492
<reponame>FilthyFrankTheGoanimator/Voice<gh_stars>100-1000 import os import logging from dataset.forced_alignment.audio import DEFAULT_RATE, read_frames_from_file, vad_split from dataset.audio_processing import get_timestamp, cut_audio logging.getLogger().setLevel(logging.INFO) audio_vad_threshold = 0.5 audio_vad_ag...
goldsrc/bsp/lumps/edge_lump.py
half5life/SourceIO
199
11025505
import numpy as np from ..lump import Lump, LumpType, LumpInfo class EdgeLump(Lump): LUMP_TYPE = LumpType.LUMP_EDGES def __init__(self, info: LumpInfo): super().__init__(info) self.values = np.array([]) def parse(self): self.values = np.frombuffer(self.buffer.read(self.info.leng...
tests/resources/test_issue.py
Glushiator/jira
1,639
11025534
<gh_stars>1000+ import logging import re from time import sleep from jira.exceptions import JIRAError from tests.conftest import ( JiraTestCase, broken_test, find_by_key, find_by_key_value, rndstr, ) LOGGER = logging.getLogger(__name__) class IssueTests(JiraTestCase): def setUp(self): ...
tests/tests_domain/test_domain_union.py
uwe-iben/torchphysics
203
11025553
import pytest import torch import numpy as np from torchphysics.problem.domains.domain2D.circle import Circle from torchphysics.problem.domains.domain2D.parallelogram import Parallelogram from torchphysics.problem.domains.domain1D.interval import Interval from torchphysics.problem.domains.domain3D.sphere import Sphere...
typescript/listeners/rename.py
bertilnilsson/TypeScript-Sublime-Plugin
1,688
11025576
<reponame>bertilnilsson/TypeScript-Sublime-Plugin<gh_stars>1000+ from ..libs import * from .event_hub import EventHub class RenameEventListener: def on_load(self, view): client_info = cli.get_or_add_file(view.file_name()) # finish the renaming if client_info and client_info.rename_on_load:...
docs/components_page/components/input/textarea.py
glsdown/dash-bootstrap-components
776
11025618
import dash_bootstrap_components as dbc from dash import html textareas = html.Div( [ dbc.Textarea(className="mb-3", placeholder="A Textarea"), dbc.Textarea( valid=True, size="sm", className="mb-3", placeholder="A small, valid Textarea", ), ...
descarteslabs/workflows/types/conditional/ifelse.py
carderne/descarteslabs-python
167
11025633
from descarteslabs.common.graft import client from descarteslabs.workflows.types.core import typecheck_promote from descarteslabs.workflows.types.primitives import Bool from descarteslabs.workflows.types.proxify import proxify @typecheck_promote(Bool, None, None) def ifelse(condition, true_value, false_value): "...
tests/core/cube/test_conditions.py
jorisvandenbossche/kartothek
171
11025653
# -*- coding: utf-8 -*- import numpy as np import pandas as pd import pandas.testing as pdt import pyarrow as pa import pytest from kartothek.core.cube.conditions import ( C, Condition, Conjunction, EqualityCondition, GreaterEqualCondition, GreaterThanCondition, InequalityCondition, InI...
examples/pxScene2d/external/breakpad-chrome_55/gyp/test/symlinks/gyptest-symlinks.py
madanagopaltcomcast/pxCore
2,151
11025660
#!/usr/bin/env python # Copyright (c) 2015 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Test that RelativePath(s, d) doesn't return a path starting with '..' when s is textually below d, but is also a symlink to a file that ...
src/rust/iced-x86-py/src/iced_x86/DecoderError.py
clayne/iced
1,018
11025662
<gh_stars>1000+ # SPDX-License-Identifier: MIT # Copyright (C) 2018-present iced project and contributors # ⚠️This file was generated by GENERATOR!🦹‍♂️ # pylint: disable=invalid-name # pylint: disable=line-too-long # pylint: disable=too-many-lines """ Decoder error """ import typing if typing.TYPE_CHECKING: from ...
geocoder/mapquest.py
termim/geocoder
1,506
11025689
#!/usr/bin/python # coding: utf8 from __future__ import absolute_import from geocoder.base import OneResult, MultipleResultsQuery from geocoder.keys import mapquest_key from geocoder.location import BBox class MapquestResult(OneResult): @property def lat(self): return self.raw.get('latLng', {}).get...
external/marcopede-face-eval-f2870fd85d48/loadData.py
collinb585/collinb585
142
11025690
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function from database import * from operator import itemgetter, attrgetter import util import os import glob def loadDetections(fn): """ load detections from fn in the different formats """ dets = [] print ("loading ...
recipes/Python/300411_foreachpy__Execute_pythfunctiselected_set/recipe-300411.py
tdiprima/code
2,023
11025699
#!/usr/bin/env python """Execute a python function for a selected set of files. The purpose of this script is to build a filelist, by: - recursing over a directory, or - selecting files having a common filename extension, or - just accepting the filenames as command line arguments, and then executing any user defined ...
NeoPixel_Tiara/NeoPixel_Tiara.py
joewalk102/Adafruit_Learning_System_Guides
665
11025714
import time import board import neopixel try: import urandom as random except ImportError: import random numpix = 7 # Number of NeoPixels pixpin = board.D1 # Pin where NeoPixels are connected strip = neopixel.NeoPixel(pixpin, numpix, brightness=1, auto_write=True) colors = [ [232, 100, 255], # Purple ...