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 |
|---|---|---|---|---|---|---|---|---|---|---|
oatomobile/__init__.py | jannikwagner/oatomobile | 152 | 1662182 | # Copyright 2020 The OATomobile 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 |
venv/Lib/site-packages/ipywidgets/widgets/widget_date.py | ajayiagbebaku/NFL-Model | 603 | 1662193 | <gh_stars>100-1000
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
"""Color class.
Represents an HTML Color .
"""
from .widget_description import DescriptionWidget
from .valuewidget import ValueWidget
from .widget import register
from .widget_core import CoreWidge... | 0 | 0 | 0 | 0 | 0 | 0 |
plugins/droidian.py | maldroid/maldrolyzer | 105 | 1662201 | <gh_stars>100-1000
from templates import Plugin
import base64
class Droidian(Plugin):
NAME = 'droidian'
def recon(self):
for cls in self.dvm.get_classes():
for field in cls.get_fields():
if field.name in ['backupURL', 'encodedURL']:
self.droidian_service = cls
return True
return False
def ... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/__init__.py | kaixinguo360/genpac | 2,331 | 1662206 | <filename>tests/__init__.py
def setup_module(module):
print('setup_module')
def teardown_module(module):
print('teardown_module')
| 0 | 0 | 0 | 0 | 0 | 0 |
.modules/.recon-ng/modules/recon/contacts-domains/migrate_contacts.py | termux-one/EasY_HaCk | 1,103 | 1662229 | from recon.core.module import BaseModule
import os
import re
class Module(BaseModule):
meta: dict[str,str | tuple[str]] = {
'name': 'Contacts to Domains Data Migrator',
'author': '<NAME> (@LaNMaSteR53)',
'description': 'Adds a new domain for all the hostnames associated with email addresse... | 0 | 0 | 1 | 0 | 1 | 0 |
Z - Tool Box/LaZagne/Linux/lazagne/softwares/sysadmin/shadow.py | dfirpaul/Active-Directory-Exploitation-Cheat-Sheet-1 | 1,290 | 1662257 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import crypt
import os
from lazagne.config.module_info import ModuleInfo
from lazagne.config.dico import get_dic
class Shadow(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'shadow', 'sysadmin')
def dictionary_attack(self, user, crypt_pwd):
... | 0 | 0 | 0 | 0 | 0 | 0 |
pulsar/utils/system/winprocess.py | PyCN/pulsar | 1,410 | 1662274 | import sys
import os
from multiprocessing import forking, process, freeze_support
from multiprocessing.util import _logger, _log_to_stderr
WINEXE = forking.WINEXE
def get_preparation_data(name) -> object:
'''
Return info about parent needed by child to unpickle process object.
Monkey-patch fro... | 0 | 1 | 0 | 0 | 1 | 0 |
salesforce/dbapi/__init__.py | agilentia/django-salesforce | 251 | 1662314 | <filename>salesforce/dbapi/__init__.py
"""
Simplified Python DB API 2.0 driver for Salesforce - (independent on Django)
https://www.python.org/dev/peps/pep-0249/
A basic SQL SELECT and a small part of PEP 0249 is currently implemented here.
Transactions will be never implemented.
SQL commands INSERT, UPDATE and DELET... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/zeus/tasks/test_testcase_rollups.py | getsentry/zeus | 221 | 1662329 | <reponame>getsentry/zeus
from zeus import factories
from zeus.models import TestCaseMeta, TestCaseRollup
from zeus.tasks import rollup_testcase, rollup_testcases_for_job
def test_rollup_testcases_for_job(mocker, db_session, default_revision, default_tenant):
mock_delay = mocker.patch("zeus.config.celery.delay")
... | 0 | 0 | 0 | 0 | 0 | 0 |
services/migration_service/migration_config.py | runsascoded/metaflow-service | 103 | 1662334 | <filename>services/migration_service/migration_config.py
from services.utils import DBConfiguration
db_conf = DBConfiguration()
| 0 | 0 | 0 | 0 | 0 | 0 |
test/backend/test_api/test_link.py | bnbwebexpertise/linkr | 124 | 1662342 | <reponame>bnbwebexpertise/linkr<gh_stars>100-1000
import linkr # flake8: noqa: F401
import mock
import webpreview
import util.recaptcha
import util.response
from test.backend.factory import LinkFactory
from test.backend.factory import UserFactory
from test.backend.test_case import LinkrTestCase
from uri.link import ... | 0 | 0 | 0 | 0 | 0 | 0 |
demos/python/sdk_wireless_camera_control/open_gopro/ble/controller.py | Natureshadow/OpenGoPro | 210 | 1662344 | # controller.py/Open GoPro, Version 2.0 (C) Copyright 2021 GoPro, Inc. (http://gopro.com/OpenGoPro).
# This copyright was auto-generated on Tue Sep 7 21:35:53 UTC 2021
"""BLE Controller Interface Definition."""
import logging
from abc import ABC, abstractmethod
from typing import Callable, Generic, Pattern, TypeVar
... | 15 | 8 | 0 | 0 | 23 | 0 |
nncf/tensorflow/helpers/model_manager.py | GreenWaves-Technologies/nncf | 136 | 1662354 | <filename>nncf/tensorflow/helpers/model_manager.py
"""
Copyright (c) 2022 Intel Corporation
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
Unles... | 0 | 0 | 0 | 0 | 0 | 0 |
utils/mod_fixes.py | kishorkunal-raj/content | 1,138 | 1662363 | #!/usr/bin/env python3
import sys
import os
import argparse
import subprocess
import json
import ssg.build_remediations
import ssg.fixes
import ssg.rule_yaml
import ssg.utils
SSG_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
REMEDIATION_LANGS = list(ssg.build_remediations.REMEDIATION_TO_EXT_M... | 0 | 2 | 0 | 0 | 2 | 0 |
mudpi/extensions/picamera/camera.py | icyspace/mudpi-core | 163 | 1662368 | """
Picamera Interface
Connects to a raspberry pi camera
through the picamera library.
"""
from picamera import PiCamera
from mudpi.exceptions import ConfigError
from mudpi.extensions import BaseInterface
from mudpi.extensions.camera import Camera
from mudpi.logger.Logger import Logger, LOG_LEVEL
class I... | 2 | 3 | 0 | 0 | 5 | 0 |
smartsheet/token.py | bromic007/smartsheet-python-sdk | 106 | 1662375 | <filename>smartsheet/token.py
# pylint: disable=C0111,R0902,R0913
# Smartsheet Python SDK.
#
# Copyright 2016 Smartsheet.com, 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:... | 0 | 0 | 0 | 0 | 0 | 0 |
python/tvm/meta_schedule/testing/tlcbench.py | XiaoSong9905/tvm | 4,640 | 1662418 | # 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 u... | 2 | 3 | 0 | 0 | 5 | 0 |
yinyang/src/parsing/SMTLIBv2Lexer.py | rainoftime/yinyang | 143 | 1662428 | # Generated from SMTLIBv2.g4 by ANTLR 4.9.2
from __future__ import annotations
from antlr4 import *
from io import StringIO
import sys
if sys.version_info[1] > 5:
from typing import TextIO
else:
from typing.io import TextIO
def serializedATN() -> object:
with StringIO() as buf:
buf.write("\3\u608... | 2 | 1 | 145 | 2 | 150 | 0 |
Ryven/packages/auto_generated/sndhdr/nodes.py | tfroehlich82/Ryven | 2,872 | 1662477 | <gh_stars>1000+
from NENV import *
import sndhdr
class NodeBase(Node):
pass
class Get_Long_Be_Node(NodeBase):
"""
"""
title = 'get_long_be'
type_ = 'sndhdr'
init_inputs = [
NodeInputBP(label='b'),
]
init_outputs = [
NodeOutputBP(type_='data'),
]
color =... | 0 | 0 | 0 | 0 | 0 | 0 |
datasets/RTFM/rtfm/dynamics/item/armour/dragon_suits.py | TianhaoFu/MultiBench | 148 | 1662501 | <gh_stars>100-1000
# Copyright (c) Facebook, Inc. and its affiliates.
# 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 .base_armour import Armour
from ... import material as M
class BaseDragonSuit(Armour):
pass
... | 0 | 0 | 0 | 0 | 0 | 0 |
accounts/migrations/0003_auto_20200604_0930.py | NGXTDN/webvirtcloud | 1,246 | 1662531 | <reponame>NGXTDN/webvirtcloud
# Generated by Django 2.2.12 on 2020-06-04 09:30
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0002_permissionset'),
]
operations = [
migrations.AlterField(
... | 0 | 0 | 0 | 0 | 0 | 0 |
grr/server/grr_response_server/gui/api_plugins/__init__.py | nkrios/grr | 4,238 | 1662537 | #!/usr/bin/env python
"""GRR restful API rendering plugins."""
| 0 | 0 | 0 | 0 | 0 | 0 |
app/apis/api_b/submod.py | tomosolutions/python-fastapi-template | 371 | 1662543 | # This a dummy module
# This gets called in the module_main.py file
from __future__ import annotations
import random
def rand_gen(num: int) -> dict[str, int]:
num = int(num)
d = {
"seed": num,
"random_first": random.randint(0, num),
"random_second": random.randint(0, num),
}
... | 1 | 1 | 0 | 0 | 2 | 0 |
docs/conf.py | tom3131/simfin | 231 | 1662562 | <reponame>tom3131/simfin<filename>docs/conf.py
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup ------------------------... | 0 | 0 | 0 | 0 | 0 | 0 |
dataset/__init__.py | NotMorven/cavaface.pytorch | 329 | 1662565 | from dataset.datasets import MXFaceDataset, SyntheticDataset
from dataset.randaugment import RandAugment
from dataset.utils import *
| 0 | 0 | 0 | 0 | 0 | 0 |
unittest/python/bindings_centroidal_dynamics_derivatives.py | thanhndv212/pinocchio | 716 | 1662606 | <filename>unittest/python/bindings_centroidal_dynamics_derivatives.py
import unittest
from test_case import PinocchioTestCase as TestCase
import pinocchio as pin
import numpy as np
class TestDeriavtives(TestCase):
def setUp(self):
self.model = pin.buildSampleModelHumanoidRandom()
self.data = self... | 0 | 0 | 0 | 0 | 0 | 0 |
dockerscan/core/helpers.py | michalkoczwara/dockerscan | 1,286 | 1662666 | """
This file contains utils and reusable functions
"""
import logging
from collections import namedtuple
from contextlib import contextmanager
log = logging.getLogger("dockerscan")
def dict_to_obj(data) -> object:
"""
Transform an input dict into a object.
>>> data = dict(hello="world", bye="see you")... | 2 | 2 | 0 | 0 | 4 | 0 |
src/pynwb/io/image.py | Asif54321/pynwb | 132 | 1662678 | <gh_stars>100-1000
from .. import register_map
from ..image import ImageSeries
from .base import TimeSeriesMap
@register_map(ImageSeries)
class ImageSeriesMap(TimeSeriesMap):
def __init__(self, spec):
super().__init__(spec)
external_file_spec = self.spec.get_dataset('external_file')
self.... | 0 | 0 | 0 | 0 | 0 | 0 |
mwclient/util.py | mikiec84/mwclient | 214 | 1662684 | import time
import io
def parse_timestamp(t) -> object:
"""Parses a string containing a timestamp.
Args:
t (str): A string containing a timestamp.
Returns:
time.struct_time: A timestamp.
"""
if t is None or t == '0000-00-00T00:00:00Z':
return time.struct_time((0, 0, 0, 0,... | 0 | 1 | 0 | 0 | 1 | 0 |
pyeit/io/ewd.py | fzouari/pyEIT | 107 | 1662732 | # pylint: disable=no-member, invalid-name, too-many-instance-attributes
"""
load raw EWD into memory
"""
# Copyright (c) <NAME>. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
import os
from struct import unpack
import numpy as np
class EWD:
"""EIT raw/waveform data... | 0 | 2 | 0 | 2 | 4 | 0 |
common/src/stack/command/stack/commands/load/plugin_environment.py | kmcm0/stacki | 123 | 1662782 | # @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@
import stack.commands
class Plugin(stack.commands.Plugin):
def provides(self) -> str:
return 'environment'
def run(self, section):
sel... | 0 | 1 | 0 | 0 | 1 | 0 |
titus/test/lib/prob/testDist.py | jmilleralpine/hadrian | 127 | 1662823 | #!/usr/bin/env python
# Copyright (C) 2014 Open Data ("Open Data" refers to
# one or more of the following companies: Open Data Partners LLC,
# Open Data Research LLC, or Open Data Capital LLC.)
#
# This file is part of Hadrian.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this... | 0 | 0 | 0 | 0 | 0 | 0 |
duckling/test/test_duckling_wrapper.py | spenly/python-duckling | 129 | 1662841 | <filename>duckling/test/test_duckling_wrapper.py
import pytest
from datetime import time, date, timedelta, datetime
from dateutil import parser
from dateutil.tz import tzlocal
from duckling import DucklingWrapper, Dim
@pytest.fixture(scope='module')
def duckling_wrapper():
return DucklingWrapper()
@pytest.fixtu... | 0 | 0 | 0 | 0 | 0 | 0 |
Chapter04/python/2.0.0/com/sparksamples/plot_user_ages.py | quguiliang/Machine-Learning-with-Spark-Second-Edition | 112 | 1662873 | <filename>Chapter04/python/2.0.0/com/sparksamples/plot_user_ages.py
import matplotlib
import matplotlib.pyplot as plt
from util import get_user_data
def main():
user_data = get_user_data()
user_ages = user_data.select('age').collect()
user_ages_list = []
user_ages_len = len(user_ages)
for i in ra... | 0 | 0 | 0 | 0 | 0 | 0 |
HotUpdateDemo/tools/ModifyFileTime.py | Lmz521/CocosCreatorTutorial | 512 | 1662882 | <filename>HotUpdateDemo/tools/ModifyFileTime.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import os.path
import json
relativePath = ''
zipDirList = []
TIMESTAMP = 1330712292
def modifyFileTime(filePath, time):
# 修改访问和修改时间
os.utime(filePath, (time, time))
def modify(rootdir):
f... | 0 | 0 | 0 | 0 | 0 | 0 |
src/micropython/microbit/__model/image.py | julianrendell/vscode-python-devicesimulator | 151 | 1662884 | from __future__ import annotations
from . import constants as CONSTANTS
from .producer_property import ProducerProperty
from common.telemetry import telemetry_py
from common.telemetry_events import TelemetryEvent
class Image:
"""
If ``string`` is used, it has to consist of digits 0-9 arranged into
lines, ... | 2 | 29 | 65 | 1 | 97 | 0 |
src/whylogs/viz/__init__.py | cswarth/whylogs | 603 | 1662897 | from .browser_viz import profile_viewer
from .visualizer import BaseProfileVisualizer, ProfileVisualizer
__ALL__ = [ProfileVisualizer, BaseProfileVisualizer, profile_viewer]
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/constraints/circuits.py | pretl/ALIGN-public | 119 | 1662940 | <reponame>pretl/ALIGN-public
import textwrap
def comparator(name):
netlist = textwrap.dedent(f"""\
.subckt {name} clk vccx vin vip von vop vssx
mp8 vip_d clk vccx vccx p w=360e-9 m=1 nf=2
mp5 vin_o vip_o vccx vccx p w=360e-9 m=6 nf=2
mp14 vop vip_o vccx vccx p w=360e-9 m=1 nf=2
... | 0 | 0 | 0 | 0 | 0 | 0 |
python/mujoco/glfw/__init__.py | mfkiwl/mujoco | 1,575 | 1662944 | # Copyright 2017 The dm_control Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 0 | 0 | 0 | 0 | 0 | 0 |
conditional/__init__.py | randanegm/adverserial | 111 | 1662978 | from __future__ import annotations
import functools
from pylearn2.models.mlp import MLP, CompositeLayer
from pylearn2.space import CompositeSpace, VectorSpace
import theano
from theano import tensor as T
from theano.compat import OrderedDict
from theano.sandbox.rng_mrg import MRG_RandomStreams
from adversarial import... | 18 | 10 | 1 | 0 | 29 | 0 |
app/spider/__init__.py | kenmingwang/ASoulCnki | 384 | 1663003 | <filename>app/spider/__init__.py
from . import dynamic
from . import reply
| 0 | 0 | 0 | 0 | 0 | 0 |
security_monkey/auditors/vpc/vpc.py | boladmin/security_monkey | 4,258 | 1663004 | <gh_stars>1000+
# Copyright 2016 Bridgewater Associates
#
# 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 r... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/cli/mocks.py | longhuei/floyd-cli | 162 | 1663008 | from floyd.model.experiment_config import ExperimentConfig
def mock_exp(exp_id) -> object:
class Experiment:
id = exp_id
state = 'success'
name = 'test_name'
task_instances = []
return Experiment()
def mock_exp(exp_id) -> object:
class Experiment:
id = exp_id
... | 0 | 6 | 0 | 0 | 6 | 0 |
translator/postprocess.py | ttslr/gtos | 172 | 1663010 | <filename>translator/postprocess.py
import re
class PostProcess:
def __init__ (self):
pass
def post_process(self, sent):
return re.sub(r'(@@ )|(@@ ?$)', '', sent)
def parse_config():
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--golden_file', type=... | 0 | 0 | 0 | 0 | 0 | 0 |
synthetic/experiments/mxnet/fc/symbol_fcn8.py | feifeibear/dlbench | 181 | 1663014 | <gh_stars>100-1000
import mxnet as mx
def get_symbol(num_classes = 26752):
input_data = mx.symbol.Variable(name="data")
fc1 = mx.symbol.FullyConnected(data = input_data, name='fc1', num_hidden=2048)
act1 = mx.symbol.Activation(data=fc1, name='sigmoid1', act_type="sigmoid")
fc2 = mx.symbol.FullyConnecte... | 0 | 0 | 0 | 0 | 0 | 0 |
test/completion/positional_only_params.py | kirat-singh/jedi | 4,213 | 1663020 | <reponame>kirat-singh/jedi
# python >= 3.8
def positional_only_call(a, /, b):
#? str()
a
#? int()
b
if UNDEFINED:
return a
else:
return b
#? int() str()
positional_only_call('', 1)
def positional_only_call2(a, /, b=3):
if UNDEFINED:
return a
else:
ret... | 0 | 0 | 0 | 0 | 0 | 0 |
install.py | wdongxv/DDDProxy | 139 | 1663080 | #!/usr/bin/env python
from optparse import OptionParser
import sys
import os
from __builtin__ import file
import getpass
import string
import random
import platform
# echo "Install ..."
# current="$(dirname ${0})";
# cd $current
# root?Dir=$(dirname $(pwd))
#
# plist=$(cat "$(pwd)/com.wangdongxu.ddproxy.plist")
# pl... | 0 | 0 | 0 | 0 | 0 | 0 |
hwt/serializer/hwt/__init__.py | ufo2011/hwt | 134 | 1663084 | """
Hwt serializer converts HDL objects back to code in python for hwt.
"""
from hdlConvertorAst.to.hwt._main import ToHwt
from hwt.serializer.hwt.serializer import ToHdlAstHwt
from hwt.serializer.serializer_config import DummySerializerConfig
from hdlConvertorAst.hdlAst import iHdlObj
from hwt.serializer.exceptions i... | 0 | 1 | 2 | 0 | 3 | 0 |
tools/windows_adapter_info.py | UAEKondaya1/expressvpn_leak_testing | 219 | 1663111 | #!/usr/bin/env python3
# TODO: Remove this once the sys.path.append is gone
# pylint: disable=wrong-import-position
import os
import sys
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..'))
from xv_leak_tools.network.windows.windows_network import WindowsNetwork
for adapter in WindowsNe... | 0 | 0 | 0 | 0 | 0 | 0 |
metadata/metadata_service/api/type_metadata.py | kokizzu/amundsen | 1,169 | 1663120 | <gh_stars>1000+
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
import json
import logging
from http import HTTPStatus
from typing import Iterable, Mapping, Union
from amundsen_common.entity.resource_type import ResourceType
from flasgger import swag_from
from flask import requ... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/qrcode_text/png_text.py | dbajar/segno | 254 | 1663156 | <filename>examples/qrcode_text/png_text.py<gh_stars>100-1000
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 - 2020 -- <NAME>
# All rights reserved.
#
# License: BSD License
#
"""\
Example how to add additional text to a QR code.
See <https://github.com/lincolnloop/python-qrcode/issues/199>
"""
import io
import os
from... | 0 | 0 | 0 | 0 | 0 | 0 |
backend/www/test/auth_prospective_test.py | xuantan/viewfinder | 645 | 1663157 | <filename>backend/www/test/auth_prospective_test.py
# Copyright 2012 Viewfinder Inc. All Rights Reserved.
"""Authentication tests for prospective users.
"""
__author__ = '<EMAIL> (<NAME>)'
import base64
import json
import time
import urllib
from copy import deepcopy
from tornado import options
from viewfinder.backe... | 0 | 0 | 0 | 0 | 0 | 0 |
platypush/plugins/wiimote.py | RichardChiang/platypush | 228 | 1663171 | <gh_stars>100-1000
"""
.. moduleauthor:: <NAME> <<EMAIL>>
"""
import time
from platypush.context import get_backend
from platypush.plugins import Plugin, action
class WiimotePlugin(Plugin):
"""
WiiMote plugin.
A wrapper around the :mod:`platypush.backend.wiimote` backend to
programmatically control a... | 0 | 0 | 0 | 0 | 0 | 0 |
alipay/aop/api/domain/AlipayCommerceIotSdarttoolMessageSendModel.py | antopen/alipay-sdk-python-all | 213 | 1663182 | <reponame>antopen/alipay-sdk-python-all<filename>alipay/aop/api/domain/AlipayCommerceIotSdarttoolMessageSendModel.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayCommerceIotSdarttoolMessageSendModel(object):
def __init__(self):
... | 0 | 0 | 0 | 0 | 0 | 0 |
a01_ensemble_boxes_functions.py | MinliangLin/Keras-RetinaNet-for-Open-Images-Challenge-2018 | 287 | 1663185 | # coding: utf-8
from __future__ import annotations
__author__ = 'ZFTurbo: https://kaggle.com/zfturbo'
import numpy as np
def nms_standard(dets, thresh) -> object:
scores = dets[:, 0]
x1 = dets[:, 1]
y1 = dets[:, 2]
x2 = dets[:, 3]
y2 = dets[:, 4]
areas = (x2 - x1 + 1) * (y2 - y1 + 1)
ord... | 3 | 7 | 0 | 0 | 10 | 0 |
docs/manual/gears/examples/sdp.py | bogdanvuk/pygears | 120 | 1663187 | from pygears.lib import sdp, check, drv, delay
from pygears.typing import Uint, Tuple
wr_addr_data = drv(t=Tuple[Uint[2], Uint[3]],
seq=[(0, 0), (1, 2), (2, 4), (3, 6)])
rd_addr = drv(t=Uint[2], seq=[0, 1, 2, 3]) | delay(1)
rd_addr \
| sdp(wr_addr_data) \
| check(ref=[0, 2, 4, 6])
| 0 | 0 | 0 | 0 | 0 | 0 |
word2vec.py | thunlp/AutoCLIWC | 126 | 1663191 | <gh_stars>100-1000
from gensim.models import word2vec
import logging
PATH2SOGOUT = ''
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
sentences = word2vec.LineSentence(PATH2SOGOUT)
model = word2vec.Word2Vec(sentences, workers=20, sg=1, size=300, min_count=50)
model.wv.save_w... | 0 | 0 | 0 | 0 | 0 | 0 |
consulate/exceptions.py | python-microservices/consulate | 309 | 1663206 | """
Consulate Exceptions
"""
class ConsulateException(Exception):
"""Base Consul exception"""
class RequestError(ConsulateException):
"""There was an error making the request to the consul server"""
class ClientError(ConsulateException):
"""There was an error in the request that was made to consul"""... | 0 | 0 | 0 | 0 | 0 | 0 |
leonardo/module/web/page/common/forms.py | timgates42/django-leonardo | 102 | 1663254 | <gh_stars>100-1000
from django.db.models.fields import BLANK_CHOICE_DASH
from crispy_forms.bootstrap import Tab, TabHolder
from crispy_forms.layout import Layout, Fieldset
from django.http import HttpResponseRedirect
from leonardo import forms
from django.utils.translation import ugettext_lazy as _
from leonardo.forms... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_type_property.py | bhumikapahariapuresoftware/visions | 142 | 1663286 | <filename>tests/test_type_property.py
from visions import Integer, IPAddress, VisionsBaseType
from visions.relations import TypeRelation
from visions.types.type import RelationsIterManager
def test_property_base():
"""Assert that _relations is initialized"""
assert VisionsBaseType._relations is None
def te... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/get_total_gates_line.py | clairechingching/ScaffCC | 158 | 1663340 | #!/usr/bin/python
import sys
the_file = open(sys.argv[1],"r")
for line in the_file.readlines():
if line.startswith( 'total_gates' ):
print (line)
the_file.close()
| 0 | 0 | 0 | 0 | 0 | 0 |
python_src/layered_planner/main_rrt_gradient.py | tkortz/motion_planning_rt | 111 | 1663352 | <filename>python_src/layered_planner/main_rrt_gradient.py
#!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
from tools import *
from rrt import *
from potential_fields import *
def move_obstacles(obstacles, params):
# obstacles[3] += np.array([0.004, 0.005])
# small cubes movement
... | 0 | 0 | 0 | 0 | 0 | 0 |
jsuarez/tools/handletest.py | jarbus/neural-mmo | 1,450 | 1663378 | <reponame>jarbus/neural-mmo
import ray
ray.init(driver_mode=ray.PYTHON_MODE)
@ray.remote
class Actor1:
def method(self):
pass
@ray.remote
class Actor2:
def __init__(self, a):
self.a = a
def method(self):
ray.get(self.a.method.remote())
a1 = Actor1.remote()
a2 = Actor2.remote(a1)
ray.ge... | 0 | 0 | 0 | 0 | 0 | 0 |
streampipes-wrapper-python/streampipes/api/resources/dummy.py | vesense/incubator-streampipes | 228 | 1663413 | #
# 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 us... | 0 | 2 | 0 | 0 | 2 | 0 |
census_data_downloader/tables/occupancy.py | datadesk/census-data-downloader | 170 | 1663425 | #! /usr/bin/env python
# -*- coding: utf-8 -*
import collections
from census_data_downloader.core.tables import BaseTableConfig
from census_data_downloader.core.decorators import register
@register
class OccupantsDownloader(BaseTableConfig):
PROCESSED_TABLE_NAME: str = "occupants"
UNIVERSE: str = "occupied ho... | 0 | 0 | 3 | 0 | 3 | 0 |
torchelie/recipes/unpaired.py | Vermeille/Torchelie | 117 | 1663436 | from __future__ import annotations
import torch
import torchelie as tch
import torchelie.utils as tu
from torchelie.recipes.gan import GANRecipe
import torchvision.transforms as TF
import torchelie.loss.gan.standard as gan_loss
from torchelie.loss.gan.penalty import zero_gp, R1
from torchelie.datasets.pix2pix import Un... | 8 | 15 | 0 | 1 | 24 | 0 |
discodo/voice_client.py | eunwoo1104/discodo | 105 | 1663462 | from __future__ import annotations
import random
import re
from youtube_related import RateLimited
from youtube_related import preventDuplication as relatedClient
from .config import Config
from .connector import VoiceConnector
from .enums import PlayerState
from .errors import NotPlaying
from .player import Player
f... | 5 | 16 | 0 | 4 | 25 | 0 |
fast_soft_sort/numpy_ops.py | jsw7460/mylinear | 389 | 1663493 | <filename>fast_soft_sort/numpy_ops.py
# 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 ap... | 0 | 0 | 0 | 0 | 0 | 0 |
NLP/Text2SQL-BASELINE/text2sql/launch/__init__.py | zhangyimi/Research | 1,319 | 1663534 | # -*- coding: utf-8 -*-
"""text2sql launch tools"""
from . import trainer
from . import infer
from . import eval
| 0 | 0 | 0 | 0 | 0 | 0 |
Alignment/OfflineValidation/python/TkAlAllInOneTool/TkAlExceptions.py | ckamtsikis/cmssw | 852 | 1663540 | <gh_stars>100-1000
class AllInOneError(Exception):
def __init__(self, msg):
Exception.__init__(self, msg)
self._msg = msg
return
def __str__(self):
return self._msg
| 0 | 0 | 0 | 0 | 0 | 0 |
python_modules/dagster/dagster/core/storage/schedules/sqlite/__init__.py | dbatten5/dagster | 4,606 | 1663550 | from .sqlite_schedule_storage import SqliteScheduleStorage
| 0 | 0 | 0 | 0 | 0 | 0 |
bcbio/bed/__init__.py | a113n/bcbio-nextgen | 418 | 1663572 | from __future__ import annotations
import pybedtools as bt
from bcbio.utils import file_exists
from bcbio import utils
def decomment(bed_file, out_file) -> object:
"""
clean a BED file
"""
if file_exists(out_file):
return out_file
with utils.open_gzipsafe(bed_file) as in_handle, open(out_f... | 1 | 4 | 0 | 0 | 5 | 0 |
scripts/builtin/_genBuiltinDocs.py | Shafaq-Siddiqi/systemml | 372 | 1663593 | <filename>scripts/builtin/_genBuiltinDocs.py
#-------------------------------------------------------------
#
# 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 ownershi... | 0 | 0 | 0 | 0 | 0 | 0 |
misc/pytorch_toolkit/machine_translation/core/tokenizer/nmt_tokenizer.py | dqawami/openvino_training_extensions | 256 | 1663635 | """
Copyright (c) 2020 Intel Corporation
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 writin... | 9 | 7 | 0 | 0 | 16 | 0 |
dawp/book/10_mcs/CIR_zcb_valuation_gen.py | PyCN/dawp | 484 | 1663692 | #
# Valuation of Zero-Coupon Bonds
# in Cox-Ingersoll-Ross (1985) Model
# 09_gmm/CIR_zcb_valuation_gen.py
#
# (c) Dr. <NAME>
# Derivatives Analytics with Python
#
import math
import numpy as np
#
# Example Parameters CIR85 Model
#
r0, kappa_r, theta_r, sigma_r, t, T = 0.04, 0.3, 0.04, 0.1, 0.5, 5.0
#
# Zero-Coupon Bo... | 0 | 0 | 0 | 0 | 0 | 0 |
sdk/mixedreality/azure-mixedreality-authentication/tests/test_static_access_token_credential.py | rsdoherty/azure-sdk-for-python | 2,728 | 1663718 | <reponame>rsdoherty/azure-sdk-for-python<filename>sdk/mixedreality/azure-mixedreality-authentication/tests/test_static_access_token_credential.py
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See ... | 0 | 0 | 0 | 0 | 0 | 0 |
nonechucks/__init__.py | appliedinnovation/nonechucks | 346 | 1663760 | import logging
import torch
import torch.utils.data
logger = logging.getLogger(__name__)
def _get_pytorch_version() -> tuple[object, object]:
version = torch.__version__
major, minor = [int(x) for x in version.split(".")[:2]]
if major != 1:
raise RuntimeError(
"nonechucks only suppo... | 0 | 1 | 0 | 0 | 1 | 0 |
beta_rec/utils/alias_table.py | mengzaiqiao/TVBR | 126 | 1663763 | <reponame>mengzaiqiao/TVBR
import numpy as np
class AliasTable:
"""AliasTable Class.
A list of indices of tokens in the vocab following a power law distribution,
used to draw negative samples.
"""
def __init__(self, obj_freq):
"""Initialize an AliasTable.
Args:
obj_fre... | 0 | 0 | 0 | 0 | 0 | 0 |
qmsolve/time_dependent_solver/__init__.py | quantum-visualizations/qmsolve | 356 | 1663798 | from .time_dependent_solver import TimeSimulation
| 0 | 0 | 0 | 0 | 0 | 0 |
CNN_training/2-网络训练/A-Method/codes/evaluation.py | Ravenclaw-OIer/ISML_auto_voter | 128 | 1663804 | import os
import sys
import utils
import random
import datetime
import argparse
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
from sklearn.metrics import confusion_matrix
from sklearn.metrics import roc_curve, roc_auc_score, precision_recall_curve
class Evaluation(object):
d... | 0 | 2 | 0 | 0 | 2 | 0 |
extraPackages/matplotlib-3.0.3/examples/pyplots/pyplot_formatstr.py | dolboBobo/python3_ios | 130 | 1663809 | """
================
Pyplot Formatstr
================
Use a format string to colorize a `~matplotlib.axes.Axes.plot` and set its
markers.
"""
import matplotlib.pyplot as plt
plt.plot([1,2,3,4], [1,4,9,16], 'ro')
plt.axis([0, 6, 0, 20])
plt.show()
######################################################################... | 0 | 0 | 0 | 0 | 0 | 0 |
recipes/nsync/all/test_package/conanfile.py | rockandsalt/conan-center-index | 562 | 1663816 | <filename>recipes/nsync/all/test_package/conanfile.py
import os
from conans import ConanFile, CMake, tools
class NsyncTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake", "cmake_find_package_multi"
def build(self):
cmake = CMake(self)
cmake.config... | 0 | 0 | 0 | 0 | 0 | 0 |
gwd/eda/coco.py | kazakh-shai/kaggle-global-wheat-detection | 136 | 1663822 | <reponame>kazakh-shai/kaggle-global-wheat-detection<gh_stars>100-1000
import argparse
import os
import os.path as osp
import tempfile
import cv2
import mmcv
from pycocotools.coco import COCO
from tqdm import tqdm
from gwd.eda.visualization import draw_bounding_boxes_on_image
def parse_args():
parser = argparse.... | 0 | 0 | 0 | 0 | 0 | 0 |
brainrender/atlas_specific/__init__.py | crsanderford/brainrender | 226 | 1663826 | <gh_stars>100-1000
from brainrender.atlas_specific.allen_brain_atlas.gene_expression import (
GeneExpressionAPI,
)
from brainrender.atlas_specific.allen_brain_atlas.streamlines import (
get_streamlines_for_region,
)
| 0 | 0 | 0 | 0 | 0 | 0 |
stable_nalu/functional/gumbel.py | wlm2019/Neural-Arithmetic-Units | 147 | 1663828 | <filename>stable_nalu/functional/gumbel.py
import torch
def sample_gumbel(placeholder, eps=1e-10, reuse=False):
"""Samples Gumbel(0, 1) values into the placeholder"""
# Uniform sample between [eps, 1)
if reuse:
uniform = placeholder
else:
uniform = placeholder.uniform_(eps, 1)
# ... | 0 | 0 | 0 | 0 | 0 | 0 |
securetea/lib/ids/r2l_rules/wireless/deauth.py | neerajv18/SecureTea-Project | 257 | 1663841 | # -*- coding: utf-8
u"""Wireless De-authentication attack detection module for SecureTea IDS.
Project:
╔═╗┌─┐┌─┐┬ ┬┬─┐┌─┐╔╦╗┌─┐┌─┐
╚═╗├┤ │ │ │├┬┘├┤ ║ ├┤ ├─┤
╚═╝└─┘└─┘└─┘┴└─└─┘ ╩ └─┘┴ ┴
Author: <NAME> <<EMAIL>> , May 21 2019
Version: 1.1
Module: SecureTea
"""
import scapy.all as scapy
import... | 1 | 0 | 0 | 3 | 4 | 0 |
PointRCNN/lib/net/batch_utils.py | mileyan/mileyan | 152 | 1663858 | <filename>PointRCNN/lib/net/batch_utils.py<gh_stars>100-1000
import torch as torch
import numpy as np
from lib.config import cfg
import lib.utils.kitti_utils as kitti_utils
import kitti_util
def pointrcnn_transform(pts_lidar, calib, PRCNN_npoints, sample_id, mode='TRAIN', random_select=True):
pts_rect = calib.li... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/dicts/keypath/test_keypath_util.py | next-franciscoalgaba/python-benedict | 365 | 1663872 | # -*- coding: utf-8 -*-
from benedict.dicts.keylist import keylist_util
from benedict.dicts.keypath import keypath_util
import unittest
class keypath_util_test_case(unittest.TestCase):
def test_split_key_indexes_with_valid_indexes(self):
f = keypath_util._split_key_indexes
self.assertEqual(f('i... | 0 | 0 | 0 | 0 | 0 | 0 |
indy_node/test/auth_rule/auth_framework/add_roles.py | Rob-S/indy-node | 627 | 1663899 | import pytest
from indy_common.authorize.auth_actions import ADD_PREFIX
from indy_common.authorize.auth_constraints import AuthConstraint
from indy_common.authorize import auth_map
from indy_common.constants import NYM, ROLE, ENDORSER
from indy_node.test.auth_rule.auth_framework.basic import roles_to_string, AuthTest
... | 1 | 3 | 0 | 1 | 5 | 0 |
third_party/capstone/capstone.gyp | xswz8015/syzygy | 343 | 1663952 | # 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.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 0 | 0 | 0 | 0 | 0 | 0 |
src/chapter-2/conftest.py | luizyao/pytest-chinese-doc | 283 | 1663977 | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
'''
Author: <NAME> (<EMAIL>)
Created Date: 2019-09-27 15:13:44
-----
Last Modified: 2019-09-27 15:13:46
Modified By: <NAME> (<EMAIL>)
-----
THIS PROGRAM IS FREE SOFTWARE, IS LICENSED UNDER MIT.
A short and simple permissive license with conditions
only requiring preservati... | 0 | 0 | 0 | 0 | 0 | 0 |
pylearn2/sandbox/lisa_rl/bandit/gaussian_bandit.py | BouchardLab/pylearn2 | 2,045 | 1663984 | <gh_stars>1000+
__author__ = "<NAME>"
import numpy as np
from theano import config
from theano import function
from theano import tensor as T
from pylearn2.sandbox.lisa_rl.bandit.environment import Environment
from pylearn2.utils import sharedX
from pylearn2.utils.rng import make_np_rng, make_theano_rng
class Gaus... | 0 | 0 | 0 | 0 | 0 | 0 |
applications/DEMApplication/python_scripts/analytic_tools/analytic_data_procedures.py | lkusch/Kratos | 778 | 1664004 | <filename>applications/DEMApplication/python_scripts/analytic_tools/analytic_data_procedures.py<gh_stars>100-1000
import os
import numpy as np
from KratosMultiphysics import *
from KratosMultiphysics.DEMApplication import *
class SurfaceAnalyzer:
def __init__(self, smp):
self.inlet = None
self.n_pa... | 0 | 0 | 0 | 0 | 0 | 0 |
specs/make_hpke_constants.py | sthagen/project-everest-hacl-star | 201 | 1664016 | # This Python script was used to generate the F* code
# for the string constants used in HPKE, see
# Spec.Agile.HPKE.fsti, Section “Contants for HPKE labels”.
# Invoke this script with Python3 on the command line,
# for example with:
# python3 make_hpke_constants.py
# Ultimately, this should be rewritten in Meta-F*, se... | 0 | 1 | 0 | 0 | 1 | 0 |
feathermodules/auxiliary/base_n_solver.py | timgates42/featherduster | 1,026 | 1664027 | <reponame>timgates42/featherduster
import cryptanalib as ca
import feathermodules
def base_n_solve(samples):
result = ''
arguments = check_arguments(dict(feathermodules.current_options))
if arguments == False:
return '[*] num_answers option must be an integer between 1-35'
for sample in samples:
... | 0 | 0 | 0 | 0 | 0 | 0 |
blaze/deprecation.py | quantopian-enterprise/blaze | 2,106 | 1664065 | <reponame>quantopian-enterprise/blaze
from __future__ import print_function, division, absolute_import
import warnings
from functools import wraps
def deprecated(version, replacement=None):
"""Define a deprecation decorator.
An optional `replacement` should refer to the new API to be used instead.
Exampl... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/fake_main.py | hellysmile/aiorun | 296 | 1664069 | <reponame>hellysmile/aiorun
import logging
import asyncio
from aiorun import run
logging.basicConfig(level="DEBUG")
async def main():
logging.info("Sleeping in main")
try:
await asyncio.sleep(50)
finally:
logging.info("Leaving main")
run(main())
logging.critical("Leaving fake main")
| 0 | 0 | 0 | 0 | 0 | 0 |
brainstorm/layers/merge_layer.py | PyCN/brainstorm | 1,473 | 1664082 | #!/usr/bin/env python
# coding=utf-8
from __future__ import annotations
from __future__ import division, print_function, unicode_literals
from collections import OrderedDict
from brainstorm.layers.base_layer import Layer
from brainstorm.structure.buffer_structure import (BufferStructure,
... | 2 | 2 | 2 | 0 | 6 | 0 |
docs/setup.py | akuzia/phpspec | 1,320 | 1664119 | #!/usr/bin/env python
#
# -*- coding: utf-8 -*-
import sys
import os
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if on_rtd:
html_theme = 'default'
else:
html_theme = 'nature'
| 0 | 0 | 0 | 0 | 0 | 0 |
2020-11/2020-11-13-TabuSearch/GetData.py | OlittleRer/2020-11 | 115 | 1664171 | <gh_stars>100-1000
'''
Description: data generation for vehicle routing problem and visualization
Version: 1.0
Author: 71
Date: 2020-12-10 17:20:09
'''
import math,re,copy
import numpy as np
import networkx as nx
import matplotlib.pyplot as plt
class GetData():
def generate_locations(self,num_points... | 0 | 0 | 0 | 0 | 0 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.