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
2016/CVE-2016-2384/poc.py
0xToast/Linux-Kernel-Exploits
1,324
171585
<gh_stars>1000+ #!/usr/bin/env python3 # A part of the proof-of-concept exploit for the vulnerability in the usb-midi # driver. Can be used on it's own for a denial of service attack. Should be # used in conjuction with a userspace part for an arbitrary code execution # attack. # # Requires a Facedancer21 board # (htt...
0
0
0
0
0
0
meross_iot/model/push/common.py
rhasselbaum/MerossIot
375
171592
<reponame>rhasselbaum/MerossIot from meross_iot.model.shared import BaseDictPayload class HardwareInfo(BaseDictPayload): def __init__(self, version=None, uuid=None, type=None, sub_type=None, mac_address=None, chip_time=None, *args, **kwargs): super().__init__(*args, **kwargs) self...
0
0
0
0
0
0
demo/hipaa/tests.py
jeanqasaur/jeeves
253
171602
<reponame>jeanqasaur/jeeves """HIPAA tests. :synopsis: Tests for the HIPAA case study. .. moduleauthor:: <NAME> <<EMAIL>> """ from datetime import date from django.contrib.auth.models import User from django.db import models from django.utils import unittest from django.test import TestCase import JeevesLib fro...
0
0
0
0
0
0
SNMP__pysnmp__examples/get_table__get_CPU.py
gil9red/SimplePyScripts
117
171649
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' # SOURCE: http://www.oidview.com/mibs/0/SNMPv2-MIB.html from typing import Iterator # pip install pysnmp from pysnmp.hlapi import nextCmd, SnmpEngine, CommunityData, UdpTransportTarget, ContextData, ObjectType, ObjectIdentity def get_iterato...
3
1
0
0
4
0
tensorflow/python/keras/utils/metrics_utils_test.py
abhaikollara/tensorflow
848
171670
<filename>tensorflow/python/keras/utils/metrics_utils_test.py<gh_stars>100-1000 # Copyright 2018 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 #...
0
0
0
0
0
0
examples/python/conditional_gate_example.py
CQCL/pytket
249
171677
# # Conditional Execution # Whilst any quantum process can be created by performing "pure" operations delaying all measurements to the end, this is not always practical and can greatly increase the resource requirements. It is much more convenient to alternate quantum gates and measurements, especially if we can use t...
0
0
0
0
0
0
maths/abs_min.py
NavpreetDevpuri/Python
145,614
171687
from __future__ import annotations from .abs import abs_val def abs_min(x: list[int]) -> int: """ >>> abs_min([0,5,1,11]) 0 >>> abs_min([3,-10,-2]) -2 >>> abs_min([]) Traceback (most recent call last): ... ValueError: abs_min() arg is an empty sequence """ if len(x) ==...
1
1
0
0
2
0
kivy/tests/test_uix_relativelayout.py
Galland/kivy
13,889
171706
''' uix.relativelayout tests ======================== ''' import unittest from kivy.base import EventLoop from kivy.input.motionevent import MotionEvent from kivy.uix.relativelayout import RelativeLayout # https://gist.github.com/tito/f111b6916aa6a4ed0851 # subclass for touch event in unit test class UTMotionEvent(...
0
0
0
0
0
0
src/bepasty/storage/__init__.py
Emojigit/bepasty-server
123
171712
import importlib def create_storage(app) -> object: """ Load specified storage and return the object. """ if 'STORAGE' not in app.config: raise Exception("Missing STORAGE config key") storage = importlib.import_module('.' + app.config['STORAGE'], __name__) return storage.create_storag...
0
1
0
0
1
0
server/lib/python3.9/site-packages/stripe/api_resources/issuing/dispute.py
ejanicas-stripe/hotel
1,078
171722
# File generated from our OpenAPI spec from __future__ import annotations from __future__ import absolute_import, division, print_function from stripe import util from stripe.api_resources.abstract import CreateableAPIResource from stripe.api_resources.abstract import ListableAPIResource from stripe.api_resources.abst...
1
1
1
0
3
0
labgraph/loggers/__init__.py
Yunusbcr/labgraph
124
171728
<filename>labgraph/loggers/__init__.py #!/usr/bin/env python3 # Copyright 2004-present Facebook. All Rights Reserved. __all__ = ["Logger", "LoggerConfig"] from .logger import Logger, LoggerConfig
0
0
0
0
0
0
scripts/simpleTest.py
luisriverag/librecaptcha-core
361
171735
import http.client import json import subprocess import os tempDir = os.getenv('XDG_RUNTIME_DIR', '.') conn = http.client.HTTPConnection('localhost', 8888) params = """{ "level": "debug", "media": "image/png", "input_type": "text" }""" def getCaptcha() -> object: conn.request("POST", "/v1/captcha", body=params) ...
0
3
0
0
3
0
streamalert_cli/configure/handler.py
cninja1/streamalert
2,770
171776
<reponame>cninja1/streamalert """ Copyright 2017-present Airbnb, 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 la...
0
0
0
0
0
0
mqtt_io/modules/gpio/gpiod.py
DominicWindisch/mqtt-io
231
171784
""" Linux Kernel 4.8+ libgpiod """ import threading from datetime import datetime, timedelta from typing import TYPE_CHECKING, Any, Callable, Dict, Optional from ...types import ConfigType, PinType from . import GenericGPIO, InterruptEdge, InterruptSupport, PinDirection, PinPUD if TYPE_CHECKING: # pylint: disable...
21
8
4
5
38
0
src/web/genstatic.py
anderson-attilio/runbook
155
171790
#!/usr/bin/python ###################################################################### # Generate static HTML for non dynamic pages ###################################################################### # <NAME> - 01/02/2014 import jinja2 import os import codecs import distutils.core def createFile(path, filename,...
0
1
0
0
1
0
libraries/botbuilder-core/botbuilder/core/queue_storage.py
Fl4v/botbuilder-python
388
171807
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. from abc import ABC, abstractmethod from botbuilder.schema import Activity class QueueStorage(ABC): """ A base class for enqueueing an Activity for later processing. """ @abstractmethod async def queue_...
3
1
0
0
4
0
src/cpu/testers/traffic_gen/GUPSGen.py
hyu-iot/gem5
765
171809
# Copyright (c) 2021 The Regents of the University of California. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyright # notice, this li...
0
0
3
0
3
0
impedance/tests/test_validation.py
FTHuld/impedance.py
110
171815
<reponame>FTHuld/impedance.py from impedance.validation import calc_mu, eval_linKK, residuals_linKK from impedance.validation import get_tc_distribution, linKK, fit_linKK from impedance import preprocessing import numpy as np import pytest def test_eval_linKK(): Rs = np.array([1, 1, 2, 0.5, 0.1]) ts = np.arr...
0
0
0
0
0
0
src/Sastrawi/Stemmer/CachedStemmer.py
ZenaNugraha/PySastrawi
282
171829
<filename>src/Sastrawi/Stemmer/CachedStemmer.py<gh_stars>100-1000 #from Sastrawi.Stemmer.StemmerInterface import StemmerInterface from Sastrawi.Stemmer.Filter import TextNormalizer class CachedStemmer(object): """description of class""" def __init__(self, cache, delegatedStemmer): self.cache = cache ...
0
0
0
0
0
0
scripts/imdb/run_unsupervised.py
skaghzz/dino-korean
113
171874
<reponame>skaghzz/dino-korean # 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
rosreestr2coord/__init__.py
antonsukhanov/rosreestr2coord
121
171888
from rosreestr2coord.parser import Area from rosreestr2coord.version import VERSION
0
0
0
0
0
0
map-word-embeddings/experiment/mapping/model/transform_both_separate.py
UKPLab/arxiv2018-xling-sentence-embeddings
196
171892
import tensorflow as tf from experiment.mapping.model.transform_both import FixSpaceModel from experiment.utils.variables import weight_variable, bias_variable class FixSpaceSeparateTransformationModel(FixSpaceModel): def __init__(self, config, config_global, logger): super(FixSpaceSeparateTransformation...
0
0
0
0
0
0
tests/cpu/test_linear_reorder.py
Manny27nyc/intel-extension-for-pytorch
322
171932
import unittest from common_utils import VerboseTestCase import subprocess class TestLinearReorder(VerboseTestCase): def test_linear_reorder(self): with subprocess.Popen('DNNL_VERBOSE=1 python -u linear_reorder.py', shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) as p: segmentation...
0
0
0
0
0
0
pymtl3/stdlib/queues/enq_deq_ifcs.py
kevinyuan/pymtl3
152
171934
<gh_stars>100-1000 """ ======================================================================== EnqDeqIfc.py ======================================================================== RTL implementation of deq and enq interface. Author: <NAME> Date: Mar 21, 2019 """ from pymtl3 import * from pymtl3.stdlib.ifcs import ...
0
0
0
0
0
0
saas/dataops/api/dataset/APP-META-PRIVATE/postrun/dataset/entry.py
iuskye/SREWorks
407
171961
# coding: utf-8 from . import dataset_interface_init def init(): dataset_interface_init.add_interfaces()
0
0
0
0
0
0
Lib/test/test_compiler/testcorpus/74_class_kwargs.py
diogommartins/cinder
1,886
171967
class Foo(x=42): pass
0
0
0
0
0
0
features/environment.py
simpsonw/atmosphere
197
171972
import dateutil.parser import freezegun from behaving import environment as benv PERSONAS = {} def before_all(context): benv.before_all(context) def after_all(context): benv.after_all(context) def before_feature(context, feature): benv.before_feature(context, feature) def after_feature(context, fea...
0
0
0
0
0
0
packages/core/minos-microservice-networks/minos/networks/testing/brokers/publishers/queues.py
minos-framework/minos-python
247
172001
from minos.common.testing import ( MockedDatabaseClient, ) from minos.networks import ( BrokerPublisherQueueDatabaseOperationFactory, ) from ..collections import ( MockedBrokerQueueDatabaseOperationFactory, ) class MockedBrokerPublisherQueueDatabaseOperationFactory( BrokerPublisherQueueDatabaseOperat...
0
0
0
0
0
0
python/ql/src/Classes/ConflictingAttributesInBaseClasses_Fixed.py
vadi2/codeql
4,036
172010
#Fixed by overriding. This does not change behavior, but makes it explicit and comprehensible. class ThreadingTCPServerOverriding(ThreadingMixIn, TCPServer): def process_request(self, request, client_address): #process_request forwards to do_work, so it is OK to call ThreadingMixIn.process_request ...
0
0
0
0
0
0
moya/tests/test_expose.py
moyaproject/moya
129
172028
<reponame>moyaproject/moya from __future__ import unicode_literals from __future__ import print_function import unittest import os from moya import db from moya import pilot from moya.wsgi import WSGIApplication from moya.console import Console from moya.context import Context from moya.context.tools import set_dyna...
0
0
0
0
0
0
Demos/StockNews/HeadlineReader.py
Joshua0128/ArticutAPI
375
172054
<filename>Demos/StockNews/HeadlineReader.py #!/usr/bin/env python3 # -*- coding:utf-8 -*- try: # Installed via pip install try: from .ArticutAPI import Articut except: from ArticutAPI import Articut except: # Installed via git clone import sys sys.path.append("../..") from A...
0
0
0
0
0
0
riptable/rt_dataset.py
wenjuno/riptable
307
172086
<filename>riptable/rt_dataset.py # -*- coding: utf-8 -*- __all__ = ['Dataset', ] from collections import abc, Counter, namedtuple import operator import os from typing import Any, Callable, Iterable, List, Mapping, Optional, Sequence, Tuple, Union, TYPE_CHECKING import warnings import numpy as np from .r...
0
0
0
0
0
0
tests/app_b/models.py
emihir0/django-schema-graph
316
172151
<filename>tests/app_b/models.py<gh_stars>100-1000 from django.db import models class InterAppForeignKey(models.Model): user = models.ForeignKey("auth.User", on_delete=models.CASCADE)
0
0
0
0
0
0
modelling/src/neuraldb/convert_legacy_predictions.py
j6mes/NeuralDB
213
172175
<reponame>j6mes/NeuralDB # # Copyright (c) 2021 Facebook, Inc. and its affiliates. # # This file is part of NeuralDB. # See https://github.com/facebookresearch/NeuralDB for further info. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License...
0
0
0
0
0
0
packages/jet_bridge_base/jet_bridge_base/messages.py
bokal2/jet-bridge
1,247
172200
<gh_stars>1000+ GET_ACTION_LIST = 'get_action_list' EXECUTE_ACTION = 'execute_action' GET_FIELD_OPTIONS = 'get_field_options' GET_ELEMENT_STATUS = 'get_element_status' message_handlers = {} def add_handler(message_name, func): message_handlers[message_name] = func def get_handler(message_name): return mes...
0
0
0
0
0
0
pylayers/mobility/ban/dist.py
usmanwardag/pylayers
143
172201
import numpy as np import scipy as sp import matplotlib.pyplot as plt import scipy.linalg as la def dist(A,B,C,D,alpha,beta): """ Parameters ---------- A B C D alpha beta Return ------ f g """ AC=C-A CD=D-C BA=A-B u0 = np.dot(AC,AC) u4 = ...
0
0
0
0
0
0
frida-ios-hook/core/utils/log.py
kasnder/frida-ios-hook
354
172215
import logging from colorlog import ColoredFormatter def setup_logging(): logger = logging.getLogger() logger.setLevel(logging.INFO) color_formatter = ColoredFormatter( "%(log_color)s[%(asctime)s] [%(levelname)-4s]%(reset)s - %(message)s", datefmt='%d-%m-%y %H:%M:%S', r...
0
0
0
0
0
0
tests/integration/voice/v1/connection_policy/test_connection_policy_target.py
BrimmingDev/twilio-python
1,362
172259
# 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 ConnectionPolicyTargetTes...
0
0
0
0
0
0
addons/Sprytile-6b68d00/rx/joins/activeplan.py
trisadmeslek/V-Sekai-Blender-tools
733
172263
class ActivePlan(object): def __init__(self, join_observer_list, on_next, on_completed): self.join_observer_list = join_observer_list self.on_next = on_next self.on_completed = on_completed self.join_observers: dict[object,object] = {} for join_observer in self.join_observer_...
0
0
0
1
1
0
asreader/custombricks/metrics.py
rkadlec/asreader
113
172264
<reponame>rkadlec/asreader from blocks.bricks import application from blocks.bricks.cost import Cost import theano.tensor as tt __author__ = 'rkadlec' class CorrectResponseRank(Cost): """Calculates the the rank of a correct response among all competing responses given in the batch. It is assumed that the cor...
0
0
0
0
0
0
Algo and DSA/LeetCode-Solutions-master/Python/maximum-number-of-darts-inside-of-a-circular-dartboard.py
Sourav692/FAANG-Interview-Preparation
3,269
172294
# Time: O(n^2 * logn) # Space: O(n) import math # angle sweep solution # great explanation: # https://leetcode.com/problems/maximum-number-of-darts-inside-of-a-circular-dartboard/discuss/636345/Python-O(n3)-and-O(n2logn)-solution-explained-in-detail-with-pictures class Solution(object): def numPoints(self, poin...
0
2
0
0
2
0
XML/XML_to_python_objects__untagle__examples/from_url.py
DazEB2/SimplePyScripts
117
172314
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' # SOURCE: https://github.com/stchris/untangle # pip install untangle # OR: # pip install git+https://github.com/stchris/untangle.git import untangle obj = untangle.parse('https://news.yandex.ru/games.rss') channel = obj.rss.channel print(chann...
0
0
0
0
0
0
runtime/space/interface.py
cheery/lever
136
172321
<reponame>cheery/lever<filename>runtime/space/interface.py import re from rpython.rlib.objectmodel import compute_hash, specialize, always_inline from rpython.rlib import jit, rgc import space, weakref class Object: _immutable_fields_ = ['interface', 'custom_interface', 'flag', 'number', 'value', 'contents', 'data...
0
0
0
0
0
0
tools/idf_monitor_base/line_matcher.py
cablelabs/esp-idf
8,747
172352
<reponame>cablelabs/esp-idf # Copyright 2015-2021 Espressif Systems (Shanghai) CO LTD # # 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 # # Un...
0
0
0
0
0
0
example/urls.py
marknotfound/django-su
123
172384
<gh_stars>100-1000 from django.conf import settings from django.conf.urls import include, url from django.views.generic import TemplateView from django.contrib import admin admin.autodiscover() urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^su/', include('django_su.urls')), url(r'^$', Template...
0
0
0
0
0
0
sdk/arena-python-sdk/arenasdk/logger/logger.py
thliang01/arena
502
172399
<gh_stars>100-1000 #!/usr/bin/env python from __future__ import annotations import os import sys from typing import List from io import TextIOWrapper class LoggerBuilder(object): def __init__(self): self._args = list() self._accepter = sys.stdout def with_accepter(self, accepter: TextIOWr...
0
0
0
0
0
0
common/src/stack/command/stack/commands/list/host/xml/__init__.py
knutsonchris/stacki
123
172401
<filename>common/src/stack/command/stack/commands/list/host/xml/__init__.py # @copyright@ # Copyright (c) 2006 - 2019 Teradata # All rights reserved. Stacki(r) v5.x stacki.com # https://github.com/Teradata/stacki/blob/master/LICENSE.txt # @copyright@ # # @rocks@ # Copyright (c) 2000 - 2010 The Regents of the University...
0
0
0
0
0
0
alipay/aop/api/response/AlipayPcreditHuabeiPcreditamountQueryprocessorQueryResponse.py
antopen/alipay-sdk-python-all
213
172461
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse from alipay.aop.api.domain.TbapiQueryAmountResponse import TbapiQueryAmountResponse class AlipayPcreditHuabeiPcreditamountQueryprocessorQueryResponse(AlipayResponse): def __init__(self): ...
0
3
0
3
6
0
csp/utils.py
Kyeongan/crowdsource-platform
138
172528
<reponame>Kyeongan/crowdsource-platform from django.core.exceptions import PermissionDenied from oauth2_provider.oauth2_backends import get_oauthlib_core from django.conf import settings from django.utils.functional import SimpleLazyObject from django.contrib.auth import get_user try: # django >= 1.8 && python >= ...
0
0
0
0
0
0
r/example/mobilenet.py
zmxdream/Paddle
17,085
172542
#!/usr/bin/env python3.7 # Copyright (c) 2020 PaddlePaddle 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 ...
0
2
0
0
2
0
tests/opytimizer/core/test_optimizer.py
anukaal/opytimizer
528
172581
<gh_stars>100-1000 import sys import numpy as np from opytimizer.core import function, optimizer from opytimizer.spaces import search def test_optimizer_algorithm(): new_optimizer = optimizer.Optimizer() assert new_optimizer.algorithm == 'Optimizer' def test_optimizer_algorithm_setter(): new_optimize...
0
0
0
0
0
0
scripts/decode.py
appotry/openofdm
200
172588
<reponame>appotry/openofdm<gh_stars>100-1000 #!/usr/bin/env python import os import numpy as np import cmath import collections import itertools import array import math from cStringIO import StringIO import commpy.channelcoding.convcode as cc from wltrace import dot11 LONG_PREAMBLE_TXT =\ """ 0 -0.078 0.000 40...
0
0
0
0
0
0
Source/Services/RPSLS.PythonPlayer.Api/app/pick/rpsls_dto.py
geverghe/RockPaperScissorsLizardSpock
572
172590
<reponame>geverghe/RockPaperScissorsLizardSpock<filename>Source/Services/RPSLS.PythonPlayer.Api/app/pick/rpsls_dto.py import socket from flask import jsonify def get_rpsls_dto_json(pick): return jsonify(text = pick.name, value = pick.value, player=socket.gethostname(), playerType="python")
0
0
0
0
0
0
setup.py
jnirschl/risk-slim
117
172595
<reponame>jnirschl/risk-slim #! /usr/bin/env python # # Copyright (C) 2017 <NAME> import os import sys from setuptools import setup, find_packages from setuptools.extension import Extension #resources #setuptools http://setuptools.readthedocs.io/en/latest/setuptools.html #setuptools + Cython: http://stackoverflow.com...
0
0
0
0
0
0
labgraph/devices/protocols/lsl/tests/test_lsl_node.py
Yunusbcr/labgraph
124
172627
<reponame>Yunusbcr/labgraph from pylsl import StreamInfo, StreamOutlet, StreamInlet, resolve_stream import pytest import asyncio import time from multiprocessing import Process from typing import Sequence from labgraph.graphs import ( AsyncPublisher, Config, Connections, Graph, Module, Node, ...
0
0
0
0
0
0
sdk/python/pulumi_aws/outputs.py
rapzo/pulumi-aws
260
172628
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from . import ...
22
22
0
0
44
0
hypergan/layer_shape.py
limberc/HyperGAN
889
172632
<gh_stars>100-1000 class LayerShape: def __init__(self, *dims): self.dims = dims if len(dims) == 1: self.channels = dims[0] elif len(dims) == 2: self.channels = dims[0] self.height = dims[1] elif len(dims) == 3: self.channels = dims[0] ...
0
0
0
0
0
0
lvsr/bricks/recognizer.py
Fatman003/Actor
178
172710
from __future__ import annotations import copy import logging import numpy import theano from theano import tensor from theano.gradient import disconnected_grad from blocks.bricks import ( Bias, Identity, Initializable, MLP, Tanh, Softmax, Random) from blocks.bricks.attention import SequenceContentAttention from ...
44
29
4
8
85
0
data/transcoder_evaluation_gfg/python/REMAINDER_7_LARGE_NUMBERS.py
mxl1n/CodeGen
241
172739
<reponame>mxl1n/CodeGen<filename>data/transcoder_evaluation_gfg/python/REMAINDER_7_LARGE_NUMBERS.py # 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 ( num ) : ser...
0
0
0
0
0
0
test/integration_test/tools/lib/checker.py
ryoon/lagopus
281
172763
<filename>test/integration_test/tools/lib/checker.py import os import sys import logging from ofp_checker import ofp_checker_start, ofp_checker_stop from ofp_checker import ofp_checker_get_dp, ofp_checker_get_dps from ofp_checker import ofp_checker_send_msg, ofp_checker_recv_msg from ofp_checker import OFPChecker from...
0
0
0
0
0
0
test/tests/imageserver/test_os_image_service.py
arunrordell/RackHD
451
172769
<reponame>arunrordell/RackHD ''' Copyright 2017 Dell Inc. or its subsidiaries. All Rights Reserved. Author(s): <NAME> This test validate the image-service of RackHD. It use OS iso file stored in remote server server to load on the image-service server. This test will create os repo in the server and then go thr...
0
0
0
0
0
0
pymzml/utils/SQListeConnector.py
RJMW/pymzML
117
172777
import sqlite3 import xml.etree.ElementTree as et from pymzml import spec from pymzml.run import Reader def create_database_from_file(db_name, file_path) -> bool: conn = sqlite3.connect(db_name + ".db") Run = Reader("./tests/data/example.mzML") with conn: cursor = conn.cursor() cursor.exec...
0
4
0
0
4
0
litex/build/dfu.py
osterwood/litex
1,501
172788
<gh_stars>1000+ # # This file is part of LiteX. # # Copyright (c) 2020 <NAME> <<EMAIL>> # SPDX-License-Identifier: BSD-2-Clause import subprocess from litex.build.tools import write_to_file from litex.build.generic_programmer import GenericProgrammer # DFUProg --------------------------------------------------------...
0
0
0
0
0
0
transmission.py
anast20sm/Addarr
135
172793
import os import yaml from telegram import InlineKeyboardButton, InlineKeyboardMarkup from telegram.ext import ConversationHandler from commons import authentication, checkAdmin, checkId from config import config from translations import i18n config = config["transmission"] TSL_LIMIT = 'limited' TSL_NORMAL = 'norma...
0
2
0
0
2
0
src/reader/_plugins/__init__.py
mirekdlugosz/reader
205
172795
from __future__ import annotations """ Plug-in infrastructure. Not stable. Also package containing **unstable** plugins shipped with reader. Note that while the plugin entry points (import names) are relatively stable, the contents of the actual plugins is not. """ import functools from contextlib import contextmana...
1
1
0
0
2
0
lib/yahoo/sports/fantasy/views.py
goztrk/django-htk
206
172818
<reponame>goztrk/django-htk<filename>lib/yahoo/sports/fantasy/views.py # Django Imports from django.contrib.auth.decorators import login_required from django.http import Http404 from django.shortcuts import redirect from django.template import Context from django.template import loader from django.urls import reverse ...
0
0
0
0
0
0
tests/commands/test_release.py
williamirick/hatch
2,549
172858
import os from click.testing import CliRunner from twine.utils import TEST_REPOSITORY from hatch.cli import hatch from hatch.env import install_packages from hatch.settings import SETTINGS_FILE, copy_default_settings, save_settings from hatch.utils import env_vars, temp_chdir, temp_move_path from hatch.venv import cr...
0
0
0
0
0
1
promgen/tests/notification/test_webhook.py
kackey0-1/promgen
913
172885
# Copyright (c) 2017 LINE Corporation # These sources are released under the terms of the MIT license: see LICENSE from unittest import mock from requests.exceptions import RequestException from django.test import override_settings from promgen import models, rest, tests from promgen.notification.webhook import Not...
0
0
1
0
1
0
SoftLayer/fixtures/SoftLayer_Network_CdnMarketplace_Metrics.py
dvzrv/softlayer-python
126
172955
<filename>SoftLayer/fixtures/SoftLayer_Network_CdnMarketplace_Metrics.py<gh_stars>100-1000 getMappingUsageMetrics = [ { "names": [ "TotalBandwidth", "TotalHits", "HitRatio" ], "totals": [ "0.0", "0", "0.0" ], ...
0
0
0
0
0
0
dragonfire/odqa.py
ismlkrkmz/Dragonfire
1,320
172963
<reponame>ismlkrkmz/Dragonfire #!/usr/bin/python3 # -*- coding: utf-8 -*- """ .. module:: odqa :platform: Unix :synopsis: the top-level submodule of Dragonfire that contains the classes related to **ODQA**: Dragonfire's DeepPavlov SQuAD BERT model based Open-Domain Question Answering Engine. .. moduleauthor::...
0
0
0
0
0
0
lib/PyAMF-0.6.1/pyamf/adapters/_google_appengine_ext_db.py
MiCHiLU/google_appengine_sdk
790
172988
# Copyright (c) The PyAMF Project. # See LICENSE.txt for details. from __future__ import annotations """ Google App Engine adapter module. Sets up basic type mapping and class mappings for using the Datastore API in Google App Engine. @see: U{Datastore API on Google App Engine<http:// code.google.com/appengine/d...
5
11
1
0
17
0
machine_learning/ml_resampling.py
gautard/pystatsml
123
173000
''' Resampling methods ================== ''' import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from sklearn import datasets import sklearn.linear_model as lm from sklearn.model_selection import train_test_split, KFold, PredefinedSplit from sklearn.model_selection import cro...
0
3
0
0
3
0
awx/main/routing.py
DamoR25/awxnew
11,396
173009
import redis import logging from django.conf.urls import url from django.conf import settings from channels.auth import AuthMiddlewareStack from channels.routing import ProtocolTypeRouter, URLRouter from . import consumers logger = logging.getLogger('awx.main.routing') class AWXProtocolTypeRouter(ProtocolTypeRou...
0
0
0
0
0
0
tests/test_resource_tracker/test_api/test_resource_group_api_views/test_rg_attribute_definition_api_views/test_create.py
LaudateCorpus1/squest
112
173013
from rest_framework import status from rest_framework.reverse import reverse from resource_tracker.models import ResourceGroupAttributeDefinition from tests.test_resource_tracker.test_api.base_test_api import BaseTestAPI class TestAttributeDefinitionCreate(BaseTestAPI): def setUp(self): super(TestAttrib...
0
0
0
0
0
0
social/storage/peewee_orm.py
raccoongang/python-social-auth
1,987
173071
from social_peewee.storage import database_proxy, BaseModel, PeeweeUserMixin, \ PeeweeNonceMixin, PeeweeAssociationMixin, PeeweeCodeMixin, BasePeeweeStorage
0
0
0
0
0
0
lineflow/datasets/conll2000.py
yasufumy/textflow
138
173086
<reponame>yasufumy/textflow import gzip import io import os import pickle from functools import lru_cache from typing import Dict, List import gdown from lineflow import download from lineflow.core import Dataset def get_conll2000() -> Dict[str, List[str]]: url = 'https://www.clips.uantwerpen.be/conll2000/chun...
0
0
0
0
0
0
OmniDB/OmniDB_app/views/polling.py
lejmr/OmniDB
2,982
173125
<gh_stars>1000+ from django.http import HttpResponse from django.template import loader from django.http import JsonResponse from django.core import serializers from django.shortcuts import redirect from datetime import datetime from math import ceil import json import time import threading import OmniDB_app.include.Sp...
0
0
0
0
0
0
cloudflare_ddns.py
thatjpk/cloudflare-ddns
150
173202
<filename>cloudflare_ddns.py #!/usr/bin/env python # # CloudFlare DDNS script. # # usage: # cloudflare_ddns.py [config] # # See README for details # import requests import json import time import yaml import os import sys from subprocess import Popen, PIPE # CloudFlare api url. CLOUDFLARE_URL = 'https://api.cloudfl...
0
0
0
0
0
0
src/spn/tests/test_cpp_binary.py
tkrons/SPFlow_topdownrules
199
173206
import unittest import numpy as np from spn.algorithms.Inference import log_likelihood from spn.algorithms.MPE import mpe from spn.io.CPP import get_cpp_function, setup_cpp_bridge, get_cpp_mpe_function from spn.io.Graphics import plot_spn from spn.structure.Base import get_nodes_by_type from spn.structure.leaves.para...
0
0
0
0
0
0
src/hdusd/usd_nodes/nodes/usd_to_blender.py
VascoPi/BlenderUSDHydraAddon
212
173224
# ********************************************************************** # Copyright 2020 Advanced Micro Devices, 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.o...
0
1
5
0
6
0
pororo/models/p2g.py
jayten42/pororo
1,137
173251
# Copyright (c) <NAME>. All Rights Reserved from __future__ import annotations import pickle import torch import torch.nn as nn from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence from torch.utils.data import DataLoader, Dataset UNK_TOKEN = "<UNK>" # 0 PAD_TOKEN = "<PAD>" # 1 class P2gM(obje...
5
6
0
3
14
0
071_Noise2Noise/test_model.py
IgiArdiyanto/PINTO_model_zoo
1,529
173298
import argparse import numpy as np from pathlib import Path import cv2 from model import get_model from noise_model import get_noise_model import sys import tensorflow as tf from tensorflow.python.framework.convert_to_constants import convert_variables_to_constants_v2 import tensorflow_datasets as tfds def get_args()...
0
3
0
0
3
0
vimiv/__init__.py
karlch/vimiv
268
173334
<filename>vimiv/__init__.py # vim: ft=python fileencoding=utf-8 sw=4 et sts=4 """vimiv init: tests some imports and imports main.""" import sys __license__ = "MIT" __version__ = "0.9.2.dev0" __author__ = __maintainer__ = "<NAME>" __email__ = "<EMAIL>" try: from gi import require_version require_version("Gtk"...
0
0
0
0
0
0
tests/test_models/test_necks/test_densecl_neck.py
mitming/mmselfsup
355
173341
# Copyright (c) OpenMMLab. All rights reserved. import torch import torch.nn as nn from mmselfsup.models.necks import DenseCLNeck def test_densecl_neck(): neck = DenseCLNeck(16, 32, 16) assert isinstance(neck.mlp, nn.Sequential) assert isinstance(neck.mlp2, nn.Sequential) assert neck.mlp[0].in_featur...
0
0
0
0
0
0
django_file_form/widgets.py
kosior/django-file-form
133
173372
from __future__ import annotations import json from typing import Dict, Union from django.forms import ClearableFileInput from django.http import QueryDict from django.utils.datastructures import MultiValueDict from django.utils.translation import gettext as _ from django_file_form.util import compact from .uploaded_f...
11
7
1
0
19
0
tests/test_utilities.py
osynge/flowpipe
139
173384
from __future__ import print_function import pytest from hashlib import sha256 import json import re import sys import numpy as np import flowpipe.utilities as util class WeirdObject(object): """An object that is not json serializable and has no bytes() interface.""" foo: str = "bar" def test_node_enco...
0
0
1
0
1
0
tests/unit/test_meta_model_repurposer.py
apaleyes/xfer
244
173387
# 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://www.apache.org/licenses/LICENSE-2.0 # # or in th...
1
1
1
0
3
0
examples/photos/tests.py
jpwatts/django-positions
118
173393
<gh_stars>100-1000 from django.test import TestCase import doctest import unittest import pprint from examples.photos.forms import PhotoForm from examples.photos.models import Album, Photo class PhotosTestCase(TestCase): def setUp(self): self.album = Album.objects.create(name="Vacation") self.baham...
0
0
0
0
0
0
Validation/HGCalValidation/test/python/standalone_fromRECO.py
Purva-Chaudhari/cmssw
852
173394
import FWCore.ParameterSet.Config as cms from Configuration.Eras.Era_Phase2C11M9_cff import Phase2C11M9 process = cms.Process('HGCAL',Phase2C11M9) # import of standard configurations process.load('Configuration.StandardSequences.Services_cff') process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Conf...
0
0
0
0
0
0
tests/nlu_core_tests/component_tests/classifier_tests/yake_tests.py
milyiyo/nlu
480
173403
import unittest from tests.test_utils import get_sample_pdf_with_labels, get_sample_pdf, get_sample_sdf, get_sample_pdf_with_extra_cols, get_sample_pdf_with_no_text_col ,get_sample_spark_dataframe from nlu import * class TestYake(unittest.TestCase): def test_yake_model(self): #setting meta to true will ou...
0
0
0
0
0
0
trello/exceptions.py
x-magic/py-trello
740
173410
# -*- coding: utf-8 -*- class ResourceUnavailable(Exception): """Exception representing a failed request to a resource""" def __init__(self, msg, http_response): Exception.__init__(self) self._msg = msg self._status = http_response.status_code def __str__(self) -> object: ...
0
1
0
0
1
0
observations/r/cement.py
hajime9652/observations
199
173421
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import csv import numpy as np import os import sys from observations.util import maybe_download_and_extract def cement(path) -> tuple[object, object]: """Heat Evolved by Setting Cem...
0
1
0
0
1
0
manuscript/img-src/prepie.py
ssloy/least-squares-course
129
173519
<filename>manuscript/img-src/prepie.py import numpy as np fa = 1 # left constraint fb = 3 # right constraint n = 40 x = np.linspace(0, 2*np.pi, n) g = [np.sin(p) for p in x] A = np.matrix(np.zeros((n-1,n-2))) b = np.matrix(np.zeros((n-1,1))) A[0,0] = 1 b[0,0] = fa + g[1]-g[0] A[n-2, n-3] = -1 b[n-2,0] ...
0
0
0
0
0
0
cirq-google/cirq_google/experimental/noise_models/compare_generated_noise_to_metrics.py
peterse/Cirq
3,326
173528
<filename>cirq-google/cirq_google/experimental/noise_models/compare_generated_noise_to_metrics.py # coverage: ignore import cirq_google import numpy as np from cirq.devices.noise_properties import NoiseModelFromNoiseProperties from cirq_google.experimental.noise_models.calibration_to_noise_properties import ( noise...
0
0
0
0
0
0
cape_privacy/spark/utils.py
vismaya-Kalaiselvan/cape-python
144
173564
import pyspark from packaging import version from pyspark import sql _3_0_0_VERSION = version.Version("3.0.0") _spark_version = version.parse(pyspark.__version__) def configure_session(sess: sql.SparkSession, arrow: bool=True) -> object: if arrow: if _spark_version >= _3_0_0_VERSION: sess.con...
4
2
0
0
6
0
sdk/graphrbac/azure-graphrbac/azure/graphrbac/models/graph_rbac_management_client_enums.py
rsdoherty/azure-sdk-for-python
2,728
173616
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
0
0
4
0
4
0
test/countries/test_estonia.py
m-ganko/python-holidays
654
173666
<reponame>m-ganko/python-holidays # -*- coding: utf-8 -*- # python-holidays # --------------- # A fast, efficient Python library for generating country, province and state # specific sets of holidays on the fly. It aims to make determining whether a # specific date is a holiday as fast and flexible as possible. #...
0
0
0
0
0
0
reql/gen.py
bblackcblackc/librethinkdbxx
107
173694
from sys import argv from re import sub, finditer, VERBOSE def gen(defs): indent = 0 enum = False def p(s): print(" " * (indent * 4) + s) for item in finditer(""" (?P<type> message|enum) \\s+ (?P<name> \\w+) \\s* \\{ | (?P<var> \\w+) \\s* = \\s* (?P<val> \\w+) \\s* ; | \\} ...
0
0
0
0
0
0
examples/tutorial/outline-cube.py
Frekby/glumpy
1,074
173707
<gh_stars>1000+ # ----------------------------------------------------------------------------- # Copyright (c) 2009-2016 <NAME>. All rights reserved. # Distributed under the (new) BSD License. # ----------------------------------------------------------------------------- import numpy as np from glumpy import app, gl,...
0
0
0
0
0
0
insights/parsers/tests/test_limits_conf.py
mglantz/insights-core
121
173709
from insights.parsers.limits_conf import LimitsConf from insights.tests import context_wrap LIMITS_CONF = """ #oracle soft nproc 2047 #oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 oracle soft stack 10240 oracle hard stack 3276 root soft nproc unlimited """.strip() LIMITS_CONF_...
0
0
0
0
0
0