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 |
|---|---|---|---|---|---|
from __future__ import with_statement
import tempfile
import shutil
import os
import sys
from cStringIO import StringIO
from akara import commandline, read_config
class Config(object):
def __init__(self, server_root):
self.config_filename = os.path.join(server_root, "pid_test.ini")
self.pid_filena... | uogbuji/akara | test/test_commandline.py | Python | apache-2.0 | 7,233 |
# Copyright 2014 Mirantis 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... | sajuptpm/manila | contrib/tempest/tempest/services/share/json/shares_client.py | Python | apache-2.0 | 28,667 |
from .attributes import Attribute, MapItem, KeyedListItem
from .attribute_collection import (AttributeCollection, MapAttributeCollection,
KeyedListAttributeCollection)
from .maps import Map, KeyedList
from .objects import Object
from .sequences import Sequence, IntList, FloatList, Str... | SimplyKnownAsG/yamlize | yamlize/__init__.py | Python | apache-2.0 | 421 |
# -*- 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-recommender | samples/generated_samples/recommender_v1beta1_generated_recommender_mark_recommendation_succeeded_sync.py | Python | apache-2.0 | 1,596 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 NEC 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
#... | MKTCloud/MKTCloud | openstack_dashboard/dashboards/admin/networks/subnets/views.py | Python | apache-2.0 | 3,612 |
# Copyright 2016 ZTE 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 or agreed to in ... | open-o/nfvo | lcm/lcm/ns/sfcs/create_port_chain.py | Python | apache-2.0 | 4,061 |
#!/usr/bin/env python
import httplib2
import mock
from six.moves import urllib
import unittest
import ee
from ee import apitestcase
class DataTest(unittest.TestCase):
def testGetTaskList(self):
def Request(unused_self, url, method, body, headers):
_ = method, body, headers # Unused kwargs.
par... | tylere/earthengine-api | python/ee/tests/data_test.py | Python | apache-2.0 | 12,603 |
# coding:utf-8
from tasks.workers import app
from page_get import user as user_get
from db.seed_ids import get_seed_ids, get_seed_by_id, insert_seeds, set_seed_other_crawled
@app.task(ignore_result=True)
def crawl_follower_fans(uid):
seed = get_seed_by_id(uid)
if seed.other_crawled == 0:
rs = user_get... | Danceiny/HackGirlfriend | Spider/WeiboSpider/tasks/user.py | Python | apache-2.0 | 1,574 |
#!/usr/bin/env python
"""Classes for exporting network-related data."""
from typing import Iterator, List
from grr_response_core.lib.rdfvalues import client_network as rdf_client_network
from grr_response_core.lib.rdfvalues import structs as rdf_structs
from grr_response_proto import export_pb2
from grr_response_serv... | google/grr | grr/server/grr_response_server/export_converters/network.py | Python | apache-2.0 | 4,124 |
#
# 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... | idegtiarov/ceilometer | ceilometer/tests/unit/test_neutronclient_lbaas_v2.py | Python | apache-2.0 | 14,539 |
import importlib
import pytest
from unittest import mock
from google.cloud import aiplatform
from google.cloud.aiplatform import base
from google.cloud.aiplatform import datasets
from google.cloud.aiplatform import initializer
from google.cloud.aiplatform import schema
from google.cloud.aiplatform import training_jobs... | googleapis/python-aiplatform | tests/unit/aiplatform/test_automl_tabular_training_jobs.py | Python | apache-2.0 | 50,875 |
#
# Created as part of the StratusLab project (http://stratuslab.eu),
# co-funded by the European Commission under the Grant Agreement
# INFSO-RI-261552."
#
# Copyright (c) 2011, SixSq Sarl
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... | StratusLab/client | api/code/src/main/python/stratuslab/FileAppender.py | Python | apache-2.0 | 2,638 |
# Copyright 2014 ARM Limited
#
# Licensed under the Apache License, Version 2.0
# See LICENSE file for details.
# standard library modules, , ,
import string
import os
import logging
import re
import itertools
from collections import defaultdict
from collections import OrderedDict
# bsd licensed - pip install jinja2
... | stevenewey/yotta | yotta/lib/cmakegen.py | Python | apache-2.0 | 28,539 |
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect 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 Li... | Mendelone/forex_trading | Algorithm.Python/DataConsolidationAlgorithm.py | Python | apache-2.0 | 6,399 |
from studio.util import logs
from typing import Dict
from studio.storage.http_storage_handler import HTTPStorageHandler
from studio.storage.local_storage_handler import LocalStorageHandler
from studio.storage.storage_setup import get_storage_verbose_level
from studio.storage.storage_handler import StorageHandler
from ... | studioml/studio | studio/storage/storage_handler_factory.py | Python | apache-2.0 | 2,584 |
import sys
from solution import Solution
# from classes import ?
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/ValidParentheses/test_suite.py | Python | apache-2.0 | 1,102 |
#!/usr/bin/env python3
import urllib.request, urllib.parse
from xml.dom import minidom
import json
import datetime
import codecs
#import argparse
import logging, os, sys, tempfile
import cgi
logging.basicConfig(format='%(asctime)s %(message)s', level=logging.DEBUG)
form = cgi.FieldStorage()
CODE = form.getvalue("code... | mpredfearn/kindle-forecast | server/cgi-bin/weather.py | Python | apache-2.0 | 2,183 |
# 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 | meta_augmentation/pose_regression/np_bbb.py | Python | apache-2.0 | 14,955 |
# -*- coding: utf-8 -*-
# Copyright 2010-2011 OpenStack Foundation
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
# Copyright 2013 Nebula 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 o... | dtroyer/osc-debug | oscdebug/tests/base.py | Python | apache-2.0 | 2,618 |
# Copyright 2011 Andrew Bogott for the Wikimedia 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-... | HybridF5/jacket | jacket/tests/compute/unit/api/openstack/compute/test_flavor_manage.py | Python | apache-2.0 | 20,113 |
# -*- 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-service-directory | samples/generated_samples/servicedirectory_v1_generated_registration_service_get_namespace_async.py | Python | apache-2.0 | 1,526 |
# Copyright 2014 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 requ... | Mirantis/tempest | tempest/api/database/base.py | Python | apache-2.0 | 1,654 |
from io import StringIO
from base import BaseService
class DNSError(Exception):
pass
class DNS(BaseService):
PACKAGE = 'dhcp'
HOSTS = '/tmp/hosts/jumpscale'
ADD_OP = '+'
REM_OP = '-'
REMALL_OP = '--'
def __init__(self, wrt):
super(DNS, self).__init__(wrt)
self._transa... | Jumpscale/jumpscale_core8 | lib/JumpScale/tools/openwrt/dns.py | Python | apache-2.0 | 3,726 |
# -*- coding: utf-8 -*-
from selenium.webdriver.firefox.webdriver import WebDriver
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile
from fixture.session import SessionHelper
from fixture.group import GroupHelper
from fixture.contact import ContactHelper
class Application:
def __init__(self):... | tzvezda/python_training | fixture/application.py | Python | apache-2.0 | 999 |
# Gambit scripts
#
# Copyright (C) USC Information Sciences Institute
# Author: Nibir Bora <nbora@usc.edu>
# URL: <http://cbg.isi.edu/>
# For license information, see LICENSE
import os
import sys
import csv
import math
import numpy
import anyjson
import psycopg2
import matplotlib
import matplotlib.pyplot as plt
from ... | nbir/gambit-scripts | scripts/LAnhoodAnalysis/src/disp_stat.py | Python | apache-2.0 | 5,328 |
#!/usr/bin/env python
"""Contains the Data Model for a cool Resource.
"""
__author__ = "Sanjay Joshi"
__copyright__ = "IBM Copyright 2017"
__credits__ = ["Sanjay Joshi"]
__license__ = "Apache 2.0"
__version__ = "1.0"
__maintainer__ = "Sanjay Joshi"
__email__ = "joshisa@us.ibm.com"
__status__ = "Prototype"
schema = {
... | joshisa/mistub | mistub/models/corporaadastatistics.py | Python | apache-2.0 | 812 |
# Copyright 2016 PerfKitBenchmarker Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/spark_service.py | Python | apache-2.0 | 8,537 |
master = "192.168.222.3"
#本番時 : 172.16.2.126 とか
| SP2LC/procon25-main | A-star/config.py | Python | apache-2.0 | 58 |
import tweepy
import json
import couchdb
import jsonpickle
import sys,os
import time
from textblob import TextBlob
import requests
import matplotlib.pyplot as plt
from matplotlib.path import Path
import matplotlib.patches as patches
import matplotlib.path as mplPath
import numpy as np
import socket
maxTweets = 10000... | COMP90024CloudComputing/Submit_Cloud_Computing | search/rest_ade.py | Python | apache-2.0 | 5,015 |
"""
models.py
App Engine datastore models
"""
from google.appengine.ext import ndb
class Problem(ndb.Model):
problemId = ndb.StringProperty(required=True)
problemInd = ndb.StringProperty(required=True)
contestId = ndb.IntegerProperty(required=True)
peopleSolved = ndb.IntegerProperty(required=True)
... | expl0si0nn/cf-tracker | src/cftracker/models.py | Python | apache-2.0 | 411 |
# -*- 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-ari | doc/source/conf.py | Python | apache-2.0 | 2,478 |
# Copyright 2012 NetApp
# 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... | bswartz/python-manilaclient | manilaclient/v1/shares.py | Python | apache-2.0 | 6,247 |
#from selenium.webdriver.firefox.webdriver import WebDriver
from selenium import webdriver
from fixture.session import SessionHelper
from fixture.group import GroupHelper
from fixture.contact import ContactHelper
class Application:
def __init__(self, browser, base_url):
# self.wd = WebDriver()
if b... | IrishaS/python_training | fixture/application.py | Python | apache-2.0 | 1,136 |
# 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 sys
print('... | tejal29/pants | tests/python/pants_test/python/die.py | Python | apache-2.0 | 356 |
# 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 json
import o... | areitz/pants | contrib/go/src/python/pants/contrib/go/tasks/go_fetch.py | Python | apache-2.0 | 10,376 |
# Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.battle.Movie
from panda3d.core import Point3, Vec3
import copy
from direct.directnotify import DirectNotifyGlobal
from direct.interval.IntervalGlobal import *
from direct.showbase import DirectObject
import random
from BattleBase import *
impor... | DedMemez/ODS-August-2017 | battle/Movie.py | Python | apache-2.0 | 33,920 |
# 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 required by applicable law or a... | deepakgupta1313/models | neural_gpu/neural_gpu_trainer.py | Python | apache-2.0 | 45,093 |
import os
import socket
import botocore.session
import pytest
import mock
from botocore.stub import Stubber
from botocore.vendored.requests import ConnectionError as \
RequestsConnectionError
from pytest import fixture
from chalice.app import Chalice
from chalice.awsclient import LambdaClientError, AWSClientErro... | awslabs/chalice | tests/unit/deploy/test_deployer.py | Python | apache-2.0 | 38,828 |
import logging
class NLog(object):
"""
Main Log Handling Class
"""
def __init__(self):
self.log = logging
| NeptuneFramework/neptune | neptune/logger.py | Python | apache-2.0 | 132 |
# Copyright 2019 The TensorNetwork 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 ... | google/TensorNetwork | tensornetwork/contractors/opt_einsum_paths/utils.py | Python | apache-2.0 | 1,871 |
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
# See https://swift.org/CONTRIBUTORS.txt for the list o... | atrick/swift | utils/build_swift/build_swift/driver_arguments.py | Python | apache-2.0 | 54,095 |
# coding=utf-8
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | google/learned_optimization | learned_optimization/population/examples/simple_cnn/train_threads.py | Python | apache-2.0 | 4,362 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
#... | tylertian/Openstack | openstack F/nova/nova/utils.py | Python | apache-2.0 | 43,686 |
class Ticket:
def __init__(self, id, description, classes, system, vector=None, kw=None):
self._id = id
self._description = description
self._classes = classes
self._system = system
self._vector = vector
self._keywords = kw
if vector is not None:
s... | w-garcia/BugClustering | Ticket.py | Python | apache-2.0 | 904 |
from django.shortcuts import get_object_or_404, redirect
from django.db import transaction
from rest_framework import viewsets
from rest_framework.mixins import CreateModelMixin, ListModelMixin, RetrieveModelMixin
from .serializers import GameSerializer, PlayerSerializer, TargetSerializer
from .models import Game, Play... | TanksForWaiting/tanks-for-waiting | tanks_api/api/views.py | Python | apache-2.0 | 4,229 |
# coding: utf-8
from cases.osmtest import OsmTestCase
from chainsrc.ubike import UbikeSource
# 不顯示 stack trace
__unittest = True
## U-bike 圖資測試
class UbikeTestCase(OsmTestCase):
## 取 U-bike 站點資料 (一次性)
@classmethod
def setUpClass(cls):
super(cls, UbikeTestCase).setUpClass()
UbikeTestCase.src = UbikeSource()
... | OsmHackTW/integrality_check | cases/test_ubike.py | Python | apache-2.0 | 1,161 |
# Copyright 2020 gRPC 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 writing... | nicolasnoble/grpc | tools/distrib/python/grpc_version.py | Python | apache-2.0 | 738 |
# Copyright 2017 the original author or 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 a... | opencord/voltha | voltha/core/local_handler.py | Python | apache-2.0 | 54,573 |
"""Support for Soma Smartshades."""
from api.soma_api import SomaApi
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_HOST, CONF_PORT
from homeassistant.core import HomeAssistant
import homeassistant.helpers.con... | jawilson/home-assistant | homeassistant/components/soma/__init__.py | Python | apache-2.0 | 2,778 |
"""
Given a binary tree, flatten it to a linked list in-place.
For example,
Given
1
/ \
2 5
/ \ \
3 4 6
The flattened tree should look like:
1
\
2
\
3
\
4
\
5
\
6
"""
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# ... | xiaonanln/myleetcode-python | src/114. Flatten Binary Tree to Linked List.py | Python | apache-2.0 | 1,072 |
#udp1.py
import socket
s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
s.bind(('127.0.0.1',9999))
print 'Bind UDP on 9999...'
while True:
data,addr=s.recvfrom(1024)
print 'Received from %s:%s' %addr
s.sendto('Hello,%s!'%data,addr)
| zengboming/python | udp1.py | Python | apache-2.0 | 240 |
#!/usr/bin/env python
#
# Software License Agreement (Apache License)
# Copyright (c) 2017, <Advanced Remanufacturing Technology Centre/Mingli Han>
# 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 Licens... | ros-industrial-consortium/bohr_devel | packml_smach/src/executeState.py | Python | apache-2.0 | 1,575 |
import os
import sys
import re
dir = sys.argv[1]
files = [string for string in os.listdir(dir) if string.endswith(".json") and string.startswith("part-")]
pattern = re.compile("\d+")
for fin in files:
suffix = ""
with open(dir + "/" + fin) as data_in:
for line in data_in:
if suffix == "... | cleosson/AnalyticsWithApacheSpark | tools/toJson.py | Python | apache-2.0 | 773 |
class Map(dict):
"""
Example:
m = Map({'first_name': 'Eduardo'}, last_name='Pool', age=24, sports=['Soccer'])
"""
def __init__(self, *args, **kwargs):
super(Map, self).__init__(*args, **kwargs)
for arg in args:
if isinstance(arg, dict):
for k, v in arg.ite... | rwecho/fflask_blog | fflask_blog/Repositories/map_dict.py | Python | apache-2.0 | 1,096 |
from turbo_palm_tree.utility.download_subreddit_submissions \
import DownloadSubredditSubmissions
from turbo_palm_tree.utility.exception import TurboPalmTreeException
| jtara1/turbo_palm_tree | turbo_palm_tree/__init__.py | Python | apache-2.0 | 171 |
#!/usr/bin/python
'''
Validates command to gather logs from a cluster
Developer usage:
ssh -i log_gathering_key use-tower2.ops.rhcloud.com -- -c <clusterName> -u <kerberosID>
clusterName is checked against a list of known/valid cluster names.
kerberosID is the Kerberos ID of the developer requesting logs, for t... | rhdedgar/openshift-tools | scripts/cicd/verify-gather-logs-operations.py | Python | apache-2.0 | 4,734 |
#################################################
####### Author: Hugo Pibernat #######
####### Contact: hugopibernat@gmail.com #######
####### Date: April 2014 #######
#################################################
from bayesianABTest import sampleSuccessRateForBinomial, sampleMeanF... | hugopibernat/BayesianABTestAnalysis | code/examples/xpromo_test.py | Python | apache-2.0 | 2,854 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from io import open
from kappa import __version__
import os
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def open_file(fname):
return open(os.path.join(os.path.dirname(__file__), fname), encoding='utf-8')
def run_s... | garnaat/kappa | setup.py | Python | apache-2.0 | 1,734 |
import os
import sys
import codecs
# Must be run with python 3 in order to work
ENCODINGS = [
u"ascii",
u"big5",
u"big5hkscs",
u"cp037",
u"cp424",
u"cp437",
u"cp500",
u"cp720",
u"cp737",
u"cp775",
u"cp850",
u"cp852",
u"cp855",
u"cp856",
u"cp857",
u"cp85... | RobertElderSoftware/roberteldersoftwarediff | tests/make_encoded_files.py | Python | apache-2.0 | 2,258 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2011 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... | aristanetworks/arista-ovs-quantum | quantum/extensions/multiport.py | Python | apache-2.0 | 3,854 |
route = list()
route.append(('GET', '/', 'demo.Demo.welcome'))
| ShareAny/LuckyPython | application/config/route.py | Python | apache-2.0 | 63 |
# 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... | asimshankar/tensorflow | tensorflow/python/data/experimental/kernel_tests/scan_test.py | Python | apache-2.0 | 6,663 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2016 DNAnexus, Inc.
#
# This file is part of dx-toolkit (DNAnexus platform client libraries).
#
# 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 c... | johnwallace123/dx-toolkit | src/python/test/test_dxclient.py | Python | apache-2.0 | 383,723 |
import config_file_manager
# get all roles
# returns a dictionary
def get_roles():
# load roles from ./configuration/roles/main.yml
return config_file_manager.get_roles_config()
# def parse_roles(roles):
# for role, playbooks in roles.iteritems():
# print "Applying role" + role + " sin... | dkoudlo/py-manage-server | py-manage-server/role_manager.py | Python | apache-2.0 | 769 |
"""Utility command to filter table rows based on the value of a column and a provided regex."""
import unsync
@unsync.command()
@unsync.option('--source', '-s', required=True, help='The source data table.')
@unsync.option('--filter', '-f', type=unsync.Tuple([str, str]), multiple=True, required=True, help='A tuple of ... | PGower/Unsync | unsync_petl/unsync_petl/search.py | Python | apache-2.0 | 830 |
# 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
# distr... | openstack/watcher | watcher/tests/api/v1/test_webhooks.py | Python | apache-2.0 | 3,148 |
#!/usr/bin/python
import sys
import libvhd
def vhd_create(filename, size, disk_type=None, create_flags=None):
"""Usage: <filename> <size> [<disk_type>] [<create_flags>]"""
return libvhd.vhd_create(filename, size, disk_type=disk_type,
create_flags=create_flags)
def vhd_convert_from_raw(src_fil... | comstud/python-vhdutil | src/vhdutil.py | Python | apache-2.0 | 2,708 |
import abc
from probabilities.base import probability_distribution
from probabilities.base import probability
from tests import test_sub_class
class BaseProbabilityDistributionTest(test_sub_class.BaseSubClassTest):
def setUp(self):
super().setUp()
self.super_classes.add(probability_distribution.... | tomerghelber/probabilities | tests/base/test_probability_distribution/base_test_probability_distribution.py | Python | apache-2.0 | 770 |
import mock
from nose.tools import * # noqa
import httplib as http
from boto.exception import S3ResponseError
from framework.auth import Auth
from tests.base import OsfTestCase
from tests.factories import ProjectFactory, AuthUserFactory
from website.addons.s3.model import S3GuidFile
from website.addons.s3.utils imp... | AndrewSallans/osf.io | website/addons/s3/tests/test_view.py | Python | apache-2.0 | 17,933 |
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2009,2010,2011,2012,2013,2014,2015,2016,2017 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ma... | quattor/aquilon | lib/aquilon/worker/commands/del_allowed_personality_cluster.py | Python | apache-2.0 | 2,670 |
#!/usr/bin/env python
import sys, os, pwd, grp, signal, time
from resource_management import *
from subprocess import call
from common import *
def setup_hue():
import params
import status_params
Logger.info("Configure Hue Service")
# create the pid and log dir
Directory([params.hue_log_dir, params.hue_pid_di... | alexryndin/ambari | ambari-server/src/main/resources/stacks/ADH/1.4/services/HUE/package/scripts/setup_hue.py | Python | apache-2.0 | 2,346 |
BASE_CONFIG = {
'version': 1,
'loggers': {
'pit': {
'handlers': ['console'],
'level': 'DEBUG',
}
},
'handlers': {
'console': {
'class': 'logging.StreamHandler',
'stream': 'ext://sys.stdout',
'formatter': 'verbose',
... | mitlib-tdm/pit | pit/logging.py | Python | apache-2.0 | 507 |
#!/usr/bin/env python
#
# Copyright 2013 Darragh Bailey
#
# 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... | joostvdg/jenkins-job-builder | tests/localyaml/test_localyaml.py | Python | apache-2.0 | 3,217 |
##You need to edit the formula in the file named 'Formula.txt' to the desmos formula
##
##Created By Boston Abrams
##
##With Help from Martin ( :
##
##
def Maths (x):
reading_file=open('Formula.txt', 'r')
lines=reading_file.readlines()
Formula = lines[1]
m1 = 0
count = 0
... | BostonA/SpudnikPi | Math.py | Python | apache-2.0 | 2,014 |
#!/usr/bin/env python
# Copyright (C) 2015 Wayne Warren
#
# 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... | joostvdg/jenkins-job-builder | jenkins_jobs/cli/subcommand/delete_all.py | Python | apache-2.0 | 1,517 |
#!/usr/bin/env python
"""
fastaCount.py <filename>
"""
import sys
from mungo.fasta import fastaCount
for filename in sys.argv[1:]:
print '%s: %i' % (filename, fastaCount(filename)) | PapenfussLab/Mungo | bin/fastaCount.py | Python | artistic-2.0 | 187 |
import arrow
import CONFIG
START_TIME = CONFIG.START_TIME
END_TIME = CONFIG.END_TIME
def get_free_times(busy_times, begin_date, end_date):
"""
Gets a list of free times calculated from a list of busy times.
:param busy_times: is the list of busy times in ascending order.
:param begin_date: is the st... | hkhamm/proj7-freetimes | free_times.py | Python | artistic-2.0 | 5,647 |
import os
import unittest
from msquaredc.persistence import BackedUpDict
from msquaredc.persistence import obtain
from msquaredc.persistence import persist
class TestPersistence(unittest.TestCase):
def test_all(self):
samples = [
{"x": 1, "y": 2, "z": 3},
{"x": 4, "y": 5, "z": ""}... | j340m3/python-msquaredc | tests/test_persistence.py | Python | bsd-2-clause | 1,432 |
from os import environ
from pyramid.view import view_config
from pyramid.view import notfound_view_config
from pyramid.httpexceptions import HTTPFound
from pyramid.response import Response
from springboard.utils import ga_context, Paginator
from springboard.views.base import SpringboardViews
from springboard.tasks im... | universalcore/springboard | springboard/views/core.py | Python | bsd-2-clause | 4,570 |
# $Id: ImageButton.py,v 1.33.2.2 2006/11/14 12:46:15 marcusva Exp $
#
# Copyright (c) 2004-2006, Marcus von Appen
# 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 cod... | prim/ocempgui | ocempgui/widgets/ImageButton.py | Python | bsd-2-clause | 8,485 |
# Copyright (c) 2011, Daniel Crosta
# 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 list of conditions and the... | dcrosta/nymwit | nymwit/game/models.py | Python | bsd-2-clause | 10,157 |
"""
This acts very much like a renderer, except instead of rendering to screen,
it ouputs bam files, one per tile with all the LOD and such packed in
"""
import os
import json
import bakery.bakery
import bakery.gpuBakery
from renderer.renderTiler import RenderNodeTiler
from panda3d.core import NodePath
from di... | Craig-Macomber/Panda3D-Terrain-System | tileBamCacher.py | Python | bsd-2-clause | 4,549 |
###############################################################################
#
# Copyright (C) 2016 Bitquant Research Laboratories (Asia) Limited
#
# Licensed under the GPLv3+ License
#
###############################################################################
from cffi import FFI
import atexit
import os
impor... | joequant/sptrader | sptrader/sptrader.py | Python | bsd-2-clause | 20,783 |
import os
from uuid import uuid4
basedir = os.path.abspath(os.path.dirname(__file__))
CSFR_ENABLED = True
SECRET_KEY = uuid4().hex
#SHORTENER SERVICE SETTINGS
TINY_API_URL = 'http://tiny-url.info/api/v1/create'
TINY_API_KEY = '8A6CIC8081B6BC5G5A07'
TINY_API_PROVIDER = 'go_ly'
TINY_API_FORMAT = 'json'
#LOGS SETTINGS... | sosmooth/smoothyurl | server/config.py | Python | bsd-2-clause | 405 |
"""
Feature Detector/Descriptor Visualization
Licence: BSD
Author : Hoang Anh Nguyen
"""
import cv2
import numpy as np
import argparse, sys
#--------------------------------------------------------
#--------------------------------------------------------
# Class provide an interface to facilitate the use of Feature ... | hanguyen86/feature | src/feature.py | Python | bsd-2-clause | 15,196 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# Copyright (c) 2016 ASMlover. 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 copyrig... | ASMlover/study | python/btool/build.py | Python | bsd-2-clause | 8,175 |
# -*- coding: utf-8 -*-
import logging
import functools
from django.contrib.gis.db import models
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.contrib.gis.geos import fromstr, LineString
from mapentity.models import MapEntityMixin
from geotrek.authent.models imp... | Anaethelion/Geotrek | geotrek/core/models.py | Python | bsd-2-clause | 20,663 |
from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
import os
import csv
import rdflib
import logging
import requests
try:
# Python 3
from functools import lru_cache
from urllib.error import HTTPError
except ImportError:
# Python 2
from functools32... | jmuhlich/indra | indra/databases/uniprot_client.py | Python | bsd-2-clause | 14,426 |
#!/usr/bin/env python3
"""
Nisetango
Builds a string based on a pattern to insert the letter U in specific
places. The result emulates how the author thinks japanese people
sound when they speak western (swedish) languages.
"""
import re
import sys
def nisetango(str_, to_upper=True):
"""
Nonsense-japanese fr... | antoneri/nisetango | nisetango.py | Python | bsd-2-clause | 2,199 |
from django.views.generic import TemplateView
class ScrapsIndexView(TemplateView):
template_name = '404.html'
index = ScrapsIndexView.as_view()
| hipikat/hipikat.org | src/hipikat/views/scraps.py | Python | bsd-2-clause | 151 |
###############################################################################
#
# Format - A class for writing the Excel XLSX Worksheet file.
#
# Copyright 2013-2016, John McNamara, jmcnamara@cpan.org
#
# Package imports.
from . import xmlwriter
class Format(xmlwriter.XMLwriter):
"""
A class for writing th... | jkyeung/XlsxWriter | xlsxwriter/format.py | Python | bsd-2-clause | 25,888 |
import click
from iscc_bench.readers import ALL_READERS
from iscc_bench.elastic_search.fill_elasticsearch import populate_elastic
from iscc_bench.elastic_search.new_index import new_data_index, new_id_index
from iscc_bench.elastic_search.generate_meta_ids import generate_ids
from iscc_bench.elastic_search.evaluate impo... | coblo/isccbench | iscc_bench/cli.py | Python | bsd-2-clause | 1,542 |
from django.core.urlresolvers import reverse
from django.db.models import F
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404, render
from django.utils.translation import get_language_from_request
from django.views import generic
from django.views.generic import TemplateView
fr... | praekelt/molo.polls | molo/polls/views.py | Python | bsd-2-clause | 5,198 |
import os
import sys
class ConfigHelper():
"""
Manage all configuration information for the application
"""
def __init__(self):
TRUE = "True"
FALSE = "False"
ERROR = 1
self.halo_key = os.getenv("HALO_API_KEY")
self.halo_secret = os.getenv("HALO_API_SECRET_K... | jgibbons-cp/sva_scan_examples | app/sva_scan_examples/config_helper.py | Python | bsd-2-clause | 1,913 |
from clusto.drivers.devices.servers.basicserver import BasicServer
from IPy import IP
import boto.ec2
import urllib2
import urllib
import socket
import json
import sys
from sgext.util import SGException
class Request(urllib2.Request):
def __init__(self, method, url, data=None):
if isinstance(data, dict):
... | simplegeo/clusto-sgext | sgext/drivers/devices/servers/sgserver.py | Python | bsd-2-clause | 4,449 |
#
#
# Copyright (C) 2006, 2007, 2010, 2011 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:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list ... | leshchevds/ganeti | lib/utils/__init__.py | Python | bsd-2-clause | 27,804 |
# -*- coding: utf-8 -*-
"""
pygments.lexers.verification
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lexer for Intermediate Verification Languages (IVLs).
:copyright: Copyright 2006-2016 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, include... | aswinpj/Pygments | pygments/lexers/verification.py | Python | bsd-2-clause | 3,624 |
# Copyright (c) 2011, Enthought, Ltd.
# Author: Pietro Berkes <pberkes@enthought.com>
# License: Modified BSD license (2-clause)
from traits.api import HasTraits, Property, Array
from traits.trait_types import List, Int, Bool, Str
from traitsui.api import View, Item, TabularEditor
from traitsui.group import VGroup
fro... | enthought/uchicago-pyanno | pyanno/ui/arrayview.py | Python | bsd-2-clause | 2,429 |
"""
Boilerplate functions used in defining binary operations.
"""
from functools import wraps
from typing import Callable
from pandas._libs.lib import item_from_zerodim
from pandas._typing import F
from pandas.core.dtypes.generic import ABCDataFrame, ABCIndex, ABCSeries
def unpack_zerodim_and_defer(name: str) -> Ca... | jreback/pandas | pandas/core/ops/common.py | Python | bsd-3-clause | 2,915 |
"""
kombu.transport.SQS
===================
Amazon SQS transport module for Kombu. This package implements an AMQP-like
interface on top of Amazons SQS service, with the goal of being optimized for
high performance and reliability.
The default settings for this module are focused now on high performance in
task queue... | daevaorn/kombu | kombu/transport/SQS.py | Python | bsd-3-clause | 16,498 |