code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
# coding=utf-8
# Copyright 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 pytest
from ... | tejal29/pants | tests/python/pants_test/tasks/test_list_goals.py | Python | apache-2.0 | 4,020 |
"""Unit tests for the Jira manual test duration collector."""
from .base import JiraTestCase
class JiraManualTestDurationTest(JiraTestCase):
"""Unit tests for the Jira manual test duration collector."""
METRIC_TYPE = "manual_test_duration"
async def test_duration(self):
"""Test that the duratio... | ICTU/quality-time | components/collector/tests/source_collectors/jira/test_manual_test_duration.py | Python | apache-2.0 | 745 |
#
# Copyright 2016 The BigDL 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 ... | intel-analytics/BigDL | python/chronos/test/bigdl/chronos/forecaster/test_prophet_forecaster.py | Python | apache-2.0 | 4,818 |
#!/usr/bin/env python
#Source Code provided by https://pointlessprogramming.wordpress.com/2011/02/13/python-cgi-tutorial-2/ by Nick Zarczynski.
import cgi
form = cgi.FieldStorage()
val1 = form.getvalue('first')
val2 = form.getvalue('last')
print "Content-type: text/html"
print
print "<html><head><title>Test URL... | davischau/CMPUT410Lab3 | server/test_urlencode.py | Python | apache-2.0 | 404 |
# Copyright 2020. ThingsBoard
#
# 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 ... | thingsboard/thingsboard-gateway | tests/converters/test_odbc_uplink_converter.py | Python | apache-2.0 | 2,890 |
from mpl_toolkits.basemap import Basemap
import BaseDomsHandler
import ResultsStorage
import numpy as np
import string
from cStringIO import StringIO
from multiprocessing import Process, Manager
import matplotlib.pyplot as plt
import matplotlib
matplotlib.use('Agg')
PARAMETER_TO_FIELD = {
"sst": "sea_water_te... | dataplumber/nexus | analysis/webservice/algorithms/doms/mapplot.py | Python | apache-2.0 | 5,004 |
# ----------------------------------------------------------------------------
# Copyright 2014 Nervana Systems Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.o... | Bam4d/neon | neon/transforms/cost.py | Python | apache-2.0 | 11,917 |
# Copyright (c) 2016 GigaSpaces Technologies Ltd. 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 ... | cloudify-cosmo/cloudify-nsx-plugin | cloudify_nsx/library/nsx_security_tag.py | Python | apache-2.0 | 2,966 |
#
# Copyright (C) 2008 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | linux-knight/repo | subcmds/sync.py | Python | apache-2.0 | 26,550 |
#coding:utf-8
'''
New Integration Test for zstack cloudformation.
Create a Basic vm with eip.
Cover resource:VM,VIP,EIP
@author: Lei Liu
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.operations.resource_stack as resource_stack_ops
import zstackwoodpecker.operations.resource_o... | zstackio/zstack-woodpecker | integrationtest/vm/zstackformation/test_create_eip.py | Python | apache-2.0 | 7,061 |
# Copyright 2015 Open vStorage NV
#
# 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 writ... | tcpcloud/openvstorage | ovs/extensions/db/arakoon/tests/__init__.py | Python | apache-2.0 | 630 |
# 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... | chenglongwei/trafficserver | ci/tsqa/tests/test_redirection.py | Python | apache-2.0 | 1,880 |
#
# 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... | mistercrunch/airflow | tests/models/test_baseoperator.py | Python | apache-2.0 | 29,590 |
import os
import re
SCHEDULER_NAME = os.environ.get("MEMSQL_SCHEDULER_NAME", "memsql")
if SCHEDULER_NAME == "memsql":
DEFAULT_DATA_ROOT_PATH = "memsql_scheduler"
else:
DEFAULT_DATA_ROOT_PATH = "memsql_scheduler_%s" % re.sub("\W", "", SCHEDULER_NAME)
__version__ = "0.0.1"
| memsql/memsql-mesos | memsql_framework/__init__.py | Python | apache-2.0 | 282 |
# 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 pytest
from ... | jtrobec/pants | tests/python/pants_test/backend/jvm/targets/test_jvm_target.py | Python | apache-2.0 | 908 |
"""
Cloning resources.
"""
from marshmallow import (
Schema,
fields,
post_load,
pre_dump,
)
class EdgeSchema(Schema):
"""
An edge between UUID node ids.
"""
fromId = fields.UUID(
attribute="from_id",
required=True,
)
toId = fields.UUID(
attribute="to_i... | globality-corp/microcosm-flask | microcosm_flask/cloning.py | Python | apache-2.0 | 2,468 |
# unit tests for each of the 3 main modules within berrl
# pipehtml and piperealtime tests still need written!!!
import os
#testing pipegeohash
os.chdir('pipegeohash_test')
execfile('test_pipegeohash.py')
os.chdir('..')
# testing pipegeojson
os.chdir('pipegeojson_test')
execfile('test_pipegeojson.py')
os.chdir('..')
... | murphy214/berrl | tests/build_test.py | Python | apache-2.0 | 323 |
import numpy as np
from . import Measurement
class PixelAverage(Measurement):
"""
This is an incredibly basic example of a feature-extraction measurement.
Returns
-------
np.array
Contains a single element equal to the average of all pixel values in the image.
"""
def compute(self, image):
return [np.aver... | widoptimization-willett/feature-extraction | feature_extraction/measurements/pixelaverage.py | Python | apache-2.0 | 332 |
# Copyright (c) 2018 by contributors. 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... | aksnzhy/xLearn | python-package/xlearn/xlearn.py | Python | apache-2.0 | 12,443 |
import os.path
import queue
import requests
import threading
from . import linkextraction
class MockStorage(object):
def store(self, url, html):
pass
class FileStorage(object):
def __init__(self, folder):
self.folder = folder
def store(self, url, html):
filename = url.replace('_'... | aufziehvogel/dungbeetle | dungbeetle/crawler.py | Python | apache-2.0 | 1,548 |
"""
This module contains all request handlers which
are associated with the enter of user to application.
For example, there are functions for registration requests,
request to enter system, and request to logout.
"""
__author__ = 'Thodoris Sotiropoulos'
import json
from flask import session, request, redirect, ur... | theosotr/netxanal | mvc/view/registration.py | Python | apache-2.0 | 3,541 |
import re
import os
import sys
import json
import time
import doctest
import textwrap
import subprocess
from nbformat import v3, v4
from datetime import datetime, date
import argparse
# Hacky solution to avoid picking up ParaView's python packages (i.e. pygments)
# that causes the notebooks to not be generated
try:
o... | BioDynaMo/biodynamo | util/demo_to_notebook.py | Python | apache-2.0 | 15,802 |
# Copyright 2012 OpenStack Foundation
# All Rights Reserved
# Copyright (c) 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/lic... | afrolov1/nova | nova/network/neutronv2/api.py | Python | apache-2.0 | 57,638 |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.6.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
im... | skuda/client-python | kubernetes/test/test_v1_non_resource_attributes.py | Python | apache-2.0 | 925 |
#!/usr/bin/python
# Copyright 2016 Joel Dunham
#
# 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... | jrwdunham/old | oldterm.py | Python | apache-2.0 | 6,105 |
import os
import glob
import sys
import re
if __name__ == '__main__':
script, subCommand, workingDir, jdkDir, outputDir, optionsPath, classPathsPath, sourcesPath, logPath, listFilePath, faninPath = sys.argv
def read_list_file():
if os.path.exists(listFilePath):
with open(listFilePath, "r... | fifoforlifo/pynja | packages/pynja/scripts/javac-invoke.py | Python | apache-2.0 | 4,162 |
# Copyright 2017-present MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | wujuguang/motor | test/tornado_tests/test_motor_session.py | Python | apache-2.0 | 8,232 |
"""
sphinx.roles
~~~~~~~~~~~~
Handlers for additional ReST roles.
:copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from typing import TYPE_CHECKING, Any, Dict, List, Tuple, Type
from docutils import nodes, utils
from docutils.... | sonntagsgesicht/regtest | .aux/venv/lib/python3.9/site-packages/sphinx/roles.py | Python | apache-2.0 | 13,846 |
import unittest
from mock import patch, Mock, call
from the_ark import jcr_helpers
import requests.exceptions
TEST_URL = "http://www.test.com"
TEST_PATH = "/content/path"
JCR_NON_PAGE = {
"jcr:primaryType": "nt:unstructured",
"jcr:lastModifiedBy": "admin",
"jcr:lastModified": "Thu Dec 08 2016 00:19:17 GMT... | meltmedia/the-ark | tests/test_jcr_helpers.py | Python | apache-2.0 | 15,587 |
from troposphere import (
Parameter,
Ref,
Equals,
Output,
Tags,
GetAtt,
Base64,
Join,
cloudwatch as cw,
ec2,
elasticloadbalancing as elb,
autoscaling as asg
)
from utils.cfn import get_recent_ami
from utils.constants import (
ALLOW_ALL_CIDR,
EC2_INSTANCE_TYPES,
... | kdeloach/raster-foundry | deployment/cfn/application.py | Python | apache-2.0 | 17,090 |
"""
page 132
"""
from sklearn.naive_bayes import GaussianNB
data_table = [
[1, 1, 1, 0],
[0, 0, 0, 1],
[0, 1, 0, 0],
[1, 0, 0, 0],
[1, 1, 0, 1],
[1, 0, 0, 1],
[0, 1, 1, 1],
[0, 0, 0, 0],
[1, 0, 1, 0],
[0, 1, 0, 1]
]
X = [x[0:2] for x in data_table]
print(X)
y1 = [x[2] for x in ... | hhj0325/pystock | com/hhj/baihuabigdata/demo4.py | Python | apache-2.0 | 523 |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | dougfelt/nototools | nototools/gpos_diff.py | Python | apache-2.0 | 10,512 |
"""
WSGI config for navel project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTIN... | flychensc/orange | navel/wsgi.py | Python | apache-2.0 | 388 |
# -*- coding: utf-8 -*-
from __future__ import with_statement
import psycopg2
from psycopg2 import pool
from config import LoggerLoader
from database.postgres_db import PostgresDataBase
__author__ = 'leandroloi'
__license__ = "GPL"
__version__ = "0.0.1"
__maintainer__ = "Leandro Loi"
__email__ = "leandroloi at gmail d... | leandroloi/bovespa-eod | database/__init__.py | Python | apache-2.0 | 1,860 |
import asyncio
import logging
from contextlib import ContextDecorator
from functools import wraps
from unittest.mock import patch, _patch
from typing import List, Dict, Tuple, TypeVar, Type, NamedTuple, Optional, Set
from lightbus import (
RpcTransport,
EventTransport,
SchemaTransport,
ResultTransport... | adamcharnock/lightbus | lightbus/utilities/testing.py | Python | apache-2.0 | 16,695 |
from __future__ import print_function, absolute_import, division
from future.builtins import *
from future import standard_library
standard_library.install_aliases()
# Copyright 2017 Autodesk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with ... | Autodesk/molecular-design-toolkit | moldesign/utils/databases.py | Python | apache-2.0 | 2,281 |
# Copyright 2012 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,... | raphlinus/ghilbert | app/edit.py | Python | apache-2.0 | 17,458 |
"""
* The <code>ThreadedTest</code> is a test decorator that
* runs a test in a separate thread.
*
* @author <b>Mike Clark</b>
* @author Clarkware Consulting, Inc.
**************************************
* Ported to Python by Grig Gheorghiu *
**************************************
"""
import time
from threading ... | nmondal/pyunitperf | ThreadedTest.py | Python | apache-2.0 | 1,719 |
# Nothing in this file should need to be edited.
# Use package.json to adjust metadata about this package.
# Use MANIFEST.in to include package-specific data files.
import os
import json
from setuptools import setup, find_packages
info = json.load(open("./package.json"))
def generate_namespaces(package):
i ... | armstrong/armstrong.core.arm_layout | setup.py | Python | apache-2.0 | 1,334 |
from django.conf import settings
from django.contrib.auth.models import User
from uuidfield import UUIDField
from django.db import models
# Base API User Class
class APIUser(models.Model):
user = models.OneToOneField(User)
id = UUIDField(auto=True, primary_key=True)
host = models.URLField(null=False, defau... | CMPUT404/socialdistribution | api/models/user.py | Python | apache-2.0 | 780 |
# Example of calling REST API from Python to manage APIC-EM users/roles using APIC-EM APIs.
# * THIS SAMPLE APPLICATION AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
# * OF ANY KIND BY CISCO, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
# * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY FITNESS FOR A PA... | CiscoDevNet/coding-skills-sample-code | coding102-REST-python-dcloud/manage-users.py | Python | apache-2.0 | 5,294 |
""" Cisco_IOS_XR_common_acl_datatypes
This module contains a collection of generally useful
derived YANG data types.
Copyright (c) 2013\-2016 by Cisco Systems, Inc.
All rights reserved.
"""
import re
import collections
from enum import Enum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, Fixed... | 111pontes/ydk-py | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_common_acl_datatypes.py | Python | apache-2.0 | 920 |
# Copyright 2015 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | dimtruck/magnum | magnum/tests/unit/conductor/tasks/test_heat_tasks.py | Python | apache-2.0 | 4,943 |
import re, sys, json, time, xbmc
import control
import bookmarks
class player(xbmc.Player):
def __init__(self):
xbmc.Player.__init__(self)
self.totalTime = 0
self.loadingTime = 0
self.currentTime = 0
self.title = ""
self.year = 2015
self.offset = '0'
... | camalot/plugin.video.microsoftvirtualacademy | resources/lib/player.py | Python | apache-2.0 | 5,130 |
from django.conf.urls.defaults import *
from django.conf import settings
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
#(r'^tinymcewrapper/', include('tinymcewrapper.urls')),
(r'^admin/', include(admin.site.urls)),
)
urlpatterns = urlpatterns + patterns('',
(r'^static/(... | callowayproject/django-tinymcewrapper | example/urls.py | Python | apache-2.0 | 456 |
# -*- coding: utf-8 -*-
# Import the basic Django ORM models library
from django.db import models
from model_utils.models import TimeStampedModel
from taggit.managers import TaggableManager
from autoslug.fields import AutoSlugField
from users.models import User
class Category(TimeStampedModel):
title = models.C... | zhiwehu/zhiwehu | zhiwehu/post/models.py | Python | apache-2.0 | 2,831 |
"""Reslowe process model."""
from django.conf import settings
from django.contrib.postgres.fields import JSONField
from django.core.validators import RegexValidator
from django.db import models
from .base import BaseModel
class Process(BaseModel):
"""Postgres model for storing processes."""
class Meta(BaseM... | jberci/resolwe | resolwe/flow/models/process.py | Python | apache-2.0 | 6,293 |
# Copyright 2016 Autodesk 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... | tkzeng/molecular-design-toolkit | moldesign/utils/__init__.py | Python | apache-2.0 | 695 |
import gunicorn
from bottle import request, response, route
import bottle
from sys import argv
@route('/')
def index():
return 'Hello!'
@route('/oauth/authorise/basic', method=['GET','POST'])
def oauth_redirect():
return 'Hello!'
@route('/oauth/access/token', method=['GET','POST'])
def oauth_access_token... | cmlh/Heroku-py | example_gunicorn.py | Python | apache-2.0 | 480 |
"""add ondelete cascade to organisation_committee
Revision ID: 15cc05702df3
Revises: 29978548fcb6
Create Date: 2015-02-10 09:58:45.663899
"""
# revision identifiers, used by Alembic.
revision = '15cc05702df3'
down_revision = '29978548fcb6'
branch_labels = None
depends_on = None
from alembic import op
import sqlalch... | Code4SA/pmg-cms-2 | migrations/versions/15cc05702df3_add_ondelete_cascade_to_organisation_.py | Python | apache-2.0 | 884 |
# -*- coding: utf-8 -*-
"""
Created on Feb 20, 2014
@author: Aaron Ponti
"""
import re
import random
import math
from MicroscopyCompositeDatasetConfig import MicroscopyCompositeDatasetConfig
from ch.systemsx.cisd.openbis.dss.etl.dto.api.impl import MaximumIntensityProjectionGenerationAlgorithm
from ch.systemsx.cisd.... | aarpon/obit_microscopy_core_technology | core-plugins/microscopy/2/dss/drop-boxes/MicroscopyDropbox/VisitronNDCompositeDatasetConfig.py | Python | apache-2.0 | 18,425 |
#
# sonos.py
# Who doesn't love some music?
#
__Author__ = 'Chris Swanson'
import soco
import ConfigParser
import time
class Sonos:
def __init__(self):
self.import_conf()
self.sonos = soco.SoCo(self.ipaddr)
def import_conf(self):
config = ConfigParser.ConfigParser()
confi... | ChrisSwanson/PygerAlarm | alarms/sonos.py | Python | apache-2.0 | 1,193 |
"""Config flow to configure Heos."""
import asyncio
from pyheos import Heos
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_HOST, CONF_NAME
from .const import DATA_DISCOVERED_HOSTS, DOMAIN
def format_title(host: str) -> str:
"""Format the title for config ... | fbradyirl/home-assistant | homeassistant/components/heos/config_flow.py | Python | apache-2.0 | 2,907 |
from pony.orm import *
from datetime import datetime
from model.group import Group
from model.contact import Contact
from pymysql.converters import encoders, decoders, convert_mysql_timestamp
class ORMFixture:
db = Database()
class ORMGroup(db.Entity):
_table_ = 'group_list'
id = PrimaryKey(i... | vspitsyn/python_taining | fixture/orm.py | Python | apache-2.0 | 3,388 |
# vim:tw=50
"""Tuples
You have already seen one kind of sequence: the
string. Strings are a sequence of one-character
strings - they're strings all the way down. They
are also **immutable**: once you have defined one,
it can never change.
Another immutable seqeunce type in Python is the
**tuple**. You define a tupl... | shiblon/pytour | 3/tutorials/tuples.py | Python | apache-2.0 | 1,633 |
#
# 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... | wooga/airflow | airflow/providers/jenkins/operators/jenkins_job_trigger.py | Python | apache-2.0 | 10,560 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'sortdialog.ui'
#
# Created: Sat Apr 18 15:24:45 2015
# by: pyside-uic 0.2.15 running on PySide 1.2.2
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, QtGui
class Ui_SortDialog(object):
def setupU... | piexona/pyside-examples | sortdialog.py | Python | apache-2.0 | 9,805 |
import os
import jinja2
import webapp2
import logging
JINJA_ENVIRONMENT = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)),
extensions=['jinja2.ext.autoescape'],
autoescape=True)
from flask import Flask
app = Flask(__name__)
app.config['DEBUG'] = True
# Note: We don't need to... | rchlchang/byte1 | main.py | Python | apache-2.0 | 682 |
import numpy as np
from .VariableUnitTest import VariableUnitTest
from gwlfe.MultiUse_Fxns.Runoff import CNum
class TestCNum(VariableUnitTest):
def test_elementwise_CNum(self):
z = self.z
np.testing.assert_array_almost_equal(
np.load(self.basepath + "/CNum.npy"),
CNum.CNu... | WikiWatershed/gwlf-e | test/unittests/test_CNum.py | Python | apache-2.0 | 821 |
#
# This file is execfile()d with the current directory set to its containing dir
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
try:
import sphinx_rtd_theme
except... | pyca/pynacl | docs/conf.py | Python | apache-2.0 | 6,159 |
#!/usr/bin/env python
# Copyright 2016 Criteo
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | unbrice/biggraphite | tests/test_carbon.py | Python | apache-2.0 | 3,483 |
# 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 Lice... | AnshulYADAV007/Lean | Algorithm.Python/CompositeAlphaModelFrameworkAlgorithm.py | Python | apache-2.0 | 2,828 |
import re
import logging
from cattle import utils
from cattle.lock import lock
from cattle.utils import JsonObject
log = logging.getLogger("agent")
class BaseHandler(object):
def __init__(self):
pass
def events(self):
ret = []
for i in utils.events_from_methods(self):
re... | wlan0/python-agent | cattle/agent/handler.py | Python | apache-2.0 | 3,407 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test_settings")
from django.core.management import execute_from_command_line
is_testing = 'test' in sys.argv
if is_testing:
import coverage
cov = coverage.coverage(s... | Miserlou/django-easy-timezones | manage.py | Python | apache-2.0 | 526 |
"""Adding metric warning_text
Revision ID: 19a814813610
Revises: ca69c70ec99b
Create Date: 2017-09-15 15:09:40.495345
"""
# revision identifiers, used by Alembic.
revision = '19a814813610'
down_revision = 'ca69c70ec99b'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('metrics', sa.... | alanmcruickshank/superset-dev | superset/migrations/versions/19a814813610_adding_metric_warning_text.py | Python | apache-2.0 | 717 |
import tensorflow as tf
import numpy as np
from . import base_model
class Qnetwork(base_model.BaseModel):
"""
Args:
name (string): label for model namespace
path (string): path to save/load model
input_shape (tuple): tuple of inputs to network.
output_shape (int): number of out... | lightd22/smartDraft | src/models/qNetwork.py | Python | apache-2.0 | 10,997 |
# 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 copy of t... | gooddata/openstack-nova | nova/tests/unit/test_fixtures.py | Python | apache-2.0 | 20,898 |
# Copyright 2012, Nachi Ueno, NTT MCL, 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 applic... | spandanb/horizon | openstack_dashboard/dashboards/project/routers/ports/tables.py | Python | apache-2.0 | 4,088 |
from oslo_utils import uuidutils
def rand_name(name=''):
rand_data = uuidutils.generate_uuid()[:8]
if name:
return '%s-%s' % (name, rand_data)
else:
return rand_data
| esikachev/my-dev-client | my_dev/tests/utils.py | Python | apache-2.0 | 196 |
from botor import Botor
from botor.aws.iam import get_role_managed_policies, get_role_inline_policies, get_role_instance_profiles
from bozor.aws.iam import _get_name_from_structure, modify, _conn_from_args
def _get_base(role, **conn):
"""
Determine whether the boto get_role call needs to be made or if we alre... | monkeysecurity/bozor | bozor/aws/iam/role.py | Python | apache-2.0 | 2,398 |
# Copyright 2014 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | xuweiliang/Codelibrary | novaclient/v2/versions.py | Python | apache-2.0 | 4,239 |
import unittest
from robot.utils.asserts import assert_equal
from robot.model.statistics import Statistics
from robot.result import TestCase, TestSuite
def verify_stat(stat, name, passed, failed, skipped, critical=None, combined=None,
id=None, elapsed=0):
assert_equal(stat.name, name, 'stat.name'... | snyderr/robotframework | utest/model/test_statistics.py | Python | apache-2.0 | 10,312 |
__license__ = """
Copyright 2012 DISQUS
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, so... | disqus/bokbok | fabfile.py | Python | apache-2.0 | 2,084 |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 BigML
#
# 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 ... | brokendata/bigmler | bigmler/checkpoint.py | Python | apache-2.0 | 12,195 |
import random
import threading
import uuid
import socket
import six
import pexpect
from pandaharvester.harvestercore import core_utils
if six.PY2:
pexpect_spawn = pexpect.spawn
else:
pexpect_spawn = pexpect.spawnu
# logger
baseLogger = core_utils.setup_logger('ssh_tunnel_pool')
# Pool of SSH tunnels
class... | PanDAWMS/panda-harvester | pandaharvester/harvestermiddleware/ssh_tunnel_pool.py | Python | apache-2.0 | 6,713 |
# -*- coding: utf-8 -*-
# Copyright (C) 2017 Nippon Telegraph and Telephone 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
#
#... | beluganos/beluganos | src/fabricflow/fibc/app/fibcapi.py | Python | apache-2.0 | 10,265 |
# 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 | jax_dft/setup.py | Python | apache-2.0 | 1,145 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2011 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... | nearlyfreeapps/python-googleadwords | examples/adspygoogle/adwords/v201109/campaign_management/set_ad_parameters.py | Python | apache-2.0 | 3,488 |
# -*- 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | googleapis/python-spanner | docs/conf.py | Python | apache-2.0 | 12,378 |
# 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
# not use this file except in compliance wi... | potsmaster/cinder | cinder/utils.py | Python | apache-2.0 | 34,378 |
# Copyright 2016-2017, Fabien Boucher
# Copyright 2016-2017, Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | morucci/repoxplorer | repoxplorer/version.py | Python | apache-2.0 | 755 |
""" openconfig_mpls
This module provides data definitions for configuration of
Multiprotocol Label Switching (MPLS) and associated protocols for
signaling and traffic engineering.
RFC 3031\: Multiprotocol Label Switching Architecture
The MPLS / TE data model consists of several modules and
submodules as shown below... | abhikeshav/ydk-py | openconfig/ydk/models/openconfig/openconfig_mpls.py | Python | apache-2.0 | 526,973 |
"""
sphinx.builders.gettext
~~~~~~~~~~~~~~~~~~~~~~~
The MessageCatalogBuilder class.
:copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from codecs import open
from collections import OrderedDict, defaultdict
from datetime import datetime,... | sonntagsgesicht/regtest | .aux/venv/lib/python3.9/site-packages/sphinx/builders/gettext.py | Python | apache-2.0 | 11,428 |
from kfp.components import InputPath, OutputPath, create_component_from_func
def convert_apache_parquet_to_csv(
data_path: InputPath('ApacheParquet'),
output_data_path: OutputPath('CSV'),
):
'''Converts Apache Parquet to CSV.
[Apache Parquet](https://parquet.apache.org/)
Annotations:
auth... | kubeflow/pipelines | components/contrib/_converters/ApacheParquet/to_CSV/component.py | Python | apache-2.0 | 1,096 |
'''
Created on 2013-12-19
@author: zpfalpc23
'''
_FATAL_EXCEPTION_FORMAT_ERRORS = False
class TgetException(Exception):
"""
Base Tget Exception
To correctly use this class, inherit from it and define
a 'message' property. That message will get printf'd
with the keyword arguments provided to the ... | zhangpf/image-tget | tget/exception.py | Python | apache-2.0 | 1,581 |
"""
Support for Blink Home Camera System.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/blink/
"""
import logging
from datetime import timedelta
import voluptuous as vol
from homeassistant.helpers import (
config_validation as cv, discovery)
from ... | tinloaf/home-assistant | homeassistant/components/blink/__init__.py | Python | apache-2.0 | 5,050 |
# Copyright (c) 2017 Presslabs 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 law or agreed to in writ... | PressLabs/django-payu | example/example/settings.py | Python | apache-2.0 | 3,350 |
from mock import call
from scanpointgenerator import CompoundGenerator, LineGenerator
from malcolm.core import Context, Process
from malcolm.modules.pmac.blocks import raw_motor_block
from malcolm.modules.pmac.parts import MotorPreMovePart
from malcolm.modules.scanning.controllers import RunnableController
from malcol... | dls-controls/pymalcolm | tests/test_modules/test_pmac/test_motorpremovepart.py | Python | apache-2.0 | 1,398 |
import unittest
from p2bf.builder import BFBuild
from p2bf.emitter import Emitter
import StringIO
from util.run_bf import run
class TestVariableAssignment(unittest.TestCase):
def test_single_assignment(self):
emit_output = StringIO.StringIO()
run_output = StringIO.StringIO()
emitter = Emit... | vegitron/python2brainfuck | t/py2b/variable_assignment.py | Python | apache-2.0 | 1,480 |
# Copyright 2014 Yajie Miao Carnegie Mellon University
# 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
#
# THIS CODE IS PROVIDED *AS IS* B... | mclaughlin6464/pdnn | cmds2/run_CnnFeat.py | Python | apache-2.0 | 3,178 |
import copy
from fireant.dataset.fields import Field, is_metric_field
from fireant.queries.finders import find_field_in_modified_field
def _replace_reference_dimension(dimension, offset_func, field_transformer, trunc_date=None):
ref_definition = offset_func(field_transformer(dimension, trunc_date))
field = F... | kayak/fireant | fireant/queries/references.py | Python | apache-2.0 | 2,281 |
from .services import (HttpPageFetcher, ReadabilityArticleExtractor,
DocumentExtractorService)
from ...async import client_session
_page_fetcher = HttpPageFetcher(client_session)
_article_extractor = ReadabilityArticleExtractor(client_session)
extractor_service = DocumentExtractorService(_page_... | melphi/article-extractor | python/app/modules/extractor/components.py | Python | apache-2.0 | 349 |
# 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 applica... | asimshankar/tensorflow | tensorflow/python/data/kernel_tests/window_test.py | Python | apache-2.0 | 9,036 |
# coding: utf-8
#
# Copyright 2014-2017 Groupon, Inc.
# Copyright 2014-2017 The Billing Project, LLC
#
# The Billing Project, LLC licenses this file to you 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 a... | killbill/killbill-client-python | test/test_integration.py | Python | apache-2.0 | 10,301 |
'''
cdrFormula is an example of a package plug-in to both GUI menu and command line/web service
that compiles a CDR Formula Linbase file to be executed by Arelle XBRL Formula processing.
For description of CDR formula see:
http://http://www.ffiec.gov/find/taxonomy/call_report_taxonomy.html
Functions are desc... | sternshus/arelle2.7 | svr-2.7/arelle/plugin/cdrFormula/__init__.py | Python | apache-2.0 | 2,567 |
# 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 th... | hammerlab/gtftools | setup.py | Python | apache-2.0 | 2,043 |
from attributes.unit_test.discoverer import TestDiscoverer
class ObjectiveCTestDiscoverer(TestDiscoverer):
def __init__(self):
self.language = 'Objective C'
self.languages = ['Objective C', 'C/C++ Header']
self.extensions = ['*.m', '*.h']
self.frameworks = [
self.__xcte... | RepoReapers/reaper | attributes/unit_test/discoverer/objectivec.py | Python | apache-2.0 | 464 |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | googleapis/python-grafeas | grafeas/grafeas_v1/types/package.py | Python | apache-2.0 | 6,379 |
from __future__ import print_function
import sys
# from https://github.com/mitsuhiko/flask/blob/master/scripts/make-release.py L92
def fail(message, *args):
print('Error:', message % args, file=sys.stderr)
sys.exit(1)
def check_args(args):
"""Checks that the args are coherent."""
check_args_has_attr... | Alexis-benoist/eralchemy | eralchemy/helpers.py | Python | apache-2.0 | 1,305 |
# coding=utf-8
# Copyright 2019 The Interval Bound Propagation 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 ... | deepmind/interval-bound-propagation | interval_bound_propagation/tests/relative_bounds_test.py | Python | apache-2.0 | 14,261 |