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
tools/gnc_visualizer/dds/writer.py
limenutt/astrobee
629
3295740
<gh_stars>100-1000 ############################################################################## # Copyright (c) 2005-2015 Real-Time Innovations, Inc. All rights reserved. # Permission to modify and use for internal purposes granted. # This software is provided "as is", without warranty, express or implied. ##########...
0
0
0
0
0
0
tests/unit/test_util.py
CCXXXI/redisgraph-py
141
3295750
from redisgraph import util from tests.utils import base class TestUtils(base.TestCase): def test_random_string(self): self.assertEqual(10, len(util.random_string())) self.assertEqual(5, len(util.random_string(length=5))) def test_quote_string(self): self.assertEqual(util.quote_str...
0
0
0
0
0
0
heat/tests/openstack/neutron/test_neutron_trunk.py
stackriot/heat
265
3295755
<gh_stars>100-1000 # Copyright 2017 Ericsson # # 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...
0
0
0
0
0
0
tests/gdb_memory_map_loader.py
ispras/avatar2
415
3295762
import os import subprocess from avatar2 import * filename = "a.out" GDB_PORT = 1234 # This is a bare minimum elf-file, gracefully compiled from # https://github.com/abraithwaite/teensy tiny_elf = ( b"\x7f\x45\x4c\x46\x02\x01\x01\x00\xb3\x2a\x31\xc0\xff\xc0\xcd\x80" b"\x02\x00\x3e\x00\x01\x00\x00\x00\x08\x00...
0
0
0
0
0
0
11_mobilenetv2/01_mobilenet_v2_1.0_224/01_float32/00_replace_input.py
khanfarhan10/PINTO_model_zoo
1,529
3295829
<gh_stars>1000+ import tensorflow as tf from tensorflow.tools.graph_transforms import TransformGraph with tf.compat.v1.Session() as sess: # shape=[1, ?, ?, 3] -> shape=[1, 224, 224, 3] # name='image' specifies the placeholder name of the converted model inputs = tf.compat.v1.placeholder(tf.float32, shape=...
0
0
0
0
0
0
hermione/module_templates/__NOT_IMPLEMENTED_BASE__/src/ml/analysis/hypothesis_autopilot.py
karenstemartins/hermione
183
3295837
<filename>hermione/module_templates/__NOT_IMPLEMENTED_BASE__/src/ml/analysis/hypothesis_autopilot.py import pandas as pd import numpy as np import operator import warnings from ml.analysis.hypothesis_testing import HypothesisTester class HTestAutoPilot: """ Chooses what is the most adequate hypothesis test fo...
0
0
0
0
0
0
static/tutorials/slim/quant/image_classification/paddlelite_export.py
cheneyveron/PaddleX
3,655
3295856
<gh_stars>1000+ # 需先安装paddlelite import paddlelite.lite as lite model_filename = 'server_mobilenet/__model__' params_filename = 'server_mobilenet/__params__' export_filename = 'mobilenetv2' opt = lite.Opt() # 将正常模型导出为Lite模型 opt.run_optimize("", model_filename, params_filename, 'naive_buffer', 'arm', ...
0
0
0
0
0
0
src/ezdxf/explode.py
jkjt/ezdxf
515
3295869
# Copyright (c) 2020-2021, <NAME> # License: MIT License import logging from typing import ( TYPE_CHECKING, Iterable, Callable, Optional, cast, Dict, List, Any, ) from ezdxf.entities import factory from ezdxf.entities.boundary_paths import ( PolylinePath, EdgePath, LineEdge,...
12
10
2
0
24
0
luminoth/tools/dataset/readers/object_detection/taggerine.py
jsdussanc/luminoth
2,584
3295875
<gh_stars>1000+ import collections import json import os import six import tensorflow as tf from PIL import Image from luminoth.tools.dataset.readers import InvalidDataDirectory from luminoth.tools.dataset.readers.object_detection import ( ObjectDetectionReader ) from luminoth.utils.dataset import read_image VA...
0
0
0
0
0
0
rlzoo/algorithms/pg/run_pg.py
integral-ai/RLzoo
750
3295881
from rlzoo.algorithms.pg.pg import PG from rlzoo.common.policy_networks import * import gym """ load environment """ env = gym.make('CartPole-v0').unwrapped # env = gym.make('Pendulum-v0').unwrapped # env = DummyVecEnv([lambda: env]) # The algorithms require a vectorized/wrapped environment to run obs_space =...
0
0
0
0
0
0
torchdistill/datasets/sample_loader.py
AhmedHussKhalifa/torchdistill
576
3295900
<gh_stars>100-1000 from io import BytesIO from PIL import Image from torchdistill.common.constant import def_logger logger = def_logger.getChild(__name__) SAMPLE_LOADER_CLASS_DICT = dict() SAMPLE_LOADER_FUNC_DICT = dict() def register_sample_loader_class(cls): SAMPLE_LOADER_CLASS_DICT[cls.__name__] = cls ...
0
0
0
0
0
0
actions/get_deployment_statuses.py
kingsleyadam/stackstorm-github
164
3295931
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
0
1
0
0
1
0
learnpy_ecourse/class3/ex3_show_ip_int_brief.py
fallenfuzz/pynet
528
3295943
<filename>learnpy_ecourse/class3/ex3_show_ip_int_brief.py #!/usr/bin/env python ''' Disclaimer - This is a solution to the below problem given the content we have discussed in class. It is not necessarily the best solution to the problem. In other words, I only use things we have covered up to this point in the class...
0
0
0
0
0
0
base/site-packages/redis_model/models/mfilter.py
edisonlz/fastor
285
3295945
#encoding = utf-8 """ Handles the queries. """ import os,sys import types from redis_client import RedisClient #加载配置 import setting from setting import logger from datetime import datetime # Model Set class ModelSet(object): def __init__(self, model_class): """ initialize the model class an...
0
0
0
0
0
1
distribuuuu/models/botnet.py
zhiiker/distribuuuu
160
3295957
""" Bottleneck Transformers for Visual Recognition. adapted from https://github.com/CandiceD17/Bottleneck-Transformers-for-Visual-Recognition """ import torch from einops import rearrange from torch import einsum, nn try: from distribuuuu.models import resnet50 except ImportError: from torchvision.models impor...
19
9
0
0
28
0
Face Reconstruction/3D Face Reconstruction with Weakly-Supervised Learning/utils.py
swapnilgarg7/Face-X
175
3296001
<filename>Face Reconstruction/3D Face Reconstruction with Weakly-Supervised Learning/utils.py import torch import numpy as np class LeastSquares: # https://github.com/pytorch/pytorch/issues/27036 def __init__(self): pass def lstq(self, A, Y, lamb=0.0): """ Differentiable least squ...
0
0
0
0
0
0
test/unit/master/test_cluster_runner_config.py
rsennewald/ClusterRunner
164
3296042
from genty import genty, genty_dataset import sys from app.master.atomizer import Atomizer from app.master.job_config import ConfigValidationError from app.master.cluster_runner_config import ClusterRunnerConfig, ConfigParseError from test.framework.base_unit_test_case import BaseUnitTestCase @genty class TestCluste...
0
1
9
0
10
0
examples/fetch_warninglist_hits.py
chrisinmtown/PyMISP
307
3296069
#!/usr/bin/env python # -*- coding: utf-8 -*- from pymisp import PyMISP from keys import misp_url, misp_key import argparse def init(url, key) -> object: return PyMISP(url, key) def loop_attributes(elem): if 'Attribute' in elem.keys(): for attribute in elem['Attribute']: if 'warnings' i...
0
1
0
0
1
0
var/spack/repos/builtin/packages/py-xdot/package.py
kkauder/spack
2,360
3296070
<filename>var/spack/repos/builtin/packages/py-xdot/package.py # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyXdot(PythonPackage): """xd...
0
0
0
0
0
0
bin/python_scripts/src/utilities/directory.py
wvat/NTRTsim
148
3296072
import os class Directory: def __init__(self, absPath): """ Creates a Directory object. Parameters absPath: An absolute path to the directory this object operates over. """ self.absPath = absPath def getDirList(self, extWhiteList: list[object]=[]) -> object: ...
1
1
0
0
2
0
splearn/linear_model/tests/test_logistic.py
dtrckd/sparkit-learn
1,219
3296083
<filename>splearn/linear_model/tests/test_logistic.py<gh_stars>1000+ import numpy as np from sklearn.linear_model import LogisticRegression from splearn.linear_model import SparkLogisticRegression from splearn.utils.testing import SplearnTestCase, assert_array_almost_equal class TestLogisticRegression(SplearnTestCase...
0
0
0
0
0
0
examples/test_tokyo_best.py
adujardin/OpenIBL
182
3296093
<reponame>adujardin/OpenIBL<gh_stars>100-1000 import argparse import os.path as osp import torch from torch import nn from torch.utils.data import DataLoader from ibl import datasets from ibl.evaluators import Evaluator from ibl.utils.data import get_transformer_test from ibl.utils.data.sampler import DistributedSlic...
0
0
0
0
0
0
src/odb/test/python/19-swig_interface_test.py
erictaur/OpenROAD
525
3296105
import opendbpy as odb import os current_dir = os.path.dirname(os.path.realpath(__file__)) tests_dir = os.path.abspath(os.path.join(current_dir, os.pardir)) opendb_dir = os.path.abspath(os.path.join(tests_dir, os.pardir)) data_dir = os.path.join(tests_dir, "data") db = odb.dbDatabase.create() lef = odb.read_lef(db, ...
0
0
0
0
0
0
examples/transformer/config_wmt14.py
dyoshioka-555/texar
2,325
3296110
<filename>examples/transformer/config_wmt14.py batch_size = 3072 test_batch_size = 64 max_train_epoch = 10 display_steps = 500 eval_steps = 2000 max_decoding_length = 256 filename_prefix = "processed." input_dir = 'temp/run_en_de_bpe/data' vocab_file = input_dir + '/processed.vocab.pickle'
0
0
0
0
0
0
tests/integration/messaging/v1/brand_registration/test_brand_vetting.py
shwetha-manvinkurke/twilio-python
1,362
3296125
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from tests import IntegrationTestCase from tests.holodeck import Request from twilio.base.exceptions import TwilioException from twilio.http.response import Response class BrandVettingTestCase(Inte...
0
0
0
0
0
0
lib/model/metrics.py
xuchen-ethz/snarf
150
3296130
<reponame>xuchen-ethz/snarf import torch def calculate_iou(gt, prediction): intersection = torch.logical_and(gt, prediction) union = torch.logical_or(gt, prediction) return torch.sum(intersection) / torch.sum(union)
0
0
0
0
0
0
spopt/region/azp_util.py
martinfleis/spopt
135
3296140
from __future__ import annotations import abc import math import numbers import random import numpy as np class AllowMoveStrategy(abc.ABC): def start_new_component(self, initial_labels, attr, objective_func, comp_idx): """ This method should be called whenever a new connected component is ...
0
4
0
4
8
0
2018-volgactf-quals/XOR-Trick/xortrick.py
integeruser/on-pwning
104
3296149
#!/usr/bin/env python2 # -*- coding: utf-8 -*- from io import BytesIO from itertools import cycle from PIL import Image from pwn import * context(arch='amd64', os='linux') if args['REMOTE']: io = remote('xortrick.quals.2018.volgactf.ru', 45678) else: io = remote('127.0.0.1', 45678) io.recvuntil('Send your i...
0
0
0
0
0
0
.modules/.metagoofil/hachoir_parser/archive/ar.py
termux-one/EasY_HaCk
1,103
3296151
from __future__ import annotations """ GNU ar archive : archive file (.a) and Debian (.deb) archive. """ from hachoir_parser import Parser from hachoir_core.field import (FieldSet, ParserError, String, RawBytes, UnixLine) from hachoir_core.endian import BIG_ENDIAN class ArchiveFileEntry(FieldSet): def createF...
0
2
2
0
4
0
tests/utils/test_early_stop.py
seqRep/dgl-lifesci
390
3296174
<reponame>seqRep/dgl-lifesci # -*- coding: utf-8 -*- # # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 import os import torch import torch.nn as nn from dgllife.utils import EarlyStopping def remove_file(fname): if os.path.isfile(fname): try: ...
0
0
0
0
0
0
tests/test_asscs_ns.py
flying-sheep/goatools
477
3296203
#!/usr/bin/env python from __future__ import annotations """Test TermCounts object used in Resnik and Lin similarity calculations.""" from __future__ import print_function import os import sys import timeit import datetime import collections as cx from goatools.base import get_godag from goatools.test_data.gafs impor...
1
2
0
0
3
0
scripts/test_claim_search.py
nishp77/lbry-sdk
4,996
3296221
<reponame>nishp77/lbry-sdk import asyncio from lbry.wallet.network import ClientSession from lbry.wallet.rpc.jsonrpc import RPCError import logging import json import sys logging.getLogger('lbry.wallet').setLevel(logging.CRITICAL) async def main(): try: hostname = sys.argv[1] except IndexError: ...
0
0
0
0
0
0
examples/docs_snippets_crag/docs_snippets_crag/intro_tutorial/airflow.py
dbatten5/dagster
4,606
3296224
<filename>examples/docs_snippets_crag/docs_snippets_crag/intro_tutorial/airflow.py import csv import requests from dagster import pipeline, solid @solid def hello_cereal(context): response = requests.get("https://docs.dagster.io/assets/cereal.csv") lines = response.text.split("\n") cereals = [row for row...
0
0
0
0
0
0
json_schema_generator/recorder.py
ruairif/json_schema_generator
231
3296235
# -*- coding: utf-8 -*- from json_schema_generator.generator import SchemaGenerator class Recorder(object): def __init__(self, generator): self.generator = generator @classmethod def from_url(cls, url) -> object: from six.moves.urllib.request import urlopen json_data = urlopen(...
0
2
0
0
2
0
setup.py
jhrmnn/hydra
5,847
3296239
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved # type: ignore import pathlib import pkg_resources from setuptools import find_packages, setup from build_helpers.build_helpers import ( ANTLRCommand, BuildPyCommand, CleanCommand, Develop, SDistCommand, find_version, ) wi...
0
0
0
0
0
0
TWE-3/gensim/examples/dmlcz/gensim_genmodel.py
sysuhu/topical_word_embeddings
330
3296287
<reponame>sysuhu/topical_word_embeddings #!/usr/bin/env python # # Copyright (C) 2010 <NAME> <<EMAIL>> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ USAGE: %(program)s LANGUAGE METHOD Generate topic models for the specified subcorpus. METHOD is currently one \ of 'tfidf', 'lsi', 'l...
0
0
0
0
0
0
stream_framework/tests/utils/__init__.py
amitpatra/Stream-Framework
3,964
3296291
<gh_stars>1000+ from stream_framework.activity import Activity, AggregatedActivity class FakeActivity(Activity): pass class FakeAggregatedActivity(AggregatedActivity): pass class Pin(object): def __init__(self, **kwargs): self.__dict__.update(kwargs)
0
0
0
0
0
0
alibi_detect/utils/tensorflow/__init__.py
sugatoray/alibi-detect
1,227
3296303
<reponame>sugatoray/alibi-detect from .distance import mmd2, mmd2_from_kernel_matrix, batch_compute_kernel_matrix from .distance import relative_euclidean_distance, squared_pairwise_distance, permed_lsdds from .kernels import GaussianRBF, DeepKernel from .prediction import predict_batch, predict_batch_transformer from ...
0
0
0
0
0
0
lldb/packages/Python/lldbsuite/test/arm/breakpoint-it/TestBreakpointIt.py
medismailben/llvm-project
2,338
3296318
""" Test that breakpoints in an IT instruction don't fire if their condition is false. """ import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class TestBreakpointIt(TestBase): mydir = TestBase.compute_mydir(__file__) NO_DEBUG_INFO_T...
0
0
1
0
1
0
PsychPython/demos/hidtest_pythonic.py
dcnieho/Psychtoolbox-3
357
3296355
# hidtest.py - Basic test of PsychHID for Python # Also tests WaitSecs, as it is utilized here. # # The test will be subject to change without notice, it is throwaway wip code. # # (c) 2019 <NAME> - Licensed under MIT license. # (c) 2018 <NAME> - Licensed under MIT license. from psychtoolbox import hid import psychtoo...
0
0
0
0
0
0
loss/InpaintingLoss.py
Vious/LBAM_Pytorch
112
3296373
<gh_stars>100-1000 import torch from torch import nn from torch import autograd from tensorboardX import SummaryWriter from models.discriminator import DiscriminatorDoubleColumn # modified from WGAN-GP def calc_gradient_penalty(netD, real_data, fake_data, masks, cuda, Lambda): BATCH_SIZE = real_data.size()[0] ...
0
0
0
0
0
0
petridish/utils/callbacks.py
Bhaskers-Blu-Org2/petridishnn
121
3296388
<reponame>Bhaskers-Blu-Org2/petridishnn # Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import tensorflow as tf from tensorpack.callbacks import Callback, HookToCallback, Inferencer class PerStepHookWithControlDependencies(Callback): _chief_only = False def __init__( se...
0
0
0
0
0
0
tests/test_cursor.py
bobuk/montydb
478
3296404
<reponame>bobuk/montydb import pytest from montydb.errors import OperationFailure from montydb.cursor import MontyCursor @pytest.fixture def monty_collection(monty_database): monty_database.drop_collection("for_cursor_test") col = monty_database.for_cursor_test col.insert_many([{"doc": i} for i in range...
0
0
0
0
0
0
scrapy_proj/openrecipes/spiders/thevintagemixer_feedspider.py
fictivekin/openrecipes
300
3296439
from scrapy.spider import BaseSpider from scrapy.http import Request from scrapy.selector import XmlXPathSelector from openrecipes.spiders.thevintagemixer_spider import TheVintageMixerMixin class TheVintageMixerFeedSpider(BaseSpider, TheVintageMixerMixin): name: str = "thevintagemixer.feed" allowed_domains: ...
0
1
3
0
4
0
scripts/examples/OpenMV/09-Feature-Detection/selective_search.py
jiskra/openmv
1,761
3296444
# Selective Search Example import sensor, image, time from random import randint sensor.reset() # Reset and initialize the sensor. sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE) sensor.set_framesize(sensor.QVGA) # Set frame size to QVGA (320x240) sensor.skip_fra...
0
0
0
0
0
0
alipay/aop/api/domain/DevicePushPayload.py
antopen/alipay-sdk-python-all
213
3296460
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import annotations import json from alipay.aop.api.constant.ParamConstants import * class DevicePushPayload(object): def __init__(self): self._device_id: None = None self._notify_params: None = None self._scene: None = None ...
0
5
0
3
8
0
idaes/core/util/expr_doc.py
eslickj/idaes-pse
112
3296476
<reponame>eslickj/idaes-pse ################################################################################# # The Institute for the Design of Advanced Energy Systems Integrated Platform # Framework (IDAES IP) was produced under the DOE Institute for the # Design of Advanced Energy Systems (IDAES), and is copyright (c...
0
0
0
0
0
0
objectdetection_video.py
GustavZ/Tensorflow-Object-Detection
187
3296484
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Thu Dec 21 12:01:40 2017 @author: www.github.com/GustavZ """ from rod.model import ObjectDetectionModel from rod.config import Config def main(): model_type = 'od' input_type = 'video' config = Config(model_type) model = ObjectDetectionMod...
0
0
0
0
0
0
warps/resources/lookup_tables.py
TheTechnobear/mi
1,802
3296495
<filename>warps/resources/lookup_tables.py #!/usr/bin/python2.5 # # Copyright 2014 <NAME>. # # Author: <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
onnxruntime/python/tools/quantization/operators/gather.py
mszhanyi/onnxruntime
669
3296513
from __future__ import annotations import onnx from onnx import onnx_pb as onnx_proto from ..quant_utils import QuantizedValue, QuantizedValueType from .base_operator import QuantOperatorBase """ Quantize Gather """ class GatherQuant(QuantOperatorBase): def __init__(self, onnx_quantizer, onnx_node): ...
0
1
0
0
1
0
setup.py
Suor/patterns
182
3296522
from setuptools import setup setup( name='patterns', version='0.3', author='<NAME>', author_email='<EMAIL>', description='Pattern matching for python', long_description=open('README.rst').read().replace('|Build Status|', '', 1), url='http://github.com/Suor/patterns', license='BSD', ...
0
0
0
0
0
0
Examples/AppKit/CocoaBindings/CurrencyConvBinding/Converter.py
Khan/pyobjc-framework-Cocoa
132
3296553
<reponame>Khan/pyobjc-framework-Cocoa from Foundation import * class Converter (NSObject): exchangeRate = objc.ivar.double() dollarsToConvert = objc.ivar.double() def init(self): self = super(Converter, self).init() self.exchangeRate = 3 self.dollarsToConvert = 4 return sel...
0
0
0
0
0
0
bin/webdevops/command/BaseCommand.py
oobeya-space/Dockerfile
1,405
3296579
#!/usr/bin/env/python # -*- coding: utf-8 -*- # # (c) 2016 WebDevOps.io # # This file is part of Dockerfile Repository. # # 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, in...
0
0
0
0
0
0
doctr/models/obj_detection/faster_rcnn/__init__.py
Pandinosaurus/doctr
628
3296602
from doctr.file_utils import is_tf_available, is_torch_available if not is_tf_available() and is_torch_available(): from .pytorch import * # type: ignore[misc]
0
0
0
0
0
0
parlai/mturk/webapp/run_mocks/mock_turk_agent.py
ricsinaruto/ParlAI
258
3296605
<gh_stars>100-1000 #!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import logging from parlai.mturk.core.agents import MTurkAgent, TIMEOUT_MESSAGE from parlai.mturk.co...
0
0
0
0
0
0
deephyper/nas/preprocessing/__init__.py
felixeperez/deephyper
185
3296614
<filename>deephyper/nas/preprocessing/__init__.py from ._base import minmaxstdscaler, stdscaler __all__ = ["minmaxstdscaler", "stdscaler"]
0
0
0
0
0
0
examples/basic_queue.py
agrimrules/fiber
1,010
3296628
from fiber import Process, SimpleQueue def foo(q, a, b): q.put(a + b) if __name__ == '__main__': q = SimpleQueue() p = Process(target=foo, args=(q, 42, 21)) p.start() print(q.get()) p.join()
0
0
0
0
0
0
CodeIA/venv/Lib/site-packages/coremltools/converters/mil/mil/passes/matmul_weight_bias_fusion.py
Finasty-lab/IA-Python
11,356
3296641
# -*- coding: utf-8 -*- # Copyright (c) 2020, Apple Inc. All rights reserved. # # Use of this source code is governed by a BSD-3-clause license that can be # found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause from __future__ import annotations from __future__ import print_function as ...
0
4
0
0
4
0
Tools/python37/Lib/test/test_email/test__encoded_words.py
xxroot/android_universal
207
3296648
<reponame>xxroot/android_universal import unittest from email import _encoded_words as _ew from email import errors from test.test_email import TestEmailBase class TestDecodeQ(TestEmailBase): def _test(self, source, ex_result, ex_defects=[]): result, defects = _ew.decode_q(source) self....
0
0
0
0
0
0
coherence/extern/youtubedl/__init__.py
wd8rde/Coherence
112
3296649
from youtubedl import FileDownloader from youtubedl import YoutubeIE from youtubedl import MetacafeIE from youtubedl import YoutubePlaylistIE
0
0
0
0
0
0
smartnlp/utils/stopwords.py
msgi/nlp-tour
1,559
3296675
from nltk.corpus import stopwords # 英文停用词直接引用nltk包里的即可 def get_en_stopwords() -> set[object]: return set(stopwords.words('english')) # 中文停用词自己实现 def get_zh_stopwords(): raise NotImplementedError
0
1
0
0
1
0
mindspore-jina/MindsporeLeNet/__init__.py
wsatu/community
185
3296687
<gh_stars>100-1000 import numpy as np from jina.executors.encoders.frameworks import BaseMindsporeEncoder class MindsporeLeNet(BaseMindsporeEncoder): """ :class:`MindsporeLeNet` Encoding image into vectors using mindspore. """ def encode(self, data, *args, **kwargs): # data is B x D, where D ...
0
0
0
0
0
0
runway/_cli/commands/_tfenv/_uninstall.py
blade2005/runway
134
3296706
"""Uninstall Terraform version(s) that were installed by Runway and/or tfenv.""" # docs: file://./../../../../docs/source/commands.rst import logging from typing import TYPE_CHECKING, Any, Optional, cast import click from ....env_mgr.tfenv import TFEnvManager from ... import options if TYPE_CHECKING: from runway...
4
1
0
0
5
0
tools/mo/openvino/tools/mo/front/tf/floor_div_decomposition.py
ryanloney/openvino-1
1,127
3296729
# Copyright (C) 2018-2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 from openvino.tools.mo.ops.activation_ops import Floor from openvino.tools.mo.ops.elementwise import Div from openvino.tools.mo.front.common.replacement import FrontReplacementPattern from openvino.tools.mo.graph.graph import Graph, Node...
2
0
1
0
3
0
examples/pxScene2d/external/libnode-v6.9.0/tools/comtypes/patcher.py
madanagopaltcomcast/pxCore
212
3296733
<reponame>madanagopaltcomcast/pxCore class Patch(object): """ Implements a class decorator suitable for patching an existing class with a new namespace. For example, consider this trivial class (that your code doesn't own): >>> class MyClass: ... def __init__(self, param): ... ...
0
0
0
0
0
0
cvpods/utils/visualizer/__init__.py
reinforcementdriving/cvpods
758
3296751
<gh_stars>100-1000 #!/usr/bin/python3 # -*- coding:utf-8 -*- from .colormap import * from .video_visualizer import * from .visualizer import *
0
0
0
0
0
0
src/marshmallow_sqlalchemy/schema.py
mrname/marshmallow-sqlalchemy
498
3296753
from __future__ import annotations from marshmallow.fields import Field from marshmallow.schema import Schema, SchemaMeta, SchemaOpts import sqlalchemy as sa from sqlalchemy.ext.declarative import DeclarativeMeta from .convert import ModelConverter from .exceptions import IncorrectSchemaTypeError from .load_instance_m...
6
6
0
0
12
0
helper/req_check.py
JoseETeixeira/vulkan-renderer
443
3296788
""" Copyright 2021-present Iceflower - <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, including without limitation the rights to use, copy, modify, merge, publish, di...
0
1
0
0
1
0
todo/check.py
Sowmya-1998/https-github.com-shacker-django-todo
567
3296790
from __future__ import annotations from django.core.checks import Error, register # the sole purpose of this warning is to prevent people who have # django-autocomplete-light installed but not configured to start the app @register() def dal_check(app_configs, **kwargs) -> list[object] | object: from django.conf im...
0
1
0
0
1
0
experimental/emulated_vault/opt/emulated-vault/storage/adapter_base.py
qtweng/trafficcontrol
598
3296811
<gh_stars>100-1000 # # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
0
0
0
0
0
0
silk/request_filters.py
side2k/django-silk
2,027
3296819
<gh_stars>1000+ """ Django queryset filters used by the requests view """ import logging from datetime import datetime, timedelta from django.db.models import Count, Q, Sum from django.utils import timezone from silk.profiling.dynamic import _get_module from silk.templatetags.silk_filters import _silk_date_time logg...
0
0
0
0
0
0
tests/performance/compare_perfs.py
PrecisionMetrics/openjpeg
823
3296826
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2017, IntoPIX SA # Contact: <EMAIL> # Author: <NAME> # # 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 the ...
0
0
0
0
0
0
packages/grid/apps/domain/src/main/__init__.py
exityan/PySyft
425
3296862
<filename>packages/grid/apps/domain/src/main/__init__.py # third party from flask import Blueprint ws = Blueprint(r"ws", __name__)
0
0
0
0
0
0
tests/features/test_simple.py
ashish-narwal/nalaf
103
3296870
import unittest from nalaf.structures.data import Dataset, Document, Part, Token from nalaf.features.simple import SimpleFeatureGenerator, SentenceMarkerFeatureGenerator class TestSimpleFeatureGenerator(unittest.TestCase): def setUp(self): part = Part('Word1 word2 word3. Word4 word5 word6.') part....
0
0
0
0
0
0
openfl-tutorials/interactive_api/PyTorch_MVTec_PatchSVDD/envoy/mvtec_shard_descriptor.py
ssg-research/openfl
297
3296881
# Copyright (C) 2020-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 """MVTec shard descriptor.""" import os from glob import glob from pathlib import Path import numpy as np from imageio import imread from PIL import Image from openfl.interface.interactive_api.shard_descriptor import ShardDataset from ...
7
8
0
0
15
0
leet/dynamic/maxProfit3.py
monishshah18/python-cp-cheatsheet
140
3296902
<reponame>monishshah18/python-cp-cheatsheet<gh_stars>100-1000 class Solution: def maxProfit(self, prices: List[int]) -> int: t0 = [0] * 3 t1 = [float(-inf)] * 3 for p in prices: for i in range(2,0,-1): t0[i] = max(t0[i], t1[i] + p) t1[i] =...
0
0
0
0
0
0
chatbot/trainner.py
kootenpv/DeepQA
176
3296908
#!/usr/bin/env python3 # Copyright 2015 Conchylicultor. 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 req...
0
0
0
0
0
0
Modules/RefineDet/train_val.py
Passer-D/GameAISDK
1,210
3296921
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making GameAISDK available. This source code file is licensed under the GNU General Public License Version 3. For full details, please refer to the file "LICENSE.txt" which is provided as part of this source code package. Copyright...
0
0
0
0
0
0
magenta/pipelines/performance_pipeline.py
cooltunes/magenta
2,785
3296940
<filename>magenta/pipelines/performance_pipeline.py # Copyright 2021 The Magenta Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # ...
0
0
0
0
0
0
test/test_signed_request.py
michaelwalkerfl/facebook-sdk
1,330
3296956
import facebook from . import FacebookTestCase class FacebookParseSignedRequestTestCase(FacebookTestCase): cookie = ( "Z6pnNcY-TePEBA7IfKta6ipLgrig53M7DRGisKSybBQ." "<KEY>DLV<KEY>" "M090T3BSRGtpT1k4UDNlOWgwYzZRNFFuMEFFQnVqR1M3ZEV5LXNtbUt5b3pD" "dHdhZy1kRmVYNmRUbi12dVBfQVNtek5Rbjlka...
0
0
0
0
0
0
tests/unit/dogstatsd/fixtures.py
jonathan-hosmer/datadogpy
520
3296963
# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License. # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2015-Present Datadog, Inc """ Helper(s), load fixtures. """ # stdlib import os def load_fixtures(name) -> objec...
0
1
0
0
1
0
third_party/blink/renderer/bindings/scripts/bind_gen/__init__.py
Ron423c/chromium
575
3296964
# Copyright 2019 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 os.path import sys # Set up |sys.path| so that this module works without user-side setup of # PYTHONPATH assuming Chromium's directory tree structur...
0
0
0
0
0
0
lemur/plugins/lemur_jks/plugin.py
dck25/lemur
1,656
3296975
""" .. module: lemur.plugins.lemur_jks.plugin :platform: Unix :copyright: (c) 2018 by Netflix Inc., see AUTHORS for more :license: Apache, see LICENSE for more details. .. moduleauthor:: <NAME> <<EMAIL>> """ from cryptography.fernet import Fernet from cryptography.hazmat.primitives import serialization fr...
0
0
0
0
0
0
test/programytest/parser/pattern/matching/base.py
cdoebler1/AIML2
345
3296998
import xml.etree.ElementTree as ET from programy.dialog.sentence import Sentence from programy.parser.template.nodes.word import TemplateWordNode from programytest.parser.base import ParserTestsBaseClass class PatternMatcherBaseClass(ParserTestsBaseClass): def add_pattern_to_graph(self, pattern, topic: str="*",...
5
1
0
0
6
0
experimental/utilities/python/tree_mirror.py
liuhoward/tech-interview-handbook
71,386
3297001
<filename>experimental/utilities/python/tree_mirror.py def tree_mirror(node): if not node: return node.left, node.right = node.right, node.left tree_mirror(node.left) tree_mirror(node.right)
0
0
0
0
0
0
scanner/plugins/cms/thinkphp/thinkphp_code_exec.py
UgOrange/onlinetools
1,207
3297011
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import annotations ''' name: ThinkPHP 代码执行漏洞 referer: http://zone.wooyun.org/index.php?do=view&id=44 author: Lucifer description: ThinkPHP 版本3.0~3.1开启Lite模式后preg_replace使用了/e选项,同时第二个参数使用双引号,所以造成了代码执行,可直接GETSHELL ''' import sys import requests class thinkp...
0
1
0
0
1
0
data/transcoder_evaluation_gfg/python/K_TH_DIGIT_RAISED_POWER_B.py
mxl1n/CodeGen
241
3297021
<reponame>mxl1n/CodeGen # Copyright (c) 2019-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # def f_gold ( a , b , k ) : p = a ** b count = 0 while ( p > 0 and count < k ) : rem ...
0
0
0
0
0
0
saws/resource/bucket_uris.py
Pangeam/saws
5,358
3297034
<gh_stars>1000+ # -*- coding: utf-8 -*- # Copyright 2015 <NAME>. 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://www.apache.org/licenses/LICENSE-2.0 # # or in...
0
0
0
0
0
0
proxyclient/m1n1/fw/pmp.py
EricRabil/m1n1
1,604
3297038
# SPDX-License-Identifier: MIT import struct from ..utils import * from .asc import StandardASC from .asc.base import * class PMPMessage(Register64): TYPE: tuple[int, int] = 56, 44 class PMP_Startup(PMPMessage): TYPE: tuple[int, int, object] = 56, 44, Constant(0x00) class PMP_Configure(PMPMessage): TYP...
0
6
35
4
45
0
tensorflow/data/seg_partnet.py
pauldinh/O-CNN
299
3297045
# Credit: This file is originally written by <NAME>, modified by <NAME> from __future__ import annotations import os import json import numpy as np current_path = os.path.dirname(os.path.realpath(__file__)) root_folder = os.path.join(current_path, '../script/dataset/partnet_segmentation') convert_tfrecords = os.path....
1
5
0
0
6
0
ckanext/example_theme/v19_02_error_handling/plugin.py
okfde/ckankrzn
2,805
3297053
<reponame>okfde/ckankrzn ../v19_01_error/plugin.py
0
0
0
0
0
0
test/test_broker.py
koyoki/Poco
1,444
3297060
# coding=utf-8 import time import threading from poco.sdk.std.rpc.controller import StdRpcEndpointController from poco.sdk.std.rpc.reactor import StdRpcReactor from poco.utils.net.transport.tcp import TcpSocket from poco.utils.net.stdbroker import StdBroker def Dump(arg) -> object: return 'this is Dump ' + arg ...
0
1
0
0
1
0
regtests/bench/fannkuch.py
bpmbank/PythonJS
319
3297079
<filename>regtests/bench/fannkuch.py # The Computer Language Benchmarks Game # http://shootout.alioth.debian.org/ # # contributed by <NAME> # modified by Tupteq # modified by hartsantler 2014 from time import time DEFAULT_ARG = 9 def main(): if PYTHON=='PYTHONJS': pythonjs.configure( direct_operator='+' ) pytho...
0
0
0
0
0
0
tests/book/ch13/sigmoid.py
xchaoinfo/pyhanlp
2,792
3297113
<gh_stars>1000+ # -*- coding:utf-8 -*- # Author: hankcs # Date: 2019-02-26 15:16 # 《自然语言处理入门》13.2 深度学习与优势 # 配套书籍:http://nlp.hankcs.com/book.php # 讨论答疑:https://bbs.hankcs.com/ from matplotlib import pylab as plt import numpy as np sigmoid = lambda x: 1 / (1 + np.exp(-x)) x = plt.linspace(-10, 10, 10000) plt.plot(x, ...
0
0
0
0
0
0
prettytensor/pretty_tensor_test.py
google/prettytensor
1,413
3297160
# Copyright 2015 Google Inc. All Rights Reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed ...
3
17
0
0
20
0
pulumi/infra/bucket.py
insanitybit/grapl
313
3297178
<filename>pulumi/infra/bucket.py import json from pathlib import Path from typing import List, Optional import pulumi_aws as aws import pulumi class Bucket(aws.s3.Bucket): def __init__( self, name: str, sse: bool = False, opts: Optional[pulumi.ResourceOptions] = None, ) -> No...
0
0
0
0
0
0
admob/config.py
HummusSamurai/godot-admob
397
3297219
<filename>admob/config.py # Godot 2.1 only passes platform. Godot 3+ build passes env, platform def can_build(*argv): platform = argv[1] if len(argv) == 2 else argv[0] return platform=="android" or platform=="iphone" def configure(env): if (env['platform'] == 'android'): env.android_add_dependency("compile ('com....
0
0
0
0
0
0
packs/puppet/actions/cert_revoke.py
jonico/st2contrib
164
3297225
<reponame>jonico/st2contrib from lib.python_actions import PuppetBasePythonAction __all__ = [ 'PuppetCertRevokeAction' ] class PuppetCertRevokeAction(PuppetBasePythonAction): def run(self, environment, host): success = self.client.cert_revoke(environment=environment, host=host) return success...
0
0
0
0
0
0
tests/r/test_barley.py
hajime9652/observations
199
3297234
<filename>tests/r/test_barley.py from __future__ import absolute_import from __future__ import division from __future__ import print_function import shutil import sys import tempfile from observations.r.barley import barley def test_barley(): """Test module barley.py by downloading barley.csv and testing shape...
0
0
0
0
0
0
app/external/pytaw/setup.py
cyberjacob/ytsm
298
3297277
<filename>app/external/pytaw/setup.py from setuptools import setup setup( name='pytaw', version='0.0.1', packages=['pytaw'], url='https://github.com/6000hulls/pytaw', license='', author='6000hulls', author_email='<EMAIL>', description='PYTAW: Python YouTube API Wrapper' )
0
0
0
0
0
0