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 |
|---|---|---|---|---|---|---|---|---|---|---|
eventlet/green/http/cookies.py | li-caspar/eventlet_0.30.2 | 5,079 | 3279729 | # This is part of Python source code with Eventlet-specific modifications.
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
# 2011, 2012, 2013, 2014, 2015, 2016 Python Software Foundation; All Rights
# Reserved
#
# PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
# -----------------------------... | 11 | 24 | 2 | 0 | 37 | 0 |
mmdet/apis/train.py | BUPT-PRIV/BalancedGroupSoftmax | 333 | 3279755 | from __future__ import annotations
from __future__ import division
import re
from collections import OrderedDict
import torch
from mmcv.parallel import MMDataParallel, MMDistributedDataParallel
from mmcv.runner import DistSamplerSeedHook, Runner, obj_from_dict
from mmdet import datasets
from mmdet.core import (CocoDi... | 5 | 3 | 0 | 0 | 8 | 0 |
examples/naf_pendulum.py | stefanbschneider/keras-rl | 3,350 | 3279772 | <filename>examples/naf_pendulum.py
import numpy as np
import gym
from keras.models import Sequential, Model
from keras.layers import Dense, Activation, Flatten, Input, Concatenate
from keras.optimizers import Adam
from rl.agents import NAFAgent
from rl.memory import SequentialMemory
from rl.random import OrnsteinUhle... | 0 | 0 | 0 | 0 | 0 | 0 |
notebooks-text-format/GAN_loss_types.py | arpitvaghela/probml-notebooks | 166 | 3279796 | # ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.11.3
# kernelspec:
# display_name: Python 3
# name: python3
# ---
# + [markdown] id="view-in-github" colab_type="text"
# <a href="https://colab... | 0 | 0 | 0 | 0 | 0 | 0 |
fuzzinator/ui/tui/decor_widgets.py | pmatos/fuzzinator | 202 | 3279800 | # Copyright (c) 2016-2019 <NAME>, <NAME>.
#
# Licensed under the BSD 3-Clause License
# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.
# This file may not be copied, modified, or distributed except
# according to those terms.
"""
Widgets to extend Urwid capabilities
"""
from urwid import *
class Pat... | 12 | 5 | 3 | 2 | 22 | 0 |
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/unsafe/eh.py | BadDevCode/lumberyard | 1,738 | 3279814 | <reponame>BadDevCode/lumberyard<filename>dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/unsafe/eh.py<gh_stars>1000+
"""
Exception handling intrinsics.
"""
from numba import types, cgutils, errors
from numba.extending import intrinsic
@intrinsic
def exception_check(typingctx):
"""An intrinsic to check if... | 0 | 0 | 0 | 0 | 0 | 0 |
packages/fetchai/skills/gym/rl_agent.py | bryanchriswhite/agents-aea | 126 | 3279816 | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# 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 ... | 16 | 9 | 0 | 2 | 27 | 0 |
backpack/extensions/firstorder/batch_grad/conv_transpose3d.py | jabader97/backpack | 395 | 3279848 | <reponame>jabader97/backpack
from backpack.core.derivatives.conv_transpose3d import ConvTranspose3DDerivatives
from backpack.extensions.firstorder.batch_grad.batch_grad_base import BatchGradBase
class BatchGradConvTranspose3d(BatchGradBase):
def __init__(self):
super().__init__(
derivatives=Co... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/dicts/test_mk_nested_dic.py | ssato/python-anyconfig | 213 | 3279861 | #
# Forked from m9dicts.tests.{api,dicts}
#
# Copyright (C) 2011 - 2021 <NAME> <<EMAIL>>
#
# pylint: disable=missing-docstring,invalid-name
import anyconfig.dicts as TT
from . import common
class TestCase(common.TestCase):
kind: str = 'mk_nested_dic'
pattern: str = '*.*'
ordered: bool = False
def te... | 0 | 0 | 3 | 0 | 3 | 0 |
Scripts/sims4communitylib/enums/common_gender.py | ColonolNutty/Sims4CommunityLibrary | 118 | 3279870 | """
The Sims 4 Community Library is licensed under the Creative Commons Attribution 4.0 International public license (CC BY 4.0).
https://creativecommons.org/licenses/by/4.0/
https://creativecommons.org/licenses/by/4.0/legalcode
Copyright (c) COLONOLNUTTY
"""
from typing import Dict, Union, Tuple
from sims.sim_info i... | 4 | 6 | 7 | 0 | 17 | 0 |
tgen/parallel_seq2seq_train.py | nbishdev/tgen | 222 | 3279872 | <reponame>nbishdev/tgen
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
"""
from __future__ import unicode_literals
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from builtins import range
from builtins import object
from threading import Thread
impor... | 0 | 0 | 0 | 0 | 0 | 0 |
build/fbcode_builder/specs/proxygen.py | nathanawmk/fboss | 19,046 | 3279875 | <reponame>nathanawmk/fboss
#!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import specs.fizz as fizz
import specs.fmt as fmt
import specs.folly a... | 0 | 0 | 0 | 0 | 0 | 0 |
chatbot/__init__.py | mckinziebrandon/seq2seq_projects | 341 | 3279877 | <reponame>mckinziebrandon/seq2seq_projects<gh_stars>100-1000
from chatbot import globals
from chatbot.components.base._rnn import *
from chatbot.components.bot_ops import dynamic_sampled_softmax_loss
from chatbot.components.decoders import *
from chatbot.components.embedder import *
from chatbot.components.encoders im... | 0 | 0 | 0 | 0 | 0 | 0 |
graphql/core/validation/rules.py | gabriel-laet/graphql-py | 118 | 3279901 | from __future__ import annotations
import itertools
from ..error import GraphQLError
from ..language import ast
from ..language.printer import print_ast
from ..language.visitor import Visitor, visit
from ..type.definition import (
GraphQLInterfaceType,
GraphQLList,
GraphQLNonNull,
GraphQLObjectType,
... | 2 | 76 | 8 | 14 | 100 | 0 |
airflow/providers/mysql/transfers/trino_to_mysql.py | ChaseKnowlden/airflow | 15,947 | 3279905 | <gh_stars>1000+
#
# 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
# "Licens... | 0 | 0 | 0 | 0 | 0 | 0 |
paas-ce/paas/paas/app/forms.py | canway-bk/bk-PaaS | 767 | 3279947 | # -*- coding: utf-8 -*-
from __future__ import annotations
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you... | 0 | 17 | 0 | 0 | 17 | 0 |
training/misc.py | Euro2xx/gansformer | 1,172 | 3279969 | <filename>training/misc.py
# Miscellaneous utility functions
import tensorflow as tf
import numpy as np
import PIL.Image
import pickle
import dnnlib
import math
import glob
import os
import seaborn as sns
from termcolor import colored
from tqdm import tqdm
# Colorful prints
# -----------------------------------------... | 0 | 0 | 0 | 0 | 0 | 0 |
recipes/rmlui/4.x/conanfile.py | dvirtz/conan-center-index | 562 | 3279993 | <gh_stars>100-1000
from conans import ConanFile, CMake, tools
from conans.errors import ConanInvalidConfiguration
import os
class RmluiConan(ConanFile):
name = "rmlui"
description = "RmlUi - The HTML/CSS User Interface Library Evolved"
homepage = "https://github.com/mikke89/RmlUi"
url = "https://githu... | 0 | 0 | 0 | 0 | 0 | 0 |
fuel/server.py | zaimusho/fuel | 767 | 3280021 | import logging
import numpy
import zmq
from numpy.lib.format import header_data_from_array_1_0
from fuel.utils import buffer_
logger = logging.getLogger(__name__)
def send_arrays(socket, arrays, stop: bool=False):
"""Send NumPy arrays using the buffer interface and some metadata.
Parameters
----------... | 3 | 1 | 0 | 0 | 4 | 0 |
mathml/tools/limits.py | meyerweb/wpt | 14,668 | 3280028 | <gh_stars>1000+
#!/usr/bin/env python3
from utils import mathfont
import fontforge
nArySumCodePoint = 0x2211 # largeop operator
v = 3 * mathfont.em
f = mathfont.create("limits-lowerlimitbaselinedropmin%d" % v,
"Copyright (c) 2016 MathML Association")
mathfont.createSquareGlyph(f, nArySumCodePoint... | 0 | 0 | 0 | 0 | 0 | 0 |
kim/pipelines/static.py | mikeywaites/kim | 356 | 3280044 | # kim/pipelines/static.py
# Copyright (C) 2014-2015 the Kim authors and contributors
# <see AUTHORS file>
#
# This module is part of Kim and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from .base import pipe
from .serialization import SerializePipeline
@pipe(run_if_none=Tr... | 0 | 1 | 0 | 0 | 1 | 0 |
cursive_re/exprs.py | Bogdanp/cursive_re | 332 | 3280064 | <gh_stars>100-1000
import re
from typing import Optional, Pattern, Union
def compile(expr: "expr", flags: int = 0) -> Pattern[str]:
"""Compile a cursive_re expression to a real regular expression.
"""
return re.compile(str(expr), flags)
class expr:
def __add__(self, other: "expr") -> "expr":
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/components/iotawatt/test_config_flow.py | MrDelik/core | 30,023 | 3280068 | """Test the IoTawatt config flow."""
from unittest.mock import patch
import httpx
from homeassistant import config_entries
from homeassistant.components.iotawatt.const import DOMAIN
from homeassistant.core import HomeAssistant
from homeassistant.data_entry_flow import RESULT_TYPE_CREATE_ENTRY, RESULT_TYPE_FORM
asyn... | 4 | 4 | 0 | 0 | 8 | 0 |
quetz/tests/api/test_api_keys.py | maresb/quetz | 108 | 3280078 | <filename>quetz/tests/api/test_api_keys.py
import pytest
from quetz.dao import Dao
from quetz.db_models import ApiKey, ChannelMember, PackageMember
from quetz.rest_models import BaseApiKey
from quetz.utils import generate_random_key
@pytest.fixture
def api_keys(other_user, user, db, dao: Dao):
def key_factory(ke... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/dev/rename_busco_genes.py | caspoer/BRAKER | 180 | 3280083 | <filename>scripts/dev/rename_busco_genes.py
#!/usr/bin/env python3
import re
import argparse
import sys
import errno
import shutil
import os
from os import listdir
from os.path import isfile, join
__author__ = "<NAME>"
__copyright__ = "Copyright 2020. All rights reserved."
__license__ = "Artistic License"
__version_... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/settings/main.py | Galland/kivy | 13,889 | 3280084 | from __future__ import annotations
"""
Config Example
==============
This file contains a simple example of how the use the Kivy settings classes in
a real app. It allows the user to change the caption and font_size of the label
and stores these changes.
When the user next runs the programs, their changes are restore... | 1 | 1 | 0 | 0 | 2 | 0 |
drake/src/drake/enumeration.py | wk8/elle | 124 | 3280089 | <reponame>wk8/elle<gh_stars>100-1000
# Copyright (C) 2013-2016, Quentin "mefyl" Hocquet
#
# This software is provided "as is" without warranty of any kind,
# either expressed or implied, including but not limited to the
# implied warranties of fitness for a particular purpose.
#
# See the LICENSE file for more informat... | 0 | 0 | 0 | 0 | 0 | 0 |
comm/ntlmrelayx/servers/socksplugins/http.py | helloexp/CVE-2019-1040 | 225 | 3280096 | <reponame>helloexp/CVE-2019-1040
# SECUREAUTH LABS. Copyright 2018 SecureAuth Corporation. All rights reserved.
#
# This software is provided under under a slightly modified version
# of the Apache Software License. See the accompanying LICENSE file
# for more information.
#
# A Socks Proxy for the HTTP Protocol
#
# Au... | 0 | 0 | 0 | 0 | 0 | 0 |
aerosandbox/optimization/test_optimization/test_opti_parametric_sensitivites.py | peterdsharpe/AeroSandbox | 322 | 3280101 | import aerosandbox as asb
import aerosandbox.numpy as np
import pytest
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(palette=sns.color_palette("husl"))
"""
This test solves the 2-dimensional Rosenbrock problem constrained to a circle centered on the origin:
----------
Minimize:
(1 - x) ** 2 + (y - ... | 1 | 0 | 0 | 0 | 1 | 0 |
gryphon/data_service/pollers/trades/trades_poller.py | qiquanzhijia/gryphon | 1,109 | 3280124 | <reponame>qiquanzhijia/gryphon
# -*- coding: utf-8 -*-
import json
import termcolor as tc
from twisted.internet import defer
from twisted.internet.task import LoopingCall
from twisted.python import log
import gryphon.data_service.consts as consts
from gryphon.data_service.pollers.request_poller import RequestPoller
i... | 0 | 0 | 0 | 0 | 0 | 0 |
api/waffle/serializers.py | gaybro8777/osf.io | 628 | 3280129 | <gh_stars>100-1000
from rest_framework import serializers as ser
from api.base.serializers import JSONAPISerializer, TypeField
from api.base.waffle_decorators import waffle_feature_is_active
from waffle.models import Flag, Sample, Switch
class BaseWaffleSerializer(JSONAPISerializer):
id = ser.SerializerMethodFie... | 0 | 0 | 0 | 0 | 0 | 0 |
demo/demo_2d_unbounded.py | yuanming-hu/elements | 265 | 3280158 | import taichi as ti
import numpy as np
import utils
import math
from engine.mpm_solver import MPMSolver
write_to_disk = False
ti.init(arch=ti.cuda) # Try to run on GPU
gui = ti.GUI("Taichi MLS-MPM", res=512, background_color=0x112F41)
mpm = MPMSolver(res=(128, 128), unbounded=True)
mpm.add_surface_collider(point=(0... | 0 | 0 | 0 | 0 | 0 | 0 |
deepchem/trans/tests/test_clipping.py | cjgalvin/deepchem | 3,782 | 3280176 | <gh_stars>1000+
import deepchem as dc
import numpy as np
def test_clipping_X_transformer():
"""Test clipping transformer on X of singletask dataset."""
n_samples = 10
n_features = 3
n_tasks = 1
ids = np.arange(n_samples)
X = np.ones((n_samples, n_features))
target = 5. * X
X *= 6.
y = np.zeros((n_sa... | 0 | 0 | 0 | 0 | 0 | 0 |
uberduck_ml_dev/text/symbols.py | Cris140/uberduck-ml-dev | 167 | 3280184 | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/text.symbols.ipynb (unless otherwise specified).
__all__ = ['symbols_portuguese', 'PORTUGUESE_SYMBOLS', 'symbols_polish', 'POLISH_SYMBOLS', 'symbols_dutch',
'DUTCH_SYMBOLS', 'symbols_spanish', 'SPANISH_SYMBOLS', 'symbols', 'symbols_nvidia_taco2', 'symbols_with... | 2 | 3 | 0 | 0 | 5 | 0 |
xarray/tests/test_backends_locks.py | jhamman/xarray-test-docs | 2,257 | 3280186 | <reponame>jhamman/xarray-test-docs
import threading
from xarray.backends import locks
def test_threaded_lock() -> None:
lock1 = locks._get_threaded_lock("foo")
assert isinstance(lock1, type(threading.Lock()))
lock2 = locks._get_threaded_lock("foo")
assert lock1 is lock2
lock3 = locks._get_thread... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/curl/test/curlparse/test_block_iterator.py | isabella232/apicheck | 224 | 3280200 | <filename>tools/curl/test/curlparse/test_block_iterator.py
import gurl.curlparse as cp
import uuid
def test_none():
inp = None
res = cp.curl_trace_block_iterator(inp)
assert len(list(res)) == 0
def test_empty():
inp = ""
res = cp.curl_trace_block_iterator(inp)
assert len(list(res)) == 0
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/web/test_web_client.py | renovate-testing/test-10090-2-python-slack-sdk | 492 | 3280201 | <gh_stars>100-1000
import asyncio
import gc
import io
import re
import socket
import unittest
import slack.errors as err
from slack import WebClient
from tests.helpers import async_test
from tests.web.mock_web_api_server import (
setup_mock_web_api_server,
cleanup_mock_web_api_server,
)
class TestWebClient(u... | 0 | 0 | 0 | 0 | 0 | 0 |
sfa/train.py | Allendjmax/lidar | 409 | 3280225 | <reponame>Allendjmax/lidar
"""
# -*- coding: utf-8 -*-
-----------------------------------------------------------------------------------
# Author: <NAME>
# DoC: 2020.08.17
# email: <EMAIL>
-----------------------------------------------------------------------------------
# Description: This script for training
"""
... | 0 | 0 | 0 | 0 | 0 | 0 |
LCM/scripts/GetDscLocalConfigurationManager.py | Microsoft/PowerShell-DSC-for-Linux | 154 | 3280227 | #!/usr/bin/python2
import fileinput
import sys
import subprocess
import json
import time
import datetime
import os
import os.path
from OmsConfigHostHelpers import write_omsconfig_host_telemetry, write_omsconfig_host_switch_event, write_omsconfig_host_log, stop_old_host_instances
from imp import load_source
f... | 0 | 0 | 0 | 0 | 0 | 0 |
src/oci/devops/models/repository_ref_summary.py | CentroidChef/oci-python-sdk | 249 | 3280237 | # 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 | 10 | 0 | 8 | 18 | 0 |
finalists/yc14600/PyTorch-Encoding/scripts/prepare_ade20k.py | lrzpellegrini/cvpr_clvision_challenge | 2,190 | 3280284 | <gh_stars>1000+
"""Prepare ADE20K dataset"""
import os
import shutil
import argparse
import zipfile
from encoding.utils import download, mkdir
_TARGET_DIR = os.path.expanduser('~/.encoding/data')
def parse_args():
parser = argparse.ArgumentParser(
description='Initialize ADE20K dataset.',
epilog='... | 0 | 0 | 0 | 0 | 0 | 0 |
fund/run_sz_fundshare.py | cogitate3/stock | 3,401 | 3280307 | # -*- coding: UTF-8 -*-
"""
@author:xda
@file:run_sz_fundshare.py
@time:2021/01/24
"""
from fund_share_crawl import SZFundShare
if __name__ == '__main__':
app = SZFundShare(first_use=False)
app.run()
| 0 | 0 | 0 | 0 | 0 | 0 |
python_modules/dagster/dagster_tests/core_tests/definitions_tests/decorators_tests/test_op.py | alexismanuel/dagster | 4,606 | 3280309 | <filename>python_modules/dagster/dagster_tests/core_tests/definitions_tests/decorators_tests/test_op.py
from typing import Dict, Generator, Tuple
import pytest
from dagster import (
DagsterInvalidConfigError,
DagsterInvariantViolationError,
DagsterType,
DagsterTypeCheckDidNotPass,
In,
Nothing,
... | 0 | 0 | 0 | 0 | 0 | 0 |
Tests/test_PopGen_GenePop_EasyController.py | lukasz-kozlowski/biopython | 2,856 | 3280312 | # Copyright 2009 by <NAME> <<EMAIL>>. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Tests for GenePop easy-controller."""
import os
import unittest
from Bio import Missin... | 0 | 0 | 0 | 0 | 0 | 0 |
deepneuro/outputs/inference.py | ysuter/DeepNeuro | 113 | 3280323 | <reponame>ysuter/DeepNeuro
""" This is a base class for running inference on models.
"""
import numpy as np
from deepneuro.outputs.output import Output
from deepneuro.utilities.util import add_parameter
class ModelInference(Output):
def load(self, kwargs):
# Evaluation Params
add_parameter(sel... | 0 | 0 | 0 | 0 | 0 | 0 |
utils/gyb_syntax_support/AvailabilityNodes.py | gandhi56/swift | 72,551 | 3280343 | <reponame>gandhi56/swift<gh_stars>1000+
from .Child import Child
from .Node import Node # noqa: I201
AVAILABILITY_NODES = [
# availability-spec-list -> availability-entry availability-spec-list?
Node('AvailabilitySpecList', kind='SyntaxCollection',
element='AvailabilityArgument'),
# Wrapper for ... | 0 | 0 | 0 | 0 | 0 | 0 |
maskrcnn_benchmark/data/datasets/evaluation/voc/__init__.py | witwitchayakarn/6DVNET | 295 | 3280363 | <reponame>witwitchayakarn/6DVNET<gh_stars>100-1000
import logging
from .voc_eval import do_voc_evaluation
def voc_evaluation(dataset, predictions, output_folder, box_only, **_):
logger = logging.getLogger("maskrcnn_benchmark.inference")
if box_only:
logger.warning("voc evaluation doesn't supp... | 0 | 0 | 0 | 0 | 0 | 0 |
2021/CVE-2021-20167/poc/pocsploit/CVE-2021-20167.py | hjyuan/reapoc | 421 | 3280379 | from __future__ import annotations
import requests
from plugins.oob import verify_request, gen_oob_domain
# Vuln Base Info
def info() -> dict[str,dict[str,str] | list[str] | str]:
return {
"author": "cckuailong",
"name": '''Netgear RAX43 - Unauthenticated Command Injection / Authentication Bypass... | 0 | 5 | 0 | 0 | 5 | 0 |
checkov/terraform/checks/resource/aws/RDSEnableIAMAuthentication.py | jamesholland-uk/checkov | 4,013 | 3280381 | <filename>checkov/terraform/checks/resource/aws/RDSEnableIAMAuthentication.py
from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck
from checkov.common.models.enums import CheckCategories
class RDSEnableIAMAuthentication(BaseResourceValueCheck):
def __init__(self):
... | 0 | 0 | 0 | 0 | 0 | 0 |
Python3/863.py | rakhi2001/ecom7 | 854 | 3280396 | <reponame>rakhi2001/ecom7<gh_stars>100-1000
__________________________________________________________________________________________________
sample 24 ms submission
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.righ... | 0 | 0 | 0 | 0 | 0 | 0 |
nova/tests/unit/test_test_utils.py | zjzh/nova | 1,874 | 3280401 | <filename>nova/tests/unit/test_test_utils.py<gh_stars>1000+
# Copyright 2010 OpenStack Foundation
#
# 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... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/extmoduleutf8.py | JoostvDoorn/pywren | 630 | 3280402 | <reponame>JoostvDoorn/pywren<filename>tests/extmoduleutf8.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2018 PyWren Team
#
# 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
#
# h... | 0 | 0 | 0 | 0 | 0 | 0 |
azure-iot-device/azure/iot/device/common/auth/__init__.py | danewalton/azure-iot-sdk-python | 366 | 3280443 | from .signing_mechanism import SymmetricKeySigningMechanism
# NOTE: Please import the connection_string and sastoken modules directly
# rather than through the package interface, as the modules contain many
# related items for their respective domains, which we do not wish to expose
# at length here.
| 0 | 0 | 0 | 0 | 0 | 0 |
appengine/standard/images/api/blobstore_test.py | yshalabi/python-docs-samples | 5,938 | 3280470 | <gh_stars>1000+
# Copyright 2015 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 app... | 0 | 0 | 0 | 0 | 0 | 0 |
rabbitmq/tests/conftest.py | mchelen-gov/integrations-core | 663 | 3280474 | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import os
import subprocess
import pytest
import requests
from datadog_checks.dev import docker_run, temp_dir
from datadog_checks.rabbitmq import RabbitMQ
from .common import CHECK_NAME, CONFIG, HERE, ... | 0 | 2 | 0 | 0 | 2 | 0 |
monailabel/utils/sessions.py | IntroAI-termproject/MONAILabel | 214 | 3280476 | # Copyright 2020 - 2021 MONAI Consortium
# 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 wri... | 12 | 5 | 1 | 7 | 25 | 0 |
dreamerv2/common/__init__.py | Leonardo130709/dreamerv2 | 524 | 3280492 | # General tools.
from .config import *
from .counter import *
from .flags import *
from .logger import *
from .when import *
# RL tools.
from .other import *
from .driver import *
from .envs import *
from .replay import *
# TensorFlow tools.
from .tfutils import *
from .dists import *
from .nets import *
| 0 | 0 | 0 | 0 | 0 | 0 |
segmentation/model/post_processing/semantic_post_processing.py | RajasekharChowdary9/panoptic-deeplab | 506 | 3280496 | # ------------------------------------------------------------------------------
# Post-processing to get semantic segmentation results.
# Written by <NAME> (<EMAIL>)
# ------------------------------------------------------------------------------
import torch
__all__ = ['get_semantic_segmentation']
def get_semanti... | 0 | 1 | 0 | 0 | 1 | 0 |
tests/components/ozw/test_services.py | tbarbette/core | 22,481 | 3280497 | <filename>tests/components/ozw/test_services.py<gh_stars>1000+
"""Test Z-Wave Services."""
from openzwavemqtt.const import ATTR_POSITION, ATTR_VALUE
from openzwavemqtt.exceptions import InvalidValueError, NotFoundError, WrongTypeError
import pytest
from .common import setup_ozw
async def test_services(hass, light_da... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/parallel/test_base.py | gony0/buffalo | 577 | 3280520 | <reponame>gony0/buffalo<filename>tests/parallel/test_base.py
# -*- coding: utf-8 -*-
import time
import psutil
import unittest
import numpy as np
from buffalo.algo.als import ALS
from buffalo.misc.log import set_log_level
from .base import TestBase, MockParallel
class TestParallelBase(TestBase):
def get_factor... | 0 | 0 | 0 | 0 | 0 | 0 |
detectron2/solver/lr_scheduler.py | Shun14/detectron2-ResNeSt | 348 | 3280534 | <reponame>Shun14/detectron2-ResNeSt
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import math
from bisect import bisect_right
from typing import List
import torch
# NOTE: PyTorch's LR scheduler interface uses names that assume the LR changes
# only on epoch boundaries. We typically use iterati... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/io/test_embed_loader.py | sleepy-owl/fastNLP | 2,693 | 3280540 | <reponame>sleepy-owl/fastNLP
import unittest
import numpy as np
from fastNLP import Vocabulary
from fastNLP.io import EmbedLoader
class TestEmbedLoader(unittest.TestCase):
def test_load_with_vocab(self):
vocab = Vocabulary()
glove = "tests/data_for_tests/embedding/small_static_embedding/glove.6B.... | 0 | 0 | 0 | 0 | 0 | 0 |
mmdnn/conversion/_script/convertToIR.py | ankitshah009/MMdnn | 3,442 | 3280550 | <reponame>ankitshah009/MMdnn<gh_stars>1000+
import sys as _sys
import google.protobuf.text_format as text_format
from six import text_type as _text_type
def _convert(args):
if args.inputShape != None:
inputshape = []
for x in args.inputShape:
shape = x.split(',')
inputshape... | 0 | 0 | 0 | 0 | 0 | 0 |
src/oci/data_safe/models/generate_security_assessment_report_details.py | Manny27nyc/oci-python-sdk | 249 | 3280566 | # 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 | 4 | 2 | 3 | 9 | 0 |
tests/sync/test_element_handle.py | axelande/playwright-python | 6,243 | 3280574 | <gh_stars>1000+
# Copyright (c) Microsoft 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 ... | 0 | 0 | 0 | 0 | 0 | 0 |
donghuangzhong/src/lib/scapy/layers/dns.py | onsis/hack-tools | 171 | 3280586 | ## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) <NAME> <<EMAIL>>
## This program is published under a GPLv2 license
from __future__ import annotations
import socket,struct
from scapy.packet import *
from scapy.fields import *
from scapy.ansmachine impor... | 7 | 20 | 13 | 0 | 40 | 0 |
calamari_ocr/ocr/dataset/datareader/pagexml/__init__.py | jacektl/calamari | 922 | 3280616 | from .reader import PageXMLReader
| 0 | 0 | 0 | 0 | 0 | 0 |
src/sage/combinat/sf/schur.py | sheerluck/sage | 1,742 | 3280642 | <gh_stars>1000+
"""
Schur symmetric functions
"""
# ****************************************************************************
# Copyright (C) 2007 <NAME> <<EMAIL>>
# 2012 <NAME> <<EMAIL>>
#
# Distributed under the terms of the GNU General Public License (GPL)
#
# This code is distribute... | 0 | 0 | 0 | 0 | 0 | 0 |
plugins/public/cinq-collector-aws/cinq_collector_aws/views/ebs_volumes.py | gibbsie/cloud-inquisitor | 462 | 3280650 | from cloud_inquisitor.constants import ROLE_USER, HTTP
from cloud_inquisitor.plugins import BaseView
from cloud_inquisitor.plugins.types.resources import EBSVolume
from cloud_inquisitor.utils import MenuItem
from cloud_inquisitor.wrappers import check_auth, rollback
class EBSVolumeList(BaseView):
URLS: list[str] ... | 0 | 2 | 3 | 0 | 5 | 0 |
spacy_cld/about.py | redsk/spacy-cld | 113 | 3280651 | <reponame>redsk/spacy-cld
__title__ = 'spacy-cld'
__version__ = '0.1.0'
__summary__ = 'spaCy pipeline component for guessing the language of Doc and Span objects.'
__url__ = 'https://github.com/nickdavidhaynes/spacy-cld'
__author__ = '<NAME>'
__email__ = '<EMAIL>'
__license__ = 'MIT'
| 0 | 0 | 0 | 0 | 0 | 0 |
yasql/yasql/settings.py | simonhou/YaSQL | 443 | 3280665 | <filename>yasql/yasql/settings.py
"""
Django settings for yasql project.
Generated by 'django-admin startproject' using Django 2.2.15.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.... | 0 | 0 | 0 | 0 | 0 | 0 |
tensorflow/lite/experimental/mlir/testing/op_tests/while_loop.py | ashutom/tensorflow-upstream | 4,538 | 3280668 | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 0 | 5 | 0 | 0 | 5 | 0 |
src/toil/provisioners/abstractProvisioner.py | Hexotical/toil | 348 | 3280741 | <gh_stars>100-1000
# Copyright (C) 2015-2021 Regents of the University of California
#
# 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
#
# Unl... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/pot/openvino/tools/pot/configs/templates/__init__.py | kurylo/openvino | 1,127 | 3280745 | # Copyright (C) 2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
| 0 | 0 | 0 | 0 | 0 | 0 |
examples/change_detection/prepara_data.py | yaoshanliang/PaddleX | 3,655 | 3280771 | import os
import os.path as osp
import numpy as np
import cv2
import shutil
import random
# 为保证每次运行该脚本时划分的样本一致,故固定随机种子
random.seed(0)
import paddlex as pdx
# 定义训练集切分时的滑动窗口大小和步长,格式为(W, H)
train_tile_size = (1024, 1024)
train_stride = (512, 512)
# 定义验证集切分时的滑动窗口大小和步长,格式(W, H)
val_tile_size = (769, 769)
val_stride = (769... | 0 | 0 | 0 | 0 | 0 | 0 |
dymos/utils/hermite.py | kaushikponnapalli/dymos | 104 | 3280794 | import numpy as np
def hermite_matrices(x_given, x_eval) -> tuple[object, object, object, object]:
"""
Return matrices for a Hermite polynomial at the given nodes.
This includes interpolation matrices (A_i and B_i) and differentiation matrices (A_d and B_d).
Parameters
----------
x_given : n... | 0 | 3 | 0 | 0 | 3 | 0 |
tf_agents/specs/array_spec_test.py | Francis777/agents | 3,175 | 3280822 | <reponame>Francis777/agents
# coding=utf-8
# Copyright 2020 The TF-Agents 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unle... | 0 | 0 | 0 | 0 | 0 | 0 |
egs/iwslt21/asr1/local/filter_parentheses.py | nmfisher/espnet | 5,053 | 3280828 | <gh_stars>1000+
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2021 Kyoto University (<NAME>)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import argparse
import codecs
import re
import regex
parser = argparse.ArgumentParser()
parser.add_argument("text", type=str, help="text file")
args =... | 0 | 0 | 0 | 0 | 0 | 0 |
dev/Tools/Python/2.7.13/mac/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyxb/bundles/wssplat/sawsdl.py | jeikabu/lumberyard | 123 | 3280829 | # -*- coding: utf-8 -*-
from pyxb.bundles.wssplat.raw.sawsdl import *
| 0 | 0 | 0 | 0 | 0 | 0 |
disprcnn/solver/lr_scheduler.py | maheriya/disprcnn | 191 | 3280838 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
from __future__ import annotations
from bisect import bisect_right
from torch.optim.lr_scheduler import _LRScheduler
import numpy as np
from torch.optim.optimizer import Optimizer
class ConstantScheduler(_LRScheduler):
def __init__(self, opti... | 10 | 6 | 0 | 4 | 20 | 0 |
customer/apps.py | wh8983298/GreaterWMS | 1,063 | 3280879 | <reponame>wh8983298/GreaterWMS
from django.apps import AppConfig
class CustomerConfig(AppConfig):
name = 'customer'
| 0 | 0 | 0 | 0 | 0 | 0 |
example/utils/get_data.py | headupinclouds/mxnet | 399 | 3280892 | # 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... | 0 | 1 | 0 | 0 | 1 | 0 |
test/lib/mayaUsd/render/vp2RenderDelegate/testVP2RenderDelegateInteractiveWorkflows.py | ika-rporter/maya-usd | 507 | 3280897 | <filename>test/lib/mayaUsd/render/vp2RenderDelegate/testVP2RenderDelegateInteractiveWorkflows.py
#!/usr/bin/env mayapy
#
# Copyright 2021 Autodesk
#
# 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... | 0 | 0 | 0 | 0 | 0 | 0 |
Algorithms/Cryptography_Algorithm/Bifid_Cipher/Bifid_Cipher.py | arslantalib3/algo_ds_101 | 182 | 3280902 | <reponame>arslantalib3/algo_ds_101<gh_stars>100-1000
"""
@author: <NAME>
@github: abhinav-idle
"""
"""
Bifid Cipher was invented in 1901 by <NAME>.
Bifid cipher is a cipher in which we combine polybius
square with transposition and fractionation i.e
we use regular system to shift the letters of input-text
so tha... | 0 | 0 | 0 | 0 | 0 | 0 |
malaya_speech/config/tacotron2.py | ishine/malaya-speech | 111 | 3280907 | config = {
'embedding_hidden_size': 512,
'initializer_range': 0.02,
'embedding_dropout_prob': 0.1,
'n_speakers': 1,
'n_conv_encoder': 5,
'encoder_conv_filters': 512,
'encoder_conv_kernel_sizes': 5,
'encoder_conv_activation': 'relu',
'encoder_conv_dropout_rate': 0.5,
'encoder_lstm... | 0 | 0 | 0 | 0 | 0 | 0 |
pydlm/tests/tuner/test_dlmTune.py | onnheimm/pydlm | 423 | 3280909 | <reponame>onnheimm/pydlm<filename>pydlm/tests/tuner/test_dlmTune.py
import unittest
from pydlm.modeler.trends import trend
from pydlm.modeler.seasonality import seasonality
from pydlm.modeler.autoReg import autoReg
from pydlm.tuner._dlmTune import _dlmTune
class test_dlmTune(unittest.TestCase):
def setUp(self)... | 0 | 0 | 0 | 0 | 0 | 0 |
rep/metaml/factory.py | HolyBayes/rep | 726 | 3280926 | from __future__ import annotations
"""
**Factory** provides convenient way to train several classifiers on the same dataset.
These classifiers can be trained one-by-one in a single thread, or simultaneously
with IPython cluster or in several threads.
Also :class:`Factory` allows comparison of several classifiers (pred... | 14 | 13 | 0 | 0 | 27 | 0 |
hloc/pairs_from_covisibility.py | patelajaychh/Hierarchical-Localization | 1,535 | 3280929 | import argparse
import logging
from pathlib import Path
import numpy as np
from tqdm import tqdm
from collections import defaultdict
from .utils.read_write_model import read_model
def main(model, output, num_matched):
logging.info('Reading the COLMAP model...')
cameras, images, points3D = read_model(model)
... | 0 | 0 | 0 | 0 | 0 | 0 |
backend/src/data/github/utils.py | rutvikpadhiyar000/github-trends | 157 | 3280940 | from typing import Optional
from src.data.mongo.secret import get_random_key
def get_access_token(access_token: Optional[str] = None) -> str:
if access_token is not None:
return access_token
return get_random_key()
| 1 | 1 | 0 | 0 | 2 | 0 |
tests/integration/ops/test_container.py | dooglewoogle/pystiche | 129 | 3280943 | from __future__ import annotations
import pytest
import pytorch_testing_utils as ptu
import torch
from torch import nn
import pystiche
from pystiche import enc, ops
from tests.asserts import assert_named_modules_identical
from tests.utils import suppress_deprecation_warning
class TestOperatorContainer:
class O... | 2 | 13 | 0 | 0 | 15 | 0 |
var/spack/repos/builtin/packages/r-processx/package.py | LiamBindle/spack | 2,360 | 3280947 | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RProcessx(RPackage):
"""Execute and Control System Processes
Tools to run system proc... | 0 | 0 | 2 | 0 | 2 | 0 |
Projects/robosat-master/robosat/spatial/core.py | DanielMabadeje/Artificial-Intelligence-Deep-Learning-Machine-Learning-Tutorials | 3,266 | 3280950 | import functools
import pyproj
import shapely.ops
from rtree.index import Index, Property
def project(shape, source, target) -> object:
'''Projects a geometry from one coordinate system into another.
Args:
shape: the geometry to project.
source: the source EPSG spatial reference system identifi... | 0 | 5 | 0 | 0 | 5 | 0 |
tests/unit/test_request_validator.py | BrimmingDev/twilio-python | 1,362 | 3280952 | # -*- coding: utf-8 -*-
import unittest
from nose.tools import assert_equal, assert_true
from twilio.request_validator import RequestValidator
class ValidationTest(unittest.TestCase):
def setUp(self):
token = "<PASSWORD>"
self.validator = RequestValidator(token)
self.uri = "https://myc... | 0 | 0 | 0 | 0 | 0 | 0 |
test/orm/test_backref_mutations.py | mmeyer724/sqlalchemy | 5,079 | 3280953 | <reponame>mmeyer724/sqlalchemy
"""
a series of tests which assert the behavior of moving objects between
collections and scalar attributes resulting in the expected state w.r.t.
backrefs, add/remove events, etc.
there's a particular focus on collections that have "uselist=False", since in
these cases the re-assignment... | 0 | 0 | 0 | 0 | 0 | 0 |
tensorflow/contrib/eager/python/saver.py | PaulWang1905/tensorflow | 848 | 3280958 | <filename>tensorflow/contrib/eager/python/saver.py
"""Saver for eager mode TensorFlow."""
# Copyright 2017 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 Li... | 0 | 0 | 0 | 0 | 0 | 0 |
airflow/providers/amazon/aws/transfers/mysql_to_s3.py | pyerbiz/airflow | 15,947 | 3280986 | #
# 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... | 12 | 3 | 3 | 0 | 18 | 0 |
tests/unit/small_text/data/test_datasets.py | chschroeder/small-text | 218 | 3281009 | from __future__ import annotations
import unittest
import numpy as np
from parameterized import parameterized_class
from unittest import mock
from numpy.testing import assert_array_equal
from small_text.data.datasets import SklearnDataset, DatasetView
from small_text.data.datasets import split_data
from small_text.... | 11 | 3 | 1 | 0 | 15 | 0 |
tests/test_funcutils.py | ofek/boltons | 6,058 | 3281031 | # -*- coding: utf-8 -*-
from boltons.funcutils import (copy_function,
total_ordering,
format_invocation,
InstancePartial,
CachedInstancePartial,
noop)
class Greet... | 1 | 7 | 0 | 0 | 8 | 0 |
wikimovie_preprocessing/extract_subgraph.py | wuqianwen/GraftNet | 225 | 3281033 | <filename>wikimovie_preprocessing/extract_subgraph.py
"""Script to extract subgraph for text given entities in the text.
A random walk is performed with the entities mentioned in the text as seeds
over the multigraph composed of both entities and relations in the KB as
nodes.
The extracted subgraph is stored as a lis... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/evaluate.py | deepinsight-playground/indic-bert | 237 | 3281062 | #!/usr/bin/env python3
"""
A script to run IGLUE tasks. Also supports cross-lingual tasks
"""
import sys
import os
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..'))
from fine_tune.cli import main as finetune_main
argvec = [
'--train_lang', 'pa',
'--test_lang', 'pa',... | 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.