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
cfgov/mega_menu/blocks.py
Colin-Seifer/consumerfinance.gov
156
3300365
<filename>cfgov/mega_menu/blocks.py from itertools import chain from wagtail.core import blocks from wagtail.core.models import Page class LinkBlock(blocks.StructBlock): page = blocks.PageChooserBlock(required=False) text = blocks.CharBlock(required=False) url = blocks.CharBlock(required=False) class L...
0
0
0
0
0
0
robustnessgym/__init__.py
jessevig/robustness-gym
399
3300384
"""Import common classes.""" # flake8: noqa from meerkat.provenance import set_provenance from robustnessgym.logging.utils import ( initialize_logging, set_logging_level, set_logging_level_for_imports, ) initialize_logging() set_provenance() from robustnessgym.core.devbench import DevBench from robustne...
0
0
0
0
0
0
nova/tests/json_ref.py
zjzh/nova
1,874
3300403
# 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 to in...
0
2
0
0
2
0
doubanfm/controller/quit_controller.py
fakegit/douban.fm
783
3300410
#!/usr/bin/env python2 # -*- coding: utf-8 -*- import logging from doubanfm.views import quit_view from doubanfm.controller.lrc_controller import LrcController logger = logging.getLogger('doubanfm') # get logger class QuitController(LrcController): """ 按键控制 """ def __init__(self, player, data, que...
0
0
0
0
0
0
caffe2/python/operator_test/piecewise_linear_transform_test.py
KevinKecc/caffe2
585
3300426
# Copyright (c) 2016-present, Facebook, 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 agreed...
0
13
0
0
13
0
mssqlcli/key_bindings.py
leonqli/mssql-cli
1,237
3300434
<reponame>leonqli/mssql-cli import logging from prompt_toolkit.enums import EditingMode from prompt_toolkit.key_binding import KeyBindings from .filters import has_selected_completion _logger = logging.getLogger(__name__) def mssqlcli_bindings(mssql_cli): """ Custom key bindings for mssqlcli. """ key...
0
0
0
0
0
0
src/pytorch_adapt/layers/sliced_wasserstein.py
KevinMusgrave/pytorch-adapt
131
3300467
import torch from ..utils import common_functions as c_f class SlicedWasserstein(torch.nn.Module): """ Implementation of the loss used in [Sliced Wasserstein Discrepancy for Unsupervised Domain Adaptation](https://arxiv.org/abs/1903.04064) """ def __init__(self, m: int = 128): """ ...
3
2
0
1
6
0
Packs/X509Certificate/Scripts/CertificateReputation/CertificateReputation.py
diCagri/content
799
3300488
from __future__ import annotations import demistomock as demisto from CommonServerPython import * # noqa # pylint: disable=unused-wildcard-import from CommonServerUserPython import * # noqa # pylint: disable=unused-wildcard-import import traceback import dateparser from datetime import timedelta from enum import Enu...
7
5
15
0
27
0
graphlearn/python/config.py
amznero/graph-learn
1,088
3300514
# Copyright 2020 Alibaba Group Holding Limited. 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 ...
3
0
0
0
3
0
CondCore/EcalPlugins/test/inspect.py
ckamtsikis/cmssw
852
3300531
from __future__ import print_function # # I should write a decent test of the python binding... # def dumpSummaries(dbname): db = rdbms.getDB(dbName) tags = db.allTags() for tag in tags.split() : try : # log = db.lastLogEntry(tag) # print log.getState() ...
0
0
0
0
0
0
mnist_saved_model/export_mnist_model.py
tobegit3hub/tensorflow_examples
156
3300546
#!/usr/bin/env python from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data def inference(input) -> object: weights = tf.get_variable( "weights", [784, 10], initializer=t...
0
1
0
0
1
0
src/autogen/quadrature/triangle.py
danielepanozzo/polyfem
228
3300604
<filename>src/autogen/quadrature/triangle.py # -*- coding: utf-8 -*- import math import textwrap import numpy import sympy import quadpy def integrate_exact(f): """ Integrate a function over the reference triangle (0,0), (1,0), (0,1). """ x, y = sympy.symbols('x y') exact = sympy.integrate( ...
0
0
0
0
0
0
tests/psd_tools/psd/test_engine_data.py
afrigon/psd-tools
644
3300633
<reponame>afrigon/psd-tools<gh_stars>100-1000 from __future__ import absolute_import, unicode_literals import os import pytest from psd_tools.psd.engine_data import ( Tokenizer, EngineToken, EngineData, Float, String ) from ..utils import check_read_write, TEST_ROOT @pytest.mark.parametrize( 'fixture, length...
0
0
0
0
0
0
tests/tools/meteorite_gauge_manager_test.py
poros/data_pipeline
110
3300664
# -*- coding: utf-8 -*- # Copyright 2016 Yelp Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
0
0
0
0
0
0
test/apps/_graphql/schema.py
stannum-l/schemathesis
563
3300668
from typing import List, Tuple import strawberry @strawberry.type class Book: title: str author: "Author" @strawberry.type class Author: name: str books: List[Book] TOLKIEN = Author(name="<NAME>", books=[]) JANSSON = Author(name="<NAME>", books=[]) BOOKS = { 1: Book(title="The Fellowship of...
4
5
4
0
13
0
tests/api_resources/test_setup_intent.py
tony/stripe-python
1,078
3300679
from __future__ import absolute_import, division, print_function import stripe TEST_RESOURCE_ID = "seti_123" class TestSetupIntent(object): def test_is_listable(self, request_mock): resources = stripe.SetupIntent.list() request_mock.assert_requested("get", "/v1/setup_intents") assert is...
0
0
0
0
0
0
example/torch/torch_module.py
axbaretto/mxnet
159
3300704
# pylint: skip-file from data import mnist_iterator import mxnet as mx import numpy as np import logging # define mlp use_torch_criterion = False data = mx.symbol.Variable('data') fc1 = mx.symbol.TorchModule(data_0=data, lua_string='nn.Linear(784, 128)', num_data=1, num_params=2, num_outputs=1, name='fc1') act1 = mx...
0
0
0
0
0
0
tests/server/static_files_test.py
sandutsar/voila
1,173
3300718
import pytest import tornado from voila.static_file_handler import TemplateStaticFileHandler async def test_static_file_absolute_path(app, base_url, http_server_client): response_lab = await http_server_client.fetch(f'{base_url}voila/templates/lab/static/voila.js') assert response_lab.code == 200 abspath...
0
0
0
0
0
0
webpy/sample/googlemodules/src/app_forum/controllers/base.py
minixalpha/SourceLearning
118
3300748
<filename>webpy/sample/googlemodules/src/app_forum/controllers/base.py # Author: <NAME> import web import config from app_forum.models import threads from app.helpers import render view = web.template.render('app_forum/views', cache=config.cache, globals=config.globals) class index: def GET(self): ...
0
0
0
0
0
0
Sources/Workflows/tower-alfred-workflow/alp/notification.py
yagosys/AlfredWorkflow.com
2,177
3300749
from __future__ import annotations import threading import objc from Foundation import * from AppKit import * from PyObjCTools import AppHelper import platform import alp.core as core NSUserNotificationActivationTypeNone = 0 NSUserNotificationActivationTypeContentsClicked = 1 NSUserNotificationActivationTypeActionBut...
1
1
0
0
2
0
gdc_client/parcel/download_stream.py
jrouly/gdc-client
139
3300847
<gh_stars>100-1000 # *************************************************************************************** # Title: LabAdvComp/parcel # Author: <NAME> # Date: May 26, 2016 # Code version: 0.1.13 # Availability: https://github.com/LabAdvComp/parcel # ********************************************************************...
0
0
0
0
0
0
scripts/images_overlay.py
sugatoray/data-science-learning
358
3300859
<reponame>sugatoray/data-science-learning import argparse import sys import subprocess from pathlib import Path import math from ds_utils.image_processing import get_imgs_paths # relies on [ImageMagick](http://www.imagemagick.org/Usage/montage/) def main(_=None): parser = argparse.ArgumentParser(description='Vid...
0
0
0
0
0
0
torchelie/recipes/trainandtest.py
Vermeille/Torchelie
117
3300899
from __future__ import annotations import torch import torchelie.callbacks as tcb from torchelie.recipes import Recipe def TrainAndTest(model, train_fun, test_fun, train_loader, test_loader, *, test_every: int=100, ...
5
2
0
0
7
0
Lesson09/max_slice_sum.py
nawang87/codility_lessons
114
3300935
<reponame>nawang87/codility_lessons """ Task:MaxSliceSum Find a maximum sum of a compact subsequence of array elements. A non-empty array A consisting of N integers is given. A pair of integers (P, Q), such that 0 ≤ P ≤ Q < N, is called a slice of array A. The sum of a slice (P, Q) is the total of A[P] + A[P+1] + ... ...
0
0
0
0
0
0
tests/test_apis/test_inference.py
open-mmlab/mmrazor
553
3300937
# Copyright (c) OpenMMLab. All rights reserved. from pathlib import Path import mmcv from mmcls.apis import inference_model from mmdet.apis import inference_detector from mmseg.apis import inference_segmentor from mmrazor.apis import init_mmcls_model, init_mmdet_model, init_mmseg_model def _sync_bn2bn(config: mmcv....
1
5
0
0
6
0
script.video.F4mProxy/lib/flvlib/tags.py
akuala/REPO.KUALA
105
3300957
from __future__ import annotations import os import struct import logging from primitives import * from constants import * from astypes import MalformedFLV from astypes import get_script_data_variable, make_script_data_variable log = logging.getLogger('flvlib.tags') STRICT_PARSING = False def strict_parser() -> obje...
4
10
0
17
31
0
pfp/native/compat_io.py
666asd/pfp
194
3300987
#!/usr/bin/env python # encoding: utf-8 from __future__ import annotations """ This module of native functions is implemented for compatability with 010 editor functions. Some of these functions are nops, some are fully implemented. """ import six import sys from pfp.native import native import pfp.fields import pfp...
0
21
0
0
21
0
spacy/tests/lang/tr/test_parser.py
snosrap/spaCy
22,040
3300994
<filename>spacy/tests/lang/tr/test_parser.py from spacy.tokens import Doc def test_tr_noun_chunks_amod_simple(tr_tokenizer): text = "<NAME>" heads = [1, 1] deps = ["amod", "ROOT"] pos = ["ADJ", "NOUN"] tokens = tr_tokenizer(text) doc = Doc( tokens.vocab, words=[t.text for t in tokens],...
0
0
0
0
0
0
setup_app/pylib/ldif4/__init__.py
qbert2k/jans-setup
178
3301026
import os import sys cur_dir = os.path.dirname(os.path.realpath(__file__)) sys.path.insert(0, cur_dir)
0
0
0
0
0
0
src/contrib/hod/hodlib/Hod/hod.py
hoppinghippo/HadoopMapReduce
194
3301027
#Licensed to the Apache Software Foundation (ASF) under one #or more contributor license agreements. See the NOTICE file #distributed with this work for additional information #regarding copyright ownership. The ASF licenses this file #to you under the Apache License, Version 2.0 (the #"License"); you may not use thi...
0
0
0
0
0
0
demo/demo_3d_mesh.py
yuanming-hu/elements
265
3301102
<reponame>yuanming-hu/elements<gh_stars>100-1000 import taichi as ti import numpy as np import utils from engine.mpm_solver import MPMSolver write_to_disk = False # Try to run on GPU ti.init(arch=ti.cuda, device_memory_GB=3.0) gui = ti.GUI("Taichi Elements", res=512, background_color=0x112F41) mpm = MPMSolver(res=(...
0
0
0
0
0
0
tests/unittests/eventhub_mock_functions/eventhub_cardinality_many/__init__.py
gohar94/azure-functions-python-worker
277
3301107
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. from typing import List import azure.functions as func # This is testing the function load feature for the multiple events annotation def main(events: List[func.EventHubEvent]) -> str: return 'OK_MANY'
1
1
0
0
2
0
siphon/testing.py
DanielWatkins/siphon
164
3301121
# Copyright (c) 2013-2015 Siphon Contributors. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause """Utilities for testing siphon.""" import os.path import vcr def get_recorder(test_file_path) -> object: """Return an appropriate response recorder for the given pat...
0
1
0
0
1
0
doc/ocv.py
bonanza-market/opencv
144
3301126
<reponame>bonanza-market/opencv #!/usr/bin/env python # -*- coding: utf-8 -*- """ ocv domain, a modified copy of sphinx.domains.cpp + shpinx.domains.python. The original copyright is below ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The OpenCV C/C+...
0
0
0
0
0
0
bin/gftools-fix-dsig.py
hyvyys/gftools
150
3301128
#!/usr/bin/env python3 # Copyright 2013,2016 The Font Bakery Authors. # Copyright 2017 The Google Font Tools 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....
0
0
0
0
0
0
libra/dev_pipeliner/regression_split_functions.py
KartikChugh/Libra
2,060
3301138
<gh_stars>1000+ import json import keras import numpy as np from colorama import Fore, Style import pandas as pd import tensorflow as tf from tabulate import tabulate from scipy.spatial.distance import cosine from sklearn.model_selection import cross_val_score from pandas import DataFrame from sklearn.preprocessing imp...
0
0
0
0
0
0
RNS/Utilities/rnstatus.py
krypt0x/Reticulum
254
3301163
#!/usr/bin/env python3 import RNS import argparse from RNS._version import __version__ def size_str(num, suffix: str='B') -> object: units = ['','K','M','G','T','P','E','Z'] last_unit = 'Y' if suffix == 'b': num *= 8 units = ['','K','M','G','T','P','E','Z'] last_unit = 'Y' f...
3
1
0
0
4
0
log-analysis/markdown_helper.py
espittle/aws-deepracer-workshops
1,116
3301164
<filename>log-analysis/markdown_helper.py # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of # the License is located at # # http://aws.amazon.com/a...
0
0
0
0
0
0
third_party/google-endpoints/google/api/config/service_config.py
tingshao/catapult
2,151
3301181
<filename>third_party/google-endpoints/google/api/config/service_config.py # Copyright 2016 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.apa...
0
0
0
0
0
0
beartype/_util/func/utilfuncscope.py
vcokltfre/beartype
1,056
3301189
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2021 Beartype authors. # See "LICENSE" for further details. ''' Project-wide **callable scope** utilities (i.e., functions handling the possibly nested lexical scopes enclosing arbitrary callable...
9
4
2
0
15
0
library/python/runtime_py3/test/test_resources.py
jochenater/catboost
6,989
3301191
# -*- coding: utf-8 -*- import importlib.resources as ir import pytest @pytest.mark.parametrize("package, resource", ( ("resources", "foo.txt"), ("resources.submodule", "bar.txt") )) def test_is_resource_good_path(package, resource): assert ir.is_resource(package, resource) @pytest.mark.parametrize("p...
0
0
0
0
0
0
release/rollback/rolling_restart.py
weiminyu/nomulus
1,644
3301194
# Copyright 2020 The Nomulus 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 applicable...
17
4
0
0
21
0
paper-code/conv2d_cosnorm.py
DengBoCong/nlp-paper
478
3301199
import tensorflow as tf def conv2d_cosnorm(x, w, strides, padding, bias: float=0.0001) -> object: """ conv2d_cosnorm Usage : x : An input Tensor with shape [batch, height, width, channel] w : A convolutional kernel Tensor with shape [height, width, in, out]. (channel == in) strides ...
1
1
0
0
2
0
hatsploit/modules/exploit/linux/dlink/hedwig_code_execution.py
EntySec/HatSploit
139
3301215
<filename>hatsploit/modules/exploit/linux/dlink/hedwig_code_execution.py #!/usr/bin/env python3 # # This module requires HatSploit: https://hatsploit.netlify.app # Current source: https://github.com/EntySec/HatSploit # import struct from hatsploit.lib.module import Module from hatsploit.utils.handler import Handler ...
0
0
0
0
0
0
aioreactive/combine.py
dbrattli/aioreactive
280
3301223
import dataclasses import logging from dataclasses import dataclass from typing import Any, Callable, Generic, Iterable, NoReturn, Tuple, TypeVar, cast from expression.collections import FrozenList, Map, frozenlist, map from expression.core import ( MailboxProcessor, Nothing, Option, Some, TailCall...
40
42
8
0
90
0
cloudbaseinit/tests/metadata/services/test_configdrive.py
andia10240/cloudbase-init
160
3301272
# Copyright 2013 Cloudbase Solutions Srl # # 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 l...
0
0
0
0
0
0
news/middlewares/httpproxy.py
GingerWWW/news_spider
208
3301274
# -*- coding: utf-8 -*- # Define here the models for your spider middleware # # See documentation in: # http://doc.scrapy.org/en/latest/topics/spider-middleware.html from scrapy.exceptions import NotConfigured from tools.proxies import get_proxy, del_proxy class HttpProxyMiddleware(object): """ 代理中间件 "...
0
2
0
1
3
0
sarpy/annotation/afrl_elements/DetailSensorInfo.py
mstewart-vsc/sarpy
119
3301281
<filename>sarpy/annotation/afrl_elements/DetailSensorInfo.py<gh_stars>100-1000 """ Definition for the DetailSensorInfo AFRL labeling object """ __classification__ = "UNCLASSIFIED" __authors__ = ("<NAME>", "<NAME>") # TODO: commentary of field troubles # - Polarization is too restrictive in formatting and has a conc...
0
0
0
0
0
0
tensorflow/python/ops/tensor_array_ops_test.py
EricRemmerswaal/tensorflow
190,993
3301282
# 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
4
0
0
4
0
dataloader/exploader.py
urasakikeisuke/rigidmask
138
3301295
from __future__ import annotations import os import numbers import torch import torch.utils.data as data import torch import torchvision.transforms as transforms import random from PIL import Image, ImageOps import numpy as np import torchvision from . import exp_transforms import pdb import cv2 from utils.flowlib impo...
13
7
0
0
20
0
libsaas/services/bitly/users.py
MidtownFellowship/libsaas
155
3301321
<gh_stars>100-1000 from libsaas.services import base from .resource import BitlyResource class User(BitlyResource): path = 'user' @base.apimethod def info(self, login=None, full_name=None): """ Return or update information about a user. :var login: the bitly login of the user wh...
0
0
0
0
0
0
label_studio/organizations/migrations/0001_squashed_0008_auto_20201005_1552.py
cdpath/label-studio
8,264
3301437
"""This file and its contents are licensed under the Apache License 2.0. Please see the included NOTICE for copyright information and LICENSE for a copy of the license. """ # Generated by Django 3.1.4 on 2021-03-03 07:31 import core.utils.common from django.conf import settings from django.db import migrations, models...
0
0
4
0
4
0
Chapter09/Exercise127/setup.py
eugeniousone/The-Python-Workshop
238
3301468
<filename>Chapter09/Exercise127/setup.py from distutils.core import setup from Cython.Build import cythonize setup( ext_modules = cythonize("sieve_module.py") )
0
0
0
0
0
0
chrome/browser/resources/chromeos/internet_config_dialog/compiled_resources2.gyp
zipated/src
2,151
3301489
<gh_stars>1000+ # Copyright 2018 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. { 'targets': [ { 'target_name': 'internet_config_dialog', 'dependencies': [ '<(DEPTH)/ui/webui/resources/cr_componen...
0
0
0
0
0
0
docs/user_guide/buffers.py
gglin001/poptorch
128
3301501
<filename>docs/user_guide/buffers.py # Copyright (c) 2021 Graphcore Ltd. All rights reserved. import torch import poptorch # counter_model_wrong_start class CounterModel(torch.nn.Module): def __init__(self): super().__init__() self.i = torch.tensor([0.], dtype=torch.float) def forward(self):...
0
0
0
0
0
0
tools/ml-auto-eda/ml_eda/orchestration/analysis_tracker.py
ruchirjain86/professional-services
2,116
3301521
<reponame>ruchirjain86/professional-services # 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-...
0
0
0
0
0
0
utils/language_model.py
jshin49/simpletod
167
3301544
<reponame>jshin49/simpletod import torch import os from transformers import PreTrainedTokenizer # from typing import Dict, List, Tuple from transformers import ( AdamW, get_linear_schedule_with_warmup, ) def get_optimizer_scheduler(args, model, t_total): no_decay = ["bias", "LayerNorm.weight"] optimi...
0
0
0
0
0
0
tower_cli/utils/parser.py
kedark3/tower-cli
363
3301555
<reponame>kedark3/tower-cli<gh_stars>100-1000 # Copyright 2015, Ansible, Inc. # <NAME> <<EMAIL>> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE...
0
0
0
0
0
0
plyplus/common.py
erezsh/plyplus
169
3301574
<filename>plyplus/common.py from weakref import ref from .utils import StringType class ErrorMsg(object): MESSAGE = u"{msg}" def __init__(self, **kw): self.args = kw def __str__(self): return self.MESSAGE.format(**self.args) class SyntaxErrorMsg_Unknown(ErrorMsg): MESSAGE = u"Synta...
0
0
0
0
0
0
mltrace/db/utils.py
vishwanath1306/mltrace
328
3301575
<reponame>vishwanath1306/mltrace from mltrace.db.base import Base from mltrace.db.models import ComponentRun, PointerTypeEnum from sqlalchemy import create_engine from sqlalchemy.engine.reflection import Inspector from sqlalchemy.schema import ( DropConstraint, DropTable, MetaData, Table, ForeignKey...
0
0
0
0
0
0
plugins/dbnd-test-scenarios/src/dbnd_test_scenarios/scheduler_scenarios.py
ipattarapong/dbnd
224
3301623
from random import random from time import sleep from dbnd import pipeline, task @task def fail_randomly(fail_chance: float=0.5) -> str: """made to test retry scenarios in the scheduler""" if random() < fail_chance: raise Exception("This day I fail") else: return "But on this day I succe...
2
3
0
0
5
0
venv/lib/python3.6/site-packages/django/contrib/gis/gdal/raster/const.py
xiegudong45/typeidea
5,079
3301629
""" GDAL - Constant definitions """ from ctypes import ( c_double, c_float, c_int16, c_int32, c_ubyte, c_uint16, c_uint32, ) # See http://www.gdal.org/gdal_8h.html#a22e22ce0a55036a96f652765793fb7a4 GDAL_PIXEL_TYPES = { 0: 'GDT_Unknown', # Unknown or unspecified type 1: 'GDT_Byte', # Eight bit unsigned in...
0
0
0
0
0
0
tests/data/ec2_offer.py
bbrummer/awspricing
195
3301643
<gh_stars>100-1000 BASIC_EC2_OFFER_SKU = '4C7N4APU9GEUZ6H6' BASIC_EC2_OFFER_MODIFIED_FORMAT = {'4C7N4APU9GEUZ6H6': { 'serviceCode': 'AmazonEC2', 'product': { 'productFamily': 'Compute Instance', 'sku' : '4C7N4APU9GEUZ6H6', 'attributes' : { 'servicecode' : 'AmazonEC2', ...
0
0
0
0
0
0
utils/d2s.py
Dai-z/pytorch-superpoint
390
3301646
"""Module used to change 2D labels to 3D labels and vise versa. Mimic function from tensorflow. """ import torch import torch.nn as nn class DepthToSpace(nn.Module): def __init__(self, block_size): super(DepthToSpace, self).__init__() self.block_size = block_size self.block_size_sq = block...
0
2
0
0
2
0
base/lib/pythonbin/jedi/evaluate/compiled/fake.py
threefoldtech/sandbox_osx
445
3301709
<gh_stars>100-1000 """ Loads functions that are mixed in to the standard library. E.g. builtins are written in C (binaries), but my autocompletion only understands Python code. By mixing in Python code, the autocompletion should work much better for builtins. """ import os from itertools import chain from jedi._compa...
0
0
0
0
0
0
data_collection/gazette/spiders/sc_nova_veneza.py
kaiocp/querido-diario
454
3301722
from gazette.spiders.base.fecam import FecamGazetteSpider class ScNovaVenezaSpider(FecamGazetteSpider): name: str = "sc_nova_veneza" FECAM_QUERY: str = "cod_entidade:177" TERRITORY_ID: str = "4211603"
0
0
3
0
3
0
lib/exaproxy/reactor/content/worker.py
oriolarcas/exaproxy
124
3301760
<filename>lib/exaproxy/reactor/content/worker.py # encoding: utf-8 """ worker.py Created by <NAME> on 2011-12-01. Copyright (c) 2011-2013 Exa Networks. All rights reserved. """ from exaproxy.network.functions import connect,isipv4 from exaproxy.network.errno_list import errno_block from exaproxy.network.errno_list i...
0
0
0
0
0
0
example-scripts/voctolight/lib/config.py
0xflotus/voctomix
521
3301803
<gh_stars>100-1000 import logging import os.path from configparser import ConfigParser __all__ = ['Config'] def getlist(self, section, option): return [x.strip() for x in self.get(section, option).split(',')] def fetchServerConfig(self, conn): log = logging.getLogger('Config') log.info("reading server...
0
0
0
0
0
0
RST/ODSAextensions/setup.py
dwgillies/OpenDSA
200
3301826
#!/usr/bin/env python from distutils.core import setup setup(name="OpenDSA eBook", version='1.0', description='Sphinx extensions for writing DSA ebook', author='efouh', author_email="<EMAIL>", url='', packages=['odsa','odsa.avembed', 'odsa.avmetadata', 'odsa.extrtoolembed'], ...
0
0
0
0
0
0
vespene/views/urls.py
Conan-Kudo/vespene
680
3301872
<filename>vespene/views/urls.py # Copyright 2018, <NAME> LLC # License: Apache License Version 2.0 # ------------------------------------------------------------------------- # urls.py - the standard web routes configuration file for Django # ------------------------------------------------------------------------...
0
0
0
0
0
0
interface/backend/images/migrations/0003_imagefile.py
yasiriqbal1/concept-to-clinic-1
346
3301895
<gh_stars>100-1000 # -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-12-05 20:41 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('images', '0002_imageseries_patient_id'),...
0
0
0
0
0
0
experiments/amplification_bots/util.py
mihaivavram/twitterbots
141
3301901
from __future__ import annotations import math # https://medium.com/@ssbothwell/counting-inversions-with-merge-sort-4d9910dc95f0 def merge_sort_inversions(arr) -> tuple[object, int] | tuple[object, object]: if len(arr) == 1: return arr, 0 else: a = arr[:math.floor(len(arr)/2)] b = arr[...
0
1
0
0
1
0
blender/nodes/color/mix_rgb.py
yuanming-hu/elements
265
3301902
<gh_stars>100-1000 import bpy from .. import base def mix_rgb(c1, c2, mode): if mode == 'ADD': res = (c1[0] + c2[0], c1[1] + c2[1], c1[2] + c2[2]) elif mode == 'MULTIPLY': res = (c1[0] * c2[0], c1[1] * c2[1], c1[2] * c2[2]) elif mode == 'SUBTRACT': res = (c1[0] - c2[0], c1[1] - c2...
0
0
0
0
0
0
infer.py
qfwysw/oft
157
3301909
<reponame>qfwysw/oft import time import torch from torchvision.transforms.functional import to_tensor from argparse import ArgumentParser import matplotlib.pyplot as plt from oft import KittiObjectDataset, OftNet, ObjectEncoder, visualize_objects def parse_args(): parser = ArgumentParser() parser.add_argume...
0
0
0
0
0
0
ax/models/tests/test_cbo_lcea.py
trsvchn/Ax
1,803
3301918
#!/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. from unittest import mock import torch from ax.core.search_space import SearchSpaceDigest from ax.models.torch.cbo_lce...
0
0
0
0
0
0
src/oci/marketplace/models/create_publication_details.py
Manny27nyc/oci-python-sdk
249
3301947
# 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 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
0
13
3
12
28
0
tools/iotjs-create-module.py
acrop/iotjs
2,081
3301954
<filename>tools/iotjs-create-module.py #!/usr/bin/env python # Copyright 2018-present Samsung Electronics Co., Ltd. and other contributors # # 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 # #...
0
0
0
0
0
0
aztk/client/base/helpers/node_run.py
Geims83/aztk
161
3302012
<reponame>Geims83/aztk from aztk import error, models from aztk.utils import ssh as ssh_lib def node_run(base_client, cluster_id, node_id, command, internal, container_name=None, timeout=None, block=True): cluster = base_client.get(cluster_id) pool, nodes = cluster.pool, list(cluster.nodes) try: n...
0
0
0
0
0
0
utils/__init__.py
flowlight0/talkingdata-adtracking-fraud-detection
214
3302019
<gh_stars>100-1000 import json import os import time from contextlib import contextmanager import numpy as np def dump_json_log(options, train_results, output_directory): config = json.load(open(options.config)) results = { 'training': { 'trials': train_results, 'average_train...
0
0
0
0
0
0
tests/unit/resources/servers/test_server_profile_templates.py
doziya/hpeOneView
107
3302034
# -*- coding: utf-8 -*- ### # (C) Copyright (2012-2017) Hewlett Packard Enterprise Development LP # # 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 limi...
0
0
0
0
0
0
zippyshare.py
oureveryday/zippyshare-scraper
109
3302044
<gh_stars>100-1000 import time import argparse import requests import loaders import logging from engines.text import TextEngine from engines.js import JSEngine from engines.patterns import utils from concurrent.futures import as_completed, ThreadPoolExecutor class ZippyParser: def __init__(self, workers=10, engi...
0
0
0
0
0
0
tests/util/caches/test_response_cache.py
mlakkadshaw/synapse
9,945
3302058
# Copyright 2021 The Matrix.org Foundation C.I.C. # # 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 a...
7
5
0
0
12
0
chartpy/dashboard/layoutcanvas.py
Joukahainen/chartpy
519
3302064
from __future__ import annotations __author__ = 'saeedamen' # <NAME> # # Copyright 2021 Cuemacro # # 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 # #...
6
6
0
0
12
0
Web/RDExtras/MolDepict.py
kazuyaujihara/rdkit
1,609
3302075
from mod_python import apache import sys, os, tempfile, urllib from WebUtils import General General._version = "1.0.0" def page(req, smiles: str='', width: int=300, height: int=300, highlight: str='[]', numbers: int=0, **kwargs) -> object: req.content_type = 'text/html' page = General.ConstructHtmlHeader(title='...
5
1
0
0
6
0
scripts/random/getVulnersDescription.py
bourbon-hunter/OSCPRepo
2,109
3302076
#!/usr/bin/env python # Goal of this script is to take a vulners url and give you the short description of the CVE # Ideally, this will be run against the vulners nmap output, which will append the description # to each of the findings. # Probably a lot of unnecessary code, but got incredibly frustrated debugging due ...
0
0
0
0
0
0
src/doc/tutorials/tutorial_examples/scripting/listing_5_rendering_a_dataset_to_a_movie.py
visit-dav/vis
226
3302078
########################################### # file: VisIt Scripting Tutorial Listing 5 ########################################### # # 1) Open VisIt # 2) Open 'aneurysm.visit' # 3) Paste and execute via the Commands window, or the CLI. # # import visit_utils, we will use it to help encode our movie from visit_utils im...
0
0
0
0
0
0
tests/test_pool.py
sloev/aioelasticsearch
123
3302098
import pytest from aioelasticsearch import (AIOHttpConnectionPool, Elasticsearch, ImproperlyConfigured) from aioelasticsearch.pool import DummyConnectionPool @pytest.mark.run_loop async def test_mark_dead_removed_connection(auto_close, es_server, loop): es = auto_close(Elasticsearch...
0
0
0
0
0
0
audiomate/processing/pipeline/pool.py
CostanzoPablo/audiomate
133
3302127
<filename>audiomate/processing/pipeline/pool.py<gh_stars>100-1000 import numpy as np from . import base class AvgPool(base.Computation): """ Average a given number of sequential frames into a single frame. If at the end of a stream just the remaining frames are used, no matter how many there are left. ...
0
0
0
0
0
0
vyapp/plugins/range_sel.py
hgdsraj/vy
927
3302144
""" Overview ======== This plugin implements range selection. Key-Commands ============ Namespace: range-sel Mode: NORMAL Event: <Control-k> Description: Add/remove selection one line up from the initial selection mark. Mode: NORMAL Event: <Control-j> Description: Add/remove selection one line down from the in...
0
0
0
0
0
0
reclass/storage/yaml_fs/__init__.py
bbinet/reclass
101
3302152
# # -*- coding: utf-8 -*- # # This file is part of reclass (http://github.com/madduck/reclass) # # Copyright © 2007–14 <NAME> <<EMAIL>> # Released under the terms of the Artistic Licence 2.0 # from __future__ import annotations import os, sys import fnmatch from reclass.storage import NodeStorageBase from yamlfile impo...
2
7
0
0
9
0
rlzoo/algorithms/sac/run_sac.py
tensorlayer/RLzoo
750
3302161
from rlzoo.algorithms.sac.sac import SAC from rlzoo.common.policy_networks import * from rlzoo.common.value_networks import * import gym """ load environment """ env = gym.make('Pendulum-v0').unwrapped # env = DummyVecEnv([lambda: env]) # The algorithms require a vectorized/wrapped environment to run action_s...
0
0
0
0
0
0
external-deps/qdarkstyle/qdarkstyle/palette.py
Earthman100/spyder
7,956
3302202
#!/usr/bin/env python # -*- coding: utf-8 -*- """Base palette mixin.""" # Standard library imports from collections import OrderedDict class Palette(object): ID: None = None # Color COLOR_BACKGROUND_1: str = '' COLOR_BACKGROUND_2: str = '' COLOR_BACKGROUND_3: str = '' COLOR_BACKGROUND_4: s...
1
2
25
0
28
0
redis/asyncio/utils.py
lazToum/redis-py
483
3302209
from typing import TYPE_CHECKING if TYPE_CHECKING: from redis.asyncio.client import Pipeline, Redis def from_url(url, **kwargs) -> object: """ Returns an active Redis client generated from the given database URL. Will attempt to extract the database id from the path url fragment, if none is prov...
1
2
0
1
4
0
tools/perf/cli_tools/flakiness_cli/analysis_unittest.py
sarang-apps/darshan_browser
575
3302210
<reponame>sarang-apps/darshan_browser # Copyright 2018 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 unittest from cli_tools.flakiness_cli import analysis from cli_tools.flakiness_cli import frames from core.exte...
0
0
0
0
0
0
tests/unit/test_arn_component.py
rezamt/skew
190
3302218
<filename>tests/unit/test_arn_component.py # Copyright (c) 2015 Scopely, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
0
0
0
0
0
0
misc/socktest/client_sock.py
PINTO0309/tflite_gles_app
388
3302254
# coding: utf-8 import socket import time import datetime PORT_NUM = 12345 class ClientSocket: def __init__(self): print ('Initialize client socket') self.client_skt = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.client_skt.connect(('127.0.0.1', PORT_NUM)) self.client...
0
1
0
0
1
0
deps/boost/tools/build/test/toolset-mock/src/MockProgram.py
alexhenrie/poedit
1,155
3302264
# Copyright 2017 <NAME> # # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import sys import os import re # Represents a sequence of arguments that must appear # in a fixed order. class ordered: def __init__(se...
0
0
0
0
0
0
src/other/ext/stepcode/src/exp2python/examples/unitary_schemas/test_multiple_inheritance.py
dservin/brlcad
262
3302272
# This file was generated by exp2python. You probably don't want to edit # it since your modifications will be lost if exp2python is used to # regenerate it. import sys from SCL.SCLBase import * from SCL.SimpleDataTypes import * from SCL.ConstructedDataTypes import * from SCL.AggregationDataTypes import * from SCL.Ty...
0
55
0
0
55
0
testing/external/test_natural_language/test_basics/runner.py
remiliacn/nonebot
1,101
3302289
<filename>testing/external/test_natural_language/test_basics/runner.py import asyncio import pytest import nonebot from nonebot.message import Message import testing.external.common.default_config as dc from testing.external.common.client import Client, run_nonebot_in_thread from testing.external.common.pytest import...
0
0
0
0
0
0
lit_nlp/components/tcav_test.py
eichinflo/lit
2,854
3302329
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
0
0
0
0
0
0