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 |
|---|---|---|---|---|
tests/grafana_dashboards/client/test_connection.py | Rvhappen/grafana-dashboard-builder | 131 | 11077368 | # -*- coding: utf-8 -*-
# Copyright 2015-2019 grafana-dashboard-builder contributors
#
# 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 ... |
src/france/utils/examples/qt_api_demo.py | ClementRolinat/covidtracker-data | 314 | 11077380 | <filename>src/france/utils/examples/qt_api_demo.py
#!/usr/bin/env python
import svg_stack as ss
doc = ss.Document()
layout1 = ss.HBoxLayout()
layout1.addSVG('red_ball.svg',alignment=ss.AlignTop|ss.AlignHCenter)
layout1.addSVG('blue_triangle.svg',alignment=ss.AlignCenter)
layout2 = ss.VBoxLayout()
layout2.addSVG('r... |
all/agents/vqn.py | kcorder/autonomous-learning-library | 584 | 11077384 | import torch
from torch.nn.functional import mse_loss
from ._agent import Agent
from ._parallel_agent import ParallelAgent
from .dqn import DQNTestAgent
class VQN(ParallelAgent):
'''
Vanilla Q-Network (VQN).
VQN is an implementation of the Q-learning algorithm found in the Sutton and Barto (2018) textbook... |
src/einsteinpy/symbolic/predefined/ernst.py | bibek22/einsteinpy | 485 | 11077395 | from sympy import diag, exp, sin, sqrt, symbols
from einsteinpy.symbolic import constants
from einsteinpy.symbolic.metric import MetricTensor
def Ernst(B=symbols("B"), M=symbols("M")):
"""
Black holes in a magnetic universe.
J. Math. Phys., 17:54–56, 1976.
<NAME>.
Parameters
----------
M... |
tacker/tests/unit/objects/test_vnf_software_images.py | takahashi-tsc/tacker | 116 | 11077405 | # Copyright (c) 2019 NTT DATA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
kivy/tests/test_fbo_py2py3.py | Kolandiolaka/kivy | 13,889 | 11077454 | <reponame>Kolandiolaka/kivy
import unittest
from kivy.tests.common import GraphicUnitTest
from kivy.uix.widget import Widget
from kivy.graphics import Fbo, Color, Rectangle
class FboTest(Widget):
def __init__(self, **kwargs):
super(FboTest, self).__init__(**kwargs)
self.positions = [
... |
cv2/tkinter-CV - with buttons to start and stop/main.py | whitmans-max/python-examples | 140 | 11077468 | #!/usr/bin/env python3
import tkinter as tk
from PIL import Image, ImageTk
import cv2
# --- functions ---
def play():
'''
start stream (run_camera and update_image)
and change state of buttons
'''
global run_camera
if not run_camera:
run_camera = True
button_pl... |
examples/quicksqlviews/app/models.py | NeolithEra/Flask-AppBuilder | 3,862 | 11077473 | import datetime
from flask_appbuilder import Model
from sqlalchemy import Column, Date, ForeignKey, Integer, MetaData, String, Table
from sqlalchemy.orm import relationship
mindate = datetime.date(datetime.MINYEAR, 1, 1)
_mt = MetaData()
class ContactGroup(Model):
id = Column(Integer, primary_key=True)
nam... |
setup.py | andreubernadserra/cadquery | 1,423 | 11077496 | # Copyright 2015 Parametric Products Intellectual Holdings, 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 appli... |
tensorlayer/layers/extend.py | Howdy-Personally/tensorlayer-master | 4,484 | 11077502 | <reponame>Howdy-Personally/tensorlayer-master<gh_stars>1000+
#! /usr/bin/python
# -*- coding: utf-8 -*-
import tensorflow as tf
from tensorlayer import logging
from tensorlayer.decorators import deprecated_alias
from tensorlayer.layers.core import Layer
__all__ = [
'ExpandDims',
'Tile',
]
class ExpandDims(... |
tests/test_async_cursor.py | jobteaser-oss/PyAthena | 363 | 11077508 | # -*- coding: utf-8 -*-
import contextlib
import time
import unittest
from datetime import datetime
from random import randint
from pyathena.async_cursor import AsyncCursor, AsyncDictCursor
from pyathena.error import NotSupportedError, ProgrammingError
from pyathena.model import AthenaQueryExecution
from pyathena.resu... |
brainrender/gui/widgets/screenshot_modal.py | crsanderford/brainrender | 226 | 11077513 | <filename>brainrender/gui/widgets/screenshot_modal.py
from qtpy.QtWidgets import QDialog, QLabel, QVBoxLayout
from qtpy import QtCore
from brainrender.gui.style import style, update_css
class ScreenshotModal(QDialog):
left = 250
top = 250
width = 400
height = 120
def __init__(self, main_window, ... |
lib/galaxy/jobs/runners/util/process_groups.py | rikeshi/galaxy | 1,085 | 11077530 | import errno
import logging
import os
import signal
from time import sleep
log = logging.getLogger(__name__)
def check_pg(pgid):
"""Check whether processes in process group pgid are still alive."""
try:
(pid, exit_status) = os.waitpid(-pgid, os.WNOHANG)
except OSError as e:
if e.errno == ... |
src/azure-cli/azure/cli/command_modules/natgateway/tests/latest/test_natgateway_commands.py | YuanyuanNi/azure-cli | 3,287 | 11077536 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
src/bindings/python/src/openvino/runtime/opset2/ops.py | artkuli/openvino | 1,127 | 11077567 | # -*- coding: utf-8 -*-
# Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Factory functions for all openvino ops."""
from typing import Callable, Iterable, List, Optional, Set, Union
import numpy as np
from functools import partial
from openvino.runtime import Node, Shape
from open... |
examples/python/markov_autoregression.py | CCHiggins/statsmodels | 6,931 | 11077575 | <gh_stars>1000+
#!/usr/bin/env python
# coding: utf-8
# DO NOT EDIT
# Autogenerated from the notebook markov_autoregression.ipynb.
# Edit the notebook and then sync the output with this file.
#
# flake8: noqa
# DO NOT EDIT
# ## Markov switching autoregression models
# This notebook provides an example of the use of ... |
backend/data/hdmetor/text_generation/blob/a9b307ce9167b3d9fd40f61407ba6c912634889d/model.py | zhiiker/neural_complete | 1,237 | 11077582 | from keras.models import Sequential
from keras.layers.recurrent import LSTM
from keras.layers.core import Dense, Activation, Dropout
def lstm_model(seq_len, total_char):
model = Sequential()
model.add(LSTM(512, return_sequences=True, input_shape=(seq_len, total_char)))
model.add(Dropout(0.4))
mode... |
demos/imagetagger/setup.py | Ixyk-Wolf/aiohttp-demos | 649 | 11077613 | <reponame>Ixyk-Wolf/aiohttp-demos
import os
import re
from setuptools import find_packages, setup
REGEXP = re.compile(r"^__version__\W*=\W*'([\d.abrc]+)'")
def read_version():
init_py = os.path.join(
os.path.dirname(__file__), 'imagetagger', '__init__.py'
)
with open(init_py) as f:
fo... |
tests/orm/test_groups.py | aiidateam/aiida_core | 153 | 11077623 | <reponame>aiidateam/aiida_core
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
crackq/logger.py | cah-antonia-vonoepen/crackq | 908 | 11077645 | <reponame>cah-antonia-vonoepen/crackq
"""Setup logging handler"""
#!/usr/bin/env python
import logging
from logging.config import fileConfig
# Setup logging
fileConfig('log_config.ini')
logger = logging.getLogger()
|
instascrape/scrapers/scrape_tools.py | code1dot/instascrape | 445 | 11077675 | <gh_stars>100-1000
from __future__ import annotations
import json
from typing import Any, Dict, Union, Callable, List
from collections import deque
import datetime
from functools import partial
import copy
import time
import requests
from bs4 import BeautifulSoup
from instascrape.core.json_algos import ... |
msg/tools/genmsg/src/genmsg/gentools.py | sikuner/Firmware_Marine | 742 | 11077688 | #! /usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2008, <NAME>, Inc.
# 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 ... |
mbrl/util/env.py | MansonX/mbrl-lib | 592 | 11077709 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from abc import ABC, abstractmethod
from typing import Dict, Optional, Tuple, Union, cast
import gym
import gym.wrappers
... |
sdk/python/tests/compiler/testdata/recur_cond.py | shrivs3/kfp-tekton | 102 | 11077718 | # Copyright 2021 kubeflow.org
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
kAFL-Fuzzer/fuzzer/technique/redqueen/hash_fix.py | SafeBreach-Labs/hAFL2 | 102 | 11077741 | <filename>kAFL-Fuzzer/fuzzer/technique/redqueen/hash_fix.py
# Copyright (C) 2017-2019 <NAME>, <NAME>, <NAME>
# Copyright (C) 2019-2020 Intel Corporation
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Redqueen Checksum Fixer
"""
import traceback
from array import array
from common.debug import log_redq
from .pars... |
datasets/nsmc/nsmc.py | WojciechKusa/datasets | 10,608 | 11077745 | <gh_stars>1000+
# coding=utf-8
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# 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... |
Algorithm.Python/ShortableProviderOrdersRejectedRegressionAlgorithm.py | BlackBoxAM/Lean | 6,580 | 11077779 | <reponame>BlackBoxAM/Lean
### QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
### Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
###
### Licensed under the Apache License, Version 2.0 (the "License");
### you may not use this file except in compliance with the License.
... |
tools/code-animation/main.py | lautalom/QuanticDev | 141 | 11077794 | <filename>tools/code-animation/main.py
from manim import *
"""
$ manim code.py/js -p
-p: preview: open vide file after rendering
"""
def highlight_line(code: Code, line_from, line_to):
if not line_to:
line_to = line_from
lines = range(line_from, line_to)
return [ApplyMethod(code.code[line_no].... |
test/test_custom_loss.py | ignatovmg/mhcflurry | 113 | 11077824 | import logging
logging.getLogger('tensorflow').disabled = True
logging.getLogger('matplotlib').disabled = True
from nose.tools import eq_, assert_less, assert_greater, assert_almost_equal
import numpy
numpy.random.seed(0)
import logging
logging.getLogger('tensorflow').disabled = True
import tensorflow.keras.backen... |
atlas/foundations_events/src/test/consumers/jobs/queued/test_run_data_keys.py | DeepLearnI/atlas | 296 | 11077831 | <reponame>DeepLearnI/atlas<filename>atlas/foundations_events/src/test/consumers/jobs/queued/test_run_data_keys.py
import unittest
from mock import Mock
from foundations_events.consumers.jobs.queued.run_data_keys import RunDataKeys
class TestRunDataKeys(unittest.TestCase):
def setUp(self):
self._redis =... |
packages/pytea/pylib/collections.py | Sehun0819/pytea | 241 | 11077865 | <filename>packages/pytea/pylib/collections.py<gh_stars>100-1000
import LibCall
def namedtuple(typename, field_names, **kwargs):
names = field_names
if isinstance(field_names, str):
names = []
LibCall.builtins.namedtuple_pushField(names, field_names)
rev_names = dict()
for i, name in e... |
slybot/slybot/starturls/__init__.py | hackrush01/portia | 6,390 | 11077881 | <reponame>hackrush01/portia
from collections import OrderedDict as ODict
from itertools import chain, product
from scrapy.utils.spider import arg_to_iter
import six
from six.moves.urllib_parse import urlparse
from .feed_generator import FeedGenerator
from .fragment_generator import FragmentGenerator
from .generated_... |
applications/tensorflow/cnns/training/Models/resnet.py | payoto/graphcore_examples | 260 | 11077888 | <gh_stars>100-1000
# Copyright (c) 2019 Graphcore 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 requi... |
factory-ai-vision/EdgeSolution/modules/WebModule/backend/vision_on_edge/streams/models.py | kaka-lin/azure-intelligent-edge-patterns | 176 | 11077891 | """App models.
"""
import logging
import threading
import time
import cv2
from configs.general_configs import PRINT_THREAD
from ..cameras.utils import normalize_rtsp, verify_rtsp
from .exceptions import StreamOpenRTSPError
logger = logging.getLogger(__name__)
# Stream
KEEP_ALIVE_THRESHOLD = 10 # Seconds
# Strea... |
manila/policies/share_snapshot.py | openstack/manila | 159 | 11077940 | <reponame>openstack/manila
# 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 ... |
008-osdev-01/build.py | gynvael/stream | 152 | 11077995 | <filename>008-osdev-01/build.py
import os
cmds_to_run = [
"nasm stage1.asm",
"nasm stage2.asm"
]
files_to_img = [
"stage1",
"stage2"
]
for cmd in cmds_to_run:
os.system(cmd)
buf = []
for fn in files_to_img:
with open(fn, "rb") as f:
buf.append(f.read())
# XXX: nie wyrownuj... |
koalixcrm/crm/factories/factory_customer_group.py | Cataldir/koalixcrm | 290 | 11077997 | # -*- coding: utf-8 -*-
import factory
from koalixcrm.crm.models import CustomerGroup
class StandardCustomerGroupFactory(factory.django.DjangoModelFactory):
class Meta:
model = CustomerGroup
django_get_or_create = ('name',)
name = factory.Sequence(lambda n: "Customer Group #%s" % n)
class ... |
pgcontents/utils/sync.py | freedom079215/pgcontents | 138 | 11078029 | """
Utilities for synchronizing directories.
"""
from __future__ import (
print_function,
unicode_literals,
)
from ..checkpoints import PostgresCheckpoints
from ..crypto import FallbackCrypto
from ..query import (
list_users,
reencrypt_user_content,
)
def create_user(db_url, user):
"""
Create... |
sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_models_py3.py | praveenkuttappan/azure-sdk-for-python | 2,728 | 11078043 | <filename>sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_models_py3.py
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license informa... |
toolkit/plugins/software/odex2jar.py | PleXone2019/IoT-Implant-Toolkit | 147 | 11078052 | <reponame>PleXone2019/IoT-Implant-Toolkit<filename>toolkit/plugins/software/odex2jar.py
#!/usr/bin/python3
'''
odex2jar class defination
not finish yet
'''
import os
from toolkit.core.basic import Plugin
class Odex2Jar(Plugin):
'''
inherit from class Plugin
'''
def __init__(self):
super().__in... |
experiments/bayesopt/run_cmaes_surrogate.py | lebrice/RoBO | 455 | 11078057 | import os
import sys
import cma
import json
import numpy as np
from robo.initial_design import init_random_uniform
from hpolib.benchmarks.ml.surrogate_svm import SurrogateSVM
from hpolib.benchmarks.ml.surrogate_cnn import SurrogateCNN
from hpolib.benchmarks.ml.surrogate_fcnet import SurrogateFCNet
run_id = int(sys.... |
tests/caliban/platform/gke/test_util.py | Anon-Artist/caliban | 425 | 11078060 | <filename>tests/caliban/platform/gke/test_util.py<gh_stars>100-1000
#!/usr/bin/python
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.... |
armi/utils/densityTools.py | celikten/armi | 162 | 11078061 | <filename>armi/utils/densityTools.py
# Copyright 2019 TerraPower, 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... |
tests/server/scheduler/test_create.py | catherine917/cloudburst | 174 | 11078108 | # Copyright 2019 U.C. Berkeley RISE Lab
#
# 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 agree... |
tests/test_provider_davidji99_ultradns.py | mjuenema/python-terrascript | 507 | 11078128 | <filename>tests/test_provider_davidji99_ultradns.py
# tests/test_provider_davidji99_ultradns.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:29:41 UTC)
def test_provider_import():
import terrascript.provider.davidji99.ultradns
def test_resource_import():
from terrascript.resource.davidji99... |
src/sage/features/join_feature.py | UCD4IDS/sage | 1,742 | 11078152 | <gh_stars>1000+
r"""
Join features
"""
from . import Feature, FeatureTestResult
class JoinFeature(Feature):
r"""
Join of several :class:`~sage.features.Feature` instances.
EXAMPLES::
sage: from sage.features import Executable
sage: from sage.features.join_feature import JoinFeature
... |
tests/compat.py | azmeuk/webtest | 239 | 11078175 | import unittest # noqa
try:
unicode()
except NameError:
b = bytes
def u(value):
if isinstance(value, bytes):
return value.decode('utf-8')
return value
else:
def b(value):
return str(value)
def u(value):
if isinstance(value, unicode):
return... |
bindings/python/cntk/train/__init__.py | shyamalschandra/CNTK | 17,702 | 11078180 | # Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE.md file in the project root
# for full license information.
# ==============================================================================
"""
Utilities for training.
"""
from .trainer import *
from .training_session impo... |
tests/torch/nn/parallel/tensor_parallel/_parallel_1d/_utils.py | lipovsek/oslo | 249 | 11078183 | <reponame>lipovsek/oslo
import torch
import torch.distributed as dist
from oslo.torch.distributed import ParallelMode
def split_1d(parallel_context, tensor, world_size, dim):
tensor = tensor.chunk(world_size, dim=dim)[
parallel_context.get_local_rank(ParallelMode.TENSOR_1D)
]
return tensor
def g... |
tests/resources/_kktpm/generate.py | jarreguit/pymoo | 762 | 11078184 | import numpy as np
from pymoo.factory import get_problem
from pymoo.optimize import minimize
def generate_test_data():
for str_problem in ["osy"]:
problem = get_problem(str_problem)
X = []
# define a callback function that prints the X and F value of the best individual
def my_c... |
spyne/util/tdict.py | edustaff/spyne | 786 | 11078212 | <reponame>edustaff/spyne
#
# spyne - Copyright (C) Spyne contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any late... |
tests/components/abode/test_switch.py | andersop91/core | 22,481 | 11078230 | """Tests for the Abode switch device."""
from unittest.mock import patch
from homeassistant.components.abode import (
DOMAIN as ABODE_DOMAIN,
SERVICE_TRIGGER_AUTOMATION,
)
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN
from homeassistant.const import (
ATTR_ENTITY_ID,
SERVICE_TURN_... |
tests/management/commands/test_list_signals.py | KazakovDenis/django-extensions | 4,057 | 11078253 | <filename>tests/management/commands/test_list_signals.py
# -*- coding: utf-8 -*-
import re
from io import StringIO
from django.test import TestCase
from django.core.management import call_command
class ListSignalsTests(TestCase):
"""Tests for list_signals command."""
def setUp(self):
self.out = Stri... |
simulation_research/traffic/point_process_model.py | deepneuralmachine/google-research | 23,901 | 11078266 | <filename>simulation_research/traffic/point_process_model.py
# coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.ap... |
src/ecdsa/eddsa.py | 592767809/python-ecdsa | 130 | 11078277 | <gh_stars>100-1000
"""Implementation of Edwards Digital Signature Algorithm."""
import hashlib
from ._sha3 import shake_256
from . import ellipticcurve
from ._compat import (
remove_whitespace,
bit_length,
bytes_to_int,
int_to_bytes,
compat26_str,
)
# edwards25519, defined in RFC7748
_p = 2 ** 255... |
boto3_type_annotations/boto3_type_annotations/snowball/client.py | cowboygneox/boto3_type_annotations | 119 | 11078289 | <gh_stars>100-1000
from typing import Optional
from botocore.client import BaseClient
from botocore.waiter import Waiter
from typing import Union
from typing import Dict
from botocore.paginate import Paginator
class Client(BaseClient):
def can_paginate(self, operation_name: str = None):
pass
def canc... |
sparse_operation_kit/unit_test/test_scripts/tf2/test_all_gather_dispatcher.py | xjqbest/HugeCTR | 130 | 11078290 | """
Copyright (c) 2021, NVIDIA 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 agreed to in ... |
torchdistill/losses/__init__.py | AhmedHussKhalifa/torchdistill | 576 | 11078298 | <filename>torchdistill/losses/__init__.py
from torchdistill.losses import custom, single
|
OnlineDB/SiStripESSources/python/test_FedCablingFromConfigDb_cfg.py | ckamtsikis/cmssw | 852 | 11078302 | <filename>OnlineDB/SiStripESSources/python/test_FedCablingFromConfigDb_cfg.py
import FWCore.ParameterSet.Config as cms
process = cms.Process("testFedCablingFromConfigDb")
process.load("DQM.SiStripCommon.MessageLogger_cfi")
process.load("OnlineDB.SiStripESSources.FedCablingFromConfigDb_cff")
process.SiStripConfigDb.U... |
py/mazebase/items/MazeItem.py | fakeNetflix/facebook-repo-MazeBase | 263 | 11078314 | <reponame>fakeNetflix/facebook-repo-MazeBase<gh_stars>100-1000
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import abc
import six
from copy import deepcopy
from mazebase.utils.mazeutils import populate_kwargs
@six... |
custom_components/xiaomi_miot_raw/deps/xiaomi_cloud_new.py | easy8646/xiaomi_miot_raw | 1,294 | 11078323 | """
The base logic was taken from project https://github.com/squachen/micloud
I had to rewrite the code to work asynchronously and handle timeouts for
requests to the cloud.
MIT License
Copyright (c) 2020 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
... |
tests/test_dask_image/test_ndfilters/test_cupy_ndfilters.py | anlavandier/dask-image | 144 | 11078351 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import dask.array as da
import numpy as np
import pytest
import dask_image.ndfilters
cupy = pytest.importorskip("cupy", minversion="7.7.0")
@pytest.fixture
def array():
s = (10, 10)
a = da.from_array(cupy.arange(int(np.prod(s)),
dtype=cupy... |
tool/msdf-atlas-gen/json-atlas-splitter.py | caogtaa/CCCustomVertexFomat | 123 | 11078358 | <filename>tool/msdf-atlas-gen/json-atlas-splitter.py
'''
Author: GT<<EMAIL>>
Date: 2020-12-24 11:14:35
LastEditors: GT<<EMAIL>>
LastEditTime: 2021-08-28 17:10:57
'''
import os
import shutil
import cv2
import codecs
import json
import numpy as np
import copy
import fire
from enum import IntEnum
from os import mkdir, pat... |
tests/tmp.py | Pandinosaurus/d6tpipe | 184 | 11078378 | <reponame>Pandinosaurus/d6tpipe<filename>tests/tmp.py<gh_stars>100-1000
import d6tpipe
api = d6tpipe.APIClient(profile='utest-local')
api = d6tpipe.APIClient(profile='utest-d6tdev')
api = d6tpipe.APIClient(profile='utest-dev', filecfg='~/d6tpipe/cfg-utest-dev.json')
api2 = d6tpipe.APIClient(profile='utest-dev2', filec... |
rman_translators/rman_nurbs_translator.py | N500/RenderManForBlender | 432 | 11078382 | <reponame>N500/RenderManForBlender
from .rman_translator import RmanTranslator
from ..rman_sg_nodes.rman_sg_nurbs import RmanSgNurbs
from ..rfb_utils import object_utils
from ..rfb_utils import string_utils
from ..rfb_utils import property_utils
import bpy
import math
'''
Code reference from: https://blender.stackexc... |
pyshtools/shclasses/shgradient.py | mjc87/SHTOOLS | 251 | 11078388 | <reponame>mjc87/SHTOOLS
"""
Class for grids of the two components of the horizontal gradient.
"""
import matplotlib as _mpl
import matplotlib.pyplot as _plt
import copy as _copy
import xarray as _xr
from .shgrid import SHGrid as _SHGrid
class SHGradient(object):
"""
Class for grids of the two components ... |
third_party/spider/baselines/nl2code/nn/utils/__init__.py | chenyangh/tensor2struct-public | 341 | 11078397 | <filename>third_party/spider/baselines/nl2code/nn/utils/__init__.py
__author__ = 'yinpengcheng'
|
alipay/aop/api/domain/AlipayMarketingActivityOrderRefundModel.py | antopen/alipay-sdk-python-all | 213 | 11078402 | <gh_stars>100-1000
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.RefundActivityInfo import RefundActivityInfo
class AlipayMarketingActivityOrderRefundModel(object):
def __init__(self):
self._buyer_id = None
... |
DeepHash/model/dch/__init__.py | imhmhm/DeepHash | 506 | 11078409 | <reponame>imhmhm/DeepHash
from .util import Dataset
from .dch import DCH
def train(train_img, database_img, query_img, config):
model = DCH(config)
img_database = Dataset(database_img, config.output_dim)
img_query = Dataset(query_img, config.output_dim)
img_train = Dataset(train_img, config.output_dim)... |
compiler_opt/rl/trainer_test.py | google/ml-compiler-opt | 130 | 11078414 | # coding=utf-8
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... |
agentnet/resolver/probabilistic.py | mraihan19/AgentNet | 337 | 11078454 | <gh_stars>100-1000
import theano.tensor as T
import theano.tensor.shared_randomstreams as random_streams
from .base import BaseResolver
class ProbabilisticResolver(BaseResolver):
"""
instance, that:
- determines which action should be taken given policy
- samples actions with probabilities gi... |
tests/commands/conftest.py | MitchellTesla/datasets | 3,395 | 11078458 | import pytest
DATASET_LOADING_SCRIPT_NAME = "__dummy_dataset1__"
DATASET_LOADING_SCRIPT_CODE = """
import json
import os
import datasets
REPO_URL = "https://huggingface.co/datasets/albertvillanova/tests-raw-jsonl/resolve/main/"
URLS = {"train": REPO_URL + "wikiann-bn-train.jsonl", "validation": REPO_URL + "wikian... |
nameko/web/websocket.py | mohamedmehdigara/nameko | 3,425 | 11078509 | <reponame>mohamedmehdigara/nameko<gh_stars>1000+
import json
import uuid
from collections import namedtuple
from functools import partial
from logging import getLogger
import six
import werkzeug
from eventlet.event import Event
from eventlet.websocket import WebSocketWSGI
from packaging import version
from werkzeug.ro... |
tests/test_lambda_runtime_client.py | keshayad/aws-lambda-python-runtime-interface-client | 136 | 11078517 | <gh_stars>100-1000
"""
Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
"""
import http
import http.client
import unittest.mock
from unittest.mock import MagicMock, patch
from awslambdaric import __version__
from awslambdaric.lambda_runtime_client import (
LambdaRuntimeClient,
LambdaRu... |
tools/convert_policy_yaml_to_heat_template.py | openstack/tripleo-heat-templates | 135 | 11078521 | <reponame>openstack/tripleo-heat-templates
#!/usr/bin/env python3
# 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 appl... |
bin/test_bsopt.py | hstenzel/yugabyte-db | 3,702 | 11078553 | <filename>bin/test_bsopt.py
#!/usr/bin/env python3
"""
A test for running tablet bootstrap with different combinations of options, and measuring time.
"""
import os
import threading
import time
import urllib.request
import json
import sys
import subprocess
# YugaByte directories
YUGABYTE_DIR = os.path.dirname(os.pat... |
mayan/apps/appearance/tests/mixins.py | nattangwiwat/Mayan-EDMS-recitation | 336 | 11078560 | from ..models import Theme
from .literals import TEST_THEME_LABEL, TEST_THEME_LABEL_EDITED
class ThemeTestMixin:
def _create_test_theme(self):
self.test_theme = Theme.objects.create(
label=TEST_THEME_LABEL
)
def _edit_test_theme(self):
self.test_theme.label = TEST_THEME_L... |
sharppy/databases/sars_cal.py | skovic/SHARPpy | 163 | 11078568 | import sharppy.databases.sars as sars
import sharppy.sharptab as tab
from sharppy.io.spc_decoder import SPCDecoder
import numpy as np
from datetime import datetime
import os
def get_profile(fname, sars_type):
# Create a convective profile object
# fname - filename/SARS sounding string to load in
# sars_typ... |
virtual/lib/python3.8/site-packages/registration/views.py | erastus-1/GramApp | 925 | 11078572 | """
Views which allow users to create and activate accounts.
"""
from django.conf import settings
from django.shortcuts import redirect
from django.utils.decorators import method_decorator
from django.utils.module_loading import import_string
from django.views.decorators.debug import sensitive_post_parameters
from dj... |
ykdl/extractors/bilibili/vc.py | Fearyncess/ykdl | 1,153 | 11078576 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from ykdl.extractor import VideoExtractor
from ykdl.videoinfo import VideoInfo
from ykdl.util.html import get_content
from ykdl.util.match import match1
import json
class BiliVC(VideoExtractor):
name = u'哔哩哔哩 小视频 (Bili VC)'
def prepare(self):
info = Vide... |
mpi4jax/_src/collective_ops/send.py | Thenerdstation/mpi4jax | 122 | 11078597 | import numpy as _np
from mpi4py import MPI as _MPI
from jax import core
from jax.core import Primitive
from jax.interpreters import xla
from jax.lax import create_token
from jax.lib import xla_client
from ..utils import (
HashableMPIType,
default_primitive_impl,
to_dtype_handle,
to_mpi_handle,
unp... |
robot-server/tests/protocols/__init__.py | anuwrag/opentrons | 235 | 11078605 | <gh_stars>100-1000
"""Tests for the robot_server.protocols module."""
|
RecoMuon/MuonSeedGenerator/python/ptSeedParameterization_38T_cfi.py | ckamtsikis/cmssw | 852 | 11078625 | import FWCore.ParameterSet.Config as cms
ptSeedParameterization = cms.PSet(
SMB_21 = cms.vdouble(0.918425, -0.141199, 0.0, 0.254515, -0.111848, 0.0),
SMB_20 = cms.vdouble(0.861314, -0.16233, 0.0, 0.248879, -0.113879, 0.0),
SMB_22 = cms.vdouble(1.308565, -0.701634, 0.0, -0.302861, 0.675785, 0.0),
OL_221... |
test/slicing/test_convergence.py | HazyResearch/snorkel | 2,906 | 11078631 | import random
import unittest
from typing import List
import numpy as np
import pandas as pd
import pytest
import torch
import torch.nn as nn
from snorkel.analysis import Scorer
from snorkel.classification import (
DictDataLoader,
DictDataset,
MultitaskClassifier,
Operation,
Task,
Trainer,
)
f... |
src/ros_callbacks.py | UnofficialJuliaMirrorSnapshots/RobotOS.jl-22415677-39a4-5241-a37a-00beabbbdae8 | 147 | 11078636 | <reponame>UnofficialJuliaMirrorSnapshots/RobotOS.jl-22415677-39a4-5241-a37a-00beabbbdae8<filename>src/ros_callbacks.py
#Python 2/3 compatibility with 3 style code
from __future__ import absolute_import, division, print_function, unicode_literals
__metaclass__ = type
import sys
import ctypes
import threading
try:
i... |
tests/modifier_test.py | khoih-prog/TinyNeuralNetwork | 241 | 11078650 | import random
import unittest
from distutils.version import LooseVersion
from operator import add, mul, sub, truediv
from unittest.case import SkipTest
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from interval import Interval
from tinynn.graph.modifier import l2_norm
from ti... |
doc/tutorial.py | alex123012/biotite | 208 | 11078667 | <reponame>alex123012/biotite<filename>doc/tutorial.py
import os.path
import os
import codeop
import logging
import copy
from importlib.util import module_from_spec, spec_from_loader
from sphinx.util.logging import getLogger
from sphinx.util import status_iterator
import sphinx_gallery.gen_rst as genrst
from sphinx_gall... |
raw_packet/Scripts/DHCPv4/dhcpv4_server.py | Vladimir-Ivanov-Git/raw_packet | 146 | 11078671 | <reponame>Vladimir-Ivanov-Git/raw_packet<filename>raw_packet/Scripts/DHCPv4/dhcpv4_server.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# region Description
"""
dhcpv4_server.py: DHCPv4 server (dhcpv4_server)
Author: <NAME>
License: MIT
Copyright 2020, Raw-packet Project
"""
# endregion
# region Import
from raw_p... |
examples/create_boxplots.py | sevagh/sigsep-mus-eval | 116 | 11078677 | import seaborn as sns
import pandas as pd
import matplotlib.pyplot as plt
import museval
comparisons = museval.MethodStore()
comparisons.add_sisec18()
agg_df = comparisons.agg_frames_scores()
sns.set()
sns.set_context("notebook")
metrics = ['SDR']
selected_targets = ['vocals', 'drums', 'bass', 'other']
oracles = [
... |
tests/tensorflow/test_models/__init__.py | sarthakpati/nncf | 310 | 11078711 | """
Copyright (c) 2020 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 agreed to in writin... |
src/genie/libs/parser/junos/tests/ShowOspfDatabase/cli/equal/golden_output_expected.py | balmasea/genieparser | 204 | 11078720 | <gh_stars>100-1000
expected_output = {
"ospf-database-information": {
"ospf-area-header": {"ospf-area": "0.0.0.8"},
"ospf-database": [
{
"advertising-router": "10.36.3.3",
"age": "61",
"checksum": "0xa127",
"lsa-id": "10.36.... |
tests/float/sys_getsizeof_float.py | iotctl/pycopy | 663 | 11078730 | <filename>tests/float/sys_getsizeof_float.py
# test sys.getsizeof() function
import sys
try:
sys.getsizeof
except AttributeError:
print("SKIP")
raise SystemExit
print(sys.getsizeof(1.0) >= 2)
|
src/nginx/config/api/base.py | sixninetynine/nginx-config-builder | 149 | 11078736 | <filename>src/nginx/config/api/base.py
class Base(object):
""" This is the base class for all blocks and options. """
_indent_level = 0
_indent_char = ' '
_indent = 4
_parent = None
def _get_indent(self):
return self._indent_char * self._indent * self._indent_level
def _render(self... |
backend/chat/schemas.py | restato/bunnybook | 131 | 11078739 | import datetime as dt
from typing import Optional
from uuid import UUID
from common.schemas import BaseSchema
class ChatMessageRead(BaseSchema):
id: UUID
created_at: dt.datetime
from_profile_id: UUID
chat_group_id: UUID
content: str
class ConversationRead(BaseSchema):
from_profile_id: UUID
... |
copier/subproject.py | Ket3r/copier | 438 | 11078755 | <gh_stars>100-1000
"""Objects to interact with subprojects.
A *subproject* is a project that gets rendered and/or updated with Copier.
"""
from pathlib import Path
from typing import Optional
import yaml
from plumbum.cmd import git
from plumbum.machines import local
from pydantic.dataclasses import dataclass
from .... |
scripts/convertChromsBigWig.py | gartician/deepTools | 351 | 11078761 | <reponame>gartician/deepTools
#!/usr/bin/env python
import sys
import pyBigWig
import requests
import re
import argparse
from argparse import RawTextHelpFormatter
import itertools
def parse_arguments(defaults):
parser = argparse.ArgumentParser(description='Convert chromosome names for bigwig files between ensemb... |
srl_zoo/models/autoencoders.py | anonymous-authors-2018/robotics-repo | 134 | 11078792 | from __future__ import print_function, division, absolute_import
from .models import *
class LinearAutoEncoder(BaseModelAutoEncoder):
"""
:param input_dim: (int)
:param state_dim: (int)
"""
def __init__(self, input_dim, state_dim=3):
super(LinearAutoEncoder, self).__init__()
sel... |
scripts/bpf/gen.py | 5cs/spdk | 2,107 | 11078811 | <filename>scripts/bpf/gen.py
#!/usr/bin/env python3
from argparse import ArgumentParser
import os
import re
import subprocess
import sys
class TraceProcess:
def __init__(self, pid):
self._path = os.readlink(f'/proc/{pid}/exe')
self._pid = pid
self._probes = self._init_probes()
def _i... |
examples/pysolver.py | tenglongcong/amgcl | 504 | 11078820 | <gh_stars>100-1000
#!/usr/bin/env python
import sys, argparse
import numpy as np
import pyamgcl as amg
from scipy.io import mmread, mmwrite
from time import time
from make_poisson import *
class timeit:
profile = {}
def __init__(self, desc):
self.desc = desc
self.tic = time()
def __ent... |
chrome/test/functional/media/media_stat_perf.py | nagineni/chromium-crosswalk | 231 | 11078827 | <gh_stars>100-1000
#!/usr/bin/env python
# Copyright (c) 2012 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.
"""CPU, Memory, and FPS performance test for <video>.
Calculates decoded fps, dropped fps, CPU, and memory stat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.