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
src/generate-jobs/calculate_quad_key.py
geops/osm2vectortiles
524
12688885
#!/usr/bin/env python """Calculate QuadKey for TSV file and append it as column Usage: calculate_quad_key.py <list_file> calculate_quad_key.py (-h | --help) calculate_quad_key.py --version Options: -h --help Show this screen. --version Show version. """ import sys impor...
conans/test/functional/generators/package_info/deps_cpp_info_test.py
ssaavedra/conan
6,205
12688890
import textwrap import unittest from conans.test.assets.genconanfile import GenConanfile from conans.test.utils.tools import TestClient class DepsCppInfoTest(unittest.TestCase): def test(self): # https://github.com/conan-io/conan/issues/7598 client = TestClient() client.save({"conanfile...
colossalai/nn/optimizer/hybrid_adam.py
RichardoLuo/ColossalAI
1,630
12688891
<reponame>RichardoLuo/ColossalAI<filename>colossalai/nn/optimizer/hybrid_adam.py import torch from colossalai.utils import multi_tensor_applier from colossalai.registry import OPTIMIZERS from colossalai.nn.optimizer import CPU_ADAM_CNT @OPTIMIZERS.register_module class HybridAdam(torch.optim.Optimizer): """Imple...
cctbx/adp_restraints/flags.py
dperl-sol/cctbx_project
155
12688892
from __future__ import absolute_import, division, print_function from libtbx import adopt_init_args import sys class flags(object): def __init__(self, adp_similarity=None, rigid_bond=None, isotropic_adp=None, default=False): if (adp_similarity is None): adp_similarity = default ...
tutorial/python/1-Flat.py
ScriptBox99/facebook-faiss
17,006
12688897
# 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 numpy as np d = 64 # dimension nb = 100000 # database size nq = 10000 ...
geoplot/datasets.py
QuLogic/geoplot
1,025
12688898
<gh_stars>1000+ """ Example dataset fetching utility. Used in docs. """ src = 'https://raw.githubusercontent.com/ResidentMario/geoplot-data/master' def get_path(dataset_name): """ Returns the URL path to an example dataset suitable for reading into ``geopandas``. """ if dataset_name == 'usa_cities': ...
FWCore/MessageService/test/u20_cfg.py
ckamtsikis/cmssw
852
12688903
# Unit test configuration file for MessageLogger service # Uses include MessageLogger.cfi and nothing else except time stamp suppression # Currently output will be jumbled unless cout and cerr are directed separately import FWCore.ParameterSet.Config as cms process = cms.Process("TEST") import FWCore.Framework.test....
Skype4Py/api/posix_x11.py
low456high/Skype4Py
199
12688914
<gh_stars>100-1000 """ Low level *Skype for Linux* interface implemented using *XWindows messaging*. Uses direct *Xlib* calls through *ctypes* module. This module handles the options that you can pass to `Skype.__init__` for Linux machines when the transport is set to *X11*. No further options are currently supported...
pe_tree/hash_pe.py
lybtongji/pe_tree
1,271
12688928
# # Copyright (c) 2020 BlackBerry Limited. 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 requ...
recipes/Python/578882_Monitor_Progress_File_Descriptors_Another/recipe-578882.py
tdiprima/code
2,023
12688929
#!/usr/bin/env python # # fdprogress.py -- by Alfe (<EMAIL>), inspired by azat@Stackoverflow # # usage: fdprogress.py <pid> # import time, os, os.path from collections import defaultdict def getFds(pid): return os.listdir('/proc/%s/fd/' % pid) def getPos(pid, fd): with open('/proc/%s/fdinfo/%s' % (pid, fd)) as...
DQMOffline/Trigger/python/PhotonMonitor_cfi.py
ckamtsikis/cmssw
852
12688940
import FWCore.ParameterSet.Config as cms from DQMOffline.Trigger.photonMonitoring_cfi import photonMonitoring hltPhotonmonitoring = photonMonitoring.clone() hltPhotonmonitoring.FolderName = cms.string('HLT/Photon/Photon200/') hltPhotonmonitoring.histoPSet.lsPSet = cms.PSet( nbins = cms.uint32 ( 250 ), xmin = cms...
var/spack/repos/builtin/packages/ruby-erubis/package.py
kkauder/spack
2,360
12688959
# 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 RubyErubis(RubyPackage): """Erubis is a fast, secure, and very extensible implementation of eRuby. """ ...
albu-solution/src/pytorch_utils/concrete_eval.py
Hulihrach/RoadDetector
180
12688960
import os import cv2 cv2.setNumThreads(0) cv2.ocl.setUseOpenCL(False) import numpy as np from .eval import Evaluator class FullImageEvaluator(Evaluator): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) def process_batch(self, predicted, model, data, prefix=""): ...
dl_coursera/markup.py
nodamu/dl_coursera
111
12688964
import logging import copy import re from urllib.parse import quote import bs4 import jinja2 from .resource import load_resource from .define import URL_ROOT def _is_root(e): return e.parent is None def _is_tag(e): return isinstance(e, bs4.Tag) def _has_no_child(tag): return len(tag.contents) == 0 ...
tests/utils/object_factory.py
chschroeder/small-text
218
12688991
<reponame>chschroeder/small-text<gh_stars>100-1000 import numpy as np from small_text.active_learner import PoolBasedActiveLearner def get_initialized_active_learner(clf_factory, query_strategy, dataset): active_learner = PoolBasedActiveLearner(clf_factory, query_strategy, dataset) x_indices_initial = np.ra...
tests/st/ops/ascend/test_drop_out_gen_mask.py
GuoSuiming/mindspore
3,200
12688996
<filename>tests/st/ops/ascend/test_drop_out_gen_mask.py # Copyright 2020 Huawei Technologies Co., Ltd # # 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/LICENS...
azure-kusto-data/tests/test_converter.py
artunduman/azure-kusto-python
134
12689003
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License import unittest from datetime import timedelta from azure.kusto.data._converters import to_datetime, to_timedelta class ConverterTests(unittest.TestCase): """These are unit tests that should test custom converters used in.""" def test_t...
tests/components/panel_custom/__init__.py
domwillcode/home-assistant
30,023
12689019
<gh_stars>1000+ """Tests for the panel_custom component."""
examples/implicit_orientation_learning/processors.py
niqbal996/paz
300
12689041
<reponame>niqbal996/paz from paz.abstract import Processor import numpy as np class MakeDictionary(Processor): def __init__(self, encoder, renderer): super(MakeDictionary, self).__init__() self.latent_dimension = encoder.encoder.output_shape[1] self.encoder = encoder self.renderer ...
psdaq/psdaq/pyxpm/surf/devices/silabs/_Si5345Lite.py
ZhenghengLi/lcls2
134
12689047
#----------------------------------------------------------------------------- # This file is part of 'SLAC Firmware Standard Library'. # It is subject to the license terms in the LICENSE.txt file found in the # top-level directory of this distribution and at: # https://confluence.slac.stanford.edu/display/ppareg/LI...
AlphaZero/AlphaMCTS.py
morozig/muzero
111
12689048
<filename>AlphaZero/AlphaMCTS.py """ Contains logic for performing Monte Carlo Tree Search having access to the environment. The class is an adaptation of AlphaZero-General's MCTS search to accommodate non-adversarial environments (MDPs). We utilize the MinMax scaling of backed-up rewards for the UCB formula and (by d...
optimus/engines/cudf/rows.py
ironmussa/Optimus
1,045
12689049
<filename>optimus/engines/cudf/rows.py import functools import operator from optimus.engines.base.cudf.rows import CUDFBaseRows import cudf import pandas as pd from optimus.engines.base.dataframe.rows import DataFrameBaseRows from optimus.engines.base.cudf.rows import CUDFBaseRows from optimus.engines.base.rows import...
pythran/tests/user_defined_import/global_init_alias_main.py
davidbrochart/pythran
1,647
12689086
<reponame>davidbrochart/pythran<filename>pythran/tests/user_defined_import/global_init_alias_main.py import global_init as gi XX = [gi.aa(), 3] #pythran export bb() def bb(): return XX
importer/models.py
juliecentofanti172/juliecentofanti.github.io
134
12689087
<filename>importer/models.py """ See the module-level docstring for implementation details """ from django.core.validators import MinValueValidator from django.db import models # FIXME: these classes should have names which more accurately represent what they do class TaskStatusModel(models.Model): created = mod...
lightbus/serializers/by_field.py
gcollard/lightbus
178
12689119
""" Serializers suitable for transports which support multiple fields per message These serializers handle moving data to/from a dictionary format. The format looks like this:: # Message metadata first. Each value is implicitly a utf8 string id: 'ZOCTLh1CEeimW3gxwcOTbg==' api_name: 'my_company.auth' p...
parsl/tests/test_python_apps/test_depfail_propagation.py
cylondata/parsl
323
12689153
<filename>parsl/tests/test_python_apps/test_depfail_propagation.py from parsl import python_app from parsl.dataflow.error import DependencyError @python_app def fails(): raise ValueError("Deliberate failure") @python_app def depends(parent): return 1 def test_depfail_once(): """Test the simplest depen...
env/lib/python3.6/site-packages/py4j/tests/java_tls_test.py
jenngeorge/kafka-practice
111
12689156
""" Created on Feb 2, 2016 @author: <NAME> """ from __future__ import unicode_literals, absolute_import from multiprocessing import Process import subprocess import unittest import ssl import os import sys from py4j.java_gateway import ( JavaGateway, CallbackServerParameters, set_default_callback_accept_time...
HunterSense/model/request_log.py
tt9133github/hunter
322
12689165
#!/ usr/bin/env # coding=utf-8 # # Copyright 2019 ztosec & https://www.zto.com/ # # 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 r...
nextgen/bcbio/pipeline/shared.py
bgruening/bcbb
339
12689185
<gh_stars>100-1000 """Pipeline functionality shared amongst multiple analysis types. """ import os import collections from contextlib import closing import pysam from bcbio import broad from bcbio.pipeline.alignment import get_genome_ref from bcbio.utils import file_exists, safe_makedir, save_diskspace from bcbio.dis...
desktop/core/ext-py/urllib2_kerberos-0.1.6/setup.py
kokosing/hue
5,079
12689186
<reponame>kokosing/hue<filename>desktop/core/ext-py/urllib2_kerberos-0.1.6/setup.py<gh_stars>1000+ # Copyright 2008 Lime Nest LLC # Copyright 2008 Lime Spot 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 o...
python_toolbox/wx_tools/widgets/cute_bitmap_button.py
hboshnak/python_toolbox
119
12689197
# Copyright 2009-2011 <NAME>. # This program is distributed under the LGPL2.1 license. import wx from python_toolbox.wx_tools.widgets.cute_button import CuteButton class CuteBitmapButton(wx.BitmapButton, CuteButton): def __init__(self, parent, id=-1, bitmap=wx.NullBitmap, pos=wx.DefaultPosition...
scripts/monitoring/cron-haproxy-close-wait.py
fahlmant/openshift-tools
164
12689230
#!/usr/bin/python # vim: expandtab:tabstop=4:shiftwidth=4 # Disabling invalid-name because pylint doesn't like the naming convention we have. # pylint: disable=invalid-name ''' Tool to detect haproxy processes that have been running longer than the most recent haproxy process and have connection in CLOSE_WAIT stat...
test/com/facebook/buck/testutil/endtoend/testdata/fix/fix.py
Unknoob/buck
8,027
12689249
#!/usr/bin/env python from __future__ import print_function import argparse import json import sys if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("--build-details", required=True) parser.add_argument("--exit-code", type=int, default=0) parser.add_argument("--wait",...
service_checker.py
nettargets/bern
143
12689264
from datetime import datetime import math import numpy as np import random from utils \ import is_good, is_get_good, send_mail, test_bern_get, test_bern_post, query FROM_GMAIL_ADDR = 'YOUR_GMAIL_ADDR' FROM_GMAIL_ACCOUNT_PASSWORD = '<PASSWORD>' TO_EMAIL_ADDR = 'TO_EMAIL_ADDR' def check_bern(from_gmail, to_email, ...
nni/experiment/config/utils/internal.py
dutxubo/nni
2,305
12689266
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. """ Utility functions for experiment config classes, internal part. If you are implementing a config class for a training service, it's unlikely you will need these. """ import dataclasses import importlib import json import os.path from pathli...
examples/inference/python/export/fairseq/native_fs_transformer_export.py
hexisyztem/lightseq
106
12689283
<filename>examples/inference/python/export/fairseq/native_fs_transformer_export.py<gh_stars>100-1000 """ Export native Fairseq Transformer models to protobuf/hdf5 format. Refer to the `examples/training/fairseq` directory for more training details. """ from collections import OrderedDict import torch from export.proto...
flask_reddit/users/forms.py
huhansan666666/flask_reddit
461
12689303
<gh_stars>100-1000 # -*- coding: utf-8 -*- """ Logic handling user specific input forms such as logins and registration. """ from flask_wtf import FlaskForm from wtforms import TextField, PasswordField, BooleanField from flask_wtf.recaptcha import RecaptchaField from wtforms.validators import Required, EqualTo, Email ...
pincer/objects/message/attachment.py
Arthurdw/Pincer
118
12689314
<reponame>Arthurdw/Pincer # Copyright Pincer 2021-Present # Full MIT License can be found in `LICENSE` at the project root. from __future__ import annotations from dataclasses import dataclass from typing import TYPE_CHECKING from ...utils.api_object import APIObject from ...utils.types import MISSING if TYPE_CHECK...
tests/test_engine.py
RobertCraigie/prisma-client-py
518
12689322
<gh_stars>100-1000 import asyncio import contextlib from pathlib import Path from typing import Iterator, Optional import pytest from _pytest.monkeypatch import MonkeyPatch from pytest_subprocess import FakeProcess from prisma import Client from prisma.utils import temp_env_update from prisma.binaries import platform...
Giveme5W1H/examples/evaluation/evaluation.py
bkrrr/Giveme5W
410
12689333
import csv import os """ evaluates results by calculating: - ICR(pairwise intercoder reliability AB, BC, AC) - GP(precision_generalized) Results are global and per category """ filename = 'evaluation_data_how.csv' # change csv column index, if necessary here category_index = 2 coder_a_index = 5 coder_b_index = ...
doc/examples/scripts/structure/normal_modes.py
alex123012/biotite
208
12689340
r""" Visualization of normal modes from an elastic network model =========================================================== The *elastic network model* (ENM) is a fast method to estimate movements in a protein structure, without the need to run time-consuming MD simulations. A protein is modelled as *mass-and-spring*...
examples/04_manipulating_images/plot_negate_image.py
SIMEXP/nilearn
827
12689343
<filename>examples/04_manipulating_images/plot_negate_image.py """ Negating an image with math_img =============================== The goal of this example is to illustrate the use of the function :func:`nilearn.image.math_img` on T-maps. We compute a negative image by multiplying its voxel values with -1. """ from n...
sdk/python/pulumi_azure/authorization/get_user_assigned_identity.py
henriktao/pulumi-azure
109
12689358
# 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...
kgp/datasets/sysid.py
alshedivat/keras-gp
181
12689369
""" Interface for system identification data (Actuator and Drives). """ from __future__ import print_function import os import sys import zipfile import warnings import numpy as np import scipy.io as sio from six.moves import urllib from six.moves import cPickle as pkl SOURCE_URLS = { 'actuator': 'https://www.c...
package_syncing/logger.py
csch0/SublimeText-Package-Syncing
171
12689389
<reponame>csch0/SublimeText-Package-Syncing<gh_stars>100-1000 import sublime import sublime_plugin import logging LOG = False TRACE = 9 BASIC_FORMAT = "[%(asctime)s - %(levelname)s - %(filename)s %(funcName)s] %(message)s" logging.addLevelName("TRACE", TRACE) class CustomLogger(logging.Logger): def isEnabledF...
aliyun-python-sdk-cbn/aliyunsdkcbn/request/v20170912/ListTransitRouterRouteTablesRequest.py
leafcoder/aliyun-openapi-python-sdk
1,001
12689394
<filename>aliyun-python-sdk-cbn/aliyunsdkcbn/request/v20170912/ListTransitRouterRouteTablesRequest.py # 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 ...
ml/kubeflow-pipelines/keras_tuner/components/kubeflow-resources/bikesw_training/eval_metrics.py
amygdala/code-snippets
146
12689397
<gh_stars>100-1000 # 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 agr...
zerver/webhooks/json/tests.py
Pulkit007/zulip
17,004
12689418
<filename>zerver/webhooks/json/tests.py<gh_stars>1000+ import json from zerver.lib.test_classes import WebhookTestCase class JsonHookTests(WebhookTestCase): STREAM_NAME = "json" URL_TEMPLATE = "/api/v1/external/json?api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "json" def test_json_github_pu...
glucometerutils/support/tests/test_construct_extras.py
Flameeyes/glucometerutils
135
12689429
# -*- coding: utf-8 -*- # # SPDX-FileCopyrightText: © 2018 The glucometerutils Authors # SPDX-License-Identifier: MIT """Tests for the common routines.""" # pylint: disable=protected-access,missing-docstring import datetime import construct from absl.testing import absltest from glucometerutils.support import const...
python/ql/test/experimental/dataflow/tainttracking/defaultAdditionalTaintStep-py3/test_pathlib.py
timoles/codeql
4,036
12689458
# Add taintlib to PATH so it can be imported during runtime without any hassle import sys; import os; sys.path.append(os.path.dirname(os.path.dirname((__file__)))) from taintlib import * # This has no runtime impact, but allows autocomplete to work from typing import Iterable, TYPE_CHECKING if TYPE_CHECKING: from ...
t/test_umash_fprint.py
backtrace-labs/umash
108
12689472
""" Test suite for the public fingerprinting function. """ from hypothesis import given, settings import hypothesis.strategies as st from umash import C, FFI from umash_reference import umash, UmashKey U64S = st.integers(min_value=0, max_value=2 ** 64 - 1) FIELD = 2 ** 61 - 1 def repeats(min_size): """Repeats...
rgb_track/models/wrappers/rgb_simple_wrapper.py
hieuvecto/CASIA-SURF_CeFA
133
12689506
import torch.nn as nn import torch from at_learner_core.models.wrappers.losses import get_loss from at_learner_core.models.wrappers.simple_classifier_wrapper import SimpleClassifierWrapper from at_learner_core.models.architectures import get_backbone class RGBSimpleWrapper(SimpleClassifierWrapper): def __init__(s...
Chapter10/c10_16_straddle.py
John-ye666/Python-for-Finance-Second-Edition
236
12689512
# -*- coding: utf-8 -*- """ Name : c10_16_straddle.py Book : Python for Finance (2nd ed.) Publisher: Packt Publishing Ltd. Author : <NAME> Date : 6/6/2017 email : <EMAIL> <EMAIL> """ import matplotlib.pyplot as plt import numpy as np sT = np.arange(30,80,5) x=50; c=2; p=1 st...
stable_nalu/layer/_abstract_recurrent_cell.py
wlm2019/Neural-Arithmetic-Units
147
12689513
import torch from ..abstract import ExtendedTorchModule class AbstractRecurrentCell(ExtendedTorchModule): def __init__(self, Op, input_size, hidden_size, writer=None, **kwargs): super().__init__('recurrent', writer=writer, **kwargs) self.input_size = input_size self.hidden_size = hidden_si...
tests/test_visitors/test_ast/test_complexity/test_jones/test_module_complexity.py
cdhiraj40/wemake-python-styleguide
1,931
12689539
<reponame>cdhiraj40/wemake-python-styleguide import pytest from wemake_python_styleguide.visitors.ast.complexity.jones import ( JonesComplexityVisitor, JonesScoreViolation, ) module_without_nodes = '' module_with_nodes = """ some_value = 1 + 2 other = some_value if some_value > 2 else some_value * 8 + 34 """ ...
netaddr/tests/ip/test_ip.py
Rockly/netaddr
416
12689557
import weakref from netaddr import IPAddress, IPNetwork, IPRange def test_ip_classes_are_weak_referencable(): weakref.ref(IPAddress('10.0.0.1')) weakref.ref(IPNetwork('10.0.0.1/8')) weakref.ref(IPRange('10.0.0.1', '10.0.0.10'))
actions/lib/utils.py
mattmiller87/stackstorm-time
164
12689584
<gh_stars>100-1000 import time __all__ = [ 'dt_to_timestamp' ] def dt_to_timestamp(dt): timestamp = int(time.mktime(dt.timetuple())) return timestamp
superset/dashboards/filter_sets/commands/create.py
delorenzosoftware/superset
18,621
12689597
<gh_stars>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"...
src/genie/libs/parser/iosxe/tests/ShowWirelessMobilitySummary/cli/equal/golden_output2_expected.py
balmasea/genieparser
204
12689655
<reponame>balmasea/genieparser expected_output = { "controller_config": { "group_name": "default", "ipv4": "10.9.3.4", "mac_address": "AAAA.BBFF.8888", "multicast_ipv4": "0.0.0.0", "multicast_ipv6": "::", "pmtu": "N/A", "public_ip": "N/A", "status": "N...
tutorials/eboutique/microservices/product/src/commands/__init__.py
bhardwajRahul/minos-python
247
12689673
<reponame>bhardwajRahul/minos-python<gh_stars>100-1000 from .services import ( ProductCommandService, )
chitra/import_utils.py
aniketmaurya/Chitra
158
12689693
import importlib def is_installed(module_name: str): return importlib.util.find_spec(module_name) is not None
reinforcement/tensorflow/minigo/tests/test_go.py
mengkai94/training
3,475
12689733
# Copyright 2018 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, ...
panel/tests/template/test_vanilla_manual.py
datalayer-contrib/holoviz-panel
1,130
12689744
import panel as pn import numpy as np import holoviews as hv LOGO = "https://panel.holoviz.org/_static/logo_horizontal.png" def test_vanilla_with_sidebar(): """Returns an app that uses the vanilla template in various ways. Inspect the app and verify that the issues of [Issue 1641]\ (https://github.com/holoviz/p...
timesynth/signals/car.py
swight-prc/TimeSynth
242
12689761
<reponame>swight-prc/TimeSynth import numpy as np from .base_signal import BaseSignal __all__ = ['CAR'] class CAR(BaseSignal): """Signal generatpr for continuously autoregressive (CAR) signals. Parameters ---------- ar_param : number (default 1.0) Parameter of the AR(1) process sigma : n...
crabageprediction/venv/Lib/site-packages/fontTools/ttLib/tables/_h_e_a_d.py
13rianlucero/CrabAgePrediction
38,667
12689816
from fontTools.misc import sstruct from fontTools.misc.fixedTools import floatToFixedToStr, strToFixedToFloat from fontTools.misc.textTools import safeEval, num2binary, binary2num from fontTools.misc.timeTools import timestampFromString, timestampToString, timestampNow from fontTools.misc.timeTools import epoch_diff as...
ibis/backends/impala/tests/test_connection_pool.py
GrapeBaBa/ibis
986
12689821
import ibis def test_connection_pool_size(hdfs, env, test_data_db): client = ibis.impala.connect( port=env.impala_port, hdfs_client=hdfs, host=env.impala_host, database=test_data_db, ) # the client cursor may or may not be GC'd, so the connection # pool will contain ei...
test/data/70.py
suliveevil/vista.vim
1,764
12689852
<filename>test/data/70.py class Foo: class Bar: def baz(self): pass
test/examples/simple/registers/integration/common/regmodel.py
rodrigomelo9/uvm-python
140
12689855
<gh_stars>100-1000 #// #//------------------------------------------------------------------------------ #// Copyright 2011 Mentor Graphics Corporation #// Copyright 2011 Cadence Design Systems, Inc. #// Copyright 2011 Synopsys, Inc. #// Copyright 2019-2020 <NAME> (tpoikela) #// All Rights Reserved Worldwide ...
federatedml/optim/test/activation_test.py
fqiang/FATE
3,787
12689869
#!/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/conf.py
melonwater211/snorkel
2,906
12689873
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # http://www.sphinx-doc.org/en/master/config # -- Path setup -------------------------------------------------------------- # If extensions (or module...
src/mesh_nerf.py
qway/nerfmeshes
113
12689904
<gh_stars>100-1000 import argparse import os import numpy as np import torch import models from importlib import import_module from pytorch3d.structures import Meshes from skimage import measure from nerf.nerf_helpers import export_obj, batchify from lightning_modules import PathParser def create_mesh(vertices, face...
tests/test_ami.py
ukwa/mrjob
1,538
12689929
<reponame>ukwa/mrjob # -*- coding: utf-8 -*- # Copyright 2018 Yelp # # 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 applic...
eos/core/__init__.py
YSaxon/eos
168
12689935
""" EOS core package. """ from .base import Base, EOSException from .profiler import Profiler from .symfony import Symfony from .engine import Engine from .cookies import RememberMe from .eos import EOS
elastichq/api/clusters.py
billboggs/elasticsearch-HQ
2,026
12689953
<filename>elastichq/api/clusters.py """ .. module:: clusters .. moduleauthor:: <NAME> <<EMAIL>> """ from flask import request, current_app from flask_restful import Resource from requests.exceptions import ConnectionError from elastichq.model import ClusterDTO from . import api from ..common.api_response import APIR...
test/ios/TestIOSDriver.py
chonty/napalm1
1,752
12689971
<filename>test/ios/TestIOSDriver.py # Copyright 2015 Spotify AB. All rights reserved. # # The contents of this file are 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/l...
test/vso_tools/copyright_check.py
nbl97/nni
2,305
12689973
<reponame>nbl97/nni<gh_stars>1000+ import os import sys invalid_files = [] copyright_headers = [ '# Copyright (c) Microsoft Corporation.\n# Licensed under the MIT license.', '# Copyright (c) Microsoft Corporation. All rights reserved.\n#\n# MIT License', ] whitelist = [ 'nni/version.py', 'nni/algorit...
examples/testFile.py
tgolsson/appJar
666
12689989
import sys sys.path.append("../") from appJar import gui def getQuestions(fileName = "questions.txt"): questions = [] data = None with open(fileName, "r") as questionsFile: while True: line = questionsFile.readline().strip() if line == "EOF": break # end of file...
data/logs_model/test/test_combined_model.py
giuseppe/quay
2,027
12690026
<reponame>giuseppe/quay from datetime import date, datetime, timedelta from freezegun import freeze_time from data.logs_model.inmemory_model import InMemoryModel from data.logs_model.combined_model import CombinedLogsModel from test.fixtures import * @pytest.fixture() def first_model(): return InMemoryModel() ...
tests/unit/test_ignore_list.py
georgettica/URLExtract
184
12690041
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This file contains pytests for exeption URLs () method of URLExtract .. Licence MIT .. codeauthor:: <NAME> <<EMAIL>>, <EMAIL> """ import pytest @pytest.mark.parametrize( "text, expected", [ ("example.com", []), ("ample.com", ["ample.com"]), ...
tests/test_paths.py
JPTIZ/asciimatics
3,197
12690052
import unittest from asciimatics.event import MouseEvent from asciimatics.paths import Path, DynamicPath class TestPaths(unittest.TestCase): def assert_path_equals(self, path, oracle): path.reset() positions = [] while not path.is_finished(): positions.append(path.next_pos()) ...
tests/test_settings.py
PaKyong/labelImg
17,641
12690062
<gh_stars>1000+ #!/usr/bin/env python import os import sys import time import unittest __author__ = 'TzuTaLin' dir_name = os.path.abspath(os.path.dirname(__file__)) libs_path = os.path.join(dir_name, '..', 'libs') sys.path.insert(0, libs_path) from settings import Settings class TestSettings(unittest.TestCase): ...
tests/nlu_core_tests/component_tests/pre_processing_tests/stopword_tests.py
milyiyo/nlu
480
12690077
<filename>tests/nlu_core_tests/component_tests/pre_processing_tests/stopword_tests.py<gh_stars>100-1000 import unittest from tests.test_utils import get_sample_pdf_with_labels, get_sample_pdf, get_sample_sdf, get_sample_pdf_with_extra_cols, get_sample_pdf_with_no_text_col ,get_sample_spark_dataframe from nlu import * ...
deep-rl/lib/python2.7/site-packages/OpenGL/raw/GL/AMD/debug_output.py
ShujaKhalid/deep-rl
210
12690116
'''Autogenerated by xml_generate script, do not edit!''' from OpenGL import platform as _p, arrays # Code generation uses this from OpenGL.raw.GL import _types as _cs # End users want this... from OpenGL.raw.GL._types import * from OpenGL.raw.GL import _errors from OpenGL.constant import Constant as _C import ctypes _...
nuplan/common/geometry/test/test_transform.py
motional/nuplan-devkit
128
12690120
import unittest from unittest.mock import Mock, patch import numpy as np import numpy.typing as npt from nuplan.common.actor_state.state_representation import Point2D, StateSE2 from nuplan.common.geometry.transform import ( rotate, rotate_2d, rotate_angle, transform, translate, translate_later...
deepfence_backend/models/user.py
tuapuikia/ThreatMapper
1,281
12690150
<filename>deepfence_backend/models/user.py<gh_stars>1000+ import datetime import arrow from sqlalchemy.sql import func from flask import current_app as app from werkzeug.security import generate_password_hash, check_password_hash from config.extensions import db from utils.constants import USER_ROLES, INVITE_EXPIRY f...
setup.py
aswinkp/swampdragon
366
12690165
import os from setuptools import setup, find_packages def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name="SwampDragon", version="0.4.2.2", author="<NAME>", author_email="<EMAIL>", description=("SwampDragon is a powerful platform making it easy to b...
cesium/tests/test_time_series.py
acrellin/cesium
603
12690167
<filename>cesium/tests/test_time_series.py<gh_stars>100-1000 import os from uuid import uuid4 import numpy.testing as npt import numpy as np from cesium import time_series from cesium.time_series import TimeSeries def sample_time_series(size=51, channels=1): times = np.array([np.sort(np.random.random(size)) ...
test_bot/cogs/message_commands.py
Enegg/disnake
290
12690178
<reponame>Enegg/disnake import disnake from disnake.ext import commands class MessageCommands(commands.Cog): def __init__(self, bot): self.bot: commands.Bot = bot @commands.message_command(name="Reverse") async def reverse(self, inter: disnake.MessageCommandInteraction): await inter.respo...
rlgraph/components/neural_networks/actor_component.py
RLGraph/RLGraph
290
12690189
# Copyright 2018/2019 The RLgraph 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...
2020/03/09/How to Copy Django Model Instance Objects/django_clone_example/clone_object/example/views.py
kenjitagawa/youtube_video_code
492
12690197
<reponame>kenjitagawa/youtube_video_code<gh_stars>100-1000 from django.shortcuts import render from .models import Member def index(request): #member_one = Member(name='Anthony', location='Las Vegas') #member_one.save() member_three = Member.objects.get(pk=1) #member_two = member_one member_three...
tests/async/test_locators.py
microsoft/playwright-python
6,243
12690200
# Copyright (c) Microsoft Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
test/test_naarad_api.py
richardhsu/naarad
180
12690206
# coding=utf-8 """ Copyright 2013 LinkedIn Corp. 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 l...
api/allennlp_demo/bidaf_elmo/test_api.py
dragon18456/allennlp-demo
190
12690228
from overrides import overrides import pytest from allennlp_demo.bidaf_elmo.api import BidafElmoModelEndpoint from allennlp_demo.common.testing import RcModelEndpointTestCase class TestBidafElmoModelEndpoint(RcModelEndpointTestCase): endpoint = BidafElmoModelEndpoint() @pytest.mark.skip("Takes too long") ...
crabageprediction/venv/Lib/site-packages/fontTools/otlLib/__init__.py
13rianlucero/CrabAgePrediction
38,667
12690244
"""OpenType Layout-related functionality."""
src/unittest/python/install_utils_tests.py
klr8/pybuilder
1,419
12690246
<reponame>klr8/pybuilder # -*- coding: utf-8 -*- # # This file is part of PyBuilder # # Copyright 2011-2020 PyBuilder Team # # 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 # # ...
tests/brevitas/test_brevitas_validate_mobilenet.py
mmrahorovic/finn
109
12690247
# Copyright (c) 2020, Xilinx # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the follow...
using-python-to-interact-with-the-operating-system/week-five/charfreq.py
veera-raju/google-it-automation-with-python
164
12690250
#!/usr/bin/env python3 def char_frequency(filename): """ Counts the frequency of each character in the given file. """ # First try to open the file try: f = open(filename) # code in the except block is only executed if one of the instructions in the try block raise an error of the match...
fast_transformers/feature_maps/__init__.py
SamuelCahyawijaya/fast-transformers
1,171
12690251
<gh_stars>1000+ # # Copyright (c) 2020 Idiap Research Institute, http://www.idiap.ch/ # Written by <NAME> <<EMAIL>> # """Implementations of feature maps to be used with linear attention and causal linear attention.""" from .base import elu_feature_map, ActivationFunctionFeatureMap from .fourier_features import Rando...
lenstronomy/GalKin/aperture_types.py
heather999/lenstronomy
107
12690255
<filename>lenstronomy/GalKin/aperture_types.py<gh_stars>100-1000 __author__ = 'sibirrer' import numpy as np from lenstronomy.Util.package_util import exporter export, __all__ = exporter() @export class Slit(object): """ Slit aperture description """ def __init__(self, length, width, center_ra=0, ce...
apprise/plugins/NotifySendGrid.py
linkmauve/apprise
4,764
12690263
# -*- coding: utf-8 -*- # # Copyright (C) 2019 <NAME> <<EMAIL>> # All rights reserved. # # This code is licensed under the MIT License. # # 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 withou...