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
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # Copyright 2011 Eldar Nugaev # 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://...
bigswitch/nova
nova/tests/unit/api/openstack/compute/test_floating_ips.py
Python
apache-2.0
40,992
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2010-2012 OpenStack Foundation # Copyright 2013 IBM Corp. # Copyright 2015 Mirantis, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "L...
pizhi/umbrella
umbrella/db/__init__.py
Python
apache-2.0
1,346
import tensorflow as tf from docqa.configurable import Configurable from docqa.nn.layers import get_keras_initialization, get_keras_activation def compute_attention_mask(x_mask, mem_mask, x_word_dim, key_word_dim): """ computes a (batch, x_word_dim, key_word_dim) bool mask for clients that want masking """ i...
allenai/document-qa
docqa/nn/similarity_layers.py
Python
apache-2.0
7,000
# 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...
apache/incubator-airflow
tests/providers/microsoft/azure/log/test_wasb_task_handler.py
Python
apache-2.0
7,878
from concurrent import futures import threading import time """ Using map() with a Basic Thread Pool¶ The ThreadPoolExecutor manages a set of worker threads, passing tasks to them as they become available for more work. This example uses map() to concurrently produce a set of results from an input iterable. The tas...
scotthuang1989/Python-3-Module-of-the-Week
concurrency/futures/futures_thread_pool_map.py
Python
apache-2.0
1,050
# 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 required by applicable law or agre...
jettisonjoe/openhtf
examples/checkpoints.py
Python
apache-2.0
2,528
# # 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 # ...
fawadkhaliq/plumgrid-neutron-plugin
plugin/plumgrid/db/api.py
Python
apache-2.0
1,370
# -*- coding: utf-8 -*- { '!langcode!': 'nl', '!langname!': 'Nederlands', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" is een optionele expressie zoals "veld1=\'nieuwewaarde\'". Je kan de resultaten van een JOIN niet updaten of verwijderen...
xiang12835/python_web
py2_web2py/web2py/applications/admin/languages/nl.py
Python
apache-2.0
36,703
""" Train Class1 single allele models. """ import argparse import os import signal import sys import time import traceback import random from functools import partial import pandas import yaml from sklearn.metrics.pairwise import cosine_similarity from sklearn.model_selection import StratifiedKFold from .common import...
hammerlab/mhcflurry
mhcflurry/train_allele_specific_models_command.py
Python
apache-2.0
15,515
import srmanager.sr srm = srmanager.sr.SR() top = srm.get_topology() #for n in top: # for l in top[n]: # print "{} node, {} link, {} src-tp".format(n,l,top[n][l]['source-tp']) srm.del_all_flows(top) srm.add_sr_flows(top) srm.listen_to_topology()
brocade-apj/anzsdnhackathon2016
test.py
Python
apache-2.0
261
#!/usr/bin/env python # DinoCity is a full-screen Super Nintendo ROM launcher designed to be # controlled with a SNES game pad only. __author__ = ('David Anderson <dave@natulte.net>', 'Maxime Petazzoni <maxime.petazzoni@bulix.org>') import clutter import logging import os import struct import subproces...
mpetazzoni/dinocity
dinocity.py
Python
apache-2.0
8,839
# Copyright 2014 # The Cloudscaling Group, 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...
hayderimran7/ec2-api
ec2api/tests/unit/test_apirequest.py
Python
apache-2.0
5,776
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import absolute_import # -- prioritized -- import sys import os.path sys.path.append(os.path.join(os.path.dirname(__file__), '../libs')) # -- stdlib -- import json import subprocess # -- third party -- # -- own -- # -- code -- NET_PORT_LISTEN = os.path.join...
kadashu/satori
satori-rules/plugin/redis/30_redis_port_listen.py
Python
apache-2.0
906
"""Unit test for sysinfo. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import collections import os import sys import unittest import mock import six import treadmill import treadmill.appenv from treadmill im...
captiosus/treadmill
tests/sysinfo_test.py
Python
apache-2.0
7,333
import eventlet import gettext import sys from staccato.common import config import staccato.scheduler.interface as scheduler # Monkey patch socket and time eventlet.patcher.monkey_patch(all=False, socket=True, time=True) gettext.install('staccato', unicode=1) def fail(returncode, e): sys.stderr.write("ERROR: ...
buzztroll/staccato
staccato/cmd/scheduler.py
Python
apache-2.0
559
from org.transcrypt.stubs.browser import __pragma__ class Iterable: def __init__ (self, i): self.aList = range (0, 50, i) def __iter__ (self): return Iterator (self) class Iterator: def __init__ (self, iterable): self.iterable = iterable self.index = -...
QQuick/Transcrypt
transcrypt/development/automated_tests/transcrypt/iterators_and_generators/__init__.py
Python
apache-2.0
3,884
#!/usr/bin/env python # -*- coding: utf-8 -*- """ .. py:currentmodule:: pysemeels.project .. moduleauthor:: Hendrix Demers <hendrix.demers@mail.mcgill.ca> Container of EELS data. The EELS data are: * raw EELS spectrum * spectral imaging * point * line scan * map * EFSTEM image """ #################...
drix00/pysemeels
pysemeels/project.py
Python
apache-2.0
6,175
# ~*~ coding: utf-8 ~*~ """Pickle field implementation for Django.""" from copy import deepcopy from base64 import b64encode, b64decode from zlib import compress, decompress try: from cPickle import loads, dumps except ImportError: from pickle import loads, dumps from django.db import models from django.utils...
Haikson/virtenviro
virtenviro/picklefield/fields.py
Python
apache-2.0
6,480
# Copyright (c) 2019 Cisco Systems # 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 require...
noironetworks/aci-integration-module
aim/db/migration/alembic_migrations/versions/287c1e5b30c1_apic_assignment.py
Python
apache-2.0
1,478
# -*- coding: utf-8 -*- # Copyright 2010-2014, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this...
kishikawakatsumi/Mozc-for-iOS
src/dictionary/gen_pos_rewrite_rule.py
Python
apache-2.0
2,889
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2012 Zhang ZY<http://idupx.blogspot.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 # # http://www.apache.org/licenses/L...
bufferx/tns
tns/web/action/base.py
Python
apache-2.0
2,230
from __future__ import unicode_literals import time import datetime import boto3 from botocore.exceptions import ClientError import sure # noqa from moto import ( mock_batch, mock_iam, mock_ec2, mock_ecs, mock_logs, mock_cloudformation, ) import functools import json DEFAULT_REGION = "eu-cent...
william-richard/moto
tests/test_batch/test_batch_cloudformation.py
Python
apache-2.0
9,558
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Hub' db.create_table('webinars_hub', ( ('id', self.gf('django.db.models.fields...
prior/webinars
webinars_web/webinars/migrations/0001_initial.py
Python
apache-2.0
29,086
#!/usr/bin/env python # Copyright 2011 Google Inc. All Rights Reserved. # pylint: disable=g-bad-name import unittest from mapreduce.lib import pipeline from google.appengine.api import files from google.appengine.ext import db from mapreduce import context from mapreduce import input_readers from mapreduce impor...
bslatkin/8-bits
appengine-mapreduce/python/test/mapreduce/mapper_pipeline_test.py
Python
apache-2.0
10,472
from __future__ import print_function, division import imgaug as ia from imgaug import augmenters as iaa from imgaug import parameters as iap import numpy as np from scipy import ndimage, misc from skimage import data import matplotlib.pyplot as plt from matplotlib import gridspec import six import six.moves as sm impo...
dedoogong/asrada
utils/generate_example_images.py
Python
apache-2.0
15,371
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Tests for the OLE Compound File summary and document summary plugins.""" import unittest from plaso.parsers.olecf_plugins import summary from tests.parsers.olecf_plugins import test_lib class TestSummaryInformationOLECFPlugin(test_lib.OLECFPluginTestCase): """Tes...
Onager/plaso
tests/parsers/olecf_plugins/summary.py
Python
apache-2.0
2,434
# coding: utf-8 """ EnvironmentsApi.py Copyright 2015 SmartBear Software Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless requi...
thauser/pnc-cli
pnc_cli/swagger_client/apis/environments_api.py
Python
apache-2.0
7,145
from django import template from django.template.loader import render_to_string register = template.Library() @register.simple_tag def action_probe_config(action, action_config_d): return render_to_string(action.probe_config_template_name, {'action_config_d': action.get_probe_context_...
zentralopensource/zentral
zentral/core/probes/templatetags/probe_extras.py
Python
apache-2.0
355
from ex import * from common import * class NBayes: '''naive bayes classifier ''' def __init__(self): self.n, self.dim, self.options, self.pC, self.meanFC, self.stdFC = [None]*6 def Train(self, X, y, options = None): self.options = options prior = GetOptions( self....
excelly/xpy-ml
ex/ml/nbayes.py
Python
apache-2.0
4,772
from app.league.forms import LeagueForm from app.league.models import LeagueModel, create_league, update_league from app.user.views import login_required from flask import Blueprint, redirect, request, g, url_for, render_template LEAGUE_MODULE = Blueprint('league', __name__, url_prefix='/league') @LEAGUE_MODULE.rout...
sourlows/rating-cruncher
src/app/league/views.py
Python
apache-2.0
1,675
# -*- coding: utf-8 -*- u"""SMTP connection to send emails :copyright: Copyright (c) 2018-2019 RadiaSoft LLC. All Rights Reserved. :license: http://www.apache.org/licenses/LICENSE-2.0.html """ from __future__ import absolute_import, division, print_function from pykern import pkconfig from pykern.pkcollections impor...
mkeilman/sirepo
sirepo/smtp.py
Python
apache-2.0
1,222
# RESTful API from .ping import * from .post import *
Coderhypo/namiya
nayami/api/__init__.py
Python
apache-2.0
55
#!/usr/bin/env python # Copyright 2016 Emaad Ahmed Manzoor # License: Apache License, Version 2.0 # https://github.com/sbustreamspot/sbustreamspot-baselines from params import * from distribution import * import sys feat_file = sys.argv[1] feat_name = sys.argv[2] binwidth = float(sys.argv[3]) benign_values = [] mal...
sbustreamspot/sbustreamspot-baselines
distributions/feature_distributions.py
Python
apache-2.0
2,324
#coding=utf-8 ''' @author: Michael Wan @since: 2014-11-13 ''' import httplib import json import unittest import sys reload(sys) #http://www.pythoner.com/200.html #运行时没问题, 但是编译有有错误提示, 可以忽略。 sys.setdefaultencoding('utf8') print(sys.getdefaultencoding()) jsonString = "{\"address\":\"CN|\u5185\u8499\u...
onehao/opensource
pyml/lbs/webapi/genLocationByCoord.py
Python
apache-2.0
2,613
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2018-10-26 21:49 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('workflow', '0020_auto_20180918_1554'), ] operation...
mercycorps/TolaActivity
workflow/migrations/0021_auto_20181026_1449.py
Python
apache-2.0
11,276
""" Support for Dark Sky weather service. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.darksky/ """ from datetime import timedelta import logging from requests.exceptions import ( ConnectionError as ConnectError, HTTPError, Timeout) import ...
jamespcole/home-assistant
homeassistant/components/darksky/sensor.py
Python
apache-2.0
19,407
# Copyright 2014 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 required by applicable law or ...
ram8647/gcb-mobilecsp
tests/functional/progress_percent.py
Python
apache-2.0
9,285
#!/usr/bin/env python3 # Copyright 2017 The Kubernetes 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 appl...
brahmaroutu/test-infra
kettle/make_json.py
Python
apache-2.0
11,953
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import json import m...
dbentley/pants
src/python/pants/goal/run_tracker.py
Python
apache-2.0
15,278
#!/usr/bin/env python # Copyright 2016 Criteo # # 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...
criteo/biggraphite
biggraphite/metadata_cache.py
Python
apache-2.0
24,975
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """description""" from command.base_command import Command class InfoCommand(Command): def alias(self): return ['INFO', 'I'] def run(self, *args): return lambda sh: sh.output.write('{}\n'.format(sh.game))
mogproject/mog-cli-archive
mog_cli/command/info_command.py
Python
apache-2.0
280
from django.db import migrations, models DEVICE_FACE_CHOICES = ( (0, 'front'), (1, 'rear'), ) DEVICE_STATUS_CHOICES = ( (0, 'offline'), (1, 'active'), (2, 'planned'), (3, 'staged'), (4, 'failed'), (5, 'inventory'), (6, 'decommissioning'), ) def device_face_to_slug(apps, schema_ed...
digitalocean/netbox
netbox/dcim/migrations/0081_3569_device_fields.py
Python
apache-2.0
1,560
"""Copyright 2013 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 required by applicable law or agreed to in ...
google/pinject
pinject/object_graph.py
Python
apache-2.0
9,487
# Copyright 2017 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.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
jiaphuan/models
research/object_detection/models/faster_rcnn_nas_feature_extractor_test.py
Python
apache-2.0
4,505
# Copyright 2014-2015 Predikto, 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...
predikto/python-sdk
predikto/__init__.py
Python
apache-2.0
913
import demopkg2 print('demopkg2 :', demopkg2.__file__) import demopkg2.overloaded print('demopkg2.overloaded:', demopkg2.overloaded.__file__) print() demopkg2.overloaded.func()
jasonwee/asus-rt-n14uhp-mrtg
src/lesson_modules_and_packages/extension/pkgutil_devel.py
Python
apache-2.0
190
#!/usr/bin/env python # Copyright 2008-2015 Nokia Networks # Copyright 2016- Robot Framework Foundation # # 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.or...
alexandrul-ci/robotframework
src/robot/run.py
Python
apache-2.0
31,804
# -*- 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-retail
google/cloud/retail_v2/types/prediction_service.py
Python
apache-2.0
9,829
# Copyright (c) 2017 Cisco Systems, 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 r...
Tehsmash/networking-cisco
networking_cisco/plugins/ml2/drivers/cisco/nexus/nexus_helpers.py
Python
apache-2.0
2,914
# # This file is part of pySMT. # # Copyright 2014 Andrea Micheli and Marco Gario # # 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 ...
chubbymaggie/pysmt
pysmt/test/examples.py
Python
apache-2.0
19,804
# Copyright 2021 The FedLearner 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 applica...
bytedance/fedlearner
web_console_v2/api/fedlearner_webconsole/dataset/sparkapp/pipeline/transformer.py
Python
apache-2.0
1,826
#! coding:utf-8 from test.lib.testing import eq_, is_, assert_raises, assert_raises_message import datetime, re, operator, decimal from sqlalchemy import * from sqlalchemy import exc, sql, util, types, schema from sqlalchemy.sql import table, column, label, compiler from sqlalchemy.sql.expression import ClauseList, _l...
ioram7/keystone-federado-pgid2013
build/sqlalchemy/test/sql/test_compiler.py
Python
apache-2.0
135,109
#!/usr/bin/env python # # Copyright 2007 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...
GoogleCloudPlatform/appengine-python-standard
tests/google/appengine/ext/db/metadata_test.py
Python
apache-2.0
9,862
"""Support for Yamaha MusicCast Receivers.""" import logging import voluptuous as vol from homeassistant.components.media_player import MediaPlayerDevice, PLATFORM_SCHEMA from homeassistant.components.media_player.const import ( MEDIA_TYPE_MUSIC, SUPPORT_NEXT_TRACK, SUPPORT_PAUSE, SUPPORT_PLAY, SU...
Cinntax/home-assistant
homeassistant/components/yamaha_musiccast/media_player.py
Python
apache-2.0
8,888
###alignToKnownAlt #Copyright 2005-2008 J. David Gladstone Institutes, San Francisco California #Author Nathan Salomonis - nsalomonis@gmail.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 So...
nsalomonis/AltAnalyze
build_scripts/alignToKnownAlt.py
Python
apache-2.0
16,855
""" Tests - Deuce Client - API - Vault - Serialize """ from unittest import TestCase import deuceclient.api as api import deuceclient.common.errors as errors import deuceclient.common.validation as val from deuceclient.tests import * class VaultTest(VaultTestBase): def setUp(self): super(VaultTest, self...
rackerlabs/deuce-client
deuceclient/tests/test_api_vault_serialize.py
Python
apache-2.0
3,686
# Copyright 2018 The Lucid 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 applicable l...
tensorflow/lucid
lucid/misc/io/reading.py
Python
apache-2.0
6,910
# -*- coding: utf-8 -*- # Copyright (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 # # Unless...
HewlettPackard/oneview-redfish-toolkit
oneview_redfish_toolkit/tests/api/test_vlan_network_interface.py
Python
apache-2.0
2,138
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Sample script to generate a count of licenses used by app name, regardless of environment type (Prod, Devl, Qual, Cert, etc.) """ from __future__ import print_function from datetime import datetime import itertools from appd.cmdline import parse_argv from appd.requ...
tradel/AppDynamicsREST
examples/license_count_by_appgroup.py
Python
apache-2.0
3,020
# coding: utf-8 """ Wavefront REST API Documentation <p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the W...
wavefrontHQ/python-client
wavefront_api_client/models/paged_message.py
Python
apache-2.0
8,348
#!/usr/bin/python # -*- coding: utf-8 -*- # ------------------------------------------------------------------------------- # 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 copy...
yafraorg/yafra-archive
yafra-python/server/app/database.py
Python
apache-2.0
2,831
"""Tests for SSHSessionizerSketchPlugin""" from __future__ import unicode_literals import mock from timesketch.lib.analyzers.ssh_sessionizer import SSHSessionizerSketchPlugin from timesketch.lib.testlib import BaseTest from timesketch.lib.testlib import MockDataStore # TODO _create_mock_event will be renamed in anot...
google/timesketch
timesketch/lib/analyzers/ssh_sessionizer_test.py
Python
apache-2.0
6,085
''' Integration test for testing power off mini hosts. #1.operations & power off random hosts #2.start hosts #3.duplicated operation @author: zhaohao.chen ''' import apibinding.inventory as inventory import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_state as test_state import zstackwoodpecker...
zstackio/zstack-woodpecker
integrationtest/vm/mini/poweroff/test_poweroff_host_vm_backup_multicluster.py
Python
apache-2.0
3,546
"""The test for binary_sensor device automation.""" from datetime import timedelta from unittest.mock import patch import pytest import homeassistant.components.automation as automation from homeassistant.components.binary_sensor import DEVICE_CLASSES, DOMAIN from homeassistant.components.binary_sensor.device_conditi...
kennedyshead/home-assistant
tests/components/binary_sensor/test_device_condition.py
Python
apache-2.0
8,944
import logging from argh import arg from six import iteritems import json import pnc_cli.common as common import pnc_cli.cli_types as types import pnc_cli.utils as utils from pnc_cli import swagger_client from pnc_cli.pnc_api import pnc_api import sys def _create_build_config_set_object(**kwargs): created_bui...
janinko/pnc-cli
pnc_cli/buildconfigurationsets.py
Python
apache-2.0
14,566
import os.path import marshal DATA_DIR = 'data/' PYPI_DATA_DIR = 'data2/' def get_file_name(package, data_dir=DATA_DIR): return os.path.join(data_dir, '%s.bin' % package) def exists(package, data_dir=DATA_DIR): file_name = get_file_name(package, data_dir) return os.path.exists(file_name) def save_dat...
ducky427/python-dep
fileinfo.py
Python
apache-2.0
483
# Copyright (c) 2014 Cisco Systems 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 re...
CiscoSystems/nova-solver-scheduler
nova/scheduler/solvers/constraints/vcpu_constraint.py
Python
apache-2.0
3,119
# Copyright 2014 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 required by applicable law or a...
google/python-adb
adb/fastboot.py
Python
apache-2.0
15,438
""" Python directory syncer Report the difference in content of two directories, synchronise or update a directory from another, taking into account time-stamps of files etc. (c) Thomas Khyn 2014 Based on Robocopy by Anand B Pillai """ import os import sys import stat import time import shutil import re import logg...
mogoweb/365browser
script/dirsync-2.1/dirsync/syncer.py
Python
apache-2.0
19,976
""" 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 use this ...
JunHe77/bigtop
bigtop-packages/src/common/bigtop-ambari-mpack/bgtp-ambari-mpack/src/main/resources/stacks/BGTP/1.0/services/YARN/package/scripts/params_linux.py
Python
apache-2.0
25,014
# # Copyright (C) 2009 The Android Open Source 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/licenses/LICENSE-2.0 # # Unless required by applicable la...
Himmele/git-repo
subcmds/checkout.py
Python
apache-2.0
1,898
COUNTRY_MAPPING = { 380: "country_FYR", 272: "country_VAT", 233: "country_COT", 238: "country_DCO", 301: "country_MAC", 313: "country_MIC", 428: "country_PLE", 348: "country_RUS", 282: "country_ISR", 375: "country_SYR", 378: "country_TZA", 403: "country_WAL", 402: "co...
CDE-UNIBE/qcat
apps/wocat/management/commands/qa_mapping.py
Python
apache-2.0
146,526
# -*- coding: utf-8 -*- # This file is part of CairoSVG # Copyright © 2010-2012 Kozea # # This library is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your option...
nsalomonis/AltAnalyze
visualization_scripts/cairosvg/surface/__init__.py
Python
apache-2.0
14,955
import sys from solution import Solution from ListNode import ListNode class TestSuite: def run(self): self.test000() self.test001() self.test002() self.test003() self.test004() def test000(self): print "test 000" ...
54lihaoxin/leetcode_python
src/LinkedListCycle/test_suite.py
Python
apache-2.0
2,371
# -*- coding: utf-8 -*- from model.person import Person from model.group import Group from random import randrange import random def test_add_contact_to_group(app,db,check_ui): if len(db.get_contact_list()) == 0: app.contact.add_contact_fill_form(Person(firstname="John", lastname="Doe", company="paramou...
dmitryvorobev/python_training
test/test_add_contact_to_group.py
Python
apache-2.0
1,261
#!usr/bin/env python # -*- coding: utf-8 -*- import platform, random, time, logging, logging.handlers from pymongo import MongoClient from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities # 记录程序运行的日志文件设定 logfile = './log/log_util.log' logfile_size = 50 * 1024 * 1...
mayuanucas/paper_spider
util.py
Python
apache-2.0
3,583
""" Font Bakery CheckRunner is the driver of a font bakery suite of checks. Separation of Concerns Disclaimer: While created specifically for checking fonts and font-families this module has no domain knowledge about fonts. It can be used for any kind of (document) checking. Please keep it so. It will be valuable for...
graphicore/fontbakery
Lib/fontbakery/checkrunner.py
Python
apache-2.0
79,719
from model.contact import * import re def test_contacts_in_home_and_edit_pages(app, db): if app.contact.count() == 0: app.contact.create(PersonInfo(firstname="Test name", initials="Test initials", lastname="Test last name", nickname="Test nickname", title="Test title"...
Dob3r/python_training
test/test_contacts_in_home_and_database.py
Python
apache-2.0
5,586
__author__ = 'ivo' import os import struct import subprocess import logging _log = logging.getLogger(__name__) def is_yaffs_image(filepath): """ According to yaffs2 yaffs_guts.c source code: struct yaffs_obj_hdr { enum yaffs_obj_type type; <-- This can be an int value between 0 and 4 (likely 3) ...
3ev0/android-whitelist
blackswan/support/mounting.py
Python
apache-2.0
3,812
'''Provides utility functions for encoding and decoding linestrings using the Google encoded polyline algorithm. ''' def encode_coords(coords): '''Encodes a polyline using Google's polyline algorithm See http://code.google.com/apis/maps/documentation/polylinealgorithm.html for more information. ...
kyro38/TagData
googleMapPolyline.py
Python
apache-2.0
3,413
import os import boto import boto.ec2.elb from k.aws.config import AwsCreds, connection_hash from k.aws.config import RegionAwsCreds, region_connection_hash def connect(creds): """ Connect to autoscale, with user-provided options. :param region_creds: The region name and AWS credentials. :type region_creds: k.aws...
Knewton/k.aws
k/aws/elb.py
Python
apache-2.0
763
# -*- coding: utf-8 -*- #!/usr/bin/env python from gevent import monkey monkey.patch_all() import os import datetime import sys from easyspider.utils import import_object PROJDIR = os.path.abspath(os.path.dirname(__file__)) ROOTDIR = os.path.split(PROJDIR)[0] try: import site site.addsitedir(PROJDIR) pr...
feilaoda/easyspider
spider.py
Python
apache-2.0
1,336
# -*- coding: utf-8 -*- # Copyright 2021 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...
GoogleChrome/chromium-dashboard
api/login_api.py
Python
apache-2.0
1,390
#! /usr/bin/env python # Copyright (c) 2016-2018, Rethink Robotics 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 ...
RethinkRobotics/intera_sdk
intera_examples/scripts/go_to_joint_angles_in_contact.py
Python
apache-2.0
11,719
# (c) Adam Pridgen <adam.pridgen@thecoverofnight.com> # example of how to use getnames, and then find the first instruction # that meets the selected criteria # # Please do not release without asking permission first # GPLv3 import sys import idc import idaapi import idautils from ida_pro_collection impor...
deeso/python_scrirpts
ida/dsoftware_getmalloc_call_sz.py
Python
apache-2.0
1,399
#!/usr/bin/env python #This is a program which allows the user to modify the parameters of 8 sine waves with a graphical interface. These #parameters are then formatted and written to the specified serial port. from Tkinter import * import serial import time import math ##############################################...
alexmartinnnnnn/Mr_Runner_Servo
Brain.py
Python
apache-2.0
7,538
#!/usr/bin/env python """ """ import vtk def main(): colors = vtk.vtkNamedColors() fileName = get_program_parameters() # Read the image. readerFactory = vtk.vtkImageReader2Factory() reader = readerFactory.CreateImageReader2(fileName) reader.SetFileName(fileName) reader.Update() # ...
lorensen/VTKExamples
src/Python/ImageProcessing/Pad.py
Python
apache-2.0
3,435
#!/usr/bin/python #This is the program for clean all objects in .rgw.buckets pool # Frank Li 2014/12/12 # frank.likuohao@gmail.com import os #rados -p .rgw.buckets ls - > allbuckets os.system("rados -p .rgw.buckets ls - > allbuckets") #os.system("rad...
FrankLikuohao/inwin_ceph_toolset
clean_.rgw.buckets_objs.py
Python
apache-2.0
733
import glob import gzip import os import os.path import subprocess import sys import tables import numpy as np import find_intersecting_snps def read_bam(bam): """ Read a bam file into a list where each element of the list is a line from the bam file (with the newline stripped). The header is discarded. ...
smozaffari/WASP
mapping/test_find_intersecting_snps.py
Python
apache-2.0
95,042
# Copyright 2011 Justin Santa Barbara # 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 requ...
cloudbase/nova
nova/tests/functional/integrated_helpers.py
Python
apache-2.0
8,195
# -*- coding: utf-8 -*- ''' fantastic Add-on This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This pro...
TheWardoctor/Wardoctors-repo
script.module.fantastic/lib/resources/lib/modules/workers.py
Python
apache-2.0
949
# Copyright 2013-2015 DataStax, 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...
HackerEarth/cassandra-python-driver
tests/integration/standard/test_metadata.py
Python
apache-2.0
37,798
# -*- 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, software...
openstack/oslo.cache
releasenotes/source/conf.py
Python
apache-2.0
9,053
# tests.test_text.test_dispersion # Tests for the dispersion plot visualization # # Author: Larry Gray # Created: 2018-06-22 15:27 # # Copyright (C) 2018 The scikit-yb developers # For license information, see LICENSE.txt # # ID: test_dispersion.py [25f1b9a] lwgray@gmail.com $ """ Tests for the dispersion plot text...
DistrictDataLabs/yellowbrick
tests/test_text/test_dispersion.py
Python
apache-2.0
4,613
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
googleapis/python-dialogflow
samples/generated_samples/dialogflow_generated_dialogflow_v2_agents_delete_agent_sync.py
Python
apache-2.0
1,394
# Copyright 2019-present Kensho Technologies, LLC. import html import re from typing import Any, Dict, List, Optional, Sequence from graphql import GraphQLList, GraphQLScalarType from ..compiler.compiler_frontend import OutputMetadata from ..deserialization import deserialize_scalar_value def _mssql_xml_path_string...
kensho-technologies/graphql-compiler
graphql_compiler/post_processing/sql_post_processing.py
Python
apache-2.0
5,017
from contextlib import contextmanager import difflib import filecmp import io import json import os import re import sys from unittest.mock import Mock @contextmanager def capture(): with capture_std_streams(streams=['stdout']) as captured_streams: yield captured_streams['stdout'] def capture_std_streams...
aspuru-guzik-group/mission_control
mc/utils/testing/__init__.py
Python
apache-2.0
4,440
# coding: utf-8 from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import (Column, Integer, Text, String, DateTime, ForeignKey, Boolean) from sqlalchemy.orm import relationship Base = declarative_base() class User(Base): __tablename__ = 'users' id = Column(Intege...
junqueira/snitch
snitch/models.py
Python
apache-2.0
5,428
import requests import logging import datetime class BuildResult: Failure, Unstable, Success, NotBuilt, Other = range(5) class Build(object): def __init__(self, json_obj): self.display_name = json_obj['displayName'] if json_obj['result'] == 'SUCCESS': self.result = BuildResult.S...
suzukieng/dot-jenkins
jenkins.py
Python
apache-2.0
4,317
import argparse import logging import sys from inspect import isclass import lightbus from lightbus.commands import utilities as command_utilities from lightbus.plugins import PluginRegistry from lightbus.utilities.async_tools import block logger = logging.getLogger(__name__) class Command: def setup(self, pars...
adamcharnock/lightbus
lightbus/commands/shell.py
Python
apache-2.0
1,899