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 |
|---|---|---|---|---|
generator/modules/__module__.py | vv111y/deepo | 6,560 | 12674065 | # -*- coding: utf-8 -*-
def parametrized(dec):
def layer(*args, **kwargs):
def repl(f):
return dec(f, *args, **kwargs)
return repl
return layer
@parametrized
def dependency(module, *_deps):
module.deps = _deps
return module
@parametrized
def source(module, _source):
... |
Validation/HGCalValidation/python/HGVHistoProducerAlgoBlock_cfi.py | Purva-Chaudhari/cmssw | 852 | 12674073 | <filename>Validation/HGCalValidation/python/HGVHistoProducerAlgoBlock_cfi.py
import FWCore.ParameterSet.Config as cms
HGVHistoProducerAlgoBlock = cms.PSet(
minEta = cms.double(-4.5),
maxEta = cms.double(4.5),
nintEta = cms.int32(100),
useFabsEta = cms.bool(False),
#parameters for energy
minEne... |
alexa/listService/listService.py | eifinger/appdaemon-scripts | 122 | 12674086 | import appdaemon.plugins.hass.hassapi as hass
#
# Provide the list of HA entities for Alexa Apps
#
#
# Args:
#
# switchable: dict of switchable entities
# temperature: dict of temperature sensors
# door: dict of reed sensors showing if the door is completely open
# door_tilted: dict of reed sensors showing if a door i... |
src/rayoptics/elem/elements.py | diplodocuslongus/ray-optics | 106 | 12674100 | <gh_stars>100-1000
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright © 2018 <NAME>
""" Module for element modeling
.. Created on Sun Jan 28 16:27:01 2018
.. codeauthor: <NAME>
"""
from collections import namedtuple
import itertools
from packaging import version
import numpy as np
from anytree import Node
... |
fireworks/user_objects/firetasks/tests/test_filepad_tasks.py | jmmshn/fireworks | 251 | 12674102 | __author__ = "<NAME>, <NAME>"
import os
import unittest
from ruamel.yaml import YAML
from fireworks.user_objects.firetasks.filepad_tasks import (
AddFilesTask,
DeleteFilesTask,
GetFilesByQueryTask,
GetFilesTask,
)
from fireworks.utilities.filepad import FilePad
module_dir = os.path.abspath(os.path.d... |
var/spack/repos/builtin/packages/r-insight/package.py | LiamBindle/spack | 2,360 | 12674103 | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RInsight(RPackage):
"""Easy Access to Model Information for Various Model Objects
A t... |
config_files/sthv1/tsm_baseline.py | shreyas-bk/TPN | 353 | 12674133 | model = dict(
type='TSN2D',
backbone=dict(
type='ResNet',
pretrained='modelzoo://resnet50',
nsegments=8,
depth=50,
out_indices=(3,),
tsm=True,
bn_eval=False,
partial_bn=False),
spatial_temporal_module=dict(
type='SimpleSpatialModule',
... |
app/main/routes_picoferm_api.py | zuiko42/picobrew_pico | 142 | 12674140 | <gh_stars>100-1000
import json
from datetime import datetime
from flask import current_app, send_from_directory
from webargs import fields
from webargs.flaskparser import use_args, FlaskParser
from . import main
from .. import socketio
from .config import ferm_active_sessions_path, picoferm_firmware_path, Mach... |
vtrace/notifiers.py | rnui2k/vivisect | 716 | 12674143 | <filename>vtrace/notifiers.py
"""
Vtrace notitifers base classes and examples
Vtrace supports the idea of callback notifiers which
get called whenever particular events occur in the target
process. Notifiers may be registered to recieve a callback
on any of the vtrace.NOTIFY_FOO events from vtrace. One notifier
*may... |
venv/lib/python3.8/site-packages/pylint/extensions/_check_docs_utils.py | DiegoSilvaHoffmann/Small-Ecommerce | 463 | 12674161 | <reponame>DiegoSilvaHoffmann/Small-Ecommerce
# Copyright (c) 2016-2020 <NAME> <<EMAIL>>
# Copyright (c) 2016-2019 <NAME> <<EMAIL>>
# Copyright (c) 2016 <NAME> <<EMAIL>>
# Copyright (c) 2016 <NAME> <<EMAIL>>
# Copyright (c) 2016 <NAME> <<EMAIL>>
# Copyright (c) 2017, 2020 hippo91 <<EMAIL>>
# Copyright (c) 2017 Mitar <<E... |
esrally/utils/net.py | Kua-Fu/rally | 1,577 | 12674182 | # Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... |
python3-alpha/extra_modules/bs4/builder/_htmlparser.py | stormtheh4ck3r/python-for-android | 267 | 12674194 | """Use the HTMLParser library to parse HTML files that aren't too bad."""
__all__ = [
'HTMLParserTreeBuilder',
]
from html.parser import HTMLParser
import sys
# Starting in Python 3.2, the HTMLParser constructor takes a 'strict'
# argument, which we'd like to set to False. Unfortunately,
# http://bugs.python... |
Examples/Tests/particle_pusher/analysis_pusher.py | ruohai0925/artemis | 131 | 12674215 | <gh_stars>100-1000
#! /usr/bin/env python
# Copyright 2019 <NAME>
#
# This file is part of WarpX.
#
# License: BSD-3-Clause-LBNL
# This script tests the particle pusher (HC)
# using a force-free field,
# in which position x should remain 0.
# An initial velocity Vy corresponding to
# Lorentz factor = 20 is used.
# B... |
skiing-huabei/utils/email_warning.py | OneCodeMonkey/spider-suites | 3,649 | 12674216 | <reponame>OneCodeMonkey/spider-suites
from traceback import format_tb
import smtplib
from email.header import Header
from email.mime.text import MIMEText
from email.utils import (
parseaddr, formataddr)
from config import get_email_args
from logger import other
email_args = get_email_args()
smtp_server = email_... |
meter/daemon/master_v1.py | anbo225/docklet | 273 | 12674237 | import subprocess, os
def http_client_post(ip, port, url, entries = {}):
import urllib.request, urllib.parse, json
url = url if not url.startswith('/') else url[1:]
response = urllib.request.urlopen('http://%s:%d/%s' % (ip, port, url), urllib.parse.urlencode(entries).encode())
obj = json.loads(response.read().deco... |
apps/__init__.py | PyCN/BlogBackendProject | 335 | 12674244 | <filename>apps/__init__.py
# _*_ coding: utf-8 _*_
__author__ = 'LennonChin'
__date__ = '2017/11/27 23:38' |
terrascript/provider/NetApp/netapp_elementsw.py | mjuenema/python-terrascript | 507 | 12674275 | <filename>terrascript/provider/NetApp/netapp_elementsw.py
# terrascript/provider/NetApp/netapp_elementsw.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:22:13 UTC)
import terrascript
class netapp_elementsw(terrascript.Provider):
"""Support for Volume, Initiator, Account, and Volume Access Group... |
fuzzymatcher/scorer_default.py | nikoAguilar/fuzzymatcher_edit | 218 | 12674277 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
import pandas as pd
from collections import Counter
from itertools import chain, product
from operator import mul
from functools import reduce
from math import log10
from functools import lru_cache
import logging
log = logging.getLogger(__name__)
from fuzzymatcher.utils impo... |
faker/providers/internet/sk_SK/__init__.py | StabbarN/faker | 12,077 | 12674283 | from .. import Provider as InternetProvider
class Provider(InternetProvider):
user_name_formats = (
'{{last_name_female}}.{{first_name_female}}',
'{{last_name_female}}.{{first_name_female}}',
'{{last_name_male}}.{{first_name_male}}',
'{{last_name_male}}.{{first_name_male}}',
... |
src/config.py | eco999/VALORANT-rank-yoinker | 107 | 12674294 | import json
from io import TextIOWrapper
from json import JSONDecodeError
import requests
import os
from src.logs import Logging
class Config:
def __init__(self, log):
self.log = log
if not os.path.exists("config.json"):
self.log("config.json not found, creating new one")
... |
exercises/fr/exc_01_08_02.py | Jette16/spacy-course | 2,085 | 12674298 | import spacy
nlp = spacy.load("fr_core_news_sm")
text = "Apple a été créée en 1976 par <NAME>, <NAME> et <NAME>."
# Traite le texte
doc = ____
# Itère sur les entités prédites
for ent in ____.____:
# Affiche le texte de l'entité et son label
print(ent.____, ____.____)
|
test/element_test.py | screamingskulls/sofi | 402 | 12674304 | <gh_stars>100-1000
from sofi.ui import Element
def test_attrs_to_string_shortcut():
attributes = [
('cl', 'class'),
('ident', 'id'),
]
e = Element(cl='container', ident='foo')
should_be = 'class="container" id="foo"'
assert e._attrs_to_string(attributes) == should_b... |
indra/tests/test_cyjs_assembler.py | zebulon2/indra | 136 | 12674312 | <filename>indra/tests/test_cyjs_assembler.py<gh_stars>100-1000
from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
from indra.statements import *
from indra.assemblers.cyjs import CyJSAssembler
mek = Agent('MAP2K1', db_refs={'HGNC': '6840', 'TEXT': 'mek1'})
erk = Age... |
tools/version_bump.py | tirkarthi/python-plexapi | 749 | 12674323 | <gh_stars>100-1000
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Helper script to bump the current version."""
import argparse
import re
import subprocess
from packaging.version import Version
from plexapi import const
SUPPORTED_BUMP_TYPES = ["patch", "minor", "major"]
def _bump_release(release, bump_type):
... |
third_party/gsutil/third_party/pyasn1/tests/codec/cer/__main__.py | tingshao/catapult | 2,151 | 12674325 | <filename>third_party/gsutil/third_party/pyasn1/tests/codec/cer/__main__.py
#
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2017, <NAME> <<EMAIL>>
# License: http://snmplabs.com/pyasn1/license.html
#
try:
import unittest2 as unittest
except ImportError:
import unittest
suite = unittest.TestLo... |
macro_benchmark/SegLink/seglink/config.py | songhappy/ai-matrix | 180 | 12674329 | import tensorflow as tf
# basic
tf.app.flags.DEFINE_string('action', 'train', 'Action to take')
tf.app.flags.DEFINE_string('working_dir', '', 'Directory for saving checkpoints and log files')
tf.app.flags.DEFINE_string('log_file_prefix', 'fctd_', 'Prefix of logging file name')
# FCTD model
tf.app.flags.DEFINE_integer... |
filprofiler/__init__.py | whalesalad/filprofiler | 521 | 12674344 | <filename>filprofiler/__init__.py<gh_stars>100-1000
"""The Fil memory profiler."""
__all__ = ["__version__"]
# If we're running with Fil preloaded, after forks make sure Fil is no longer
# enabled, since we don't yet support child processes. This is also done in C
# code; doing it only in Python or only C doesn't see... |
pipeline/Serverless/02_pipeline/deploy.py | Rkauff/Klayers | 1,096 | 12674353 | import os
import time
from datetime import datetime
import boto3
from botocore.exceptions import ClientError
from boto3.dynamodb.conditions import Key
from aws_lambda_powertools.logging import Logger
logger = Logger()
import common.get_config as get_config
def check_regions_to_deploy(package, requirements_hash, r... |
lib/gcn/sparse/torch_nn.py | ChenFengYe/relightable-nr | 105 | 12674371 | from torch import nn
from torch.nn import Sequential as Seq, Linear as Lin
##############################
# Basic layers
##############################
def act_layer(act_type, inplace=False, neg_slope=0.2, n_prelu=1):
"""
helper selecting activation
:param act_type:
:param inplace:
:param neg_s... |
scraper/src/tests/default_strategy/tags_test.py | erichiggins0/docsearch-scraper | 242 | 12674377 | <filename>scraper/src/tests/default_strategy/tags_test.py
# coding: utf-8
import lxml.html
from .abstract import get_strategy
class TestTags:
def test_adding_tags_for_page(self):
# Given
strategy = get_strategy({
'start_urls': [{
'url': 'http://foo.bar/api',
... |
tools/dev/parrot_fuzzer.py | winnit-myself/Wifie | 312 | 12674394 | <reponame>winnit-myself/Wifie
#!/usr/bin/env python
# Copyright (C) 2009-2011, Parrot Foundation.
from fusil.application import Application
from fusil.process.watch import WatchProcess
from fusil.process.create import CreateProcess
from fusil.process.stdout import WatchStdout
from fusil.project_agent import Proj... |
tools/perf/page_sets/media_cns_cases.py | google-ar/chromium | 777 | 12674398 | # Copyright 2014 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.
from telemetry.page import page as page_module
from telemetry import story
class BasicPlayPage(page_module.Page):
def __init__(self, url, page_set, name=... |
src/backbones/efficientnet/effnetv2_configs.py | HY-Vision-Lab/metrabs | 208 | 12674423 | <reponame>HY-Vision-Lab/metrabs
# Copyright 2021 Google Research. 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
#
# U... |
locations/spiders/thebigbiscuit.py | nbeecher/alltheplaces | 297 | 12674426 | # -*- coding: utf-8 -*-
import scrapy
from locations.items import GeojsonPointItem
class TheBigBiscuitSpider(scrapy.Spider):
name = 'thebigbiscuit'
item_attributes = {'brand': 'The Big Biscuit'}
allowed_domains = ['www.bigbiscuit.com']
start_urls = ['https://bigbiscuit.com/locations/']
def parse... |
setup.py | vilhub/DeBERTa | 916 | 12674450 | import subprocess
import datetime
import sys
def install(package):
subprocess.check_call([sys.executable, "-m", "pip", "install", package])
install('setuptools')
install('gitpython')
import setuptools
import git
repo = git.Repo(search_parent_directories=True)
date=datetime.datetime.utcnow()
with open("README.md"... |
tests/test_s3-acl.py | kaiboma/hammer | 385 | 12674455 | <filename>tests/test_s3-acl.py
import pytest
from . import mock_s3
from library.aws.s3 import S3BucketsAclChecker
from library.aws.utility import Account
buckets = {
"Bucket1": {
"Description": "Private bucket",
"CheckShouldPass": True,
"ACL": "private",
},
"Bucket2": {
"... |
tests/gpflow/utilities/test_bijectors.py | HarrySpearing/GPflow | 1,724 | 12674469 | <filename>tests/gpflow/utilities/test_bijectors.py<gh_stars>1000+
import numpy as np
import pytest
import tensorflow_probability as tfp
from gpflow.config import Config, as_context
from gpflow.utilities import positive, triangular
@pytest.mark.parametrize(
"env_lower, override_lower",
[
(0.1, None), ... |
venv/lib/python3.7/site-packages/pyasn1_modules/rfc8619.py | nicholasadamou/StockBird | 9,953 | 12674491 | #
# This file is part of pyasn1-modules software.
#
# Created by <NAME>.
#
# Copyright (c) 2019, Vigil Security, LLC
# License: http://snmplabs.com/pyasn1/license.html
#
# Algorithm Identifiers for HKDF
#
# ASN.1 source from:
# https://www.rfc-editor.org/rfc/rfc8619.txt
#
from pyasn1.type import univ
from pyasn1_modu... |
deps/memkind/test/python_framework/cmd_helper.py | kimleeju/Heterogeneous_Redis | 107 | 12674498 | #
# Copyright (C) 2016 Intel Corporation.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice(s),
# this list of con... |
nodemcu_uploader/luacode.py | bazooka07/nodemcu-uploader | 324 | 12674565 | # -*- coding: utf-8 -*-
"""This module contains all the LUA code that needs to be on the device
to perform whats needed. They will be uploaded if they doesn't exist"""
# Copyright (C) 2015-2019 <NAME> <<EMAIL>>
# pylint: disable=C0301
# flake8: noqa
LUA_FUNCTIONS = ['recv_block', 'recv_name', 'recv', 'shafile', 'sen... |
tests/views/test_current.py | whywaita/gitfs | 921 | 12674583 | # Copyright 2014-2016 Presslabs SRL
#
# 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 wri... |
var/spack/repos/builtin/packages/node-js/package.py | LiamBindle/spack | 2,360 | 12674598 | <reponame>LiamBindle/spack
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import subprocess
import sys
from spack import *
class NodeJs(Package):
"""Node.js is a ... |
python_toolbox/wx_tools/widgets/cute_html_window.py | hboshnak/python_toolbox | 119 | 12674599 | # Copyright 2009-2011 <NAME>.
# This program is distributed under the LGPL2.1 license.
import webbrowser
import wx.html
from python_toolbox.wx_tools.widgets.cute_window import CuteWindow
class CuteHtmlWindow(wx.html.HtmlWindow, CuteWindow):
event_modules = wx.html
def __init__(self, parent, id=-1, pos=wx... |
pandapower/test/networks/test_cigre_networks.py | yougnen/pandapower | 104 | 12674600 | # -*- coding: utf-8 -*-
# Copyright (c) 2016-2021 by University of Kassel and Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel. All rights reserved.
import pandas as pd
import pytest
import pandapower as pp
import pandapower.networks as pn
def test_cigre_hv():
net = pn.cr... |
package_control/commands/advanced_install_package_command.py | zjzh/package_control | 3,373 | 12674612 | <reponame>zjzh/package_control
import threading
import re
import time
import functools
import sublime
import sublime_plugin
from ..show_error import show_error
from ..package_manager import PackageManager
from ..package_disabler import PackageDisabler
from ..thread_progress import ThreadProgress
try:
str_cls = u... |
Lib/bsddb/__init__.py | arvindm95/unladen-swallow | 2,293 | 12674619 | <filename>Lib/bsddb/__init__.py<gh_stars>1000+
#----------------------------------------------------------------------
# Copyright (c) 1999-2001, Digital Creations, Fredericksburg, VA, USA
# and <NAME>. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are p... |
reviewboard/oauth/models.py | amalik2/reviewboard | 921 | 12674620 | <filename>reviewboard/oauth/models.py
"""Models for OAuth2 applications."""
from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models
from django.utils.translation import ugettext_lazy as _
from djblets.db.fields import JSONField
from oauth2_provider.models impor... |
AppServer/lib/django-1.2/tests/modeltests/serializers/tests.py | loftwah/appscale | 790 | 12674629 | # -*- coding: utf-8 -*-
from datetime import datetime
from StringIO import StringIO
import unittest
from xml.dom import minidom
from django.conf import settings
from django.core import serializers
from django.db import transaction
from django.test import TestCase, TransactionTestCase, Approximate
from django.utils imp... |
rllib/env/dm_env_wrapper.py | firebolt55439/ray | 21,382 | 12674643 | <gh_stars>1000+
import gym
from gym import spaces
import numpy as np
try:
from dm_env import specs
except ImportError:
specs = None
def _convert_spec_to_space(spec):
if isinstance(spec, dict):
return spaces.Dict(
{k: _convert_spec_to_space(v)
for k, v in spec.items()})
... |
TL-ERC/setup.py | NouamaneTazi/conv-emotion | 488 | 12674644 | <reponame>NouamaneTazi/conv-emotion
import os
DATASET_DIRECTORY_PATH = "./datasets/"
GENERATIVE_WEIGHTS_DIRECTORY_PATH = "./generative_weights/"
if not os.path.exists(DATASET_DIRECTORY_PATH):
os.makedirs(DATASET_DIRECTORY_PATH)
if not os.path.exists(GENERATIVE_WEIGHTS_DIRECTORY_PATH):
os.makedirs(GENERATIVE... |
pyscf/mcscf/__init__.py | QuESt-Calculator/pyscf | 501 | 12674646 | #!/usr/bin/env python
# Copyright 2014-2018 The PySCF Developers. 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
#
# U... |
tests/cpydiff/types_bytearray_sliceassign.py | learnforpractice/micropython-cpp | 13,648 | 12674648 | <gh_stars>1000+
"""
categories: Types,bytearray
description: Array slice assignment with unsupported RHS
cause: Unknown
workaround: Unknown
"""
b = bytearray(4)
b[0:1] = [1, 2]
print(b)
|
sfa/config/train_config.py | FinalCold/SFA3D | 409 | 12674653 | """
# -*- coding: utf-8 -*-
-----------------------------------------------------------------------------------
# Author: <NAME>
# DoC: 2020.08.17
# email: <EMAIL>
-----------------------------------------------------------------------------------
# Description: The configurations of the project will be defined here
""... |
colour/notation/datasets/__init__.py | rift-labs-developer/colour | 1,380 | 12674674 | # -*- coding: utf-8 -*-
from .munsell import * # noqa
from . import munsell
__all__ = []
__all__ += munsell.__all__
|
Tools/Scenarios/strip_code.py | ErQing/Nova | 212 | 12674687 | #!/usr/bin/env python3
from nova_script_parser import normalize_dialogue, parse_chapters
in_filename = 'scenario.txt'
out_filename = 'scenario_no_code.txt'
with open(in_filename, 'r', encoding='utf-8') as f:
chapters = parse_chapters(f)
with open(out_filename, 'w', encoding='utf-8', newline='\n') as f:
for ... |
official/vision/detection/modeling/learning_rates.py | akshit-protonn/models | 82,518 | 12674689 | <filename>official/vision/detection/modeling/learning_rates.py
# Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www... |
examples/titanic/multiple_model_training.py | yarenty/ludwig | 970 | 12674694 | <reponame>yarenty/ludwig
#!/usr/bin/env python
# # Multiple Model Training Example
#
# This example trains multiple models and extracts training statistics
import logging
import shutil
# ## Import required libraries
from ludwig.api import LudwigModel
from ludwig.datasets import titanic
from ludwig.visualize import l... |
trove/common/cache.py | hlesesne/trove | 244 | 12674706 | # Copyright 2021 Catalyst Cloud
#
# 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 agre... |
easytransfer/losses/classification_regression_loss.py | johnson7788/EasyTransfer | 806 | 12674707 | # coding=utf-8
# Copyright (c) 2019 Alibaba PAI team.
#
# 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 ... |
python_modules/libraries/dagster-pagerduty/dagster_pagerduty_tests/test_resources.py | rpatil524/dagster | 4,606 | 12674718 | <gh_stars>1000+
import responses
from dagster import build_op_context, op
from dagster_pagerduty import pagerduty_resource
@responses.activate
def test_pagerduty_resource():
@op(required_resource_keys={"pagerduty"})
def pagerduty_op(context):
assert context.resources.pagerduty
with responses.R... |
experimental/language_structure/psl/psl_model_multiwoz_test_util.py | y0ast/uncertainty-baselines | 794 | 12674720 | # coding=utf-8
# Copyright 2021 The Uncertainty Baselines 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.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... |
test_twowheel.py | rossning92/rpi-robot | 106 | 12674722 | from device import Motor
from time import sleep
from twowheel import TwoWheelController
def test_controller(controller):
for _ in range(2):
controller.set_axis(x=-0.3)
sleep(0.25)
controller.set_axis(x=0.3)
sleep(0.25)
controller.set_axis()
if __name__ =... |
src/oci/golden_gate/models/create_deployment_backup_details.py | Manny27nyc/oci-python-sdk | 249 | 12674736 | # 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... |
python/ffi_navigator/pattern.py | csullivan/ffi-navigator | 148 | 12674747 | """FFI related code patterns and utility function to detect them."""
from typing import Optional
import re
import attr
import numpy as np
from bisect import bisect
from .lsp import Range, Position, Location
class Pattern:
"""Base class of all interesting code patterns."""
pass
@attr.s
class Def(Pattern):
... |
ceilometer/keystone_client.py | ionutbiru/ceilometer | 239 | 12674754 | <gh_stars>100-1000
#
# Copyright 2015 eNovance <<EMAIL>>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
04-distillation/model.py | PeiqinSun/tf-tutorials | 184 | 12674784 | <reponame>PeiqinSun/tf-tutorials
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import tensorflow as tf
import tensorflow.contrib as tf_contrib
from common import config
from model_utils import conv2d_quantize
class Model():
def __init__(self):
# set the initializer of conv_weight and conv_bias
se... |
zipfly/__init__.py | beckedorf/zipfly | 522 | 12674807 | <reponame>beckedorf/zipfly<filename>zipfly/__init__.py<gh_stars>100-1000
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function, with_statement
__version__ = '6.0.4'
__author__ = '<NAME> - Buzon, Inc.'
__license__ = 'MIT'
# v
from .zipfly import ZipFly
from .zipfly import LargePredictionSize... |
explainerdashboard/dashboard_components/composites.py | Simon-Free/explainerdashboard | 1,178 | 12674824 | __all__ = [
'ImportancesComposite',
'ClassifierModelStatsComposite',
'RegressionModelStatsComposite',
'IndividualPredictionsComposite',
'ShapDependenceComposite',
'ShapInteractionsComposite',
'DecisionTreesComposite',
'WhatIfComposite',
'SimplifiedClassifierComposite',
'Simplifie... |
third_party/chromite/cli/cros/lint_unittest.py | zipated/src | 2,151 | 12674833 | # -*- coding: utf-8 -*-
# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Test the lint module."""
from __future__ import print_function
import collections
import StringIO
from chromite.cli.cros... |
old_jobs/guess_sklearn_ma_daily_job.py | welldo/stock | 5,309 | 12674847 | <reponame>welldo/stock<gh_stars>1000+
#!/usr/local/bin/python3
# -*- coding: utf-8 -*-
import libs.common as common
import pandas as pd
import numpy as np
import math
import datetime
import sklearn as skl
from sklearn import datasets, linear_model
# https://github.com/udacity/machine-learning/issues/202
# sklearn.cro... |
todo/parser/subparsers/todo.py | tomasdanjonsson/td-cli | 154 | 12674872 | <reponame>tomasdanjonsson/td-cli
import argparse
from todo.constants import COMMANDS
from todo.parser.base import BaseParser
class TodoParser(BaseParser):
"""
usage: td [id] {get,delete,uncomplete,complete,edit} ...
manage todo
positional arguments:
id the id of the todo
... |
docs/source/examples/main.py | torarvid/aio-pika | 832 | 12674878 | <reponame>torarvid/aio-pika
import asyncio
from aio_pika import connect_robust, Message
async def main(loop):
connection = await connect_robust(
"amqp://guest:guest@127.0.0.1/", loop=loop
)
queue_name = "test_queue"
routing_key = "test_queue"
# Creating channel
channel = await connec... |
usaspending_api/awards/v2/urls_subawards.py | g4brielvs/usaspending-api | 217 | 12674897 | <gh_stars>100-1000
from django.conf.urls import url
from usaspending_api.awards.v2.views.subawards import SubawardsViewSet
urlpatterns = [url(r"^$", SubawardsViewSet.as_view())]
|
opensfm/test/test_stats.py | ricklentz/OpenSfM | 2,535 | 12674900 | <filename>opensfm/test/test_stats.py<gh_stars>1000+
from opensfm import stats, types
from opensfm.synthetic_data import synthetic_dataset, synthetic_scene
def test_processing_statistics_normal(
scene_synthetic: synthetic_scene.SyntheticInputData,
):
reference = scene_synthetic.reconstruction
dataset = syn... |
mayan/apps/testing/tests/mixins.py | bonitobonita24/Mayan-EDMS | 343 | 12674923 | <gh_stars>100-1000
import glob
import importlib
import logging
import os
import random
import time
from furl import furl
import psutil
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.firefox.webdriver import WebDriver
from django.apps import apps
from django.conf import settings
from dj... |
easy_maps/widgets.py | cyber-barrista/django-easy-maps | 114 | 12674927 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
from django import template
from django.forms import TextInput
class AddressWithMapWidget(TextInput):
width = 700
height = 200
zoom = 16
tpl = "{{% load easy_maps_tags %}}{{% easy_map address {0.width} {0.height} {0.zoom} %}}"
def render(self, name, va... |
libraries/botbuilder-core/botbuilder/core/user_state.py | Fl4v/botbuilder-python | 388 | 12674958 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from .turn_context import TurnContext
from .bot_state import BotState
from .storage import Storage
class UserState(BotState):
"""
Reads and writes user state for your bot to storage.
"""
no_key_error_messag... |
homeassistant/components/cups/__init__.py | domwillcode/home-assistant | 30,023 | 12674962 | <gh_stars>1000+
"""The cups component."""
|
chemdataextractor_batteries/chemdataextractor/parse/base.py | MB9991/test_demo- | 199 | 12674977 | # -*- coding: utf-8 -*-
"""
chemdataextractor.parse.base
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from abc import abstractproperty, abstractmethod
import logging
log = loggin... |
tests/test_type_alignment.py | TinkerBoard-Android/external-google-fruit | 1,666 | 12674980 | #!/usr/bin/env python3
# Copyright 2016 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
#
# Unless requir... |
okta/models/policy_rule_conditions.py | corylevine/okta-sdk-python | 145 | 12674996 | # flake8: noqa
"""
Copyright 2020 - Present Okta, 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 or agreed to in ... |
tensorflow_model_analysis/slicer/slicer_test.py | jaymessina3/model-analysis | 1,118 | 12675017 | # Lint as: python3
# Copyright 2018 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 or agr... |
robogym/robot/utils/logistic_functions.py | 0xflotus/robogym | 288 | 12675039 | <reponame>0xflotus/robogym<filename>robogym/robot/utils/logistic_functions.py
"""
Logistic functions
Function List:
1. logistic_sigmoid(x: float, a: float) -> float: calculate the normalized logistic sigmoid
with slope parameter a
2. clipped_logistic_sigmoid(x: float, a: float) -> float: calculate the normalize... |
python/federatedml/nn/backend/tf_keras/layers/baisc.py | rubenlozanoaht3m/DataDogm | 715 | 12675041 | #
# Copyright 2019 The FATE 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 appli... |
__scraping__/legit.ng - requests/main.py | whitmans-max/python-examples | 140 | 12675070 | <reponame>whitmans-max/python-examples
#!/usr/bin/env python3
# date: 2020.01.09
#
import requests
from bs4 import BeautifulSoup
res = requests.get('https://www.legit.ng/1087216-igbo-proverbs-meaning.html')
soup = BeautifulSoup(res.content, 'html.parser')
data = []
for div in soup.find_all('div'):
for block in... |
biscuit/src/kernel/rewrite.py | whakapapa/biscuit | 2,062 | 12675085 | #!/usr/bin/env python2
import os
import subprocess
import sys
def usage():
print >> sys.stderr, 'usage: %s <in gobin> <out gobin>' % (sys.argv[0])
sys.exit(1)
def _fsrex(data):
# FS seg override?
c = ord(data[0])
if c != 0x64:
return False
c = ord(data[1])
# 64 bit width, 64bit width + r8-r15 reg
rexes = [... |
tests/test_fms_api_event_list_parser.py | tervay/the-blue-alliance | 266 | 12675109 | <gh_stars>100-1000
import datetime
import json
import unittest2
from datafeeds.parsers.fms_api.fms_api_event_list_parser import FMSAPIEventListParser
from google.appengine.ext import ndb
from google.appengine.ext import testbed
from consts.event_type import EventType
from models.sitevar import Sitevar
class TestFM... |
lib/__init__.py | lockywolf/pysqlcipher3 | 108 | 12675149 | # pysqlite2/__init__.py: the pysqlite2 package.
#
# Copyright (C) 2005 <NAME> <<EMAIL>>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
# arising from the use of this software.
#
# Permissio... |
palladium/tests/test_julia.py | vishalbelsare/palladium | 528 | 12675155 | <reponame>vishalbelsare/palladium
from unittest.mock import call
from unittest.mock import Mock
from unittest.mock import patch
import numpy as np
import pytest
from pytest import fixture
pytest.importorskip("julia")
@fixture
def bridge(monkeypatch):
make_bridge = Mock()
monkeypatch.setattr('palladium.juli... |
pyrosm/networks.py | nmarchio/pyrosm | 186 | 12675163 | from pyrosm.data_manager import get_osm_data
from pyrosm.frames import prepare_geodataframe
import warnings
def get_network_data(
node_coordinates,
way_records,
tags_as_columns,
network_filter,
bounding_box,
slice_to_segments,
):
# Tags to keep as separate columns
tags_as_columns += ["... |
documents/__init__.py | nuwainfo/treeio | 242 | 12675178 | # encoding: utf-8
# Copyright 2011 Tree.io Limited
# This file is part of Treeio.
# License www.tree.io/license
"""
Documents docstring
"""
|
scripts/vim/plugin/snippets/__init__.py | n13l/OpenAAA | 413 | 12675179 | __all__ = ['clang_complete', 'ultisnips', 'dummy']
|
downstream/votenet_det_new/models/backbone/sparseconv/models/wrapper.py | mbanani/PointContrast | 244 | 12675200 | <reponame>mbanani/PointContrast
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import random
from torch.nn import Module
from MinkowskiEngine import SparseTensor
class Wrapper(Module):... |
tests/test_worksheet.py | aaaddress1/boobsnail | 169 | 12675201 | from unittest import TestCase
from excel4lib.sheet import *
class TestWorksheet(TestCase):
def test_column_iterate(self):
worksheet = Worksheet("test.csv")
worksheet.set_current_cords(1, 1)
for i in range(1,10):
for j in range(1, 10):
worksheet.add_cell(Cell(i, ... |
lib/node_modules/@stdlib/blas/base/sswap/binding.gyp | ghalimi/stdlib | 3,428 | 12675212 | <reponame>ghalimi/stdlib<filename>lib/node_modules/@stdlib/blas/base/sswap/binding.gyp<gh_stars>1000+
# @license Apache-2.0
#
# Copyright (c) 2018 The Stdlib 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... |
yellowbrick/text/freqdist.py | mrtrkmn/yellowbrick | 3,662 | 12675237 | # yellowbrick.text.freqdist
# Implementations of frequency distributions for text visualization.
#
# Author: <NAME>
# Created: Mon Feb 20 12:38:20 2017 -0500
#
# Copyright (C) 2017 The scikit-yb developers
# For license information, see LICENSE.txt
#
# ID: freqdist.py [67b2740] <EMAIL> $
"""
Implementations of freq... |
dataloaders/image_transforms.py | yoxu515/aot-benchmark | 105 | 12675242 | <filename>dataloaders/image_transforms.py
import math
import warnings
import random
import numbers
import numpy as np
from PIL import Image
from collections.abc import Sequence
import torch
import torchvision.transforms.functional as TF
_pil_interpolation_to_str = {
Image.NEAREST: 'PIL.Image.NEAREST',
Image.B... |
wilds/datasets/rxrx1_dataset.py | caglasozen/wilds | 355 | 12675249 | <reponame>caglasozen/wilds
import os
from pathlib import Path
from collections import defaultdict
from PIL import Image
import pandas as pd
import numpy as np
import torch
from wilds.datasets.wilds_dataset import WILDSDataset
from wilds.common.grouper import CombinatorialGrouper
from wilds.common.metrics.a... |
tools/perf/core/results_dashboard_unittest.py | sarang-apps/darshan_browser | 575 | 12675254 | # Copyright 2018 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 unittest
import mock
from mock import call
from core import results_dashboard
class ResultsDashboardTest(unittest.TestCase):
def setUp(self):
... |
cityscapesScripts/cityscapesscripts/preparation/json2instanceImg.py | zeroAska/TFSegmentation | 633 | 12675265 | #!/usr/bin/python
#
# Reads labels as polygons in JSON format and converts them to instance images,
# where each pixel has an ID that represents the ground truth class and the
# individual instance of that class.
#
# The pixel values encode both, class and the individual instance.
# The integer part of a division by 10... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.