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
shenfun/laguerre/matrices.py
spectralDNS/shenfun
138
12754031
<filename>shenfun/laguerre/matrices.py import functools from shenfun.matrixbase import SpectralMatrix from shenfun.la import TDMA_O from . import bases SD = bases.ShenDirichlet L = bases.Orthogonal class BLLmat(SpectralMatrix): r"""Mass matrix for inner product .. math:: B_{kj} = (L_j, L_k)_w ...
all/experiments/experiment.py
drozzy/autonomous-learning-library
584
12754060
from abc import ABC, abstractmethod import numpy as np from scipy import stats import torch class Experiment(ABC): ''' An Experiment manages the basic train/test loop and logs results. Args: writer (:torch.logging.writer:): A Writer object used for logging. quiet (bool): If False,...
xar/utils.py
darjeeling/xar
1,477
12754062
#!/usr/bin/env python # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved """Handy helper utils to work with XARs at runtime""" from __future__ import absolute_import, division, print_function, unicode_literals import os def get_runtime_path(): # type: (...) -> str """Return the location ...
tests/configure/test_config.py
testruction/databricks-cli
252
12754066
# Databricks CLI # Copyright 2017 Databricks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"), except # that the use of services to which certain application programming # interfaces (each, an "API") connect requires that the user first obtain # a license for the use of the APIs from Databricks,...
pgmpy/estimators/base.py
akleinau/pgmpy
2,144
12754091
#!/usr/bin/env python from functools import lru_cache import pandas as pd from pgmpy.utils.decorators import convert_args_tuple class BaseEstimator(object): def __init__(self, data=None, state_names=None, complete_samples_only=True): """ Base class for estimators in pgmpy; `ParameterEstimator`, ...
autobahn/wamp/gen/wamp/proto/AuthMethod.py
rapyuta-robotics/autobahn-python
1,670
12754097
<filename>autobahn/wamp/gen/wamp/proto/AuthMethod.py # automatically generated by the FlatBuffers compiler, do not modify # namespace: proto class AuthMethod(object): ANONYMOUS = 0 COOKIE = 1 TLS = 2 TICKET = 3 CRA = 4 SCRAM = 5 CRYPTOSIGN = 6
pogom/pgoapi/protos/POGOProtos/Networking/Requests/Messages/SetPlayerTeamMessage_pb2.py
tier4fusion/pogom-updated
2,557
12754115
<filename>pogom/pgoapi/protos/POGOProtos/Networking/Requests/Messages/SetPlayerTeamMessage_pb2.py # Generated by the protocol buffer compiler. DO NOT EDIT! # source: POGOProtos/Networking/Requests/Messages/SetPlayerTeamMessage.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))...
tools/rosunit/test/dotname_cases.py
mcx/ros
2,051
12754130
import unittest class CaseA(unittest.TestCase): def runTest(self): self.assertTrue(True) class CaseB(unittest.TestCase): def runTest(self): self.assertTrue(True) class DotnameLoadingSuite(unittest.TestSuite): def __init__(self): super(DotnameLoadingSuite, self).__init__() ...
client/verta/verta/_swagger/_public/uac/model/UacResources.py
stefan-petrov-toptal/modeldb
835
12754133
# THIS FILE IS AUTO-GENERATED. DO NOT EDIT from verta._swagger.base_type import BaseType class UacResources(BaseType): def __init__(self, service=None, resource_ids=None, role_service_resource_type=None, authz_service_resource_type=None, modeldb_service_resource_type=None): required = { "service": False, ...
uiBasicIO.py
xcgoo/uiKLine
232
12754142
<reponame>xcgoo/uiKLine # -*- coding: utf-8 -*- # PyQt from qtpy.QtGui import * from qtpy.QtWidgets import * from qtpy.QtCore import * from qtpy import QtGui,QtCore # Others import os import imp import sys import json import glob from functools import partial from collections import OrderedDict # 导入按钮函数 #-------------...
src/Python/Visualization/InteractorStyleTrackballActor.py
cvandijck/VTKExamples
309
12754155
<reponame>cvandijck/VTKExamples<filename>src/Python/Visualization/InteractorStyleTrackballActor.py import vtk def main(): colors = vtk.vtkNamedColors() # create a rendering window and renderer ren = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren) # create a renderwin...
ufora/FORA/python/PurePython/testModules/same_line_number/A.py
ufora/ufora
571
12754177
from ufora.FORA.python.PurePython.testModules.same_line_number.B import B class A(object): def __init__(self, m): self.m = m def foo(self): return B(self.m)
Yank/commands/analyze.py
lilyminium/yank
136
12754187
<gh_stars>100-1000 #!/usr/local/bin/env python # ============================================================================================= # MODULE DOCSTRING # ============================================================================================= """ Analyze YANK output file. """ # ======================...
openmc/data/angle_distribution.py
norberto-schmidt/openmc
262
12754191
<filename>openmc/data/angle_distribution.py from collections.abc import Iterable from io import StringIO from numbers import Real from warnings import warn import numpy as np import openmc.checkvalue as cv from openmc.mixin import EqualityMixin from openmc.stats import Univariate, Tabular, Uniform, Legendre from .fun...
tests/utils/test_system.py
PyCN/pulsar
1,410
12754200
<reponame>PyCN/pulsar '''Tests the tools and utilities in pulsar.utils.''' import unittest from pulsar.utils.system import platform, get_maxfd class TestSystem(unittest.TestCase): @unittest.skipUnless(platform.is_posix, 'Posix platform required') def testPlatform(self): self.assertFalse(platform.is_...
supriya/commands/server.py
butayama/supriya
191
12754203
<gh_stars>100-1000 import supriya.osc from supriya.enums import RequestId from .bases import Request, Response class ClearScheduleRequest(Request): ### CLASS VARIABLES ### request_id = RequestId.CLEAR_SCHEDULE ### PUBLIC METHODS ### def to_osc(self, *, with_placeholders=False): request_id...
hack/def.bzl
akinfermo/elcarro-oracle-operator
185
12754212
load("@bazel_skylib//lib:shell.bzl", "shell") def kubebuilder_manifests(name, srcs, config_root, **kwargs): native.genrule( name = name, srcs = srcs, outs = [name + ".yaml"], cmd = """ tmp=$$(mktemp --directory) cp -aL "%s/." "$$tmp" $(location @io_k8s_sigs_kustomize_kustomize_v4//:...
code/chapter-4/uretprobes/example.py
dddddai/linux-observability-with-bpf
643
12754220
<filename>code/chapter-4/uretprobes/example.py<gh_stars>100-1000 from bcc import BPF bpf_source = """ BPF_HASH(cache, u64, u64); int trace_start_time(struct pt_regs *ctx) { u64 pid = bpf_get_current_pid_tgid(); u64 start_time_ns = bpf_ktime_get_ns(); cache.update(&pid, &start_time_ns); return 0; } """ bpf_so...
notebook/numpy_1d_to_2d.py
vhn0912/python-snippets
174
12754240
import numpy as np a = np.arange(6) print(a) # [0 1 2 3 4 5] print(a.reshape(2, 3)) # [[0 1 2] # [3 4 5]] print(a.reshape(-1, 3)) # [[0 1 2] # [3 4 5]] print(a.reshape(2, -1)) # [[0 1 2] # [3 4 5]] # print(a.reshape(3, 4)) # ValueError: cannot reshape array of size 6 into shape (3,4) # print(a.reshape(-1, 4)) ...
py/testdir_single_jvm/test_summary2_uniform.py
gigliovale/h2o
882
12754255
<gh_stars>100-1000 import unittest, time, sys, random, math, getpass sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_import as h2i, h2o_util, h2o_print as h2p, h2o_summ DO_MEDIAN = False MAX_QBINS = 1000 ROWS = 500000 def write_syn_dataset(csvPathname, rowCount, colCount, expectedMin, expectedMax, S...
pymdp/envs/env.py
Arun-Niranjan/pymdp
108
12754257
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Environment Base Class __author__: <NAME>, <NAME>, <NAME> """ class Env(object): def reset(self, state=None): raise NotImplementedError def step(self, action): raise NotImplementedError def render(self): pass def sample_ac...
src/garage/examples/sim_policy.py
blacksph3re/garage
1,500
12754288
<reponame>blacksph3re/garage #!/usr/bin/env python3 """Simulates pre-learned policy.""" import argparse import sys import cloudpickle import tensorflow as tf from garage import rollout def query_yes_no(question, default='yes'): """Ask a yes/no question via raw_input() and return their answer. Args: ...
dev/dev.py
emadehsan/climetlab
182
12754307
<gh_stars>100-1000 import climetlab as cml url = "https://www.cpc.ncep.noaa.gov/products/precip/CWlink/daily_ao_index/monthly.ao.index.b50.current.ascii" s = cml.load_source("url", url, reader="fix_width_format") print(s.to_pandas())
lib/tests/streamlit/report_context_test.py
AnOctopus/streamlit
19,099
12754315
# Copyright 2018-2021 Streamlit 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 wr...
brainstorm/layers/recurrent_layer.py
PyCN/brainstorm
1,473
12754327
#!/usr/bin/env python # coding=utf-8 from __future__ import division, print_function, unicode_literals from collections import OrderedDict from brainstorm.layers.base_layer import Layer from brainstorm.structure.buffer_structure import (BufferStructure, StructureTemp...
release/stubs.min/System/Windows/Media/Animation_parts/KeySpline.py
htlcnn/ironpython-stubs
182
12754392
class KeySpline(Freezable,ISealable,IFormattable): """ This class is used by a spline key frame to define animation progress. KeySpline(controlPoint1: Point,controlPoint2: Point) KeySpline() KeySpline(x1: float,y1: float,x2: float,y2: float) """ def CloneCore(self,*args): """ CloneCore(se...
examples/rl/environments/capturegame/pente.py
sveilleux1/pybrain
2,208
12754407
<reponame>sveilleux1/pybrain<gh_stars>1000+ from __future__ import print_function #!/usr/bin/env python """ A little script illustrating how to use a (randomly initialized) convolutional network to play a game of Pente. """ __author__ = '<NAME>, <EMAIL>' from pybrain.rl.environments.twoplayergames.pente import Pente...
examples/database/discovery_rate.py
tachyontraveler/qmpy
103
12754414
<filename>examples/database/discovery_rate.py # from qmpy import * from matplotlib import rc rc("font", **{"family": "serif", "serif": ["Century"]}) params = {"font.size": 48} import matplotlib matplotlib.rcParams.update(params) import matplotlib.pylab as plt import pickle import sys import numpy as np def get_data...
tensorflow/python/ops/initializers_ns.py
EricRemmerswaal/tensorflow
190,993
12754416
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
tests/uri_encoding.py
naokazuterada/MarkdownTOC
299
12754424
<gh_stars>100-1000 # coding:utf-8 from base import TestBase class TestUriEncoding(TestBase): """Test for attributes \'uri_encoding\'""" # for debug # def tearDown(self): # pass uri_encoding_text = """ <!-- MarkdownTOC autolink="true" lowercase="only_ascii" {0} --> <!-- /MarkdownTOC --> # ...
desktop/core/ext-py/docutils-0.14/test/test_parsers/test_get_parser_class.py
kokosing/hue
5,079
12754425
#! /usr/bin/env python # $Id: test_get_parser_class.py 7504 2012-08-27 07:55:20Z grubert $ # Author: <NAME> # Maintainer: <EMAIL> # Copyright: This module has been placed in the public domain. """ test get_parser_class """ from __init__ import DocutilsTestSupport from docutils.parsers import get_parser_class class ...
web/search/esmodels.py
ChiChou/wiggle
110
12754460
<filename>web/search/esmodels.py from datetime import datetime from elasticsearch_dsl import * from elasticsearch_dsl.connections import connections # Define a default Elasticsearch client connection = connections.create_connection(hosts=['es', 'localhost']) path_analyzer = analysis.analyzer('path', tokenizer='path_h...
plugins/cipher_plugin/plugin.py
MrT3acher/Android-Malware-Sandbox
218
12754462
<reponame>MrT3acher/Android-Malware-Sandbox<gh_stars>100-1000 from sqlalchemy.orm import sessionmaker, scoped_session from lib.model.database.Database import Database from .lib.Cipher import Cipher import logging import os import binascii import base64 import filetype current_path = os.path.dirname(os.path.realpath...
cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_manageability_object_tracking_datatypes.py
CiscoDevNet/ydk-py
177
12754477
<reponame>CiscoDevNet/ydk-py """ Cisco_IOS_XR_manageability_object_tracking_datatypes This module contains a collection of generally useful derived YANG data types. Copyright (c) 2013\-2018 by Cisco Systems, Inc. All rights reserved. """ import sys from collections import OrderedDict from ydk.types import Entity a...
python/scripts/generic-pytest/test_zap.py
eas5/zaproxy
10,016
12754482
<filename>python/scripts/generic-pytest/test_zap.py # Zed Attack Proxy (ZAP) and its related class files. # # ZAP is an HTTP/HTTPS proxy for assessing web application security. # # Copyright 2012 ZAP Development Team # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except ...
tests/test_optionmenu.py
larryw3i/pygubu
1,716
12754501
<reponame>larryw3i/pygubu # encoding: utf8 import support import pygubu import os import sys import unittest try: import tkinter as tk import tkinter.ttk as ttk except: import Tkinter as tk import ttk pygubu_basedir = os.path.abspath(os.path.dirname( os.path.dirname(os.path.realpath(sys.argv[0])))...
vel/api/base/scheduler.py
tigerwlin/vel
273
12754550
<filename>vel/api/base/scheduler.py from .callback import Callback class SchedulerFactory: """ Factory class for various schedulers """ def instantiate(self, optimizer, last_epoch=-1) -> Callback: raise NotImplementedError
DQM/TrackingMonitor/python/tracksDQMMiniAOD_cff.py
ckamtsikis/cmssw
852
12754553
import FWCore.ParameterSet.Config as cms from DQM.TrackingMonitor.packedCandidateTrackValidator_cfi import * packedCandidateTrackValidatorLostTracks = packedCandidateTrackValidator.clone( trackToPackedCandidateAssociation = "lostTracks", rootFolder = "Tracking/PackedCandidate/lostTracks" ) tracksDQMMiniAOD =...
superset/db_engine_specs/elasticsearch.py
delorenzosoftware/superset
18,621
12754560
<reponame>delorenzosoftware/superset # 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...
language/labs/exemplar_decoding/models/linear.py
naveenjafer/language
1,199
12754562
<gh_stars>1000+ # coding=utf-8 # Copyright 2018 The Google AI Language Team 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 # # Unl...
src/logger/neptune/neptune_logger.py
Sarajvega/kaggle-birdsong-recognition
137
12754568
from ignite.engine import Events from ignite.contrib.handlers.tqdm_logger import ProgressBar from ignite.handlers import Checkpoint, DiskSaver, global_step_from_engine from logger.base.base_logger import BaseLogger from logger.base.utils import * from logger.neptune.neptune_utils import * from ignite.contrib.handlers.n...
tasks/multi_length_sequences.py
evanharwin/keras-tcn
1,473
12754576
import numpy as np from tensorflow.keras import Sequential from tensorflow.keras.layers import Dense from tcn import TCN # if you increase the sequence length make sure the receptive field of the TCN is big enough. MAX_TIME_STEP = 30 """ Input: sequence of length 7 Input: sequence of length 25 Input: sequence of len...
tests/test_chi_police_retirement.py
MAYANK25402/city-scrapers
255
12754679
from datetime import datetime from os.path import dirname, join import pytest from city_scrapers_core.utils import file_response from freezegun import freeze_time from city_scrapers.spiders.chi_police_retirement import ChiPoliceRetirementSpider test_response = file_response( join(dirname(__file__), "files", "chi...
rpython/jit/metainterp/test/test_call.py
nanjekyejoannah/pypy
381
12754707
from rpython.jit.metainterp.test.support import LLJitMixin, noConst from rpython.rlib import jit class CallTest(object): def test_indirect_call(self): @jit.dont_look_inside def f1(x): return x + 1 @jit.dont_look_inside def f2(x): return x + 2 @jit....
server/workers/persistence/src/example_settings.py
chreman/Headstart
111
12754744
BEHIND_PROXY = True SWAGGER_BASEPATH = "" DEFAULT_DATABASE = "dev" DATABASES = ["test"] ENV = "development" DEBUG = True
tools/src/deleteGroup.py
kevinsigwart/ArcREST
208
12754749
<reponame>kevinsigwart/ArcREST """ @author: ArcREST Team @contact: www.github.com/Esri/ArcREST @company: Esri @version: 1.0.0 @description: deletes a group on the AGOL site. @requirements: Python 2.7.x, ArcGIS 10.2.2, ArcREST 2.0 @copyright: Esri, 2015 """ import os from arcpy import env fro...
alipay/aop/api/response/AlipayCommerceIotMdeviceprodQueryResponse.py
snowxmas/alipay-sdk-python-all
213
12754821
<reponame>snowxmas/alipay-sdk-python-all<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse from alipay.aop.api.domain.MerchantModel import MerchantModel from alipay.aop.api.domain.MerchantModel import MerchantModel class Alip...
test/python/classical_function_compiler/examples.py
Roshan-Thomas/qiskit-terra
1,599
12754834
<filename>test/python/classical_function_compiler/examples.py # This code is part of Qiskit. # # (C) Copyright IBM 2020. # # 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.or...
libs/csv.py
bgizdov/revolut-stocks
206
12754836
<gh_stars>100-1000 from libs.utils import humanize_date from libs import NAP_DATE_FORMAT, NAP_DIGIT_PRECISION import os import csv import decimal decimal.getcontext().rounding = decimal.ROUND_HALF_UP def export_to_csv(list_object, csv_file, fieldnames): csv_list_object = humanize_date(list_object) with op...
src/python/grpcio_tests/tests_aio/unit/done_callback_test.py
echo80313/grpc
36,552
12754855
<gh_stars>1000+ # Copyright 2020 The gRPC Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
external/heng/tgs/pspnet/loss.py
liaopeiyuan/ml-arsenal-public
280
12754860
<reponame>liaopeiyuan/ml-arsenal-public from include import * #https://github.com/marvis/pytorch-yolo2/blob/master/FocalLoss.py #https://github.com/unsky/focal-loss class FocalLoss2d(nn.Module): def __init__(self, gamma=2, size_average=True): super(FocalLoss2d, self).__init__() self.gamma = gamma ...
legacy/build_vocab.py
SeongJunKang/pytorch-bert-crf-ner
353
12754865
<filename>legacy/build_vocab.py import codecs import pickle import pandas as pd import itertools from pathlib import Path from sklearn.model_selection import train_test_split import gluonnlp as nlp from pathlib import Path from collections import Counter import os def load_data_from_txt(file_full_name): with co...
tests/test_0099-read-from-file-object.py
eic/uproot4
133
12754869
<filename>tests/test_0099-read-from-file-object.py # BSD 3-Clause License; see https://github.com/scikit-hep/uproot4/blob/main/LICENSE from __future__ import absolute_import import pytest import skhep_testdata import uproot def test(): with open(skhep_testdata.data_path("uproot-Zmumu.root"), "rb") as f: ...
experiments/vera/convert_duot5_output_to_trec.py
Elfsong/pygaggle
166
12754894
import argparse import collections import numpy as np parser = argparse.ArgumentParser( description='Convert T5 predictions into a TREC-formatted run.') parser.add_argument('--predictions', type=str, required=True, help='T5 predictions file.') parser.add_argument('--query_run_ids', type=str, required=True, ...
loudml/misc.py
toni-moreno/loudml
245
12754897
<gh_stars>100-1000 """ Miscelaneous Loud ML helpers """ import datetime import dateutil.parser import hashlib import json import numpy as np import math import itertools from uuid import getnode from jinja2 import Environment, meta import loudml from loudml import ( errors, ) QUOTE_ESCAPE_TRANS = str.maketrans...
docs/components_page/components/carousel/indicators.py
glsdown/dash-bootstrap-components
776
12754926
<filename>docs/components_page/components/carousel/indicators.py import dash_bootstrap_components as dbc carousel = dbc.Carousel( items=[ {"key": "1", "src": "/static/images/slide1.svg"}, {"key": "2", "src": "/static/images/slide2.svg"}, {"key": "3", "src": "/static/images/slide3.svg"}, ...
runtime/translation/models/gnmt_large/gpus=4/gnmt_large.py
NestLakerJasonLIN/pipedream
273
12754961
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import torch from .stage0 import Stage0 from .stage1 import Stage1 from .stage2 import Stage2 from .stage3 import Stage3 class GNMTSplit(torch.nn.Module): def __init__(self): super(GNMTSplit, self).__init__() self.stage0 = St...
tests/py/test_www_npm_package.py
kant/gratipay.com
517
12754972
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals from gratipay.models.package import NPM, Package from gratipay.testing import Harness class Tests(Harness): def setUp(self): self.make_package() def test_trailing_slash_redirects(self): ...
tensorflow/python/data/experimental/kernel_tests/serialization/parallel_interleave_dataset_serialization_test.py
MathMachado/tensorflow
848
12754981
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
setup.py
DPDmancul/termpdf.py
216
12755001
#!/usr/bin/python3 from distutils.core import setup setup(name='termpdf.py', version='0.1.0', description='Graphical pdf reader that works inside the kitty terminal', author='<NAME>', author_email='<EMAIL>', url='https://github.com/dsanson/termpdf.py', scripts=['termpdf.py'], ...
tensorflow_serving/model_servers/profiler_client.py
mzhang-code/serving
5,791
12755008
# Copyright 2020 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.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
tests/plugins/test_pexpect_filters.py
dexy/dexy
136
12755017
<filename>tests/plugins/test_pexpect_filters.py from dexy.doc import Doc from tests.utils import assert_in_output from tests.utils import wrap from nose.exc import SkipTest def test_shint_filter(): with wrap() as wrapper: src = """ ### @export "touch" touch newfile.txt ### @export "ls" ls """ doc ...
tests/convert/test_to_address.py
x3devships/brownie
1,595
12755023
#!/usr/bin/python3 import pytest from brownie.convert import to_address addr = "0x14b0Ed2a7C4cC60DD8F676AE44D0831d3c9b2a9E" addr_encoded = b"\x14\xb0\xed*|L\xc6\r\xd8\xf6v\xaeD\xd0\x83\x1d<\x9b*\x9e" def test_success(): assert to_address(addr) == addr assert to_address(addr.lower()) == addr assert to_a...
migrations/versions/f5f55452fa58_make_scheduler_params_a_separate_jsonb_.py
eltociear/chaos_genius
320
12755025
"""make scheduler_params a separate JSONB field Revision ID: f5f55452fa58 Revises: <PASSWORD> Create Date: 2021-09-28 16:48:42.834962 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql # revision identifiers, used by Alembic. revision = 'f5f55452fa58' down_revision = '<PASS...
pandas_market_calendars/holidays_uk.py
jmcdermo/pandas_market_calendars
460
12755060
<filename>pandas_market_calendars/holidays_uk.py # UK Holidays import pandas as pd from pandas import DateOffset, Timestamp from pandas.tseries.holiday import Holiday, MO, previous_friday, weekend_to_monday from pandas_market_calendars.market_calendar import MONDAY, TUESDAY # New Year's Eve LSENewYearsEve = Holiday(...
climpred/tests/test_alignment.py
raybellwaves/climpred
104
12755061
import logging import numpy as np import pytest import xskillscore as xs from climpred.exceptions import CoordinateError from climpred.prediction import compute_hindcast def test_same_inits_initializations( hind_ds_initialized_1d_cftime, reconstruction_ds_1d_cftime, caplog ): """Tests that inits are identic...
gremlin/neptune-streams/lambda/neptune-streams-demo/neptune_python_utils/bulkload.py
chriscoombs/amazon-neptune-samples
298
12755066
''' Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: MIT-0 ''' import json import urllib.request import os import time from neptune_python_utils.endpoints import Endpoints class BulkLoad: def __init__(self, source, format='csv', role=None, region=None, endpoint...
src/amuse/units/core.py
sibonyves/amuse
131
12755071
<filename>src/amuse/units/core.py<gh_stars>100-1000 from amuse.support.core import late from amuse.support import exceptions import numpy from amuse.support.core import memoize from amuse.support.core import MultitonMetaClass class system(object): ALL = {} def __init__(self, name): self.name = name...
mmtbx/regression/model_idealization/tst_withmap_04.py
dperl-sol/cctbx_project
155
12755083
from __future__ import absolute_import, division, print_function from libtbx import easy_run import libtbx.load_env import os.path import time # taken from phenix_regression/refinement/ncs/tst_ncs_0.py pdb_str = """\ CRYST1 100.000 100.000 100.000 90.00 90.00 90.00 P 1 ATOM 1 N ALA A 1 27.344 16....
RecoEgamma/ElectronIdentification/python/egmPatElectronIDs_cfi.py
ckamtsikis/cmssw
852
12755091
<gh_stars>100-1000 import FWCore.ParameterSet.Config as cms from PhysicsTools.SelectorUtils.centralIDRegistry import central_id_registry from PhysicsTools.SelectorUtils.trivialCutFlow_cff import * trivialCutFlowMD5 = central_id_registry.getMD5FromName(trivialCutFlow.idName) egmPatElectronIDs = cms.EDProducer( "V...
corehq/apps/builds/fixtures.py
dimagilg/commcare-hq
471
12755094
import json commcare_build_config = json.loads("""{ "_id": "config--commcare-builds", "doc_type": "CommCareBuildConfig", "preview": { "version": "1.2.1", "build_number": null, "latest": true }, "defaults": [{ "version": "1.2.1", "build_number": null, "latest": ...
staffjoy/resources/session.py
Joey-Wondersign/Staffjoy-suite-Joey
890
12755096
from staffjoy.resource import Resource class Session(Resource): """User session""" PATH = "users/{user_id}/sessions/{session_id}" ID_NAME = "session_id"
py4j-python/src/py4j/tests/memory_leak_test.py
dHannasch/py4j
3,301
12755123
<reponame>dHannasch/py4j # -*- coding: UTF-8 -*- from contextlib import contextmanager import gc from multiprocessing import Process import subprocess import unittest from py4j.java_gateway import ( JavaGateway, GatewayParameters, CallbackServerParameters, DEFAULT_PORT, DEFAULT_PYTHON_PROXY_PORT) from py4j.cli...
dataset/merge_dataset.py
wx-b/SOLD2
347
12755133
""" Compose multiple datasets in a single loader. """ import numpy as np from copy import deepcopy from torch.utils.data import Dataset from dataset.wireframe_dataset import WireframeDataset from dataset.holicity_dataset import HolicityDataset class MergeDataset(Dataset): def __init__(self, mode, config=None): ...
corehq/apps/data_interfaces/migrations/0010_automaticupdaterule_workflow.py
dimagilg/commcare-hq
471
12755136
<filename>corehq/apps/data_interfaces/migrations/0010_automaticupdaterule_workflow.py # Generated by Django 1.10.7 on 2017-05-23 11:39 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('data_interfaces', '0009_scheduling_integration'), ] operation...
tests/test_config.py
istvan-fodor/giraffez
122
12755144
# -*- coding: utf-8 -*- import os import platform import pytest import yaml import giraffez from giraffez.constants import * from giraffez.errors import * from giraffez.types import Columns from giraffez.utils import * @pytest.mark.usefixtures('config', 'tmpfiles') class TestConfig(object): def test_get_set_li...
sdk/python/pulumi_azure/mysql/flexible_server_configuration.py
henriktao/pulumi-azure
109
12755194
<gh_stars>100-1000 # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, over...
src/pipelines/epidemiology/ua_authority.py
chrismayemba/covid-19-open-data
430
12755224
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
pahelix/utils/protein_tools.py
agave233/PaddleHelix
454
12755241
# Copyright (c) 2020 PaddlePaddle 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 app...
feature_learning/visualzation/file2web.py
oumayb/ArtMiner
107
12755255
import argparse import os import re parser = argparse.ArgumentParser('Visualizing Training sample, top200 pairs from randomly top 2000 pairs') parser.add_argument( '--outHtml', type=str, help='output html file') parser.add_argument( '--imgDir', type=str, help='image directory') args = parser.parse_args() ...
data/io/convert_data_to_tfrecord_coco.py
rickyHong/NAS_FPN_repl
224
12755269
<reponame>rickyHong/NAS_FPN_repl # -*- coding: utf-8 -*- from __future__ import division, print_function, absolute_import import sys sys.path.append('../../') import xml.etree.cElementTree as ET import numpy as np import tensorflow as tf import glob import cv2 import json from libs.label_name_dict.label_dict import * f...
dragonfly/exd/unittest_exd_utils.py
hase1128/dragonfly
675
12755300
<filename>dragonfly/exd/unittest_exd_utils.py<gh_stars>100-1000 """ Unit tests for ed_utils. -- <EMAIL> """ from __future__ import absolute_import from __future__ import division # pylint: disable=relative-import # Local imports from .exd_utils import random_sampling_cts, random_sampling_kmeans_cts from ..utils.b...
chainer-1.4/seg_rnn.py
ysadamori/chainer_LSTM_seq2seq_example
137
12755306
<gh_stars>100-1000 #!/usr/bin/python3 #import my_settings import sys import math import numpy as np from argparse import ArgumentParser from chainer import functions, optimizers import util.generators as gens from util.functions import trace, fill_batch from util.model_file import ModelFile from util.vocabulary imp...
sheetfu/config.py
darkroomdave/sheetfu
893
12755323
<reponame>darkroomdave/sheetfu fields_masks = { 'background': "sheets/data/rowData/values/effectiveFormat/backgroundColor", 'value': "sheets/data/rowData/values/formattedValue", 'note': "sheets/data/rowData/values/note", 'font_color': "sheets/data/rowData/values/effectiveFormat/textFormat/foregroundColo...
Malt/Render/Lighting.py
BlenderNPR/BEER
242
12755397
# Copyright (c) 2020 BlenderNPR and contributors. MIT license. import math import ctypes import pyrr from Malt.GL.GL import * from Malt.GL.Shader import UBO from Malt.GL.Texture import TextureArray, CubeMapArray from Malt.GL.RenderTarget import ArrayLayerTarget, RenderTarget from Malt import Pipeline _LIGHTS_BUFFE...
sdk/python/pulumi_aws/eks/get_clusters.py
chivandikwa/pulumi-aws
260
12755417
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import...
pylons/decorators/rest.py
KinSai1975/Menira.py
118
12755426
"""REST decorators""" import logging from decorator import decorator from pylons.controllers.util import abort from pylons.decorators.util import get_pylons __all__ = ['dispatch_on', 'restrict'] log = logging.getLogger(__name__) def restrict(*methods): """Restricts access to the function depending on HTTP met...
app/log.py
nthparameter/ci_edit
229
12755429
<reponame>nthparameter/ci_edit # Copyright 2016 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-2.0 # # Unless required by applicabl...
common/tools/jcxxgen.bzl
mfkiwl/verible
147
12755438
# -*- Python -*- # Copyright 2021 The Verible Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
glumpy/app/__init__.py
Frekby/glumpy
1,074
12755470
# ----------------------------------------------------------------------------- # Copyright (c) 2009-2016 <NAME>. All rights reserved. # Distributed under the (new) BSD License. # ----------------------------------------------------------------------------- """ """ import os import re import sys import logging import i...
aries_cloudagent/transport/inbound/tests/test_session.py
kuraakhilesh8230/aries-cloudagent-python
247
12755476
<reponame>kuraakhilesh8230/aries-cloudagent-python import asyncio import pytest from asynctest import TestCase, mock as async_mock from ....admin.server import AdminResponder from ....core.in_memory import InMemoryProfile from ....messaging.responder import BaseResponder from ....multitenant.base import BaseMultitena...
losses/flow_loss.py
Wassouli/projet-prat-oceano
196
12755480
import torch.nn as nn import torch.nn.functional as F from .loss_blocks import SSIM, smooth_grad_1st, smooth_grad_2nd, TernaryLoss from utils.warp_utils import flow_warp from utils.warp_utils import get_occu_mask_bidirection, get_occu_mask_backward class unFlowLoss(nn.modules.Module): def __init__(self, cfg): ...
nmap_port_scanner_ip_obj.py
Mr-Cracker-Pro/red-python-scripts
1,353
12755494
#!/usr/bin/env python3 #Use these commands in Kali to install required software: # sudo apt install python3-pip # pip install python-nmap # Import nmap so we can use it for the scan import nmap # We import the ipaddress module. We want to use the ipaddress.ip_address(address) # method to see if we can instantiate a ...
language/conpono/cpc/run_cc_cpc.py
naveenjafer/language
1,199
12755501
# coding=utf-8 # Copyright 2018 The Google AI Language Team 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 ...
dp/cloud/python/magma/db_service/tests/db_testcase.py
nstng/magma
539
12755521
<filename>dp/cloud/python/magma/db_service/tests/db_testcase.py import unittest from typing import Dict, Optional import sqlalchemy.engine from magma.db_service.config import TestConfig from magma.db_service.models import Base from magma.db_service.session_manager import Session from sqlalchemy import MetaData, create...
research/feelvos/utils/video_input_generator.py
873040/Abhishek
153
12755530
<reponame>873040/Abhishek # Copyright 2018 The TensorFlow Authors All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
gdmix-trainer/src/gdmix/io/dataset_metadata.py
Kostyansa/gdmix
130
12755541
<reponame>Kostyansa/gdmix import tensorflow as tf from gdmix.util.io_utils import read_json_file, namedtuple_with_defaults class DatasetMetadata: """Abstract Metadata class from which all dataset metadata classes derive""" # define mapping of dtype in meta data to dtype in TensorFlow TO_TF_DTYPE = { ...
utils/AttendanceCheck.py
datamonday/Face-Recognition-Class-Attendance-System
105
12755559
from datetime import datetime import pandas as pd import numpy as np # 将根目录(execute所在目录)添加到环境变量 from utils.GlobalVar import add_path_to_sys rootdir = add_path_to_sys() # 导入考勤状态判断相关函数和变量 from utils.GlobalVar import COURSE_TIME, LATE_SPAN filenames = ['Auxiliary_Info.xlsx', 'Classroom_Course_Schedule.xls...
python/federatedml/secure_information_retrieval/secure_information_retrieval_host.py
rubenlozanoaht3m/DataDogm
715
12755572
#!/usr/bin/env python # -*- coding: utf-8 -*- # # 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/lic...
docs/docs_env/Lib/sre.py
gilsonbp/Django-facebook
6,989
12755577
<gh_stars>1000+ """This file is only retained for backwards compatibility. It will be removed in the future. sre was moved to re in version 2.5. """ import warnings warnings.warn("The sre module is deprecated, please import re.", DeprecationWarning, 2) from re import * from re import __all__ # old pic...