max_stars_repo_path
string
max_stars_repo_name
string
max_stars_count
int64
id
string
content
string
add_param_types
int64
add_return_types
int64
add_class_field_types
int64
add_instance_field_types
int64
add_total
int64
add_error
int64
dynaconf/vendor/box/__init__.py
RonnyPfannschmidt/dynaconf
2,293
3336115
<gh_stars>1000+ __author__='<NAME>' __version__='4.2.3' from .box import Box from .box_list import BoxList from .config_box import ConfigBox from .shorthand_box import SBox from .exceptions import BoxError,BoxKeyError from .from_file import box_from_file
0
0
0
0
0
0
third_party/blink/renderer/build/scripts/core/css/css_properties.py
zipated/src
2,151
3336126
<filename>third_party/blink/renderer/build/scripts/core/css/css_properties.py<gh_stars>1000+ #!/usr/bin/env python # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import json5_generator from name_utilities...
0
0
0
0
0
0
captum/insights/attr_vis/_utils/transforms.py
i-jones/captum
3,140
3336163
#!/usr/bin/env python3 from typing import Callable, List, Optional, Union def format_transforms( transforms: Optional[Union[Callable, List[Callable]]] ) -> List[Callable]: if transforms is None: return [] if callable(transforms): return [transforms] return transforms
1
1
0
0
2
0
examples/colors.py
crotwell/cmd2
469
3336262
<filename>examples/colors.py #!/usr/bin/env python # coding=utf-8 """ A sample application for cmd2. Demonstrating colorized output. Experiment with the command line options on the `speak` command to see how different output colors ca The allow_style setting has three possible values: Never poutput(), pfeedback(...
0
0
0
0
0
0
pyranges/tostring.py
iamjli/pyranges
299
3336272
from __future__ import annotations import shutil import pandas as pd from tabulate import tabulate def get_terminal_size() -> object: return shutil.get_terminal_size().columns def show_pos_merge_position(self, df, first_df) -> object: if "Strand" in df: pos = df.Chromosome.astype(str) + " " + df...
4
5
0
0
9
0
src/test/python/apache/aurora/client/cli/test_api_from_cli.py
jeremyvdw/aurora
479
3336285
# # 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, software # distributed under ...
0
4
0
0
4
0
backend/light_head_rcnn/lib/lib_kernel/lib_nms_dev/nms_test.py
zju-3dv/multi-person3dpose
391
3336296
<filename>backend/light_head_rcnn/lib/lib_kernel/lib_nms_dev/nms_test.py<gh_stars>100-1000 import tensorflow as tf import numpy as np import pdb import os import nms_op os.environ["CUDA_VISIBLE_DEVICES"] = '1' # pdb.set_trace() rois = tf.convert_to_tensor( [[0, 1, 2, 3, 4], [1, 2, 3, 4, 4], [2, 3, 4, 5, 2]], ...
0
0
0
0
0
0
src/hcrystalball/preprocessing/__init__.py
betatim/hcrystalball
139
3336301
from ._endog_transformer import TargetTransformer __all__ = [ "TargetTransformer", ]
0
0
0
0
0
0
databricks/python/healthcare_case_studies/mt_scrapper.py
hatrungduc/spark-nlp-workshop
687
3336320
from __future__ import annotations import requests from bs4 import BeautifulSoup import os import re def get_mt_samples(medical_speciality: str="", path: str = ".", n: object | None = None): """ Download Transcribed Medical Transcription Sample Reports and Examples from 'www.mtsamples.com'. ## Param...
3
0
0
0
3
0
sfepy/discrete/dg/fields.py
BubuLK/sfepy
510
3336338
# -*- coding: utf-8 -*- from __future__ import annotations """ Fields for Discontinous Galerkin method """ import numpy as nm import six from numpy.lib.stride_tricks import as_strided from six.moves import range from sfepy.base.base import (output, assert_, Struct) from sfepy.discrete import Integral, PolySpace from s...
37
29
2
6
74
0
core/polyaxon/cli/components/initializer.py
admariner/polyaxon
3,200
3336351
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, 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 ...
8
0
0
0
8
0
yabgp/message/attribute/community.py
mengjunyi/yabgp
203
3336356
# Copyright 2015 Cisco Systems, 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...
0
2
0
0
2
0
cyphercat/utils/file_utils.py
arafin-lab/model_inversion_experiments
101
3336373
import os import sys import shutil import requests import zipfile import tarfile def downloader(save_dir: str='', url: str='') -> object: """ Function to download file from url to specified destination file. If file already exists, or the url is a path to a valid local file, then simply return...
4
1
0
0
5
0
build/plugins/lib/nots/package_manager/base/lockfile.py
jochenater/catboost
6,989
3336388
from __future__ import annotations import os from abc import ABCMeta, abstractmethod from six import add_metaclass class LockfilePackageMeta(object): """ Basic struct representing package meta from lockfile. """ __slots__: tuple[str, str, str, str, str, str] = ("name", "version", "sky_id", "integrity...
1
3
1
1
6
0
modules/google-earth-engine/docker/src/sepalinternal/landcover/create_composites.py
BuddyVolly/sepal
153
3336395
import ee from landcoverPackage import landsat from ..aoi import Aoi from ..export.image_to_asset import ImageToAsset from ..gee import create_asset_image_collection, to_asset_id from ..task.task import ThreadTask, Task def create(spec, context) -> object: return CreateComposites(context.credentials, spec) cla...
0
7
0
3
10
0
tools/generate_majestic-million.py
houey/misp-warninglists
277
3336406
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from generator import download_to_file, get_version, write_to_file, get_abspath_source_file def process(file, dst): with open(get_abspath_source_file(file), newline='\n', encoding='utf-8', errors='replace') as csv_file: sites = csv_file.readlines()[:10000] ...
0
0
0
0
0
0
deeppavlov/models/preprocessors/transformers_preprocessor.py
xbodx/DeepPavlov
5,893
3336418
# Copyright 2020 Neural Networks and Deep Learning lab, MIPT # # 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...
7
2
0
0
9
0
common/data_refinery_common/migrations/0061_transcriptome_database_name.py
AlexsLemonade/refinebio
106
3336476
<reponame>AlexsLemonade/refinebio<filename>common/data_refinery_common/migrations/0061_transcriptome_database_name.py # Generated by Django 2.2.13 on 2020-08-28 19:40 import json from django.db import migrations import requests def find_division_by_species(species: str, division_jsons: dict) -> str: species_na...
0
0
0
0
0
0
lore/template/init/app/__init__.py
timgates42/lore
1,549
3336482
<reponame>timgates42/lore<gh_stars>1000+ import lore import lore.stores import os lore.env.APP = __name__ lore.stores.query_cache.limit = int(os.environ.get('LORE_QUERY_CACHE_LIMIT', 10000000000))
0
0
0
0
0
0
Misc/Spark/Python/ConsumeGBNYCReg.py
jfindlay/Azure-MachineLearning-DataScience
390
3336506
# COPY THIS SCRIPT INTO THE SPARK CLUSTER SO IT CAN BE TRIGGERED WHENEVER WE WANT TO SCORE A FILE BASED ON PREBUILT MODEL # MODEL CAN BE BUILT USING ONE OF THE TWO EXAMPLE NOTEBOOKS: machine-learning-data-science-spark-data-exploration-modeling.ipynb OR machine-learning-data-science-spark-advanced-data-exploration-mode...
0
1
0
0
1
0
tacker/sol_refactored/conductor/vnflcm_driver_v2.py
h1r0mu/tacker
116
3336507
# Copyright (C) 2021 Nippon Telegraph and Telephone 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/LICE...
0
4
0
0
4
0
atomic_reactor/plugins/flatpak_update_dockerfile.py
qixiang/atomic-reactor
113
3336542
<filename>atomic_reactor/plugins/flatpak_update_dockerfile.py<gh_stars>100-1000 """ Copyright (c) 2017-2022 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. Updates the Dockerfile created by flatpak_create_dockerfile...
0
0
0
0
0
0
actions/command.py
cognifloyd/stackstorm-smartthings
164
3336571
<reponame>cognifloyd/stackstorm-smartthings<filename>actions/command.py from lib.action import BaseAction class SendCommandAction(BaseAction): def run(self, device_type=None, device_id=None, command=None, value=None, mode=None): params = {} url = "/{}/{}".format(device_type, device_id)...
0
0
0
0
0
0
orchestra/migrations/0012_auto_20150701_1948.py
code-review-doctor/orchestra
444
3336583
<gh_stars>100-1000 # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations from django.db import models class Migration(migrations.Migration): dependencies = [ ('orchestra', '0011_auto_20150618_0003'), ] operations = [ migrations.AlterField( ...
0
0
0
0
0
0
examples/queue_performance/enqueue.py
fredstro/mrq
745
3336627
#!/usr/bin/env python import sys from mrq.context import setup_context from mrq.job import queue_jobs, queue_raw_jobs setup_context() queue = sys.argv[1] n = int(sys.argv[2]) if queue == "square": queue_jobs("tasks.Square", [{"n": 42} for _ in range(n)], queue=queue) elif queue in ("square_raw", "square_nostora...
0
0
0
0
0
0
netpyne/tutorials/saving_loading_tut/saving_normal_init.py
adamjhn/netpyne
120
3336633
from netpyne import sim cfg, netParams = sim.readCmdLineArgs( simConfigDefault='saving_normal_cfg.py', netParamsDefault='saving_netParams.py') sim.initialize(simConfig=cfg, netParams=netParams) sim.net.createPops() sim.net.createCells() sim.net.connectCells() sim.net.addStims() sim.setupRecording() sim.runSim...
0
0
0
0
0
0
Python/Fundamentals/class_attributes.py
Gjacquenot/training-material
115
3336644
#!/usr/bin/env python from __future__ import annotations import math class Point(object): def __init__(self, x, y): self._x = float(x) self._y = float(y) @property def x(self) -> object: return self._x @property def y(self) -> object: return self._y def dis...
2
7
1
0
10
0
tests/test_sensor_dataset_config.py
gargrohin/argoverse-api
560
3336683
import hydra from hydra.utils import instantiate from argoverse.sensor_dataset_config import SensorDatasetConfig def test_sensor_dataset_config(): """Ensure that config fields are populated correctly from YAML.""" dataset_name = "argoverse-v1.1" with hydra.initialize_config_module(config_module="argover...
0
0
1
0
1
0
server/photos/management/commands/fix_scene_category.py
paulu/opensurfaces
137
3336703
from clint.textui import progress from django.core.management.base import BaseCommand from django.contrib.auth.models import User from photos.models import Photo, PhotoSceneCategory class Command(BaseCommand): args: str = '' help: str = 'Temp fix' def handle(self, *args, **options): admin_user...
0
0
2
0
2
0
tests/test_cancel.py
PyExplorer/shub
111
3336704
from __future__ import absolute_import import unittest import mock from collections import namedtuple from click.testing import CliRunner from shub import cancel from shub.exceptions import ( BadParameterException, ShubException, ) from .utils import AssertInvokeRaisesMixin, mock_conf class CancelTest(Ass...
0
0
0
0
0
0
indexpy/routing/__init__.py
abersheeran/index.py
242
3336717
from .routers import NoMatchFound, NoRouteFound, Prefix, Router, Routes from .routes import BaseRoute, HttpRoute, SocketRoute __all__ = [ "Router", "Routes", "BaseRoute", "HttpRoute", "SocketRoute", "Prefix", "NoMatchFound", "NoRouteFound", ]
0
0
0
0
0
0
pylayers/antprop/examples/ex_channel.py
usmanwardag/pylayers
143
3336722
<filename>pylayers/antprop/examples/ex_channel.py ########################### # test Channel, Simulation, Antenna ########################### from pylayers.antprop.channel import * from pylayers.simul.simulem import * from pylayers.signal.waveform import * from pylayers.signal.bsignal import * import numpy as np # # c...
0
0
0
0
0
0
examples/start_cli.py
tvorogme/pytg
385
3336728
<reponame>tvorogme/pytg # -*- coding: utf-8 -*- import pytg __author__ = 'luckydonald' """ This is more a TEST, not an example... You probably should NOT start with this. """ def main(): import signal signal.signal(signal.SIGINT, sigint_handler) tg = pytg.Telegram(telegram="/path/to/tg/bin/teleg...
0
0
0
0
0
0
options/test_options.py
awdxqqqaz/MoCoGAN-HD
170
3336771
<filename>options/test_options.py """ Copyright Snap Inc. 2021. This sample code is made available by Snap Inc. for informational purposes only. No license, whether implied or otherwise, is granted in or to such code (including any rights to copy, modify, publish, distribute and/or commercialize such code), unless you ...
0
0
0
0
0
0
qkeras/autoqkeras/tests/test_forgiving_factor.py
julesmuhizi/qkeras
388
3336778
# ============================================================================== # 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/li...
0
1
0
0
1
0
geomdl/sweeping.py
Maik93/NURBS-Python
382
3336782
<reponame>Maik93/NURBS-Python """ .. module:: sweeping :platform: Unix, Windows :synopsis: Provides functions for generating swept geometries .. moduleauthor:: <NAME> <<EMAIL>> """ from copy import deepcopy from . import linalg from . import construct from .exceptions import GeomdlException from ._utilities ...
0
0
0
0
0
0
twstock/cli/stock.py
wilson1745/twstock
956
3336817
<reponame>wilson1745/twstock<filename>twstock/cli/stock.py # -*- coding: utf-8 -*- import twstock def run(argv): for sid in argv: s = twstock.Stock(sid) print('-------------- %s ---------------- ' % sid) print('high : {:>5} {:>5} {:>5} {:>5} {:>5}'.format(*s.high[-5:])) print('low...
0
0
0
0
0
0
utilities/mano_fitting.py
lixiny/ContactPose
199
3336860
<filename>utilities/mano_fitting.py # Copyright (c) Facebook, Inc. and its affiliates. # Code by <NAME> from utilities.import_open3d import * from open3d import pipelines import utilities.misc as mutils assert(mutils.load_mano_model is not None) import numpy as np import chumpy as ch import os import json import trans...
0
0
0
0
0
0
ma_gym/envs/traffic_junction/__init__.py
prasuchit/ma-gym
310
3336879
<filename>ma_gym/envs/traffic_junction/__init__.py from .traffic_junction import TrafficJunction
0
0
0
0
0
0
tests/alltests.py
maroianenasrellah/-pyqrcode
332
3336899
<filename>tests/alltests.py #!/usr/bin/env python # -*- coding: utf-8 -*- """\ Runs all tests """ import nose nose.run()
0
0
0
0
0
0
tests/test_linear_trend.py
wdeanHPA/timeseers
233
3336903
from timeseers import LinearTrend import numpy as np def test_can_fit_generated_data(trend_data): data, true_delta, n_changepoints = trend_data model = LinearTrend(n_changepoints=n_changepoints) model.fit(data, data["value"]) y_scale_factor = model._y_scaler_.std_ model_delta = np.mean(model.trac...
0
0
0
0
0
0
sfm/ui/migrations/0016_auto_20170523_1026.py
Xtuden-com/sfm-ui
129
3336914
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies: list[tuple[str, str]] = [ ('ui', '0015_auto_20170426_0803'), ] operations: list[object] = [ migrations.RenameField('Collection', ...
0
0
2
0
2
0
validation_tests/analytical_exact/runup_on_beach/numerical_runup.py
samcom12/anuga_core
136
3336922
<filename>validation_tests/analytical_exact/runup_on_beach/numerical_runup.py<gh_stars>100-1000 """ Runup example from the manual, slightly modified """ #--------- #Import Modules #-------- import anuga import numpy from math import sin, pi, exp from anuga import Domain from anuga import myid, finalize, distribute ar...
0
0
0
0
0
0
bamboo/compiler_tests/test_compiler.py
jonesholger/lbann
194
3336962
<reponame>jonesholger/lbann import sys sys.path.insert(0, '../common_python') import tools import pytest import os, re import shutil def test_compiler_build_script(cluster, dirname): bamboo_base_dir = os.path.join(dirname, 'bamboo', 'compiler_tests') output_file_name = os.path.join(bamboo_base_dir, 'output', '...
0
0
0
0
0
0
statistical-modeling/lab3/generators.py
Foltrex/bsu
113
3336973
from math import sqrt, erf, log, exp from random import random # Gauss def get_next_standard_gauss() -> object: return sum([random() for _ in range(12)]) - 6 def get_next_gauss(m, s) -> object: return m + s * get_next_standard_gauss() def gauss(m, s, n): """ N(m, s^2) :param m: mean ...
0
7
0
0
7
0
tests/test_accelerator_efficient_blocks_mobile_cpu_activation_attention.py
kevinmtian/pytorchvideo
2,391
3337017
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import logging import unittest from copy import deepcopy import torch from pytorchvideo.layers.accelerator.mobile_cpu.activation_functions import ( supported_act_functions, ) from pytorchvideo.layers.accelerator.mobile_cpu.attention import Sq...
0
0
0
0
0
0
dialogue-engine/test/programytest/utils/email/test_sender.py
cotobadesign/cotoba-agent-oss
104
3337091
<filename>dialogue-engine/test/programytest/utils/email/test_sender.py """ Copyright (c) 2020 COTOBA DESIGN, Inc. 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 wit...
0
0
0
0
0
0
examples/custom_struct/packed_matrix.py
prkhrsrvstv1/cupy
6,180
3337101
<filename>examples/custom_struct/packed_matrix.py import sys import numpy import cupy code = ''' template<typename T> struct Matrix { T value[4][4]; __device__ T& operator() (int i, int j) { return this->value[i][j]; } __device__ const T& operator() (int i, int j) const { return this-...
0
0
0
0
0
0
topicnet/cooking_machine/recipes/multimodal_exploratory_search_pipeline.py
bt2901/TopicNet
123
3337225
<gh_stars>100-1000 from typing import List, Union, Dict from .recipe_wrapper import BaseRecipe from .. import Dataset multimodal_search_template = ''' # This config modifies a strategy described in the article # Multi-objective Topic Modeling for Exploratory Search in Tech News # by <NAME>, <NAME> and <NAME>, Jan 2018...
0
0
0
0
0
0
Python/binary_exponentiation.py
Nikhil-Sharma-1/DS-Algo-Point
1,148
3337273
number = int(input("Please enter number you want to to elevate : ")) power = int(input("Please enter the power : ")) binary = bin(power) binary = str(binary)[2:] prod = 1 index = 0 for c in reversed(binary): if c == '1': prod *= pow(number, pow(2, index)) index += 1 print(prod) ''' Compute the binar...
0
0
0
0
0
0
chart/scripts/primehub-start-notebook/patch_start_script_sudo_command.py
thliang01/primehub
294
3337313
def patch_sudo_command(script_path): with open(script_path, "r") as f: lines = f.readlines() outputs = [] for line in lines: if 'exec sudo -E' in line and 'LD_LIBRARY_PATH' not in line: line = line.replace(r'PATH=$PATH', r"""PATH=$PATH LD_LIBRARY_PATH=${LD_LIBRARY...
0
0
0
0
0
0
block/models/criterions/factory.py
Karol-G/block.bootstrap.pytorch
312
3337336
<filename>block/models/criterions/factory.py from bootstrap.lib.options import Options from .vqa_cross_entropy import VQACrossEntropyLoss from .vrd_bce import VRDBCELoss def factory(engine, mode): name = Options()['model.criterion.name'] split = engine.dataset[mode].split eval_only = 'train' not in engine....
0
0
0
0
0
0
peeringdb_server/migrations/0070_add_obj_counts.py
CyberFlameGO/peeringdb
224
3337418
<filename>peeringdb_server/migrations/0070_add_obj_counts.py # Generated by Django 2.2.19 on 2021-04-22 22:43 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("peeringdb_server", "0069_add_ix_service_and_terms"), ] operations = [ migratio...
0
0
0
0
0
0
python/backtracking/theKnightsTour.py
SounakMandal/AlgoBook
191
3337433
# Python3 program to solve The Knight Tour problem using Backtracking def printSolution(n, board): """ Print the solution Chessboard matrix """ for i in range(n): for j in range(n): print(board[i][j], end=' ') print() def isSafe(x, y, n, board) -> bool: ""...
0
2
0
0
2
0
cancat/uds/did.py
TomSomerville/CanCatFork
146
3337436
class DID(int): pass
0
0
0
0
0
0
elasticpypi/name.py
Conflate/elasticpypi
199
3337469
<gh_stars>100-1000 """ From https://github.com/vendasta/cloudpypi/blob/master/cloudpypi/package_api.py#L14 """ import os import re ARCHIVE_SUFFIX = r"(\.zip|\.tar\.gz|\.tgz|\.tar\.bz3|-py[23]\.\d-.*|\.win-amd64-py[23]\.\d\..*|\.win32-py[23]\.\d\..*)$" _archive_suffix_re = re.compile(ARCHIVE_SUFFIX, re.IGNORECASE) wh...
0
0
0
0
0
0
src/data_prep/model/py2vec_docstring_model.py
LaudateCorpus1/hermes-5
135
3337476
<reponame>LaudateCorpus1/hermes-5 import ast import inspect import imp import numpy as np import os import re from pyspark.mllib.feature import Word2Vec # ============================================================================= # Helper Functions # # These helper functions will be used in Py2VecModel's __get_fil...
0
0
0
0
0
0
pygam/tests/test_datasets.py
pjk645/pyGAM
714
3337498
# -*- coding: utf-8 -*- from __future__ import annotations import numpy as np import pytest from pygam.datasets import cake from pygam.datasets import coal from pygam.datasets import default from pygam.datasets import faithful from pygam.datasets import hepatitis from pygam.datasets import mcycle from pygam.datasets ...
1
0
0
0
1
0
examples/python/src/tests/test_authors.py
BearerPipelineTest/sqlc
5,153
3337542
<filename>examples/python/src/tests/test_authors.py import os import pytest import sqlalchemy.ext.asyncio from authors import query from dbtest.migrations import apply_migrations, apply_migrations_async def test_authors(db: sqlalchemy.engine.Connection): apply_migrations(db, [os.path.dirname(__file__) + "/../.....
0
0
0
0
0
0
misc/pytorch_toolkit/time_series/core/dataset/electricity_utils.py
dqawami/openvino_training_extensions
256
3337575
<filename>misc/pytorch_toolkit/time_series/core/dataset/electricity_utils.py import enum import pandas as pd import numpy as np import sklearn.preprocessing from tqdm import tqdm def expand(x, axis=0): return np.expand_dims(x, axis=axis) def get_single_col_by_input_type(input_type, column_definition): """Re...
0
0
0
0
0
0
test/python/test_op_disable.py
avijit-chakroborty/ngraph-bridge
142
3337615
<filename>test/python/test_op_disable.py # ============================================================================== # Copyright 2019-2020 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a ...
0
0
0
0
0
0
jack/core/__init__.py
elyase/jack
192
3337618
<reponame>elyase/jack from jack.core.input_module import * from jack.core.model_module import * from jack.core.output_module import * from jack.core.reader import * from jack.core.tensorport import * from jack.core.shared_resources import *
0
0
0
0
0
0
third_party/mesa/MesaLib/src/mesa/main/APIspecutil.py
Scopetta197/chromium
2,151
3337627
<filename>third_party/mesa/MesaLib/src/mesa/main/APIspecutil.py #!/usr/bin/python # # Copyright (C) 2009 <NAME> <<EMAIL>> # # 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...
0
0
0
0
0
0
src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/Languages/da.py
neurodebian/htcondor
217
3337731
apiAttachAvailable = u'API forefindes' apiAttachNotAvailable = u'Optaget' apiAttachPendingAuthorization = u'Afventer godkendelse' apiAttachRefused = u'Afvist' apiAttachSuccess = u'Succes' apiAttachUnknown = u'Ukendt' budDeletedFriend = u'Slettet fra liste over kontaktpersoner' budFriend = u'Ven' budNeverBeenFri...
0
0
0
0
0
0
tests/linear.py
dojitza/ddnn
110
3337748
import os import sys sys.path.append('..') import argparse import numpy as np import chainer_sequential.binary.utils.binary_util as bu from chainer_sequential.binary.links.link_binary_linear import BinaryLinear from chainer_sequential.binary.links.link_batch_normalization import BatchNormalization x = np.random.rand...
0
0
0
0
0
0
HunterAdminApi/api/authentication/ldap_auth_module.py
tt9133github/hunter
322
3337771
#!/ 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...
0
2
0
1
3
0
packages/core/minos-microservice-networks/minos/networks/brokers/subscribers/queued/queues/database/impl.py
minos-framework/minos-python
247
3337796
from __future__ import ( annotations, ) import logging from typing import ( Any, ) from minos.common import ( DatabaseClient, ) from .....collections import ( DatabaseBrokerQueue, DatabaseBrokerQueueBuilder, ) from ..abc import ( BrokerSubscriberQueue, BrokerSubscriberQueueBuilder, ) from...
1
2
0
0
3
0
tests/bpr_test.py
deethereal/implicit
2,824
3337824
<filename>tests/bpr_test.py import unittest from scipy.sparse import csr_matrix from implicit.bpr import BayesianPersonalizedRanking from implicit.gpu import HAS_CUDA from .recommender_base_test import RecommenderBaseTestMixin class BPRTest(unittest.TestCase, RecommenderBaseTestMixin): def _get_model(self): ...
0
0
0
0
0
0
examples/mxnet/tagcn/tagcn.py
ketyi/dgl
9,516
3337828
<reponame>ketyi/dgl<gh_stars>1000+ """TAGCN using DGL nn package References: - Topology Adaptive Graph Convolutional Networks - Paper: https://arxiv.org/abs/1710.10370 """ import mxnet as mx from mxnet import gluon import dgl from dgl.nn.mxnet import TAGConv class TAGCN(gluon.Block): def __init__(self, ...
0
0
0
0
0
0
tests/opytimizer/optimizers/population/test_gco.py
anukaal/opytimizer
528
3337829
<reponame>anukaal/opytimizer<gh_stars>100-1000 import numpy as np from opytimizer.optimizers.population import gco from opytimizer.spaces import search np.random.seed(0) def test_gco_params(): params = { 'CR': 0.7, 'F': 1.25 } new_gco = gco.GCO(params=params) assert new_gco.CR == 0...
0
0
0
0
0
0
lib/common/agents.py
mibboy/EmPyre
527
3337848
<reponame>mibboy/EmPyre<filename>lib/common/agents.py """ Main agent handling functionality for EmPyre. Database methods related to agents, as well as the GET and POST handlers (process_get() and process_post()) used to process checkin and result requests. handle_agent_response() is where the packets are parsed and ...
0
0
0
0
0
0
torch_fidelity/generative_model_modulewrapper.py
forkbabu/torch-fidelity
372
3337865
<filename>torch_fidelity/generative_model_modulewrapper.py import copy import torch from torch_fidelity.generative_model_base import GenerativeModelBase from torch_fidelity.helpers import vassert class GenerativeModelModuleWrapper(GenerativeModelBase): def __init__(self, module, z_size, z_type, num_classes, mak...
0
0
0
0
0
0
03-machine-learning-tabular-crossection/09 - Balanceamento/solutions/solution_13.py
pavellelis/datascience_course
331
3337866
<gh_stars>100-1000 from sklearn.neighbors import KNeighborsClassifier from sklearn.svm import SVC from sklearn.tree import DecisionTreeClassifier from sklearn.ensemble import RandomForestClassifier, GradientBoostingClassifier from sklearn.naive_bayes import GaussianNB from sklearn.linear_model import LogisticRegression...
0
0
0
0
0
0
tests/pki/test_openssl.py
pythonModule/commandment
138
3337893
<reponame>pythonModule/commandment<filename>tests/pki/test_openssl.py<gh_stars>100-1000 import pytest import os.path import logging from cryptography import x509 from cryptography.hazmat.primitives.asymmetric import rsa from commandment.pki import openssl import oscrypto logger = logging.getLogger(__name__) class Te...
0
0
0
0
0
0
atlas/foundations_core_cli/src/foundations_core_cli/job_submission/logs.py
DeepLearnI/atlas
296
3337895
def stream_job_logs(deployment): from foundations_contrib.global_state import log_manager from os import environ import time logger = log_manager.get_logger(__name__) if environ.get('DISABLE_LOG_STREAMING', 'False') == 'False': logger.info('Job queued. Ctrl-C to stop streaming - job wi...
0
0
0
0
0
0
tools/blenderScripts/8_directions/render_animFrames_in_8_directions_2.py
turesnake/tprPixelGames
591
3337931
# # render animAction frames in 8-directions # before run, remember set target-obj.Rotation.z == 0 !!! # import bpy import os import sys from random import randint sys.path.append("C:/Users/Administrator/Desktop/blender_script/tree_create/") from tools import * #----- class DirData(object): d...
0
0
0
0
0
0
examples/wip/tle/codefestival_2015_final_d.py
uta8a/Jikka
139
3337940
<gh_stars>100-1000 # https://atcoder.jp/contests/code-festival-2015-final-open/tasks/codefestival_2015_final_d from typing import * def solve(n: int, s: List[int], t: List[int]) -> int: assert 2 <= n <= 10 ** 5 assert len(s) == n assert len(t) == n ans = n for i in range(n): ans_i = max(sum...
0
0
0
0
0
0
src/pretix/base/migrations/0198_invoice_sent_to_customer.py
hansegucker/pretix
1,248
3338082
# Generated by Django 3.2.4 on 2021-09-30 10:25 from datetime import datetime from django.db import migrations, models from pytz import UTC class Migration(migrations.Migration): dependencies: list[tuple[str, str]] = [ ('pretixbase', '0197_auto_20210914_0814'), ] operations: list[object] = [ ...
0
0
2
0
2
0
tests/__init__.py
bpkwee/metrics
769
3338149
<gh_stars>100-1000 from tests.helpers.testers import BATCH_SIZE, NUM_BATCHES, NUM_PROCESSES, DummyMetric, MetricTester # noqa: F401
0
0
0
0
0
0
tests/test_schedule.py
suned/pfun
126
3338183
import itertools from datetime import timedelta from unittest.mock import Mock from pfun import schedule, success two_seconds = timedelta(seconds=2) def test_spaced(): deltas = schedule.spaced(two_seconds).run(None) assert list(itertools.islice(deltas, 3)) == [two_seconds] * 3 def test_exponential(): ...
0
0
0
0
0
0
tests/libgsync/test_drive.py
iwonbigbro/gsync
199
3338235
#!/usr/bin/env python # -*- coding: utf8 -*- # Copyright (C) 2014 <NAME>. All rights reserved. from __future__ import annotations import unittest, os, inspect from libgsync.output import debug from libgsync.drive import Drive, DriveFile, DrivePathCache from libgsync.drive.mimetypes import MimeTypes from apiclient.ht...
0
2
0
0
2
0
微信聊天记录/utils/string_utils.py
xingag/spider_python
762
3338254
#!/usr/bin/env python # encoding: utf-8 """ @version: v1.0 @author: xag @license: Apache Licence @contact: <EMAIL> @site: http://www.xingag.top @software: PyCharm @file: StringUtils.py @time: 2020-04-11 18:39 @description:TODO """ import re def get_ava_string(str) -> object: """ 去掉特殊符号,保留正常内容 ...
0
1
0
0
1
0
metakernel/magics/tests/test_kernel_magic.py
StephanRempel/metakernel
276
3338280
<gh_stars>100-1000 from metakernel.tests.utils import get_kernel, get_log_text, EvalKernel import os import time def test_kernel_magic(): kernel = get_kernel(EvalKernel) kernel.do_execute("%kx 42", False) results = get_log_text(kernel) assert "42" in results, results
0
0
0
0
0
0
tokenizer/apply_tokenizer.py
chadykamar/CodeT5
337
3338289
<gh_stars>100-1000 from tokenizers import ByteLevelBPETokenizer tokenizer = ByteLevelBPETokenizer.from_file( "./salesforce/codet5-vocab.json", "./salesforce/codet5-merges.txt" ) tokenizer.add_special_tokens([ "<pad>", "<s>", "</s>", "<unk>", "<mask>" ]) print( tokenizer.encode("<s> hel...
0
0
0
0
0
0
src/mem/RTyyyy_memdef.py
ufo2011/NXP-MCUBootUtility
174
3338323
import sys, os kMemBlockOffset_HwCryptoKeyBlob = 0x0 kMemBlockOffset_EKIB0 = 0x400 kMemBlockOffset_EPRDB0 = 0x480 kMemBlockOffset_EKIB1 = 0x800 kMemBlockOffset_EPRDB1 = 0x880 kMemBlockOffsetToIvt_DCD = 0x40 kMemBlockSize_HwCryptoKeyBlob = 0x100 kMemBlockSize_NFCB = 0x...
0
0
0
0
0
0
up/tasks/det/models/heads/roi_head/retina_head.py
ModelTC/EOD
196
3338360
<filename>up/tasks/det/models/heads/roi_head/retina_head.py import torch.nn as nn from up.utils.model.normalize import build_conv_norm, build_norm_layer from up.utils.model.initializer import init_bias_focal, initialize_from_cfg from up.utils.general.registry_factory import MODULE_ZOO_REGISTRY from up.utils.general.gl...
0
0
0
0
0
0
tests/cmd/create/test_create_component.py
riiid/krsh
133
3338385
import os import shutil import tempfile import unittest from krsh.cmd.group_create.cmd_component import cmd_create_component class TestCommandCreateComponent(unittest.TestCase): def setUp(self): self.sample_path = os.path.join(os.path.dirname(__file__), "../../samples") def test_create_component(sel...
0
0
0
0
0
0
eemont/__init__.py
barbedorafael/eemont
213
3338391
<gh_stars>100-1000 """The eemont python package.""" __version__ = "0.3.0" from . import (app, dataframe, eeDictionary, eeList, extra, feature, featurecollection, geometry, image, imagecollection, number) from .common import *
0
0
0
0
0
0
635 Design Log Storage System.py
krishna13052001/LeetCode
872
3338400
<reponame>krishna13052001/LeetCode #!/usr/bin/python3 """ You are given several logs that each log contains a unique id and timestamp. Timestamp is a string that has the following format: Year:Month:Day:Hour:Minute:Second, for example, 2017:01:01:23:59:59. All domains are zero-padded decimal numbers. Design a log stor...
0
0
0
0
0
0
ds-bifurcation-diagram-saddlenode.py
RachidStat/PyCX
176
3338416
<filename>ds-bifurcation-diagram-saddlenode.py from pylab import * def xeq1(r): return sqrt(r) def xeq2(r): return -sqrt(r) domain = linspace(0, 10) plot(domain, xeq1(domain), 'b-', linewidth = 3) plot(domain, xeq2(domain), 'r--', linewidth = 3) plot([0], [0], 'go') axis([-10, 10, -5, 5]) xlabel('r') ylabel(...
0
0
0
0
0
0
Hackerrank/drawingbook/solution.py
arushmangal/Hack-CP-DSA
205
3338429
<reponame>arushmangal/Hack-CP-DSA #!/bin/python3 import os import sys # # Complete the pageCount function below. # def pageCount(n, p): # # Write your code here. # pages = [] count = 0 #For turing from page 1. loop_run_one = 0 #For turning from page n. loop_run_two = 0 #For st...
0
0
0
0
0
0
tools/Polygraphy/polygraphy/logger/__init__.py
martellz/TensorRT
5,249
3338459
<filename>tools/Polygraphy/polygraphy/logger/__init__.py from polygraphy.logger.logger import G_LOGGER, LogMode
0
0
0
0
0
0
examples/experimental/alignment.py
limberc/HyperGAN
889
3338488
from __future__ import annotations import argparse import os import uuid import random import sys import tensorflow as tf import hypergan as hg import hyperchamber as hc import numpy as np from hypergan.generators import * from hypergan.gans.base_gan import BaseGAN from hypergan.gans.standard_gan import StandardGAN fro...
0
2
0
0
2
0
examples/markers.py
RyanAugust/geoplotlib
1,021
3338531
""" Example of rendering markers """ import geoplotlib from geoplotlib.utils import read_csv metro = read_csv('./data/metro.csv') s_tog = read_csv('./data/s-tog.csv') geoplotlib.markers(metro, 'data/m.png', f_tooltip=lambda r: r['name']) geoplotlib.markers(s_tog, 'data/s-tog.png', f_tooltip=lambda r: r['name']) geop...
0
0
0
0
0
0
Contents/Libraries/Shared/plex/objects/user.py
jippo015/Sub-Zero.bundle
1,553
3338535
from plex.objects.core.base import Descriptor, Property class User(Descriptor): id = Property(type=int) title = Property thumb = Property
0
0
0
0
0
0
test/fixtures/python/main.py
dugsmith/quicktype
7,936
3338617
import quicktype import json import sys import io f = io.open(sys.argv[1], mode="r", encoding="utf-8") obj = quicktype.top_level_from_dict(json.load(f)) print(json.dumps(quicktype.top_level_to_dict(obj)))
0
0
0
0
0
0
tests/zero_code_change/smdataparallel_tests/constants.py
sophiayue1116/sagemaker-debugger
133
3338628
SMDATAPARALLEL_PYTORCH_TEST_MNIST_SCRIPT = ( "examples/pytorch/zero_code_change_examples/smdataparallel_mnist.py" ) SMDATAPARALLEL_PYTORCH_TEST_MNIST_ARGS = ["--epochs", "1"] SMDATAPARALLEL_TF2_TEST_MNIST_SCRIPT = "examples/tensorflow2/scripts/smdataparallel_mnist_tf2.py"
0
0
0
0
0
0
deep-rl/lib/python2.7/site-packages/OpenGL/raw/GL/SGIX/clipmap.py
ShujaKhalid/deep-rl
210
3338653
<reponame>ShujaKhalid/deep-rl '''Autogenerated by xml_generate script, do not edit!''' from OpenGL import platform as _p, arrays # Code generation uses this from OpenGL.raw.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 C...
0
0
0
0
0
0
tests/test_gscholar.py
DanwRob/gscholar
205
3338693
<gh_stars>100-1000 from gscholar import gscholar as gs import pytest @pytest.mark.xfail(reason="Google's rate limiter.") def test_query(): """Normal query with latin encoding should give non empty result.""" result = gs.query('<NAME>', gs.FORMAT_BIBTEX) assert len(result) > 0 @pytest.mark.xfail(reason=...
0
0
0
0
0
0
vendor/github.com/google/certificate-transparency/python/ct/cert_analysis/base_check_test.py
weltonrodrigo/origin
220
3338718
<gh_stars>100-1000 import unittest class BaseCheckTest(unittest.TestCase): def assertObservationIn(self, obs, result): """Asserts that Observation (or some subtype) with (description, reason, details) is in result.""" self.assertIn((obs.description, obs.reason, obs.details), ...
0
0
0
0
0
0