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
biostar/recipes/test/test_ajax.py
Oribyne/biostar-central-fork
477
140174
<filename>biostar/recipes/test/test_ajax.py import logging import os import json from unittest.mock import patch, MagicMock from django.conf import settings from django.test import TestCase, override_settings from django.urls import reverse from biostar.recipes import models, auth, ajax from biostar.utils.helpers imp...
0
0
0
0
0
0
modin/experimental/sql/test/test_sql.py
Rubtsowa/modin
7,258
140204
<reponame>Rubtsowa/modin # Licensed to Modin Development Team under one or more contributor license agreements. # See the NOTICE file distributed with this work for additional information regarding # copyright ownership. The Modin Development Team licenses this file to you under the # Apache License, Version 2.0 (the ...
0
0
0
0
0
0
awesome_gans/segan/segan_train.py
StevenJokess/Awesome-GANs
739
140232
import time import numpy as np import tensorflow as tf import awesome_gans.image_utils as iu import awesome_gans.segan.segan_model as segan from awesome_gans.datasets import MNISTDataSet results = {'output': './gen_img/', 'checkpoint': './model/checkpoint', 'model': './model/SEGAN-model.ckpt'} train_step = { 'g...
0
0
0
0
0
0
roboticstoolbox/examples/mexican-wave.py
tassos/robotics-toolbox-python
749
140234
<filename>roboticstoolbox/examples/mexican-wave.py #!/usr/bin/env python """ @author <NAME> @author <NAME> """ # A circle of Puma robot's doing a Mexican wave import numpy as np from spatialmath import SE3 import roboticstoolbox as rtb from roboticstoolbox.backends.swift import Swift import time swift = Swift() swif...
0
0
0
0
0
0
sopaper/queryhandler.py
gonzalorodrigo/SoPaper
158
140250
#!../manage/exec-in-virtualenv.sh # -*- coding: UTF-8 -*- # File: queryhandler.py # Date: Thu Jun 18 22:52:39 2015 +0800 # Author: <NAME> <<EMAIL>> from __future__ import annotations from bson.binary import Binary from threading import Thread from multiprocessing import Pool from ukdbconn import get_mongo, global_cou...
0
5
0
0
5
0
models/maskrcnn/metric.py
tingyumao94/groupsoftmax-simpledet
153
140268
<reponame>tingyumao94/groupsoftmax-simpledet<filename>models/maskrcnn/metric.py<gh_stars>100-1000 import numpy as np import mxnet as mx class SigmoidCELossMetric(mx.metric.EvalMetric): def __init__(self, name, output_names, label_names): super().__init__(name, output_names, label_names) def update(sel...
0
0
0
0
0
0
tests/tests_tuner/test_time_controller.py
stjordanis/mljar-supervised
1,882
140270
import os import time import unittest from numpy.testing import assert_almost_equal from supervised.tuner.time_controller import TimeController class TimeControllerTest(unittest.TestCase): def test_to_and_from_json(self): tc = TimeController( start_time=time.time(), total_time_lim...
0
0
0
0
0
0
readthedocs/metrics/tasks.py
mforbes/readthedocs.org
4,054
140292
""" Specific metric tasks for community. Override the base metric tasks to add specific ones only required on community. """ # Disable import error because -ext is not available on pylint # pylint: disable=import-error from readthedocsext.monitoring.metrics.database import ( AvgBuildTimeMetric, AvgBuildTrigge...
0
0
0
0
0
0
Allura/allura/tests/test_webhooks.py
rohankumardubey/allura
113
140302
# 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 (t...
2
8
0
0
10
0
tests/test_task_scale_images.py
asmeurer/nikola
1,901
140304
<filename>tests/test_task_scale_images.py import os from tempfile import NamedTemporaryFile import pytest from PIL import Image, ImageDraw from nikola.plugins.task import scale_images # These tests don't require valid profiles. They need only to verify # that profile data is/isn't saved with images. # It would be ni...
0
0
0
0
0
0
bdd_data/label2det_v1.py
Erotemic/bdd-data
131
140324
<reponame>Erotemic/bdd-data import argparse import json import os from os import path as osp import sys def parse_args(): """Use argparse to get command line arguments.""" parser = argparse.ArgumentParser() parser.add_argument('label_dir', help='path to the label dir') parser.add_argument('det_path', ...
0
0
0
0
0
0
Tools/MonoGenerator/__main__.py
mortend/fuse-studio
324
140352
<gh_stars>100-1000 import subprocess import argparse import os import urllib import tarfile import glob import shutil from os import path from install_name_tool import * import re containing_dir = path.dirname(path.realpath(__file__)) working_dir = os.getcwd() parser = argparse.ArgumentParser(description='\ Generates...
0
0
0
0
0
0
empire.py
chenxiangfang/Empire
2,541
140401
#! /usr/bin/env python3 import empire.arguments as arguments import sys if __name__ == '__main__': args = arguments.args if args.subparser_name == 'server': import empire.server.server as server server.run(args) elif args.subparser_name == 'client': import empire.client.client a...
0
0
0
0
0
0
venv/Lib/site-packages/IPython/nbformat.py
ajayiagbebaku/NFL-Model
6,989
140406
""" Shim to maintain backwards compatibility with old IPython.nbformat imports. """ # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import sys from warnings import warn from IPython.utils.shimmodule import ShimModule, ShimWarning warn("The `IPython.nbformat` packa...
0
0
0
0
0
0
test/unit_test/controller/test_callback.py
ArnovanHilten/NVFlare
155
140412
# Copyright (c) 2021-2022, 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 ...
14
1
0
0
15
0
cls/TimeText.py
hermanb001/Free-Node-Merge-1
192
140422
<gh_stars>100-1000 #!/usr/bin/env python3 import requests import os import time class TimeText(): # 将订阅链接中YAML,Base64等内容转换为 Url 链接内容 # 读取本地文件的修改时间 def get_local_file_modifiedtime(fname): try: modifiedTime = time.localtime(os.stat(fname).st_mtime) #mTime = time.strftime('%Y-%m-%...
0
0
0
0
0
0
3rd_party/py/defusedxml_local/defusedxml/ElementTree.py
Wlgen/force-riscv
111
140454
<gh_stars>100-1000 # defusedxml # # Copyright (c) 2013 by <NAME> <<EMAIL>> # Licensed to PSF under a Contributor Agreement. # See https://www.python.org/psf/license for licensing details. """Defused xml.etree.ElementTree facade """ from __future__ import print_function, absolute_import import sys import warnings from ...
0
0
0
0
0
0
pypeit/scripts/chk_edges.py
ykwang1/PypeIt
107
140480
<reponame>ykwang1/PypeIt<filename>pypeit/scripts/chk_edges.py """ This script displays the Trace image and the traces in an RC Ginga window. .. include common links, assuming primary doc root is up one directory .. include:: ../include/links.rst """ from pypeit.scripts import scriptbase class ChkEdges(scriptbase.Sc...
0
0
0
0
0
0
pyformance/reporters/console_reporter.py
boarik/pyformance
167
140486
<gh_stars>100-1000 # -*- coding: utf-8 -*- from __future__ import print_function import sys import datetime from .reporter import Reporter class ConsoleReporter(Reporter): """ Show metrics in a human readable form. This is useful for debugging if you want to read the current state on the console. """...
0
0
0
0
0
0
modules/t_google_play_download/gplay-cli/ext_libs/androguard/core/bytecodes/jvm.py
napoler/t-drupal-module
285
140519
# This file is part of Androguard. # # Copyright (C) 2012, <NAME> <desnos at t0t0.fr> # All rights reserved. # # Androguard is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the Licens...
0
0
0
0
0
0
src/genie/libs/parser/iosxe/tests/ShowIpVrfDetail/cli/equal/golden_output_expected.py
balmasea/genieparser
204
140580
expected_output = { "Mgmt-intf": { "address_family": { "ipv4 unicast": { "flags": "0x0", "table_id": "0x1", "vrf_label": {"allocation_mode": "per-prefix"}, } }, "cli_format": "New", "flags": "0x1808", "in...
0
0
0
0
0
0
test/win/gyptest-link-safeseh.py
chlorm-forks/gyp
2,151
140588
#!/usr/bin/env python # Copyright (c) 2014 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Make sure safeseh setting is extracted properly. """ import TestGyp import sys if sys.platform == 'win32': test = TestGyp.TestGyp()...
0
1
0
0
1
0
Lib/objc/_MIME.py
snazari/Pyto
701
140591
from __future__ import annotations """ Classes from the 'MIME' framework. """ try: from rubicon.objc import ObjCClass except ValueError: def ObjCClass(name) -> None: return None def _Class(name) -> object | None: try: return ObjCClass(name) except NameError: return None MFW...
0
2
0
0
2
0
ck/repo/module/index/module.py
santosh653/ck
480
140594
# # Collective Knowledge (indexing through ElasticSearch) # # See CK LICENSE.txt for licensing details # See CK COPYRIGHT.txt for copyright details # # Developer: <NAME> # from __future__ import annotations cfg = {} # Will be updated by CK (meta description of this module) work = {} # Will be updated by CK (temporal...
0
7
0
0
7
0
tools/crunchstat-summary/crunchstat_summary/webchart.py
rpatil524/arvados
222
140596
<gh_stars>100-1000 # Copyright (C) The Arvados Authors. All rights reserved. # # SPDX-License-Identifier: AGPL-3.0 try: from html import escape except ImportError: from cgi import escape import json import pkg_resources class WebChart(object): """Base class for a web chart. Subclasses must assign J...
0
0
0
0
0
0
cogan/data/compute_optimal_alignment.py
sagardsaxena/CoGAN
285
140626
#!/usr/bin/env python ''' /* Copyright 2016, <NAME> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any non-commercial purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notic...
0
0
0
0
0
0
chainer_chemistry/models/gwm/gwm.py
pfnet/chainerchem
184
140637
<gh_stars>100-1000 import chainer from chainer import functions from chainer import links from chainer_chemistry.links import GraphLinear class WarpGateUnit(chainer.Chain): """WarpGateUnit It computes gated-sum mixing `merged` feature from normal node feature `h` and super node feature `g`, See Sec...
0
0
0
0
0
0
local_flow/rec/src/custom_decorators.py
JSpenced/you-dont-need-a-bigger-boat
356
140665
<gh_stars>100-1000 """ Custom decorators for use with Metaflow """ from functools import wraps def pip(libraries): def decorator(function): @wraps(function) def wrapper(*args, **kwargs): import subprocess import sys for library, version in libraries.items(): ...
0
0
0
0
0
0
encoders/audio/MFCCTimbreEncoder/__init__.py
sidphbot/jina-hub
106
140668
<filename>encoders/audio/MFCCTimbreEncoder/__init__.py __copyright__ = "Copyright (c) 2021 Jina AI Limited. All rights reserved." __license__ = "Apache-2.0" import numpy as np from jina.executors.decorators import batching, as_ndarray from jina.executors.encoders import BaseAudioEncoder class MFCCTimbreEncoder(BaseA...
0
0
0
0
0
0
utils/onnx_util.py
xuguozhi/Peppa-Facial-Landmark-PyTorch
163
140721
import torch import torch.onnx from models.slim import Slim x = torch.randn(1, 3, 160, 160) model = Slim() model.load_state_dict(torch.load("../pretrained_weights/slim_160_latest.pth", map_location="cpu")) model.eval() torch.onnx.export(model, x, "../pretrained_weights/slim_160_latest.onnx", input_names=["input1"], ou...
0
0
0
0
0
0
proj/hps_accel/gateware/gen2/test_utils.py
keadwen/CFU-Playground
240
140728
#!/bin/env python # Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
0
1
0
0
1
0
examples/computer_vision/efficientdet_pytorch/efficientdet_files/modelema.py
gh-determined-ai/determined
1,729
140733
from __future__ import annotations ''' This is based on pytorch-image-models' ModelEMA https://github.com/rwightman/pytorch-image-models/blob/9a25fdf3ad0414b4d66da443fe60ae0aa14edc84/timm/utils/model_ema.py This altered version refactors the load and save functionality to support Determined's fault tolerance features....
4
3
0
0
7
0
src/observer/python/test.py
oxnz/design-patterns
117
140769
#!/usr/bin/python #coding: utf-8 class Subject(object): def __init__(self): self._observers = [] def attach(self, observer): if not observer in self._observers: self._observers.append(observer) def detach(self, observer): try: self._observers.remove(observer) except ValueError: pass def notify(sel...
0
0
0
0
0
0
tests/unit/display/test_traditional.py
senstb/aws-elastic-beanstalk-cli
110
140784
<gh_stars>100-1000 # Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "li...
0
0
0
0
0
0
photogrammetry_importer/file_handlers/meshroom_file_handler.py
clayne/Blender-Addon-Photogrammetry-Importer
452
140821
from __future__ import annotations import json import numpy as np import os from photogrammetry_importer.types.camera import Camera from photogrammetry_importer.types.point import Point from photogrammetry_importer.file_handlers.utility import ( check_radial_distortion, ) from photogrammetry_importer.blender_utili...
3
15
0
0
18
0
pymtl3/stdlib/basic_rtl/register_files.py
pymtl/pymtl3
152
140826
from pymtl3 import * class RegisterFile( Component ): def construct( s, Type, nregs: int=32, rd_ports: int=1, wr_ports: int=1, const_zero: bool=False ): addr_type = mk_bits( max( 1, clog2( nregs ) ) ) s.raddr = [ InPort( addr_type ) for i in range( rd_ports ) ] s.rdata = [ OutPort( Ty...
4
0
0
0
4
0
inversion/video/post_processing.py
cedro3/stylegan3-editing
347
140832
from typing import List, Dict import numpy as np import torch from tqdm import tqdm from utils.fov_expansion import Expander from inversion.video.video_config import VideoConfig from utils.common import tensor2im, get_identity_transform def postprocess_and_smooth_inversions(results: Dict, net, opts: VideoConfig) ->...
6
4
0
0
10
0
RecoTracker/Configuration/python/RecoTrackerP5_EventContent_cff.py
ckamtsikis/cmssw
852
140863
import FWCore.ParameterSet.Config as cms #Tracks without extra and hits #AOD content RecoTrackerAOD = cms.PSet( outputCommands = cms.untracked.vstring( 'keep recoTracks_ctfWithMaterialTracksP5_*_*', 'keep recoTracks_ctfWithMaterialTracksP5LHCNavigation_*_*', 'keep recoTracks_rsWithMaterialTracksP5...
0
0
0
0
0
0
apim-migration-testing-tool/Python/venv/lib/python3.6/site-packages/zope/interface/tests/test_sorting.py
tharindu1st/apim-migration-resources
9,953
140866
############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # TH...
0
0
0
0
0
0
desktop_local_tests/test_packet_capture_disrupt_vpn_connection.py
UAEKondaya1/expressvpn_leak_testing
219
140876
<filename>desktop_local_tests/test_packet_capture_disrupt_vpn_connection.py from desktop_local_tests.local_packet_capture_test_case_with_disrupter import LocalPacketCaptureTestCaseWithDisrupter from desktop_local_tests.vpn_connection_disrupter import VPNConnectionDisrupter class TestPacketCaptureDisruptVPNConnection(L...
0
0
0
0
0
0
lib/pymedphys/trf.py
ethanio12345/pymedphys
207
140909
<reponame>ethanio12345/pymedphys<filename>lib/pymedphys/trf.py<gh_stars>100-1000 # pylint: disable = unused-import, missing-docstring from pymedphys._trf.decode.trf2pandas import trf2pandas as read from pymedphys._trf.manage.identify import identify_logfile as identify
0
0
0
0
0
0
openfold/utils/lr_schedulers.py
ville761/openfold
789
140911
import torch class AlphaFoldLRScheduler(torch.optim.lr_scheduler._LRScheduler): """ Implements the learning rate schedule defined in the AlphaFold 2 supplement. A linear warmup is followed by a plateau at the maximum learning rate and then exponential decay. Note that the initial...
8
2
0
0
10
0
regipy/__init__.py
pombredanne/regipy
190
140945
<reponame>pombredanne/regipy from .registry import * __title__ = 'regipy' __version__ = '2.2.0'
0
0
0
0
0
0
public-engines/kaggle-titanic-engine/tests/prediction/test_predictor.py
tallandroid/incubator-marvin
101
140951
#!/usr/bin/env python # coding=utf-8 try: import mock except ImportError: import unittest.mock as mock from marvin_titanic_engine.prediction import Predictor class TestPredictor: def test_execute(self, mocked_params): model_mocked = { "rf": mock.MagicMock(), "svm": mock...
0
0
0
0
0
0
problems/tests/test_sock_merchant.py
vinta/fuck-coding-interviews
590
140964
<gh_stars>100-1000 # coding: utf-8 import unittest from problems.sock_merchant import sockMerchant class TestCase(unittest.TestCase): def test(self): test_data = [ {'n': 9, 'ar': [10, 20, 20, 10, 10, 30, 50, 10, 20], 'expected': 3}, ] for data in test_data: n = dat...
0
0
0
0
0
0
tools/osx/crosstool/osx_archs.bzl
obruns/bazel
16,989
140985
"""Information regarding crosstool-supported architectures.""" # Copyright 2017 The Bazel 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.apach...
0
0
0
0
0
0
tests/unit/operations/test_solution_stack_ops.py
sdolenc/aws-elastic-beanstalk-cli
110
140995
<filename>tests/unit/operations/test_solution_stack_ops.py # Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws...
0
0
0
0
0
0
vmware_host.py
mkevenaar/SysAdminBoard
293
141008
#!/usr/bin/env python """vmware_host - Exports JSON files with CPU and RAM data for VMware ESX hosts # Requires VMware Python SDK: pyvmomi # https://code.google.com/p/pysphere/ # pip install pyvmomi """ from credentials import VMWARE_VCENTER_USERNAME from credentials import VMWARE_VCENTER_PASSWORD import operator ...
0
0
0
0
0
0
test/mavsdk_tests/logger_helper.py
SaxionMechatronics/Firmware
4,224
141009
<reponame>SaxionMechatronics/Firmware #!/usr/bin/env python3 import re import sys import os from enum import Enum from functools import lru_cache class color(Enum): PURPLE = '\033[95m' CYAN = '\033[96m' DARKCYAN = '\033[36m' BLUE = '\033[94m' GREEN = '\033[92m' YELLOW = '\033[93m' RED = '...
0
0
0
0
0
0
src/cocoa/toga_cocoa/widgets/internal/data.py
freespace/toga
1,261
141034
from toga_cocoa.libs import NSObject, objc_method class TogaData(NSObject): @objc_method def copyWithZone_(self) -> object: # TogaData is used as an immutable reference to a row # so the same object can be returned as a copy. self.retain() return self
0
1
0
0
1
0
examples/pawn.py
TonyZYT2000/vapory
376
141096
""" Just a purple sphere """ from vapory import * objects = [ # SUN LightSource([1500,2500,-2500], 'color',1), # SKY Sphere( [0,0,0],1, 'hollow', Texture( Pigment( 'gradient', [0,1,0], 'color_map{[0 color White] [1 color Blu...
0
0
0
0
0
0
Reverse Engineering/resources/scripts/Install Commonly Used Utilities/debugserver.py
bzxy/cydia
678
141097
#!/usr/bin/env python import subprocess import string import os Path = subprocess.check_output(['xcode-select', '-p']) Path = Path + "/Platforms/iPhoneOS.platform/DeviceSupport" Path = string.replace(Path, "\n", "") print "Developer Images Located At:", Path for Sub in os.listdir(Path): SubDire = os.path.join(Path,...
0
0
0
0
0
0
boto3_type_annotations/boto3_type_annotations/route53domains/client.py
cowboygneox/boto3_type_annotations
119
141099
from typing import Optional from botocore.client import BaseClient from typing import Dict from typing import Union from botocore.paginate import Paginator from datetime import datetime from botocore.waiter import Waiter from typing import List class Client(BaseClient): def can_paginate(self, operation_name: str ...
73
26
0
0
99
0
code/utils.py
kongmoumou/BootEA
131
141107
<reponame>kongmoumou/BootEA<gh_stars>100-1000 import numpy as np import time from triples import Triples def read_input(folder): triples_set1 = read_triples(folder + 'triples_1') triples_set2 = read_triples(folder + 'triples_2') triples1 = Triples(triples_set1) triples2 = Triples(triples_set2) to...
0
0
0
0
0
0
opendatatools/nhindex/__init__.py
solider245/OpenData
1,179
141109
# encoding: utf-8 from .nhindex_interface import *
0
0
0
0
0
0
python/IECoreMaya/FnParameterisedHolder.py
bradleyhenke/cortex
386
141110
########################################################################## # # Copyright (c) 2008-2011, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redis...
11
14
3
0
28
0
resotocore/tests/resotocore/model/typed_model_test.py
someengineering/resoto
126
141114
<filename>resotocore/tests/resotocore/model/typed_model_test.py import abc from datetime import datetime from deepdiff import DeepDiff from frozendict import frozendict from resotocore.model.typed_model import from_js, to_js from resotocore.query.model import Query, P from resotocore.query.query_parser import parse_q...
0
0
0
0
0
0
PyFin/tests/Analysis/testCrossSectionValueHolders.py
rpatil524/Finance-Python
325
141138
<filename>PyFin/tests/Analysis/testCrossSectionValueHolders.py<gh_stars>100-1000 # -*- coding: utf-8 -*- u""" Created on 2017-1-6 @author: cheng.li """ import unittest import numpy as np import pandas as pd from PyFin.Enums import Factors from PyFin.Analysis.SecurityValueHolders import SecurityLatestValueHolder from ...
0
0
0
0
0
0
cogdl/data/dataloader.py
li-ziang/cogdl
1,072
141168
<reponame>li-ziang/cogdl<filename>cogdl/data/dataloader.py from abc import ABCMeta import torch.utils.data from torch.utils.data.dataloader import default_collate from cogdl.data import Batch, Graph try: from typing import GenericMeta # python 3.6 except ImportError: # in 3.7, genericmeta doesn't exist but w...
0
0
0
0
0
0
cliff/tests/test_formatters_csv.py
tivaliy/cliff
187
141170
<filename>cliff/tests/test_formatters_csv.py #!/usr/bin/env python # -*- coding: utf-8 -*- # # 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-...
0
0
0
0
0
0
k2/python/host/tests/properties_test.py
EmreOzkose/k2
491
141175
#!/usr/bin/env python3 # # Copyright 2020 Xiaomi Corporation (author: <NAME>) # # See ../../../LICENSE for clarification regarding multiple 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 ...
0
0
0
0
0
0
lit_nlp/lib/utils.py
eichinflo/lit
2,854
141180
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
17
10
1
0
28
0
src/opendr/perception/face_recognition/algorithm/util/iterator.py
makistsantekidis/opendr
217
141206
<reponame>makistsantekidis/opendr from opendr.engine.datasets import DatasetIterator import torch import numpy as np class FaceRecognitionDataset(DatasetIterator): def __init__(self, pairs): self.data = np.array([pairs[:, 0], pairs[:, 1]]) self.labels = pairs[:, 2] def __getitem__(self, idx):...
0
0
0
0
0
0
testproject/django_file_form_example/tests/utils/test_utils.py
kosior/django-file-form
133
141211
<reponame>kosior/django-file-form import uuid from datetime import datetime from json import dumps from pathlib import Path from django.utils import timezone from django.conf import settings from django_file_form_example.models import Example, ExampleFile def get_random_id(): return uuid.uuid4().hex def encod...
0
0
0
0
0
0
app/settings.py
priyanshu-kumar02/personfinder
561
141212
<gh_stars>100-1000 # Copyright 2019 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
0
0
0
0
0
0
Chapter08/1imputation.py
karim7262/Python-Machine-Learning-By-Example
106
141229
import numpy as np from sklearn.preprocessing import Imputer # Represent the unknown value by np.nan in numpy data_origin = [[30, 100], [20, 50], [35, np.nan], [25, 80], [30, 70], [40, 60]] # Imputation with the mean value imp_mean = Imputer(m...
0
0
0
0
0
0
tests/autobahn_test.py
andreasbossard/deutschland
445
141231
from pprint import pprint from deutschland import autobahn from deutschland.autobahn.api import default_api autobahn_api_instance = default_api.DefaultApi() try: # Auflistung aller Autobahnen api_response = autobahn_api_instance.list_autobahnen() pprint(api_response) # Details zu einer Ladestation ...
0
0
0
0
0
0
common/utils/manopth/test/test_demo.py
Alan-delete/I2L-MeshNet_RELEASE
544
141233
import torch from manopth.demo import generate_random_hand def test_generate_random_hand(): batch_size = 3 hand_info = generate_random_hand(batch_size=batch_size, ncomps=6) verts = hand_info['verts'] joints = hand_info['joints'] assert verts.shape == (batch_size, 778, 3) assert joints.shape =...
0
0
0
0
0
0
mode/examples/Contributed Libraries in Python/OpenCV/FindEdges/FindEdges.pyde
timgates42/processing.py
1,224
141247
add_library('opencv_processing') src = loadImage("test.jpg") size(src.width, src.height, P2D) opencv = OpenCV(this, src) opencv.findCannyEdges(20, 75) canny = opencv.getSnapshot() opencv.loadImage(src) opencv.findScharrEdges(OpenCV.HORIZONTAL) scharr = opencv.getSnapshot() opencv.loadImage(src) opencv.findSobelEdge...
0
0
0
0
0
0
dragonfly/gp/mf_gp.py
hase1128/dragonfly
675
141248
<reponame>hase1128/dragonfly """ Implements the kernel, GP and fitter for multi-fidelity GPs. --<EMAIL> """ from __future__ import division # pylint: disable=invalid-name # pylint: disable=abstract-class-not-used # Local imports from . import kernel as gp_kernel from .gp_core import GP, GPFitter, mandatory_gp_arg...
0
0
0
0
0
0
html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/resources/slow.py
meyerweb/wpt
14,668
141261
# Like /common/slow.py except with text/html content-type so that it won't # trigger strange parts of the <iframe> navigate algorithm. import time def main(request, response) -> tuple[int, list[list[str]], bytes]: time.sleep(2) return 200, [["Content-Type", "text/html"]], b''
0
1
0
0
1
0
bmemcached/__init__.py
alexmv/python-binary-memcached
103
141265
__all__ = ('Client', 'ReplicatingClient', 'DistributedClient', ) from bmemcached.client import Client, ReplicatingClient, DistributedClient
0
0
0
0
0
0
SPOJ/Random/ONEZERO/test.py
VastoLorde95/Competitive-Programming
170
141279
mx = 0 for i in xrange(1, 100): j = 1 while True: num = i * j s = str(num) if s.count('1') + s.count('0') == len(s): mx = max(mx, j) break j += 1 print mx
0
0
0
0
0
0
bscan/config.py
netsec/bscan
229
141302
<gh_stars>100-1000 """Configuration initialization and handling.""" import os import re import shutil import sys import toml from argparse import ( Namespace) from collections import ( namedtuple) from pkg_resources import ( resource_string) from typing import ( Optional) from bscan.errors import ( ...
0
0
0
0
0
0
SoftLayer/CLI/order/lookup.py
dvzrv/softlayer-python
126
141324
<gh_stars>100-1000 """Provides some details related to the order.""" # :license: MIT, see LICENSE for more details. import click from SoftLayer.CLI.account.invoice_detail import get_invoice_table from SoftLayer.CLI import environment from SoftLayer.CLI import formatting from SoftLayer.managers import ordering from S...
0
0
0
0
0
0
openbb_terminal/stocks/options/calculator_model.py
tehcoderer/GamestonkTerminal
255
141338
<gh_stars>100-1000 """Calculator Model""" ___docformat__ = "numpy" import logging from typing import Dict, Tuple import numpy as np from openbb_terminal.decorators import log_start_end logger = logging.getLogger(__name__) @log_start_end(log=logger) def pnl_calculator( strike: float, premium: float, put: bool,...
0
0
0
0
0
0
scvelo/plotting/simulation.py
WeilerP/scvelo
272
141358
<reponame>WeilerP/scvelo import numpy as np import matplotlib.pyplot as pl from matplotlib import rcParams from scvelo.core import SplicingDynamics from scvelo.tools.dynamical_model_utils import get_vars, tau_inv, unspliced, vectorize from .utils import make_dense def get_dynamics(adata, key="fit", extrapolate=Fals...
0
0
0
0
0
0
keras/caffe/models/segmentation/test_segmentation.py
lvapeab/keras
259
141377
""" author: <NAME> (https://github.com/akshaychawla) TEST:rs Test convert.py's ability to handle Deconvolution and Crop laye by converting voc-fcn8s .prototxt and .caffemodel present in the caffe/models/segmentation folder """ # import os # import inspect # import numpy as np # import keras.caffe.convert as convert # f...
0
0
0
0
0
0
.github/workflows/update_init_el.py
jstranik/nix-doom-emacs
220
141406
<filename>.github/workflows/update_init_el.py #!/usr/bin/env python3 import sys from difflib import unified_diff from os import environ as env from typing import cast from github import Github from github.ContentFile import ContentFile from github.GithubException import GithubException from github.Repository import Re...
0
0
0
0
0
0
tests/notebooks/mirror/ipynb_to_hydrogen/nteract_with_parameter.py
st--/jupytext
5,378
141416
# --- # jupyter: # kernel_info: # name: python3 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # %% outputHidden=false inputHidden=false tags=["parameters"] param = 4 # %% outputHidden=false inputHidden=false import pandas as pd # %% outputHidden=false inputHidden...
0
0
0
0
0
0
bin/sam_to_psl.py
baraaorabi/flair
139
141435
#!/usr/bin/env python3 import sys, csv, re, os try: sam = open(sys.argv[1]) outfilename = sys.argv[2] if len(sys.argv) > 3: if sys.argv[3] == 'quick': quick = True chromsizefile = '' else: quick = False chromsizefile = sys.argv[3] else: chromsizefile = '' quick = False except:...
0
0
0
0
0
0
test/test_mount.py
ltmix-web/bottle
6,086
141440
<reponame>ltmix-web/bottle # -*- coding: utf-8 -*- import bottle from .tools import ServerTestBase from bottle import response class TestAppMounting(ServerTestBase): def setUp(self): ServerTestBase.setUp(self) self.subapp = bottle.Bottle() @self.subapp.route('/') @self.subapp.route...
0
0
0
0
0
0
utils/data_manager.py
stu1130/deeplearning-benchmark
131
141452
<reponame>stu1130/deeplearning-benchmark import os def getImagenetData(dataset): if dataset == 'imagenet' or dataset == 'imagenet-256px-q90': os.system('mkdir -p data') if not os.path.exists('./data/imagenet1k-train.rec'): os.system("aws s3 cp s3://imagenet-rec/imagenet1k-train.rec dat...
0
0
0
0
0
0
backend/app/app/api/api_v1/router/home/__init__.py
PY-GZKY/Tplan
121
141463
<reponame>PY-GZKY/Tplan from .index import router
0
0
0
0
0
0
solidity/python/PerformanceExpTestCross.py
surzm/contracts-solidity
200
141480
<filename>solidity/python/PerformanceExpTestCross.py import Web3Wrapper import InputGenerator MINIMUM_VALUE_BALANCE = 100 MAXIMUM_VALUE_BALANCE = 10 ** 34 GROWTH_FACTOR_BALANCE = 2.5 MINIMUM_VALUE_WEIGHT = 100000 MAXIMUM_VALUE_WEIGHT = 900000 GROWTH_FACTOR_WEIGHT = 1.5 MINIMUM_VALUE_AMOUNT = 1 MAXIMUM_VALUE_AMOUNT ...
0
0
0
0
0
0
audiomate/annotations/label.py
CostanzoPablo/audiomate
133
141481
<reponame>CostanzoPablo/audiomate<gh_stars>100-1000 import copy from functools import total_ordering @total_ordering class Label: """ Represents a label that describes some part of an utterance. Args: value (str): The text of the label. start (float): Start of the label within the utteran...
0
0
0
0
0
0
vega/quota/quota_affinity.py
This-50m/vega
724
141485
# -*- coding:utf-8 -*- # Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved. # This program is free software; you can redistribute it and/or modify # it under the terms of the MIT License. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the ...
0
5
0
0
5
0
server/src/protobuf/protobuf-2.6.1/python/google/protobuf/internal/message_test.py
Steven0917/TT
2,151
141492
<reponame>Steven0917/TT<filename>server/src/protobuf/protobuf-2.6.1/python/google/protobuf/internal/message_test.py #! /usr/bin/python # # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use i...
0
0
0
0
0
0
tensorflow/python/ops/control_flow_v2_func_graphs.py
EricRemmerswaal/tensorflow
190,993
141501
<reponame>EricRemmerswaal/tensorflow<gh_stars>1000+ # Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org...
0
0
0
0
0
0
jenkins_job_wrecker/__init__.py
chenhuahuan/jenkins-job-wrecker
210
141507
__version__ = '1.7.1'
0
0
0
0
0
0
tests/test_socfaker_timestamp.py
priamai/soc-faker
122
141517
<reponame>priamai/soc-faker def test_socfaker_timestamp_in_the_past(socfaker_fixture): assert socfaker_fixture.timestamp.in_the_past() def test_socfaker_timestamp_in_the_future(socfaker_fixture): assert socfaker_fixture.timestamp.in_the_future() def test_socfaker_timestamp_current(socfaker_fixture): asser...
0
0
0
0
0
0
xfel/cxi/cspad_ana/xes_faster_histograms.py
dperl-sol/cctbx_project
155
141528
from __future__ import annotations """Specialized version of xes_histograms. 1) no support for background region of interest 2) photon_counting method only; uses integrated area under 1-photon Gaussian 3) no support for >1 photon 4) no multiprocessing 5) no output of gain map; no input gain correction 6) Fixed constrai...
13
9
0
1
23
0
sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/models/__init__.py
rsdoherty/azure-sdk-for-python
2,728
141548
# 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 may ...
0
0
0
0
0
0
ml_editor/model_evaluation.py
VestiDev/ml-powered-applications-2020-book
542
141579
<filename>ml_editor/model_evaluation.py from sklearn.calibration import calibration_curve from sklearn.metrics import ( confusion_matrix, roc_curve, auc, brier_score_loss, accuracy_score, f1_score, precision_score, recall_score, ) import matplotlib.pyplot as plt import numpy as np import...
0
0
0
0
0
0
tests/test_options.py
xiaowuhu/sklearn-onnx
323
141588
<filename>tests/test_options.py # SPDX-License-Identifier: Apache-2.0 """ Tests topology. """ import unittest import numpy from sklearn.base import BaseEstimator, TransformerMixin from sklearn import datasets from skl2onnx import to_onnx, update_registered_converter from skl2onnx.algebra.onnx_ops import OnnxIdentity, ...
0
0
0
0
0
0
lib/luxi.py
modulus-sa/ganeti
396
141601
<reponame>modulus-sa/ganeti # # # Copyright (C) 2006, 2007, 2011, 2012, 2013, 2014 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of source code must retain ...
0
0
0
0
0
0
src/obfuscapk/obfuscators/advanced_reflection/advanced_reflection.py
Dado1513/Obfuscapk
688
141616
#!/usr/bin/env python3 import logging import os import re from typing import List, Set from obfuscapk import obfuscator_category from obfuscapk import util from obfuscapk.obfuscation import Obfuscation class AdvancedReflection(obfuscator_category.ICodeObfuscator): def __init__(self): self.logger = loggi...
11
4
8
8
31
0
data_processing/filter_aichallenge2018_only_single_person.py
tucan9389/mobile-pose-estimation-for-TF2
122
141628
<filename>data_processing/filter_aichallenge2018_only_single_person.py import os, json, shutil # coco_annotation_json_path = "/home/centos/datasets/ai_challenger_2018/ai_challenger_keypoint_train_20170909/keypoint_train_annotations_20170909.json" # image_source_dir_path = "/home/centos/datasets/ai_challeng...
0
0
0
0
0
0
Compare Frontmost Fonts/Compare Composites of Two Frontmost Fonts.py
justanotherfoundry/Glyphs-Scripts
283
141642
<reponame>justanotherfoundry/Glyphs-Scripts #MenuTitle: Compare Composites # -*- coding: utf-8 -*- from __future__ import division, print_function, unicode_literals __doc__=""" Reports diverging component structures of composite glyphs, e.g., iacute built with acutecomb in one font, and acutecomb.narrow in the other. "...
0
0
0
0
0
0
PyPortal_EZ_Make_Oven/codecalibrate/code.py
gamblor21/Adafruit_Learning_System_Guides
665
141649
import time import sys import board import busio import digitalio from adafruit_mcp9600 import MCP9600 SENSOR_ADDR = 0X67 i2c = busio.I2C(board.SCL, board.SDA,frequency=200000) try: sensor = MCP9600(i2c,SENSOR_ADDR,"K") except ValueError as e: print(e) print("Unable to connect to the thermocouple sensor."...
1
0
0
0
1
0