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/telemetry/telemetry/value/value_backcompat.py
iplo/Chain
231
12725603
# Copyright 2013 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. """Backward compatibility for old results API. This module helps convert the old PageMeasurementResults API into the new style one. This exists as a bridging...
contrib/conflict_resolution/resolve_interactively.py
telotortium/vdirsyncer
888
12725623
#!/usr/bin/env python3 """Ask user to resolve a vdirsyncer sync conflict interactively. Needs a way to ask the user. The use of https://apps.kde.org/kdialog/ for GNU/Linix is hardcoded. Depends on python>3.5 and KDialog. Usage: Ensure the file executable and use it in the vdirsyncer.conf file, e.g. conflict_res...
04_transformer_tutorial_2nd_part/BERT_tutorial/dataset/wiki_dataset.py
loveagri/a_journey_into_math_of_ml
1,590
12725674
from torch.utils.data import Dataset import tqdm import json import torch import random import numpy as np from sklearn.utils import shuffle class BERTDataset(Dataset): def __init__(self, corpus_path, word2idx_path, seq_len, hidden_dim=384, on_memory=True): # hidden dimension for positional encoding ...
IkaLog.py
fetus-hina/IkaLog
285
12725693
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # IkaLog # ====== # Copyright (C) 2015 <NAME> # # 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/LI...
jill/utils/mount_utils.py
KronosTheLate/jill.py
162
12725710
from tempfile import mkdtemp import os import sys import subprocess import shutil import time class Mounter: def __init__(self, src_path, mount_root="."): self.src_path = src_path self.mount_root = os.path.abspath(mount_root) mount_name = os.path.splitext(os.path.split(self.src_path)[1])[0...
tests/exhaustive/ncaab_tests.py
MArtinherz/sportsipy
221
12725713
<reponame>MArtinherz/sportsipy<gh_stars>100-1000 import sys, os sys.path.append(os.path.dirname(os.path.dirname(sys.path[0]))) from sportsipy.ncaab.conferences import Conferences from sportsipy.ncaab.rankings import Rankings from sportsipy.ncaab.teams import Teams for team in Teams(): print(team.name) for play...
tests/api/inbound_eligibility/test_inbound_eligibility.py
Camille-cmd/python-amazon-sp-api
213
12725732
<filename>tests/api/inbound_eligibility/test_inbound_eligibility.py from sp_api.api import FbaInboundEligibility def test_inbound_eligibility(): res = FbaInboundEligibility().get_item_eligibility_preview(asin='TEST_CASE_200', program="INBOUND") assert res.payload is not None
components/isceobj/IsceProc/runResamp_image.py
vincentschut/isce2
1,133
12725746
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Copyright 2013 California Institute of Technology. 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 th...
tests/test_08_addons/test_815_dxf_browser.py
jkjt/ezdxf
515
12725751
# Copyright (c) 2021, <NAME> # License: MIT License import pytest pytest.importorskip("PySide6") from io import StringIO import math from ezdxf.lldxf.tags import Tags, DXFTag from ezdxf.lldxf.loader import load_dxf_structure from ezdxf.lldxf.tagger import ascii_tags_loader from ezdxf.addons.browser import DXFTagsM...
python/ql/test/experimental/query-tests/Security-new-dataflow/CWE-078-py2/command_injection.py
vadi2/codeql
4,036
12725785
<reponame>vadi2/codeql import os import platform import popen2 from flask import Flask, request app = Flask(__name__) @app.route("/python2-specific") def python2_specific(): """ These tests are mostly included to check for extra paths that can be generated if we can track flow into the implementation of...
docs/components_page/components/progress/progress.py
imrehg/dash-bootstrap-components
776
12725814
import dash_bootstrap_components as dbc progress = dbc.Progress(value=50)
test/compatibility/gpsd_test.py
quiet-oceans/libais
161
12725819
#!/usr/bin/env python """Tests for ais.compatibility.gpsd.""" import ais import ais.compatibility.gpsd import ais.stream import unittest import json import os import re import subprocess import six from .. import testutils known_problems = { 2: set(('turn', 'status_text')), 9: set(['speed']), 15: set(['...
Face-Mask-Detection/Face mask detection using YOLO V4/utility-scripts/count_objs.py
swapnilgarg7/Face-X
175
12725868
import os counts={"0":0,"1":0} for file in os.listdir("./Dataset"): if file.endswith(".txt") and file!='classes.txt': f = open("./Dataset/"+file) lines=f.readlines() for line in lines: counts[''+line[0]]+=1 print(counts)
softdelete/admin/__init__.py
RedMoon32/django-softdelete
242
12725930
<filename>softdelete/admin/__init__.py from softdelete.admin.admin import * from softdelete.admin.forms import * __all__ = ['SoftDeleteObjectAdmin', 'SoftDeleteRecordAdmin', 'ChangeSetAdmin', 'SoftDeleteObjectInline', 'SoftDeleteObjectAdminForm', ]
data/MSCOCO/MSCOCO.py
Qin-Folks/I2L-MeshNet_RELEASE
544
12725945
import os import os.path as osp import numpy as np from config import cfg import copy import json import scipy.io as sio import cv2 import random import math import torch import transforms3d from pycocotools.coco import COCO from utils.smpl import SMPL from utils.preprocessing import load_img, process_bbox, augmentatio...
2015-10_Lecture/Lecture3/code/NER_Keras_with_Caseing.py
hlin117/deeplearning4nlp-tutorial
593
12725973
<filename>2015-10_Lecture/Lecture3/code/NER_Keras_with_Caseing.py<gh_stars>100-1000 # -*- coding: utf-8 -*- import numpy as np import theano import theano.tensor as T import time import gzip import GermEvalReader import GermEvalReader_with_casing import BIOF1Validation import keras from keras.models import Sequenti...
IndicNLP/indicnlp/common.py
Adityashar/Sanskrit-Machine-Translation
432
12725979
# # Copyright (c) 2013-present, <NAME> # All rights reserved. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # import os """ Path to the Indic NLP Resources directory """ INDIC_RESOURCES_PATH='' def init(): """ Initialize ...
old_py2/controllers/main_controller.py
ofekashery/the-blue-alliance
266
12726062
<gh_stars>100-1000 from collections import defaultdict import datetime import logging import webapp2 from google.appengine.api import memcache from google.appengine.ext import ndb import tba_config from base_controller import CacheableHandler from consts.award_type import AwardType from consts.event_type import Event...
manga_py/base_classes/arc_name.py
sonvt1710/manga-py
337
12726073
from abc import abstractmethod, ABCMeta class ArchiveName(metaclass=ABCMeta): _vol_fill = False @abstractmethod def get_chapter_index(self): pass def get_archive_name(self) -> str: idx = self.get_chapter_index() self._vol_fill = True return self.normal_arc_name({'vol'...
pydis_site/apps/home/views/__init__.py
Robin5605/site
700
12726082
from .home import HomeView, timeline __all__ = ["HomeView", "timeline"]
memorious/logic/check.py
Rosencrantz/memorious
265
12726118
import numbers import re from normality import stringify from dateutil.parser import parse class ContextCheck(object): def __init__(self, context): self.context = context def shout(self, msg, strict=False, *args): if strict: raise ValueError(msg % args) else: s...
scripts/popgen/operatorfactory.py
gglin001/poptorch
128
12726131
# Copyright (c) 2020 Graphcore Ltd. All rights reserved from popgen import NonTensorValue, Value, onnx, poptorch from popgen.helpers import empty_initializer # no_tensor_braces(v): # # Modifiers for values that take tensors without initializer list braces # Parameters: # v - the input value def no_tensor_braces(v):...
boto3_type_annotations/boto3_type_annotations/xray/paginator.py
cowboygneox/boto3_type_annotations
119
12726133
from typing import List from typing import Dict from datetime import datetime from botocore.paginate import Paginator class BatchGetTraces(Paginator): def paginate(self, TraceIds: List, PaginationConfig: Dict = None) -> Dict: pass class GetGroups(Paginator): def paginate(self, PaginationConfig: Dict...
veriloggen/dataflow/mul.py
akmaru/veriloggen
232
12726141
<gh_stars>100-1000 from __future__ import absolute_import from __future__ import print_function import veriloggen.core.vtypes as vtypes import veriloggen.core.module as module def mkMultiplierCore(index, lwidth=32, rwidth=32, lsigned=True, rsigned=True, depth=6): if lwidth <= 0: raise ValueError("data wi...
fedot/core/dag/graph_node.py
rozlana-g/FEDOT
358
12726158
from typing import List, Optional, Union from fedot.core.dag.node_operator import NodeOperator class GraphNode: """ Class for node definition in the DAG-based structure :param nodes_from: parent nodes which information comes from :param content: dict for the content in node The possible para...
windowgram/windowgram.py
lion24/tmuxomatic
846
12726171
<filename>windowgram/windowgram.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Copyright 2013-2016, Oxidane All rights reserved This source has NOT yet been licensed for redistribution, modification, or inclusion in other projects. An exception has been granted to the official tmuxomatic project, originating...
syzygy/scripts/benchmark/dromaeo.py
nzeh/syzygy
343
12726173
<reponame>nzeh/syzygy #!python # Copyright 2013 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 ...
tools/isolate/trace_child_process.py
Scopetta197/chromium
212
12726209
<filename>tools/isolate/trace_child_process.py #!/usr/bin/env python # Copyright (c) 2012 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. """Waits for the go signal and replaces itself with the command to be run. Not mean...
docs_src/path_operation_advanced_configuration/tutorial002.py
Aryabhata-Rootspring/fastapi
53,007
12726244
from fastapi import FastAPI from fastapi.routing import APIRoute app = FastAPI() @app.get("/items/") async def read_items(): return [{"item_id": "Foo"}] def use_route_names_as_operation_ids(app: FastAPI) -> None: """ Simplify operation IDs so that generated API clients have simpler function names. ...
notebooks/work-in-progress/2018-10_SceneGraphParsing/train_grapher.py
AnveshAeturi/deep-learning-workshop
486
12726245
<gh_stars>100-1000 import os, sys import argparse import random import time, pytz from datetime import datetime, timezone import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import h5py from torch.utils.data import Dataset from torch.utils.data import DataLoader #from text_utils i...
play-1.2.4/python/Lib/site-packages/Rpyc/Servers/Users.py
AppSecAI-TEST/restcommander
550
12726306
<gh_stars>100-1000 # # chmod this file securely and be sure to remove the default users # users = { "frodo" : "1ring", "yossarian" : "catch22", "ayla" : "jondalar", }
model.py
dhirajpatnaik16297/text-gan-tensorflow
102
12726329
""" Text GAN Adverserial networks applied to language models using Gumbel Softmax. Can be used as pure language model. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import functools from collections import namedtuple import tensorflow as tf from ten...
dialogue-engine/test/programytest/storage/asserts/store/assert_rdfs.py
cotobadesign/cotoba-agent-oss
104
12726346
<reponame>cotobadesign/cotoba-agent-oss """ 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 without limitation the rights to u...
contrib/stack/alosStack/estimate_slc_offset.py
yuankailiu/isce2
1,133
12726373
#!/usr/bin/env python3 # # Author: <NAME> # Copyright 2015-present, NASA-JPL/Caltech # import os import glob import datetime import numpy as np import isce, isceobj import mroipac from mroipac.ampcor.Ampcor import Ampcor from isceobj.Alos2Proc.Alos2ProcPublic import topo from isceobj.Alos2Proc.Alos2ProcPublic import...
ansible/roles/lib_gcloud/build/lib/vminstance.py
fahlmant/openshift-tools
164
12726390
<reponame>fahlmant/openshift-tools # pylint: skip-file # pylint: disable=too-many-instance-attributes class VMInstance(GCPResource): '''Object to represent a gcp instance''' resource_type = "compute.v1.instance" # pylint: disable=too-many-arguments def __init__(self, rname, ...
feature_extract/bresenham_circle.py
chexueji/easy_slam_tutorial
231
12726410
# -*- coding: utf-8 -*- """ Created on Sun Jul 21 15:02:36 2019 Bresenham画圆法实现 博客教程地址: https://blog.csdn.net/varyshare/article/details/96724103 @author: 知乎@Ai酱 """ import numpy as np import matplotlib.pyplot as plt img = np.zeros((105,105)) # 创建一个105x105的画布 count = 0 def draw(x,y): """ 绘制点(x,y) 注意:需要把(x...
goatools/gosubdag/plot/goea_results.py
flying-sheep/goatools
477
12726467
"""Manages GO Term fill colors and bordercolors.""" __copyright__ = "Copyright (C) 2016-2017, <NAME>, <NAME>, All rights reserved." __author__ = "<NAME>" import sys import collections as cx class GoeaResults(object): """Manages GOEA Results for plotting.""" kws_set = set(['id2symbol', 'study_items', 'items...
tests/test_boringdisabled.py
acpaquette/deepstate
684
12726536
<filename>tests/test_boringdisabled.py from __future__ import print_function import logrun import deepstate_base class BoringDisabledTest(deepstate_base.DeepStateTestCase): def run_deepstate(self, deepstate): (r, output) = logrun.logrun([deepstate, "build/examples/BoringDisabled"], "deepstate.o...
examples/experiments/ best_naive_predictor_for_f1_score.py
timothyxp/ppscore
765
12726567
<filename>examples/experiments/ best_naive_predictor_for_f1_score.py # %% [markdown] # ## Determining the best naive predictor for the f1 score # - If there are 2 classes that are skewed, then the most common value is often slightly better than the random guess # - If there are 4 classes that are skewed, then the rando...
safety/managers.py
ulule/django-safety
157
12726569
<reponame>ulule/django-safety # -*- coding: utf-8 -*- from django.db import models, transaction, IntegrityError from django.utils.timezone import now from . import app_settings from . import utils class PasswordChangeManager(models.Manager): def get_or_create_for_user(self, user): return self.get_or_crea...
mjml/__init__.py
stenius/django-mjml
199
12726597
<filename>mjml/__init__.py __version__ = '0.11.0' default_app_config = 'mjml.apps.MJMLConfig'
examples/jina_example/app.py
procedure2012/RocketQA
210
12726668
import sys import os import webbrowser from pathlib import Path from jina import Document, Flow def config(): os.environ.setdefault('JINA_USE_CUDA', 'False') os.environ.setdefault('JINA_PORT_EXPOSE', '8886') os.environ.setdefault('JINA_WORKSPACE', './workspace') def index(file_name): def load_marco(...
__scraping__/nhle.com - requests, JSON/main.py
furas/python-code
140
12726691
<reponame>furas/python-code<gh_stars>100-1000 # author: Bartlomiej "furas" Burek (https://blog.furas.pl) # date: 2021.12.01 # # title: Scrape for Table with Limits # url: https://stackoverflow.com/questions/70179298/scrape-for-table-with-limits/70180875#70180875 # [Scrape for Table with Limits](https://stackoverflow....
text_extensions_for_pandas/array/arrow_conversion.py
ZachEichen/text-extensions-for-pandas
193
12726699
# # Copyright (c) 2020 IBM Corp. # 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 writi...
src/encode_lib_log_parser.py
motorny/chip-seq-pipeline2
261
12726761
#!/usr/bin/env python """ ENCODE QC log parser wrapper which converts a log file into a dict Author: <NAME> (<EMAIL>) """ from collections import OrderedDict MAP_KEY_DESC_FRAC_MITO_QC = { 'non_mito_reads': 'Rn = Number of Non-mitochondrial Reads', 'mito_reads': 'Rm = Number of Mitochondrial Reads', 'fra...
tests/extensions/redash-dummy/redash_dummy/extension.py
zero1number/redash
20,680
12726812
<reponame>zero1number/redash<gh_stars>1000+ module_attribute = "hello!" def extension(app): """This extension will work""" return "extension loaded" def assertive_extension(app): """This extension won't work""" assert False
packages/vaex-astro/vaex/astro/astropy_table.py
sethvargo/vaex
337
12726853
<filename>packages/vaex-astro/vaex/astro/astropy_table.py import numpy as np from vaex.dataset import DatasetArrays from vaex.dataset_misc import _try_unit class DatasetAstropyTable(DatasetArrays): def __init__(self, filename=None, format=None, table=None, **kwargs): self.ucds = {} self.units = {}...
src/oci/apm_synthetics/models/monitor_configuration.py
Manny27nyc/oci-python-sdk
249
12726868
<filename>src/oci/apm_synthetics/models/monitor_configuration.py # coding: utf-8 # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 ...
src/nap/rpc/client.py
timgates42/django-nap
114
12726892
<filename>src/nap/rpc/client.py import json import requests class RPCProxy: def __init__(self, client, name): self.client = client self.name = name def __call__(self, **kwargs): resp = self.client.session.post( self.client.endpoint, data=json.dumps(kwargs), ...
test/test.py
stonewell/pymterm
102
12726929
<filename>test/test.py # -*- coding: utf8 -*- import os os.environ['PYGAME_FREETYPE'] = '1' import pygame import pygame.freetype pygame.init() #font = pygame.freetype.SysFont('Menlo Regular', 13) font = pygame.freetype.Font('c:\\github\\pymterm\\data\\fonts\\wqy-microhei-mono.ttf', 13) #font = pygame.font.Font('c:\\g...
RecoBTag/Skimming/python/btagMC_QCD_380_470_cfi.py
ckamtsikis/cmssw
852
12726988
<gh_stars>100-1000 import FWCore.ParameterSet.Config as cms btagMC_QCD_380_470 = cms.EDFilter("BTagSkimMC", mcProcess = cms.string('QCD'), pthat_min = cms.double(380.0), verbose = cms.untracked.bool(False), pthat_max = cms.double(470.0) )
fum/tests.py
jsavikko/futurice-ldap-user-manager
111
12726998
<reponame>jsavikko/futurice-ldap-user-manager import sshpubkeys import unittest class UtilTestCase(unittest.TestCase): def test_ssh_key_bits_and_fingerprint(self): with self.assertRaises(sshpubkeys.InvalidKeyException): sshpubkeys.SSHKey('an invalid key string') valid_ssh_key = 'ssh-...
Chapter01/01_reading_image.py
debojyoti007/OpenCV
105
12727010
<gh_stars>100-1000 import cv2 img = cv2.imread('./images/input.jpg') cv2.imshow('Input image', img) cv2.waitKey()
zeus/web/hooks/base.py
conrad-kronos/zeus
221
12727025
from flask import current_app, jsonify, request, Response from flask.views import View from sqlalchemy.orm import joinedload from zeus import auth from zeus.api.resources.base import ApiHelpers from zeus.config import nplusone from zeus.constants import Permission from zeus.exceptions import ApiError from zeus.models ...
demo/dygraph/quant/optimizer.py
ZichaoGuo/PaddleSlim
926
12727044
<filename>demo/dygraph/quant/optimizer.py # copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. # # 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/...
autoPyTorch/core/autonet_classes/autonet_image_classification_multiple_datasets.py
mens-artis/Auto-PyTorch
1,657
12727094
<gh_stars>1000+ from autoPyTorch.core.autonet_classes.autonet_image_classification import AutoNetImageClassification class AutoNetImageClassificationMultipleDatasets(AutoNetImageClassification): preset_folder_name = "image_classification_multiple_datasets" @classmethod def get_default_pipeline(cls): ...
Wrapping/Python/vtkmodules/test/ErrorObserver.py
cclauss/VTK
1,755
12727103
<gh_stars>1000+ from vtkmodules.vtkCommonCore import vtkCommand class vtkErrorObserver(object): def __init__(self): self.CallDataType = 'string0' self.reset() def __call__(self, caller, event, data): if event == 'ErrorEvent': self._error_message = data elif event =...
cort/coreference/multigraph/features.py
leonardoboliveira/cort
141
12727104
<gh_stars>100-1000 import re from cort.core import external_data from cort.core import spans from cort.core import util __author__ = 'smartschat' def not_singleton(anaphor, antecedent): singleton_data = external_data.SingletonMentions.get_instance() anaphor = " ".join(anaphor.attributes["tokens"]) ante...
server.py
tongplw/SentimentAnalysis
298
12727139
<filename>server.py from flask import Flask, jsonify, request from flask_cors import CORS import torch from transformers import AutoTokenizer, AutoConfig from modeling import BertForSentimentClassification, AlbertForSentimentClassification, DistilBertForSentimentClassification from arguments import args app = Flask(_...
glumpy/app/parser.py
Frekby/glumpy
1,074
12727166
# ----------------------------------------------------------------------------- # Copyright (c) 2009-2016 <NAME>. All rights reserved. # Distributed under the (new) BSD License. # ----------------------------------------------------------------------------- """ Default argument parser for any glumpy program. """ import...
src/ddpg/actor_net.py
jimkon/Deep-Reinforcement-Learning-in-Large-Discrete-Action-Spaces
154
12727188
import numpy as np import tensorflow as tf import math LEARNING_RATE = 0.0001 BATCH_SIZE = 64 TAU = 0.001 class ActorNet: """ Actor Network Model of DDPG Algorithm """ def __init__(self, num_states, num_actions): self.g = tf.Graph() with self.g.as_default(): self.sess = tf.Intera...
templates/powershell/ps_external_ip.py
ohoph/Ebowla
738
12727190
buildcode=""" function Get-ExternalIP(){ $extern_ip_mask = @() while ($response.IPAddress -eq $null){ $response = Resolve-DnsName -Name myip.opendns.com -Server resolver1.opendns.com Start-Sleep -s 1 } $octet1, $octet2, $octet3, $octet4 = $response.IPAddress.Split(".") $extern_ip_mask += $response.IPAddress ...
transformers4rec/data/testing/tabular_data/dataset.py
Jwmc999/Transformers4Rec
415
12727205
import pathlib from transformers4rec.data.dataset import ParquetDataset tabular_testing_data: ParquetDataset = ParquetDataset(pathlib.Path(__file__).parent)
src/ai-examples/azext_ai_examples/_help.py
Mannan2812/azure-cli-extensions
207
12727229
<filename>src/ai-examples/azext_ai_examples/_help.py # 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. # ...
hover/core/representation/manifold.py
haochuanwei/hover
251
12727234
<reponame>haochuanwei/hover """ Manifold similarity measures for any collection of sequences of vectors. Can be useful for improved interpretability of neural nets. """ from .reduction import DimensionalityReducer from tqdm import tqdm from scipy.spatial import procrustes from hover.core import Loggable DEFAULT_UMAP_P...
Operators/ExampleFaceParsingOperator/FaceParsingOperator.py
Caius-Lu/Savior
108
12727236
from abc import ABC import cv2 import numpy as np from Operators.DummyAlgorithmWithModel import DummyAlgorithmWithModel from Utils.GeometryUtils import center_pad_image_with_specific_base, \ resize_with_long_side, force_convert_image_to_bgr, correct_face_orientation from Utils.InferenceHelpers import TritonInfere...
lib/python/pack2/parser.py
leozz37/makani
1,178
12727238
# Copyright 2020 Makani Technologies 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...
scripts/python/break-contigs-vs-truth.py
benjeffery/mccortex
104
12727271
#!/usr/bin/env python from __future__ import print_function try: input = raw_input except: pass # usage: python break-contigs-vs-truth.py <k> [input.txt] # input.txt: # <master> :string # <query1> :string # <query2> :string # ... # # Output: # <contig-id> <ref-strand> <ref-start> <contig-substr> # ... # # For ea...
server/common/config/__init__.py
andrewsu/cellxgene
403
12727302
DEFAULT_SERVER_PORT = 5005 BIG_FILE_SIZE_THRESHOLD = 100 * 2 ** 20 # 100MB
bin/license_finder_pip.py
nitram509/LicenseFinder
1,039
12727305
#!/usr/bin/env python import json import sys try: from pip._internal.req import parse_requirements except ImportError: from pip.req import parse_requirements try: # since pip 19.3 from pip._internal.network.session import PipSession except ImportError: try: # since pip 10 f...
modules/intelligence-gathering/asm.py
decidedlygray/ptf
4,391
12727335
#!/usr/bin/env python ####################################### # Installation module for AttackSurfaceMapper ####################################### DESCRIPTION="This module will install/update Attack Surface Mapper (ASM) by Andreas Georgiou - A tool that aim to automate the recon process" AUTHOR="<NAME>" INSTALL_TYP...
py/agentflow/meta_options/control_flow/examples/simple_insertion.py
wx-b/dm_robotics
128
12727336
# Copyright 2020 DeepMind Technologies Limited. # # 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...
maro/cli/data_pipeline/vm_scheduling.py
yangboz/maro
598
12727384
import gzip import os import shutil import time from csv import reader, writer from typing import List import aria2p import pandas as pd from yaml import safe_load from maro.cli.data_pipeline.base import DataPipeline, DataTopology from maro.cli.data_pipeline.utils import StaticParameter, convert, download_file from m...
testing-tools/lxml-ast.py
philippeitis/roxmltree
228
12727397
<reponame>philippeitis/roxmltree #!/usr/bin/env python3 import sys from lxml import etree def escape_text(text): return text.encode('unicode_escape').decode("utf-8") def split_qname(name): if name[0] == '{': return name[1:].split('}') else: return [None, name] def print_ind(depth, *ar...
examples/03_Batching/simple_batching_client.py
ryanleary/tensorrt-laboratory
226
12727404
import grpc import simple_pb2 import simple_pb2_grpc def run(): with grpc.insecure_channel('localhost:50051') as channel: stub = simple_pb2_grpc.InferenceStub(channel) def requests(): messages = [simple_pb2.Input(batch_id=i) for i in range(10)] for msg in messages: ...
app/utils/throttle.py
kenmingwang/ASoulCnki
384
12727441
from datetime import datetime from urllib.parse import urlparse class Throttle: def __init__(self, delay): self.domains = {} # 可以放到数据库中 self.delay = delay # 两次间隔下载间隔 def wait_url(self, url_str): # 以netloc为基础进行休眠 domain_url = urlparse(url_str).netloc last_accessed = s...
geocode_sqlite/__init__.py
noslouch/geocode-sqlite
222
12727479
from .utils import geocode_table
evaluate/multipose_keypoint_val.py
nguyenbaviet/MultiPoseNet
203
12727504
import os, sys root_path = os.path.realpath(__file__).split('/evaluate/multipose_keypoint_val.py')[0] os.chdir(root_path) sys.path.append(root_path) from training.batch_processor import batch_processor from network.posenet import poseNet from datasets.coco import get_loader from evaluate.tester import Tester # Hyper-...
tests/test_schedule.py
skrytebane/meinheld
1,186
12727507
<gh_stars>1000+ from base import * import requests ASSERT_RESPONSE = b"Hello world!" RESPONSE = [b"Hello ", b"world!"] class App(BaseApp): environ = None def __call__(self, environ, start_response): status = '200 OK' response_headers = [('Content-type','text/plain')] start_response(s...
data/transforms/build.py
livestockai/CVWC2019-Amur-Tiger-Re-ID
109
12727514
# encoding: utf-8 """ @author: loveletter @contact: <EMAIL> """ import torchvision.transforms as T from .transforms import RandomErasing def build_transforms(cfg, is_train=True): normalize_transform = T.Normalize(mean=cfg.INPUT.PIXEL_MEAN, std=cfg.INPUT.PIXEL_STD) if is_train: transform_ = T.Compos...
vlcp/service/utils/autoload.py
hubo1016/vlcp
252
12727520
<reponame>hubo1016/vlcp ''' Created on 2016/5/27 :author: hubo ''' from vlcp.server.module import Module, ModuleLoadStateChanged from vlcp.config.config import defaultconfig import pkgutil @defaultconfig class AutoLoad(Module): ''' Auto load some modules from a package. Usually used to load network plugins. ...
stochastic/processes/continuous/wiener.py
zaczw/stochastic
268
12727527
"""Wiener process.""" from stochastic.processes.continuous.brownian_motion import BrownianMotion class WienerProcess(BrownianMotion): """Wiener process, or standard Brownian motion. .. image:: _static/wiener_process.png :scale: 50% :param float t: the right hand endpoint of the time interval :ma...
root/src/log.py
tensorlang/nao
332
12727575
<gh_stars>100-1000 from tensorflow.python.framework import dtypes import sys from nao.run import graph_summary def eprint(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) def LogWithStep(summary_protobuf, global_step) -> dtypes.int64: graph_summary.get_summary_writer().add_summary(summary_protobuf, glo...
src/acrtransfer/azext_acrtransfer/_client_factory.py
Mannan2812/azure-cli-extensions
207
12727623
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
river/tests/admin.py
JohnieBraaf/django-river
705
12727647
<gh_stars>100-1000 from django.contrib import admin from django.contrib.admin import ModelAdmin from river.tests.models import BasicTestModel class BasicTestModelAdmin(ModelAdmin): pass admin.site.register(BasicTestModel, BasicTestModelAdmin)
util/__init__.py
SebastianoF/pyro2
151
12727649
"""This module provides utility functions for pyro""" __all__ = ['runparams', 'profile', 'plot_tools']
python/fserver.py
VMAJSTER/cloudfire
194
12727654
#!/usr/bin/env python # # Be a Fast CGI server, running on a localhost port. # import click, redis, os, sys from flup.server.fcgi import WSGIServer class MyWSGIServer(WSGIServer): # See .../flup/server/fcgi_base.py for original version debug = False # just in case def error(self, req): ...
tests/python/twitter/common/rpc/finagle/test_span.py
zhouyijiaren/commons
1,143
12727659
# ================================================================================================== # Copyright 2011 Twitter, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
networks/keras/examples/imdb_cnn.py
redoclag/plaidml
4,535
12727711
'''This example demonstrates the use of Convolution1D for text classification. Gets to 0.89 test accuracy after 2 epochs. 90s/epoch on Intel i5 2.4Ghz CPU. 10s/epoch on Tesla K40 GPU. ''' from __future__ import print_function import numpy as np import keras.callbacks from keras.preprocessing import sequence from ke...
jmetal/util/test/test_constraint_handling.py
12yuens2/jMetalPy
335
12727727
import unittest from jmetal.core.solution import Solution from jmetal.util.constraint_handling import is_feasible, number_of_violated_constraints, \ overall_constraint_violation_degree, feasibility_ratio class ConstraintHandlingTestCases(unittest.TestCase): def test_should_is_feasible_return_true_if_the_sol...
lib/galaxy/webapps/base/api.py
rhpvorderman/galaxy
1,085
12727746
<filename>lib/galaxy/webapps/base/api.py from fastapi import FastAPI, Request from fastapi.exceptions import RequestValidationError from fastapi.responses import JSONResponse from starlette.responses import Response try: from starlette_context.middleware import RawContextMiddleware from starlette_context.plugin...
Python/random/generate_number_image.py
saneravi/ML_Stuff
209
12727756
<reponame>saneravi/ML_Stuff<gh_stars>100-1000 #!/usr/bin/env python """ Generate an image where the x-axis is the seed, the y-axis is the random number. """ # core modules import random import click import imageio import javarandom # 3rd party import numpy as np from numpy.random import MT19937, SFC64, Generator, Ph...
up/tasks/distill/models/utils.py
ModelTC/EOD
196
12727775
import torch from up.tasks.det.models.utils.assigner import map_rois_to_level from up.tasks.det.models.utils.bbox_helper import ( clip_bbox, filter_by_size ) def mlvl_extract_roi_features(rois, x_features, fpn_levels, fpn_strides, base_scale, roi_extractor, ...
boto3_type_annotations/boto3_type_annotations/application_autoscaling/client.py
cowboygneox/boto3_type_annotations
119
12727843
<reponame>cowboygneox/boto3_type_annotations 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): ...
AIPacman/Algorithm_1/Algorithm_1_v2/demo.py
sanmusane/AIGames
543
12727865
<reponame>sanmusane/AIGames ''' Function: show the effect of trained model used in game Author: Charles 微信公众号: Charles的皮卡丘 ''' import torch import config from nets.nets import DQNet, DQNAgent from gameAPI.game import GamePacmanAgent '''run demo''' def runDemo(): if config.operator == 'ai': game_pacman_agent = G...
sphinx-sources/Examples/Commands/AperturesandScreens2.py
jccmak/lightpipes
132
12727927
<filename>sphinx-sources/Examples/Commands/AperturesandScreens2.py from LightPipes import * import matplotlib.pyplot as plt GridSize = 10*mm GridDimension = 256 lambda_ = 1000*nm #lambda_ is used because lambda is a Python build-in function. R=2.5*mm #Radius of the aperture xs=1*mm; ys=1*mm#shift of the aperture Fie...
test/test_cpu_stat.py
cuongnguyen2190/pure-python-adb
382
12727957
<reponame>cuongnguyen2190/pure-python-adb def test_get_cpu_times(device): result = device.cpu_times() assert result is not None def test_get_cpu_percent(device): percent = device.cpu_percent(interval=1) assert percent is not None assert percent != 0 def test_get_cpu_count(device): assert devic...
SubCircuits/gain_stage.py
pingdynasty/KlonCentaur
210
12727971
import numpy as np from numpy.polynomial import polynomial as poly import scipy.signal as signal import matplotlib.pyplot as plt # Component values GAIN = 1.0 R6 = 10e3 Ra = 100e3 * GAIN R10b = 2e3 + 100e3 * (1-GAIN) R11 = 15e3 R12 = 422e3 C3 = 0.1e-6 C5 = 68e-9 C7 = 82e-9 C8 = 390e-12 a0s = C7 * C8 * R10b * R11 *...
tests/generic/generators.py
dubesar/model_bakery
448
12728001
def gen_value_string(): return 'value'
opennmt/tests/sequence_tagger_test.py
gcervantes8/OpenNMT-tf
1,363
12728003
<gh_stars>1000+ import numpy as np import tensorflow as tf from opennmt.models import sequence_tagger class SequenceTaggerTest(tf.test.TestCase): def _testTagSchemeFlags( self, tag_fn, labels, predicted, expected_true_positives, expected_false_positives, ex...