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 |
|---|---|---|---|---|---|
# 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... | openstack/rally | rally/verification/utils.py | Python | apache-2.0 | 3,055 |
import pytest
import gen.template
from gen.template import (For, Replacement, Switch, Tokenizer, UnsetParameter,
parse_str)
just_text = "foo"
more_complex_text = "foo {"
def get_tokens(str):
return Tokenizer(str).tokens
def test_lex():
assert(get_tokens("foo") == [("blob", "foo")... | movicha/dcos | gen/test_template.py | Python | apache-2.0 | 6,998 |
"""Flask Blueprint adding login functionality to our app. Note that we expect
gluten model and db config to be handled elsewhere
"""
import sys
import traceback
from functools import partial, wraps
from flask import redirect, request, flash, session, abort, g, url_for
from flask.globals import LocalProxy, _lookup_ap... | memphis-iis/gluten | gluten/auth.py | Python | apache-2.0 | 4,308 |
# -*- 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-area120-tables | google/area120/tables_v1alpha1/types/__init__.py | Python | apache-2.0 | 1,783 |
import json
import re
import tg
import pkg_resources
import pylons
pylons.c = pylons.tmpl_context
pylons.g = pylons.app_globals
from pylons import c
from ming.orm import ThreadLocalORMSession
from datadiff.tools import assert_equal
from allura import model as M
from allura.lib import helpers as h
from allura.tests im... | leotrubach/sourceforge-allura | ForgeGit/forgegit/tests/functional/test_controllers.py | Python | apache-2.0 | 8,569 |
# Copyright 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 req... | apporc/neutron | neutron/extensions/quotasv2.py | Python | apache-2.0 | 5,333 |
from adt.util.prog import Prog
from adt.util.literal import Literal
from adt.util.expr import Expr
from adt.util.unary_op import Unary_op
from adt.util.binary_op import Binary_op
from adt.util.block import Block
from adt.util.context import Context
from adt.util.instr import Instr
from adt.types.bool import Bool
from ... | mencattini/ideal-pancake | adt/tests/prog_test.py | Python | apache-2.0 | 4,066 |
# Copyright 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 requ... | hanlind/nova | nova/tests/unit/virt/xenapi/image/test_glance.py | Python | apache-2.0 | 10,892 |
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
#
# Copyright (c) 2015 Juniper Networks, Inc.
# All rights reserved.
#
# Use is subject to license terms.
#
# 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... | Juniper/py-space-platform | jnpr/space/connection.py | Python | apache-2.0 | 5,362 |
import Utils
from Utils import printe
class CommandBuilder(object):
def __init__(self, *command_args):
self.command_args = list(command_args)
def append(self, *args):
for arg in args:
if isinstance(arg, str):
self.command_args += [arg]
elif isinstance(... | bytejive/lazy-docker | CommandBuilder.py | Python | apache-2.0 | 828 |
# Copyright (c) 2015-2016 Tigera, 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 applicabl... | projectcalico/calico | calicoctl/tests/st/utils/utils.py | Python | apache-2.0 | 20,521 |
python manage.py collectstatic
python manage.py runserver --nostatic
urlpatterns += patterns('',
(r'^static/suit/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.DJANGO_SUIT_TEMPLATE}),
)
urlpatterns += patterns('',
(r'^static/admin/(?P<path>.*)$', 'django.views.static.serve', {'documen... | pisun2/python | static.py | Python | apache-2.0 | 711 |
#!/usr/bin/env python
# Copyright 2015 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... | GoogleCloudPlatform/psq | psq/psqworker.py | Python | apache-2.0 | 2,499 |
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
#
# 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... | openstack/os-collect-config | os_collect_config/tests/test_cfn.py | Python | apache-2.0 | 10,601 |
import streamcorpus as sc
import cuttsum.events
import cuttsum.corpora
from cuttsum.trecdata import SCChunkResource
from cuttsum.pipeline import ArticlesResource, DedupedArticlesResource
import os
import pandas as pd
from datetime import datetime
from collections import defaultdict
import matplotlib.pylab as plt
plt.st... | kedz/cuttsum | trec2015/sbin/reports/raw-stream-count.py | Python | apache-2.0 | 7,738 |
# Copyright 2012 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... | Tesora/tesora-tempest | tempest/api/compute/servers/test_create_server.py | Python | apache-2.0 | 14,903 |
# Copyright 2019 Verily Life Sciences 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 t... | verilylifesciences/classifaedes | classifaedes/hparams_lib_test.py | Python | apache-2.0 | 1,292 |
# -*- coding: utf-8 -*-
#
# portal.py # # # # # # # # # #
# #
# Copyright 2016 Giorgio Ladu <giorgio.ladu >at< gmail.com> #
# #
# ... | giorgioladu/Rapa | portal.py | Python | apache-2.0 | 987 |
from paypalrestsdk import BillingAgreement
import logging
BILLING_AGREEMENT_ID = "I-HT38K76XPMGJ"
try:
billing_agreement = BillingAgreement.find(BILLING_AGREEMENT_ID)
print("Billing Agreement [%s] has state %s" % (billing_agreement.id, billing_agreement.state))
suspend_note = {
"note": "Suspendin... | stafur/pyTRUST | paypal-rest-api-sdk-python/samples/subscription/billing_agreements/suspend_and_re_activate.py | Python | apache-2.0 | 1,184 |
#
# 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
# ... | sebrandon1/nova | nova/tests/unit/api/openstack/placement/test_util.py | Python | apache-2.0 | 10,993 |
from .test_antivirus import AbstractTests
import modules.antivirus.avg.avg as module
import modules.antivirus.base as base
from mock import patch
from pathlib import Path
class TestAvg(AbstractTests.TestAntivirus):
name = "AVG AntiVirus Free (Linux)"
scan_path = Path("/usr/bin/avgscan")
scan_args = ('--he... | quarkslab/irma | probe/tests/modules/antivirus/test_avg.py | Python | apache-2.0 | 4,618 |
# Copyright 2014 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | tartavull/google-cloud-python | datastore/tests/unit/test_query.py | Python | apache-2.0 | 26,883 |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | kubeflow/kfp-tekton-backend | components/gcp/container/component_sdk/python/kfp_component/google/bigquery/__init__.py | Python | apache-2.0 | 601 |
#!/usr/bin/python
#
# Script to determine the performance statistics and other information
# related to libvirt guests
# https://github.com/odyssey4me/monitoring-scripts
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may o... | odyssey4me/monitoring-scripts | check_virsh_domains.py | Python | apache-2.0 | 18,638 |
# -*- encoding: utf-8 -*-
# Copyright © 2012 New Dream Network, LLC (DreamHost)
# 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.... | SauloAislan/ironic | ironic/api/app.py | Python | apache-2.0 | 3,844 |
# 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 compliance with the License. You may obtain
# a ... | bswartz/manila | manila/tests/conf_fixture.py | Python | apache-2.0 | 2,989 |
# Copyright 2014 Cloudbase Solutions Srl
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | e0ne/cinder | cinder/tests/test_smbfs.py | Python | apache-2.0 | 22,226 |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google/tink | python/tink/_keyset_reader_test.py | Python | apache-2.0 | 4,878 |
#EQUIPE 2
#Nahan Trindade Passos - 1615310021
#Ana Beatriz Frota - 1615310027
#
#
#
#
#
#
import math
print("Digite os termos da equacao ax2+bx+c")
a = float(input("Digite o valor de A:\n"))
if(a==0):
print("Nao e uma equacao de segundo grau")
else:
b = float(input("Valor de B:\n"))
c = float(input("Valo... | any1m1c/ipc20161 | lista2/ipc_lista2.16.py | Python | apache-2.0 | 824 |
#!/usr/bin/env python
# coding: utf-8
"""
Copyright 2015 SYSTRAN Software, 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/licen... | SYSTRAN/geographic-api-python-client | systran_geographic_api/models/full_inspiration.py | Python | apache-2.0 | 2,585 |
# -*- coding: utf-8 -*-
##############################################################################################
# This file is deprecated because Python 2.x is deprecated #
# A Python 3.x version of this file can be found at: #
# ... | Guymer/PyGuymer | load_GPS_EXIF.py | Python | apache-2.0 | 993 |
'''
Copyright 2013 George Caley
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wri... | spake/pathways | binder.py | Python | apache-2.0 | 6,253 |
import inspect
import json
import os
import random
import subprocess
import time
import requests
import ast
import paramiko
import rancher
from rancher import ApiError
from lib.aws import AmazonWebServices
DEFAULT_TIMEOUT = 120
DEFAULT_MULTI_CLUSTER_APP_TIMEOUT = 300
CATTLE_TEST_URL = os.environ.get('CATTLE_TEST_URL'... | sabiodelhielo/rancher-validation | tests/v3_api/common.py | Python | apache-2.0 | 41,077 |
__author__ = 'mpetyx'
from tastypie.authorization import DjangoAuthorization
from .models import OpeniQuestion
from OPENiapp.APIS.OpeniGenericResource import GenericResource
from OPENiapp.APIS.OPENiAuthorization import Authorization
from OPENiapp.APIS.OPENiAuthentication import Authentication
class QuestionResource... | OPENi-ict/ntua_demo | openiPrototype/openiPrototype/APIS/Activity/Question/Resources.py | Python | apache-2.0 | 2,158 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
# Copyright 2012 OpenStack LLC
#
# Licensed under the Apache License, Version 2.0 (... | 1ukash/horizon | horizon/dashboards/project/images_and_snapshots/views.py | Python | apache-2.0 | 3,222 |
# Copyright (c) 2015 Dell Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | Akrog/cinder | cinder/tests/test_dellscapi.py | Python | apache-2.0 | 155,946 |
import click
@click.command('config', short_help='Display remote client config')
@click.pass_obj
def cli(obj):
"""Display client config downloaded from API server."""
for k, v in obj.items():
if isinstance(v, list):
v = ', '.join(v)
click.echo(f'{k:20}: {v}')
| alerta/python-alerta-client | alertaclient/commands/cmd_config.py | Python | apache-2.0 | 298 |
#!/Users/vishnu/anaconda/bin/python
import random
import sys
"""class schema:
files=[]
def __init__(self):
pass
def addFile(self,file):
self.files.append(file)
def setForeignKey(self,primaryFile,theOtherOne):
pass"""
class JoinReq:
def __init__(self,R,S,m,n,fing):
self.cost=0
self.first_req=True... | vishnuprathish/constrained-data-generator | fingered_temp.py | Python | apache-2.0 | 10,459 |
"""
Find the closest DMC colors for a hex color.
Usage: python closest_colors.py <hexcolor>
"""
import sys
from .. import color
from .. import dmc_colors
def main():
if len(sys.argv) < 2:
sys.exit(__doc__)
hex_color = sys.argv[1]
rgb_color = color.RGBColorFromHexString(hex_color)
print 'Given RGB ... | nanaze/pystitch | pystitch/examples/closest_colors.py | Python | apache-2.0 | 562 |
"""
"""
from .register import get_registered_layers
#custom layer import begins
import axpy
import flatten
import argmax
import reshape
import roipooling
import priorbox
import permute
import detection_out
import normalize
import select
import crop
import reduction
#custom layer import ends
custom_layers = get_regi... | lcy-seso/models | fluid/image_classification/caffe2fluid/kaffe/custom_layers/__init__.py | Python | apache-2.0 | 2,996 |
#!/usr/bin/env python2.7
from nltk.book import *
fdist1 = FreqDist(text1)
fdist1.plot(50, cumulative=True) | prinsmike/nltk_book | ch01/13-cumulative_frequency_plot.py | Python | apache-2.0 | 109 |
# -*- coding: utf-8 -*-
def command():
return "edit-instance-vmware"
def init_argument(parser):
parser.add_argument("--instance-no", required=True)
parser.add_argument("--instance-type", required=True)
parser.add_argument("--key-name", required=True)
parser.add_argument("--compute-resource", requi... | primecloud-controller-org/pcc-cli | src/pcc/api/instance/edit_instance_vmware.py | Python | apache-2.0 | 1,746 |
import os
import time
import ujson
from django.conf import settings
from django.http import HttpResponse
from django.test import TestCase
from mock import patch
from typing import Any, Callable, Dict, List, Mapping, Tuple
from zerver.lib.test_helpers import simulated_queue_client
from zerver.lib.test_classes import ... | amanharitsh123/zulip | zerver/tests/test_queue_worker.py | Python | apache-2.0 | 5,307 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2014 Kitware 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 cop... | opadron/girder | plugins/oauth/plugin_tests/oauth_test.py | Python | apache-2.0 | 29,618 |
# #!/usr/bin/env python
#
# import nlopt # THIS IS NOT A PACKAGE!
# import numpy as np
#
# print(('nlopt version='+nlopt.__version__))
#
# def f(x, grad):
# F=x[0]
# L=x[1]
# E=x[2]
# I=x[3]
# D=F*L**3/(3.*E*I)
# return D
#
# n = 4
# opt = nlopt.opt(nlopt.LN_COBYLA, n)
# opt.set_min_objective(f)... | PMBio/limix | External/nlopt/test/test_std.py | Python | apache-2.0 | 727 |
# Copyright 2015 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... | syed/PerfKitBenchmarker | perfkitbenchmarker/openstack/utils.py | Python | apache-2.0 | 6,884 |
# -*- coding: utf-8 -*-
#imports
from linkedin import linkedin
import easygui
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
import requests
def enum(*sequential, **named):
enums = dict(zip(sequential, range(len(sequential))), **named)
return type('Enum', (), enums)
Mode = enum('PREVIEW', 'EDIT', ... | SAP/lumira-extension-da-linkedin | source/LinkedinExtractor.py | Python | apache-2.0 | 6,132 |
"""Support for Lutron Caseta scenes."""
from typing import Any
from homeassistant.components.scene import Scene
from .const import BRIDGE_LEAP, DOMAIN as CASETA_DOMAIN
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up the Lutron Caseta scene platform.
Adds scenes from the Caset... | turbokongen/home-assistant | homeassistant/components/lutron_caseta/scene.py | Python | apache-2.0 | 1,243 |
#!/usr/bin/env python
###
# This script sets up a Spark cluster on Google Compute Engine
# Sigmoidanalytics.com
###
from __future__ import with_statement
import logging
import os
import pipes
import random
import shutil
import subprocess
import sys
import tempfile
import time
import commands
import urllib2
from optp... | sigmoidanalytics/spark_gce | spark_gce.py | Python | apache-2.0 | 20,428 |
# coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | won0089/oppia | extensions/rules/real_test.py | Python | apache-2.0 | 2,944 |
# 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, print_function, unicode_literals
import os
from builtins import str
from textwrap import dedent
from pants.backend.jvm.ta... | twitter/pants | tests/python/pants_test/backend/jvm/targets/test_jvm_app.py | Python | apache-2.0 | 14,693 |
import sys
import ray
import pytest
from ray.test_utils import (
generate_system_config_map,
wait_for_condition,
wait_for_pid_to_exit,
)
@ray.remote
class Increase:
def method(self, x):
return x + 2
@ray.remote
def increase(x):
return x + 1
@pytest.mark.parametrize(
"ray_start_reg... | robertnishihara/ray | python/ray/tests/test_gcs_fault_tolerance.py | Python | apache-2.0 | 3,783 |
# Copyright (c) 2013 OpenStack 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.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | lielongxingkong/windchimes | swift/common/middleware/slo.py | Python | apache-2.0 | 19,534 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from turnstile.checks import get_checks
from turnstile.manager import get_commands
CORE_COMMIT_MSG_CHECKS = ['branch_pattern', 'branch_release', 'branch_type', 'protect_master', 'specification']
CORE_SUBCOMMANDS = ['config', 'install', 'remove', 'specification', 'upgrade'... | zalando/turnstile | tests/test_discovery.py | Python | apache-2.0 | 636 |
import gevent
import socket
from vnc_api.vnc_api import *
from cfgm_common.vnc_kombu import VncKombuClient
from config_db import *
from cfgm_common.dependency_tracker import DependencyTracker
from reaction_map import REACTION_MAP
import svc_monitor
class RabbitConnection(object):
_REACTION_MAP = REACTION_MAP
... | sajuptpm/contrail-controller | src/config/svc-monitor/svc_monitor/rabbit.py | Python | apache-2.0 | 4,079 |
# Copyright 2014 - Mirantis, Inc.
# Copyright 2020 Nokia 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... | openstack/mistral | mistral/tests/unit/services/test_workbook_service.py | Python | apache-2.0 | 8,847 |
# Copyright (c) 2016 OpenStack 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.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | openstack/networking-l2gw | networking_l2gw/services/l2gateway/common/tunnel_calls.py | Python | apache-2.0 | 2,017 |
# -*- 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... | googleads/google-ads-python | google/ads/googleads/v10/enums/types/webpage_condition_operator.py | Python | apache-2.0 | 1,199 |
# Copyright 2019 DeepMind Technologies Limited
#
# 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 agr... | deepmind/open_spiel | open_spiel/python/algorithms/adidas_utils/games/big.py | Python | apache-2.0 | 4,268 |
""" environ settings """
import environ
BASE_DIR = environ.Path(__file__) - 4
ENV_VAR = environ.Env()
| kaizentech/skeleton | config/settings/configurations/ENV.py | Python | apache-2.0 | 103 |
import os
from library.connecter.ansible.yaml import Yaml_Base
class Data_DB(Yaml_Base):
def router(self, content, name, yaml_tpye='main', file_type='tasks', preserve=True, together=False, describe=''):
'''
检测yaml数据的语法是否正确,如果含有include或/和roles,将把这些存储在后端数据库中
:参数
... | lykops/lykops | library/connecter/ansible/yaml/data2db.py | Python | apache-2.0 | 12,807 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2012 Yahoo! 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.or... | hagleitn/Openstack-Devstack2 | devstack/components/quantum.py | Python | apache-2.0 | 8,662 |
# Copyright 2014 Mellanox Technologies, Ltd
#
# 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 t... | silenci/neutron | neutron/plugins/ml2/drivers/mech_sriov/agent/sriov_nic_agent.py | Python | apache-2.0 | 17,661 |
# Copyright 2015 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... | taknevski/tensorflow-xsmm | tensorflow/contrib/layers/python/layers/feature_column.py | Python | apache-2.0 | 89,072 |
##
# Copyright Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0
#
# or in the "license" file accompany... | alexeblee/s2n | tests/integration/common/s2n_test_scenario.py | Python | apache-2.0 | 5,789 |
#
# 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... | wprice/qpid-proton | proton-c/bindings/python/proton/handlers.py | Python | apache-2.0 | 20,366 |
# 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... | TargetHolding/pyspark-cassandra | python/pyspark_cassandra/streaming.py | Python | apache-2.0 | 2,902 |
# Copyright 2018 Rackspace, US Inc.
# Copyright 2019 Red Hat, 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
#
# Unle... | openstack/octavia | octavia/api/drivers/driver_agent/driver_listener.py | Python | apache-2.0 | 5,587 |
# coding=utf-8
# Copyright 2018 The DisentanglementLib 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
#
# Un... | google-research/disentanglement_lib | disentanglement_lib/config/abstract_reasoning_study_v1/stage1/sweep.py | Python | apache-2.0 | 5,267 |
"hey iam there yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuyyy"
| 6mandati6/6mandati6 | tt.py | Python | apache-2.0 | 135 |
# ./MARC21relaxed.py
# -*- coding: utf-8 -*-
# PyXB bindings for NM:5e592dacc0cf5bbbe827fb7d980f3324ca92c3dc
# Generated 2016-12-21 00:24:34.092428 by PyXB version 1.2.4 using Python 2.7.12.final.0
# Namespace http://www.loc.gov/MARC21/slim
from __future__ import unicode_literals
import pyxb
import pyxb.binding
import... | PixelDragon/pixeldragon | MARC21relaxed.py | Python | apache-2.0 | 30,253 |
# Copyright 2014 Rackspace
#
# 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... | jiahaoliang/group-based-policy | gbpservice/nfp/configurator/drivers/loadbalancer/v2/haproxy/octavia_lib/network/data_models.py | Python | apache-2.0 | 4,043 |
from django.shortcuts import render
from django.http import HttpResponse
from django.utils import simplejson as json
import ner
def index(request):
params = {'current': 'home'}
return render(request, 'index.html', params)
def name_entity_recognition(request):
if request.method == 'GET':
#Get the ... | smouzakitis/molly | molly/views.py | Python | apache-2.0 | 711 |
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | googleapis/python-dlp | samples/snippets/redact_test.py | Python | apache-2.0 | 1,601 |
class RegisterPair:
def __init__(self, name, register_high, register_low):
self.name = name
self.register_high = register_high
self.register_low = register_low
| AlexLitvino/i8080_simulator | microprocessor/register_pair.py | Python | apache-2.0 | 189 |
# Copyright 2014 Open Source Robotics Foundation, 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 ... | viccro/diarc | fabrik/flowlabel.py | Python | apache-2.0 | 1,392 |
"""
Ecks plugin to collect system memory usage information
Copyright 2011 Chris Read (chris.read@gmail.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.... | cread/ecks | ecks/plugins/memory.py | Python | apache-2.0 | 1,335 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2017-09-14 23:53
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('organization', '0004_teacher_image'),
('courses', '0... | LennonChin/Django-Practices | MxOnline/apps/courses/migrations/0007_course_teacher.py | Python | apache-2.0 | 640 |
# Copyright 2015 Isotoma Limited
#
# 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... | yaybu/touchdown | touchdown/provisioner/output.py | Python | apache-2.0 | 2,488 |
from webfs import WebDirParser
testDoc = """
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<title>Index of /ubuntu</title>
</head>
<body>
<h1>Index of /ubuntu</h1>
<pre><img src="/icons/blank.gif" alt="Icon "> <a href="?C=N;O=D">Name</a> <a href="?C=M;O=A">Last modified<... | harun-emektar/webfs | tests/Test_WebDirParser.py | Python | apache-2.0 | 1,416 |
from bacnet import BACNetTransform
from cwmp import CWMPTransform
from dns import DNSTransform
from ftp import FTPTransform
from http import HTTPTransform
from http import HTTPWWWTransform
from https import HTTPSTransform
from https import HTTPSGetTransform
from https import HTTPSWWWTransform
from https import Heartb... | zmap/ztag | ztag/transforms/__init__.py | Python | apache-2.0 | 1,377 |
"""
@author: ArcGIS for Intelligence
@contact: defensesolutions@esri.com
@company: Esri
@version: 1.0
@description: Used to stage the apps for Movement Analysis
@requirements: Python 2.7.x, ArcGIS 10.3.1
@copyright: Esri, 2015
"""
import arcresthelper
from arcresthelper import portalautomati... | conklinbd/MovementAnalysis | TemplateInstall/PortalDeploy/StageApp.py | Python | apache-2.0 | 726 |
# ===============================================================================
# Copyright 2013 Jake Ross
#
# 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/licens... | UManPychron/pychron | pychron/lasers/tasks/panes/ablation.py | Python | apache-2.0 | 4,882 |
# -*- coding: utf-8 -*-
__author__ = 'eveliotc'
__license__ = 'See LICENSE'
import alfred
from alfred import Item
import sys
from subprocess import Popen, PIPE
def json_to_obj(x):
if isinstance(x, dict):
return type('X', (), {k: json_to_obj(v) for k, v in x.iteritems()})
else:
return x
def jo... | eveliotc/gradleplease-workflow | common.py | Python | apache-2.0 | 1,475 |
"""
mbed CMSIS-DAP debugger
Copyright (c) 2006-2013 ARM Limited
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 ... | geky/pyOCD | pyOCD/flash/flash_kl28z.py | Python | apache-2.0 | 6,139 |
from nativedroid.protobuf.java_signatures_pb2 import *
__author__ = "Fengguo Wei"
__copyright__ = "Copyright 2018, The Argus-SAF Project"
__license__ = "Apache v2.0"
def java_package_str(java_package_pb, delimiter):
"""
Return full string of a java package proto.
:param JavaPackage java_package_pb: java_... | arguslab/Argus-SAF | nativedroid/nativedroid/jawa/utils.py | Python | apache-2.0 | 4,799 |
class Solution:
def uniquePathsIII(self, grid: 'List[List[int]]') -> 'int':
self.res = 0
R, C, E = len(grid), len(grid[0]), 1
for i in range(R):
for j in range(C):
if grid[i][j] == 1: x,y = (i, j)
elif grid[i][j] == 2: end = (i, j)
... | zuun77/givemegoogletshirts | leetcode/python/980_unique_paths_III.py | Python | apache-2.0 | 938 |
#!/usr/bin/python
# Copyright (c) 2014 SwiftStack, 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... | caiobrentano/swift_undelete | setup.py | Python | apache-2.0 | 1,663 |
import os
import time
import logging
import math
from parsl.channels import LocalChannel
from parsl.launchers import SingleNodeLauncher
from parsl.providers.cluster_provider import ClusterProvider
from parsl.providers.lsf.template import template_string
from parsl.providers.provider_base import JobState, JobStatus
fro... | Parsl/parsl | parsl/providers/lsf/lsf.py | Python | apache-2.0 | 10,602 |
# -*- 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/sources/en/movie4kis.py | Python | apache-2.0 | 4,184 |
# All-Terrain-Life-Vest
All Terrain Life Vest- IEA Raspverry Pi Competition Entry
# Description
import RPi.GPIO as GPIO
import time
import os
GPIO.setmode (GPIO.BCM)
GPIO.cleanup()
GPIO.setwarnings(False)
GPIO.setup(17,GPIO.OUT)
GPIO.setup(04,GPIO.OUT)
GPIO.setup(22, GPIO.IN)
print("---------------")
print("Button... | 8acs2016/All-Terrain-Life-Vest | code.py | Python | apache-2.0 | 762 |
import urllib
from flask import Flask, Response, abort, request, send_file
from flask_restful import Resource, Api
from flask_cors import CORS, cross_origin
import datetime
import json
import vacker.file_factory
app = Flask(__name__)
api = Api(app)
file_factory = vacker.file_factory.FileFactory()
CORS(app, resourc... | MatthewJohn/vacker | vacker/server.py | Python | apache-2.0 | 1,498 |
# Copyright 2019 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 | official/vision/detection/modeling/retinanet_model.py | Python | apache-2.0 | 6,957 |
import logging
from boto3.resources.factory import ResourceFactory
from boto3.resources.model import ResourceModel
from boto3.resources.base import ResourceMeta
from boto3.docs import docstring
from boto3.exceptions import ResourceLoadException
from boto3.resources.factory import build_identifiers
from functools impor... | terrycain/aioboto3 | aioboto3/resources/factory.py | Python | apache-2.0 | 10,415 |
from PyCA.Core import *
import PyCA.Common as common
import numpy as np
import matplotlib.pyplot as plt
def SplatSafe(outMass, g, mass):
mType = mass.memType()
if mType == MEM_DEVICE:
minmaxl = MinMax(mass)
maxval = max([abs(x) for x in minmaxl])
if maxval > 2000.00:
... | rkwitt/quicksilver | code/vectormomentum/Code/Python/Libraries/CAvmCommon.py | Python | apache-2.0 | 34,587 |
import shutil
import tempfile
import numpy as np
import os
from os.path import getsize
import pytest
import yaml
from util import PATH_TO_TESTS, seed, dummy_predict_with_threshold
PATH_TO_ASSETS = os.path.join(PATH_TO_TESTS, 'assets')
PATH_TO_RETINA_DIR = os.path.join(PATH_TO_ASSETS, 'recordings', 'retina')
PATH_TO_R... | paninski-lab/yass | tests/conftest.py | Python | apache-2.0 | 2,794 |
def index_power(array, n):
if n>=len(array):
return -1
else:
return array[n]**n
if __name__ == '__main__':
# These "asserts" using only for self-checking and not necessary for auto-testing
assert index_power([1, 2, 3, 4], 2) == 9, "Square"
assert index_power([1, 3, 10, 100], 3) == 1... | nesterione/problem-solving-and-algorithms | problems/Empireofcode/IndexPower.py | Python | apache-2.0 | 441 |
# Copyright (c) 2018 Foundries.io
#
# SPDX-License-Identifier: Apache-2.0
import argparse
from unittest.mock import patch, call
import pytest
from runners.nrfjprog import NrfJprogBinaryRunner
from conftest import RC_KERNEL_HEX
#
# Test values
#
TEST_DEF_SNR = 'test-default-serial-number' # for mocking user input... | GiulianoFranchetto/zephyr | scripts/west_commands/tests/test_nrfjprog.py | Python | apache-2.0 | 9,816 |
# coding=utf-8
# Copyright 2020 The TF-Agents 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | tensorflow/agents | tf_agents/train/utils/strategy_utils.py | Python | apache-2.0 | 2,113 |
#!/usr/bin/env python
# Lint as: python3
"""Tests for PrometheusStatsCollector."""
from absl import app
from grr_response_core.stats import stats_test_utils
from grr_response_server import prometheus_stats_collector
from grr.test_lib import test_lib
class PrometheusStatsCollectorTest(stats_test_utils.StatsCollecto... | google/grr | grr/server/grr_response_server/prometheus_stats_collector_test.py | Python | apache-2.0 | 514 |