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
tools/process-wasm-compilation-times.py
EXHades/v8
20,995
12760997
<filename>tools/process-wasm-compilation-times.py<gh_stars>1000+ #!/usr/bin/env python3 # Copyright 2021 the V8 project authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Processes {stdout} output generated by --trace-wasm-compilation-t...
official/vision/segmentation/tools/train.py
pepperonibo/Models
294
12761025
<reponame>pepperonibo/Models # -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "...
src/tools/nuscenes-devkit/utils/color_map.py
jie311/TraDeS
1,284
12761053
from typing import Dict, Tuple def get_colormap() -> Dict[str, Tuple[int, int, int]]: """ Get the defined colormap. :return: A mapping from the class names to the respective RGB values. """ classname_to_color = { # RGB. "noise": (0, 0, 0), # Black. "animal": (70, 130, 180), # S...
qprotocal/utils/xbin.py
gorgiaxx/qq-protocal-library
109
12761056
#!/usr/bin/env python import binascii import hashlib import random class Xbin(object): # def __init__(self): # get random hex by length def get_random_hex(self, length=1, is_bytes=0): random_hex = '' for _ in range(0, length): random_hex += "{:0>2x}".format(random.randrange(0...
netket/utils/struct/utils.py
gpescia/MyNetKet
352
12761089
<gh_stars>100-1000 import sys import builtins from dataclasses import MISSING ## STUFF FROM python/lib/dataclasses.py def _set_new_attribute(cls, name, value): # Never overwrites an existing attribute. Returns True if the # attribute already exists. if name in cls.__dict__: return True setat...
h2o-py/tests/testdir_algos/psvm/pyunit_svm_svmguide3.py
ahmedengu/h2o-3
6,098
12761110
from __future__ import print_function import sys sys.path.insert(1,"../../../") import h2o from tests import pyunit_utils from h2o.estimators.psvm import H2OSupportVectorMachineEstimator def svm_svmguide3(): svmguide3 = h2o.import_file(pyunit_utils.locate("smalldata/svm_test/svmguide3scale.svm")) svmguide3_te...
src/test/blocked_bad_ip.py
jalapenopuzzle/rr
5,156
12761161
from util import * send_gdb('c') expect_rr('EXIT-SUCCESS') expect_gdb('SIGSEGV') send_gdb('reverse-stepi') expect_gdb('SIGSEGV') send_gdb('reverse-stepi') expect_gdb('start_thread') ok()
mmgen/datasets/quick_test_dataset.py
plutoyuxie/mmgeneration
718
12761188
# Copyright (c) OpenMMLab. All rights reserved. import torch from torch.utils.data import Dataset from .builder import DATASETS @DATASETS.register_module() class QuickTestImageDataset(Dataset): """Dataset for quickly testing the correctness. Args: size (tuple[int]): The size of the images. Defaults ...
tests/integration/test_storage_s3/s3_mocks/echo.py
pdv-ru/ClickHouse
15,577
12761210
import http.server import sys class RequestHandler(http.server.BaseHTTPRequestHandler): def do_HEAD(self): if self.path.startswith("/get-my-path/"): self.send_response(200) self.send_header("Content-Type", "text/plain") self.end_headers() elif self.path == "/":...
amadeus/airport/__init__.py
akshitsingla/amadeus-python
125
12761228
from ._predictions import AirportOnTime __all__ = ['AirportOnTime']
homeassistant/components/geocaching/sensor.py
liangleslie/core
30,023
12761232
"""Platform for sensor integration.""" from __future__ import annotations from collections.abc import Callable from dataclasses import dataclass from typing import cast from geocachingapi.models import GeocachingStatus from homeassistant.components.sensor import SensorEntity, SensorEntityDescription from homeassista...
rapidsms/backends/kannel/migrations/0002_auto_20150801_2142.py
catalpainternational/rapidsms
330
12761237
<reponame>catalpainternational/rapidsms # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('kannel', '0001_initial'), ] operations = [ migrations.AlterField( model_...
caql/utils.py
deepneuralmachine/google-research
23,901
12761284
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
externals/skia/third_party/externals/sfntly/cpp/tools/utils.py
terrajobst/linux-packaging-skiasharp
2,151
12761297
<gh_stars>1000+ # Copyright 2011 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 applica...
payloads/promethea.py
k3170makan/PyMLProjects
156
12761311
#!/usr/bin/python import numpy from random import random from keras.models import Sequential from keras.layers import Dense from keras.layers import Dropout from keras.layers import LSTM from keras.callbacks import ModelCheckpoint from keras.utils import np_utils from sys import argv from sys import stdout from sys imp...
src/ralph/assets/models/assets.py
pinoatrome/ralph
1,668
12761323
<filename>src/ralph/assets/models/assets.py # -*- coding: utf-8 -*- import datetime import logging from dateutil.relativedelta import relativedelta from django.conf import settings from django.core.exceptions import ValidationError from django.core.validators import MinValueValidator from django.db import models from ...
wouso/games/grandchallenge/models.py
AlexandruGhergut/wouso
117
12761332
from django.db import models from django.db.models import Q, Max import logging from wouso.core.config.models import IntegerSetting from wouso.core.game.models import Game from wouso.core.user.models import Player from wouso.games.challenge.models import Challenge, ChallengeUser class GrandChallengeUser(Player): ...
rdtools/test/filtering_test.py
kperrynrel/rdtools
107
12761348
<filename>rdtools/test/filtering_test.py """ Filtering Module Tests. """ import pytest import pandas as pd import numpy as np from rdtools import (csi_filter, poa_filter, tcell_filter, clip_filter, quantile_clip_filter, ...
t/test_salsa20.py
warmchang/umash
108
12761399
""" Quick smoke test that our implementation of salsa20 does the right thing. """ from hypothesis import given import hypothesis.strategies as st from Crypto.Cipher import Salsa20 from umash import C, FFI @given( length=st.integers(min_value=1, max_value=512), nonce=st.binary(min_size=8, max_size=8), key=...
WebMirror/management/rss_parser_funcs/feed_parse_extractPenguTaichou.py
fake-name/ReadableWebProxy
193
12761406
def extractPenguTaichou(item): """ <NAME> """ vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol or frag) or 'preview' in item['title'].lower(): return None if item['title'].lower().startswith('sword shisho chapter'): return buildReleaseMessageWithType(item, 'I was a ...
src/falconpy/host_group.py
CrowdStrike/falconpy
111
12761411
"""CrowdStrike Falcon Host Groups API interface class _______ __ _______ __ __ __ | _ .----.-----.--.--.--.--| | _ | |_.----|__| |--.-----. |. 1___| _| _ | | | | _ | 1___| _| _| | <| -__| |. |___|__| |_____|________|_____|____ |____|__| |__|__|__|_____|...
egs/wsj/s5/utils/data/extend_segment_times.py
shuipi100/kaldi
805
12761430
<filename>egs/wsj/s5/utils/data/extend_segment_times.py #!/usr/bin/env python from __future__ import print_function import sys import argparse from collections import defaultdict parser = argparse.ArgumentParser(description=""" Usage: extend_segment_times.py [options] <input-segments >output-segments This program ...
tftrt/examples/image_classification/image_classification.py
sarvex/tensorrt
662
12761439
<reponame>sarvex/tensorrt<filename>tftrt/examples/image_classification/image_classification.py<gh_stars>100-1000 # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Copyright 2021 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may no...
tests/datasets/test_eigenscape_raw.py
lucaspbastos/soundata
177
12761486
<filename>tests/datasets/test_eigenscape_raw.py<gh_stars>100-1000 import numpy as np from tests.test_utils import run_clip_tests from soundata import annotations from soundata.datasets import eigenscape_raw TEST_DATA_HOME = "tests/resources/sound_datasets/eigenscape_raw" def test_clip(): default_clipid = "Bea...
kipart/common.py
xesscorp/KiPart
133
12761509
<gh_stars>100-1000 # MIT license # # Copyright (C) 2015-2021 by <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 #...
django_react/settings.py
AmbiteamProject/spleeter-web
202
12761535
<gh_stars>100-1000 import os # SECURITY WARNING: don't run with debug turned on in production! DEBUG = False BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) SECRET_KEY = os.getenv('SECRET_KEY', 'sekrit') YOUTUBE_API_KEY = os.getenv('YOUTUBE_API_KEY', '') CPU_SEPARATION = bool(int(os.getenv('C...
event_rpcgen.py
mengzhisuoliu/libevent
8,731
12761541
#!/usr/bin/env python # # Copyright (c) 2005-2007 <NAME> <<EMAIL>> # Copyright (c) 2007-2012 <NAME> and <NAME> # All rights reserved. # # Generates marshaling code based on libevent. # pylint: disable=too-many-lines # pylint: disable=too-many-branches # pylint: disable=too-many-public-methods # pylint: disable=too-man...
tests/guinea-pigs/unittest/nested_suits.py
djeebus/teamcity-python
105
12761552
<reponame>djeebus/teamcity-python import unittest from teamcity.unittestpy import TeamcityTestRunner from teamcity import is_running_under_teamcity class TestXXX(unittest.TestCase): def runTest(self): assert 1 == 1 if __name__ == '__main__': if is_running_under_teamcity(): runner = Teamcity...
Bar/bar_border_radius.py
pyecharts/pyecharts_gallery
759
12761577
from pyecharts import options as opts from pyecharts.charts import Bar from pyecharts.commons.utils import JsCode from pyecharts.faker import Faker c = ( Bar() .add_xaxis(Faker.choose()) .add_yaxis("商家A", Faker.values(), category_gap="60%") .set_series_opts( itemstyle_opts={ "normal...
plugins/xml_hidden_extensions_hotfix.py
MattDMo/PackageDev
288
12761594
<filename>plugins/xml_hidden_extensions_hotfix.py """Bootstrap the 'hidden_extensions' setting for the XML syntax. The XML package includes a `XML.sublime-settings` file that sets `hidden_extensions` to include some of the extensions we want to highlight with our package. There is currently no other way to override th...
equation.py
NYU-CDS-Capstone-FBSDE/DeepBSDE
205
12761606
<reponame>NYU-CDS-Capstone-FBSDE/DeepBSDE import numpy as np import tensorflow as tf class Equation(object): """Base class for defining PDE related function.""" def __init__(self, eqn_config): self.dim = eqn_config.dim self.total_time = eqn_config.total_time self.num_time_interval = e...
benchmark/megatron/benchmark_gpt_bert_one_case.py
yf225/alpa
114
12761658
<reponame>yf225/alpa import argparse import gc from functools import partial import os import sys import time import numpy as np from megatron.utils import average_losses_across_data_parallel_group from megatron.model import BertModel, GPTModel from megatron.model import ModelType from megatron import mpu, initialize...
datasets/wiki_auto/wiki_auto.py
MitchellTesla/datasets
10,608
12761664
<reponame>MitchellTesla/datasets # coding=utf-8 # Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at #...
chainer/_environment_check.py
zjzh/chainer
3,705
12761669
<reponame>zjzh/chainer from __future__ import absolute_import import os import sys import warnings import numpy.distutils.system_info import pkg_resources import chainer def _check_python_350(): if sys.version_info[:3] == (3, 5, 0): if not int(os.getenv('CHAINER_PYTHON_350_FORCE', '0')): msg...
contrib/share_driver_hooks/zaqar_notification_example_consumer.py
kpawar89/manila
159
12761671
#!/usr/bin/env python # # Copyright (c) 2015 Mirantis, 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-...
tests/test_remote_debug.py
codelv/enaml-native
237
12761706
""" Copyright (c) 2017, <NAME>. Distributed under the terms of the MIT License. The full license is in the file LICENSE, distributed with this software. Created on Oct 4, 2017 @author: jrm """ import sh import sys def main(): # Make sure instance is cleared from enaml.application import Application Ap...
.dev_scripts/benchmark/gather_train_benchmark_metric.py
kevin3314/mmtracking
2,226
12761723
# Copyright (c) OpenMMLab. All rights reserved. import argparse import glob import json import os.path as osp import mmcv try: import xlrd except ImportError: xlrd = None try: import xlutils from xlutils.copy import copy except ImportError: xlutils = None def parse_args(): parser = argparse....
gravity/migrations/0003_tiltbridge_mdns_id.py
fossabot/fermentrack
114
12761732
<reponame>fossabot/fermentrack # -*- coding: utf-8 -*- # Generated by Django 1.11.13 on 2019-03-18 23:46 from __future__ import unicode_literals from django.db import migrations, models import django.core.validators class Migration(migrations.Migration): dependencies = [ ('gravity', '0002_tilt_refactor'...
saleor/menu/migrations/0009_remove_menu_json_content.py
elwoodxblues/saleor
15,337
12761737
# Generated by Django 2.0.8 on 2018-09-13 13:38 from django.db import migrations class Migration(migrations.Migration): dependencies = [("menu", "0008_menu_json_content_new")] operations = [migrations.RemoveField(model_name="menu", name="json_content")]
src/tools/_predict.py
TensorFX/tensorfx
204
12761738
# Copyright 2016 TensorLab. 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 agreed t...
sources_non_forked/vim-visual-multi/test/tests/oO/commands.py
doitsu2014/vimrc
2,083
12761748
<filename>sources_non_forked/vim-visual-multi/test/tests/oO/commands.py<gh_stars>1000+ # insert CR, insert line above keys(':setf vim\<CR>jw') keys('4\<C-Down>') keys('Ea') keys('\<CR>') keys('CARRYING OVER ') keys('\<Esc>A') keys('\<CR>') keys('CR at EOL') keys('\<Esc>k') keys('O') keys('above CR') keys('\<Esc>\<Esc>...
analysis/paper_plot.py
MGheini/unify-parameter-efficient-tuning
101
12761761
import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl import sys import os from collections import defaultdict labelsize = 16 legendsize = 14 mpl.rcParams['xtick.labelsize'] = labelsize mpl.rcParams['ytick.labelsize'] = labelsize mpl.rcParams['axes.labelsize'] = labelsize mpl.rcParams['axes.title...
fuzz_lightyear/settings.py
bbhunter/fuzz-lightyear
169
12761816
import random from functools import lru_cache from hypothesis import core class Settings: def __init__(self) -> None: self.seed = random.getrandbits(128) # type: int self.unicode_enabled = True # type: bool self.enable_color = True # type: bool @property ...
keras-bert-poetry-generator/model.py
ganfanhang/DeepLearningExamples
274
12761823
<filename>keras-bert-poetry-generator/model.py # -*- coding: utf-8 -*- # @File : model.py # @Author : AaronJny # @Time : 2019/12/25 # @Desc : from bert4keras.models import build_transformer_model import tensorflow as tf from dataset import keep_words import settings model = build_transformer_model(settings.C...
news_collector/collector/apps.py
orehush/channels-examples
1,311
12761825
from django.apps import AppConfig class CollectorConfig(AppConfig): name = 'collector'
office365/sharepoint/social/socialRestActor.py
wreiner/Office365-REST-Python-Client
544
12761827
<filename>office365/sharepoint/social/socialRestActor.py<gh_stars>100-1000 from office365.runtime.client_object import ClientObject class SocialRestActor(ClientObject): pass
glance/tests/functional/db/migrations/test_pike_expand01.py
Steap/glance
309
12761898
<reponame>Steap/glance<gh_stars>100-1000 # 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...
venv/lib/python3.8/site-packages/statsmodels/multivariate/tests/test_ml_factor.py
johncollinsai/post-high-frequency-data
6,931
12761911
<reponame>johncollinsai/post-high-frequency-data import numpy as np from statsmodels.multivariate.factor import Factor from numpy.testing import assert_allclose, assert_equal from scipy.optimize import approx_fprime import warnings # A small model for basic testing def _toy(): uniq = np.r_[4, 9, 16] load = np....
deeppy/dataset/stl10.py
purushothamgowthu/deeppy
1,170
12761947
import os import numpy as np import logging from ..base import float_, int_ from .util import dataset_home, download, checksum, archive_extract, checkpoint log = logging.getLogger(__name__) _URL = 'http://ai.stanford.edu/~acoates/stl10/stl10_binary.tar.gz' _SHA1 = 'b22ebbd7f3c4384ebc9ba3152939186d3750b902' class ...
eICU_tstr_evaluation.py
cliohong/RGAN
585
12761955
<reponame>cliohong/RGAN import data_utils import pandas as pd import numpy as np import tensorflow as tf import math, random, itertools import pickle import time import json import os import math import data_utils import pickle from sklearn.ensemble import RandomForestClassifier from sklearn.metrics import accuracy_sco...
ee/api/chalicelib/blueprints/bp_ee_crons.py
nogamenofun98/openreplay
3,614
12761965
<gh_stars>1000+ from chalice import Blueprint from chalice import Cron from chalicelib import _overrides app = Blueprint(__name__) _overrides.chalice_app(app)
notifications/email_constants.py
bfortuner/VOCdetect
336
12761971
<gh_stars>100-1000 import config import constants as c WEBSITE_URL = config.KIBANA_URL ADMIN_EMAIL = config.ADMIN_EMAIL USER_EMAIL = config.USER_EMAIL EMAIL_CHARSET = 'UTF-8' HEADER="<html>" FOOTER="</html>" EXPERIMENT_STATUS_EMAIL_TEMPLATE=""" <p>Hello,</p> <p>Your experiment has ended.</p> <p><b>Name:</b> %s</p> ...
logdevice/ops/ldops/exceptions.py
majra20/LogDevice
1,831
12761984
<filename>logdevice/ops/ldops/exceptions.py<gh_stars>1000+ #!/usr/bin/env python3 # pyre-strict # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. """ ldops.excep...
QPT_client/Python/Lib/site-packages/qpt/memory.py
Scxw010516/Smart_container
150
12761997
# Author: <NAME> # Datetime:2021/7/3 # Copyright belongs to the author. # Please indicate the source for reprinting. import platform import os from distutils.sysconfig import get_python_lib from qpt.kernel.qlog import Logging def init_wrapper(var=True): def i_wrapper(func): if var: @propert...
Packs/ShiftManagement/Scripts/GetAwayUsers/GetAwayUsers_test.py
sorkan/content
799
12762010
import io import json from copy import deepcopy import GetAwayUsers import demistomock as demisto def util_load_json(path): with io.open(path, mode='r', encoding='utf-8') as f: return json.loads(f.read()) away_user_data = util_load_json('test_data/away_user.json') def test_script_valid(mocker): ...
datasets/SOT/seed/Impl/TrackingNet.py
zhangzhengde0225/SwinTrack
143
12762019
import os from datasets.types.data_split import DataSplit from datasets.SOT.constructor.base_interface import SingleObjectTrackingDatasetConstructor import numpy as np def construct_TrackingNet(constructor: SingleObjectTrackingDatasetConstructor, seed): root_path = seed.root_path data_type = seed.data_split ...
msticpy/config/ce_keyvault.py
kubajir/msticpy
820
12762021
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- """Key Vau...
fonts/romfonts/vga1_8x8.py
slabua/st7789py_mpy
153
12762029
"""converted from vga_8x8.bin """ WIDTH = 8 HEIGHT = 8 FIRST = 0x20 LAST = 0x7f _FONT =\ b'\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x18\x3c\x3c\x18\x18\x00\x18\x00'\ b'\x66\x66\x24\x00\x00\x00\x00\x00'\ b'\x6c\x6c\xfe\x6c\xfe\x6c\x6c\x00'\ b'\x18\x3e\x60\x3c\x06\x7c\x18\x00'\ b'\x00\xc6\xcc\x18\x30\x66\xc6\x00'\ b'\x38\x6...
examples/data/norm_feature.py
leilin-research/Time-series-prediction
552
12762031
<gh_stars>100-1000 import os import joblib import pandas as pd from sklearn.preprocessing import StandardScaler, MinMaxScaler class FeatureNorm(object): def __init__(self, type='minmax'): self.type = type def __call__(self, x, mode='train', model_dir='../weights', name='scaler'): assert len(...
src/db-up/azext_db_up/vendored_sdks/azure_mgmt_sql/sql/models/elastic_pool_performance_level_capability_py3.py
Mannan2812/azure-cli-extensions
207
12762065
# 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 Microsoft (R) AutoRest Code Generator. # Changes ...
spectral/io/__init__.py
wwlswj/spectral
398
12762083
<gh_stars>100-1000 from __future__ import absolute_import, division, print_function, unicode_literals from .spyfile import SpyFile from ..io import aviris from ..io import erdas from ..io import envi
tests/test_provider_hashicorp_aws.py
mjuenema/python-terrascript
507
12762092
<reponame>mjuenema/python-terrascript # tests/test_provider_hashicorp_aws.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:12:25 UTC) def test_provider_import(): import terrascript.provider.hashicorp.aws def test_resource_import(): from terrascript.resource.hashicorp.aws import aws_accessan...
UnityPy/classes/PPtr.py
yvsdrop/UnityPy
313
12762095
from ..files import ObjectReader from ..streams import EndianBinaryWriter from ..helpers import ImportHelper from .. import files from ..enums import FileType, ClassIDType import os from .. import environment def save_ptr(obj, writer: EndianBinaryWriter): if isinstance(obj, PPtr): writer.write_int(obj.file...
tests/test_bql.py
almartin82/bayeslite
964
12762100
# -*- coding: utf-8 -*- # Copyright (c) 2010-2016, MIT Probabilistic Computing Project # # 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...
jaeger_client/throttler.py
jaegertracing/jaeger-client-python
372
12762102
<reponame>jaegertracing/jaeger-client-python # Copyright (c) 2018 Uber Technologies, 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 # # Un...
esmvaltool/cmorizers/obs/cmorize_obs_ghcn_cams.py
cffbots/ESMValTool
148
12762104
<filename>esmvaltool/cmorizers/obs/cmorize_obs_ghcn_cams.py """ESMValTool CMORizer for GHCN-CAMS data. Tier Tier 2: other freely-available dataset. Source https://www.esrl.noaa.gov/psd/data/gridded/data.ghcncams.html ftp://ftp.cdc.noaa.gov/Datasets/ghcncams/air.mon.mean.nc Last access 20200304 """ ...
examples/ServiceSchema.py
msitt/blpapi-python
228
12762107
# ServiceSchema.py from __future__ import print_function from __future__ import absolute_import from optparse import OptionParser, OptionValueError import os import platform as plat import sys if sys.version_info >= (3, 8) and plat.system().lower() == "windows": # pylint: disable=no-member with os.add_dll_dir...
save_raw_fea.py
insad/pytorch-kaldi
2,248
12762126
########################################################## # pytorch-kaldi v.0.1 # <NAME>, <NAME> # Mila, University of Montreal # October 2018 # # Description: This script generates kaldi ark files containing raw features. # The file list must be a file containing "snt_id file.wav". # Note that only wav files are supp...
tensorflow_privacy/privacy/estimators/v1/dnn_test.py
amad-person/privacy
2,327
12762166
# Copyright 2020, The TensorFlow Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
hs_core/management/commands/add_owner.py
hydroshare/hydroshare
178
12762176
""" Add an owner to a resource or resources Usage: add_owner {username} {resource list} """ from django.core.management.base import BaseCommand from django.contrib.auth.models import User from hs_core.models import BaseResource from hs_core.hydroshare.utils import get_resource_by_shortkey from hs_access_control.model...
tests/test_primitive_data/test_real.py
amih90/bacpypes
240
12762181
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Test Primitive Data Real ------------------------ """ import unittest import struct import math from bacpypes.debugging import bacpypes_debugging, ModuleLogger, xtob from bacpypes.errors import InvalidTag from bacpypes.primitivedata import Real, Tag # some debuggin...
insights/parsers/named_conf.py
lhuett/insights-core
121
12762200
""" NamedConf parser - file ``/etc/named.conf`` =========================================== NamedConf parser the file named configuration file. Named is a name server used by BIND. """ from insights.specs import Specs from insights.core.plugins import parser from insights.parsers import SkipException from insights.pa...
eval/src/tests/tensor/onnx_wrapper/dynamic.py
Anlon-Burke/vespa
4,054
12762204
# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. import onnx from onnx import helper, TensorProto QUERY_TENSOR = helper.make_tensor_value_info('query_tensor', TensorProto.FLOAT, ['batch', 4]) ATTRIBUTE_TENSOR = helper.make_tensor_value_info('attribute_tensor', Ten...
src/utils/embeddingvis.py
fatterbetter/CodeSearchNet
1,681
12762227
<reponame>fatterbetter/CodeSearchNet #!/usr/bin/env python """ Usage: embeddingvis.py [options] plot-tsne (--code | --query) MODEL_PATH embeddingvis.py [options] print-nns (--code | --query) MODEL_PATH DISTANCE_THRESHOLD Options: --azure-info=<path> Azure authentication information file (JSON...
dirigible/fts/tests/test_2734_ClearCells.py
EnoX1/dirigible-spreadsheet
168
12762233
# Copyright (c) 2010 Resolver Systems Ltd. # All Rights Reserved # try: import unittest2 as unittest except ImportError: import unittest from functionaltest import FunctionalTest import key_codes from textwrap import dedent class Test_2734_ClearCells(FunctionalTest): def test_delete_key_clears_selected...
libcity/data/dataset/cstn_dataset.py
moghadas76/test_bigcity
221
12762247
<reponame>moghadas76/test_bigcity import os import numpy as np from libcity.data.dataset import TrafficStateGridOdDataset from libcity.data.utils import generate_dataloader from libcity.utils import ensure_dir class CSTNDataset(TrafficStateGridOdDataset): def __init__(self, config): super().__init__(co...
tests/test_main.py
greggles/cutadapt
375
12762251
import pytest from cutadapt.__main__ import main, parse_cutoffs, parse_lengths, CommandLineError, setup_logging def test_help(): with pytest.raises(SystemExit) as e: main(["--help"]) assert e.value.args[0] == 0 def test_parse_cutoffs(): assert parse_cutoffs("5") == (0, 5) assert parse_cutof...
plugin.video.mrknowtv/resources/lib/sources/pierwsza.py
mrknow/filmkodi
105
12762266
# -*- coding: utf-8 -*- ''' Mrknow TV Add-on Copyright (C) 2016 mrknow This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) an...
study/vowel_summary.py
Kshitiz-Bansal/wavetorch
470
12762275
"""Generate a summary of a previously trained vowel recognition model. """ import torch import wavetorch import argparse import yaml import os import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl try: from helpers.plot import mpl_set_latex mpl_set_latex() except ImportError: impor...
nni/common/nas_utils.py
dutxubo/nni
9,680
12762292
<gh_stars>1000+ # Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import functools import logging from .. import trial _logger = logging.getLogger(__name__) _MUTABLE_LAYER_SPACE_PREFIX = "_mutable_layer" _namespace = {} _tf_variables = {} _arch_logits_list = [] _optimizer = None _train_op = N...
competitive_programming/programming_contests/interfatecs/1_2018/f.py
LeandroTk/Algorithms
205
12762301
codigo_set = set() codido_set_saiu = set() s = input() codigos = input().split(' ') for codigo in codigos: codigo_set.add(codigo) i = input() saidas = input().split(' ') A = 0 I = 0 R = 0 for saida in saidas: if saida in codigo_set: if saida in codido_set_saiu: R += 1 else: A += 1...
fastseq/logging/logging_utils.py
nttcs-ds/fastseq
346
12762305
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. """Logging related module.""" import os import logging from logging import _checkLevel from fastseq.config import FASTSEQ_DEFAULT_LOG_LEVEL, FASTSEQ_LOG_LEVEL, FASTSEQ_LOG_FORMAT def set_default_log_level(): """Set the default log level ...
chap6/bbox_labeling/detection_anno_bbox2voc.py
wang420349864/dlcv_for_beginners
1,424
12762327
<reponame>wang420349864/dlcv_for_beginners<filename>chap6/bbox_labeling/detection_anno_bbox2voc.py import os import sys import xml.etree.ElementTree as ET #import xml.dom.minidom as minidom import cv2 from bbox_labeling import SimpleBBoxLabeling input_dir = sys.argv[1].rstrip(os.sep) bbox_filenames = [x for x in os.l...
pwncat/modules/linux/enumerate/user/__init__.py
Mitul16/pwncat
1,454
12762338
<reponame>Mitul16/pwncat<filename>pwncat/modules/linux/enumerate/user/__init__.py<gh_stars>1000+ #!/usr/bin/env python3 import pwncat from pwncat.modules import Status, ModuleFailed from pwncat.facts.linux import LinuxUser from pwncat.platform.linux import Linux from pwncat.modules.enumerate import Schedule, Enumerate...
examples/providers/factory_init_injections_underlying.py
whysage/python-dependency-injector
1,997
12762345
<reponame>whysage/python-dependency-injector<gh_stars>1000+ """`Factory` provider - passing injections to the underlying providers example.""" from dependency_injector import containers, providers class Regularizer: def __init__(self, alpha: float) -> None: self.alpha = alpha class Loss: def __init...
ykdl/extractors/yizhibo.py
592767809/ykdl
136
12762349
# -*- coding: utf-8 -*- from ._common import * class Yizhibo(Extractor): name = 'Yizhibo (一直播)' def prepare(self): info = MediaInfo(self.name) info.live = True self.vid = self.url[self.url.rfind('/')+1:].split('.')[0] data = get_response( 'http://www.yizh...
nemo/collections/asr/parts/numba/rnnt_loss/utils/global_constants.py
madhukarkm/NeMo
4,145
12762354
# Copyright (c) 2021, NVIDIA CORPORATION. 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...
tests/roots/test-ext-autodoc/target/wrappedfunction.py
samdoran/sphinx
4,973
12762372
from contextlib import contextmanager from functools import lru_cache from typing import Generator @lru_cache(maxsize=None) def slow_function(message, timeout): """This function is slow.""" print(message) @contextmanager def feeling_good(x: int, y: int) -> Generator: """You'll feel better in this contex...
muddery/worldeditor/dao/image_resources_mapper.py
dongwudanci/muddery
127
12762375
""" Query and deal common tables. """ from evennia.utils import logger from django.apps import apps from django.conf import settings class ImageResourcesMapper(object): """ Object's image. """ def __init__(self): self.model_name = "image_resources" self.model = apps.get_model(settings...
pywizlight/bulblibrary.py
UH-60/pywizlight
221
12762379
<reponame>UH-60/pywizlight<filename>pywizlight/bulblibrary.py<gh_stars>100-1000 """Library with compatible bulb types. Bulb Type detection: ESP01_SHDW1C_31 ESP01 -- defines the module family (WiFi only bulb in this case) SH -- Single Head light (most bulbs are single heads) / LED Strip TW -- Tunable White - can only c...
packyou/py2.py
llazzaro/packyou
217
12762413
<reponame>llazzaro/packyou<filename>packyou/py2.py # -*- coding: utf-8 -*- import imp import ipdb import logging from sys import modules, meta_path from os import mkdir from os.path import ( isdir, abspath, dirname, exists, join, ) import encodings.idna import requests from git import Repo from p...
pysd/py_backend/vensim/table2py.py
rogersamso/pysd_dev
240
12762415
import pandas as pd import warnings from ...pysd import read_vensim from io import open def read_tabular(table_file, sheetname='Sheet1'): """ Reads a vensim syntax model which has been formatted as a table. This is useful in contexts where model building is performed without the aid of Vensim. P...
brambox/boxes/formats.py
thesuperorange/task-conditioned
331
12762416
# # Copyright EAVISE # from .annotations import annotation_formats from .detections import detection_formats __all__ = ['formats', 'annotation_formats', 'detection_formats'] formats = {} for key in annotation_formats: formats['anno_'+key] = annotation_formats[key] for key in detection_formats: formats['det...
Code Templates/Google.py
cnm06/Competitive-Programming
994
12762418
f = open('sample-input.txt') o = open('sample-output.txt', 'w') t = int(f.readline().strip()) for i in xrange(1, t + 1): o.write("Case #{}: ".format(i)) n = int(f.readline().strip()) x = [int(j) for j in f.readline().strip().split()] y = [int(j) for j in f.readline().strip().split()] o.write("\n")
examples/ahrs/python/ukf/__init__.py
rafaelrietmann/ukf
320
12762431
<reponame>rafaelrietmann/ukf #Copyright (C) 2013 <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, merg...
kino/skills/card.py
DongjunLee/kino-bot
109
12762448
<filename>kino/skills/card.py<gh_stars>100-1000 import arrow import re from ..slack.resource import MsgResource from ..utils.data_handler import DataHandler from ..utils.member import Member class BusinessCard(object): def __init__(self, slackbot=None): self.fname = "card.json" self.data_handler...
extras/test_octasphere.py
BruegelN/svg3d
286
12762449
<reponame>BruegelN/svg3d<filename>extras/test_octasphere.py<gh_stars>100-1000 #!/usr/bin/env python3 import numpy as np import svgwrite.utils from octasphere import octasphere import pyrr from parent_folder import svg3d from math import * create_ortho = pyrr.matrix44.create_orthogonal_projection create_perspective = ...
users/urls.py
yileye/OpenSA
280
12762462
#!/usr/bin/env python # ~*~ coding: utf-8 ~*~ from __future__ import absolute_import from django.urls import path from users.views import login, users, groups, project, permission,role,keys app_name = 'users' urlpatterns = [ # Login View path('login/', login.UserLoginView.as_view(), name='login'...
testing/business_lookup_responses.py
ricwillis98/yelp-python
195
12762464
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import unicode_literals import responses from testing.util import read_json_file YELP_SAN_FRANCISCO = responses.Response( method="GET", url="https://api.yelp.com/v3/businesses/yelp-san-francisco", json=read_json_file("busines...
autoencoder/baseline/doc2vec.py
hugochan/K-Competitive-Autoencoder-for-Text-Analytics
133
12762474
''' Created on Jan, 2017 @author: hugo ''' from __future__ import absolute_import import multiprocessing from gensim.models import Doc2Vec class MyDoc2Vec(object): def __init__(self, dim, hs=0, window=5, negative=5, epoches=5, dm=1, dm_concat=1): super(MyDoc2Vec, self).__init__() self.dim = dim ...