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
src/protocols/CoAP/attacks/coap_payload_size_fuzzer.py
QWERTSKIHACK/peniot
143
1768769
import logging import multiprocessing import random import signal import time import unittest from coapthon.client.helperclient import HelperClient from Entity.attack import Attack from Entity.input_format import InputFormat from protocols import CoAP as PeniotCoAP class CoAPPayloadSizeFuzzerAttack(Attack): """...
0
0
0
0
0
0
esphome/components/tsl2591/sensor.py
OttoWinter/esphomeyaml
249
1768770
<reponame>OttoWinter/esphomeyaml<filename>esphome/components/tsl2591/sensor.py # Credit where due.... # I put a certain amount of work into this, but a lot of ESPHome integration is # "look for other examples and see what they do" programming-by-example. Here are # things that helped me along with this: # # - I mined t...
0
0
0
0
0
0
docs/source/_static/zzz_GENERATED_NOTEBOOK_SOURCE/etl/splitmultiallelics-transformer.py
bcajes/glow
214
1768800
# Databricks notebook source # DBTITLE 1,Define path variables import glow spark = glow.register(spark) vcf_path = '/databricks-datasets/genomics/variant-splitting/01_IN_altered_multiallelic.vcf' # COMMAND ---------- # DBTITLE 1,Load a VCF into a DataFrame original_variants_df = (spark.read .format("vcf") .option...
0
0
0
0
0
0
strawberryfields/configuration.py
corvust/strawberryfields
646
1768825
# Copyright 2019-2020 Xanadu Quantum Technologies Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or...
10
9
0
0
19
0
models/official/mnasnet/configs/mnasnet_config.py
aman2930/tpu
5,098
1768829
# 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/licenses/LICENSE-2.0 # # Unless required by applica...
0
0
0
0
0
0
system_tests/host_tests.py
lrivallain/pyvcloud
168
1768843
<gh_stars>100-1000 # VMware vCloud Director Python SDK # Copyright (c) 2018 VMware, 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/lic...
0
0
0
0
0
0
raiden/__init__.py
tirkarthi/raiden
2,101
1768859
<gh_stars>1000+ from . import _monkey _monkey.patch_all() del _monkey
0
0
0
0
0
0
google-api-client-generator/src/googleapis/codegen/utilities/json_with_comments_test.py
cclauss/discovery-artifact-manager
178
1768914
<gh_stars>100-1000 #!/usr/bin/python2.7 """Tests for json_with_comments.py.""" from google.apputils import basetest from googleapis.codegen.utilities import json_with_comments class JsonWithCommentsTest(basetest.TestCase): SOME_JSON_WITH_COMMENTS = """ # Garlic and sapphires in the mud # Clot the bedded ...
0
0
0
0
0
0
Packs/VMwareWorkspaceONEUEM/Integrations/VMwareWorkspaceONEUEM/test_data/input_data.py
diCagri/content
799
1768934
exception_handler_params = [ (404, "The resource cannot be found."), (407, "Proxy Error - cannot connect to proxy. Either try clearing the 'Use system proxy' check-box or" "check the host, authentication details and connection details for the proxy."), (500, "The server encountered an internal err...
0
0
0
0
0
0
alipay/aop/api/domain/SchoolInfo.py
alipay/alipay-sdk-python-all
213
1768941
<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class SchoolInfo(object): def __init__(self): self._address = None self._city_code = None self._inst_id = None self._inst_name = None self._in...
0
0
0
0
0
0
z3/all_different_on_intersection.py
Wikunia/hakank
279
1769027
<reponame>Wikunia/hakank #!/usr/bin/python -u # -*- coding: latin-1 -*- # # Global constraint all_different_on_intersection in Z3 # # From Global Constraint Catalogue # http://www.emn.fr/x-info/sdemasse/gccat/Calldifferent_on_intersection.html # """ # The values that both occur in the VARIABLES1 and VARIABLES2 collect...
0
0
0
0
0
0
util/cfg_override.py
nbishdev/tgen
222
1769042
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from argparse import ArgumentParser import yaml import codecs def recursive_update(orig, update) -> object: if not (isinstance(orig, dict) and isinstance(update, dict)): raise TypeError("Need dictionaries for recursive update.") for key in update: ...
0
1
0
0
1
0
components/url_formatter/top_domains/make_alexa_top_list.py
zipated/src
2,151
1769044
#!/usr/bin/env python # Copyright 2017 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. """Generates alexa_domains.list from src/tools/perf/page_sets/alexa1-10000-urls.json. By default, all the domains extracted from...
0
0
0
0
0
0
core/data_generator.py
saramsv/wss
116
1769045
# Lint as: python2, python3 # 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 # https://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law ...
16
6
0
1
23
0
nel/process/pipeline.py
psyML/nel
196
1769048
<gh_stars>100-1000 import json from . import tag, candidates, coref, resolve from ..features import feature from nel import logging log = logging.getLogger() class Pipeline(object): """ Pipeline of document processes """ def __init__(self, processors): self.processors = processors def __call__(se...
0
0
0
0
0
0
spyne/const/ansi_color.py
tlandschoff-scale/spyne
786
1769071
<gh_stars>100-1000 # # spyne - Copyright (C) Spyne contributors. # # This library 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 2.1 of the License, or (at your option) any later vers...
0
0
0
0
0
0
src/ralph/tests/migrations/0002_auto_20160119_0914.py
DoNnMyTh/ralph
1,668
1769083
<reponame>DoNnMyTh/ralph # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import ralph.lib.mixins.fields class Migration(migrations.Migration): dependencies = [ ('tests', '0001_initial'), ] operations = [ migrations.CreateModel( ...
0
0
0
0
0
0
playground/semantic_segmentation/coco/semanticfpn/semanticfpn.res50.fpn.coco.multiscale.1x/config.py
hanqiu-hq/cvpods
548
1769085
<filename>playground/semantic_segmentation/coco/semanticfpn/semanticfpn.res50.fpn.coco.multiscale.1x/config.py import os.path as osp from cvpods.configs.segm_config import SegmentationConfig _config_dict = dict( MODEL=dict( WEIGHTS="detectron2://ImageNetPretrained/MSRA/R-50.pkl", RESNETS=dict( ...
0
0
0
0
0
0
Plugins/VTKmFilters/Testing/LoadVTKmFilterPlugin.py
xj361685640/ParaView
815
1769096
from paraview.simple import * # Load the distributed plugin. LoadDistributedPlugin("VTKmFilters" , ns=globals()) # Now use a filter from that plugin. # We don't really care if the filter works correctly in this test, # we're just verifying that the plugin can be loaded correctly. Wavelet() UpdatePipeline() VTKmContou...
0
0
0
0
0
0
setup_python.py
Avi-D-coder/vim-clap
2,040
1769118
<filename>setup_python.py import sys from os.path import normpath, join import vim plugin_root_dir = vim.eval('g:clap#autoload_dir') python_root_dir = normpath(join(plugin_root_dir, '..', 'pythonx')) sys.path.insert(0, python_root_dir) import clap
0
0
0
0
0
0
tests/epyccel/modules/Module_3.py
dina-fouad/pyccel
206
1769123
# pylint: disable=missing-function-docstring, missing-module-docstring/ from __future__ import annotations from pyccel.decorators import types @types('int') def add_one(x) -> object: return x + 1 @types('int') def func(x: object | None = None) -> int | object: if x is None: return 2 re...
1
2
0
0
3
0
ae_datasets/d_creator.py
colormeblue1013/egnn-test
142
1769139
<reponame>colormeblue1013/egnn-test import networkx as nx import numpy as np import torch import graph as gl import random OFFSET_4 = torch.from_numpy(np.array([[-5, 5], [5, 5], [-5, -5], [5, -5]]).astype(np.float32)) OFFSET_9 = torch.from_numpy(np.array([[-10, -10], [0, -10], [10, -10], [-10, 0], [0, 0], ...
0
0
0
0
0
0
bminf/data/__init__.py
AdamBear/BMInf
206
1769148
<filename>bminf/data/__init__.py<gh_stars>100-1000 import os from tqdm import tqdm import requests import logging logger = logging.getLogger(__name__) _SOURCE_URL_PREFIX = "https://thunlp.oss-cn-qingdao.aliyuncs.com/bminf/" _CACHE_PATH = os.path.expanduser("~/.cache/bigmodels/") def set_source(url : str): globa...
0
0
0
0
0
0
SymbolExtractorAndRenamer/lldb/packages/Python/lldbsuite/test/expression_command/save_jit_objects/TestSaveJITObjects.py
Polidea/SiriusObfuscator
427
1769192
""" Test that LLDB can emit JIT objects when the appropriate setting is enabled """ from __future__ import print_function import os import time import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil def enumerateJITFiles() -> object: return [...
0
3
0
0
3
0
PhysicsTools/Heppy/python/analyzers/objects/METAnalyzer.py
ckamtsikis/cmssw
852
1769201
from PhysicsTools.Heppy.analyzers.core.Analyzer import Analyzer from PhysicsTools.Heppy.analyzers.core.AutoHandle import AutoHandle from PhysicsTools.Heppy.physicsobjects.PhysicsObjects import Jet from PhysicsTools.HeppyCore.utils.deltar import * from PhysicsTools.HeppyCore.statistics.counter import Counter, Counters ...
0
3
0
0
3
0
cogrun.py
sgallag-insta/pixray
468
1769233
from cog import BasePredictor, Input, Path from typing import Iterator import torch import yaml import pathlib import os import yaml from util import get_single_rgb # https://stackoverflow.com/a/6587648/1010653 import tempfile, shutil def create_temporary_copy(src_path) -> object: _, tf_suffix = os.path.splitext(...
25
11
0
0
36
0
scorers/regression/auuc.py
pragnesh-ai/driverlessai-recipes
194
1769260
"""Area under uplift curve""" import typing import numpy as np import pandas as pd import datatable as dt from h2oaicore.metrics import CustomScorer class AUUC(CustomScorer): _description: str = "Area under uplift curve" _maximize: bool = True # whether a higher score is better _perfect_score: float = 2....
18
5
8
0
31
0
test/scenarios/more_or_less_secondaries.py
zadcha/rethinkdb
21,684
1769266
#!/usr/bin/env python # Copyright 2010-2016 RethinkDB, all rights reserved. from __future__ import print_function import os, sys, time startTime = time.time() sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, 'common'))) import driver, scenario_common, utils, vcoptparse, worklo...
0
2
0
0
2
0
python/flexflow/core/flexflow_logger.py
zmxdream/FlexFlow
455
1769276
# Copyright 2020 Stanford University, Los Alamos National Laboratory # # 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 ...
0
1
0
1
2
0
src/tasks/dydpp/experiment.py
ibm-research-tokyo/dybm
126
1769296
<filename>src/tasks/dydpp/experiment.py<gh_stars>100-1000 # (C) Copyright IBM Corp. 2019 # # 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
k2/python/tests/levenshtein_alignment_test.py
drawfish/k2
491
1769348
#!/usr/bin/env python3 # # Copyright 2021 Xiaomi Corporation (authors: <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 o...
2
1
0
0
3
0
ontobio/sim/api/semsearch.py
alliance-genome/ontobio
101
1769366
<gh_stars>100-1000 """ Semantic Search (ALPHA) """ from typing import Union, List, Dict, Set, Optional, Tuple from collections import defaultdict from ontobio.model.similarity import SimResult from ontobio.sim.api.interfaces import SimApi import math import logging import pandas as pd import numpy as np from scipy.spa...
0
0
0
0
0
0
tests/codegen/fcode/scripts/USELESS_EXPRESSION.py
dina-fouad/pyccel
206
1769375
<gh_stars>100-1000 # pylint: disable=missing-function-docstring, missing-module-docstring, pointless-statement def sum_two_numbers(x : 'int', y : 'int'): x + y
0
0
0
0
0
0
backend/src/baserow/contrib/database/api/fields/urls.py
ashishdhngr/baserow
839
1769379
<gh_stars>100-1000 from django.urls import re_path from baserow.contrib.database.fields.registries import field_type_registry from .views import FieldsView, FieldView app_name = "baserow.contrib.database.api.fields" urlpatterns = field_type_registry.api_urls + [ re_path(r"table/(?P<table_id>[0-9]+)/$", FieldsV...
0
0
0
0
0
0
framework/TSA/TSAUser.py
FlanFlanagan/raven
159
1769403
# Copyright 2017 Battelle Energy Alliance, 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 t...
1
5
0
9
15
0
toggle-interval.py
oriolmirosa/dash-recipes
932
1769407
import dash_core_components as dcc import dash_html_components as html import dash import datetime app = dash.Dash() app.layout = html.Div([ dcc.Interval(id='my-interval'), dcc.RadioItems(id='set-time', value=1000, options=[ {'label': 'Every second', 'value': 1000}, {'l...
0
2
0
0
2
0
dffml/skel/config/REPLACE_IMPORT_PACKAGE_NAME/configloader.py
SGeetansh/dffml
171
1769409
<gh_stars>100-1000 """ Description of what this config does """ import ast from typing import Dict from dffml.util.entrypoint import entrypoint from dffml.util.cli.arg import Arg from dffml.base import BaseConfig from dffml.configloader.configloader import ( BaseConfigLoaderContext, BaseConfigLoader, ) class...
0
0
0
0
0
0
scripts/train/prepare_iPER_dataset.py
JSssssss/iPERCore
2,223
1769418
<filename>scripts/train/prepare_iPER_dataset.py<gh_stars>1000+ # Copyright (c) 2020-2021 impersonator.org authors (<NAME> and <NAME>). All rights reserved. """ Assume that we put the iPER data into $iPER_root_dir 1. Download the iPER dataset, http://download.impersonator.org:20086/datasets/iPER 1.1 download the ...
0
0
0
0
0
0
benchmark/util.py
fabratu/networkit
366
1769420
import time class Timer: """ Use the Python with-statement to time your code with this timer. """ def __enter__(self) -> object: self.start = time.time() return self def __exit__(self, *args): self.end = time.time() self.elapsed = round(self.end - self.start, 6) # Logging def info(message): print(me...
0
1
0
0
1
0
src/kestrel/codegen/commands.py
vincentywdeng/kestrel-lang
119
1769436
################################################################ # Module Summary # # - Code generation for each command in kestrel.lark # - The execution function names match commands in kestrel.lark # - Each command takes 2 arguments # ( statement, session ) # - statement is the current ...
0
15
0
0
15
0
survae/tests/transforms/bijections/autoregressive/autoregressive_linear_2d.py
alisiahkoohi/survae_flows
262
1769440
<filename>survae/tests/transforms/bijections/autoregressive/autoregressive_linear_2d.py import numpy as np import torch import torch.nn as nn import torchtestcase import unittest from survae.transforms.bijections.autoregressive import * from survae.nn.layers.autoregressive import SpatialMaskedConv2d, MaskedConv2d from ...
0
0
0
0
0
0
CommonTools/ParticleFlow/python/Isolation/muonPFIsolationDepositsPFBRECO_cff.py
ckamtsikis/cmssw
852
1769456
import FWCore.ParameterSet.Config as cms from CommonTools.ParticleFlow.Isolation.tools_cfi import * #Now prepare the iso deposits muPFIsoDepositChargedPFBRECO=isoDepositReplace('pfSelectedMuonsPFBRECO','pfAllChargedHadronsPFBRECO') muPFIsoDepositChargedAllPFBRECO=isoDepositReplace('pfSelectedMuonsPFBRECO','pfAllChar...
0
0
0
0
0
0
Python/Morse-Encode-Decode/morse_encode_decode.py
cs-mshah/AlgoCode
151
1769467
# All morse alphabets are being hardcoded from __future__ import annotations morse_alphabets ={ "A" : ".-", "B" : "-...", "C" : "-.-.", "D" : "-..", "E" : ".", "F" : "..-.", "G" : "--.", "H" : "....", "I" : "..", "J" : ".---", "K" :...
1
2
0
0
3
0
python/federatedml/param/psi_param.py
hubert-he/FATE
3,787
1769480
<reponame>hubert-he/FATE from federatedml.param.base_param import BaseParam from federatedml.util import consts class PSIParam(BaseParam): def __init__(self, max_bin_num=20, need_run=True, dense_missing_val=None, binning_error=consts.DEFAULT_RELATIVE_ERROR): super(PSIParam, self).__init_...
0
0
0
0
0
0
blockcypher/crypto.py
ab77/blockcypher-python
190
1769503
<filename>blockcypher/crypto.py<gh_stars>100-1000 from bitcoin import encode, changebase, binascii, bin_to_b58check import re def script_to_address(script, vbyte=0): ''' Like script_to_address but supports altcoins Copied 2015-10-02 from https://github.com/mflaxman/pybitcointools/blob/faf56c53148989ea3902...
0
0
0
0
0
0
tproxy/rewrite.py
romabysen/tproxy
170
1769509
# -*- coding: utf-8 - # # This file is part of tproxy released under the MIT license. # See the NOTICE for more information. from __future__ import annotations import sys # backports socketio import io import inspect import socket try: import errno except ImportError: errno = None EBADF = getattr(errno, 'EB...
5
9
0
0
14
0
tables/log-parsers/get-error-analysis.py
yash-srivastava19/sempre
812
1769510
<reponame>yash-srivastava19/sempre<filename>tables/log-parsers/get-error-analysis.py #!/usr/bin/env python # -*- coding: utf-8 -*- import sys, os, shutil, re, argparse, json from codecs import open from itertools import izip from collections import defaultdict class Record(object): def __init__(self): pas...
0
0
0
0
0
0
YNet/stage1/Model.py
cancertech/-cancer_diagnosis
126
1769520
<reponame>cancertech/-cancer_diagnosis<filename>YNet/stage1/Model.py # # author: <NAME> # Project Description: This repository contains source code for semantically segmenting WSIs; however, it could be easily # adapted for other domains such as natural image segmentation # File Description: This file...
0
0
0
0
0
0
atm/encoder.py
pvk-developer/ATM
554
1769540
from __future__ import annotations from __future__ import division, unicode_literals from builtins import object import numpy as np from sklearn.preprocessing import LabelEncoder, OneHotEncoder class DataEncoder(object): def __init__(self, class_column: str='class', feature_columns: object | None=None): ...
2
2
0
3
7
0
platforms/ios/run_tests.py
lefatoum2/opencv
56,632
1769562
<reponame>lefatoum2/opencv #!/usr/bin/env python """ This script runs OpenCV.framework tests for iOS. """ from __future__ import print_function import glob, re, os, os.path, shutil, string, sys, argparse, traceback, multiprocessing from subprocess import check_call, check_output, CalledProcessError IPHONEOS_DEPLOYMEN...
0
0
0
0
0
0
aiida/orm/nodes/node.py
aiidateam/aiida_core
153
1769596
# -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
25
47
14
1
87
0
codegen_sources/preprocessing/lang_processors/python_processor.py
mxl1n/CodeGen
241
1769619
# 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. # from __future__ import annotations from codegen_sources.preprocessing.lang_processors.tokenization_utils import ( process_st...
4
6
0
2
12
0
chessbot/r2_cli.py
amjadmajid/rosbook
442
1769622
#!/usr/bin/env python import sys, rospy, tf, moveit_commander, random from geometry_msgs.msg import Pose, Point, Quaternion class R2Wrapper: def __init__(self): self.group = {'left': moveit_commander.MoveGroupCommander("left_arm"), 'right': moveit_commander.MoveGroupCommander("right_arm")} de...
0
0
0
0
0
0
utils/templates.py
goztrk/django-htk
206
1769652
# Python Standard Library Imports import re # HTK Imports from htk.utils import htk_setting from htk.utils import resolve_method_dynamically def get_renderer() -> object: renderer = resolve_method_dynamically(htk_setting('HTK_TEMPLATE_RENDERER')) return renderer def get_template_context_generator() -> obje...
0
4
0
0
4
0
code/models/utils.py
tchittesh/EAS-
169
1769673
from __future__ import annotations from models.dense_net import DenseNetConfig, DenseNet from models.convnet import SimpleConvnetConfig, SimpleConvnet import numpy as np def get_model_config_by_name(name) -> object: if name == 'DenseNet': return DenseNetConfig elif name == 'SimpleConvnet': return SimpleConvnetC...
4
6
0
0
10
0
skopt/sampler/lhs.py
samueljamesbell/scikit-optimize
2,404
1769703
from __future__ import annotations """ Lhs functions are inspired by https://github.com/clicumu/pyDOE2/blob/ master/pyDOE2/doe_lhs.py """ import numpy as np from sklearn.utils import check_random_state from scipy import spatial from ..space import Space, Categorical from .base import InitialPointGenerator def _random...
5
3
0
0
8
0
PWGJE/EMCALJetTasks/Tracks/analysis/GetScalers.py
maroozm/AliPhysics
114
1769704
#************************************************************************** #* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. * #* * #* Author: The ALICE Off-line Project. * #* Contributors ...
0
0
0
0
0
0
2022/CVE-2022-24112/poc/pocsploit/CVE-2022-24112.py
hjyuan/reapoc
421
1769707
from __future__ import annotations import requests import random import string from plugins.oob import verify_request, gen_oob_domain # Vuln Base Info def info() -> dict[str,dict[str,str] | list[str] | str]: return { "author": "cckuailong", "name": '''Apache APISIX apisix/batch-requests Remote Co...
0
6
0
0
6
0
src/population.py
MichaelJWelsh/bot-evolution
151
1769739
""" This modules implements the bulk of Bot Evolution. """ import numpy as np import copy import settings from utility import seq_is_equal, distance_between, angle_is_between, find_angle from neural_network import NNetwork, sigmoid, softmax class Population: """ The environment of bots and food. """ ...
1
0
7
4
12
0
evostrat/examples/normal_lunar_lander.py
rasmusbergpalm/torch-evostrat
183
1769763
import tqdm as tqdm from torch.multiprocessing import Pool from torch.optim import Adam from evostrat import compute_centered_ranks, NormalPopulation from evostrat.examples.lunar_lander import LunarLander if __name__ == '__main__': """ Lunar landers weights and biases are drawn from normal distributions with ...
0
0
0
0
0
0
samples/vsphere/vcenter/helper/network_helper.py
restapicoding/VMware-SDK
589
1769775
from __future__ import annotations """ * ******************************************************* * Copyright (c) VMware, Inc. 2016-2018. All Rights Reserved. * SPDX-License-Identifier: MIT * ******************************************************* * * DISCLAIMER. THIS PROGRAM IS PROVIDED TO YOU "AS IS" WITHOUT * WARRANT...
0
1
0
0
1
0
tests/test-cases/typeinfer_basecase/case7.py
SMAT-Lab/Scalpel
102
1769798
<reponame>SMAT-Lab/Scalpel # Function with no return' # EXPECTED OUTPUT: # Empty list -> [] def my_function(): print('This function does nothing.') for _ in range(10): print('This is printing!')
0
0
0
0
0
0
examples/seq2seq_exposure_bias/configs/config_model.py
GingerBear/texar
2,325
1769827
<filename>examples/seq2seq_exposure_bias/configs/config_model.py num_units = 256 beam_width = 5 decoder_layers = 1 dropout = 0.2 embedder = { 'dim': num_units } encoder = { 'rnn_cell_fw': { 'kwargs': { 'num_units': num_units }, 'dropout': { 'input_keep_prob': 1. ...
0
0
0
0
0
0
paas-ce/paas/esb/esb/middlewares.py
renmcc/bk-PaaS
767
1769828
<reponame>renmcc/bk-PaaS # -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not u...
0
0
0
0
0
0
erts/lib_src/yielding_c_fun/lib/tiny_regex_c/scripts/regex_test_neg.py
jjhoo/otp
946
1769834
<filename>erts/lib_src/yielding_c_fun/lib/tiny_regex_c/scripts/regex_test_neg.py #!/usr/bin/env python """ This program generates random text that matches a given regex-pattern. The pattern is given via sys.argv and the generated text is passed to the binary 'tests/test_rand' to check if the generated text also ...
0
0
0
0
0
0
office365/runtime/http/request_options.py
wreiner/Office365-REST-Python-Client
544
1769853
<gh_stars>100-1000 from office365.runtime.http.http_method import HttpMethod class RequestOptions(object): """Request options""" def __init__(self, url): """ :type url: str """ self.url = url self.data = None self.headers = {} self.auth = None ...
0
0
0
0
0
0
crowdsourcing/serializers/task.py
Kyeongan/crowdsource-platform
138
1769875
<gh_stars>100-1000 from __future__ import division import ast from operator import itemgetter from django.db import transaction from django.db.models import Q from django.utils import timezone from rest_framework import serializers from rest_framework.exceptions import ValidationError from crowdsourcing import model...
0
0
0
0
0
0
libraries/botframework-streaming/botframework/streaming/streaming_request.py
andreikop/botbuilder-python
388
1769934
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import json from uuid import UUID, uuid4 from typing import List, Union from msrest.serialization import Model from botframework.streaming.payloads import ResponseMessageStream from botframework.streaming.payloads.models imp...
17
6
4
0
27
0
layers/containers/set.py
atn34/foundationdb
11,024
1769938
# # set.py # # This source file is part of the FoundationDB open source project # # Copyright 2013-2018 Apple Inc. and the FoundationDB project 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 Li...
0
0
0
0
0
0
deprecated/demo/tutorial_7/multi_uavs_path_planning/commander_uav4.py
mfkiwl/GAAS
2,111
1769961
import rospy from mavros_msgs.msg import GlobalPositionTarget, State from mavros_msgs.srv import CommandBool, CommandTOL, SetMode from geometry_msgs.msg import PoseStamped, Twist from sensor_msgs.msg import Imu, NavSatFix from std_msgs.msg import Float32, String from pyquaternion import Quaternion import time import ma...
5
1
0
0
6
0
Week11/209.py
bobsingh149/LeetCode
101
1769970
class Solution: def minSubArrayLen(self, s: int, nums: List[int]) -> int: j=0 tong=0 res=float('inf') for i in range(len(nums)): tong+=nums[i] while tong>=s and j<len(nums): res=min(res,i-j+1) ...
2
1
0
0
3
0
Apps/sensor/api_tests/urlfetch.py
loftwah/appscale
790
1769996
""" Different tests done against App Engine Urlfetch API. """ import logging import os import sys import time sys.path.append(os.path.join(os.path.dirname(__file__), "../")) from common import constants sys.path.append(os.path.join(os.path.dirname(__file__), "../../../AppServer")) from google.appengine.api import ur...
0
5
0
0
5
0
thinkpad_tools_assets/classes.py
devksingh4/thinkpad-tools
207
1770001
import os import glob import sys import struct import subprocess from struct import pack, unpack class UndervoltSystem(object): def __init__(self): pass def applyUndervolt(self, mv, plane) -> object: """ Apply undervolt to system MSR for Intel-based systems :return: int error:...
0
3
4
0
7
0
opta/commands/init_templates/template.py
riddopic/opta
595
1770003
<filename>opta/commands/init_templates/template.py<gh_stars>100-1000 import copy from os import path from typing import Any, Callable, List, Optional import yaml from colored import attr, fg from opta.constants import init_template_path def load_template(template_type: str, template_name: str) -> dict: file_pat...
0
0
0
0
0
0
tweepy/streaming.py
abbbbbr/tweepy
7,201
1770010
<gh_stars>1000+ # Tweepy # Copyright 2009-2021 <NAME> # See LICENSE for details. # Appengine users: https://developers.google.com/appengine/docs/python/sockets/#making_httplib_use_sockets import json import logging from math import inf from platform import python_version import ssl from threading import Thread from t...
0
0
0
0
0
0
Recycled/collector/stock_info_szse.py
lifg2000/StockAnalysisSystem
138
1770020
<filename>Recycled/collector/stock_info_szse.py #!usr/bin/env python #-*- coding:utf-8 _*- """ @version: author:YuQiu @time: 2017/08/14 @file: stock_info_szse.py @function: @modify: """ import pandas as pd import Utiltity.common from io import BytesIO from openpyxl import load_workbook class MarketInformationFromSZS...
0
0
0
0
0
0
nnunet/dataset_conversion/Task056_Verse_normalize_orientation.py
nasyxx/nnUNet
1,621
1770022
<filename>nnunet/dataset_conversion/Task056_Verse_normalize_orientation.py # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with th...
0
0
0
0
0
0
src/market_order_full_example.py
bbeale/v20-python-samples
257
1770024
#!/usr/bin/env python import argparse import common.args from order.view import print_order_create_response_transactions import v20 def main(): """ Create a Market Order in an Account based on the provided command-line arguments. """ parser = argparse.ArgumentParser() # # Add arguments ...
0
0
0
0
0
0
salesman/orders/serializers.py
icvntechstudio/django-salesman
222
1770035
from django.core.exceptions import ValidationError as DjangoValidationError from django.urls import reverse from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from rest_framework.exceptions import ValidationError from rest_framework.settings import api_settings from salesman....
0
7
7
0
14
0
models/ldif/training.py
jiyeonkim127/im3d
119
1770094
<gh_stars>100-1000 # Trainer for LIEN+LDIF. # author: chengzhang from models.training import BaseTrainer import torch class Trainer(BaseTrainer): ''' Trainer object for total3d. ''' def eval_step(self, data): ''' performs a step in evaluation :param data (dict): data dictionar...
0
0
0
0
0
0
jirafs/commands/log.py
coddingtonbear/jirafs
119
1770100
import pydoc from jirafs.plugin import CommandPlugin class Command(CommandPlugin): """ Print the log for this issue """ MIN_VERSION: str = "2.0.0" MAX_VERSION: str = "3.0.0" def main(self, folder, **kwargs) -> object: results = folder.get_log() pydoc.pager(results) return re...
0
1
2
0
3
0
tests/test_alphabet_detector.py
EliFinkelshteyn/alphabet-detector
152
1770109
<reponame>EliFinkelshteyn/alphabet-detector<filename>tests/test_alphabet_detector.py # -*- coding: utf-8 -*- import pytest from alphabet_detector.alphabet_detector import AlphabetDetector @pytest.fixture def ad(): return AlphabetDetector() @pytest.fixture def ad_no_mem(): return AlphabetDetector(no_memory=T...
0
0
0
0
0
0
python/081-090/Remove Duplicates from Sorted List.py
KaiyuWei/leetcode
150
1770139
# Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: # @param {ListNode} head # @return {ListNode} def deleteDuplicates(self, head) -> object: node = head while node and node.next: i...
0
1
0
0
1
0
Very Hard/rectangle-mania.py
SaumyaRai2010/algoexpert-data-structures-algorithms
152
1770150
# RECTANGLE MANIA # O(N^2) time and space def rectangleMania(coords): # Write your code here. coordsTable = getCoordsTable(coords) return getRectangleCount(coords, coordsTable) def getCoordsTable(coords): coordsTable = {} for coord1 in coords: coord1Directions = {UP: [], RIGHT: [], DOWN: [], LEFT: []} fo...
0
0
0
0
0
0
parsl/app/errors.py
cylondata/parsl
323
1770157
"""Exceptions raised by Apps.""" from functools import wraps from typing import Callable, List, Union, Any, TypeVar from types import TracebackType import dill import logging from tblib import Traceback from six import reraise from parsl.data_provider.files import File logger = logging.getLogger(__name__) class P...
13
11
0
0
24
0
docs/manual/gears/examples/qcnt.py
bogdanvuk/pygears
120
1770170
<reponame>bogdanvuk/pygears from pygears.lib import qcnt, check, drv from pygears.typing import Uint, Queue drv(t=Queue[Uint[4]], seq=[[1, 2, 3, 4, 5]]) \ | qcnt \ | check(ref=[5])
0
0
0
0
0
0
dppy/exact_sampling.py
JohnnyDeuss/DPPy
176
1770171
# coding: utf8 from __future__ import annotations """ Implementation of finite DPP exact samplers derived from: - the raw **projection** correlation :math:`K` kernel (no need for eigendecomposition) - the eigendecomposition of the correlation :math:`K` kernel .. seealso: `Documentation on ReadTheDocs <https://dp...
26
16
0
0
42
0
DjangoTutorial_v3.5/lesson1/task1/tests_subtask5.py
behzod/pycharm-courses
213
1770183
<filename>DjangoTutorial_v3.5/lesson1/task1/tests_subtask5.py from test_helper import run_common_tests, failed, passed, get_answer_placeholders, test_is_initial_text, \ test_is_not_empty, test_answer_placeholders_text_deleted, do_not_run_on_check def test_answer_placeholders(): placeholders = get_answer_place...
0
0
0
0
0
0
NAS-Models/lib/models/genotypes.py
zhangting2020/AutoDL
155
1770210
<filename>NAS-Models/lib/models/genotypes.py from collections import namedtuple Genotype = namedtuple('Genotype', 'normal normal_concat reduce reduce_concat') # Learning Transferable Architectures for Scalable Image Recognition, CVPR 2018 NASNet = Genotype( normal=[ (('sep_conv_5x5', 1), ('sep_conv_3x3', ...
0
0
0
0
0
0
bridge-dial/example.py
asterisk/ari-examples
102
1770215
#!/usr/bin/env python import logging import requests import ari logging.basicConfig(level=logging.ERROR) client = ari.connect('http://localhost:8088', 'asterisk', 'asterisk') def safe_hangup(channel): """Safely hang up the specified channel""" try: channel.hangup() print "Hung up {}".format...
0
0
0
0
0
0
GCC-paddle/gcc/models/emb/prone.py
S-HuaBomb/Contrib
243
1770237
import networkx as nx import numpy as np import scipy.sparse as sp from scipy import linalg from scipy.special import iv from sklearn import preprocessing from sklearn.utils.extmath import randomized_svd class ProNE(object): def __init__(self, dimension, step: int=5, mu: float=0.2, theta: float=0.5, **kwargs): ...
6
5
0
0
11
0
alex/applications/PublicTransportInfoCS/slu/gen_uniq.py
oplatek/alex
184
1770255
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals if __name__ == '__main__': import autopath import codecs import sys from alex.utils.config import as_project_path from alex.corpustools.wavaskey import save_wavaskey from alex.components.slu.base import CategoryLabelDatabase f...
0
0
0
0
0
0
dm/templates/route/single_route.py
rafaelcavazin/cloud-foundation-toolkit
688
1770256
<filename>dm/templates/route/single_route.py # Copyright 2019 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
0
0
0
0
0
droidlet/dialog/dialogue_manager.py
ali-senguel/fairo
669
1770302
<filename>droidlet/dialog/dialogue_manager.py """ Copyright (c) Facebook, Inc. and its affiliates. """ import logging from typing import Tuple, Dict class DialogueManager(object): """ | The current control flow of dialogue is: | 1. A chat comes in and Dialogue manager reads it or the bot triggers a |...
0
0
0
0
0
0
resources/good/test_message.py
ujja/mime-type-validator
301
1770324
import pytest from pywxclient.core.message import TextMessage, ImageMessage, FileMessage class TestMessage: @pytest.mark.parametrize( 'from_user, to_user, message', ( ('@aaaa', '@bbbbb', 'haahahha'), ('@fwewf', '@swefewfwe', 'heeheheh'), ('@swfewwf', '@wjwejrjwe', '你...
0
0
0
0
0
0
WebMirror/management/rss_parser_funcs/feed_parse_extractBananas.py
fake-name/ReadableWebProxy
193
1770342
<gh_stars>100-1000 def extractBananas(item): """ Parser for 'Bananas' """ badwords = [ 'iya na kao manga chapters', ] if any([bad in item['tags'] for bad in badwords]): return None vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or 'preview' in item['t...
0
0
0
0
0
0
question_templates/scripts/get_unseen_args.py
LouisCastricato/eeqa
142
1770363
<reponame>LouisCastricato/eeqa import json import collections input_file = "./data/ace-event/processed-data/description_queries_new.csv" output_file = "./data/ace-event/processed-data/all_args" out_f = open(output_file, "w") arg_dict = collections.OrderedDict() with open(input_file, "r") as f: for line in f: ...
0
0
0
0
0
0
ampligraph/datasets/__init__.py
chauvu/AmpliGraph
1,794
1770377
# Copyright 2019-2021 The AmpliGraph Authors. All Rights Reserved. # # This file is Licensed under the Apache License, Version 2.0. # A copy of the Licence is available in LICENCE, or at: # # http://www.apache.org/licenses/LICENSE-2.0 # """Helper functions to load knowledge graphs.""" from .datasets import load_fr...
0
0
0
0
0
0
Samples/2.0/AndroidAppTemplate/GenTemplate.py
coolzoom/ogre-next
701
1770438
<reponame>coolzoom/ogre-next<filename>Samples/2.0/AndroidAppTemplate/GenTemplate.py<gh_stars>100-1000 # Simple python3 script that grabs a template project and copies it N times (one per sample) # while replacing strings in some specified files (see genFiles), # eg. %%sampleName%% -> PbsMaterials # # And copies the me...
0
0
0
0
0
0
stashy/projects.py
rkorshakevich/stashy
123
1770501
from __future__ import annotations from .branch_permissions import BranchPermissions from .default_reviewers import DefaultReviewers from .compat import update_doc from .errors import ok_or_error, response_or_error from .helpers import Nested, ResourceBase, IterableResource from .permissions import ProjectPermissions f...
10
16
0
0
26
0