max_stars_repo_path string | max_stars_repo_name string | max_stars_count int64 | id string | content string | add_param_types int64 | add_return_types int64 | add_class_field_types int64 | add_instance_field_types int64 | add_total int64 | add_error int64 |
|---|---|---|---|---|---|---|---|---|---|---|
packs/packer/actions/validate.py | jonico/st2contrib | 164 | 3298848 | <reponame>jonico/st2contrib
from lib.actions import BaseAction
class ValidateAction(BaseAction):
def run(self, packerfile, cwd=None, exclude=None, only=None, variables=None,
variables_file=None):
if cwd:
self.set_dir(cwd)
p = self.packer(packerfile)
return p.valida... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_simplehttpplugin.py | danielrgullo/fauxmo | 318 | 3298881 | """test_simplehttpplugin.py :: Tests for SimpleHTTPPlugin."""
import json
import typing as t
from fauxmo.plugins.simplehttpplugin import SimpleHTTPPlugin
def test_simplehttpplugin(simplehttpplugin_target: t.Callable) -> None:
"""Test simplehttpplugin.
Uses the fauxmo_device fixture (runs httpbin) to emulat... | 3 | 2 | 0 | 0 | 5 | 0 |
python_modules/dagster/dagster/core/run_coordinator/queued_run_coordinator.py | dbatten5/dagster | 4,606 | 3298894 | <reponame>dbatten5/dagster
import logging
import time
from dagster import DagsterEvent, DagsterEventType, IntSource, String, check
from dagster.builtins import Bool
from dagster.config import Field
from dagster.config.config_type import Array, Noneable, ScalarUnion
from dagster.config.field_utils import Shape
from dag... | 0 | 0 | 0 | 0 | 0 | 0 |
bin/check_instance.py | tobyhodges/training-material | 224 | 3298904 | #!/usr/bin/env python
import os
import argparse
import yaml
from bioblend import galaxy
def check_instance(galaxy_url, tutorial_path):
""" Check if a given tutorial can be run on a given Galaxy instance """
# TODO: support specific revision checking
# TODO: discussion: for suites, encourage to list all t... | 0 | 0 | 0 | 0 | 0 | 0 |
native_client/buildbot/buildbot_toolchain_build.py | zipated/src | 2,151 | 3298907 | #!/usr/bin/python
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Main entry point for toolchain_build buildbots.
Passes its arguments to toolchain_build.py.
"""
import optparse
import os
imp... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/motor_tester/motor.py | Chrisyunhua/cantools | 1,063 | 3298928 | #!/usr/bin/env python3
#
# The "real" Motor node, transmitting the MotorStatus message
# periodically.
#
import struct
import can
def create_message(speed, load) -> object:
return can.Message(arbitration_id=0x010,
extended_id=False,
data=struct.pack('<HB', speed, load... | 0 | 1 | 0 | 0 | 1 | 0 |
tokenization/spacy_tokenization.py | evinaybit/100-Days-of-NLP | 239 | 3298937 | <filename>tokenization/spacy_tokenization.py<gh_stars>100-1000
"""
Tokenization using spacy
"""
import spacy
from spacy.symbols import ORTH
# direct use
nlp = spacy.load("en_core_web_sm")
text = '''Apple is looking at buying "U.K." startup for $1 billion!'''
doc = nlp(text)
print("\n======= Tokens =======")
# tokens... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/NeurIPS2020-Learning-to-Run-a-Power-Network-Challenge/track1/powernet_model.py | lp2333/PARL | 3,172 | 3298948 | <gh_stars>1000+
# Copyright (c) 2020 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... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/st/func/optimizer/conftest.py | fapbatista/mindinsight | 216 | 3298954 | # 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... | 0 | 0 | 0 | 0 | 0 | 0 |
src/envs/one_step_matrix_game.py | benellis3/pymarl2 | 401 | 3298958 | <reponame>benellis3/pymarl2<gh_stars>100-1000
from envs.multiagentenv import MultiAgentEnv
from utils.dict2namedtuple import convert
import numpy as np
import torch as th
# this non-monotonic matrix can be solved by qmix
payoff_values = [[12, -0.1, -0.1],
[-0.1, 0, 0],
[-0.1, 0,... | 0 | 0 | 0 | 0 | 0 | 0 |
Algorithms/Miscellaneous/Python/Sieve_of_Eratosthenes.py | abdzitter/Daily-Coding-DS-ALGO-Practice | 289 | 3298970 | <reponame>abdzitter/Daily-Coding-DS-ALGO-Practice<gh_stars>100-1000
# Python program to print all primes smaller than or equal to n using Sieve of Eratosthenes
# Time complexity : O(n*log(log(n)))
def SieveOfEratosthenes(n):
# Create a boolean array "prime[0..n]" and initialize all entries it as true.
p... | 0 | 0 | 0 | 0 | 0 | 0 |
extra_tests/cffi_tests/cffi1/test_dlopen_unicode_literals.py | nanjekyejoannah/pypy | 381 | 3299003 | # Generated by pypy/tool/import_cffi.py
import py, os
s = """from __future__ import unicode_literals
"""
with open(os.path.join(os.path.dirname(__file__), 'test_dlopen.py')) as f:
s += f.read()
exec(py.code.compile(s))
| 0 | 0 | 0 | 0 | 0 | 0 |
examples/research_projects/decision_transformer/run_decision_transformer.py | dctelus/transformers | 8,028 | 3299030 | <gh_stars>1000+
import numpy as np
import torch
import gym
from mujoco_py import GlfwContext
from transformers import DecisionTransformerModel
GlfwContext(offscreen=True) # Create a window to init GLFW.
def get_action(model, states, actions, rewards, returns_to_go, timesteps):
# we don't care about the past r... | 0 | 0 | 0 | 0 | 0 | 0 |
videoanalyst/engine/trainer/trainer_impl/distributed_regular_trainer.py | TragedyN/SiamFCpp | 737 | 3299054 | <filename>videoanalyst/engine/trainer/trainer_impl/distributed_regular_trainer.py<gh_stars>100-1000
# -*- coding: utf-8 -*
import copy
from collections import OrderedDict
from loguru import logger
from tqdm import tqdm
import torch
from torch import nn
from videoanalyst.utils import Timer, move_data_to_device
from ... | 0 | 0 | 0 | 0 | 0 | 0 |
mvpa2/cmdline/cmd_info.py | nno/PyMVPA | 227 | 3299071 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the PyMVPA package for the
# copyright and license terms.
#
### ### ### ### ###... | 0 | 0 | 0 | 0 | 0 | 0 |
DEPRECATED_PYTHON_SRC/main.py | 17701253801/firefly-proxy | 5,895 | 3299085 | import os
import sys
import json
import codecs
import shutil
import time
from datetime import datetime, date
import multiprocessing
import threading
if getattr(sys, 'frozen', False):
if sys.platform == "darwin":
rootdir = os.getcwd()
else:
rootdir = os.path.dirname(sys.executable)
else:
roo... | 0 | 0 | 0 | 0 | 0 | 0 |
pycharm2020.1.3/script/core/common/udp_test_cli.py | LaudateCorpus1/realtime-server | 465 | 3299102 | <gh_stars>100-1000
# import asyncio
# import time
# from typing import Optional
#
# from core.common import rudp
# from core.util.TimerHub import TimerHub
#
# import time
#
# from core.util.UtilApi import wait_or_not
#
# last_ts1 = time.time()
#
#
# class EchoClientProtocol:
# def __init__(self, message, on_con_los... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/exceptions/source/diagnose/syntax_error.py | ponponon/loguru | 11,391 | 3299113 | import sys
from loguru import logger
logger.remove()
logger.add(sys.stderr, format="", colorize=True, backtrace=False, diagnose=True)
code = """
if True:
a = 5
b = 7 *
"""
try:
exec(code)
except SyntaxError:
logger.exception("")
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_checkpoint.py | kevinzakka/torchkit | 144 | 3299132 | <reponame>kevinzakka/torchkit<filename>tests/test_checkpoint.py
import pytest
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchkit.checkpoint import Checkpoint, CheckpointManager
@pytest.fixture
def init_model_and_optimizer():
class SimpleMLP(nn.Module):
def __init__(self):
... | 0 | 0 | 0 | 0 | 0 | 0 |
mmdeploy/apis/extract_model.py | grimoire/mmdeploy | 746 | 3299145 | <reponame>grimoire/mmdeploy
# Copyright (c) OpenMMLab. All rights reserved.
from typing import Dict, Iterable, Optional, Union
import onnx
from .core import PIPELINE_MANAGER
from .onnx import extract_partition
@PIPELINE_MANAGER.register_pipeline()
def extract_model(model: Union[str, onnx.ModelProto],
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_patterns.py | Bogdanp/cursive_re | 332 | 3299158 | import cursive_re
from cursive_re import *
domain_name = one_or_more(any_of(in_range("a", "z") + in_range("0", "9") + text("-")))
domain = domain_name + zero_or_more(text(".") + domain_name)
path_segment = zero_or_more(none_of("/"))
path = zero_or_more(text("/") + path_segment)
url = (
group(one_or_more(any_of(in_... | 0 | 0 | 0 | 0 | 0 | 0 |
integration-tests/bot/chainrpc.py | trevor-crypto/thaler | 144 | 3299174 | <reponame>trevor-crypto/thaler
#!/usr/bin/env python3
import os
import getpass
import logging
import base64
import binascii
import json
import subprocess
import tempfile
from jsonrpcclient import request
from decouple import config
from chainbinding import RpcBinding
DEBUG_LEVEL = config('HTTP_DEBUG_LEVEL', 0, cast... | 0 | 0 | 0 | 0 | 0 | 0 |
config/sphere64_casia.py | bracca95/Probabilistic-Face-Embeddings | 312 | 3299196 | ''' Config Proto '''
import sys
import os
####### INPUT OUTPUT #######
# The name of the current model for output
name = 'sphere64_casia_am_PFE'
# The folder to save log and model
log_base_dir = './log/'
# The interval between writing summary
summary_interval = 100
# Training dataset path
train_dataset_path = ".... | 0 | 0 | 0 | 0 | 0 | 0 |
src/pyschedule/plotters/__init__.py | cutec-chris/pyschedule | 267 | 3299205 | #! /usr/bin/env python
'''
Copyright 2015 <NAME>
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Vers... | 0 | 0 | 0 | 0 | 0 | 0 |
DQM/L1TMonitorClient/python/L1TOccupancyClient_cfi.py | ckamtsikis/cmssw | 852 | 3299224 | import FWCore.ParameterSet.Config as cms
from DQMServices.Core.DQMEDHarvester import DQMEDHarvester
from DQM.L1TMonitorClient.L1TOccupancyTestParameters_cff import *
l1tOccupancyClient = DQMEDHarvester("L1TOccupancyClient",
verbose = cms.bool(False),
testParams = cms.VPSet(
#----------------------------------... | 0 | 0 | 0 | 0 | 0 | 0 |
Stock_Analysis/estimating_returns.py | vhn0912/Finance | 441 | 3299227 | <reponame>vhn0912/Finance
# imports
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import norm
import datetime as dt
from pandas_datareader import DataReader
import warnings
warnings.filterwarnings('ignore')
# parameters
stock = 'AAPL'
higher_bound = 0.3
lower_bound= 0.2
num_... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/hacker_news/hacker_news/ops/user_top_recommended_stories.py | rpatil524/dagster | 4,606 | 3299243 | import numpy as np
from dagster import Out, op
from hacker_news.ops.user_story_matrix import IndexedCooMatrix
from pandas import DataFrame
from scipy.sparse import coo_matrix, csc_matrix, csr_matrix
from sklearn.decomposition import TruncatedSVD
@op(
out=Out(
io_manager_key="warehouse_io_manager",
... | 2 | 1 | 0 | 0 | 3 | 0 |
NKUCodingCat/0002/0002.py | saurabh896/python-1 | 3,976 | 3299248 | #coding=utf-8
import os,MySQLdb,re
path = os.path.split(os.path.realpath(__file__))[0]+"/"
f = open(path+"code.txt","r")
A = f.read()
db = MySQLdb.connect("127.0.0.1","root","root","0002" )
cursor = db.cursor()
arr = re.split("\s+",A)
cursor.execute("DROP TABLE IF EXISTS CODE")
sql = """CREATE TABLE CODE (
no ... | 0 | 0 | 0 | 0 | 0 | 0 |
ppocr/modeling/backbones/rec_resnet_fpn.py | Bourne-M/PaddleOCR | 20,401 | 3299258 | <filename>ppocr/modeling/backbones/rec_resnet_fpn.py
#copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
#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/li... | 0 | 0 | 0 | 0 | 0 | 0 |
keylime/ca_impl_openssl.py | sergio-correia/keylime | 192 | 3299260 | from __future__ import annotations
'''
SPDX-License-Identifier: Apache-2.0
Copyright 2017 Massachusetts Institute of Technology.
'''
import datetime
from cryptography import x509
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.x509.oid impo... | 2 | 6 | 0 | 0 | 8 | 0 |
tasks/R2R-pano/models/policy_model.py | gregschuit/regretful-agent | 122 | 3299270 | from __future__ import annotations
import numpy as np
import torch
import torch.nn as nn
from models.modules import build_mlp, SoftAttention, PositionalEncoding, create_mask, proj_masking
class Regretful(nn.Module):
"""
The model for the regretful agent (CVPR 2019)
The Regretful Agent: Heuristic-Aided ... | 19 | 4 | 0 | 2 | 25 | 0 |
solutions/problem_358.py | ksvr444/daily-coding-problem | 1,921 | 3299289 | <filename>solutions/problem_358.py
import sys
class ValueSet:
def __init__(self):
self.keys = set()
self.prev = None
self.next = None
class MagicStruct:
def __init__(self):
self.keys = dict()
self.values = dict()
self.values[0] = ValueSet()
self.values... | 0 | 0 | 0 | 0 | 0 | 0 |
cartoframes/data/services/__init__.py | CartoDB/cartoframes | 236 | 3299290 | from .geocoding import Geocoding
from .isolines import Isolines
__all__ = [
'Geocoding',
'Isolines'
]
| 0 | 0 | 0 | 0 | 0 | 0 |
books/PRML/PRML-master-Python/prml/nn/linalg/logdet.py | iamfaith/DeepLearning | 7,581 | 3299291 | <reponame>iamfaith/DeepLearning<filename>books/PRML/PRML-master-Python/prml/nn/linalg/logdet.py<gh_stars>1000+
import numpy as np
from prml.nn.tensor.constant import Constant
from prml.nn.tensor.tensor import Tensor
from prml.nn.function import Function
class LogDeterminant(Function):
def forward(self, x):
... | 0 | 0 | 0 | 0 | 0 | 0 |
eve/tests/io/__init__.py | checkaayush/eve | 3,122 | 3299301 | # -*- coding: utf-8 -*-
# import hack so modules importing this package can still import BytesIO from
# standard library's io module
from io import BytesIO # noqa
| 0 | 0 | 0 | 0 | 0 | 0 |
analysis/kipf_welling_GCN/cast_arxivdata_into_right_form.py | maxwellyin/arxiv-public-datasets | 217 | 3299308 | <reponame>maxwellyin/arxiv-public-datasets
""" Put arXiv data into right form for the GCN """
import sys
sys.path.append('..')
import numpy as np
import matplotlib.pyplot as plt
import networkx as nx
import arxiv_public_data.tests.intra_citation as ia
import time, json, gzip
import pickle as pkl
from arxiv_public_dat... | 0 | 0 | 0 | 0 | 0 | 0 |
AutoDL_sample_code_submission/Auto_Tabular/utils/sample.py | dianjixz/AutoDL | 1,044 | 3299321 | import numpy as np
import random
import os
from .eda import AutoEDA
from .data_utils import ohe2cat
from .log_utils import info, debug
class AutoSample:
def __init__(self, y_onehot):
self.auto_eda = AutoEDA()
self.y_onehot = y_onehot
self.sample_num, self.class_num = y_onehot.shape
... | 2 | 2 | 0 | 0 | 4 | 0 |
alphastarmini/lib/config.py | liuruoze/mini-AlphaStar | 108 | 3299353 | <gh_stars>100-1000
from pysc2.lib import actions as sc2_actions
from pysc2.lib import features
__author__ = "<NAME>"
debug = True
# Minimap index
_M_HEIGHT = features.MINIMAP_FEATURES.height_map.index
_M_VISIBILITY = features.MINIMAP_FEATURES.visibility_map.index
_M_CAMERA = features.MINIMAP_FEATURES.camer... | 0 | 0 | 0 | 0 | 0 | 0 |
matminer/featurizers/structure/sites.py | ncfrey/matminer | 326 | 3299359 | from __future__ import annotations
"""
Structure featurizers based on aggregating site features.
"""
import numpy as np
from pymatgen.analysis.local_env import VoronoiNN
from matminer.featurizers.base import BaseFeaturizer
from matminer.featurizers.site import (
OPSiteFingerprint,
CoordinationNumber,
Loca... | 5 | 7 | 0 | 0 | 12 | 0 |
homeassistant/components/trafikverket_weatherstation/sensor.py | liangleslie/core | 30,023 | 3299360 | """Weather information for air and road temperature (by Trafikverket)."""
from __future__ import annotations
from dataclasses import dataclass
from datetime import datetime
from homeassistant.components.sensor import (
SensorDeviceClass,
SensorEntity,
SensorEntityDescription,
SensorStateClass,
)
from ... | 8 | 5 | 5 | 2 | 20 | 0 |
tests/test_circuit/test_inspect.py | leonardt/magma | 167 | 3299383 | import magma as m
class And2(m.Circuit):
name: str = "And2"
io = m.IO(I0=m.In(m.Bit), I1=m.In(m.Bit), O=m.Out(m.Bit))
def test_str_repr_core():
#Dont care what values they return as long as they retun non empty strings
assert str(m.Circuit)
assert repr(m.Circuit)
assert str(m.circuit.Circuit... | 0 | 0 | 1 | 0 | 1 | 0 |
TopQuarkAnalysis/TopEventProducers/python/producers/TtGenEvtProducer_cfi.py | ckamtsikis/cmssw | 852 | 3299425 | <gh_stars>100-1000
import FWCore.ParameterSet.Config as cms
#
# module to combine the persistent genParticles
# from the top decay and top mothers
#
genEvt = cms.EDProducer("TtGenEventReco",
src = cms.InputTag("decaySubset"),
init = cms.InputTag("initSubset")
)
| 0 | 0 | 0 | 0 | 0 | 0 |
src/gamemodes/guardian.py | iamgreaser/lykos | 122 | 3299431 | from src.gamemodes import game_mode, GameMode, InvalidModeException
from src.messages import messages
from src.functions import get_players
from src.events import EventListener
from src import channels, users
# original idea by Rossweisse, implemented by Vgr with help from woffle and jacob1
@game_mode("guardian", minp... | 1 | 1 | 0 | 4 | 6 | 0 |
torch/nn/quantized/dynamic/__init__.py | Hacky-DH/pytorch | 60,067 | 3299435 | <reponame>Hacky-DH/pytorch
from .modules import * # noqa: F403
| 0 | 0 | 0 | 0 | 0 | 0 |
lemur/plugins/lemur_email/templates/config.py | rajatsharma94/lemur | 1,656 | 3299452 | import os
import arrow
from jinja2 import Environment, FileSystemLoader, select_autoescape
from lemur.plugins.utils import get_plugin_option
loader = FileSystemLoader(searchpath=os.path.dirname(os.path.realpath(__file__)))
env = Environment(
loader=loader, # nosec: potentially dangerous types esc.
autoescape... | 0 | 3 | 0 | 0 | 3 | 0 |
chrome/test/functional/rlz/rlztest.py | nagineni/chromium-crosswalk | 231 | 3299453 | #!/usr/bin/env python
# Copyright (c) 2011 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.
import chromium_proxy_server_ex
import commands
import logging
import optparse
import os
import re
import selenium.selenium
import ... | 0 | 0 | 0 | 0 | 0 | 0 |
scvi/data/_built_in_data/_smfish.py | Koncopd/scvi-tools | 398 | 3299480 | <filename>scvi/data/_built_in_data/_smfish.py
import logging
import os
import anndata
import numpy as np
import pandas as pd
from scvi.data._download import _download
logger = logging.getLogger(__name__)
_subtype_to_high_level_mapping = {
"Astrocytes": ("Astrocyte Gfap", "Astrocyte Mfge8"),
"Endothelials": ... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/build_mod_picoblade.py | philcrump/agg-kicad | 150 | 3299491 | <filename>scripts/build_mod_picoblade.py
"""
build_mod_picoblade.py
Copyright 2019 <NAME>
Licensed under the MIT licence, see LICENSE file for details.
Generate foorprints for Molex Picoblade connectors.
"""
from __future__ import print_function, division
import os
import sys
import time
import math
import argparse
... | 0 | 0 | 0 | 0 | 0 | 0 |
pyoutline/outline/loader.py | prOOrc/OpenCue | 334 | 3299497 | <filename>pyoutline/outline/loader.py<gh_stars>100-1000
# Copyright Contributors to the OpenCue Project
#
# 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/licens... | 0 | 0 | 0 | 0 | 0 | 0 |
benchmark/python/gluon/benchmark_gluon.py | Vikas-kum/incubator-mxnet | 228 | 3299502 | <filename>benchmark/python/gluon/benchmark_gluon.py
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache L... | 0 | 0 | 0 | 0 | 0 | 0 |
utils.py | ChenChengKuan/SeqGAN_tensorflow | 108 | 3299546 | <filename>utils.py
import numpy as np
def generate_samples(sess, trainable_model, batch_size, generated_num, output_file):
# Generate Samples
generated_samples = []
for _ in range(int(generated_num / batch_size)):
generated_samples.extend(trainable_model.generate(sess))
with open(output_file, '... | 0 | 0 | 0 | 0 | 0 | 0 |
xfel/command_line/metrology.py | dperl-sol/cctbx_project | 155 | 3299604 | <filename>xfel/command_line/metrology.py
#
# LIBTBX_SET_DISPATCHER_NAME cspad.metrology
#
from __future__ import absolute_import, division, print_function
from scipy.optimize import leastsq # special import
from xfel.metrology.mark10 import fit_translation4
from libtbx.utils import Sorry
import os.path
master_phil=""... | 0 | 0 | 0 | 0 | 0 | 0 |
chrome/test/functional/shortcuts.py | Scopetta197/chromium | 212 | 3299606 | <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.
import os
import re
import pyauto_functional
import pyauto
class ShortcutsTest(pyauto.PyUITest):
"""Test fo... | 0 | 0 | 0 | 0 | 0 | 0 |
baselines/sac/engine.py | zuoxingdong/lagom | 383 | 3299608 | <gh_stars>100-1000
import time
from itertools import count
import torch
from lagom import Logger
from lagom import BaseEngine
from lagom.transform import describe
from lagom.utils import color_str
class Engine(BaseEngine):
def train(self, n=None, **kwargs):
train_logs, eval_logs = [], []
checkpoi... | 0 | 0 | 0 | 0 | 0 | 0 |
packs/qualys/actions/add_hosts.py | userlocalhost2000/st2contrib | 164 | 3299617 | from lib.base import QualysBaseAction
__all__ = [
'AddHostsAction'
]
class AddHostsAction(QualysBaseAction):
def run(self, hosts, vulnerability_management, policy_compliance) -> object:
if policy_compliance and vulnerability_management:
host_type = 'both'
elif policy_compliance an... | 0 | 1 | 0 | 0 | 1 | 0 |
tests/examples/todomvc/pagemodules_approach/pages/tasks.py | pupsikpic/selene | 572 | 3299635 | <reponame>pupsikpic/selene
from selene import by, be
from selene.support.conditions import have
from selene.support.shared import browser
__author__ = 'yashaka'
_elements = browser.all("#todo-list>li")
app_url = 'https://todomvc4tasj.herokuapp.com/'
def visit():
browser.open(app_url)
clear_completed_js_loa... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/common.py | Michae1Weiss/spectree | 183 | 3299647 | from enum import Enum, IntEnum
from typing import Dict, List
from pydantic import BaseModel, Field, root_validator
from spectree import SecurityScheme, Tag
api_tag = Tag(name="API", description="🐱", externalDocs={"url": "https://pypi.org"})
class Order(IntEnum):
asce: int = 1
desc: int = 0
class Query(B... | 0 | 2 | 17 | 0 | 19 | 0 |
trading_calendars/exchange_calendar_xcse.py | sjquant/trading_calendars | 508 | 3299665 | <gh_stars>100-1000
#
# Copyright 2018 Quantopian, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 0 | 0 | 0 | 0 | 0 | 0 |
functional_tests/code-save/log-code/subdir/another-lib.py | borisgrafx/client | 3,968 | 3299669 | <reponame>borisgrafx/client
"""Also nothing here"""
| 0 | 0 | 0 | 0 | 0 | 0 |
_examples/gopygc/test.py | pombredanne/go-python-gopy | 1,372 | 3299818 | # Copyright 2020 The go-python Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
# py2/py3 compat
from __future__ import print_function
import gopygc
import _gopygc
print(_gopygc.NumHandles())
# test literals
a = gopygc.StructA()
b ... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/plot_ts.py | jmrichardson/pyts | 1,217 | 3299833 | <filename>examples/plot_ts.py
"""
======================
Plotting a time series
======================
Visualizing data is important and should usually be the first step in any
analysis. This simple example shows how to plot a single time series.
"""
# Author: <NAME> <<EMAIL>>
# License: BSD-3-Clause
import numpy as... | 0 | 0 | 0 | 0 | 0 | 0 |
pytest_asyncio/__init__.py | sobolevn/pytest-asyncio | 933 | 3299842 | """The main point for importing pytest-asyncio items."""
__version__ = "0.16.0"
| 0 | 0 | 0 | 0 | 0 | 0 |
velocyto/commands/run.py | subercui/velocyto.py | 119 | 3299857 | <gh_stars>100-1000
import sys
import os
import glob
import re
import click
import numpy as np
import random
import string
import logging
from typing import *
import velocyto as vcy
from ._run import _run
# logging.basicConfig(stream=sys.stdout, format='%(asctime)s - %(levelname)s - %(message)s', level=logging.DEBUG)
... | 0 | 0 | 0 | 0 | 0 | 0 |
exceptions/ZeroBucketsFoundException.py | houey/SkyWrapper | 106 | 3299904 | class ZeroBucketsFoundException(Exception):
pass | 0 | 0 | 0 | 0 | 0 | 0 |
ghostwriter/shepherd/migrations/0002_auto_20190726_1841.py | bbhunter/Ghostwriter | 601 | 3299927 | # Generated by Django 2.2.3 on 2019-07-26 18:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies: list[tuple[str, str]] = [
('shepherd', '0001_initial'),
]
operations: list[object] = [
migrations.AlterField(
model_name='serverprovi... | 0 | 0 | 2 | 0 | 2 | 0 |
terrascript/provider/sethvargo/berglas.py | mjuenema/python-terrascript | 507 | 3299936 | # terrascript/provider/sethvargo/berglas.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:13:20 UTC)
import terrascript
class berglas(terrascript.Provider):
"""A Terraform provider for Berglas"""
__description__: str = "A Terraform provider for Berglas"
__namespace__: str = "sethvargo"
... | 0 | 0 | 7 | 0 | 7 | 0 |
tests/forms_tests/widget_tests/test_textarea.py | ni-ning/django | 61,676 | 3299942 | <reponame>ni-ning/django<filename>tests/forms_tests/widget_tests/test_textarea.py
from django.forms import Textarea
from django.utils.safestring import mark_safe
from .base import WidgetTest
class TextareaTest(WidgetTest):
widget = Textarea()
def test_render(self):
self.check_html(self.widget, 'msg'... | 0 | 0 | 0 | 0 | 0 | 0 |
anteater/src/project_scan.py | anteater/anteater | 177 | 3299953 | <reponame>anteater/anteater<filename>anteater/src/project_scan.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################################
# Copyright (c) 2017 <NAME> <<EMAIL>>
#
# All rights reserved. This program and the accompanying materials
# are made available u... | 0 | 0 | 0 | 0 | 0 | 0 |
src/cozmo/event.py | rootless4real/cozmo-python-sdk | 794 | 3299963 | <reponame>rootless4real/cozmo-python-sdk<filename>src/cozmo/event.py
# Copyright (c) 2016 Anki, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License in the file LICENSE.txt or at
#
# http://... | 0 | 0 | 0 | 0 | 0 | 0 |
tutorial/hello_query.py | q0w/snug | 123 | 3299965 | <reponame>q0w/snug
import json
import snug
def repo(name: str, owner: str) -> snug.Query[dict]:
"""a repo lookup by owner and name"""
request = snug.GET(f'https://api.github.com/repos/{owner}/{name}')
response = yield request
return json.loads(response.content)
| 0 | 0 | 0 | 0 | 0 | 0 |
slack_bolt/logger/messages.py | hirosassa/bolt-python | 504 | 3299975 | import time
from typing import Union, Dict, Any, Optional
from slack_sdk.web import SlackResponse
from slack_bolt.request import BoltRequest
from slack_bolt.request.payload_utils import (
is_action,
is_event,
is_options,
is_shortcut,
is_slash_command,
is_view,
is_workflow_step_edit,
is... | 22 | 28 | 0 | 0 | 50 | 0 |
observations/r/bomregions.py | hajime9652/observations | 199 | 3299983 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import numpy as np
import os
import sys
from observations.util import maybe_download_and_extract
def bomregions(path) -> tuple[object, object]:
"""Australian and Related ... | 0 | 1 | 0 | 0 | 1 | 0 |
homeassistant/components/nexia/const.py | liangleslie/core | 30,023 | 3300015 | """Nexia constants."""
from homeassistant.const import Platform
PLATFORMS = [
Platform.SENSOR,
Platform.BINARY_SENSOR,
Platform.CLIMATE,
Platform.SCENE,
Platform.SWITCH,
]
ATTRIBUTION = "Data provided by Trane Technologies"
CONF_BRAND = "brand"
DOMAIN = "nexia"
ATTR_DESCRIPTION = "description"
... | 0 | 0 | 0 | 0 | 0 | 0 |
utime/preprocessing/dataset_preparation/phys/__init__.py | learning310/U-Time | 138 | 3300031 | <filename>utime/preprocessing/dataset_preparation/phys/__init__.py
from .phys import download_phys, preprocess_phys_hypnograms
| 0 | 0 | 0 | 0 | 0 | 0 |
wandb/plot/line_series.py | borisgrafx/client | 3,968 | 3300040 | from __future__ import annotations
from six.moves.collections_abc import Sequence
import wandb
def line_series(xs, ys, keys: object | None=None, title: object | None=None, xname: object | None=None) -> object:
"""
Construct a line series plot.
Arguments:
xs (array of arrays, or array): Array of a... | 3 | 1 | 0 | 0 | 4 | 0 |
plenum/test/node_request/test_pre_prepare/test_pp_obsolescence_check_pass_for_stashed.py | andkononykhin/plenum | 148 | 3300072 | import pytest
from plenum.test import waits
from plenum.common.constants import LEDGER_STATUS, AUDIT_LEDGER_ID
from plenum.common.messages.node_messages import MessageRep, MessageReq, CatchupReq
from plenum.server.catchup.node_leecher_service import NodeLeecherService
from plenum.test.delayers import DEFAULT_DELAY
fro... | 0 | 4 | 0 | 0 | 4 | 0 |
applications/MeshMovingApplication/tests/test_impose_mesh_motion_process.py | lkusch/Kratos | 778 | 3300074 | # Kratos Imports
import KratosMultiphysics
from KratosMultiphysics.MeshMovingApplication.impose_mesh_motion_process import ImposeMeshMotionProcess
import KratosMultiphysics.KratosUnittest as KratosUnittest
def GenerateModel() -> tuple[object, object]:
model = KratosMultiphysics.Model()
model_part = model.Cre... | 1 | 1 | 0 | 0 | 2 | 0 |
cflearn/models/ml/mixer.py | carefree0910/carefree-learn | 400 | 3300082 | from typing import Any
from typing import Dict
from typing import Optional
from .protocol import MERGED_KEY
from .protocol import MixedStackedModel
from ..bases import BAKEBase
from ..bases import RDropoutBase
from ...types import tensor_dict_type
from ...protocol import TrainerState
from ...constants import INPUT_KEY... | 36 | 2 | 0 | 0 | 38 | 0 |
applications/migrations/0004_add_on_delete.py | vanessa/djangogirls | 446 | 3300084 | # Generated by Django 2.0 on 2017-12-17 11:44
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies: list[tuple[str, str]] = [
('applications', '0003_auto_20180529_0016'),
]
operations: list... | 0 | 0 | 2 | 0 | 2 | 0 |
src/netius/common/structures.py | timgates42/netius | 107 | 3300097 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Hive Netius System
# Copyright (c) 2008-2020 Hive Solutions Lda.
#
# This file is part of Hive Netius System.
#
# Hive Netius System is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by the Apache
# Foun... | 1 | 3 | 0 | 0 | 4 | 0 |
scripts/evaluate_predator.py | ShengyuH/PredateOverlap | 153 | 3300101 | """
Scripts for pairwise registration with RANSAC and our probabilistic sampling
Author: <NAME>
Last modified: 30.11.2020
"""
import torch, os, sys, glob
cwd = os.getcwd()
sys.path.append(cwd)
from tqdm import tqdm
import numpy as np
from lib.utils import load_obj, natural_key,setup_seed
from lib.benchmark_utils imp... | 2 | 1 | 0 | 0 | 3 | 0 |
unicorn-examples/mouse/mouse.py | Gogopex/UnicornConsole | 250 | 3300134 | <reponame>Gogopex/UnicornConsole<filename>unicorn-examples/mouse/mouse.py<gh_stars>100-1000
#unicorn / python cartridge
#version 1
#__python__
RED = 8
BLUE = 12
def _init():
pass
def _update():
pass
def _draw():
cls()
mx = mouse_x()
my = mouse_y()
unicorn_print("mouse-x: %d" % mx, 0, 0,... | 0 | 0 | 0 | 0 | 0 | 0 |
util/__init__.py | OmkarThawakar/SeqFormer-1 | 223 | 3300138 | <reponame>OmkarThawakar/SeqFormer-1<gh_stars>100-1000
# ------------------------------------------------------------------------
# SeqFormer
# ------------------------------------------------------------------------
# Modified from Deformable DETR (https://github.com/fundamentalvision/Deformable-DETR)
# Copyright (c) 2... | 0 | 0 | 0 | 0 | 0 | 0 |
jacinle/utils/naming.py | dapatil211/Jacinle | 114 | 3300160 | <filename>jacinle/utils/naming.py
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# File : naming.py
# Author : <NAME>
# Email : <EMAIL>
# Date : 01/18/2017
#
# This file is part of Jacinle.
# Distributed under terms of the MIT license.
__all__ = ['class_name', 'func_name', 'method_name', 'class_name_of_method']
... | 0 | 0 | 0 | 0 | 0 | 0 |
Chapter07/config.py | jayakumardhananjayan/pythonwebtut | 135 | 3300168 | <reponame>jayakumardhananjayan/pythonwebtut<filename>Chapter07/config.py
class Config(object):
SECRET_KEY = '736670cb10a600b695a55839ca3a5aa54a7d7356cdef815d2ad6e19a2031182b'
RECAPTCHA_PUBLIC_KEY = "<KEY>"
RECAPTCHA_PRIVATE_KEY = '<KEY>'
POSTS_PER_PAGE = 10
TWITTER_API_KEY = "XXXX"
TWITTER_API_... | 0 | 0 | 0 | 0 | 0 | 0 |
slimta/relay/smtp/lmtpclient.py | nanojob/python-slimta | 141 | 3300174 | <reponame>nanojob/python-slimta<gh_stars>100-1000
# Copyright (c) 2014 <NAME>
#
# 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
# ... | 0 | 0 | 0 | 0 | 0 | 0 |
Accelerators/GANs/gan.py | Gjacquenot/training-material | 115 | 3300197 | #!/usr/bin/env python
from argparse import ArgumentParser
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
import numpy as np
from skimage.io import imsave
import os
import shutil
img_height = 28
img_width = 28
img_size = img_height * img_width
h1_size = 150
h2_size = 300
z_size = ... | 2 | 3 | 0 | 0 | 5 | 0 |
hl7apy/v2_2/datatypes.py | ryoung29/hl7apy | 163 | 3300198 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012-2018, CRS4
#
# 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
... | 0 | 0 | 0 | 0 | 0 | 0 |
UNITTESTS/unit_test/new.py | pattyolanterns/mbed-os | 3,897 | 3300212 | <reponame>pattyolanterns/mbed-os<gh_stars>1000+
"""
Copyright (c) 2018, Arm Limited
SPDX-License-Identifier: Apache-2.0
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/lic... | 0 | 0 | 0 | 0 | 0 | 0 |
visualize/plot_all.py | yttdebaba2/meta-learning-lstm | 349 | 3300235 | import matplotlib.pyplot as plt
import sys
def readFile(fileName) -> tuple[object, object, object, object]:
iters = []
train_vals = []
oneShot_vals = []
fiveShot_vals = []
with open(fileName) as f:
iterFound = False
trainFound = False
oneFound = False
iteration = 0
for li... | 0 | 1 | 0 | 0 | 1 | 0 |
wagtail/documents/views/bulk_actions/document_bulk_action.py | melisayu/wagtail | 8,851 | 3300243 | <filename>wagtail/documents/views/bulk_actions/document_bulk_action.py
from wagtail.admin.views.bulk_action import BulkAction
from wagtail.documents import get_document_model
from wagtail.documents.permissions import permission_policy as documents_permission_policy
class DocumentBulkAction(BulkAction):
permission... | 0 | 0 | 0 | 0 | 0 | 0 |
machine/ml_data1.py | commoncdp2021/Gun-Gaja-Gun | 171 | 3300258 | {'Terminator': {'Tom': 4.0,
'Jack': 1.5,
'Lisa': 3.0,
'Sally': 2.0},
'Terminator 2': {'Tom': 5.0,
'Jack' : 1.0,
'Lisa': 3.5,
'Sally': 2.0},
'It happened one night': {'Tom': 3.5,
'Jack': 3.5,
'Tiger': 4.0,
'Lisa': 5.0,
'Michele': 3.0,
'Sally': 4.0,},
'27 Dresses': {'Tom': 3.0,
'Jack':... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/unit/test_modulegraph/testpkg-regr4/pkg/core/listenerimpl.py | hawkhai/pyinstaller | 9,267 | 3300259 | <gh_stars>1000+
""" pkg.listenerimp """
class Listener:
pass
class ListenerValidator:
pass
| 0 | 0 | 0 | 0 | 0 | 0 |
ckan/cli/__init__.py | gg2/ckan | 2,805 | 3300270 | # encoding: utf-8
from __future__ import annotations
import os
import click
import logging
from logging.config import fileConfig as loggingFileConfig
from configparser import ConfigParser, RawConfigParser
from ckan.exceptions import CkanConfigurationException
log = logging.getLogger(__name__)
class CKANConfigLoad... | 1 | 3 | 0 | 2 | 6 | 0 |
pkg/tests/test_nan_inf.py | sdrees/pyvtreat | 104 | 3300325 | import numpy.random
import pandas
import numpy
import vtreat # https://github.com/WinVector/pyvtreat
import vtreat.util
def test_nan_inf():
numpy.random.seed(235)
d = pandas.DataFrame(
{"x": [1.0, numpy.nan, numpy.inf, -numpy.inf, None, 0], "y": [1, 2, 3, 4, 5, 6]}
)
transform = vtreat.Numer... | 0 | 0 | 0 | 0 | 0 | 0 |
docs/doxyrest/sphinx/doxyrest.py | jayrulez/eepp | 304 | 3300336 | <gh_stars>100-1000
#...............................................................................
#
# This file is part of the Doxyrest toolkit.
#
# Doxyrest is distributed under the MIT license.
# For details see accompanying license.txt file,
# the public copy of which is also available at:
# http://tibbo.com/... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/xbr/test_register.py | rapyuta-robotics/autobahn-python | 1,670 | 3300338 | import sys
import argparse
import web3
from autobahn import xbr
from test_accounts import addr_owner, addr_alice_market, addr_alice_market_maker1, addr_bob_market, addr_bob_market_maker1, \
addr_charlie_provider, addr_charlie_provider_delegate1, addr_donald_provider, addr_donald_provider_delegate1, \
addr_ed... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_finger.py | listuser/jc | 3,215 | 3300341 | <reponame>listuser/jc
import os
import json
import unittest
import jc.parsers.finger
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
class MyTests(unittest.TestCase):
def setUp(self):
# input
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/finger.out'), 'r', encoding... | 0 | 0 | 0 | 0 | 0 | 0 |
pypeln/sync/stage.py | quarckster/pypeln | 1,281 | 3300343 | <gh_stars>1000+
import inspect
import sys
import traceback
from collections import namedtuple
from queue import Queue
from threading import Lock, Thread
import typing as tp
import stopit
from pypeln import utils as pypeln_utils
from pypeln.utils import T, Kwargs
from dataclasses import dataclass
from . import utils
... | 0 | 0 | 0 | 0 | 0 | 0 |
lib/train/dataset/imagenetvid_lmdb.py | tzhhhh123/Stark | 376 | 3300350 | from __future__ import annotations
import os
from .base_video_dataset import BaseVideoDataset
from lib.train.data import jpeg4py_loader
import torch
from collections import OrderedDict
from lib.train.admin import env_settings
from lib.utils.lmdb_utils import decode_img, decode_json
def get_target_to_image_ratio(seq) ... | 4 | 6 | 0 | 0 | 10 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.