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 |
|---|---|---|---|---|---|---|---|---|---|---|
scripts/test_tutorials.py | quantummind/quantum | 1,501 | 132454 | # Copyright 2020 The TensorFlow Quantum 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 req... | 0 | 0 | 0 | 0 | 0 | 0 |
src/backend/utils/isp.py | ddddhm1/LuWu | 658 | 132458 | <reponame>ddddhm1/LuWu
import json
import logging
from abc import ABC
from abc import abstractmethod
from datetime import datetime
from typing import List
import digitalocean
from aliyunsdkcore.acs_exception.exceptions import ClientException
from aliyunsdkcore.acs_exception.exceptions import ServerException
from aliyu... | 0 | 0 | 0 | 0 | 0 | 0 |
nuplan/planning/script/builders/metric_runner_builder.py | motional/nuplan-devkit | 128 | 132459 | import logging
from typing import List
from omegaconf import DictConfig
from nuplan.planning.script.builders.metric_builder import build_metrics_engines
from nuplan.planning.simulation.callback.metric_callback import MetricCallback
from nuplan.planning.simulation.runner.metric_runner import MetricRunner
from nuplan.p... | 2 | 1 | 0 | 0 | 3 | 0 |
train.py | jayagupta678/DeepEvolve | 171 | 132508 | <gh_stars>100-1000
"""
Generic setup of the data sources and the model training.
Based on:
https://github.com/fchollet/keras/blob/master/examples/mnist_mlp.py
and also on
https://github.com/fchollet/keras/blob/master/examples/mnist_cnn.py
"""
#import keras
from keras.datasets import mnist, cifar10
fr... | 0 | 0 | 0 | 0 | 0 | 0 |
Lib/test/test_compiler/testcorpus/22_func_arg.py | diogommartins/cinder | 1,886 | 132536 | <gh_stars>1000+
def foo(a, b):
a + b
| 0 | 0 | 0 | 0 | 0 | 0 |
src/oci/operator_access_control/models/operator_control_assignment_summary.py | Manny27nyc/oci-python-sdk | 249 | 132547 | # 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 | 15 | 4 | 14 | 33 | 0 |
luminoth/models/ssd/proposal.py | jsdussanc/luminoth | 2,584 | 132557 | import sonnet as snt
import tensorflow as tf
from luminoth.utils.bbox_transform_tf import decode, clip_boxes, change_order
class SSDProposal(snt.AbstractModule):
"""Transforms anchors and SSD predictions into object proposals.
Using the fixed anchors and the SSD predictions for both classification
and r... | 1 | 1 | 0 | 0 | 2 | 0 |
grr/server/grr_response_server/output_plugin.py | khanhgithead/grr | 4,238 | 132563 | #!/usr/bin/env python
# Lint as: python3
from __future__ import annotations
"""Output plugins used by flows and hunts for results exports."""
import abc
import threading
from grr_response_core.lib import rdfvalue
from grr_response_core.lib.rdfvalues import protodict as rdf_protodict
from grr_response_core.lib.rdfvalu... | 4 | 1 | 7 | 0 | 12 | 0 |
torchdyn/models/hybrid.py | iisabeller/torchdyn | 825 | 132575 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 10 | 9 | 0 | 0 | 19 | 0 |
paddlespeech/s2t/training/extensions/evaluator.py | JiehangXie/PaddleSpeech | 1,540 | 132608 | <gh_stars>1000+
# Copyright (c) 2021 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
#
# Unless r... | 0 | 0 | 0 | 0 | 0 | 0 |
ledfx/integrations/qlc.py | WeekendWarrior1/LedFx | 524 | 132610 | from __future__ import annotations
import asyncio
# import numpy as np
# import importlib
# import pkgutil
import logging
import aiohttp
import voluptuous as vol
# from ledfx.events import Event
from ledfx.integrations import Integration
from ledfx.utils import async_fire_and_forget, resolve_destination
# import ti... | 0 | 10 | 3 | 5 | 18 | 0 |
installer/__main__.py | baptoutiego/Jarvis | 2,605 | 132617 | <filename>installer/__main__.py
import traceback
try:
from helper import log_init, log_close
from unix_windows import IS_WIN
log_init()
import os
os.chdir(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import steps.a_setup_virtualenv
import steps.b_pip
import steps.c_nlt... | 0 | 0 | 0 | 0 | 0 | 0 |
flambe/cluster/__init__.py | ethan-asapp/flambe | 148 | 132621 | <gh_stars>100-1000
from flambe.cluster.cluster import Cluster
from flambe.cluster.aws import AWSCluster
from flambe.cluster.ssh import SSHCluster
__all__ = ['Cluster', 'AWSCluster', 'SSHCluster']
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/oauth2/rfc6749/clients/test_service_application.py | braedon/oauthlib | 954 | 132635 | # -*- coding: utf-8 -*-
import os
from time import time
from unittest.mock import patch
import jwt
from oauthlib.common import Request
from oauthlib.oauth2 import ServiceApplicationClient
from tests.unittest import TestCase
class ServiceApplicationClientTest(TestCase):
gt = ServiceApplicationClient.grant_type... | 0 | 0 | 10 | 0 | 10 | 0 |
esphome/components/tuya/light/__init__.py | OttoWinter/esphomeyaml | 249 | 132645 | from esphome.components import light
import esphome.config_validation as cv
import esphome.codegen as cg
from esphome.const import (
CONF_OUTPUT_ID,
CONF_MIN_VALUE,
CONF_MAX_VALUE,
CONF_GAMMA_CORRECT,
CONF_DEFAULT_TRANSITION_LENGTH,
CONF_SWITCH_DATAPOINT,
CONF_COLD_WHITE_COLOR_TEMPERATURE,
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/integration/hdf5/test_scratch.py | weiglszonja/pynwb | 132 | 132655 | <reponame>weiglszonja/pynwb
import pandas as pd
import numpy as np
from numpy.testing import assert_array_equal
from pynwb import NWBFile, NWBHDF5IO, TimeSeries
from pynwb.core import ScratchData
from pynwb.testing import NWBH5IOMixin, TestCase
class TestScratchDataIO(NWBH5IOMixin, TestCase):
def setUpContainer... | 0 | 0 | 0 | 0 | 0 | 0 |
office365/sharepoint/logger/logFileInfoCollection.py | rikeshtailor/Office365-REST-Python-Client | 544 | 132709 | <filename>office365/sharepoint/logger/logFileInfoCollection.py
from office365.sharepoint.base_entity_collection import BaseEntityCollection
from office365.sharepoint.logger.logFileInfo import LogFileInfo
class LogFileInfoCollection(BaseEntityCollection):
def __init__(self, context, resource_path=None):
s... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/qnn/conftest.py | ryanlevy/pennylane | 539 | 132724 | # Copyright 2018-2020 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or... | 0 | 4 | 0 | 0 | 4 | 0 |
Tree/tree_base.py | pyecharts/pyecharts_gallery | 759 | 132740 | from pyecharts import options as opts
from pyecharts.charts import Tree
data = [
{
"children": [
{"name": "B"},
{
"children": [{"children": [{"name": "I"}], "name": "E"}, {"name": "F"}],
"name": "C",
},
{
"chil... | 0 | 0 | 0 | 0 | 0 | 0 |
test/base/test_env.py | Aceticia/tianshou | 4,714 | 132751 | from __future__ import annotations
import sys
import time
import numpy as np
from gym.spaces.discrete import Discrete
from tianshou.data import Batch
from tianshou.env import DummyVectorEnv, RayVectorEnv, ShmemVectorEnv, SubprocVectorEnv
if __name__ == '__main__':
from env import MyTestEnv, NXEnv
else: # pytest... | 10 | 2 | 0 | 0 | 12 | 0 |
alibi/confidence/tests/test_model_linearity.py | markus583/alibi | 1,570 | 132756 | import pytest
import numpy as np
from sklearn.datasets import load_iris, load_boston
from sklearn.linear_model import LogisticRegression, LinearRegression
from sklearn.svm import SVR
from alibi.confidence.model_linearity import linearity_measure, LinearityMeasure
from alibi.confidence.model_linearity import _linear_sup... | 0 | 11 | 0 | 0 | 11 | 0 |
src/networkx/readwrite/json_graph/tree.py | MarletteFunding/aws-kube-codesuite | 184 | 132760 | # Copyright (C) 2011 by
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# All rights reserved.
# BSD license.
from __future__ import annotations
from itertools import chain, count
import networkx as nx
from networkx.utils import make_str
__author__ = """<NAME> (<EMAIL>))"""
__all__ = ['tree_d... | 0 | 3 | 0 | 0 | 3 | 0 |
chrome/tools/build/mac/run_verify_order.py | google-ar/chromium | 2,151 | 132768 | <filename>chrome/tools/build/mac/run_verify_order.py
# Copyright 2016 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 argparse
import os.path
import sys
import subprocess
# Wraps chrome/tools/build/mac/verify_order... | 0 | 0 | 0 | 0 | 0 | 0 |
Tools/mavlink_px4.py | wms124/PX4_1.4.1_Back-up | 4,224 | 132791 | from __future__ import annotations
'''
MAVLink protocol implementation (auto-generated by mavgen.py)
Generated from: common.xml
Note: this file has been auto-generated. DO NOT EDIT
'''
import struct, array, mavutil, time, json
WIRE_PROTOCOL_VERSION = "1.0"
# some base types from mavlink_types.h
MAVLINK_TYPE_CHAR ... | 8 | 272 | 0 | 105 | 385 | 0 |
promgen/proxy.py | kackey0-1/promgen | 913 | 132796 | <filename>promgen/proxy.py
# Copyright (c) 2019 LINE Corporation
# These sources are released under the terms of the MIT license: see LICENSE
import concurrent.futures
import json
import logging
from urllib.parse import urljoin
import requests
from dateutil import parser
from django.conf import settings
from django.h... | 0 | 0 | 0 | 0 | 0 | 0 |
appium/webdriver/extensions/log_event.py | salabogdan/python-client | 1,383 | 132802 | #!/usr/bin/env python
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software... | 5 | 3 | 0 | 0 | 8 | 0 |
gitgud/skills/basics/__init__.py | osai-mirrors/git-gud | 133 | 132803 | <gh_stars>100-1000
from gitgud.util import Skill
from gitgud.util.level_builder import BasicLevel
skill = Skill(
'Basics',
'basics',
[
BasicLevel('Introduction to Commits', 'committing', __name__),
BasicLevel('Branching in Git', 'branching', __name__),
BasicLevel('Merging in Git', '... | 0 | 0 | 0 | 0 | 0 | 0 |
resources/SE.py | mehrdad-shokri/Dr0p1t-Framework | 1,345 | 132806 | #Written by: <NAME> - D4Vinci ( Dr0p1t-Framework )
#In this script I store some SE tricks to use ;)
#Start
#Get the user password by fooling him and then uses it to run commands as the user by psexec to bypass UAC
def ask_pwd() -> object:
while True:
cmd = '''Powershell "$cred=$host.ui.promptforcredential('Windows ... | 0 | 1 | 0 | 0 | 1 | 0 |
on-box-python/op-scripts/rpc_execute.py | Juniper/junosautomation | 117 | 132841 | <filename>on-box-python/op-scripts/rpc_execute.py
from jnpr.junos import Device
from lxml import etree
with Device() as jdev:
#with Device(host=<hostname>, user=<user>, password=<password>) as jdev:
rsp = jdev.rpc.get_interface_information(interface_name='fxp0', terse=True)
print (etree.tostring(rsp, encoding=... | 0 | 0 | 0 | 0 | 0 | 0 |
snowfall/models/transformer.py | aarora8/snowfall | 145 | 132850 | <gh_stars>100-1000
#!/usr/bin/env python3
# Copyright (c) 2021 University of Chinese Academy of Sciences (author: <NAME>)
# Apache 2.0
import math
from typing import Dict, List, Optional, Tuple
import k2
import torch
from torch import Tensor, nn
from snowfall.common import get_texts
from snowfall.models import Ac... | 0 | 0 | 0 | 0 | 0 | 0 |
challenges/3.9.True_Operator/main.py | pradeepsaiu/python-coding-challenges | 141 | 132853 | <gh_stars>100-1000
def boolean_true():
return value # Change the varable named value to the correct answer
print(boolean_true())
| 0 | 0 | 0 | 0 | 0 | 0 |
test/regression/daily/ledger_lte.py | WDeepali/blockchaindemo | 172 | 132865 | <reponame>WDeepali/blockchaindemo
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
import unittest
import subprocess
tool_directory = '../../tools/LTE/scripts'
class perf_goleveldb(unittest.TestCase):
def test_FAB_3790_VaryNumParallelTxPerChain(self):
'''
In ... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/tcam-capture/tcam_capture/FPSCounter.py | lkucalaba/tiscamera | 241 | 132870 | <gh_stars>100-1000
# Copyright 2020 The Imaging Source Europe GmbH
#
# 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 applic... | 0 | 0 | 0 | 0 | 0 | 0 |
meta_policy_search/optimizers/conjugate_gradient_optimizer.py | Zhiwei-Z/prompzzw | 210 | 132904 | from __future__ import annotations
from meta_policy_search.utils import logger
import numpy as np
import tensorflow as tf
from collections import OrderedDict
from meta_policy_search.optimizers.base import Optimizer
class FiniteDifferenceHvp(Optimizer):
def __init__(self, base_eps: float=1e-5, symmetric: bool=True... | 13 | 11 | 0 | 11 | 35 | 0 |
build/android/pylib/perf/thermal_throttle.py | nagineni/chromium-crosswalk | 231 | 132911 | <reponame>nagineni/chromium-crosswalk
# Copyright 2013 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 logging
class OmapThrottlingDetector(object):
"""Class to detect and track thermal throttling on an OMAP 4."... | 0 | 0 | 0 | 0 | 0 | 0 |
rollbar/examples/starlette/app_logger.py | jackton1/pyrollbar | 177 | 132928 | <gh_stars>100-1000
#!/usr/bin/env python
# This example uses Uvicorn package that must be installed. However, it can be
# replaced with any other ASGI-compliant server.
#
# NOTE: Python 3.6 requires aiocontextvars package to be installed.
# Optional asynchronous reporting requires HTTPX package to be installed.
... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/reserialize.py | amaajemyfren/data | 435 | 132937 | import argparse
import logging
import json
import sys
sys.path.insert(0, '.')
from tools.constants import JSON_FORMAT_KWARGS
from tools.utils import get_json_files
def reserialize(file_):
"""Reformat json file"""
with open(file_) as fp:
try:
data = json.load(fp)
except ValueError... | 0 | 0 | 0 | 0 | 0 | 0 |
lib/python/treadmill/zkadmin.py | vrautela/treadmill | 133 | 132938 | from __future__ import annotations
"""Zookeeper admin interface.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import socket
import logging
_LOGGER = logging.getLogger(__name__)
def netcat(hostname, port, com... | 0 | 3 | 0 | 0 | 3 | 0 |
tests/unit/interpreters/test_py_spec.py | snsnlou/tox | 2,811 | 132973 | <filename>tests/unit/interpreters/test_py_spec.py<gh_stars>1000+
from tox.interpreters.py_spec import PythonSpec
def test_py_3_10():
spec = PythonSpec.from_name("python3.10")
assert (spec.major, spec.minor) == (3, 10)
def test_debug_python():
spec = PythonSpec.from_name("python3.10-dbg")
assert (spe... | 0 | 0 | 0 | 0 | 0 | 0 |
gtpython/sketch_constructed.py | satta/genometools | 202 | 132989 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from gt.core import *
from gt.extended import *
from gt.annotationsketch import *
from gt.annotationsketch.custom_track import CustomTrack
from gt.core.gtrange import Range
import sys
if __name__ == "__main__":
if len(sys.argv) != 3:
sys.stderr.write("Usage: " + (... | 0 | 0 | 0 | 0 | 0 | 0 |
gcp_variant_transforms/transforms/limit_write_test.py | tsa87/gcp-variant-transforms | 113 | 133010 | <reponame>tsa87/gcp-variant-transforms
# Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#... | 0 | 0 | 0 | 0 | 0 | 0 |
TM1py/Services/ViewService.py | adscheevel/tm1py | 113 | 133057 | <reponame>adscheevel/tm1py
# -*- coding: utf-8 -*-
import collections
from typing import List, Tuple, Union
from requests import Response
from TM1py.Exceptions.Exceptions import TM1pyRestException
from TM1py.Objects import View
from TM1py.Objects.MDXView import MDXView
from TM1py.Objects.NativeView import NativeView... | 0 | 0 | 0 | 0 | 0 | 0 |
datasets/blog_authorship_corpus/blog_authorship_corpus.py | WojciechKusa/datasets | 10,608 | 133062 | <gh_stars>1000+
import glob
import os
import datasets
logger = datasets.logging.get_logger(__name__)
_CITATION = """\
@inproceedings{schler2006effects,
title={Effects of age and gender on blogging.},
author={Schler, Jonathan and Koppel, Moshe and Argamon, Shlomo and Pennebaker, <NAME>},
booktitle={AAAI... | 0 | 0 | 0 | 0 | 0 | 0 |
docs/python/_includes/example_client.py | yeosujin/azure-sdk-korean | 302 | 133102 | """Example client using some of the most common API patterns
"""
import models
import azure.core.pipeline.transport as transports
class Thing(object):
"""A simple model type representing a Thing.
:ivar name: The name of the thing.
:vartype name: str
:ivar size: The size of the thing.
:vartype s... | 0 | 6 | 0 | 1 | 7 | 0 |
vedadet/engines/infer_engine.py | jie311/vedadet | 424 | 133105 | import torch
from vedacore.misc import registry
from vedadet.bridge import build_converter, build_meshgrid
from vedadet.misc.bbox import bbox2result, multiclass_nms
from .base_engine import BaseEngine
@registry.register_module('engine')
class InferEngine(BaseEngine):
def __init__(self, model, meshgrid, converte... | 0 | 5 | 0 | 0 | 5 | 0 |
tern/formats/spdx/spdx_common.py | KerinPithawala/tern | 325 | 133115 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2021 VMware, Inc. All Rights Reserved.
# SPDX-License-Identifier: BSD-2-Clause
from __future__ import annotations
"""
Common functions that are useful for both JSON and Tag-value document creation
"""
import datetime
import hashlib
import logging
import re
import uuid
from t... | 0 | 16 | 0 | 0 | 16 | 0 |
tests/common/test_run/ascend/matmul_mul_run.py | tianjiashuo/akg | 286 | 133135 | <filename>tests/common/test_run/ascend/matmul_mul_run.py<gh_stars>100-1000
# Copyright 2021 Huawei Technologies 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.... | 0 | 0 | 0 | 0 | 0 | 0 |
python/taichi/examples/simulation/fractal.py | kxxt/taichi | 11,699 | 133141 | <filename>python/taichi/examples/simulation/fractal.py<gh_stars>1000+
import taichi as ti
ti.init(arch=ti.gpu)
n = 320
pixels = ti.field(dtype=float, shape=(n * 2, n))
@ti.func
def complex_sqr(z):
return ti.Vector([z[0]**2 - z[1]**2, z[1] * z[0] * 2])
@ti.kernel
def paint(t: float):
for i, j in pixels: #... | 0 | 0 | 0 | 0 | 0 | 0 |
interpolation/splines/eval_cubic.py | vishalbelsare/interpolation.py | 110 | 133145 | from __future__ import annotations
import numpy
from .eval_splines import eval_cubic
## the functions in this file provide backward compatibility calls
##
## they can optionnally allocate memory for the result
## they work for any dimension, except the functions which compute the gradient
#######################
# C... | 5 | 6 | 0 | 0 | 11 | 0 |
tools/console/plugins/plugin_generate/gen_libs.py | wzhengsen/engine-x | 113 | 133146 | #!/usr/bin/python
#-*- coding: UTF-8 -*-
import os
import sys
import shutil
import json
import utils
from . import gen_prebuilt_mk
import adxe
from MultiLanguage import MultiLanguage
from adxe import CCPluginError
from adxe import Logging
from argparse import ArgumentParser
class LibsCompiler(adxe.CCPlugin):
CF... | 0 | 6 | 9 | 0 | 15 | 0 |
pred_vae.py | hugochan/K-Competitive-Autoencoder-for-Text-Analytics | 133 | 133152 | '''
Created on Jan, 2017
@author: hugo
'''
from __future__ import absolute_import
import argparse
import numpy as np
from autoencoder.core.vae import VarAutoEncoder, load_vae_model
from autoencoder.core.deepae import DeepAutoEncoder
from autoencoder.preprocessing.preprocessing import load_corpus, doc2vec
from autoen... | 0 | 0 | 0 | 0 | 0 | 0 |
networkx/algorithms/community/community_generators.py | rakschahsa/networkx | 445 | 133164 | <filename>networkx/algorithms/community/community_generators.py
# generators.py - functions for generating graphs with community structure
#
# Copyright 2011 <NAME> <<EMAIL>>.
# Copyright 2011 <NAME> <<EMAIL>>
# Copyright 2015 NetworkX developers.
#
# This file is part of NetworkX.
#
# NetworkX is distributed under a B... | 0 | 0 | 0 | 0 | 0 | 0 |
thrift/lib/py3lite/test/structs.py | sakibguy/fbthrift | 2,112 | 133205 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# 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 | 23 | 0 | 0 | 23 | 0 |
examples/mnist_branch.py | rsketine/neon | 4,415 | 133211 | #!/usr/bin/env python
# ******************************************************************************
# Copyright 2014-2018 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
... | 0 | 0 | 0 | 0 | 0 | 0 |
plugins/stock.py | daviddever/skybot | 114 | 133221 | #!/usr/bin/env python3
from __future__ import annotations
from __future__ import division, unicode_literals, print_function
from past.utils import old_div
import re
from util import hook, http
def human_price(x) -> object:
if x > 1e9:
return "{:,.2f}B".format(old_div(x, 1e9))
elif x > 1e6:
r... | 1 | 3 | 0 | 0 | 4 | 0 |
Two Pointers/349. Intersection of Two Arrays.py | beckswu/Leetcode | 138 | 133227 | """
349. Intersection of Two Arrays
Example:
Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2].
"""
# binary search
class Solution(object):
def intersection(self, nums1, nums2) -> object:
"""
:type nums1: List[int]
:type nums2: List[int]
:rtype: List[int]
"... | 0 | 3 | 0 | 0 | 3 | 0 |
coveralls/cli.py | styleseat/coveralls-python | 191 | 133231 | from __future__ import annotations
"""
Publish coverage results online via coveralls.io.
Puts your coverage results on coveralls.io for everyone to see.
This tool makes custom reports for data generated by coverage.py package and
sends it to the coveralls.io service API.
All Python files in your coverage analysis ar... | 1 | 1 | 0 | 0 | 2 | 0 |
mpf/tests/test_BallHold.py | Scottacus64/mpf | 163 | 133248 | <filename>mpf/tests/test_BallHold.py
from mpf.tests.MpfTestCase import MpfTestCase
from unittest.mock import MagicMock
class TestBallHold(MpfTestCase):
def get_config_file(self):
return 'test_ball_holds.yaml'
def get_machine_path(self):
return 'tests/machine_files/ball_holds/'
def _miss... | 0 | 0 | 0 | 0 | 0 | 0 |
src/osmo/config_osmo.py | jumperavocado/staketaxcsv | 140 | 133252 | <filename>src/osmo/config_osmo.py
from common import ExporterTypes as et
from common.config import config
class localconfig(config):
limit = 30000 # max txs
# Treat LP deposits/withdrawals as "transfers"/"omit"/"trades" (ignored for koinly)
lp_treatment = et.LP_TREATMENT_DEFAULT
ibc_addresses = {}
... | 0 | 0 | 0 | 0 | 0 | 0 |
stix/extensions/test_mechanism/open_ioc_2010_test_mechanism.py | saegel/python-stix | 194 | 133259 | # Copyright (c) 2017, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
# external
from __future__ import annotations
from lxml import etree
import mixbox.xml
from mixbox.fields import TypedField
from mixbox.vendor.six import BytesIO, iteritems
# internal
import stix
from stix.indicato... | 4 | 5 | 3 | 3 | 15 | 0 |
h/services/search_index/__init__.py | pombredanne/h | 2,103 | 133266 | <reponame>pombredanne/h<filename>h/services/search_index/__init__.py
from h.services.search_index.service import SearchIndexService
from h.services.search_index.service_factory import factory
| 0 | 0 | 0 | 0 | 0 | 0 |
lib/mirror/cnn_wrapper/resnet.py | Yzhbuaa/DAGSfM | 255 | 133274 | <reponame>Yzhbuaa/DAGSfM
from cnn_wrapper.network import Network
class ResNet50(Network):
def setup(self):
(self.feed('data')
.conv(7, 64, 2, padding=3, relu=False, name='conv1')
.batch_normalization(relu=True, scale=True, center=True, name='bn_conv1')
.max_pool(3, 2,... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/components/plex/test_services.py | andersop91/core | 22,481 | 133277 | <filename>tests/components/plex/test_services.py<gh_stars>1000+
"""Tests for various Plex services."""
from http import HTTPStatus
from unittest.mock import patch
from plexapi.exceptions import NotFound
import pytest
from homeassistant.components.media_player.const import MEDIA_TYPE_MUSIC
from homeassistant.component... | 0 | 0 | 0 | 0 | 0 | 0 |
exporter/SynthesisFusionGltfExporter/gltf/utils/PyUtils.py | Autodesk/synthesis | 136 | 133292 | <reponame>Autodesk/synthesis
from typing import *
def appendGetIndex(inList: List[any], value: any) -> int:
inList.append(value)
return len(inList) - 1 | 0 | 0 | 0 | 0 | 0 | 0 |
data_structures/trie/trie.py | NavpreetDevpuri/Python | 145,614 | 133303 | """
A Trie/Prefix Tree is a kind of search tree used to provide quick lookup
of words/patterns in a set of words. A basic Trie however has O(n^2) space complexity
making it impractical in practice. It however provides O(max(search_string, length of
longest word)) lookup time making it an optimal approach when space is ... | 11 | 11 | 0 | 2 | 24 | 0 |
SimCalorimetry/EcalElectronicsEmulation/python/EcalFEtoDigi_cfi.py | ckamtsikis/cmssw | 852 | 133310 | import FWCore.ParameterSet.Config as cms
tccFlatToDigi = cms.EDProducer("EcalFEtoDigi",
FileEventOffset = cms.untracked.int32(0),
UseIdentityLUT = cms.untracked.bool(False),
SuperModuleId = cms.untracked.int32(-1),
debugPrintFlag = cms.untracked.bool(False),
FlatBaseName = cms.untracked.string('eca... | 0 | 0 | 0 | 0 | 0 | 0 |
pyabsa/core/apc/dataset_utils/data_utils_for_inferring.py | yangheng95/PyABSA | 199 | 133331 | # -*- coding: utf-8 -*-
# file: data_utils_for_inferring.py
# time: 2021/4/22 0022
# author: yangheng <<EMAIL>>
# github: https://github.com/yangheng95
# Copyright (C) 2021. All Rights Reserved.
import numpy as np
from pyabsa.utils.pyabsa_utils import check_and_fix_labels, validate_example
from torch.utils.data import ... | 2 | 4 | 0 | 1 | 7 | 0 |
recipes/Python/52553_RoadRunner_recursively_updates_contents/recipe-52553.py | tdiprima/code | 2,023 | 133334 | #!/usr/bin/env python
# $Id. RoadRunner.py Thu Apr 5 10:49:48 EST 2001 JuanCarlos.Leon $
import os
import string
import re
import sys
_files_lst=[]
def pluggit(readlines,regx,addstrng):
""" Append a string to desire regex pattern """
lst=readlines
cregex=re.compile(regx)
for eachLine in lst:
m... | 0 | 0 | 0 | 0 | 0 | 0 |
Lib/test/test_frozen.py | arvindm95/unladen-swallow | 2,293 | 133348 | # Test the frozen module defined in frozen.c.
from test.test_support import captured_stdout, run_unittest
import unittest
import sys, os
class FrozenTests(unittest.TestCase):
def test_frozen(self):
with captured_stdout() as stdout:
try:
import __hello__
except Impo... | 0 | 0 | 0 | 0 | 0 | 0 |
AppServer/lib/django-1.4/tests/regressiontests/localflavor/mx/tests.py | loftwah/appscale | 790 | 133351 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from django.contrib.localflavor.mx.forms import (MXZipCodeField, MXRFCField,
MXStateSelect, MXCURPField)
from django.test import SimpleTestCase
from .forms import MXPersonProfileForm
class MXLocalFlavorTests(SimpleTestCase):
... | 0 | 0 | 0 | 0 | 0 | 0 |
AutotestWebD/all_urls/adminUrl.py | yangjourney/sosotest | 422 | 133366 | from django.conf.urls import url
from apps.myadmin.views import login, user, team, role, teamUserRelation, userRole, adminUser, businessLine, \
interfaceModule, interfacePermission, moduleManage, source, changeLog, businessLineModule, configService, \
jiraModule, modulePlatform, jiraBusinessLine, jiraBusiness... | 0 | 0 | 0 | 0 | 0 | 0 |
homeassistant/components/tankerkoenig/sensor.py | learn-home-automation/core | 22,481 | 133380 | from __future__ import annotations
"""Tankerkoenig sensor integration."""
import logging
from homeassistant.components.sensor import SensorEntity
from homeassistant.const import (
ATTR_ATTRIBUTION,
ATTR_LATITUDE,
ATTR_LONGITUDE,
CURRENCY_EURO,
)
from homeassistant.helpers.update_coordinator import (
... | 1 | 8 | 0 | 0 | 9 | 0 |
Chapter1/buylowsellhigh.py | buiksat/Learn-Algorithmic-Trading | 449 | 133397 | from pandas_datareader import data
start_date = '2014-01-01'
end_date = '2018-01-01'
goog_data = data.DataReader('GOOG', 'yahoo', start_date, end_date)
import numpy as np
import pandas as pd
goog_data_signal = pd.DataFrame(index=goog_data.index)
goog_data_signal['price'] = goog_data['Adj Close']
goog_data_signal['da... | 0 | 0 | 0 | 0 | 0 | 0 |
starfish/core/spots/FindSpots/test/test_local_max_peak_finder.py | haoxusci/starfish | 164 | 133401 | import sys
import numpy as np
from starfish import ImageStack
from starfish.spots import FindSpots
from starfish.types import Axes
def test_lmpf_uniform_peak():
data_array = np.zeros(shape=(1, 1, 1, 100, 100), dtype=np.float32)
data_array[0, 0, 0, 45:55, 45:55] = 1
imagestack = ImageStack.from_numpy(dat... | 0 | 0 | 0 | 0 | 0 | 0 |
mitmproxy/tls.py | ianklatzco/mitmproxy | 24,939 | 133429 | <filename>mitmproxy/tls.py
import io
from dataclasses import dataclass
from typing import List, Optional, Tuple
from kaitaistruct import KaitaiStream
from OpenSSL import SSL
from mitmproxy import connection
from mitmproxy.contrib.kaitaistruct import tls_client_hello
from mitmproxy.net import check
from mitmproxy.prox... | 0 | 0 | 0 | 0 | 0 | 0 |
web3/utils/empty.py | jsmeng324/web3.py | 326 | 133471 | <reponame>jsmeng324/web3.py
class Empty(object):
def __bool__(self):
return False
def __nonzero__(self):
return False
empty = Empty()
| 0 | 0 | 0 | 0 | 0 | 0 |
src/openue/models/model.py | ikutalilas/OpenUE | 461 | 133498 | from __future__ import annotations
import transformers as trans
import torch
import pytorch_lightning as pl
from torch.nn import CrossEntropyLoss, MSELoss
from transformers.models.auto.configuration_auto import AutoConfig
from transformers import AutoTokenizer
from openue.data.utils import get_labels_ner, get_labels_se... | 21 | 6 | 0 | 2 | 29 | 0 |
tests/test_find_enrichment_allfmts.py | flying-sheep/goatools | 477 | 133499 | #!/usr/bin/env python3
from __future__ import annotations
"""Test running an enrichment using any annotation file format."""
from __future__ import print_function
__copyright__ = "Copyright (C) 2010-2019, <NAME>, <NAME>. All rights reserved."
import os
import itertools
from goatools.base import get_godag
from goatoo... | 1 | 3 | 0 | 0 | 4 | 0 |
retrieval.py | janghyuncho/PiCIE | 113 | 133519 | <filename>retrieval.py
import os
import sys
import argparse
import logging
import time as t
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from modules import fpn
from commons import *
from utils import *
from train_picie import *
def initialize_classifier(args, n_query... | 0 | 0 | 0 | 0 | 0 | 0 |
mimesis/data/int/text.py | chinghwayu/mimesis | 2,619 | 133530 | <reponame>chinghwayu/mimesis<filename>mimesis/data/int/text.py
# -*- coding: utf-8 -*-
"""Provides all the data related to text."""
SAFE_COLORS = [
"#1abc9c",
"#16a085",
"#2ecc71",
"#27ae60",
"#3498db",
"#2980b9",
"#9b59b6",
"#8e44ad",
"#34495e",
"#2c3e50",
"#f1c40f",
"... | 0 | 0 | 0 | 0 | 0 | 0 |
vmoe/nn/external.py | google-research/vmoe | 205 | 133535 | # Copyright 2022 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, ... | 0 | 2 | 2 | 0 | 4 | 0 |
vibora/router/parser.py | brettcannon/vibora | 6,238 | 133576 | import re
from ..exceptions import RouteConfigurationError
class PatternParser:
PARAM_REGEX = re.compile(b'<.*?>')
DYNAMIC_CHARS = bytearray(b'*?.[]()')
CAST: dict[object,object] = {
str: lambda x: x.decode('utf-8'),
int: lambda x: int(x),
float: lambda x: float(x)
}
@cl... | 3 | 2 | 1 | 0 | 6 | 0 |
FWCore/Framework/test/test_deepCall_unscheduled_fail_cfg.py | ckamtsikis/cmssw | 852 | 133582 | <reponame>ckamtsikis/cmssw
import FWCore.ParameterSet.Config as cms
process = cms.Process("TEST")
import FWCore.Framework.test.cmsExceptionsFatalOption_cff
process.options = cms.untracked.PSet(
Rethrow = FWCore.Framework.test.cmsExceptionsFatalOption_cff.Rethrow
)
process.maxEvents = cms.untracked.PSet(
inpu... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/prof.py | RanganThaya/cvxpylayers | 1,287 | 133586 | <reponame>RanganThaya/cvxpylayers<filename>examples/prof.py
#!/usr/bin/env python3
import argparse
import sys
import numpy as np
import numpy.random as npr
import itertools
import time
import torch
from qpth.qp import QPFunction
from cvxpylayers.torch.cvxpylayer import CvxpyLayer
from scipy.linalg import sqrtm
fr... | 0 | 0 | 0 | 0 | 0 | 0 |
pocsuite/pocsuite_attack.py | zx273983653/vulscan | 582 | 133590 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (c) 2014-2016 pocsuite developers (https://seebug.org)
See the file 'docs/COPYING' for copying permission
"""
import sys
from pocsuite_cli import pcsInit
from .lib.core.common import banner
from .lib.core.common import dataToStdout
from .lib.core.settings im... | 0 | 0 | 0 | 0 | 0 | 0 |
website/debug_toolbar/views.py | bopopescu/canvas | 121 | 133618 | """
Helper views for the debug toolbar. These are dynamically installed when the
debug toolbar is displayed, and typically can do Bad Things, so hooking up these
views in any other way is generally not advised.
"""
import os
import django.views.static
from django.conf import settings
from django.db import connection
f... | 0 | 6 | 0 | 0 | 6 | 0 |
tests/json_schema/test_draft07.py | StephenNneji/python-fastjsonschema | 300 | 133638 | import pytest
from .utils import template_test, resolve_param_values_and_ids
def pytest_generate_tests(metafunc):
param_values, param_ids = resolve_param_values_and_ids(
schema_version='http://json-schema.org/draft-07/schema',
suite_dir='JSON-Schema-Test-Suite/tests/draft7',
ignored_suite... | 0 | 0 | 0 | 0 | 0 | 0 |
runners/old/rltools/run_con_hostage.py | SurvivorT/SRTP | 489 | 133658 | #!/usr/bin/env python
#
# File: run_con_hostage.py
#
# Created: Sunday, August 14 2016 by rejuvyesh <<EMAIL>>
#
from __future__ import absolute_import, print_function
import argparse
import json
import numpy as np
import tensorflow as tf
from gym import spaces
import rltools.algos.policyopt
import rltools.log
import... | 0 | 0 | 0 | 0 | 0 | 0 |
how-to-use-azureml/ml-frameworks/scikit-learn/train-hyperparameter-tune-deploy-with-sklearn/train_iris.py | lobrien/MachineLearningNotebooks | 3,074 | 133666 | <gh_stars>1000+
# Modified from https://www.geeksforgeeks.org/multiclass-classification-using-scikit-learn/
import argparse
import os
# importing necessary libraries
import numpy as np
from sklearn import datasets
from sklearn.metrics import confusion_matrix
from sklearn.model_selection import train_test_split
impo... | 0 | 0 | 0 | 0 | 0 | 0 |
py/torch_tensorrt/_enums.py | svenchilton/Torch-TensorRT | 430 | 133684 | from torch_tensorrt._C import dtype, DeviceType, EngineCapability, TensorFormat
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_plotting/test_matplotlib/test_plot_3d.py | RasaHQ/whatlies | 325 | 133687 | <gh_stars>100-1000
import pytest
import numpy as np
from whatlies.language import SpacyLanguage
from whatlies.transformers import Pca
words = [
"prince",
"princess",
"nurse",
"doctor",
"banker",
"man",
"woman",
"cousin",
"neice",
"king",
"queen",
"dude",
"guy",
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/unit/test_seeds.py | joye1503/cocrawler | 166 | 133692 | <reponame>joye1503/cocrawler<filename>tests/unit/test_seeds.py
import cocrawler.seeds as seeds
def test_special_seed_handling():
specialsh = seeds.special_seed_handling
assert specialsh('foo') == 'http://foo'
assert specialsh('//foo/') == 'http://foo/'
assert specialsh('https://foo') == 'https://foo'
... | 0 | 0 | 0 | 0 | 0 | 0 |
language/emql/util_test.py | urikz/language | 1,199 | 133704 | # coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... | 0 | 0 | 0 | 0 | 0 | 0 |
designate/tests/unit/metrics/test_metrics.py | mrlesmithjr/designate | 145 | 133720 | <filename>designate/tests/unit/metrics/test_metrics.py<gh_stars>100-1000
#
# Copyright (C) 2016 Red Hat, 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/li... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/autocomplete.py | silviogutierrez/reactivated | 178 | 133721 | import pytest
from reactivated import forms
from sample.server.apps.samples import models
@pytest.mark.django_db
@pytest.mark.urls("tests.urls")
def test_autocomplete(client):
composer = models.Composer.objects.create(name="<NAME>")
models.Composer.objects.create(name="<NAME>")
assert client.get("/autoc... | 0 | 0 | 0 | 0 | 0 | 0 |
src/storage-blob-preview/azext_storage_blob_preview/vendored_sdks/azure_mgmt_storage/v2021_01_01/models/_storage_management_client_enums.py | Mannan2812/azure-cli-extensions | 2,728 | 133743 | # 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 may ... | 0 | 2 | 155 | 0 | 157 | 0 |
java_predict_client/src/main/proto/tensorflow/contrib/learn/python/learn/metric_spec.py | tobegit3hub/deep_cnn | 101 | 133767 | # Copyright 2016 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... | 3 | 7 | 0 | 0 | 10 | 0 |
tensorflow/contrib/framework/python/ops/prettyprint_ops_test.py | atfkaka/tensorflow | 101 | 133772 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 0 | 0 | 0 | 0 | 0 | 0 |
exercises/ja/exc_01_07.py | Jette16/spacy-course | 2,085 | 133813 | <gh_stars>1000+
import spacy
# 「ja_core_news_sm」モデルをロード
nlp = ____
text = "公式発表:Appleが米国の上場企業として初めて時価評価額1兆ドルに到達しました。"
# テキストを処理
doc = ____
# docのテキストをプリント
print(____.____)
| 0 | 0 | 0 | 0 | 0 | 0 |
firefly/distributed/reference.py | genghaolove/firefly | 675 | 133815 | <filename>firefly/distributed/reference.py<gh_stars>100-1000
#coding:utf8
'''
Created on 2013-8-14
@author: lan (www.9miao.com)
'''
from twisted.spread import pb
from firefly.utils.services import Service
class ProxyReference(pb.Referenceable):
'''代理通道'''
def __init__(self):
'''初始化'''
se... | 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.