max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 7 115 | max_stars_count int64 101 368k | id stringlengths 2 8 | content stringlengths 6 1.03M |
|---|---|---|---|---|
models/SemanticSegmentation/LWnet.py | Dou-Yu-xuan/deep-learning-visal | 150 | 12737254 | <gh_stars>100-1000
# !/usr/bin/env python
# -- coding: utf-8 --
# @Time : 2020/6/28 18:04
# @Author : liumin
# @File : LWnet.py
import torch
import torch.nn as nn
import torchvision
import torch.nn.functional as F
def ConvBNReLU(in_channels,out_channels,kernel_size,stride,padding,dilation=1,groups=1):
return nn.S... |
pynab/categories.py | bigblue/pynab | 161 | 12737266 | import regex
import pickle
import os.path
from pynab import log, root_dir
# category codes
# these are stored in the db, as well
CAT_GAME_NDS = 1010
CAT_GAME_PSP = 1020
CAT_GAME_WII = 1030
CAT_GAME_XBOX = 1040
CAT_GAME_XBOX360 = 1050
CAT_GAME_WIIWARE = 1060
CAT_GAME_XBOX360DLC = 1070
CAT_GAME_PS3 = 1080
CAT_MOVIE_FO... |
avionics/motor/motor_client_test.py | leozz37/makani | 1,178 | 12737316 | <reponame>leozz37/makani
# Copyright 2020 Makani Technologies 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 ap... |
tox_helpers/test_missing_dependencies.py | sivchand/smart_open | 2,047 | 12737322 | <reponame>sivchand/smart_open<gh_stars>1000+
import os
import subprocess
os.environ['SMART_OPEN_TEST_MISSING_DEPS'] = '1'
command = [
'pytest',
'smart_open/tests/test_package.py',
'-v',
'--cov', 'smart_open',
'--cov-report', 'term-missing',
]
subprocess.check_call(command)
|
alg/dklite/model.py | loramf/mlforhealthlabpub | 171 | 12737362 | <gh_stars>100-1000
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import tensorflow as tf
import warnings
warnings.filterwarnings("ignore")
import logging
logging.getLogger('tensorflow').disabled = True
import numpy as np
class DKLITE(object):
def __init__(self, input_dim, output_dim, num_hidden=50, num_laye... |
utils/stop_test_exception_util.py | go000o/POMautomateCodeFramework | 207 | 12737364 | '''
This utility is for Custom Exceptions.
a) Stop_Test_Exception
You can raise a generic exceptions using just a string.
This is particularly useful when you want to end a test midway based on some condition.
'''
class Stop_Test_Exception(Exception):
def __init__(self,message):
self.message=message
... |
PhysicsTools/PatAlgos/python/recoLayer0/jetCorrections_cff.py | ckamtsikis/cmssw | 852 | 12737390 | import FWCore.ParameterSet.Config as cms
from PhysicsTools.PatAlgos.recoLayer0.jetCorrFactors_cfi import *
from JetMETCorrections.Configuration.JetCorrectionServicesAllAlgos_cff import *
## for scheduled mode
patJetCorrectionsTask = cms.Task(patJetCorrFactors)
patJetCorrections = cms.Sequence(patJetCorrectionsTask)
|
SimGeneral/TrackingAnalysis/python/trackingParticles_cfi.py | ckamtsikis/cmssw | 852 | 12737402 | import FWCore.ParameterSet.Config as cms
mergedtruth = cms.EDProducer("TrackingTruthProducer",
mixLabel = cms.string('mix'),
simHitLabel = cms.string('g4SimHits'),
volumeRadius = cms.double(1200.0),
vertexDistanceCut = cms.double(0.003),
volumeZ = cms.double(3000.0),
mergedBremsstrahlung = cms... |
examples/showcase/src/demos_widgets/namedFrame.py | takipsizad/pyjs | 739 | 12737434 | """
The ``ui.NamedFrame`` class is a variation of the ``ui.Frame`` which lets you
assign a name to the frame. Naming a frame allows you to refer to that frame
by name in Javascript code, and as the target for a hyperlink.
"""
from pyjamas.ui.SimplePanel import SimplePanel
from pyjamas.ui.VerticalPanel import VerticalP... |
src/graph/config_indep_binary.py | AbhinavGopal/ts_tutorial | 290 | 12737451 | <reponame>AbhinavGopal/ts_tutorial
"""Specify the jobs to run via config file.
Binomial bridge bandit experiment.
Binomial bridge with only binary reward at the end --> no conjugate update.
See Figure 9 https://arxiv.org/pdf/1707.02038.pdf
"""
import collections
import functools
from base.config_lib import Config
fr... |
nn/modules.py | yizt/numpy_neural_network | 428 | 12737511 | <filename>nn/modules.py
# -*- coding: utf-8 -*-
"""
@File : modules.py
@Time : 2020/4/18 上午8:28
@Author : yizuotian
@Description :
"""
from typing import List
from activations import *
from layers import fc_forward, fc_backward, global_avg_pooling_forward, flatten_forward, flatten_backward
from layers_v2... |
src/visions/backends/python/types/string.py | bhumikapahariapuresoftware/visions | 142 | 12737515 | from typing import Sequence
from visions.backends.python.series_utils import (
sequence_handle_none,
sequence_not_empty,
)
from visions.types.string import String
@String.contains_op.register
@sequence_not_empty
@sequence_handle_none
def string_contains(sequence: Sequence, state: dict) -> bool:
return al... |
f5/bigip/tm/sys/test/functional/test_disk.py | nghia-tran/f5-common-python | 272 | 12737537 | <filename>f5/bigip/tm/sys/test/functional/test_disk.py<gh_stars>100-1000
# Copyright 2018 F5 Networks 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... |
src/mylib/torch/nn/modules/dense.py | murez/mobile-semantic-segmentation | 713 | 12737592 | from torch import nn
from torch.nn.init import xavier_uniform_
from mylib.torch.nn.init import zeros_initializer
class Dense(nn.Linear):
r"""Fully connected linear layer with activation function.
.. math::
y = activation(xW^T + b)
Args:
in_features (int): number of input feature :math:`x... |
python/ray/serve/examples/doc/quickstart_class.py | mgelbart/ray | 21,382 | 12737596 | <reponame>mgelbart/ray
import requests
import ray
from ray import serve
serve.start()
@serve.deployment
class Counter:
def __init__(self):
self.count = 0
def __call__(self, *args):
self.count += 1
return {"count": self.count}
# Deploy our class.
Counter.deploy()
# Query our endpo... |
tests/unit/test_tty.py | tedivm/dockerpty | 129 | 12737611 | <gh_stars>100-1000
# dockerpty: test_tty.py.
#
# Copyright 2014 <NAME> <<EMAIL>>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... |
descarteslabs/workflows/types/geospatial/tests/test_geocontext.py | carderne/descarteslabs-python | 167 | 12737614 | import pytest
import shapely.geometry
from descarteslabs import scenes
from .. import GeoContext
from descarteslabs.workflows.types.containers import Tuple
from descarteslabs.workflows.types.primitives import Int, Float
def test_from_scenes_wrong_type():
with pytest.raises(
TypeError, match=r"expected a ... |
nmrglue/util/misc.py | genematx/nmrglue | 150 | 12737639 | <filename>nmrglue/util/misc.py
"""
Misc. functions
"""
from __future__ import print_function
import numpy as np
# default tolerences
RTOL = 1.001e-01
ATOL = 1.001e-01
DTOL = 5.001e-01
def pair_similar(dic1, data1, dic2, data2, verb=False, atol=ATOL, rtol=RTOL,
dtol=DTOL, ignore_pipe_display=False)... |
tests/flow/test_tdigest.py | simonprickett/RedisBloom | 883 | 12737643 | #!/usr/bin/env python3
import os
from random import randint
from RLTest import Env
from redis import ResponseError
import redis
import sys
import random
import math
is_valgrind = True if ("VGD" in os.environ or "VALGRIND" in os.environ) else False
def parse_tdigest_info(array_reply):
reply_dict = {}
for pos ... |
stanza/utils/datasets/constituency/vtb_convert.py | asears/stanza | 3,633 | 12737644 | <gh_stars>1000+
"""
Script for processing the VTB files and turning their trees into the desired tree syntax
The VTB original trees are stored in the directory:
VietTreebank_VLSP_SP73/Kho ngu lieu 10000 cay cu phap
The script requires two arguments:
1. Original directory storing the original trees
2. New directory st... |
cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_asr9k_sc_envmon_admin_oper.py | CiscoDevNet/ydk-py | 177 | 12737651 | """ Cisco_IOS_XR_asr9k_sc_envmon_admin_oper
This module contains a collection of YANG definitions
for Cisco IOS\-XR asr9k\-sc\-envmon package
admin\-plane operational data.
This module contains definitions
for the following management objects\:
environmental\-monitoring\: Admin Environmental Monitoring
Operati... |
services/web/manage.py | asomsiko/flask-on-docker | 207 | 12737665 | <reponame>asomsiko/flask-on-docker<filename>services/web/manage.py
from flask.cli import FlaskGroup
from project import app, db, User
cli = FlaskGroup(app)
@cli.command("create_db")
def create_db():
db.drop_all()
db.create_all()
db.session.commit()
@cli.command("seed_db")
def seed_db():
db.sessio... |
astropy/wcs/wcsapi/__init__.py | jayvdb/astropy | 445 | 12737691 | from .low_level_api import *
from .high_level_api import *
from .high_level_wcs_wrapper import *
from .utils import *
from .sliced_low_level_wcs import *
|
moto/apigateway/integration_parsers/unknown_parser.py | gtourkas/moto | 5,460 | 12737697 | class TypeUnknownParser:
"""
Parse invocations to a APIGateway resource with an unknown integration type
"""
def invoke(self, request, integration):
_type = integration["type"]
raise NotImplementedError("The {0} type has not been implemented".format(_type))
|
src/dispatch/plugins/dispatch_opsgenie/plugin.py | axellaurelut/dispatch | 3,417 | 12737700 | """
.. module: dispatch.plugins.dispatch_opsgenie.plugin
:platform: Unix
:copyright: (c) 2019 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
"""
import logging
from pydantic import Field, SecretStr
from dispatch.config import BaseConfigurationModel
from dispatch.deco... |
tests/observes/test_dynamic_relationship.py | tteaka/sqlalchemy-utils | 879 | 12737709 | import pytest
import sqlalchemy as sa
from sqlalchemy.orm import dynamic_loader
from sqlalchemy_utils.observer import observes
@pytest.fixture
def Director(Base):
class Director(Base):
__tablename__ = 'director'
id = sa.Column(sa.Integer, primary_key=True)
name = sa.Column(sa.String)
... |
nlgeval/utils.py | h4ste/nlg-eval | 1,088 | 12737712 | import click
import json
import os
from xdg import XDG_CONFIG_HOME
class InvalidDataDirException(Exception):
pass
def get_data_dir():
if os.environ.get('NLGEVAL_DATA'):
if not os.path.exists(os.environ.get('NLGEVAL_DATA')):
click.secho("NLGEVAL_DATA variable is set but points to non-exist... |
binding/python/util.py | ledoufre/porcupine | 1,034 | 12737719 | <filename>binding/python/util.py<gh_stars>1000+
#
# Copyright 2020-2021 Picovoice Inc.
#
# You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE"
# file accompanying this source.
#
# Unless required by applicable law or agreed to in writing, software distribut... |
tests/importer/test_importer.py | pie-pie-kakaoent/uvicorn | 5,012 | 12737726 | import pytest
from uvicorn.importer import ImportFromStringError, import_from_string
def test_invalid_format() -> None:
with pytest.raises(ImportFromStringError) as exc_info:
import_from_string("example:")
expected = 'Import string "example:" must be in format "<module>:<attribute>".'
assert expe... |
ecosystem_tools/mindconverter/mindconverter/graph_based_converter/mapper/aten/prim/broadcast_to_mapper.py | mindspore-ai/mindinsight | 216 | 12737738 | # Copyright 2021 Huawei Technologies Co., Ltd.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 ap... |
pyvista/utilities/geometric_objects.py | basnijholt/pyvista | 1,107 | 12737742 | """Provides an easy way of generating several geometric objects.
CONTAINS
--------
vtkArrowSource
vtkCylinderSource
vtkSphereSource
vtkPlaneSource
vtkLineSource
vtkCubeSource
vtkConeSource
vtkDiskSource
vtkRegularPolygonSource
vtkPyramid
vtkPlatonicSolidSource
vtkSuperquadricSource
as well as some pure-python helpers... |
src/titiler/application/titiler/application/settings.py | NLTGit/titiler | 288 | 12737757 | <filename>src/titiler/application/titiler/application/settings.py<gh_stars>100-1000
"""Titiler API settings."""
import pydantic
class ApiSettings(pydantic.BaseSettings):
"""FASTAPI application settings."""
name: str = "titiler"
cors_origins: str = "*"
cachecontrol: str = "public, max-age=3600"
r... |
tools/telemetry/telemetry/core/backends/webdriver/webdriver_desktop_browser_finder.py | iplo/Chain | 231 | 12737770 | <filename>tools/telemetry/telemetry/core/backends/webdriver/webdriver_desktop_browser_finder.py<gh_stars>100-1000
# 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.
"""Finds desktop browsers that can be contro... |
src/zc/buildout/tests/test_increment.py | digitalsatori/buildout | 426 | 12737779 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2020 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this ... |
env/lib/python3.6/site-packages/simple_salesforce/bulk.py | anthowen/duplify | 5,079 | 12737781 | """ Classes for interacting with Salesforce Bulk API """
try:
from collections import OrderedDict
except ImportError:
# Python < 2.7
from ordereddict import OrderedDict
import json
import requests
from time import sleep
from simple_salesforce.util import call_salesforce
class SFBulkHandler(object):
... |
airflow/ti_deps/dep_context.py | npodewitz/airflow | 8,092 | 12737792 | <reponame>npodewitz/airflow<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,... |
test/manual/trash/test_get_trash_document.py | membranepotential/mendeley-python-sdk | 103 | 12737817 | <gh_stars>100-1000
from test import get_user_session, cassette
from test.resources.documents import delete_all_documents, create_document, assert_core_document, assert_bib_document, \
assert_client_document, assert_tags_document, assert_all_document
def test_should_get_document_core_view():
session = get_user... |
homeassistant/components/tasmota/fan.py | mtarjoianu/core | 30,023 | 12737821 | <gh_stars>1000+
"""Support for Tasmota fans."""
from __future__ import annotations
from typing import Any
from hatasmota import const as tasmota_const, fan as tasmota_fan
from hatasmota.entity import TasmotaEntity as HATasmotaEntity
from hatasmota.models import DiscoveryHashType
from homeassistant.components.fan imp... |
azure-devops/azext_devops/devops_sdk/v6_0/search/search_client.py | dhilmathy/azure-devops-cli-extension | 248 | 12737833 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -------------------------------------------------------------------... |
examples/hid_keyboard_shortcuts.py | jersu11/Adafruit_CircuitPython_HID | 174 | 12737842 | # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
import time
import board
import digitalio
import usb_hid
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
kbd = Keyboard(usb_hid.devices)
# define buttons. these can be any physical switch... |
pyecharts/render/engine.py | swuecho/pyecharts | 11,032 | 12737843 | <gh_stars>1000+
import os
from collections import Iterable
from jinja2 import Environment
from ..commons import utils
from ..datasets import EXTRA, FILENAMES
from ..globals import CurrentConfig, NotebookType
from ..types import Any, Optional
from .display import HTML, Javascript
def write_utf8_html_file(file_name: ... |
models/__init__.py | ModelZoo/BostonHousing | 191 | 12737845 | from .house import HousePricePredictionModel |
tests/test_act_quantized_ops.py | yachuan/actnn | 162 | 12737897 | <filename>tests/test_act_quantized_ops.py
"""Test the activation quantized ops"""
import math
import numpy as np
import torch
from torch.nn import functional as F
from timeit_v2 import py_benchmark
from actnn import QScheme, QBNScheme, config, get_memory_usage, compute_tensor_bytes
from actnn.ops import ext_backwar... |
core/providers/torrent_modules/torrentdownloads.py | 0x20Man/Watcher3 | 320 | 12737905 | <gh_stars>100-1000
import logging
from xml.etree.cElementTree import fromstring
from xmljson import yahoo
import core
from core.helpers import Url
logging = logging.getLogger(__name__)
def search(imdbid, term):
proxy_enabled = core.CONFIG['Server']['Proxy']['enabled']
logging.info('Performing backlog search... |
aliyun-python-sdk-core/tests/auth/signers/test_sts_token_signer.py | yndu13/aliyun-openapi-python-sdk | 1,001 | 12737917 | <filename>aliyun-python-sdk-core/tests/auth/signers/test_sts_token_signer.py
# coding=utf-8
from tests import unittest
from aliyunsdkcore.auth.credentials import StsTokenCredential
from aliyunsdkcore.auth.signers.sts_token_signer import StsTokenSigner
from aliyunsdkcore.request import RpcRequest, RoaRequest
class T... |
setup.py | theomega/django-ordered-model | 421 | 12737930 | <reponame>theomega/django-ordered-model
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
with open("requirements.txt") as f:
requires = f.read().splitlines()
with open("README.md", encoding="utf-8") as f:
long_description = f.read()
setup(
name="django-ordered-model",
long_d... |
models/commands/GetFileInformationFromDeviceCommand.py | pwnfoo/SirepRAT | 357 | 12737952 | <reponame>pwnfoo/SirepRAT
#!/usr/bin/env python3
"""
BSD 3-Clause License
Copyright (c) 2017, SafeBreach Labs
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retai... |
examples/pytorch/geniepath/ppi.py | ketyi/dgl | 9,516 | 12737962 | <gh_stars>1000+
import argparse
import numpy as np
import torch as th
import torch.optim as optim
from dgl.data import PPIDataset
from dgl.dataloading import GraphDataLoader
from sklearn.metrics import f1_score
from model import GeniePath, GeniePathLazy
def evaluate(model, loss_fn, dataloader, device='cpu'):
lo... |
tkinter/command-access-button/main.py | whitmans-max/python-examples | 140 | 12737967 | <gh_stars>100-1000
# date: 2019.04.09
#
import tkinter as tk
# --- functions ---
def get_text(text):
print(text)
def get_widget(widget):
print(widget["text"])
widget["text"] = "DONE"
widget["bg"] = "green"
def get_event(event):
print(event.widget["text"])
event.widget["text"] = "DONE"... |
test/persistence/mzworkflows.py | MaterializeInc/materialize | 3,840 | 12737971 | # Copyright Materialize, Inc. and contributors. All rights reserved.
#
# Use of this software is governed by the Business Source License
# included in the LICENSE file at the root of this repository.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software... |
tools/build/v2/test/indirect_conditional.py | jmuskaan72/Boost | 198 | 12737975 | #!/usr/bin/python
# Copyright (C) <NAME> 2006.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import BoostBuild
t = BoostBuild.Tester()
t.write("jamroot.jam", """
exe a1 : a1.cpp : <conditional>@a1-... |
api/tacticalrmm/winupdate/migrations/0003_auto_20200828_0134.py | infinite8co/tacticalrmm | 903 | 12737978 | # Generated by Django 3.1 on 2020-08-28 01:34
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("automation", "0004_auto_20200617_0332"),
("agents", "0012_auto_20200810_0544"),
("winupdate", "0002_auto_20200... |
sdk/keyvault/azure-keyvault-secrets/tests/test_samples_secrets_async.py | rsdoherty/azure-sdk-for-python | 2,728 | 12737987 | <gh_stars>1000+
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# -------------------------------------
import asyncio
import pytest
from _shared.test_case_async import KeyVaultTestCase
from _test_case import client_setup, get_decorator, SecretsTestCase
... |
esphome/components/pn532_spi/__init__.py | OttoWinter/esphomeyaml | 249 | 12737991 | import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import spi, pn532
from esphome.const import CONF_ID
AUTO_LOAD = ["pn532"]
CODEOWNERS = ["@OttoWinter", "@jesserockz"]
DEPENDENCIES = ["spi"]
MULTI_CONF = True
pn532_spi_ns = cg.esphome_ns.namespace("pn532_spi")
PN532Spi = pn53... |
backend/cloud_inquisitor/plugins/views/templates.py | MrSecure/cloud-inquisitor | 462 | 12738016 | <reponame>MrSecure/cloud-inquisitor
from flask import session
from cloud_inquisitor.app import _import_templates
from cloud_inquisitor.constants import ROLE_ADMIN, HTTP
from cloud_inquisitor.database import db
from cloud_inquisitor.log import auditlog
from cloud_inquisitor.plugins import BaseView
from cloud_inquisitor... |
data/DataPre.py | byamao1/MMSA | 198 | 12738037 | # coding: utf-8
import os
import shutil
import pickle
import librosa
import argparse
import pandas as pd
import numpy as np
from glob import glob
from tqdm import tqdm
from PIL import Image
from facenet_pytorch import MTCNN, InceptionResnetV1
import torch
from transformers import BertTokenizer, BertModel
from torch.ut... |
aioinflux/__init__.py | AndyBryson/aioinflux | 120 | 12738099 | # flake8: noqa
from . import serialization
from .client import InfluxDBClient, InfluxDBError, InfluxDBWriteError
from .iterutils import iterpoints
from .serialization.usertype import *
__version__ = '0.9.0'
|
tests/test_serialization.py | Multihuntr/albumentations | 3,893 | 12738127 | import json
import os
import random
from unittest.mock import patch
import cv2
import numpy as np
import pytest
import albumentations as A
import albumentations.augmentations.functional as F
from albumentations.core.serialization import SERIALIZABLE_REGISTRY, shorten_class_name
from albumentations.core.transforms_int... |
emukit/test_functions/multi_fidelity/hartmann.py | EmuKit/Emukit | 272 | 12738138 | <gh_stars>100-1000
from typing import Tuple
import numpy as np
from ...core import ContinuousParameter, InformationSourceParameter, ParameterSpace
from ...core.loop.user_function import MultiSourceFunctionWrapper
def multi_fidelity_hartmann_3d() -> Tuple[MultiSourceFunctionWrapper, ParameterSpace]:
r"""
The... |
vnpy/api/nst/__init__.py | funrunskypalace/vnpy | 19,529 | 12738150 | from .vnnsttd import TdApi
from .nst_constant import *
|
examples/MktdataPublisher.py | msitt/blpapi-python | 228 | 12738178 | # MktdataPublisher.py
from __future__ import print_function
from __future__ import absolute_import
import time
from optparse import OptionParser, OptionValueError
import datetime
import threading
import os
import platform as plat
import sys
if sys.version_info >= (3, 8) and plat.system().lower() == "windows":
# p... |
tests/test_packages/test_protocols/test_http.py | bryanchriswhite/agents-aea | 126 | 12738185 | # -*- 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 ... |
memory_analyzer/tests/test_analysis_template.py | clearpathrobotics/memory-analyzer | 129 | 12738199 | <filename>memory_analyzer/tests/test_analysis_template.py
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import pickle
import sys
import tempfile
from unitt... |
changedetectionio/notification.py | jeremysherriff/changedetection.io | 3,933 | 12738208 | import os
import apprise
valid_tokens = {
'base_url': '',
'watch_url': '',
'watch_uuid': '',
'watch_title': '',
'watch_tag': '',
'diff_url': '',
'preview_url': '',
'current_snapshot': ''
}
def process_notification(n_object, datastore):
import logging
log = logging.getLogger('a... |
python/tvm/topi/nn/conv1d.py | XiaoSong9905/tvm | 4,640 | 12738217 | <reponame>XiaoSong9905/tvm<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, Ve... |
tests/test_samples.py | j0ono0/pinout-diagram | 304 | 12738222 | ##########################################################
#
# pinout tests
#
# Use a user-defined temporary directory if
# you have problems with multiple harddrives (like I do):
#
# >>> pytest --basetemp=temp
#
##########################################################
import filecmp
import pytest
import re
import sh... |
tools/mo/openvino/tools/mo/ops/Exit.py | ryanloney/openvino-1 | 1,127 | 12738238 | <reponame>ryanloney/openvino-1
# Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from openvino.tools.mo.graph.graph import Node, Graph
from openvino.tools.mo.ops.op import Op
class Exit(Op):
op = "Exit"
def __init__(self, graph: Graph, attrs: dict):
mandatory_props = ... |
api-inference-community/docker_images/timm/tests/test_api_text_to_speech.py | abidlabs/huggingface_hub | 362 | 12738249 | import os
from unittest import TestCase, skipIf
from app.main import ALLOWED_TASKS
from app.validation import ffmpeg_read
from starlette.testclient import TestClient
from tests.test_api import TESTABLE_MODELS
@skipIf(
"text-to-speech" not in ALLOWED_TASKS,
"text-to-speech not implemented",
)
class AudioSourc... |
src/sage/algebras/finite_gca.py | UCD4IDS/sage | 1,742 | 12738269 | r"""
Finite dimensional graded commutative algebras
AUTHORS:
- <NAME> (2021): initial version
"""
#*****************************************************************************
# Copyright (C) 2021 <NAME> <m.jung at vu.nl>
#
# This program is free software: you can redistribute it and/or modify
# it under the... |
configs/cityscapes/mask_rcnn_r50_fpn_1x_cityscapes.py | evgps/mmdetection_trashcan | 367 | 12738289 | <reponame>evgps/mmdetection_trashcan
_base_ = [
'../_base_/models/mask_rcnn_r50_fpn.py',
'../_base_/datasets/cityscapes_instance.py', '../_base_/default_runtime.py'
]
model = dict(
pretrained=None,
roi_head=dict(
bbox_head=dict(
type='Shared2FCBBoxHead',
in_channels=256,
... |
social_auth/backends/contrib/dropbox.py | merutak/django-social-auth | 863 | 12738298 | from social.backends.dropbox import DropboxOAuth as DropboxBackend
|
zktraffic/stats/stats.py | fakeNetflix/twitter-repo-zktraffic | 159 | 12738303 | # ==================================================================================================
# Copyright 2014 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... |
koku/reporting/migrations/0210_ocpaws_partables.py | project-koku/koku | 157 | 12738310 | <gh_stars>100-1000
# Generated by Django 3.1.13 on 2021-11-18 04:49
import django.db.models.deletion
from django.db import migrations
from django.db import models
from koku.database import set_partition_mode
from koku.database import unset_partition_mode
class Migration(migrations.Migration):
dependencies = [("... |
leather/shapes/dots.py | timgates42/leather | 198 | 12738314 | <reponame>timgates42/leather
#!/usr/bin/env python
from collections import defaultdict
import xml.etree.ElementTree as ET
import six
from leather.data_types import Text
from leather.series import CategorySeries
from leather.shapes.base import Shape
from leather import theme
from leather.utils import DummySeries, X, ... |
pyNastran/bdf/mesh_utils/skin_solid_elements.py | luzpaz/pyNastran | 293 | 12738326 | <filename>pyNastran/bdf/mesh_utils/skin_solid_elements.py
"""
defines:
- get_solid_skin_faces(model)
"""
from collections import defaultdict
from copy import deepcopy
from pyNastran.bdf.field_writer_8 import print_card_8
from pyNastran.bdf.field_writer_16 import print_card_16
def write_skin_solid_faces(model, skin... |
Example/Psi4Numpy/13-GeometryOptimization/opt_helper/printTools.py | yychuang/109-2-compchem-lite | 214 | 12738352 | <gh_stars>100-1000
from __future__ import print_function
def printMat(M, Ncol=7, title=None):
if title:
print(title + '\n')
for row in range(M.shape[0]):
tab = 0
for col in range(M.shape[1]):
tab += 1
print(" %10.6f" % M[row, col])
if tab == Ncol and ... |
tests/test_views_objects_permissions.py | vincentfretin/kinto | 4,618 | 12738356 | <filename>tests/test_views_objects_permissions.py
import unittest
from kinto.core.testing import get_user_headers
from .support import (
MINIMALIST_BUCKET,
MINIMALIST_COLLECTION,
MINIMALIST_GROUP,
MINIMALIST_RECORD,
BaseWebTest,
)
class PermissionsTest(BaseWebTest, unittest.TestCase):
@class... |
sources/PacketStorm.py | eacg-gmbh/VIA4CVE | 109 | 12738380 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# PacketStorm information
# Based on Vulners
#
# Software is free software released under the "Modified BSD license"
#
# Copyright (c) 2017 <NAME> - <EMAIL>
# Sources
SOURCE_NAME = 'packetstorm'
SOURCE_FILE = "https://vulners.com/api/v3/archive/collection/?type=packe... |
causalml/__init__.py | zazrivec/causalml | 2,919 | 12738413 | <filename>causalml/__init__.py
name = 'causalml'
__version__ = '0.11.1'
__all__ = ['dataset',
'features',
'feature_selection',
'inference',
'match',
'metrics',
'optimize',
'propensity']
|
scripts/generate_aligned_wave.py | m95music/yukarin | 139 | 12738415 | <filename>scripts/generate_aligned_wave.py
"""
extract indexes for alignment.
"""
import argparse
import glob
import multiprocessing
from functools import partial
from pathlib import Path
from pprint import pprint
from typing import Tuple
import librosa
import numpy
import tqdm
from yukarin.acoustic_feature import A... |
py/examples/graphics_primitives.py | swt2c/wave | 3,013 | 12738417 | # Graphics / Primitives
# Use the #graphics module to render and update shapes.
# ---
from h2o_wave import site, ui, graphics as g
# Create some shapes
arc = g.arc(r1=25, r2=50, a1=90, a2=180)
circle = g.circle(cx=25, cy=25, r=25)
ellipse = g.ellipse(cx=25, cy=25, rx=25, ry=20)
image = g.image(width=50, height=50, hr... |
Packs/CloudConvert/Integrations/CloudConvert/CloudConvert.py | diCagri/content | 799 | 12738419 | import demistomock as demisto
from CommonServerPython import *
import urllib3
from typing import Any, Dict
# Disable insecure warnings
urllib3.disable_warnings()
class Client(BaseClient):
@logger
def __init__(self, headers, verify=False, proxy=False):
url = 'https://api.cloudconvert.com/v2'
... |
server/migrations/0070_remove_machine_install_log_hash.py | nathandarnell/sal | 215 | 12738435 | <reponame>nathandarnell/sal<gh_stars>100-1000
# Generated by Django 1.11 on 2018-04-25 18:29
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('server', '0069_remove_machine_install_log'),
]
operations = [
migrations.RemoveField(
mode... |
tests/unit/lib/utils/test_hash.py | zhuhaow/aws-sam-cli | 2,959 | 12738468 | import hashlib
import os
import shutil
import tempfile
from unittest import TestCase
from unittest.mock import patch
from samcli.lib.utils.hash import dir_checksum, str_checksum
class TestHash(TestCase):
def setUp(self):
self.temp_dir = tempfile.mkdtemp()
def tearDown(self):
shutil.rmtree(se... |
modules/pymol/wizard/filter.py | dualword/pymol-open-source | 636 | 12738487 | <gh_stars>100-1000
# filter wizard
# no-frills tool for quickly filtering docked compounds, etc.
import os,sys
from pymol.wizard import Wizard
from pymol import cmd
import traceback
# global dictionary for saving result on a per-object basis
static_dict = {}
# last/current object being filtered
default_object = Non... |
haven/haven_jupyter/images_tab.py | haven-ai/haven-ai | 145 | 12738505 | from .. import haven_utils
from .. import haven_results as hr
from .. import haven_utils as hu
from .. import haven_share as hd
import os
import pprint
import json
import copy
import pprint
import pandas as pd
from . import widgets as wdg
try:
import ast
from ipywidgets import Button, HBox, VBox
from ipyw... |
moviepy/audio/tools/cuts.py | odidev/moviepy | 8,558 | 12738510 | <reponame>odidev/moviepy<filename>moviepy/audio/tools/cuts.py<gh_stars>1000+
"""Cutting utilities working with audio."""
import numpy as np
def find_audio_period(clip, min_time=0.1, max_time=2, time_resolution=0.01):
"""Finds the period, in seconds of an audioclip.
Parameters
----------
min_time : ... |
var/spack/repos/builtin/packages/kadath/package.py | LiamBindle/spack | 2,360 | 12738511 | <filename>var/spack/repos/builtin/packages/kadath/package.py
# 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)
import os
from spack import *
class Kadath(CMakePackage):
... |
dulwich/tests/test_refs.py | jessecureton-aurora/dulwich | 460 | 12738543 | <filename>dulwich/tests/test_refs.py
# test_refs.py -- tests for refs.py
# encoding: utf-8
# Copyright (C) 2013 <NAME> <<EMAIL>>
#
# Dulwich is dual-licensed under the Apache License, Version 2.0 and the GNU
# General Public License as public by the Free Software Foundation; version 2.0
# or (at your option) any later ... |
env/lib/python3.4/site-packages/bulbs/titan/index.py | mudbungie/NetExplorer | 234 | 12738545 | # -*- coding: utf-8 -*-
#
# Copyright 2012 <NAME> (http://jamesthornton.com)
# BSD License (see LICENSE for details)
#
"""
An interface for interacting with indices on Rexster.
"""
from bulbs.utils import initialize_element, initialize_elements, get_one_result
class IndexProxy(object):
"""Abstract base class the... |
test/regression/features/assignment/assign_multi.py | ppelleti/berp | 137 | 12738583 | <filename>test/regression/features/assignment/assign_multi.py
x = y = 1
print(x,y)
x = y = z = 1
print(x,y,z)
|
zoopt/objective.py | HowardHu97/ZOOpt | 403 | 12738646 | <reponame>HowardHu97/ZOOpt<filename>zoopt/objective.py<gh_stars>100-1000
"""
This module contains the class Objective
Author:
<NAME>, <NAME>
"""
from zoopt.solution import Solution
from zoopt.utils.zoo_global import pos_inf
from zoopt.utils.tool_function import ToolFunction
import numpy as np
class Objective:
... |
scripts/test_zmq/test_zmq/server.py | IDunion/indy-plenum | 148 | 12738649 | <filename>scripts/test_zmq/test_zmq/server.py<gh_stars>100-1000
#! /usr/bin/env python3
import argparse
import shutil
import socket
from concurrent.futures import ThreadPoolExecutor
from tempfile import TemporaryDirectory
from typing import NamedTuple
import zmq
from test_zmq.zstack import ZStack
SEED = b'E21bEA7De... |
SuperClippy/superclippy.py | zatherz/reddit | 444 | 12738656 | #/u/GoldenSights
import sys
import traceback
import time
import datetime
import sqlite3
import json
import praw
'''USER CONFIGURATION'''
"""GENERAL"""
APP_ID = ""
APP_SECRET = ""
APP_URI = ""
APP_REFRESH = ""
# https://www.reddit.com/comments/3cm1p8/how_to_make_your_bot_use_oauth2/
USERAGENT = "/r/Excel Clippy Office... |
tests/file_tests.py | nbanmp/seninja | 109 | 12738661 | from ..expr import BVS, BVV
from ..memory.sym_file import SymFile
from ..os_models.os_file import OsFileHandler
def test_1(): # read unconstrained
f = SymFile("a")
res = f.read(1)
assert len(res) == 1
assert isinstance(res[0], BVS)
assert res[0].name == "unconstrained_a_0"
def test_2(): # read... |
aw_nas/weights_manager/diff_super_net.py | Harald-R/aw_nas | 195 | 12738723 | """
Supernet for differentiable rollouts.
"""
import contextlib
import torch
from torch.nn import functional as F
from aw_nas import assert_rollout_type, utils
from aw_nas.rollout.base import DartsArch, DifferentiableRollout, BaseRollout
from aw_nas.utils import data_parallel, use_params
from aw_nas.weights_manager.... |
salem/__init__.py | sunt05/salem | 147 | 12738724 | <gh_stars>100-1000
"""
Salem package
"""
from __future__ import division
from os import path
from os import makedirs
import sys
from functools import wraps
import pyproj
try:
from .version import version as __version__
except ImportError: # pragma: no cover
raise ImportError('Salem is not properly installed... |
scripts/27_send_sms.py | Kirklin12/python-scripts | 2,076 | 12738730 | <reponame>Kirklin12/python-scripts
import requests
message = raw_input('Enter a Message: ')
number = raw_input('Enter the phone number: ')
payload = {'number': number, 'message': message}
r = requests.post("http://textbelt.com/text", data=payload)
if r.json()['success']:
print('Success!')
else:
print('Error!... |
keras2onnx/ke2onnx/layer_spec.py | TomWildenhain-Microsoft/keras-onnx | 362 | 12738734 | # SPDX-License-Identifier: Apache-2.0
import tensorflow as tf
from ..proto import keras, is_tf_keras, is_keras_older_than
from ..proto.tfcompat import is_tf2
_layer = keras.layers
_adv_activations = keras.layers.advanced_activations
def _default_layer_name_extractor(fstr_list, node_name):
for fstr in fstr_list:... |
superset/migrations/versions/31bb738bd1d2_move_pivot_table_v2_legacy_order_by_to_.py | delorenzosoftware/superset | 18,621 | 12738744 | <reponame>delorenzosoftware/superset<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 L... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.