code
stringlengths
2
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int32
2
1.05M
# -*- coding: utf-8 -*- # Copyright (c) 2015 Spotify AB from __future__ import absolute_import, division, print_function import attr from six.moves import BaseHTTPServer as httpserver # NOQA from .parameters import Content from .validate import * # NOQA HTTP_RESP_CODES = httpserver.BaseHTTPRequestHandler.response...
postatum/ramlfications
ramlfications/raml.py
Python
apache-2.0
8,445
# -*- coding: utf-8 -*- """ Dependencies: flask, tornado """ from __future__ import absolute_import, division, print_function import tornado.wsgi import tornado.httpserver import logging import socket from ibeis.control import controller_inject from ibeis.web import apis_engine from ibeis.web import job_engine from ibe...
SU-ECE-17-7/ibeis
ibeis/web/app.py
Python
apache-2.0
6,275
import os import sys import unittest import pytest import ray from ray import tune from ray.rllib.agents import ppo from ray.rllib.examples.env.stateless_cartpole import StatelessCartPole from ray.util.client.ray_client_helpers import ray_start_client_server class TestRayClient(unittest.TestCase): def test_conne...
ray-project/ray
rllib/tests/test_ray_client.py
Python
apache-2.0
2,283
# Copyright 2022 The Magenta 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 applicable law or agreed to in ...
magenta/magenta
magenta/models/arbitrary_image_stylization/arbitrary_image_stylization_convert_tflite.py
Python
apache-2.0
17,475
import os import unittest # This test assumes that there is a Dicom csv and a Snapshot directory in test/data/dicom from rdflib import Graph, URIRef, RDF, OWL, RDFS from SNOMEDCTToOWL.RF2Filter import main as rf2main from SNOMEDCTToOWL.SNOMEDToOWL import main as owlmain from SNOMEDCTToOWL.SNOMEDToOWLConstants import ...
hsolbrig/SNOMEDToOWL
test/test_suspected_lung_cancer.py
Python
apache-2.0
3,418
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='CmisServer', fields=[ ('id', mod...
wandss/ExportingTool
fnetET/extractiontool/migrations/0001_initial.py
Python
apache-2.0
665
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import annotations import logging import os import signal import sys import time import traceback from abc import ABCMeta from hashlib import sha256 from typing import Cal...
benjyw/pants
src/python/pants/pantsd/process_manager.py
Python
apache-2.0
22,996
#!/usr/bin/python # Copyright (c) 2010-2011 OpenStack, 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...
juvvadi/keystone
setup.py
Python
apache-2.0
1,463
#!/usr/bin/python3 import sys; import re; import os; import argparse; import fileinput; import shlex; HelpMsg = ''' Resolve unknown native stack info in Android traces file via addr2line\n Required tools: addr2line, c++filt ''' # the command used to convert addresses info file names and line numbers _add...
supernatural/scripts
addr2line/addr2line.py
Python
apache-2.0
3,200
# Copyright (c) 2011-2012 Nexenta Systems 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 agree...
Nexenta/lfs
swift_lfs/fs/__init__.py
Python
apache-2.0
5,875
""" command line options, ini-file and conftest.py processing. """ import argparse import copy import inspect import os import shlex import sys import types import warnings from functools import lru_cache from pathlib import Path from types import TracebackType from typing import Any from typing import Callable from ty...
randyzingle/tools
kub/services/archive/cdk/python/sample-app/.env/lib/python3.6/site-packages/_pytest/config/__init__.py
Python
apache-2.0
40,336
#!/usr/bin/env python # -*- coding: utf-8 -*- import vtk def main(): # Create five points. origin = [0.0, 0.0, 0.0] p0 = [1.0, 0.0, 0.0] p1 = [0.0, 1.0, 0.0] p2 = [0.0, 1.0, 2.0] p3 = [1.0, 2.0, 3.0] # Create a vtkPoints object and store the points in it points = vtk.vtkPoints() ...
lorensen/VTKExamples
src/Python/GeometricObjects/LongLine.py
Python
apache-2.0
1,952
# coding: utf-8 import os from setuptools import setup README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read() # Allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-upwork-auth', version='1.0-beta', ...
strogonoff/django-upwork-auth
setup.py
Python
apache-2.0
1,195
# Copyright Hybrid Logic Ltd. See LICENSE file for details. # -*- test-case-name: flocker.node.test.test_deploy -*- """ Deploy applications on nodes. """ from itertools import chain from warnings import warn from zope.interface import Interface, implementer, Attribute from characteristic import attributes from py...
jml/flocker
flocker/node/_deploy.py
Python
apache-2.0
37,208
import time import os import json import requests from traitlets import Dict, Int, List, Unicode from tornado import gen from tornado.web import HTTPError import sys import ast from jupyterhub.spawner import Spawner from .QueryUser import query_user from .marathon import Marathon from .GPUResourceAllocator import GPUR...
kylemvz/nbhub
l41_nbhub/MarathonSpawner.py
Python
apache-2.0
12,318
#!/usr/bin/env python # This script checks that secma is <= 1 when secdf + secdn == 0. from netCDF4 import Dataset import numpy as np import numpy.ma as ma import os static = Dataset('../../data/luh2_v2/staticData_quarterdeg.nc') icwtr = static.variables['icwtr'][:, :] secd = ma.empty_like(icwtr) secd.mask = np.wher...
ricardog/raster-project
attic/secma-check.py
Python
apache-2.0
2,215
# -*- coding: utf-8 -*- # Copyright 2022 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...
googleapis/python-dataplex
samples/generated_samples/dataplex_v1_generated_content_service_get_content_async.py
Python
apache-2.0
1,450
# Copyright 2015 Rackspace US, 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 wri...
larsbutler/chessboard
chessboard/schema.py
Python
apache-2.0
19,224
__author__ = 'Tony Beltramelli - www.tonybeltramelli.com' import numpy as np START_TOKEN = "<START>" END_TOKEN = "<END>" PLACEHOLDER = " " SEPARATOR = '->' class Vocabulary: def __init__(self): self.binary_vocabulary = {} self.vocabulary = {} self.token_lookup = {} self.size = 0 ...
hippyk/pix2code
model/classes/Vocabulary.py
Python
apache-2.0
2,300
__author__ = 'maru' __copyright__ = "Copyright 2013, ML Lab" __version__ = "0.1" __status__ = "Development" import sys import os sys.path.append(os.path.abspath(".")) from experiment_utils import print_results, parse_parameters_mat, set_cost_model import argparse import numpy as np from sklearn.datasets.base import...
mramire8/active
experiment/traintestfixk.py
Python
apache-2.0
9,508
# from classifier_env import Classifier from classifier import Classifier # from Brain_RL import DeepQNetwork from doubleDQN import DoubleDQN import numpy as np import matplotlib.pyplot as plt import tensorflow as tf env = Classifier() MEMORY_SIZE = 3000 ACTION_SPACE = 2 sess = tf.Session() with tf.variable_scope...
DaniellaAngel/MachineLearning
DQN1/run_test.py
Python
apache-2.0
3,152
from multiprocessing import Process, Queue from Queue import Empty import pymongo def run_pipeline(pipeline, input_collection, db, post_processor = lambda x: x): for entry in db.command("aggregate", input_collection, pipeline=pipeline)["result"]: yield post_processor(entry) def write_result(target_que...
inbloom/secure-data-service
POC/aggregation/mongo/aggregatedriver.py
Python
apache-2.0
1,163
"""Test the OctoPrint config flow.""" from unittest.mock import patch from pyoctoprintapi import ApiError, DiscoverySettings from homeassistant import config_entries, data_entry_flow from homeassistant.components.octoprint.const import DOMAIN from homeassistant.core import HomeAssistant from tests.common import Mock...
aronsky/home-assistant
tests/components/octoprint/test_config_flow.py
Python
apache-2.0
16,260
import zstackwoodpecker.test_state as ts_header import os TestAction = ts_header.TestAction def path(): return dict(initial_formation="template5", checking_point=8, path_list=[ [TestAction.create_vm, 'vm1', ], [TestAction.create_volume, 'volume1', 'flag=scsi'], [TestAction.attach_volume, 'vm1', 'volume1'], ...
zstackio/zstack-woodpecker
integrationtest/vm/multihosts/vm_snapshots/paths/sblk_path49.py
Python
apache-2.0
1,578
class Allele(object): """Abstraction of an IGHV allele This class will accumulate occurrences, D and J assignments Attributes: name : name of this allele vgene: IGHV gene assignment dass : IGHD gene assignments jass : IGHJ gene assignments cdr3s: set of CDR3s as...
ukirik/giggle
allele.py
Python
apache-2.0
1,536
#!/usr/bin/env python # pylint: disable=missing-docstring # flake8: noqa: T001 # ___ ___ _ _ ___ ___ _ _____ ___ ___ # / __| __| \| | __| _ \ /_\_ _| __| \ # | (_ | _|| .` | _|| / / _ \| | | _|| |) | # \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____ # | \ / _ \ | \| |/ _ \_ _| | __| \_ ...
detiber/openshift-ansible
roles/lib_openshift/library/oc_user.py
Python
apache-2.0
59,939
# vim: set fileencoding=utf-8 : # # Copyright (c) 2012 Retresco GmbH # Copyright (c) 2011 Daniel Truemper <truemped at googlemail.com> # # 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 # # ht...
truemped/dopplr
dopplr/solr/query/mlt.py
Python
apache-2.0
2,382
#!/usr/bin/env python # Copyright 2020 Google, 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...
cloudspannerecosystem/emulator-samples
python-samples/samples.py
Python
apache-2.0
66,380
# Django settings for cito project. # Copyright (c) 2012-2013 Cyrus Dasadia <cyrus@extremeunix.com> # # 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 li...
CitoEngine/cito_engine
app/cito_engine/poller/pluginpoller.py
Python
apache-2.0
3,548
"""Common functions.""" import sys def log(msg, *args): if args: msg = msg % args print >>sys.stderr, msg
google/rappor
pipeline/util.py
Python
apache-2.0
117
import json import pytest from typing import ClassVar, Dict, List, Sequence, Tuple, Union from kat.harness import sanitize, variants, Query, Runner from abstract_tests import AmbassadorTest, HTTP from abstract_tests import assert_default_errors, MappingTest, OptionTest, ServiceType, Node, Test class ShadowTestCANF...
datawire/ambassador
python/tests/kat/t_shadow.py
Python
apache-2.0
5,831
import numpy as np import pandas as pd from pyrates.utility.visualization import plot_connectivity from matplotlib.pyplot import show import pickle, os path = "/home/rgast/ownCloud/data/qif_rc_scores/lorenz_vs_stuartlandau" # STEP 1: Load pre-generated RNN parameters ########################################### confi...
Richert/BrainNetworks
RC/QIF_micro_results.py
Python
apache-2.0
1,559
az.plot_autocorr(data, var_names=['mu', 'tau'], max_lag=200, combined=True)
mcmcplotlib/mcmcplotlib
api/generated/arviz-plot_autocorr-4.py
Python
apache-2.0
76
import logging from ray.rllib.agents import with_common_config from ray.rllib.agents.trainer_template import build_trainer from ray.rllib.models.catalog import ModelCatalog from ray.rllib.models.model import restore_original_dimensions from ray.rllib.models.torch.torch_action_dist import TorchCategorical from ray.rlli...
stephanie-wang/ray
rllib/contrib/alpha_zero/core/alpha_zero_trainer.py
Python
apache-2.0
6,001
def move_data(token, member_id, from_path, to_path): url = 'https://api.dropboxapi.com/1/fileops/move' headers = {'Authorization': 'Bearer %s' % token, 'X-Dropbox-Perform-As-Team-Member': member_id} data = {'root': 'auto', 'from_path': from_path, 'to_path': to_path} print 'Moving "%s" to "%s" (member_id: %s)' % (f...
dropbox/DropboxBusinessScripts
Files/MoveData.py
Python
apache-2.0
554
alpha_testing_open = False
HunterLarco/sealed
server/api/lib/testing/alphas/constants.py
Python
apache-2.0
26
# Copyright (C) 2017 Daniel Watkins <daniel@daniel-watkins.co.uk> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
OddBloke/jenkins-job-linter
jenkins_job_linter/config.py
Python
apache-2.0
2,260
# coding=utf-8 # Copyright 2022 The Robustness Metrics 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 appli...
google-research/robustness_metrics
robustness_metrics/datasets/ood_detection.py
Python
apache-2.0
6,403
# Copyright 2014 Red Hat, 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 a...
fnordahl/nova
nova/objects/fixed_ip.py
Python
apache-2.0
13,301
import sys import readline import pprint import json import tatsu import argparse import os.path import tempfile import pprint from . import zdb, zettel def unquote(text): return text.replace('"', '').replace("'", "") class ZG(object): def literal(self, ast): return ast.word def _get_match_cla...
ZettelGeist/zettelgeist
zettelgeist/zquery.py
Python
apache-2.0
4,048
from abc import ABC, abstractmethod from typing import TypeVar, Generic from ..processor.serialization import Serde from .key_value_state_store import KeyValueStateStore KT = TypeVar('KT') # Key type. VT = TypeVar('VT') # Value type. class StateStore(ABC, Generic[KT, VT]): """ StateStores are created by S...
wintoncode/winton-kafka-streams
winton_kafka_streams/state/state_store.py
Python
apache-2.0
1,617
""" Copyright 2021 Google LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software dis...
GoogleCloudPlatform/dfcx-scrapi
src/dfcx_scrapi/tools/__init__.py
Python
apache-2.0
559
class PatchBasedCNNModel(object): pass # TODO:
alexandonian/lightning
lightning_classification/classification/model.py
Python
apache-2.0
55
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P. # Copyright (c) 2014 TrilioData, Inc # Copyright (c) 2015 EMC Corporation # 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 # ...
eharney/cinder
cinder/backup/api.py
Python
apache-2.0
23,724
from unittest import TestCase from unittest import skipIf from parameterized import parameterized from hvac import exceptions from tests import utils from tests.utils.hvac_integration_test_case import HvacIntegrationTestCase @skipIf( utils.vault_version_lt("0.6.2"), "AppRole endpoints standardized in version 0....
ianunruh/hvac
tests/integration_tests/api/auth_methods/test_approle.py
Python
apache-2.0
8,560
import pandas as pd import bayesianpy from bayesianpy.network import Builder as builder import logging import os from bayesianpy.jni import jp from sklearn.model_selection import train_test_split import matplotlib.pyplot as plt def main(): logger = logging.getLogger() logger.addHandler(logging.StreamHandle...
morganics/bayesianpy
examples/iris_virtual_accuracy.py
Python
apache-2.0
5,276
# coding=utf-8 # Copyright 2022 The init2winit 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 applicable la...
google/init2winit
hessian/test_model_debugger.py
Python
apache-2.0
5,001
# Copyright 2020, Red Hat 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 writin...
openstack/python-openstackclient
openstackclient/compute/v2/server_volume.py
Python
apache-2.0
5,096
# -*- coding: utf-8 -*- # auxilium # -------- # Python project for an automated test and deploy toolkit. # # Author: sonntagsgesicht # Version: 0.1.8, copyright Saturday, 02 October 2021 # Website: https://github.com/sonntagsgesicht/auxilium # License: Apache License 2.0 (see LICENSE file) from argparse import ...
sonntagsgesicht/regtest
.aux/venv/lib/python3.9/site-packages/auxilium/add_arguments/update.py
Python
apache-2.0
2,189
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2011 OpenStack, LLC. # 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...
aristanetworks/arista-ovs-nova
nova/rootwrap/wrapper.py
Python
apache-2.0
3,055
#! /usr/bin/env python3 import scripts_java.include_approvals_path # Note This is used! from scripts_java.prepare_release import build if __name__ == '__main__': build(lambda v: v.update_patch())
approvals/ApprovalTests.Java
build/deploy_patch_release.py
Python
apache-2.0
203
#!/usr/bin/env python # # Copyright (c) 2013-2014 Cloudera, Inc. All rights reserved. # Deploys a CDH cluster and configures CM management services. import socket, sys, time, ConfigParser, csv, pprint, urllib2 from subprocess import Popen, PIPE, STDOUT from math import log as ln from cm_api.api_client import ApiResou...
justinhayes/cm_api
python/examples/auto-deploy/deploycloudera.py
Python
apache-2.0
46,034
from .settings import * import os import dj_database_url DEBUG = bool(int(os.environ.get('DEBUG', False))) SECRET_KEY = os.environ['SECRET_KEY'] BLACKLIST_APPS = ['debugtoolbar', 'django_extensions'] INSTALLED_APPS = tuple([app for app in INSTALLED_APPS if app not in BLACKLIST_APPS]) DATABASES['default'] = dj_datab...
TanksForWaiting/tanks-for-waiting
tanks_api/tanks_api/heroku_settings.py
Python
apache-2.0
633
# Copyright (c) 2015 Russell Sim <russell.sim@gmail.com> # # 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 ...
annegentle/fairy-slipper
fairy_slipper/tests/cmd/test_docbkx_to_json.py
Python
apache-2.0
4,397
from django.db import models, transaction from django.utils import timezone, six from django.utils.translation import ugettext_noop, ugettext_lazy as _ from django.core.cache import cache from django.conf import settings import decimal import operator from functools import reduce # noinspection PyProtectedMember from...
erigones/esdc-ce
vms/models/node.py
Python
apache-2.0
39,250
# Copyright 2016 Pinterest, 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 writi...
nickdechant/teletraan
deploy-board/deploy_board/webapp/group_view.py
Python
apache-2.0
46,747
# -*- coding: utf-8 -*- from model.group import Group import random def test_delete_some_group(app, db, check_ui): if len(db.get_group_list()) == 0: app.group.create(Group(name="test")) old_groups = db.get_group_list() group = random.choice(old_groups) app.group.delete_group_by_id(...
osen000/python_task
test/test_delete_group.py
Python
apache-2.0
642
# -*- coding: utf-8 -*- # Copyright 2022 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...
googleapis/python-container
samples/generated_samples/container_v1beta1_generated_cluster_manager_list_operations_sync.py
Python
apache-2.0
1,525
from ..remote import RemoteModel class SdnSettingRemote(RemoteModel): """ This table list out the entries of SDN controller setting within NetMRI. | ``id:`` The internal NetMRI identifier for this setting. | ``attribute type:`` number | ``virtual_network_id:`` The internal NetMRI identifier ...
infobloxopen/infoblox-netmri
infoblox_netmri/api/remote/models/sdn_setting_remote.py
Python
apache-2.0
3,417
plt.
dahlstrom-g/intellij-community
python/testData/completion/notImportedPackageName/CompletionForAlias/main.after.py
Python
apache-2.0
4
# 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, Version 2.0 (the # "License"); you may not u...
Laurawly/tvm-1
tests/python/contrib/test_ethosu/test_legalize.py
Python
apache-2.0
56,646
''' ''' # 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, Version 2.0 (the # "License");...
persiaAziz/trafficserver
tests/tools/sessionvalidation/response.py
Python
apache-2.0
1,645
# Copyright 2016 - Nokia # # 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, sof...
openstack/vitrage
vitrage/datasources/ceilometer/transformer.py
Python
apache-2.0
6,882
""" Provide pre-made queries on top of the recorder component. For more details about this component, please refer to the documentation at https://home-assistant.io/components/history/ """ import asyncio from collections import defaultdict from datetime import timedelta from itertools import groupby import voluptuous ...
keerts/home-assistant
homeassistant/components/history.py
Python
apache-2.0
11,473
"""Test config validators.""" from datetime import date, datetime, timedelta import enum import os from socket import _GLOBAL_DEFAULT_TIMEOUT from unittest.mock import Mock, patch import uuid import pytest import voluptuous as vol import homeassistant from homeassistant.helpers import config_validation as cv, templat...
partofthething/home-assistant
tests/helpers/test_config_validation.py
Python
apache-2.0
27,610
from algobox.analysis.indicator import OhlcIndicators from algobox.price import StandardTimeFrame from algobox.price.pricefactory import PriceFactory from algobox.util.preconditions import Preconditions from datetime import datetime from matplotlib.ticker import Formatter import numpy as np import matplotlib.pyplot as...
melphi/algobox
python/algobox/src/algobox/analysis/plot.py
Python
apache-2.0
11,660
# -*- coding: utf-8 -*- """ A setuptools based setup module for opengrid. Adapted from https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs i...
MatteusDeloge/opengrid
setup.py
Python
apache-2.0
3,002
# Copyright 2014 Cloudbase Solutions 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 l...
stackforge/cloudbase-init
cloudbaseinit/utils/debiface.py
Python
apache-2.0
4,325
from factorial import factorial def rank_permutation(n, permutation): if n == 1: return 0 else: new_permutation = [] for element in permutation[1:]: if element > permutation[0]: new_permutation.append(element - 1) else: new_permut...
vtemian/uni-west
second_year/graph/2/rank_permutation.py
Python
apache-2.0
649
# -*- coding: utf-8 -*- # Copyright 2022 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...
googleapis/python-shell
samples/generated_samples/cloudshell_v1_generated_cloud_shell_service_authorize_environment_async.py
Python
apache-2.0
1,571
import urllib.request import xml.etree.ElementTree import logging def extract_xml_tree_from_url(url): logging.debug("Starting download of %s" % url) data = urllib.request.urlopen(url) if data.getcode() != 200: raise RuntimeError("Didnt get a 200 response from the webserver.") tree = xml.etree.ElementTree.parse...
dirrelito/animated-invention
WeatherAnalysis/download_rain_data.py
Python
apache-2.0
3,829
#!/usr/bin/python # -*- coding utf8 -*- from threading import Timer def hello(name): print('%s say hello, world' %name) t=Timer(3,hello,args=('egon',)) t.start()
5StevenWu/Coursepy
day10/定时执行.py
Python
apache-2.0
171
"""Support for Logi Circle devices.""" import asyncio from aiohttp.client_exceptions import ClientResponseError import async_timeout from logi_circle import LogiCircle from logi_circle.exception import AuthorizationFailed import voluptuous as vol from homeassistant import config_entries from homeassistant.components....
home-assistant/home-assistant
homeassistant/components/logi_circle/__init__.py
Python
apache-2.0
7,319
#Task: Creating a VM on Interoute's VDC 2.0 # #With this program the user chooses from lists of resources to put together the configuration to create a VM import pprint import inputchooser #Import the connection driver import connection as vdc from libcloud.compute.base import NodeAuthPassword #Choose the location ...
Interoute/Libcloud-and-VDC
create_vm_chooser.py
Python
apache-2.0
4,100
# http://www.hangge.com/blog/cache/category_72_3.html
openslack/openslack-crawler
crawler/spiders/hangge.py
Python
apache-2.0
54
# -*- coding: utf-8 -*- # Copyright (2017-2018) Hewlett Packard Enterprise Development LP # # 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...
HewlettPackard/oneview-redfish-toolkit
oneview_redfish_toolkit/blueprints/service_root.py
Python
apache-2.0
2,225
""" Extracting the list of members of Congress who have appeared most often on Sunday news shows and dump to the database on a weekly basis. @Author Charles Xu Octorber 6, 2015 Schema: persons(id, id_govtrack, id_lis, first_name, middle_name, last_name, birthday, gender) >> ISSUE << unable to retrieve data in 201...
bwalenz/us-congress-data
scripts/VIP-scripts/media_coverage.py
Python
apache-2.0
3,885
from collections import OrderedDict import csv from Bio import AlignIO ALIGNMENT_POSITION = 'aligmnent_position' TM = 'tm' GPCRDB_GAP = 'gpcrdb_gap' class Numberings(object): name = '' rows = [] def __init__(self, name, rows): self.name = name self.rows = rows @classmethod def f...
3D-e-Chem/snooker-alignment
scripts/snooker.py
Python
apache-2.0
3,400
""" Copyright 2015 Logvinenko Maksim 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, softw...
logarithm/photon-python
photon/protocol.py
Python
apache-2.0
15,850
"""add soft delete feature table Revision ID: af4279aa1f64 Revises: fa2cd0ecc30f Create Date: 2019-05-13 11:47:29.388502 """ # revision identifiers, used by Alembic. revision = 'af4279aa1f64' down_revision = 'fa2cd0ecc30f' branch_labels = None depends_on = None from alembic import op import sqlalchemy as sa from sq...
CanopyTax/toggle-meister
migrations/versions/af4279aa1f64_add_soft_delete_feature_table.py
Python
apache-2.0
1,256
# 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, software # distributed unde...
stackforge/senlin
senlin/objects/notification.py
Python
apache-2.0
8,976
import numpy as np from PIL import Image from numpy.random import choice def load_pixels(path_to_image_file, image_width, image_height): im = Image.open(path_to_image_file).resize((image_width, image_height), Image.BICUBIC) pixels = np.array(im) return pixels def normalize_image(img_tensor): # Normal...
EdwardDixon/deeplearning
facepaint/main/utils.py
Python
apache-2.0
2,011
# -*- coding: utf-8 -*- # Copyright 2022 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...
googleapis/python-documentai
google/cloud/documentai_v1beta3/types/processor.py
Python
apache-2.0
2,729
#MenuTitle: Rewire Fire # -*- coding: utf-8 -*- from __future__ import division, print_function, unicode_literals __doc__=""" Finds, selects and marks duplicate coordinates. Two nodes on the same position typically can be rewired with Reconnect Nodes. """ import vanilla from Foundation import NSPoint, NSIntersectsRect...
mekkablue/Glyphs-Scripts
Paths/Rewire Fire.py
Python
apache-2.0
14,422
# 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, software # d...
tbachman/group-based-policy
gbpservice/tests/contrib/gbpfunctests/testcases/tc_gbp_ri_func_4.py
Python
apache-2.0
3,683
# -*- coding: utf-8 -*- # Copyright 2022 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...
googleapis/python-grafeas
samples/generated_samples/containeranalysis_v1_generated_grafeas_update_note_async.py
Python
apache-2.0
1,433
# coding=utf-8 # Copyright 2022 The Deeplab2 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 applicable law ...
google-research/deeplab2
model/encoder/model_export_test.py
Python
apache-2.0
1,924
#!/usr/bin/env python # -*- coding: utf-8 -*- # File: raw.py # Author: Yuxin Wu <ppwwyyxxc@gmail.com> import numpy as np import copy import six from six.moves import range from .base import DataFlow, RNGDataFlow __all__ = ['FakeData', 'DataFromQueue', 'DataFromList', 'DataFromGenerator'] class FakeData(RNGDataFlow)...
haamoon/tensorpack
tensorpack/dataflow/raw.py
Python
apache-2.0
3,437
"""The tests for the MQTT cover platform.""" import unittest from homeassistant.setup import setup_component from homeassistant.const import STATE_OPEN, STATE_CLOSED, STATE_UNKNOWN, \ STATE_UNAVAILABLE, ATTR_ASSUMED_STATE import homeassistant.components.cover as cover from homeassistant.components.cover.mqtt impor...
persandstrom/home-assistant
tests/components/cover/test_mqtt.py
Python
apache-2.0
28,048
__author__ = 'dorota' from pony.orm import * from datetime import datetime from model.group import Group from model.contact import Contact from pymysql.converters import decoders class ORMFixture: db = Database() class ORMGroup(db.Entity): _table_ = 'group_list' id = PrimaryKey(int, column='...
dorotan/pythontraining
fixture/orm.py
Python
apache-2.0
2,495
""" Use Azure Blob as a Pillar source. .. versionadded:: 3001 :maintainer: <devops@eitr.tech> :maturity: new :depends: * `azure-storage-blob <https://pypi.org/project/azure-storage-blob/>`_ >= 12.0.0 The Azure Blob ext_pillar can be configured with the following parameters: .. code-block:: yaml ext_pillar:...
saltstack/salt
salt/pillar/azureblob.py
Python
apache-2.0
14,213
# -*- coding: utf-8 -*- ''' Utility functions for salt.cloud ''' # Import python libs from __future__ import absolute_import import os import sys import stat import codecs import shutil import hashlib import socket import tempfile import time import subprocess import multiprocessing import logging import pipes import ...
stephane-martin/salt-debian-packaging
salt-2016.3.3/salt/utils/cloud.py
Python
apache-2.0
111,510
from __future__ import absolute_import from __future__ import division from __future__ import print_function import cloudpickle as pickle import ray.numbuf class RaySerializationException(Exception): def __init__(self, message, example_object): Exception.__init__(self, message) self.example_obje...
alanamarzoev/ray
python/ray/serialization.py
Python
apache-2.0
8,030
# # Copyright 2018 PyWren 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 or agreed to in writing...
pywren/pywren
pywren/wren.py
Python
apache-2.0
3,644
#!/usr/bin/env python """ 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, Version 2.0 (the "License");...
zouzhberk/ambaridemo
demo-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/supervisor_prod.py
Python
apache-2.0
2,501
""" Resolves OpenSSL issues in some servers: https://lukasa.co.uk/2013/01/Choosing_SSL_Version_In_Requests/ https://github.com/kennethreitz/requests/pull/799 """ import sys from distutils.version import StrictVersion from requests.adapters import HTTPAdapter from docker.transport.basehttpadapter import Ba...
funkyfuture/docker-py
docker/transport/ssladapter.py
Python
apache-2.0
2,614
# coding=utf-8 # Copyright 2022 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.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
google-research/google-research
aloe/aloe/synthetic/utils.py
Python
apache-2.0
5,698
__version__ = "3.1.4" __author__ = 'ReactiveOps, Inc.'
reactiveops/pentagon
pentagon/meta.py
Python
apache-2.0
55
# -*- coding: utf-8 -*- # 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, softwar...
clusterdock/framework
clusterdock/__init__.py
Python
apache-2.0
1,497
# Copyright 2010 Google 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 wr...
google/personfinder
app/confirm_post_flagged_note.py
Python
apache-2.0
5,834