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 |
|---|---|---|---|---|---|
"""Support for vacuum cleaner robots (botvacs)."""
from dataclasses import dataclass
from datetime import timedelta
from functools import partial
import logging
from typing import final
import voluptuous as vol
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ( # noqa: F401 # STAT... | home-assistant/home-assistant | homeassistant/components/vacuum/__init__.py | Python | apache-2.0 | 11,828 |
import ipaddress
import urllib.parse
import bs4
import pytest
from requests.exceptions import ConnectionError
from retrying import retry
__maintainer__ = 'vespian'
__contact__ = 'dcos-security@mesosphere.io'
def test_if_dcos_ui_is_up(dcos_api_session):
r = dcos_api_session.get('/')
assert r.status_code == ... | mellenburg/dcos | packages/dcos-integration-test/extra/test_endpoints.py | Python | apache-2.0 | 11,490 |
"""Tests for egta online scheduler"""
import asyncio
import contextlib
import random
import numpy as np
import pytest
from egtaonline import api
from egtaonline import mockserver
from gameanalysis import rsgame
from egta import countsched
from egta import eosched
# TODO general setup may be done with a fixture in p... | egtaonline/quiesce | test/test_eosched.py | Python | apache-2.0 | 6,888 |
# requires:
# pip install discord.py
# pip install asyncio
# pip install bs4
# pip install imgurpython
# pip install youtube-dl
# pip install chatterbot
# put this (view raw) in the base directory for windows:
# https://github.com/Just-Some-Bots/MusicBot/blob/ea5e0daebd384ec8a14c9a585da399934e2a6252/libopus-0.x64.dll... | TuDatTr/OkBot | main.py | Python | apache-2.0 | 10,102 |
# -*- 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 copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# ... | angus-ai/angus-service-facedetection | angus/services/__init__.py | Python | apache-2.0 | 915 |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import functools
import importlib
import inspect
import threading
from builtins import st... | foursquare/pants | tests/python/pants_test/engine/examples/parsers.py | Python | apache-2.0 | 10,272 |
# -*- coding: utf-8 -*-
# Copyright 2013 Mirantis, 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 requi... | SmartInfrastructures/fuel-web-dev | nailgun/nailgun/statistics/oswl/collector.py | Python | apache-2.0 | 4,429 |
"""
:codeauthor: Thomas Stoner <tmstoner@cisco.com>
"""
# Copyright (c) 2018 Cisco and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/li... | saltstack/salt | tests/unit/modules/nxos/nxos_n5k.py | Python | apache-2.0 | 5,857 |
from .transform_base import H2OTransformer
class H2OScaler(H2OTransformer):
"""
Standardize an H2OFrame by demeaning and scaling each column.
The default scaling will result in an H2OFrame with columns
having zero mean and unit variance. Users may specify the
centering and scaling values used in the standard... | bospetersen/h2o-3 | h2o-py/h2o/transforms/preprocessing.py | Python | apache-2.0 | 3,037 |
#import sys
#sys.path.append('../')
import responses
import requests
#from lunaport_client import LunaportClinetv1
#import lunaport_client as lc
#print lc.__version__
#import .. lunaport_client
#from ..lunaport_client import LunaportClinet
#from lunaport_client import LunaportClinet as lunac
#lunac = lunaport_client... | greggyNapalm/lunaport_client | lunaport_client/tests/test_server_resource.py | Python | apache-2.0 | 1,964 |
#!/usr/bin/env python
#
# Copyright 2015 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... | Aloomaio/googleads-python-lib | examples/ad_manager/v201808/creative_service/create_creatives.py | Python | apache-2.0 | 2,868 |
#! /usr/bin/python
# Basic Matrix factorization
import numpy as np
class bmf():
def __init__(self, k = 100, rounds = 50, alpha = 0.005, beta = 0.02, train_fn = '', validate_fn = '', pred_fn = '', output = ''):
self.k = k
self.rounds = rounds
self.alpha = alpha
self.beta = beta
self.train_fn = train_f... | xunzhang/roraima | tools/mf.py | Python | apache-2.0 | 3,744 |
# Note: Even though this has Sphinx format, this is not meant to be part of the public docs
"""
************
File Caching
************
Implements a cache on local disk for Synapse file entities and other objects
with a `FileHandle <https://rest.synapse.org/org/sagebionetworks/repo/model/file/FileHandle.html>`_.
This ... | kkdang/synapsePythonClient | synapseclient/cache.py | Python | apache-2.0 | 11,025 |
# -*- 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, ... | pmverdugo/fiware-validator | validator/tests/clients/test_chef_client.py | Python | apache-2.0 | 4,428 |
'''
Copyright 2017 Dell Inc. or its subsidiaries. All Rights Reserved.
Author(s):
Norton Luo
This test validate the AMQP message send out in the workflow, and node delete and discover.
It also validate the web hook api and node registeration function.
Ths test will choose a node and reset it. After the system... | RackHD/RackHD | test/tests/amqp/test_amqp_node_rediscover.py | Python | apache-2.0 | 18,627 |
from distutils.dir_util import copy_tree
from operator import itemgetter
import pandas as pd
import sys
from jinja2 import Environment, FileSystemLoader
import os
def generate_reports(folder):
hosts = []
# get all the paths of the root folder
files = [os.path.join(folder, fn) for fn in next(os.walk(folde... | shelan/collectl-monitoring | plotter.py | Python | apache-2.0 | 3,847 |
#
# 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 us... | holdenk/spark | python/pyspark/ml/param/shared.py | Python | apache-2.0 | 24,706 |
# Copyright (c) 2012 Rackspace Hosting
# All Rights Reserved.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");... | afrolov1/nova | nova/cells/messaging.py | Python | apache-2.0 | 84,342 |
from .types.CMakeVariable import CMakeVariable
from .types.VariableCollection import VariableCollection
class CMakeBehavior(VariableCollection):
"""CMake Behavior related variables"""
BUILD_SHARED_LIBS = ()
CMAKE_ABSOLUTE_DESTINATION_FILES = ()
CMAKE_APPBUNDLE_PATH = ()
CMAKE_AUTOMOC_RELAXED_MODE... | grbd/GBD.Build.BlackJack | blackjack/cmake/vars/CMakeBehavior.py | Python | apache-2.0 | 2,553 |
"""Copyright 2008 Orbitz WorldWide
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... | Talkdesk/graphite-web | webapp/graphite/browser/views.py | Python | apache-2.0 | 7,137 |
# 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... | Juniper/tempest | tempest/tests/lib/common/test_http.py | Python | apache-2.0 | 2,801 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Contributor.zipcode_short'
db.add_column(u'tx_tecreports_... | texas/tx_tecreports | tx_tecreports/migrations/0007_auto__add_field_contributor_zipcode_short.py | Python | apache-2.0 | 13,870 |
# coding=utf-8
# Copyright 2015 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 os
import uni... | ity/pants | tests/python/pants_test/engine/test_fs.py | Python | apache-2.0 | 7,436 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import os
import unittest
import shutil
import gransk.core.helper as helper
import gransk.core.tests.test_helper as test_helper
import gransk.core.document as document
import gransk.plugins.storage.store_text as store_... | pcbje/gransk | gransk/plugins/storage/tests/store_text_test.py | Python | apache-2.0 | 1,005 |
# 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 ... | Scalr/libcloud | libcloud/extra/drivers/google.py | Python | apache-2.0 | 6,824 |
# This file is part of the MapProxy project.
# Copyright (C) 2012 Omniscale <http://omniscale.de>
#
# 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... | Anderson0026/mapproxy | mapproxy/test/system/test_cache_source.py | Python | apache-2.0 | 5,009 |
"""
:codeauthor: Joao Mesquita <jmesquita@sangoma.com>
"""
import datetime
import os
import time
import salt.utils.files
from salt import fileserver
from tests.support.helpers import with_tempdir
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import TestCase
class MapDiffTestCas... | saltstack/salt | tests/unit/test_fileserver.py | Python | apache-2.0 | 2,610 |
#! /usr/bin/env python3
# -*- 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 requi... | googleapis/python-monitoring-dashboards | scripts/fixup_dashboard_v1_keywords.py | Python | apache-2.0 | 6,186 |
#----------------------------------------------------------------------------------------------------------------------#
# Introdução a Programação de Computadores - IPC
# Universidade do Estado do Amazonas - UEA
#
# Adham Lucas da Silva Oliveira 1715310059
# Alexandre Marques Uchôa 1715310028
# A... | jucimarjr/IPC_2017-1 | lista04/lista04_lista02_questao21.py | Python | apache-2.0 | 2,408 |
# -*- coding: utf-8 -*-
# (C) Copyright 2014 Voyager Search
#
# 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... | voyagersearch/voyager-py | extractors/VoyagerWorkerPy.py | Python | apache-2.0 | 3,354 |
# Copyright 2022 The jax3d 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 wr... | google-research/jax3d | jax3d/projects/nesf/nerfstatic/utils/types_test.py | Python | apache-2.0 | 2,544 |
"""
Created on November 20, 2019
This file is subject to the terms and conditions defined in the
file 'LICENSE.txt', which is part of this source code package.
@author: David Moss
"""
# Section ID's
SECTION_ID_ALERTS = "alerts"
SECTION_ID_NOTES = "notes"
SECTION_ID_TASKS = "tasks"
SECTION_ID_SLEEP = "sleep"
SECTION_... | peoplepower/botengine | com.ppc.Bot/utilities/dailyreport.py | Python | apache-2.0 | 1,792 |
# 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 under the Li... | pwhittlesea/freestyle-multi-branch-project-module | modules/project_multibranch.py | Python | apache-2.0 | 6,733 |
# 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... | alexgorban/models | samples/outreach/blogs/blog_estimators_dataset.py | Python | apache-2.0 | 6,320 |
from django import forms
class LoginForm(forms.Form):
login = forms.CharField(max_length=255)
password = forms.CharField(widget=forms.PasswordInput())
target = forms.CharField()
| sstacha/uweb-install | cms_files/forms.py | Python | apache-2.0 | 192 |
from model.contact import Contact #создаем скрипт для генерации групп с последующим сохранением в файл
import random
import string
import os.path
import jsonpickle
import getopt
import sys
try: #почитай про трай
opts, args = getopt.getopt(sys.argv[1:], "n:f:", ["number of contacts","file"]) #опция n задает кол-во... | HowAU/python-training | generator/contact.py | Python | apache-2.0 | 2,357 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2013 OpenStack Foundation.
# 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.... | CingHu/neutron-ustack | neutron/extensions/uos_net_ratelimits.py | Python | apache-2.0 | 1,922 |
from datetime import datetime
import urllib.request
import time
from subprocess import call
import sys
import os
retry_time = 45
# save_path = ""
def get_raw_data(path):
start = time.clock()
query = "http://export.arxiv.org/oai2?verb=ListRecords&metadataPrefix=oai_dc"
print("request: %s" % (query))
... | sciosci/nsf_data_ingestion | nsf_data_ingestion/arxiv/fetch_data_hdfs_loop.py | Python | apache-2.0 | 2,651 |
import random
def pivot(items, a, b):
p = items[b]
i = a
for j in range(a,b):
if items[j] <= p:
items[i], items[j] = items[j], items[i]
i += 1
items[i], items[b] = items[b], items[i]
return i
def quicksort(items, i, j):
"""
inplace quicksort
"""
if... | cbare/Etudes | python/quick_sort.py | Python | apache-2.0 | 572 |
# Copyright 2018 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 applic... | tensorflow/io | tests/test_dicom.py | Python | apache-2.0 | 7,159 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='loanproduct',
name='acc... | AjabWorld/ajabsacco | ajabsacco/core/migrations/0002_auto_20150508_0542.py | Python | apache-2.0 | 1,088 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | joshuamckenty/yolo-octo-wookie | nova/endpoint/images.py | Python | apache-2.0 | 2,782 |
from rstem import led_matrix, accel
import RPi.GPIO as GPIO
import random
import time
import sys
# notify of progress
print("P50")
sys.stdout.flush()
# set up led matrix
#led_matrix.init_grid(2,2)
led_matrix.init_matrices([(0,8),(8,8),(8,0),(0,0)])
# set up accelometer
accel.init(1)
# notify of progress
print("P60"... | scottsilverlabs/raspberrystem | rstem/projects/led_matrix_games/aspirin.py | Python | apache-2.0 | 9,366 |
# Copyright (c) 2013 OpenStack Foundation
# 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 ... | blueboxgroup/neutron | neutron/plugins/ml2/driver_api.py | Python | apache-2.0 | 35,825 |
#! usr/bin/python
from __future__ import print_function, division, absolute_import
from os import remove
from os.path import join, abspath
from sys import stdout, exit
from time import time
import multiprocessing as mp
from argparse import ArgumentParser
import logging
import numpy as np
from disvis import DisVis, PD... | haddocking/disvis | disvis/main.py | Python | apache-2.0 | 23,344 |
""".. Ignore pydocstyle D400.
===================
Resolwe Bio Filters
===================
"""
import django_filters as filters
from rest_framework import exceptions
from resolwe.flow.filters import CollectionFilter, DataFilter, EntityFilter
from resolwe_bio.models import Sample
class BioCollectionFilter(Collectio... | genialis/resolwe-bio | resolwe_bio/filters.py | Python | apache-2.0 | 4,334 |
# Copyright 2013 Mirantis Inc.
# Copyright 2013 Rackspace Hosting.
#
# 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
#
# Unles... | mrunge/horizon | openstack_dashboard/dashboards/project/databases/tests.py | Python | apache-2.0 | 14,619 |
# -*- coding: utf-8 -*-
# Copyright (c) 2013 PolyBeacon, 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 applica... | kickstandproject/python-payloadclient | payloadclient/shell/v1/agent.py | Python | apache-2.0 | 1,641 |
import io
from operator import itemgetter
import pytest
from clldutils.markup import Table, iter_markdown_tables, iter_markdown_sections
def test_Table():
t = Table()
assert t.render() == ''
t = Table('a', 'b', rows=[[1, 2], [3, 4]])
assert t.render() == \
'| a | b |\n|----:|----:|\n| 1 | 2... | clld/clldutils | tests/test_markup.py | Python | apache-2.0 | 1,781 |
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from c7n_azure.provider import resources
from c7n_azure.resources.arm import ArmResourceManager
@resources.register('container-registry', aliases=['containerregistry'])
class ContainerRegistry(ArmResourceManager):
"""Container Registr... | thisisshi/cloud-custodian | tools/c7n_azure/c7n_azure/resources/container_registry.py | Python | apache-2.0 | 1,144 |
#!/usr/bin/env python3
# Copyright 2013-present Barefoot Networks, 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... | p4lang/behavioral-model | mininet/1sw_demo.py | Python | apache-2.0 | 3,488 |
# FileDescriptorProtos pretty-printer tool.
#
# protoprint.py provides the canonical .proto formatting for the Envoy APIs.
#
# See https://github.com/google/protobuf/blob/master/src/google/protobuf/descriptor.proto
# for the underlying protos mentioned in this file.
#
# Usage: protoprint.py <source file path> <type dat... | envoyproxy/envoy | tools/protoxform/protoprint.py | Python | apache-2.0 | 31,369 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the extraction tool object."""
import argparse
import unittest
from plaso.cli import extraction_tool
from plaso.lib import errors
from tests import test_lib as shared_test_lib
from tests.cli import test_lib
class ExtractionToolTest(test_lib.CLIToolTestCase):
... | dc3-plaso/plaso | tests/cli/extraction_tool.py | Python | apache-2.0 | 8,555 |
''' A self-contained test file.
@author Emma Wang
'''
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from tensorflow.contrib.tpu.python.tpu import tpu_config
from tensorflow.contrib.tpu.python.tpu import tpu_estimator
from tensorfl... | Emma926/paradnn | test.py | Python | apache-2.0 | 4,858 |
import logging
from flask_script import Manager
from flask_migrate import MigrateCommand
from seedbox.app import app
manager = Manager(app)
manager.add_command('db', MigrateCommand)
@manager.command
def watch_updates():
"""Starts component updates watcher in foreground (CoreOS, k8s, etcd)"""
from seedbox i... | nailgun/seedbox | src/seedbox/manage.py | Python | apache-2.0 | 478 |
from cherrypy.test import test
test.prefer_parent_path()
import cherrypy
script_names = ["", "/path/to/myapp"]
def setup_server():
# Set up site
cherrypy.config.update({
'environment': 'test_suite',
'tools.proxy.on': True,
'tools.proxy.base': 'www.mydomain.test',
... | cread/ec2id | cherrypy/test/test_proxy.py | Python | apache-2.0 | 4,957 |
# Copyright 2010-2011 OpenStack Foundation
# 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... | liverbirdkte/searchlight | searchlight/tests/utils.py | Python | apache-2.0 | 18,006 |
import os
import requests # pip install requests
# Please NOTE: In this sample we're assuming Cloud Api Server is hosted at "https://localhost".
# If it's not then please replace this with with your hosting url.
# Base URL for PDF.co Web API requests
BASE_URL = "https://localhost"
# Source file name
SourceFile = ".... | bytescout/ByteScout-SDK-SourceCode | Cloud API Server/Barcode Reader API/Python/Read Barcode From Uploaded File/ReadBarcodeFromUploadedFile.py | Python | apache-2.0 | 3,125 |
#!/usr/bin/python
import realog.debug as debug
import lutin.tools as tools
import lutin.macro as macro
def get_type():
return "LIBRARY"
#return "BINARY"
def get_sub_type():
return "TOOLS"
def get_desc():
return "ZEUS picture service"
def get_licence():
return "MPL-2"
def get_compagny_type():
return "com"
d... | atria-soft/zeus | tools/service-picture/lutin_zeus-service-picture.py | Python | apache-2.0 | 845 |
#!/usr/bin/python
#
# 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 b... | cctaylor/googleads-python-lib | examples/adwords/v201409/extensions/add_site_links_using_feeds.py | Python | apache-2.0 | 9,573 |
#!/usr/bin/python3 -W all
"""
getTweetText.py: extract tweet text from json file
usage: getTweetText.py < file
20170418 erikt(at)xs4all.nl
"""
import csv
import json
import re
import sys
# command name for error messages
COMMAND = sys.argv[0]
patternNewline = re.compile("\n")
# open csv output
with sys.s... | online-behaviour/machine-learning | getTweetText.py | Python | apache-2.0 | 1,768 |
#!/usr/bin/python
#coding:utf-8
# Filename: pickling.py
import pickle
# the name of the file where we will store the object
shoplistfile = 'shoplist.data'
# the list of things to buy
shoplist = ['apple', 'mango', 'carrot']
# Write to the file
f = open(shoplistfile, 'wb')
pickle.dump(shoplist, f) # 转储对象到文件
... | PythonT/Crawler | pickling.py | Python | apache-2.0 | 800 |
# 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 under t... | briancurtin/python-openstacksdk | openstack/cluster/v1/_proxy.py | Python | apache-2.0 | 52,340 |
"""
Component that will help set the Dlib face detect processing.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/image_processing.dlib_face_detect/
"""
import logging
import io
from homeassistant.core import split_entity_id
# pylint: disable=unused-impo... | jamespcole/home-assistant | homeassistant/components/dlib_face_detect/image_processing.py | Python | apache-2.0 | 2,155 |
'''Handle configuration for zarkov.
We support full configuration on the command line with defaults supplied by
either an .ini-style config file or a yaml (and thus json) config file.
'''
import sys
import logging.config
from optparse import OptionParser
from ConfigParser import ConfigParser
import yaml
import coland... | joeywen/zarkov | zarkov/config.py | Python | apache-2.0 | 10,451 |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google/picatrix | picatrix/notebook_init.py | Python | apache-2.0 | 1,081 |
"""
This sample shows how to create a
replica from portal of a feature service
"""
import arcrest
from arcrest.security import AGOLTokenSecurityHandler
def trace():
"""
trace finds the line, the filename
and error message and returns it
to the user
"""
import traceback, inspe... | jgravois/ArcREST | samples/create_replica_portal_item.py | Python | apache-2.0 | 2,205 |
# 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 ... | SkyLined/headsup | decode/GIF_IMAGE.py | Python | apache-2.0 | 2,315 |
#------------------------------------------------------------------------------
# Copyright 2013 Esri
# 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/LICENS... | JudTown17/solutions-geoprocessing-toolbox | capability/test/test_erg_tools/TestUtilities.py | Python | apache-2.0 | 1,365 |
from . import shim
tmpdir = None
def setUp():
global tmpdir
tmpdir = shim.setup_shim_for('kubectl')
def tearDown():
global tmpdir
shim.teardown_shim_dir(tmpdir)
| SpectoLabs/myna | contrib/python-myna/myna/__init__.py | Python | apache-2.0 | 180 |
#!/usr/bin/python2.7
# -*- encoding: UTF-8 -*-
# gps_test created on 15/8/22 上午12:44
# Copyright 2014 offbye@gmail.com
"""
"""
__author__ = ['"Xitao":<offbye@gmail.com>']
import gps3
gps_connection = gps3.GPSDSocket()
gps_fix = gps3.Fix()
try:
for new_data in gps_connection:
if new_data:
... | offbye/PiBoat | pyboat/gps_test.py | Python | apache-2.0 | 604 |
from django import forms
class PutForm(forms.Form):
body = forms.CharField(widget=forms.Textarea())
tube = forms.CharField(initial='default')
priority = forms.IntegerField(initial=2147483648)
delay = forms.IntegerField(initial=0)
ttr = forms.IntegerField(initial=120)
| andreisavu/django-jack | jack/beanstalk/forms.py | Python | apache-2.0 | 291 |
#!/usr/bin/python
## Binary Analysis Tool
## Copyright 2013-2016 Armijn Hemel for Tjaldur Software Governance Solutions
## Copyright 2016 Armijn Hemel for Insignary Inc.
## Licensed under Apache 2.0, see LICENSE file for details
import os, os.path, sys, subprocess, copy, cPickle, tempfile, hashlib, shutil, multiproce... | armijnhemel/binaryanalysis | src/bat/generateimages.py | Python | apache-2.0 | 18,625 |
from __future__ import absolute_import
import base64
import typing as tp
from selenium.common.exceptions import WebDriverException
from applitools.core import EyesScreenshot, EyesError, Point, Region, OutOfBoundsError
from applitools.utils import image_utils
from applitools.selenium import eyes_selenium_utils
from a... | applitools/eyes.selenium.python | applitools/selenium/capture/eyes_webdriver_screenshot.py | Python | apache-2.0 | 9,401 |
import sys
import requests
import json
import time
if len(sys.argv) < 3:
raise Exception("No endpoint specified. ")
endpoint = sys.argv[1]
headers = {
'Host': sys.argv[2]
}
payload_file = "input.json"
if len(sys.argv) > 3:
payload_file = sys.argv[3]
with open(payload_file) as file:
payload = json.lo... | kubeflow/kfserving-lts | docs/samples/explanation/aif/germancredit/query_bias.py | Python | apache-2.0 | 778 |
""" Cisco_IOS_XR_rgmgr_cfg
This module contains a collection of YANG definitions
for Cisco IOS\-XR rgmgr package configuration.
This module contains definitions
for the following management objects\:
redundancy\-group\-manager\: Redundancy Group Manager
Configuration
Copyright (c) 2013\-2016 by Cisco Systems,... | 111pontes/ydk-py | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_rgmgr_cfg.py | Python | apache-2.0 | 35,273 |
from novaclient import exceptions
from novaclient.v1_1 import security_group_rules
from novaclient.tests import utils
from novaclient.tests.v1_1 import fakes
cs = fakes.FakeClient()
class SecurityGroupRulesTest(utils.TestCase):
def test_delete_security_group_rule(self):
cs.security_group_rules.delete(1)... | tylertian/Openstack | openstack F/python-novaclient/novaclient/tests/v1_1/test_security_group_rules.py | Python | apache-2.0 | 2,485 |
from __future__ import with_statement
from robot.api import logger
class WrongStat(AssertionError):
ROBOT_CONTINUE_ON_FAILURE = True
def get_total_stats(path):
return get_all_stats(path)[0]
def get_tag_stats(path):
return get_all_stats(path)[1]
def get_suite_stats(path):
return get_all_stats(path)... | Senseg/robotframework | atest/robot/output/html_output_stats.py | Python | apache-2.0 | 1,194 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 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... | d4l3k/compute-archlinux-image-builder | arch-staging.py | Python | apache-2.0 | 5,271 |
#!/usr/bin/python3
# Copyright (c) 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | openstack/ironic | devstack/files/hooks/qemu.py | Python | apache-2.0 | 3,351 |
#MenuTitle: Report Compatibility by Numbers
# -*- coding: utf-8 -*-
from __future__ import print_function, division, unicode_literals
__doc__="""
Outputs path count, node count, anchor count etc. of selected glyphs in the Macro Window.
"""
import GlyphsApp
font = Glyphs.font # frontmost font
fontMaster = font.selecte... | Tosche/Glyphs-Scripts | Path/Report Compatibility by Numbers.py | Python | apache-2.0 | 1,305 |
# Copyright 2013 IBM Corp.
# 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 a... | akash1808/glance | glance/tests/unit/v2/test_tasks_resource.py | Python | apache-2.0 | 32,063 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-05-12 16:09
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
import model_utils.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
... | IQSS/geoconnect | gc_apps/content_pages/migrations/0001_initial.py | Python | apache-2.0 | 1,770 |
#encoding:utf-8
__authors__ = ['"Wei Keke" <keke.wei@cs2c.com.cn>']
__version__ = "V0.1"
'''
# ChangeLog:
#---------------------------------------------------------------------------------
# Version Date Desc Author
#----------------------------------------------------... | faylau/oVirt3.3WebAPITest | src/TestData/Profile/ITC090402_UpdateProfile_DupName.py | Python | apache-2.0 | 1,804 |
import string
import os, sys
try:
import json
except ImportError:
import simplejson as json
import subprocess
### url = 'http://bubba.jpl.nasa.gov:8083'
url = 'http://cmacws.jpl.nasa.gov:8083'
# function to print out mesg
def print_mesg(mesg, keyword):
if keyword is 'Error':
keyword1 = 'Err'
else:
k... | chrismattmann/apple | distribution/src/main/resources/bin/checker_client.py | Python | apache-2.0 | 2,189 |
import scrapy
from scrapy.selector import Selector
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import CrawlSpider, Rule
from crawlers.items import JdItem
from scrapy.http import TextResponse,FormRequest,Request
import json
class JdHardwareSpider(scrapy.Spider):
name = 'jd-hardware'
allo... | jackliusr/scrapy-crawlers | crawlers/crawlers/spiders/jd_hardware.py | Python | apache-2.0 | 2,190 |
from net.wyun.mer.ink import scginkparser
import numpy as np
from net.wyun.mer.ink.stroke import Stroke
from net.wyun.mer.ink.stroke import get_bounding_box
from net.wyun.mer.ink.stroke import get_bounding_box_h1000
from net.wyun.mer.ink.sample import Sample
from scipy import misc
# Import `load_workbook` module from ... | michaelyin/im2markup-prep | net/wyun/mer/prep/xlsxhandler.py | Python | apache-2.0 | 2,067 |
# tests.test_contrib.test_wrapper
# Tests third-party estimator wrapper
#
# Author: Benjamin Bengfort
# Created: Fri Oct 02 17:27:50 2020 -0400
#
# Copyright (C) 2020 The scikit-yb developers
# For license information, see LICENSE.txt
#
# ID: test_wrapper.py [] benjamin@bengfort.com $
"""
Tests third-party estimato... | DistrictDataLabs/yellowbrick | tests/test_contrib/test_wrapper.py | Python | apache-2.0 | 7,549 |
import sys
import os
modulepath = os.path.abspath(os.path.join(os.path.dirname(__file__), '../'))
if modulepath not in sys.path:
sys.path.insert(0, modulepath)
from mdstudio.runner import main
from lie_echo.application import EchoComponent
if __name__ == '__main__':
main(EchoComponent)
| MD-Studio/MDStudio | components/lie_echo/lie_echo/__main__.py | Python | apache-2.0 | 299 |
# binary mining.
# say we have a pair of binary encoded predicates, and we have have a sample of the truth values of them
# we want to learn if some logic exist between the two predicates. A->B or B->A. Nothing more.
# given bayesian null prior, establish a confidence method to hypothesize and learn.
# Just a sanity ch... | Fuchai/Philosophy-Machine | vae_mining/binary_mining.py | Python | apache-2.0 | 1,418 |
# coding=utf-8
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import unittest
from pants.task.unpack_remote_sources_base import UnpackRemoteSourcesBas... | twitter/pants | tests/python/pants_test/task/test_unpack_remote_sources_base.py | Python | apache-2.0 | 2,506 |
# -*- 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, softw... | kickstandproject/wildcard | wildcard/dashboards/admin/info/tables.py | Python | apache-2.0 | 2,073 |
# 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... | Huyuwei/tvm | vta/tests/python/integration/test_benchmark_topi_conv2d.py | Python | apache-2.0 | 10,351 |
# 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 under t... | 394954369/horizon | openstack_dashboard/dashboards/project/volumes/backups/tests.py | Python | apache-2.0 | 7,167 |
"""ThreatConnect Batch Import Module"""
# standard library
import json
import uuid
from typing import Any, Callable, Optional, Union
# first-party
from tcex.api.tc.v2.batch.attribute import Attribute
from tcex.api.tc.v2.batch.security_label import SecurityLabel
from tcex.api.tc.v2.batch.tag import Tag
from tcex.utils ... | ThreatConnect-Inc/tcex | tcex/api/tc/v2/batch/group.py | Python | apache-2.0 | 21,524 |
# Copyright 2018 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 ... | deepmind/pysc2 | pysc2/lib/buffs.py | Python | apache-2.0 | 2,114 |
"""Migrates the private key encrypted column from AES to fernet encryption scheme.
Revision ID: ed422fc58ba
Revises: 4bcfa2c36623
Create Date: 2015-10-23 09:19:28.654126
"""
import base64
# revision identifiers, used by Alembic.
revision = 'ed422fc58ba'
down_revision = '4bcfa2c36623'
import six
from StringIO import... | rpicard/lemur | lemur/migrations/versions/ed422fc58ba_.py | Python | apache-2.0 | 9,340 |
#!/usr/bin/env python
import rospy
from chapter3.msg import Complex
def callback(msg):
print 'Real:', msg.real
print 'Imaginary:', msg.imaginary
print
rospy.init_node('message_subscriber')
sub = rospy.Subscriber('complex', Complex, callback)
rospy.spin()
| gbiggs/ros_book_sample_code | chapter3/src/message_subscriber.py | Python | apache-2.0 | 275 |
"""Auto-generated file, do not edit by hand. BS metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_BS = PhoneMetadata(id='BS', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='9\\d\\d', possible_length=(3,)),
to... | daviddrysdale/python-phonenumbers | python/phonenumbers/shortdata/region_BS.py | Python | apache-2.0 | 677 |
def application(environ, start_response):
environ['wsgi.errors'].write('Error in application.')
environ['wsgi.errors'].flush()
start_response('200', [('Content-Length', '0')])
return []
| nginx/unit | test/python/errors_write/wsgi.py | Python | apache-2.0 | 203 |