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 |
|---|---|---|---|---|
tools/manylinux1/build_scripts/ssl-check.py | limeng357/Paddle | 17,085 | 12711193 | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
tests/pytests/unit/renderers/test_toml.py | babs/salt | 9,425 | 12711194 | <reponame>babs/salt<gh_stars>1000+
import pytest
import salt.renderers.tomlmod
import salt.serializers.toml
@pytest.mark.skipif(
salt.serializers.toml.HAS_TOML is False, reason="The 'toml' library is missing"
)
def test_toml_render_string():
data = """[[user-sshkey."ssh_auth.present"]]
user = ... |
tests/core/utils/test_time.py | cercos/masonite | 1,816 | 12711208 | import pendulum
from tests import TestCase
from src.masonite.utils.time import (
migration_timestamp,
parse_human_time,
cookie_expire_time,
)
class TestTimeUtils(TestCase):
def tearDown(self):
super().tearDown()
self.restoreTime()
def test_parse_human_time_now(self):
ref_... |
Tools/Scenarios/list_bg.py | ErQing/Nova | 212 | 12711216 | #!/usr/bin/env python3
from luaparser import astnodes
from nova_script_parser import get_node_name, parse_chapters, walk_functions
in_filename = 'scenario.txt'
def do_chapter(entries, bg_list):
for code, _, _ in entries:
if not code:
continue
for func_name, args, _ in walk_functions(... |
installer/core/providers/aws/boto3/es.py | jonico/pacbot | 1,165 | 12711219 | from core.providers.aws.boto3 import prepare_aws_client_with_given_cred
import boto3
def get_es_client(aws_auth_cred):
"""
Returns the client object for AWS Elasticsearch
Args:
aws_auth (dict): Dict containing AWS credentials
Returns:
obj: AWS Elasticsearch Object
"""
return ... |
fixtures/tmva_net.py | kgarg8/torchinfo | 736 | 12711242 | # type: ignore
# pylint: skip-file
import torch
import torch.nn as nn
import torch.nn.functional as F
class DoubleConvBlock(nn.Module):
"""(2D conv => BN => LeakyReLU) * 2"""
def __init__(self, in_ch, out_ch, k_size, pad, dil):
super().__init__()
self.block = nn.Sequential(
nn.Con... |
packages/pyright-internal/src/tests/samples/typeAlias3.py | sasano8/pyright | 4,391 | 12711327 | # This sample tests that type aliases can consist of
# partially-specialized classes that can be further
# specialized.
# pyright: strict
from typing import Callable, Generic, Literal, Tuple, Optional, TypeVar
from typing_extensions import ParamSpec
T = TypeVar("T")
P = ParamSpec("P")
ValidationResult = Tuple[bool,... |
crank/net/trainer/__init__.py | abeersaqib/crank | 162 | 12711328 | <gh_stars>100-1000
from .basetrainer import BaseTrainer # noqa
from .trainer_vqvae import VQVAETrainer # noqa
from .trainer_lsgan import LSGANTrainer # noqa
from .trainer_cyclegan import CycleGANTrainer # noqa
from .trainer_stargan import StarGANTrainer # noqa
from .basetrainer import TrainerWrapper # noqa
|
examples/algorithms/clustering_comparisons.py | rkalahasty/nipy | 236 | 12711375 | <filename>examples/algorithms/clustering_comparisons.py
#!/usr/bin/env python3
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
from __future__ import print_function # Python 2/3 compatibility
__doc__ = """
Simple demo that partitions a smooth field into ... |
python/args-test.py | honux77/practice | 152 | 12711390 | a = [1, 2, 3, 4, 5,]
print(*a)
for i in a:
print(i, end=' ') |
Chapter09/Python 3.5/classify_image.py | littlealexchen/Deep-Learning-with-TensorFlow-master | 194 | 12711416 | <gh_stars>100-1000
import tensorflow as tf, sys
# You will be sending the image to be classified as a parameter
provided_image_path = sys.argv[1]
# then we will read the image data
provided_image_data = tf.gfile.FastGFile(provided_image_path, 'rb').read()
# Loads label file
label_lines = [line.rstrip() for line
... |
tests/guinea-pigs/nose/docstrings/testa.py | djeebus/teamcity-python | 105 | 12711431 | def test_func():
""" My cool test.name """
assert True
|
awdphpspear/protect.py | hillmanyoung/AWD | 146 | 12711432 | # -*- coding:utf-8 -*-
import os
import hashlib
import time
import shutil
def get_file_md5(filename):
m = hashlib.md5()
with open(filename,'rb') as fobj:
while True:
data = fobj.read(4096)
if not data:
break
m.update(data)
return m.hexdigest()
def file_md5_build(startpath):
global md5_list
globa... |
main.py | shubhamkumar906/DeepFake-Detection | 223 | 12711433 | <gh_stars>100-1000
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim import lr_scheduler
from apex import amp
from data_loader import create_dataloaders
from model import get_trainable_params, create_model, print_model_params
from train import train
from utils import pa... |
example/validators/with_python/development_settings.py | rroden12/dynaconf | 2,293 | 12711464 | <gh_stars>1000+
EXAMPLE = True
MYSQL_HOST = "development.com"
VERSION = 1
AGE = 15
NAME = "MIKE"
IMAGE_1 = "aaa"
IMAGE_2 = "bbb"
IMAGE_4 = "a"
IMAGE_5 = "b"
|
rel-eng/lib/osbsbuilder.py | SalatskySal/atomic-reactor | 113 | 12711477 | <gh_stars>100-1000
from tito.builder import Builder
class AtomicReactorBuilder(Builder):
def __init__(self, **kwargs):
super(AtomicReactorBuilder, self).__init__(**kwargs)
# tarball has to represent Source0
# but internal structure should remain same
# i.e. {name}-{version} otherw... |
cacreader/swig-4.0.2/Examples/test-suite/python/return_const_value_runme.py | kyletanyag/LL-Smartcard | 1,031 | 12711506 | import return_const_value
import sys
p = return_const_value.Foo_ptr_getPtr()
if (p.getVal() != 17):
print "Runtime test1 failed. p.getVal()=", p.getVal()
sys.exit(1)
p = return_const_value.Foo_ptr_getConstPtr()
if (p.getVal() != 17):
print "Runtime test2 failed. p.getVal()=", p.getVal()
sys.exit(1)
|
utils.py | karhankaan/CausalGAN | 119 | 12711577 | from __future__ import print_function
import tensorflow as tf
from functools import partial
import os
from os import listdir
from os.path import isfile, join
import shutil
import sys
from glob import glob
import math
import json
import logging
import numpy as np
from PIL import Image
from datetime import datetime
from ... |
tests/ut/cpp/python_input/gtest_input/optimizer/clean_test.py | GuoSuiming/mindspore | 3,200 | 12711599 | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
atest/resources/testlibs/cache_error.py | hugovk/SeleniumLibrary | 792 | 12711645 | from robot.libraries.BuiltIn import BuiltIn
def invalidate_driver():
sl = BuiltIn().get_library_instance("SeleniumLibrary")
sl.register_driver(None, "tidii")
sl.register_driver(None, "foobar")
|
nmmo/entity/__init__.py | zhm9484/environment | 230 | 12711652 | <filename>nmmo/entity/__init__.py
from nmmo.entity.entity import Entity
from nmmo.entity.player import Player
|
search/binary_search/python/binary_search_first_occurrence.py | CarbonDDR/al-go-rithms | 1,253 | 12711653 | def binary_search(arr, item):
low = 0
high = len(arr)-1
result = -1
while (low <= high):
mid = (low + high)//2
if item == arr[mid]:
result = mid
high = mid - 1
elif (item < arr[mid]):
high = mid - 1
else:
low = mid + 1
return result
|
tests/example_tests/custom_query_strategies.py | simonlevine/modAL | 1,460 | 12711654 | <gh_stars>1000+
import numpy as np
from modAL.utils.combination import make_linear_combination, make_product
from modAL.utils.selection import multi_argmax
from modAL.uncertainty import classifier_uncertainty, classifier_margin
from modAL.models import ActiveLearner
from sklearn.datasets import make_blobs
from sklearn... |
nodes/0.7.x/python/Roof.KindIsGlazed.py | jdehotin/Clockworkfordynamo | 147 | 12711661 | import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
items = UnwrapElement(IN[0])
booleans = list()
for item in items:
try:
if item.CurtainGrids:
booleans.append(True)
else:
booleans.append(False)
except:
booleans.append(False)
OUT = booleans |
fastAutoTest/core/wx/wxCommandManager.py | FranciscoShi/FAutoTest | 903 | 12711668 | <reponame>FranciscoShi/FAutoTest
# -*- coding: utf-8 -*-
'''
Tencent is pleased to support the open source community by making FAutoTest available.
Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in com... |
seahub/api2/endpoints/ocm.py | weimens/seahub | 420 | 12711689 | <reponame>weimens/seahub<filename>seahub/api2/endpoints/ocm.py<gh_stars>100-1000
import logging
import random
import string
import requests
import json
from constance import config
from rest_framework import status
from rest_framework.authentication import SessionAuthentication
from rest_framework.permissions import I... |
lib/datasets/factory.py | LeiYangJustin/UnseenObjectClustering | 101 | 12711702 | # Copyright (c) 2020 NVIDIA Corporation. All rights reserved.
# This work is licensed under the NVIDIA Source Code License - Non-commercial. Full
# text can be found in LICENSE.md
"""Factory method for easily getting imdbs by name."""
__sets = {}
import datasets.tabletop_object
import datasets.osd_object
import data... |
src/beanmachine/ppl/compiler/tests/tutorial_GMM_with_1_dimensions_and_4_components_test.py | feynmanliang/beanmachine | 177 | 12711708 | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""End-to-end test for 1D GMM with K > 2 number of components"""
import logging
import unittest
# Comments after imports suggest alternati... |
Python/FactorialOfNumbers.py | OluSure/Hacktoberfest2021-1 | 215 | 12711717 | <filename>Python/FactorialOfNumbers.py<gh_stars>100-1000
for i in range(int(input())):
fact=1
a=int(input())
for j in range(1,a+1,1):
fact=fact*j
print(fact) |
become_yukarin/data_struct.py | nameless-writer/become-yukarin | 562 | 12711738 | <gh_stars>100-1000
from typing import NamedTuple, Dict, List
import numpy
import pyworld
_min_mc = -18.3
class Wave(NamedTuple):
wave: numpy.ndarray
sampling_rate: int
class AcousticFeature(NamedTuple):
f0: numpy.ndarray = numpy.nan
spectrogram: numpy.ndarray = numpy.nan
aperiodicity: numpy.nd... |
transcrypt/modules/org/reactjs/__init__.py | kochelmonster/Transcrypt | 2,200 | 12711743 | createElement = React.createElement
createContext = React.createContext
forwardRef = React.forwardRef
Component = ReactComponent = React.Component
useState = React.useState
useEffect = React.useEffect
useContext = React.useContext
useReducer = React.useReducer
useCallback = React.useCallback
useMemo = Re... |
release/stubs.min/Tekla/Structures/ModelInternal_parts/dotLoadCommonAttributes_t.py | htlcnn/ironpython-stubs | 182 | 12711744 | <reponame>htlcnn/ironpython-stubs<filename>release/stubs.min/Tekla/Structures/ModelInternal_parts/dotLoadCommonAttributes_t.py
class dotLoadCommonAttributes_t(object):
# no doc
aPartFilter=None
AutomaticPrimaryAxisWeight=None
BoundingBoxDx=None
BoundingBoxDy=None
BoundingBoxDz=None
CreateFixedSupportConditionsAu... |
tests/isolated/patcher_importlib_lock.py | li-caspar/eventlet_0.30.2 | 5,079 | 12711790 | <filename>tests/isolated/patcher_importlib_lock.py
__test__ = False
def do_import():
import encodings.idna
if __name__ == '__main__':
import sys
import eventlet
eventlet.monkey_patch()
threading = eventlet.patcher.original('threading')
sys.modules.pop('encodings.idna', None)
# call "i... |
examples_allennlp/utils/embedders/scalar_mix_transoformer_embedder.py | techthiyanes/luke | 467 | 12711802 | <filename>examples_allennlp/utils/embedders/scalar_mix_transoformer_embedder.py
from allennlp.modules.token_embedders import TokenEmbedder, PretrainedTransformerEmbedder
from allennlp.modules.scalar_mix import ScalarMix
@TokenEmbedder.register("intermediate_pretrained_transformer")
class IntermediatePretrainedTransfo... |
src/masonite/providers/WhitenoiseProvider.py | cercos/masonite | 1,816 | 12711822 | from .Provider import Provider
from whitenoise import WhiteNoise
import os
class WhitenoiseProvider(Provider):
def __init__(self, application):
self.application = application
def register(self):
response_handler = WhiteNoise(
self.application.get_response_handler(),
r... |
caption/encoders/vanilla.py | SikandarBakht/asg2cap | 169 | 12711851 | <gh_stars>100-1000
import torch
import torch.nn as nn
import torch.nn.functional as F
import framework.configbase
import framework.ops
'''
Vanilla Encoder: embed nd array (batch_size, ..., dim_ft)
- EncoderConfig
- Encoder
Multilayer Perceptrons: feed forward networks + softmax
- MLPConfig
- MLP
'''
class ... |
setup.py | adamserafini/pyxl | 366 | 12711868 | <gh_stars>100-1000
#!/usr/bin/env python
import distutils.core
import sys
version = "1.0"
distutils.core.setup(
name="pyxl",
version=version,
packages = ["pyxl", "pyxl.codec", "pyxl.scripts", "pyxl.examples"],
author="<NAME>",
author_email="<EMAIL>",
url="http://github.com/awable/pyxl",
d... |
numpy/mnist/adam.py | wiseodd/natural-gradients | 104 | 12711905 | import numpy as np
import input_data
from sklearn.utils import shuffle
np.random.seed(9999)
mnist = input_data.read_data_sets('../MNIST_data', one_hot=True)
X_train = mnist.train.images
t_train = mnist.train.labels
X_test = mnist.test.images
t_test = mnist.test.labels
X_train, t_train = shuffle(X_train, t_train)
... |
mode/examples/Contributed Libraries in Python/OpenCV/BrightnessContrast/BrightnessContrast.pyde | timgates42/processing.py | 1,224 | 12711920 | add_library('opencv_processing')
img = None
opencv = None
def setup():
img = loadImage("test.jpg")
size(img.width, img.height, P2D)
opencv = OpenCV(this, img)
def draw():
opencv.loadImage(img)
opencv.brightness(int(map(mouseX, 0, width, -255, 255)))
image(opencv.getOutput(), 0, 0)
|
tools/openmldb_migrate.py | jasleon/OpenMLDB | 2,659 | 12711955 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2021 4Paradigm
#
# 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 ... |
.modules/.recon-ng/modules/recon/locations-locations/reverse_geocode.py | termux-one/EasY_HaCk | 1,103 | 12711957 | from recon.core.module import BaseModule
class Module(BaseModule):
meta = {
'name': 'Reverse Geocoder',
'author': '<NAME> (<EMAIL>)',
'description': 'Queries the Google Maps API to obtain an address from coordinates.',
'query': 'SELECT DISTINCT latitude || \',\' || longitude FROM l... |
server/apps/recommendation/apps.py | Mayandev/django_morec | 129 | 12711988 | from django.apps import AppConfig
class RecommendationConfig(AppConfig):
name = 'recommendation'
# app名字后台显示中文
verbose_name = "推荐管理"
|
pybo/policies/__init__.py | hfukada/pybo | 115 | 12711993 | """
Acquisition functions.
"""
# pylint: disable=wildcard-import
from .simple import *
from . import simple
__all__ = []
__all__ += simple.__all__
|
shim/opentelemetry-opentracing-shim/tests/testbed/test_subtask_span_propagation/test_asyncio.py | oxeye-nikolay/opentelemetry-python | 868 | 12712008 | from __future__ import absolute_import, print_function
import asyncio
from ..otel_ot_shim_tracer import MockTracer
from ..testcase import OpenTelemetryTestCase
class TestAsyncio(OpenTelemetryTestCase):
def setUp(self):
self.tracer = MockTracer()
self.loop = asyncio.get_event_loop()
def test... |
chapter11/observer.py | JoeanAmiee/Mastering-Python-Design-Patterns-Second-Edition | 278 | 12712032 | <gh_stars>100-1000
class Publisher:
def __init__(self):
self.observers = []
def add(self, observer):
if observer not in self.observers:
self.observers.append(observer)
else:
print(f'Failed to add: {observer}')
def remove(self, o... |
env/Lib/site-packages/OpenGL/GLES1/OES/required_internalformat.py | 5gconnectedbike/Navio2 | 210 | 12712034 | '''OpenGL extension OES.required_internalformat
This module customises the behaviour of the
OpenGL.raw.GLES1.OES.required_internalformat to provide a more
Python-friendly API
Overview (from the spec)
The ES 1.1 API allows an implementation to store texture data internally
with arbitrary precision, regardless of... |
xfel/lcls_api/exercise_api.py | dperl-sol/cctbx_project | 155 | 12712100 | <gh_stars>100-1000
from __future__ import absolute_import, division, print_function
import psana
from xfel.lcls_api.psana_cctbx import CctbxPsanaEventProcessor
def simple_example(experiment, run_number, detector_address, params_file, event_num):
""" Demo using the cctbx/lcls api
@param experiment LCLS experiment s... |
care/facility/migrations/0254_patientnotes.py | gigincg/care | 189 | 12712121 | # Generated by Django 2.2.11 on 2021-06-12 14:33
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('facility', ... |
alg/compartmental_gp/data_loader.py | loramf/mlforhealthlabpub | 171 | 12712125 | <gh_stars>100-1000
import pandas as pds
import numpy as np
from datetime import datetime
import torch
def numpy_fill(arr):
mask = np.isnan(arr)
idx = np.where(~mask,np.arange(mask.shape[1]),0)
np.maximum.accumulate(idx,axis=1, out=idx)
out = arr[np.arange(idx.shape[0])[:,None], idx]
return out
d... |
tensorflow_graphics/projects/gan/exponential_moving_average_test.py | sarvex/graphics | 2,759 | 12712142 | # Copyright 2020 The TensorFlow 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
#
# Unless required by applicable law or agreed to i... |
cacreader/swig-4.0.2/Examples/contract/simple_cxx/runme3.py | kyletanyag/LL-Smartcard | 1,031 | 12712153 | import example
# Create the Circle object
r = 2;
print " Creating circle (radium: %d) :" % r
c = example.Circle(r)
# Set the location of the object
c.x = 20
c.y = 30
print " Here is its current position:"
print " Circle = (%f, %f)" % (c.x,c.y)
# ----- Call some methods -----
print "\n Here are some propert... |
nodemcu/nodemcu-uploader/nodemcu-uploader.py | kvderevyanko/price | 324 | 12712156 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2015-2019 <NAME> <<EMAIL>>
# pylint: disable=C0103
"""makes it easier to run nodemcu-uploader from command line"""
from nodemcu_uploader import main
if __name__ == '__main__':
main.main_func()
|
vision3d/detector/proposal.py | jhultman/PV-RCNN | 131 | 12712172 | <reponame>jhultman/PV-RCNN
import torch
import math
from torch import nn
import torch.nn.functional as F
from vision3d.ops import sigmoid_focal_loss, batched_nms_rotated
from vision3d.core.box_encode import decode
class ProposalLayer(nn.Module):
"""
Use BEV feature map to generate 3D box proposals.
TODO:... |
fiftyone/types/__init__.py | FLIR/fiftyone | 1,130 | 12712192 | <reponame>FLIR/fiftyone<filename>fiftyone/types/__init__.py
"""
FiftyOne types.
| Copyright 2017-2021, Voxel51, Inc.
| `voxel51.com <https://voxel51.com/>`_
|
"""
# pylint: disable=wildcard-import,unused-wildcard-import
from .dataset_types import *
|
plenum/test/audit_ledger/test_first_audit_catchup_during_ordering.py | andkononykhin/plenum | 148 | 12712252 | import pytest
from plenum.test import waits
from plenum.common.constants import LEDGER_STATUS, DOMAIN_LEDGER_ID
from plenum.common.messages.node_messages import MessageReq, CatchupReq
from plenum.server.catchup.node_leecher_service import NodeLeecherService
from plenum.test.delayers import ppDelay, pDelay, cDelay, DEF... |
cherry/envs/action_space_scaler_wrapper.py | acse-yl27218/cherry | 160 | 12712291 | <gh_stars>100-1000
#!/usr/bin/env python3
import gym
import numpy as np
from .base import Wrapper
class ActionSpaceScaler(Wrapper):
"""
Scales the action space to be in the range (-clip, clip).
Adapted from Vitchyr Pong's RLkit:
https://github.com/vitchyr/rlkit/blob/master/rlkit/envs/wrappers.py#L... |
egs/ifnenit/v1/local/transcript_to_latin.py | shuipi100/kaldi | 805 | 12712326 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This script is originally from qatip project (http://qatsdemo.cloudapp.net/qatip/demo/)
# of Qatar Computing Research Institute (http://qcri.qa/)
# Convert every utterance transcript to position dependent latin format using "data/train/words2latin" as dictionary.
impo... |
Beginers/ExampleExceptions/C_finally_.py | arunkgupta/PythonTrainingExercises | 150 | 12712363 | <gh_stars>100-1000
#!/usr/bin/env python
"""Example of raising an exception where b() has a finally clause and a()
catches the exception.
Created on Aug 19, 2011
@author: paulross
"""
class ExceptionNormal(Exception):
pass
class ExceptionCleanUp(Exception):
pass
def a():
try:
b()
except Exc... |
console/scan_retention.py | RishiKumarRay/scantron | 684 | 12712370 | <reponame>RishiKumarRay/scantron<gh_stars>100-1000
#!/usr/bin/env python
# Standard Python libraries.
import argparse
import datetime
import glob
import logging
import os
import sys
# Third party Python libraries.
import django
# Custom Python libraries.
import django_connector
# Setup logging.
ROOT_LOGGER = logging... |
tests/components/media_player/__init__.py | MrDelik/core | 30,023 | 12712390 | <filename>tests/components/media_player/__init__.py
"""The tests for Media player platforms."""
|
h2o-py/tests/testdir_algos/gbm/pyunit_ecology_gbm.py | ahmedengu/h2o-3 | 6,098 | 12712433 | <filename>h2o-py/tests/testdir_algos/gbm/pyunit_ecology_gbm.py
from builtins import range
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
import pandas
from sklearn import ensemble
from sklearn import preprocessing
from sklearn.metrics import roc_auc_score
from h2o.estimators.gbm imp... |
libs/models.py | mehrdad-shokri/lightbulb-framework | 497 | 12712453 | <gh_stars>100-1000
"""
This file contains all the in-memory Database implementation
of the Burp Extension. The contained models are used for
maintaining the Burp Proxy requests and responses, the lightbulb's
filters (regexes, grammars), the lightbulb's trees, the user's
campaigns, and other info. The models also includ... |
src/betamax/serializers/base.py | santosh653/betamax | 226 | 12712464 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
NOT_IMPLEMENTED_ERROR_MSG = ('This method must be implemented by classes'
' inheriting from BaseSerializer.')
class BaseSerializer(object):
"""
Base Serializer class that provides an interface for other serializers.
Usage:
.. co... |
google/cloud/aiplatform/training_utils/cloud_profiler/initializer.py | sakagarwal/python-aiplatform | 180 | 12712487 | # -*- coding: utf-8 -*-
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... |
astroNN/models/misc_models.py | igomezv/astroNN | 156 | 12712505 | <reponame>igomezv/astroNN
# ---------------------------------------------------------#
# astroNN.models.misc_models: Contain Misc. Models
# ---------------------------------------------------------#
import tensorflow.keras as tfk
from astroNN.models.base_bayesian_cnn import BayesianCNNBase
from astroNN.models.base_c... |
exercises/concept/restaurant-rozalynn/.meta/exemplar.py | tamireinhorn/python | 1,177 | 12712510 | def new_seating_chart(size=22):
"""Create a new seating chart.
:param size: int - number if seats in the seating chart.
:return: dict - with number of seats specified, and placeholder values.
"""
return {number: None for number in range(1, size + 1)}
def arrange_reservations(guests=None):
""... |
pyod/__init__.py | GBR-613/pyod | 5,126 | 12712536 | <gh_stars>1000+
# -*- coding: utf-8 -*-
from . import models
from . import utils
# TODO: add version information here
__all__ = ['models', 'utils']
|
unfurl/parsers/parse_hash.py | jakuta-tech/unfurl | 449 | 12712575 | <reponame>jakuta-tech/unfurl
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
tests/testUtils.py | pir2/python-omniture | 105 | 12712615 | import datetime
import unittest
import omniture
class UtilsTest(unittest.TestCase):
def setUp(self):
fakelist = [{"id":"123", "title":"abc"},{"id":"456","title":"abc"}]
self.alist = omniture.Value.list("segemnts",fakelist,{})
def tearDown(self):
del self.alist
def test_addre... |
tests/http_schemas/test_base_schema.py | NickMitin/pyhttptest | 142 | 12712616 | import pytest
from jsonschema import validate
from jsonschema.exceptions import ValidationError
from pyhttptest.http_schemas.base_schema import base_schema
def test_schema_with_valid_data():
data = {
'name': 'Test',
'verb': 'GET',
'endpoint': 'users',
'host': 'http://test.com',
... |
backend/src/baserow/core/tasks.py | cjh0613/baserow | 839 | 12712646 | from .trash.tasks import (
permanently_delete_marked_trash,
mark_old_trash_for_permanent_deletion,
setup_period_trash_tasks,
)
__all__ = [
"permanently_delete_marked_trash",
"mark_old_trash_for_permanent_deletion",
"setup_period_trash_tasks",
]
|
tests/assets/projekt/projekt.py | Lufedi/reaper | 106 | 12712647 | def projekt():
# Single line comment
print('RepoReapers')
|
torchtoolbox/data/__init__.py | deeplearningforfun/torch-tools | 353 | 12712680 | <reponame>deeplearningforfun/torch-tools<filename>torchtoolbox/data/__init__.py<gh_stars>100-1000
# -*- coding: utf-8 -*-
# @Author : DevinYang(<EMAIL>)
from .utils import *
from .lmdb_dataset import *
from .datasets import *
from .dataprefetcher import DataPreFetcher
from .dynamic_data_provider import *
from .sampler... |
assistive_gym/envs/agents/pr2.py | chstetco/assistive-gym | 216 | 12712695 | <gh_stars>100-1000
import os
import numpy as np
import pybullet as p
from .robot import Robot
class PR2(Robot):
def __init__(self, controllable_joints='right'):
right_arm_joint_indices = [42, 43, 44, 46, 47, 49, 50] # Controllable arm joints
left_arm_joint_indices = [64, 65, 66, 68, 69, 71, 72] # C... |
cacreader/swig-4.0.2/Examples/test-suite/python/director_default_runme.py | kyletanyag/LL-Smartcard | 1,031 | 12712775 | <gh_stars>1000+
from director_default import *
f = Foo()
f = Foo(1)
f = Bar()
f = Bar(1)
|
gobbli/test/test_util.py | RTIInternational/gobbli | 276 | 12712829 | <filename>gobbli/test/test_util.py
import gzip
import io
import tarfile
import zipfile
from pathlib import Path
from typing import List
import pytest
from gobbli.util import (
TokenizeMethod,
blob_to_dir,
detokenize,
dir_to_blob,
extract_archive,
is_archive,
shuffle_together,
tokenize,... |
applications/pytorch/miniDALL-E/log.py | payoto/graphcore_examples | 260 | 12712887 | # Copyright (c) 2021 Graphcore Ltd. All rights reserved.
import logging
import sys
from logging import handlers
class Singleton(type):
_instances = {}
def __call__(cls, *args, **kwargs):
if cls not in cls._instances:
cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
... |
up/tasks/det/plugins/condinst/models/postprocess/condinst_predictor.py | ModelTC/EOD | 196 | 12712897 | <reponame>ModelTC/EOD
import torch
from torch.nn import functional as F
from up.utils.general.registry_factory import MASK_PREDICTOR_REGISTRY
from up.utils.general.fp16_helper import to_float32
from up.tasks.det.plugins.condinst.models.head.condinst_head import aligned_bilinear
@MASK_PREDICTOR_REGISTRY.register('cond... |
PyPtt/screens.py | Truth0906/PTTLibrary | 260 | 12712898 | import re
import sys
try:
from . import lib_util
from . import log
except ModuleNotFoundError:
import lib_util
import log
class Target(object):
MainMenu = [
'離開,再見…',
'人, 我是',
'[呼叫器]',
]
MainMenu_Exiting = [
'【主功能表】',
'您確定要離開',
]
QueryPost... |
docs/generate.py | tenjupaul/pocketlang | 1,323 | 12712902 | <filename>docs/generate.py<gh_stars>1000+
#!python
## Copyright (c) 2021 <NAME>
## Licensed under: MIT License
from markdown import markdown
from os.path import join
import os, sys, shutil, re
## TODO: This is a quick and dirty script to generate html
## from markdown. Refactor this file in the future.
## Usag... |
tests/test_losses.py | bendavidsteel/neuroptica | 161 | 12712922 | import unittest
from neuroptica.layers import Activation, ClementsLayer
from neuroptica.losses import CategoricalCrossEntropy, MeanSquaredError
from neuroptica.models import Sequential
from neuroptica.nonlinearities import *
from neuroptica.optimizers import Optimizer
from tests.base import NeuropticaTest
from tests.t... |
tests/fixtures/builtin.py | WillDaSilva/mkdocstrings | 354 | 12712951 | def func(foo=print):
"""test"""
|
attendance/serializers.py | akshaya9/fosswebsite | 369 | 12712957 | <reponame>akshaya9/fosswebsite<filename>attendance/serializers.py
from rest_framework import serializers
from attendance.models import SSIDName
class SSIDNameSerializer(serializers.ModelSerializer):
class Meta:
model = SSIDName
fields = ['name']
read_only_fields = ['name']
|
recipes/tests.py | TechNic11/Try-Django-3.2 | 136 | 12713004 | <gh_stars>100-1000
from django.core.exceptions import ValidationError
from django.contrib.auth import get_user_model
from django.test import TestCase
from .models import RecipeIngredient, Recipe
User = get_user_model()
class UserTestCase(TestCase):
def setUp(self):
self.user_a = User.objects.create_user(... |
perf_dashboard/python_clientlibs_download.py | harshb36/python-runtime | 207 | 12713005 | <reponame>harshb36/python-runtime
# Copyright 2017 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
#
# Unle... |
python/KerasModelRestoration.py | GangababuManam/tensorflow-101 | 832 | 12713013 | <reponame>GangababuManam/tensorflow-101
import tensorflow as tf
import numpy as np
from keras.models import Sequential
from keras.models import load_model
from keras.models import model_from_json
from keras.layers.core import Dense, Activation
from keras.utils import np_utils
#----------------------------
... |
src/utils/lastfm_etl/lastfm.py | LaudateCorpus1/hermes-5 | 135 | 12713050 | #!/usr/bin/env python
"""Translate the Last.fm data files to JSON.
This script takes the various Last.fm data files and write them out as
JSON. It removes the Last.fm artist URLs.
Attributes:
ARTISTS (dict): A dictionary that stores information about the artists. The
variables are as follows:
... |
kmip/core/secrets.py | ondrap/PyKMIP | 179 | 12713051 | <reponame>ondrap/PyKMIP
# Copyright (c) 2014 The Johns Hopkins University/Applied Physics Laboratory
# 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.a... |
946 Validate Stack Sequences.py | krishna13052001/LeetCode | 872 | 12713061 | #!/usr/bin/python3
"""
Given two sequences pushed and popped with distinct values, return true if and
only if this could have been the result of a sequence of push and pop operations
on an initially empty stack.
Example 1:
Input: pushed = [1,2,3,4,5], popped = [4,5,3,2,1]
Output: true
Explanation: We might do the fol... |
dizoo/gfootball/model/conv1d/conv1d_default_config.py | LuciusMos/DI-engine | 464 | 12713077 | from easydict import EasyDict
conv1d_config = dict(
feature_embedding=dict(
player=dict(
input_dim=36,
output_dim=64,
),
ball=dict(
input_dim=18,
output_dim=64,
),
left_team=dict(
input_dim=7,
output_dim... |
examples/arkane/species/CH2CHOOH/input.py | tza0035/RMG-Py | 250 | 12713084 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
modelChemistry = "CBS-QB3"
useHinderedRotors = True
useBondCorrections = False
species('CH2CHOOH', 'CH2CHOOH.py')
statmech('CH2CHOOH')
thermo('CH2CHOOH', 'Wilhoit')
|
tests/version_consistency/dummy_test.py | ldelebec/asteroid | 722 | 12713116 | <reponame>ldelebec/asteroid<filename>tests/version_consistency/dummy_test.py
def dummy_test():
pass
|
census_extractomatic/user_geo.py | censusreporter/census-api | 135 | 12713117 | <reponame>censusreporter/census-api
"""Centralize non-Flask code for 2020 User Geography data aggregation here.
This file serves both as a library for the Flask app as well as
a bootstrap for Celery tasks, which could be run with something like
celery -A census_extractomatic.user_geo:celery_app worker
"""
f... |
mccolors/getcolors.py | wangtt03/raspberryjammod | 338 | 12713179 | <reponame>wangtt03/raspberryjammod
from PIL import Image
from os import listdir
def averageColor(filename):
image = Image.open(filename).convert('RGB')
r,g,b = 0.,0.,0.
pixels = image.size[0] * image.size[1]
for x in range(image.size[0]):
for y in range(image.size[1]):
rgb ... |
Pyto/Samples/Matplotlib/polar_demo.py | snazari/Pyto | 701 | 12713182 | <filename>Pyto/Samples/Matplotlib/polar_demo.py<gh_stars>100-1000
"""
==========
Polar Demo
==========
Demo of a line plot on a polar axis.
"""
import numpy as np
import matplotlib.pyplot as plt
r = np.arange(0, 2, 0.01)
theta = 2 * np.pi * r
ax = plt.subplot(111, projection='polar')
ax.plot(theta, r)
ax.set_rmax(2... |
src/oci/key_management/models/vault_usage.py | Manny27nyc/oci-python-sdk | 249 | 12713194 | # 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... |
tests/integration-v1/cattletest/core/test_ha_config.py | lifecontrol/cattle | 482 | 12713205 | from common import * # NOQA
import json
@pytest.mark.nonparallel
def test_ha_config(admin_user_client):
ha_config = find_one(admin_user_client.list_ha_config)
admin_user_client.update(ha_config, enabled=False)
ha_config = find_one(admin_user_client.list_ha_config)
assert not ha_config.enabled
a... |
ci/docker/docker-in-docker-image/_conftest.py | bugtsa/avito-android | 347 | 12713273 | import pytest
import testinfra
check_output = testinfra.get_host(
'local://'
).check_output
class CommandLineArguments:
def __init__(self, docker_image):
self.docker_image = docker_image
@pytest.fixture()
def host(request):
arguments = _parse_command_line_arguments(request)
image_id = argu... |
tests/kibana_test.py | perceptron01/elastalert2 | 250 | 12713282 | <gh_stars>100-1000
import copy
import json
from elastalert.kibana import add_filter
from elastalert.kibana import dashboard_temp
from elastalert.kibana import filters_from_dashboard
from elastalert.kibana import kibana4_dashboard_link
from elastalert.util import EAException
# Dashboard schema with only filters secti... |
src/tests/test_log.py | cclauss/happymac | 244 | 12713340 | from collections import defaultdict
import datetime
import log
from mock import patch
import os
import os.path
import preferences
import process
import psutil
#
# TODO: Fix tests, needs work on Auger's automatic test generator
#
from psutil import Popen
import sys
import unittest
import utils
import versions.v00001.pro... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.