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 |
|---|---|---|---|---|
tensorflow_constrained_optimization/python/rates/estimator_head.py | RMKruse/tensorflow_constrained_optimization | 276 | 12751057 | # Copyright 2018 The TensorFlow Constrained Optimization 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
#
#... |
main_sdf.py | ashawkey/torch-ngp | 262 | 12751060 | import torch
import argparse
from sdf.utils import *
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('path', type=str)
parser.add_argument('--test', action='store_true', help="test mode")
parser.add_argument('--workspace', type=str, default='workspace')
parser.ad... |
venv/Lib/site-packages/altair/examples/scatter_with_minimap.py | ajayiagbebaku/NFL-Model | 6,831 | 12751062 | """
Scatter Plot with Minimap
-------------------------
This example shows how to create a miniature version of a plot
such that creating a selection in the miniature version
adjusts the axis limits in another, more detailed view.
"""
# category: scatter plots
import altair as alt
from vega_datasets import data
sourc... |
src/py2.x/ml/jqxxsz/6.SVM/svm_svc.py | BinLeeBit/AILearners | 350 | 12751072 | <filename>src/py2.x/ml/jqxxsz/6.SVM/svm_svc.py
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File : svm-svc.py
@Time : 2019/06/17 21:20:49
@Author : <NAME>
@Version : 1.0
@Contact : <EMAIL>
@Desc : sklearn.svm.SVC实现手写体识别
@github : https://github.com/aimi-cn/AILearners
'''
# here put th... |
tests/adapter/conftest.py | Clinical-Genomics/scout | 111 | 12751079 | from copy import deepcopy
import pytest
@pytest.fixture
def real_oldcase_database(real_panel_database, parsed_case):
# add case with old case id construct
config_data = deepcopy(parsed_case)
config_data["case_id"] = "-".join([config_data["owner"], config_data["display_name"]])
case_obj = real_panel_d... |
src/biotite/structure/io/mol/file.py | alex123012/biotite | 208 | 12751084 | # This source code is part of the Biotite package and is distributed
# under the 3-Clause BSD License. Please see 'LICENSE.rst' for further
# information.
__name__ = "biotite.structure.io.mol"
__author__ = "<NAME>"
__all__ = ["MOLFile"]
import datetime
from warnings import warn
import numpy as np
from ...atoms import... |
emukit/test_functions/quadrature/hennig2D.py | EmuKit/Emukit | 272 | 12751092 | <reponame>EmuKit/Emukit
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
from typing import List, Tuple
import numpy as np
from emukit.core.loop.user_function import UserFunctionWrapper
def hennig2D() -> Tuple[UserFunctionWrapper, List[Tuple[float, fl... |
solutions/problem_362.py | ksvr444/daily-coding-problem | 1,921 | 12751129 | def get_strob_numbers(num_digits):
if not num_digits:
return [""]
elif num_digits == 1:
return ["0", "1", "8"]
smaller_strob_numbers = get_strob_numbers(num_digits - 2)
strob_numbers = list()
for x in smaller_strob_numbers:
strob_numbers.extend([
"1" + x + "1",
... |
deephyper/nas/run/_run_horovod.py | felixeperez/deephyper | 185 | 12751136 | """The :func:`deephyper.nas.run.horovod.run` function is used to evaluate a deep neural network by enabling data-parallelism with Horovod to the :func:`deephyper.nas.run.alpha.run` function. This function will automatically apply the linear scaling rule to the learning rate and batch size given the current number of ra... |
onelinerizer/__init__.py | mayl8822/onelinerizer | 1,062 | 12751172 | from .onelinerizer import onelinerize
|
test/pytest/test_regexes.py | showipintbri/ttp | 254 | 12751173 | <reponame>showipintbri/ttp<gh_stars>100-1000
import sys
sys.path.insert(0, "../..")
import pprint
import logging
logging.basicConfig(level="INFO")
from ttp import ttp
def test_pipe_separated_regexes():
template = """
<input load="text">
Protocol Address Age (min) Hardware Addr Type Interface
Interne... |
numpy&pandas/13_set_value.py | subshine/tutorials | 10,786 | 12751178 | <reponame>subshine/tutorials
# View more python tutorials on my Youtube and Youku channel!!!
# Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg
# Youku video tutorial: http://i.youku.com/pythontutorial
"""
Please note, this code is only for python 3+. If you are using python 2+, please... |
train.py | lipiji/Guyu | 173 | 12751190 | <gh_stars>100-1000
# coding=utf-8
import torch
import torch.distributed as dist
import torch.nn as nn
import torch.nn.functional as F
import torch.multiprocessing as mp
from biglm import BIGLM
from data import Vocab, DataLoader, s2xy
from adam import AdamWeightDecayOptimizer
from optim import Optim
import argparse, o... |
HVAC Controller/hvaccontrol_cleanup.py | Silenoz93/RaspberryPiThermostat | 160 | 12751193 | <filename>HVAC Controller/hvaccontrol_cleanup.py
#!/usr/bin/python
########################################################################################################################
#
# RasPi Smart HVAC Cleanup script
# Written by <NAME> - http://willseph.com/
#
##################################################... |
uberduck_ml_dev/monitoring/statistics.py | justinjohn0306/uberduck-ml-dev | 167 | 12751201 | <reponame>justinjohn0306/uberduck-ml-dev
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/monitoring.statistics.ipynb (unless otherwise specified).
__all__ = ['get_alignment_metrics']
# Cell
import torch
from ..utils.utils import get_mask_from_lengths
def get_alignment_metrics(
alignments, average_across_batch=T... |
tensorflow/contrib/metrics/python/ops/confusion_matrix_ops.py | tianyapiaozi/tensorflow | 522 | 12751214 | # 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... |
object-detection/centernet/src/lib/models/networks/model_dlav0.py | AaratiAkkapeddi/nnabla-examples | 228 | 12751235 | # Copyright 2021 Sony Corporation.
# Copyright 2021 Sony Group 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 requi... |
src/filter_and_group.py | LaudateCorpus1/GCGC | 395 | 12751240 | <filename>src/filter_and_group.py<gh_stars>100-1000
# filter_and_group.py
#
# Given a set of filters, and groupings, take data from pandas gc event dataframes,
# and return a modified subset of the data that follows the passed filters/groups.
# Note: It is possible to export the following function to ho... |
quantmod/datetools.py | EfimovIN/dash-technical-charting | 129 | 12751246 | """Date and time functions
Refactored from Cufflinks' 'date_tools.py' module.
Credits to @jorgesantos.
"""
import datetime as dt
def get_date_from_today(delta, strfmt='%Y%m%d'):
""" Returns a string that represents a date n numbers of days from today.
Parameters
----------
delta : int
... |
mods/TowerofHanoi/client.py | thermalpilot/opennero | 215 | 12751261 | from OpenNero import *
from random import seed, randint
# add the key and mouse bindings
from inputConfig import createInputMapping, switchToHub
from common import *
import common.gui as gui
from TowerofHanoi.module import getMod, delMod
from TowerofHanoi.constants import *
class UI:
pass
def CreateGui(guiMan,... |
demo/matrix_transpose.py | neerajchhimwal/gradio | 5,481 | 12751337 | <filename>demo/matrix_transpose.py
import gradio as gr
import numpy as np
def transpose(matrix):
return matrix.T
iface = gr.Interface(
transpose,
gr.inputs.Dataframe(type="numpy", datatype="number", row_count=5, col_count=3),
"numpy",
examples=[
[np.zeros((3,3)).tolist()],
[np.one... |
mmedit/models/backbones/encoder_decoders/pconv_encoder_decoder.py | Jian137/mmediting-1 | 1,884 | 12751342 | <filename>mmedit/models/backbones/encoder_decoders/pconv_encoder_decoder.py
# Copyright (c) OpenMMLab. All rights reserved.
import torch.nn as nn
from mmcv.runner import auto_fp16, load_checkpoint
from mmedit.models.builder import build_component
from mmedit.models.registry import BACKBONES
from mmedit.utils import ge... |
src/networks/gnn_layer.py | ccoay/ec-extraction | 488 | 12751346 | <reponame>ccoay/ec-extraction<filename>src/networks/gnn_layer.py
import torch
import torch.nn as nn
import torch.nn.init as init
import torch.nn.functional as F
from config import DEVICE
class GraphAttentionLayer(nn.Module):
"""
reference: https://github.com/xptree/DeepInf
"""
def __init__(self, att_h... |
modules/text/lexical_analysis/jieba_paddle/module.py | chunzhang-hub/PaddleHub | 8,360 | 12751363 | <filename>modules/text/lexical_analysis/jieba_paddle/module.py
# -*- coding:utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import os
import paddle.fluid as fluid
import paddlehub as hub
from paddlehub.common.logger import logger
fr... |
tests/es_versions/test_clusters.py | billboggs/elasticsearch-HQ | 2,026 | 12751414 | __author__ = 'royrusso'
import json
import logging
import jmespath
import pytest
LOGGER = logging.getLogger(__name__)
pytest_plugins = ["docker_compose"]
@pytest.mark.es_versions
def test_get_cluster_summary(session_scoped_container_getter, fixture):
fixture.add_all_clusters(session_scoped_container_getter, cl... |
ExamplesFromChapters/Chapter2/ORingFailure.py | jColeChanged/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers | 19,259 | 12751421 | import numpy as np
import pymc as pm
challenger_data = np.genfromtxt(
"../../Chapter2_MorePyMC/data/challenger_data.csv",
skip_header=1, usecols=[1, 2], missing_values="NA", delimiter=",")
# drop the NA values
challenger_data = challenger_data[~np.isnan(challenger_data[:, 1])]
temperature = challenger_data[... |
tests/mturk/create_hit_external.py | Yurzs/boto | 5,079 | 12751431 | import unittest
import uuid
import datetime
from boto.mturk.question import ExternalQuestion
from _init_environment import SetHostMTurkConnection, external_url, \
config_environment
class Test(unittest.TestCase):
def setUp(self):
config_environment()
def test_create_hit_extern... |
ethical-hacking/file-encryption/crypt.py | caesarcc/python-code-tutorials | 1,059 | 12751459 | from cryptography.fernet import Fernet
import os
def write_key():
"""
Generates a key and save it into a file
"""
key = Fernet.generate_key()
with open("key.key", "wb") as key_file:
key_file.write(key)
def load_key():
"""
Loads the key from the current directory named `key.key`
... |
tests/recipes/test_python3.py | syrykh/python-for-android | 6,278 | 12751487 | import unittest
from os.path import join
from unittest import mock
from pythonforandroid.recipes.python3 import (
NDK_API_LOWER_THAN_SUPPORTED_MESSAGE,
)
from pythonforandroid.util import BuildInterruptingException
from tests.recipes.recipe_lib_test import RecipeCtx
class TestPython3Recipe(RecipeCtx, unittest.T... |
examples/image/plot_dataset_rp.py | Pandinosaurus/pyts | 1,217 | 12751548 | <filename>examples/image/plot_dataset_rp.py<gh_stars>1000+
"""
============================
Data set of recurrence plots
============================
A recurrence plot is an image obtained from a time series, representing the
pairwise Euclidean distances for each value (and more generally for each
trajectory) in the t... |
examples/linear_elasticity/its2D_3.py | carlosal1015/sfepy | 510 | 12751556 | <filename>examples/linear_elasticity/its2D_3.py
r"""
Diametrically point loaded 2-D disk with nodal stress calculation. See
:ref:`sec-primer`.
Find :math:`\ul{u}` such that:
.. math::
\int_{\Omega} D_{ijkl}\ e_{ij}(\ul{v}) e_{kl}(\ul{u})
= 0
\;, \quad \forall \ul{v} \;,
where
.. math::
D_{ijkl} = \m... |
bellybutton/caching.py | sYnfo/bellybutton | 236 | 12751558 | <reponame>sYnfo/bellybutton
"""Caching utilities."""
|
examples/contrib/webscanner_helper/mapping.py | KarlParkinson/mitmproxy | 24,939 | 12751581 | <filename>examples/contrib/webscanner_helper/mapping.py
import copy
import logging
import typing
from typing import Dict
from bs4 import BeautifulSoup
from mitmproxy.http import HTTPFlow
from examples.contrib.webscanner_helper.urldict import URLDict
NO_CONTENT = object()
class MappingAddonConfig:
HTML_PARSER =... |
nncf/tensorflow/utils/state.py | MaximProshin/nncf | 136 | 12751602 | <gh_stars>100-1000
"""
Copyright (c) 2022 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or ... |
examples/plotting_and_normalization.py | PuzeLiu/mushroom-rl | 344 | 12751609 | import os
from mushroom_rl.utils.preprocessors import MinMaxPreprocessor
from mushroom_rl.utils.callbacks import PlotDataset
import numpy as np
from mushroom_rl.algorithms.policy_search import REINFORCE
from mushroom_rl.approximators.parametric import LinearApproximator
from mushroom_rl.approximators.regressor impor... |
Athos/tests/tf/unittests/test_shape_manipulation.py | shahakash28/EzPC | 221 | 12751636 | """
Authors: <NAME>.
Copyright:
Copyright (c) 2021 Microsoft Research
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, mo... |
src/GridCal/Engine/Simulations/result_types.py | SanPen/GridCal | 284 | 12751647 | # This file is part of GridCal.
#
# GridCal is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GridCal is distributed in the hope that... |
scripts/migrator.py | misl6/web2py | 1,573 | 12751651 | <gh_stars>1000+
# -*- coding: utf-8 -*-
'''
To use, e.g. python .\web2py.py -S APPNAME --force_migrate
To use, e.g. python .\web2py.py -S APPNAME --force_migrate --fake_migrate
'''
import logging
logger = logging.getLogger("web2py")
def get_databases(request):
dbs = {}
global_env = globals()
for (key, v... |
jenkins_job_wrecker/modules/triggers.py | javiergayala/jenkins-job-wrecker | 172 | 12751663 | <gh_stars>100-1000
# encoding=utf8
import jenkins_job_wrecker.modules.base
from jenkins_job_wrecker.helpers import get_bool, Mapper
class Triggers(jenkins_job_wrecker.modules.base.Base):
component = 'triggers'
def gen_yml(self, yml_parent, data):
triggers = []
for child in data:
... |
stonesoup/predictor/tests/test_information.py | Red-Portal/Stone-Soup-1 | 157 | 12751669 | # coding: utf-8
import datetime
import pytest
import numpy as np
from ...models.transition.linear import ConstantVelocity
from ...predictor.information import InformationKalmanPredictor
from ...predictor.kalman import KalmanPredictor
from ...types.state import InformationState, GaussianState
from ...types.array import... |
yolo/vedanet/network/head/brick/__init__.py | hilman-dayo/ObjectDetection-OneStageDet | 331 | 12751670 | <filename>yolo/vedanet/network/head/brick/__init__.py
from . import yolov3
|
tests/test_dpda.py | prashnts/hues | 371 | 12751683 | import hues.dpda as DPDA
def test_zero_negation():
func = DPDA.zero_break
assert func((1, 2, 3, 4, 0, 10, 1)) == (10, 1)
assert func((1, 2, 3, 4, 5, 0)) == tuple()
def test_order_annihilation():
func = DPDA.annihilate
assert func(range(0, 10), (1, 2, 3, 4, 4, 3)) == (3,)
assert func(range(5, 12), (1, 2, 1... |
src/radish/terrain.py | radish-bdd/radish2 | 182 | 12751698 | <reponame>radish-bdd/radish2
"""
radish
~~~~~~
The root from red to green. BDD tooling for Python.
:copyright: (c) 2019 by <NAME> <<EMAIL>>
:license: MIT, see LICENSE for more details.
"""
import threading
world = threading.local()
world.__doc__ = """Thread-local radish contex object
This object can be used to at... |
sandbox/rocky/tf/q_functions/naf_mlp_q_function.py | suryabhupa/rllabplusplus | 167 | 12751708 | <gh_stars>100-1000
from sandbox.rocky.tf.q_functions.base import QFunction
import sandbox.rocky.tf.core.layers as L
import tensorflow as tf
import numpy as np
from rllab.core.serializable import Serializable
from sandbox.rocky.tf.core.layers_powered import LayersPowered
from sandbox.rocky.tf.misc import tensor_utils
fr... |
lambeq/tokeniser/base.py | CQCL/lambeq | 131 | 12751710 | # Copyright 2021, 2022 Cambridge Quantum Computing Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
src/registration.py | quqixun/BrainPrep | 116 | 12751723 | <reponame>quqixun/BrainPrep<gh_stars>100-1000
import os
import subprocess
import matplotlib.pyplot as plt
from multiprocessing import Pool, cpu_count
def plot_middle(data, slice_no=None):
if not slice_no:
slice_no = data.shape[-1] // 2
plt.figure()
plt.imshow(data[..., slice_no], cmap="gray")
... |
gradient_free_optimizers/optimizers/sequence_model/bayesian_optimization.py | gtr8/Gradient-Free-Optimizers | 860 | 12751726 | <reponame>gtr8/Gradient-Free-Optimizers<filename>gradient_free_optimizers/optimizers/sequence_model/bayesian_optimization.py<gh_stars>100-1000
# Author: <NAME>
# Email: <EMAIL>
# License: MIT License
from .exp_imp_based_opt import ExpectedImprovementBasedOptimization
from .surrogate_models import (
GPR_linear,
... |
applications/popart/deep_voice/conf_utils.py | payoto/graphcore_examples | 260 | 12751758 | <filename>applications/popart/deep_voice/conf_utils.py
# Copyright (c) 2020 Graphcore Ltd. All rights reserved.
import argparse
import numpy as np
import popart
import json
import os
import copy
import logging_util
import text_utils
# set up logging
logger = logging_util.get_basic_logger(__name__)
de... |
anime_downloader/scrapers/twist/twist_source_decryptor.py | Amdrossa/Anime | 554 | 12751779 | from requests.utils import requote_uri
from base64 import b64decode
from hashlib import md5
from Crypto.Cipher import AES
class TwistSourceDecryptor:
BLOCK_SIZE = 16
SECRET_KEY = b'<KEY>'
def __init__(self, enc_src):
self.enc_src = enc_src.encode('utf-8')
def __pad(self, data):
lengt... |
tools/SeeDot/faceDetection/scale_image.py | Shenzhen-Cloudatawalk-Technology-Co-Ltd/EdgeML | 719 | 12751782 | <reponame>Shenzhen-Cloudatawalk-Technology-Co-Ltd/EdgeML<gh_stars>100-1000
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license.
import torch
import argparse
import cv2
import numpy as np
from PIL import Image
import os
os.environ['IS_QVGA_MONO'] = '1'
from data.choose_config ... |
modules/NaiveBayes.py | vmkc/GyoiThon | 666 | 12751788 | <gh_stars>100-1000
#!/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import math
import re
class NaiveBayes:
def __init__(self):
self.vocabularies = set()
self.word_count = {}
self.category_count = {}
self.file_name = os.path.basename(__file__)
# Co... |
apps/core.py | neulab/RIPPLe | 130 | 12751808 | <filename>apps/core.py
import streamlit as st
from pathlib import Path
import sys
ROOT = (Path(__file__).parent / "..").resolve()
sys.path.append(str(ROOT))
from pathlib import Path
import torch
import numpy as np
from typing import *
from utils_glue import *
from pytorch_transformers import *
import itertools
import... |
rpython/rtyper/test/test_rweakref.py | nanjekyejoannah/pypy | 381 | 12751812 | import py, weakref
from rpython.rlib import rgc
from rpython.rtyper.lltypesystem import lltype, llmemory
from rpython.rtyper.test.tool import BaseRtypingTest
class TestRweakref(BaseRtypingTest):
def test_weakref_simple(self):
class A:
pass
class B(A):
pass
class C(A... |
idaes/core/util/tables.py | eslickj/idaes-pse | 112 | 12751814 | <gh_stars>100-1000
#################################################################################
# The Institute for the Design of Advanced Energy Systems Integrated Platform
# Framework (IDAES IP) was produced under the DOE Institute for the
# Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-20... |
plynx/demo/__init__.py | khaxis/plynx | 137 | 12751837 | <reponame>khaxis/plynx
"""Basic Operations for the demo."""
from plynx.demo.basic_functions import GROUP as basic_group
from plynx.demo.hello_world import GROUP as hello_group
from plynx.demo.types import GROUP as types_group
COLLECTION = [
hello_group,
types_group,
basic_group,
]
|
cloudmarker/stores/esstore.py | dkuspawono/cloudmarker | 208 | 12751843 | """Elasticsearch store plugin."""
import json
import logging
from elasticsearch import Elasticsearch, ElasticsearchException
_log = logging.getLogger(__name__)
class EsStore:
"""Elasticsearch adapter to index cloud data in Elasticsearch."""
def __init__(self, host='localhost', port=9200, index='cloudmark... |
ext/testlib/state.py | hyu-iot/gem5 | 765 | 12751849 | <reponame>hyu-iot/gem5
# Copyright (c) 2017 <NAME> and <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list o... |
fuzzers/ECP5/140-sysconfig/fuzzer.py | Keno/prjtrellis | 256 | 12751862 | from fuzzconfig import FuzzConfig
import nonrouting
import pytrellis
import fuzzloops
import interconnect
cfg = FuzzConfig(job="USRMCLK", family="ECP5", device="LFE5U-45F", ncl="empty.ncl",
tiles=["MIB_R71C4:EFB0_PICB0", "MIB_R71C5:EFB1_PICB1", "MIB_R71C6:EFB2_PICB0",
"MIB_R71C... |
mutant/compat.py | pombredanne/django-mutant | 152 | 12751870 | <gh_stars>100-1000
from __future__ import unicode_literals
from operator import attrgetter
import django
get_remote_field = attrgetter('remote_field' if django.VERSION >= (1, 9) else 'rel')
if django.VERSION >= (1, 9):
def get_remote_field_model(field):
model = getattr(field, 'model', None)
if m... |
conan/recipes/gst-plugins-bad/conanfile.py | alexa/aac-sdk | 139 | 12751874 | import os
import glob
import logging
from conans import ConanFile, tools, Meson
_meson_feature = ["disabled", "enabled", "auto"]
_features = []
class GStPluginsBadConan(ConanFile):
python_requires = "aac-sdk-tools/1.0"
python_requires_extend = "aac-sdk-tools.BaseSdkDependency"
name = "gst-plugins-bad"
... |
tests/test_hyperparams_opt.py | keshaviyengar/rl-baselines-zoo | 1,023 | 12751888 | import os
import shutil
import subprocess
import pytest
def _assert_eq(left, right):
assert left == right, '{} != {}'.format(left, right)
N_STEPS = 100
N_TRIALS = 2
N_JOBS = 1
ALGOS = ('ppo2', 'a2c', 'trpo', 'acktr')
# Not yet supported:
# ALGOS = ('acer', 'dqn')
ENV_IDS = ('CartPole-v1',)
LOG_FOLDER = 'logs/... |
glance/tests/functional/db/migrations/test_rocky_expand02.py | Steap/glance | 309 | 12751937 | <reponame>Steap/glance<filename>glance/tests/functional/db/migrations/test_rocky_expand02.py
# Copyright (c) 2018 <NAME>
# 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
#
# ... |
utils/evaluate_panoptic.py | alexisgroshenry/NPM3D_DSNet | 188 | 12751991 | import argparse
import os
import yaml
import sys
import numpy as np
import time
import json
from .eval_np import PanopticEval
from .config import global_cfg
need_nuscenes_remap = False
if global_cfg.DATA_CONFIG.DATASET_NAME == 'SemanticKitti':
DATA = yaml.safe_load(open('semantic-kitti.yaml', 'r'))
# get numbe... |
kubeflow/fairing/builders/cluster/cos_context.py | suomitekai/fairing | 334 | 12752004 | from kubernetes import client
from kubeflow.fairing.builders.cluster.context_source import ContextSourceInterface
from kubeflow.fairing.cloud import ibm_cloud
from kubeflow.fairing import utils
from kubeflow.fairing.constants import constants
class COSContextSource(ContextSourceInterface):
"""
IBM Cloud Object... |
examples/pybullet/gym/pybullet_envs/minitaur/envs/minitaur_logging_pb2.py | stolk/bullet3 | 158 | 12752011 | <reponame>stolk/bullet3
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: minitaur_logging.proto
import sys
import os, inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(os.path.dirname(currentdir))
os.sys.path.insert(0, parent... |
recognition/_evaluation_/ijb/ijb_evals.py | qaz734913414/insightface | 12,377 | 12752012 | <reponame>qaz734913414/insightface
#!/usr/bin/env python3
import os
import cv2
import numpy as np
import pandas as pd
from tqdm import tqdm
from skimage import transform
from sklearn.preprocessing import normalize
from sklearn.metrics import roc_curve, auc
class Mxnet_model_interf:
def __init__(self, model_file, ... |
RecoHI/HiEgammaAlgos/python/HiEgammaPostPF_cff.py | ckamtsikis/cmssw | 852 | 12752013 | from RecoEgamma.EgammaIsolationAlgos.interestingEgammaIsoDetIdsSequence_cff import *
from RecoEgamma.PhotonIdentification.photonId_cff import *
from RecoEgamma.ElectronIdentification.electronIdSequence_cff import *
from RecoEgamma.EgammaHFProducers.hfEMClusteringSequence_cff import *
from RecoEgamma.EgammaIsolationAlgo... |
examples/maze/maze_env.py | jhardy0/deer | 373 | 12752044 | """ Environment with a distribution of mazes (one new maze is drawn at each episode)
Author: <NAME>
"""
import numpy as np
from deer.base_classes import Environment
#import matplotlib
#matplotlib.use('qt5agg')
#from mpl_toolkits.axes_grid1 import host_subplot
#import mpl_toolkits.axisartist as AA
#import matplotlib.... |
ykdl/extractors/ifeng/video.py | 592767809/ykdl | 136 | 12752075 | <reponame>592767809/ykdl
# -*- coding: utf-8 -*-
from .._common import *
class IfengVideo(Extractor):
name = '凤凰视频 (ifeng video)' # Expired
def prepare(self):
info = MediaInfo(self.name)
self.vid = self.url[-13: -6]
info.title = self.name + '-' + self.vid
data = get_response... |
src/lib/dis.py | DTenore/skulpt | 2,671 | 12752097 | import _sk_fail; _sk_fail._("dis")
|
plaso/output/shared_dsv.py | pyllyukko/plaso | 1,253 | 12752104 | # -*- coding: utf-8 -*-
"""Shared functionality for delimiter separated values output modules."""
from plaso.output import formatting_helper
from plaso.output import interface
class DSVEventFormattingHelper(formatting_helper.EventFormattingHelper):
"""Delimiter separated values output module event formatting helpe... |
Chapter03/malicious_url_detection.py | gabrielmahia/HandsOnKungFu | 112 | 12752112 | <gh_stars>100-1000
import pandas as pd
import numpy as np
import random
import pickle
from sklearn.model_selection import train_test_split
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.linear_model import LogisticRegression
#The url needs to undergo some amount of cleasing before we use it... |
luke/pretraining/model.py | xuzf-git/luke | 467 | 12752146 | from typing import Optional
import torch
from torch import nn
from torch.nn import CrossEntropyLoss
from transformers.models.bert.modeling_bert import ACT2FN, BertPreTrainingHeads
from transformers.models.roberta.modeling_roberta import RobertaLMHead
from luke.model import LukeModel, LukeConfig
class EntityPredictio... |
release/stubs.min/Autodesk/Revit/DB/Electrical.py | htlcnn/ironpython-stubs | 182 | 12752148 | <reponame>htlcnn/ironpython-stubs
# encoding: utf-8
# module Autodesk.Revit.DB.Electrical calls itself Electrical
# from RevitAPI,Version=17.0.0.0,Culture=neutral,PublicKeyToken=null
# by generator 1.145
# no doc
# no imports
# no functions
# classes
from Electrical_parts.CableTrayConduitBase import CableTray... |
examples/RP2/Waveshare-lcd-2/feathers2.py | Wind-stormger/st7789_mpy-1 | 153 | 12752153 | <gh_stars>100-1000
"""
feathers2.py
Smoothly scroll rainbow colored random curves across the front of a Waveshare Pico LCD 1.3
Display Module using a Raspberry Pi PICO.
Video: https://youtu.be/ZKrKsz7_CXo
"""
import random
import math
import utime
from machine import Pin, SPI
import st7789
def between(l... |
RecoMuon/MuonIdentification/python/muonShowerInformationProducer_cff.py | ckamtsikis/cmssw | 852 | 12752155 | from RecoMuon.MuonIdentification.muonShowerInformation_cfi import *
muonShowerInformation = cms.EDProducer("MuonShowerInformationProducer",
MuonServiceProxy,
muonCollection = cms.InputTag("muons1stStep"),
trackCollection = cms.InputTag("generalTracks"),
ShowerInfor... |
algorithms/maths/extended_gcd.py | zhengli0817/algorithms | 128 | 12752161 | <reponame>zhengli0817/algorithms<gh_stars>100-1000
"""
extended GCD algorithm
return s,t,g
such that a s + b t = GCD(a, b)
and s and t are coprime
"""
def extended_gcd(a,b):
old_s, s = 1, 0
old_t, t = 0, 1
old_r, r = a, b
while r != 0:
quotient = old_r / r
old_r, r = r, ol... |
backend/src/baserow/contrib/database/management/commands/fill_table.py | cjh0613/baserow | 839 | 12752173 | import sys
from decimal import Decimal
from math import ceil
from django.core.management.base import BaseCommand
from django.db.models import Max
from faker import Faker
from baserow.contrib.database.fields.field_helpers import (
construct_all_possible_field_kwargs,
)
from baserow.contrib.database.fields.handler ... |
supriya/providers.py | josiah-wolf-oberholtzer/supriya | 191 | 12752192 | import abc
import collections
import contextlib
import dataclasses
import pathlib
import re
import tempfile
from types import MappingProxyType
from typing import (
Any,
Callable,
Dict,
List,
Mapping,
Optional,
Sequence,
Tuple,
Type,
Union,
cast,
)
from uqbar.objects import n... |
shhh/enums.py | smallwat3r/shhh | 243 | 12752200 | <reponame>smallwat3r/shhh<filename>shhh/enums.py
from enum import Enum, IntEnum
class LivenessClient(Enum):
"""Liveness client type."""
WEB = "web"
TASK = "task"
class ReadTriesValues(IntEnum):
"""Enum of allowed number of tries to read secrets."""
THREE = 3
FIVE = 5
TEN = 10
@cla... |
aioinflux/serialization/dataframe.py | claashk/aioinflux | 120 | 12752211 | import re
from functools import reduce
from itertools import chain
from typing import Union, Dict, List
import pandas as pd
import numpy as np
from .common import *
DataFrameType = Union[pd.DataFrame, Dict[str, pd.DataFrame], List[Dict[str, pd.DataFrame]]]
# Serialization helper functions
# -----------------------... |
netbox/utilities/querysets.py | TheFlyingCorpse/netbox | 4,994 | 12752212 | from django.db.models import Q, QuerySet
from utilities.permissions import permission_is_exempt
class RestrictedQuerySet(QuerySet):
def restrict(self, user, action='view'):
"""
Filter the QuerySet to return only objects on which the specified user has been granted the specified
permissio... |
2017/python-interact-subprocess/emitter.py | mikiec84/code-for-blog | 1,199 | 12752229 | # Helper for testing.
#
# <NAME> [http://eli.thegreenplace.net]
# This code is in the public domain.
import sys
import time
def main():
count = 1
while True:
sys.stdout.write(f'{count} ')
if count % 20 == 0:
sys.stdout.write('\n')
time.sleep(0.05)
count += 1
if __... |
tools/azure-devtools/src/azure_devtools/scenario_tests/tests/test_utilities.py | rsdoherty/azure-sdk-for-python | 2,728 | 12752239 | <filename>tools/azure-devtools/src/azure_devtools/scenario_tests/tests/test_utilities.py<gh_stars>1000+
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the proj... |
skfda/inference/__init__.py | jiduque/scikit-fda | 147 | 12752242 | from . import anova, hotelling
|
pySOT/auxiliary_problems/lcb_ga.py | WY-Wang/pySOT | 180 | 12752278 | import numpy as np
from ..utils import GeneticAlgorithm as GA
from ..utils import round_vars
from .lcb_merit import lcb_merit
def lcb_ga(num_pts, opt_prob, surrogate, X, fX, Xpend=None, kappa=2.0, dtol=1e-3, lcb_target=None):
"""Minimize the LCB using a genetic algorithm.
:param num_pts: Number of points to... |
ml4a/dataset/processing.py | KushGabani/ml4a-guides | 1,110 | 12752309 | import os
from random import random, sample
import numpy as np
from PIL import Image, ImageDraw
from skimage.segmentation import felzenszwalb
from skimage.morphology import skeletonize, remove_small_objects
from skimage.util import invert
from tqdm import tqdm
import cv2
def cv2pil(cv2_img):
if len(cv2_img.shape)... |
pyNastran/converters/nastran/gui/menus/modify_map.py | ACea15/pyNastran | 293 | 12752319 | <gh_stars>100-1000
from itertools import chain
class Var:
def __init__(self, name, var, vartype='lineedit', pulldown_objs=None,
pulldown_type_limit=None, enabled=True, pulldown_allow_zero=False, required=True):
self.name = name
self.var = var
self.vartype = vartype
... |
utils/logs.py | VitorDominguesR/Astra | 1,986 | 12752324 | <reponame>VitorDominguesR/Astra<filename>utils/logs.py
import logging
import os
if os.getcwd().split('/')[-1] == 'API':
path = '../logs/scan.log'
else:
path = 'logs/scan.log'
logger = logging.getLogger()
fh = logging.FileHandler(path)
logger.addHandler(fh)
logger.setLevel(logging.INFO)
#logging.basi... |
ice/error/human_readable_error.py | reavessm/Ice | 578 | 12752328 |
class HumanReadableError(Exception):
pass
|
InnerEye-DataQuality/InnerEyeDataQuality/selection/simulation_statistics.py | faz1993/InnerEye-DeepLearning | 402 | 12752331 | # ------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# -------------------------------------------------------------------... |
BiliVideoChecker.py | SettingDust/DDRecorder | 175 | 12752365 | <filename>BiliVideoChecker.py
import datetime
import logging
import os
import time
import threading
import requests
import urllib3
import utils
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
class BiliVideoChecker(threading.Thread):
def __init__(self, bvid: str, path: str, config: dict):
... |
__init__.py | federicozaiter/LogClass | 159 | 12752370 | __all__ = ["utils", "logclass"]
from .preprocess import *
from .feature_engineering import *
from .models import *
from .reporting import *
|
sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_operation_dto_delete.py | rsdoherty/azure-sdk-for-python | 2,728 | 12752379 | # 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 ... |
corehq/ex-submodules/dimagi/utils/data/deid_generator.py | dimagilg/commcare-hq | 471 | 12752390 | <reponame>dimagilg/commcare-hq<filename>corehq/ex-submodules/dimagi/utils/data/deid_generator.py
import hashlib
from functools import reduce
def to_number(bytes):
return reduce(lambda a, b: a * 256 + b, bytes)
def to_base(n, b):
if not n:
return []
else:
rest, digit = divmod(n, b)
... |
SimpleCV/Camera.py | M93Pragya/SimpleCV | 1,686 | 12752407 | # SimpleCV Cameras & Devices
#load system libraries
from SimpleCV.base import *
from SimpleCV.ImageClass import Image, ImageSet, ColorSpace
from SimpleCV.Display import Display
from SimpleCV.Color import Color
from collections import deque
import time
import ctypes as ct
import subprocess
import cv2
import numpy as np... |
HLTrigger/HLTanalyzers/test/test_hltrigreport_run_lumi.py | ckamtsikis/cmssw | 852 | 12752429 | from test_hltrigreport_base_cfg import process
process.hlTrigReport.resetBy = "run"
process.hlTrigReport.reportBy = "lumi"
|
source/vsm/vsm/api/views/poolusages.py | ramkrsna/virtual-storage-manager | 172 | 12752466 | <filename>source/vsm/vsm/api/views/poolusages.py<gh_stars>100-1000
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2014 Intel 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
#... |
src/express-route-cross-connection/azext_expressroutecrossconnection/vendored_sdks/v2018_04_01/models/ip_tag_py3.py | Mannan2812/azure-cli-extensions | 207 | 12752473 | # 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 ... |
web_programming/get_top_hn_posts.py | NavpreetDevpuri/Python | 145,614 | 12752476 | from __future__ import annotations
import requests
def get_hackernews_story(story_id: str) -> dict:
url = f"https://hacker-news.firebaseio.com/v0/item/{story_id}.json?print=pretty"
return requests.get(url).json()
def hackernews_top_stories(max_stories: int = 10) -> list[dict]:
"""
Get the top max_s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.