repo_name stringlengths 5 104 | path stringlengths 4 248 | content stringlengths 102 99.9k |
|---|---|---|
vijayendrabvs/hap | neutron/tests/unit/nec/test_ofc_client.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 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.or... |
h2oai/h2o-dev | h2o-py/h2o/estimators/svd.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# This file is auto-generated by h2o-3/h2o-bindings/bin/gen_python.py
# Copyright 2016 H2O.ai; Apache License Version 2.0 (see LICENSE for details)
#
from __future__ import absolute_import, division, print_function, unicode_literals
from h2o.estimators.estimator_base ... |
vrsource/mapproxy | mapproxy/test/system/test_cache_source.py | # This file is part of the MapProxy project.
# Copyright (C) 2012 Omniscale <http://omniscale.de>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE... |
mikalstill/nova | nova/api/openstack/placement/policies/trait.py | # 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
# d... |
Netflix/security_monkey | security_monkey/watchers/ses.py | # Copyright 2014 Netflix, 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... |
sxjscience/tvm | tests/python/unittest/test_tir_intrin.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
HugoKuo/keystone-essex3 | keystone/__init__.py | # Copyright (C) 2011 OpenStack 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 wr... |
Si-elegans/Web-based_GUI_Tools | spirit/views/topic_unread.py | #-*- coding: utf-8 -*-
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from spirit.utils.paginator.infinite_paginator import paginate
from spirit.models.topic import Topic
@login_required
def topic_unread_list(request):
# TODO: add button to clean up read topics? o... |
SVilgelm/CloudFerry | docs/conf.py | # -*- coding: utf-8 -*-
#
# CloudFerry documentation build configuration file, created by
# sphinx-quickstart on Mon Jan 25 14:02:01 2016.
#
# 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.
#
... |
nephomaniac/eucio | eucio/namespace.py | #!/usr/bin/env python
# Copyright 2009-2014 Eucalyptus 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.org/licenses/LICENSE-2.0
# Unless required by app... |
stephane-martin/salt-debian-packaging | salt-2016.3.3/tests/unit/states/mac_xattr_test.py | # -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import
# Import Salt Libs
from salt.states import mac_xattr as xattr
# Import Salt Testing Libs
from salttesting import TestCase
from salttesting.helpers import ensure_in_syspath
from salttesting.mock import (
MagicMock,
patch
)
en... |
zstackorg/zstack-woodpecker | integrationtest/vm/monitor/5min_alert_vm_network_rx.py |
'''
Test about monitor trigger on vm network rx in five minutes
@author: Songtao,Haochen
'''
import os
import test_stub
import random
import time
import threading
import zstacklib.utils.ssh as ssh
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.operations.resource_operations as res_ops
impor... |
openstack/freezer-api | freezer_api/common/policies/base.py | # 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... |
hehongliang/tensorflow | tensorflow/python/data/util/sparse_test.py | # 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... |
Acehaidrey/incubator-airflow | airflow/executors/celery_executor.py | #
# 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... |
haypo/trollius | examples/fetch3.py | """Fetch one URL and write its content to stdout.
This version adds a primitive connection pool, redirect following and
chunked transfer-encoding. It also supports a --iocp flag.
"""
from __future__ import print_function
import sys
try:
from urllib.parse import urlparse
from http.client import BadStatusLine
... |
Dieterbe/anthracite | backend.py | from types import IntType, StringType, UnicodeType
import time
import datetime
import calendar
import os
import sys
class Config(dict):
'''
based on http://stackoverflow.com/questions/4984647/accessing-dict-keys-like-an-attribute-in-python
create a config object based on an imported module.
with the m... |
chrislovecnm/gpmr | pet-race-job/pet_race_job/model/race_participant.py | '''
entity RaceParticipants {
raceParticipantId UUID,
petId UUID,
raceId UUID,
petName String,
petColor UUID,
petCategoryName String,
petCategoryId UUID,
startTime DateTime,
finishTime Decimal,
finishPosition Integer,
finished Boolean
}
'''
import uuid
from cassandra.cqlengine import columns
from cassandra... |
PAIR-code/lit | lit_nlp/components/citrus/utils_test.py | # 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 agreed to in writing, s... |
fpieper/py2neo | py2neo/__init__.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright 2011-2014, Nigel Small
#
# 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... |
JiscPER/jper | service/tests/fixtures/__init__.py | """
This module contains all of the fixtures that are used throughout the testing.
The fixtures from each of the sub-modules are imported here for convenience, so instead of
::
from service.tests.fixtures.notifications import NotificationFactory
from service.tests.fixtures.repository import RepositoryFactory... |
Jscott27/googleads-shopping-samples | python/mcaccount_delete_batch.py | #!/usr/bin/python
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
wbap/Hackathon2015 | Tsuzuki/kusokora/bot.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import tweepy
import sys,time,os
import codecs
from gensim.models import word2vec
from datetime import *
import time
import inspect
CONSUMER_KEY = 'Fmx9H2RD96oECMuG1iSCmrVjf'
CONSUMER_SECRET ='zWNVrQTmHRfbe6EOTOZMQULX8nYfW7k2bztmAI1t36ZrUEElDB'
TOKEN = '3... |
jawilson/home-assistant | homeassistant/components/lifx/light.py | """Support for LIFX lights."""
import asyncio
from datetime import timedelta
from functools import partial
import logging
import math
import aiolifx as aiolifx_module
import aiolifx_effects as aiolifx_effects_module
from awesomeversion import AwesomeVersion
import voluptuous as vol
from homeassistant import util
from... |
Insoleet/aiohttp | tests/test_websocket_writer.py | import pytest
import random
from aiohttp import websocket
from unittest import mock
@pytest.fixture
def transport():
return mock.Mock()
@pytest.fixture
def writer(transport):
return websocket.WebSocketWriter(transport, use_mask=False)
def test_pong(transport, writer):
writer.pong()
transport.write... |
Tesora-Release/tesora-trove | trove/tests/unittests/datastore/test_datastore_version_metadata.py | # Copyright (c) 2015 Rackspace Hosting
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... |
partofthething/home-assistant | tests/components/modbus/test_modbus_cover.py | """The tests for the Modbus cover component."""
import pytest
from homeassistant.components.cover import DOMAIN as COVER_DOMAIN
from homeassistant.components.modbus.const import CALL_TYPE_COIL, CONF_REGISTER
from homeassistant.const import (
CONF_COVERS,
CONF_NAME,
CONF_SCAN_INTERVAL,
CONF_SLAVE,
S... |
Erotemic/hotspotter | _scripts/cvkpt_funcs.py |
#def old_cvkpts2_kpts(cvkpts)
#kpts = zeros((len(cvkpts), 5), dtype=float32)
#fx = 0
#for cvkp in cvkpts:
#(x,y) = cvkp.pt
#theta = cvkp.angle
#scale = float(cvkp.size)**2 / 27
#detA = 1./(scale)
#(a,c,d) = (detA, 0, detA)
#kpts[fx] = (x,y,a,c,d)
#fx... |
GabrielFortin/ansible-module-f5bigip | library/f5bigip_cm_trust_domain.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016-2018, Eric Jacob <erjac77@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.org/licenses/LICENS... |
apache/libcloud | docs/examples/compute/cloudstack/create_cloudstack_node_keypair_secgroup.py | from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
ACCESS_ID = "your access id"
SECRET_KEY = "your secret key"
HOST = "hostname or ip address of your management server"
PATH = "path to the api endpoint, e.g: /client/api"
SIZE_ID = "id of the computer offering you want to use... |
square/pants | tests/python/pants_test/tasks/test_protobuf_integration.py | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
import os
import re
... |
varunarya10/ironic | ironic/api/controllers/v1/chassis.py | # Copyright 2013 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
#
# Unless required by... |
m-lab/mlab-observatory | environment_bootstrap.py | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Copyright 2015 Measurement Lab
#
# 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 ... |
MicrosoftGenomics/FaST-LMM | tests/inputs/sc_mom_one_kernel_linear_qqfit.N300.py | distributable = FastLmmSet(
test="sc_mom",
outfile = 'tmp/sc_mom_one_kernel_linear_qqfit.N300.txt',
phenofile = 'datasets/phenSynthFrom22.23.N300.txt',
alt_snpreader = 'datasets/all_chr.maf0.001.N300',
altset_list = 'datasets/set_input.small.txt',
covarfile = None,
filenull = None,
... |
tanglei528/ceilometer | ceilometer/openstack/common/db/options.py | # 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 u... |
wemanuel/smry | smry/server-auth/ls/google-cloud-sdk/lib/googlecloudsdk/container/commands/clusters/__init__.py | # Copyright 2014 Google Inc. All Rights Reserved.
"""The command group for cloud container clusters."""
from googlecloudsdk.calliope import base
class Clusters(base.Group):
"""Deploy and teardown Google Container Engine clusters."""
@staticmethod
def Args(parser):
"""Add arguments to the parser.
Arg... |
fbradyirl/home-assistant | homeassistant/components/knx/sensor.py | """Support for KNX/IP sensors."""
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_NAME, CONF_TYPE
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
from ... |
tseaver/google-cloud-python | websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/web_security_scanner_client.py | # -*- coding: utf-8 -*-
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
thisismedium/python-xmpp-server | xmpp/interfaces.py | ## Copyright (c) 2010, Coptix, Inc. All rights reserved.
## See the LICENSE file for license terms and warranty disclaimer.
"""interfaces -- abstract interfaces"""
from __future__ import absolute_import
import abc, re
__all__ = (
'Event', 'CoreInterface', 'PluginManager',
'StreamError', 'StanzaError', 'IQEr... |
etingof/pyasn1-modules | tests/test_rfc5915.py | #
# This file is part of pyasn1-modules software.
#
# Created by Russ Housley
# Copyright (c) 2019, Vigil Security, LLC
# License: http://snmplabs.com/pyasn1/license.html
#
import sys
import unittest
from pyasn1.codec.der.decoder import decode as der_decoder
from pyasn1.codec.der.encoder import encode as der_encoder
... |
BrownDwarf/Starfish | tests/memory_module_profile.py | import numpy as np
from scipy.interpolate import interp1d
import h5py
import yaml
import gc
import pyfftw
import emcee
import bz2
from astropy.io import ascii,fits
from scipy.integrate import trapz
@profile
def base():
print("base")
@profile
def base2():
print("base2")
@profile
def base3():
print("base3"... |
riteshshrv/trytond-amazon-mws_old | shipment.py | # -*- coding: utf-8 -*-
"""
shipment.py
"""
from collections import defaultdict
from lxml.builder import E
from lxml import etree
from trytond.pool import PoolMeta, Pool
from trytond.pyson import Eval, PYSONEncoder
from trytond.model import ModelView, fields, Workflow
from trytond.wizard import Wizard, StateAction,... |
python-acoustics/python-acoustics | acoustics/standards/iso_1683_2015.py | """
ISO 1683:2015
=============
"""
REFERENCE_VALUES = {
"gas": {
"pressure": 2e-5, # Pa
"exposure": (2e-5)**2, # Pa^2 s
"power": 1e-12, # W
"energy": 1e-12, # J
"intensity": 1e-12, # W/m^2
},
"liquid": {
"pressure": 1e-5, # Pa
"exposure": 1e-5, ... |
vkosuri/ChatterBot | tests_django/test_chatbot.py | from tests_django.base_case import ChatterBotTestCase
from chatterbot.conversation import Statement
class ChatBotTests(ChatterBotTestCase):
def test_get_response_text(self):
self.chatbot.get_response(text='Test')
def test_no_statements_known(self):
"""
If there is no statements in th... |
w4-sjcho/grpc | src/python/grpcio_test/grpc_test/beta/_beta_features_test.py | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
theo-l/django | docs/_ext/djangodocs.py | """
Sphinx plugins for Django documentation.
"""
import json
import os
import re
from docutils import nodes
from docutils.parsers.rst import Directive
from docutils.statemachine import ViewList
from sphinx import addnodes
from sphinx.builders.html import StandaloneHTMLBuilder
from sphinx.directives.code import CodeBlo... |
dstockwell/catapult | dashboard/run_tests.py | #!/usr/bin/python
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Runs the unit test suite for perf dashboard."""
import argparse
import dev_appserver
import logging
import os
import sys
import unittes... |
goddardl/gaffer | python/GafferImage/__init__.py | ##########################################################################
#
# Copyright (c) 2012, John Haddon. 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 so... |
watchdogpolska/poradnia.siecobywatelska.pl | poradnia/stats/factories.py | from datetime import datetime, timedelta
import factory
import factory.fuzzy
import pytz
class ItemFactory(factory.django.DjangoModelFactory):
key = factory.Sequence("item-key-{}".format)
name = factory.Sequence("item-name-{}".format)
description = factory.fuzzy.FuzzyText()
last_updated = factory.Seq... |
willhaines/scikit-rf | skrf/frequency.py |
'''
.. currentmodule:: skrf.frequency
========================================
frequency (:mod:`skrf.frequency`)
========================================
Provides a frequency object and related functions.
Most of the functionality is provided as methods and properties of the
:class:`Frequency` Class.
Frequency ... |
oddt/oddt | tests/test_utils.py | import os
import pytest
import oddt
from oddt.utils import check_molecule, chunker, compose_iter
test_data_dir = os.path.dirname(os.path.abspath(__file__))
# common file names
dude_data_dir = os.path.join(test_data_dir, 'data', 'dude', 'xiap')
xiap_crystal_ligand = os.path.join(dude_data_dir, 'crystal_ligand.sdf')
x... |
NSLS-II/filestore | filestore/api.py | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import logging
from contextlib import contextmanager
from .fs import FileStore
from .conf import connection_config
from .core import DatumNotFound
logger = logging.getLogger(__name__)
VERSION = 1
_... |
huzq/scikit-learn | sklearn/base.py | """Base classes for all estimators."""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# License: BSD 3 clause
import copy
import warnings
from collections import defaultdict
import platform
import inspect
import re
import numpy as np
from . import __version__
from ._config import get_config
from .utils im... |
KennethPierce/pylearnk | pylearn2/sandbox/cuda_convnet/tests/test_pool.py | import copy
import numpy
import theano
from theano.tensor import grad
from theano.tests import unittest_tools
import theano.sandbox.cuda as tcn
if not tcn.cuda_available:
from nose.plugins.skip import SkipTest
raise SkipTest('Optional package cuda disabled.')
from pylearn2.sandbox.cuda_convnet.pool import Ma... |
zingale/pyro2 | compressible/problems/rt.py | from __future__ import print_function
import numpy as np
import sys
import mesh.patch as patch
from util import msg
def init_data(my_data, rp):
""" initialize the rt problem """
msg.bold("initializing the rt problem...")
# make sure that we are passed a valid patch object
if not isinstance(my_data... |
tjlee/factory | test_Factory.py | import operator
from nose.tools import *
import Factory
def test_alias():
assert Factory.Factory is Factory.bind
def test_callable_object():
class CallMe(object):
def __init__(self, x):
self.x = x
def __call__(self, y):
return self.x + y
fac = Factory.Factory(CallMe... |
MJuddBooth/pandas | pandas/core/indexes/datetimelike.py | # -*- coding: utf-8 -*-
"""
Base and utility classes for tseries type pandas objects.
"""
import operator
import warnings
import numpy as np
from pandas._libs import NaT, iNaT, lib
from pandas.compat.numpy import function as nv
from pandas.errors import AbstractMethodError
from pandas.util._decorators import Appender... |
eXma/meet-and-eat-registration-system | src/simple_data_export.py | #!/usr/bin/env python
import argparse
import json
from collections import defaultdict
from math import floor
import cfg
import database as db
from cfg import config
from database.model import Team
from geotools import simple_distance
from geotools.routing import MapPoint
arguments = argparse.ArgumentParser()
argume... |
liyongsea/DIGITS | digits/model/images/classification/views.py | # Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
import os
import re
import tempfile
import random
import flask
import werkzeug.exceptions
import numpy as np
from google.protobuf import text_format
try:
import caffe_pb2
except ImportError:
# See issue #32
from caffe.proto import caffe_... |
mvaled/sentry | src/sentry/api/serializers/rest_framework/widget.py | from __future__ import absolute_import
from django.db.models import Max
from rest_framework import serializers
from sentry.discover.endpoints.serializers import DiscoverSavedQuerySerializer
from sentry.api.serializers.rest_framework import JSONField, ListField, ValidationError
from sentry.models import Widget, Widget... |
VisTrails/VisTrails | vistrails/core/vistrail/job.py | ###############################################################################
##
## Copyright (C) 2014-2016, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## ... |
joshzarrabi/e-mission-server | emission/net/push_notify/ios_parse.py | import json,httplib
connection = httplib.HTTPSConnection('api.parse.com', 443)
connection.connect()
connection.request('POST', '/1/push',
json.dumps({
"where": {
"deviceType": "ios"
},
"data": {
# "alert": "The Mets scored! The game is now tied 1-1.",
"content-availab... |
X-DataInitiative/tick | tick/array/tests/serialize_test.py | # License: BSD 3 clause
import os
import unittest
import uuid
import gc
from scipy import sparse
import numpy as np
from tick.array.serialize import serialize_array, load_array
class Test(object):
def __init__(self, *args, dtype="float64", **kwargs):
unittest.TestCase.__init__(self, *args, **kwargs)
... |
scheib/chromium | tools/perf/benchmarks/desktop_ui.py | # Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from core import perf_benchmark
from core import platforms
from telemetry import benchmark
from telemetry import story
from telemetry.timeline import chrome... |
marina-lab/docker-trac | plugins/accountmanagerplugin/build/lib/acct_mgr/http.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2005 Matthew Good <trac@matt-good.net>
# Copyright (C) 2011 Dennis McRitchie
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# Author: Matthew Good <trac@matt-good.net>
from... |
sandeepkoduri/GAE-html-to-pdf | libs/reportlab/graphics/renderPM.py | #Copyright ReportLab Europe Ltd. 2000-2017
#see license.txt for license details
#history www.reportlab.co.uk/rl-cgi/viewcvs.cgi/rlextra/graphics/Csrc/renderPM/renderP.py
__version__='3.3.0'
__doc__="""Render drawing objects in common bitmap formats
Usage::
from reportlab.graphics import renderPM
renderPM.draw... |
brumleygap/bwx-adventure | graphviz_writer.py | from collections import defaultdict
from advent import NORTH, SOUTH, EAST, WEST, \
NORTHWEST, NORTHEAST, SOUTHWEST, SOUTHEAST, \
direction_names
"""
This module defines write_as_dot, which writes a file in the .dot
format. The open source GraphViz command-line tools (or online
in... |
ChangsoonKim/STM32F7DiscTutor | toolchain/osx/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/share/gdb/python/gdb/printer/bound_registers.py | # Pretty-printers for bounds registers.
# Copyright (C) 2013-2017 Free Software Foundation, Inc.
# 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 o... |
voxmedia/aws | vows/result_storage_vows.py | #se!/usr/bin/python
# -*- coding: utf-8 -*-
from pyvows import Vows, expect
from thumbor.context import Context
from tc_aws import Config
from fixtures.storage_fixture import IMAGE_BYTES, get_server
from boto.s3.connection import S3Connection
from moto import mock_s3
from tc_aws.result_storages.s3_storage import St... |
dtcooper/python-fitparse | docs/conf.py | # -*- coding: utf-8 -*-
#
# python-fitparse documentation build configuration file, created by
# sphinx-quickstart on Wed Dec 19 15:26:06 2012.
#
# 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.... |
mpasternak/dojango-datable | datable/testutil.py | """
Test utility class for datable-enabled web pages.
"""
import csv
import json
import xlrd
from django.core.urlresolvers import reverse
class TestPageWithDatableMixin:
tableName = None # setup this
urlName = None # setup this
indexCode = 200
params = [] # list of dicts() with kw for jsonTest,... |
bit-oasis/multisig-core | multisigcore/providers/insight.py | import json
from urllib2 import urlopen
from pycoin.convention import btc_to_satoshi
from pycoin.serialize import h2b, h2b_rev
from pycoin.services.insight import InsightService
from pycoin.tx import Spendable
from . import BatchService
__author__ = 'devrandom'
CHUNK_SIZE = 100
class InsightBatchService(InsightServ... |
gmatteo/pymatgen | pymatgen/core/trajectory.py | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module provides classes used to define a MD trajectory.
"""
import itertools
import os
import warnings
from fnmatch import fnmatch
from typing import List, Sequence, Union
import numpy as np
from mon... |
bryback/quickseq | genescript/Bio/PDB/DSSP.py | # Copyright (C) 2002, Thomas Hamelryck (thamelry@binf.ku.dk)
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Use the DSSP program to calculate secondary structure and accessibility.
You need to h... |
JeremyRubin/tinycoin | tests.py | from base import *
from node import *
from transaction import *
import unittest
sk = SigningKey.generate() # uses NIST192p
vk = sk.get_verifying_key()
#print VerifyingKey.from_string(vk.to_string())
#signature = sk.sign("message")
#print vk.verify(signature, "message")
#
#tx = TX(vk.to_string(), "", 10).sign(sk)
#tx.v... |
githubutilities/LeetCode | Python/construct-binary-tree-from-inorder-and-postorder-traversal.py | # Time: O(n)
# Space: O(n)
#
# Given inorder and postorder traversal of a tree, construct the binary tree.
#
# Note:
# You may assume that duplicates do not exist in the tree.
#
# Definition for a binary tree node
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.... |
bryback/quickseq | genescript/Bio/Align/Applications/_Probcons.py | # Copyright 2009 by Cymon J. Cox. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Command line wrapper for the multiple alignment program PROBCONS.
"""
__docformat__ = "epyte... |
pferreir/indico | indico/modules/networks/models/networks.py | # This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from ipaddress import ip_address
from flask import has_request_context, request, session
from sqlalchemy.... |
gelab/mainr | unittests.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
# MySQL Connector/Python is licensed under the terms of the GPLv2
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
... |
jijianwen/Learn | Python/project_based_intro_to_prog/chapter_20/learning_logs/migrations/0002_entry.py | # Generated by Django 2.1 on 2018-08-15 09:09
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('learning_logs', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Entry',
... |
gfrd/egfrd | test/freeFunctions_test.py | #!/usr/bin/env python
__author__ = 'Koichi Takahashi <shafi@e-cell.org>'
__license__ = 'GPL'
__copyright__ = 'Copyright The Molecular Sciences Institute 2006-2007'
import unittest
import _greens_functions as mod
import math
import numpy
class FreeFunctionsTestCase(unittest.TestCase):
def setUp(self):
... |
kratman/psi4public | psi4/driver/p4util/p4regex.py | #
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2017 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of ... |
djtopper/RTcmix | docs/sample_scores/risset_bell.py | # Illustrates using a function to play one note consisting of
# multiple RTcmix notes. Direct translation of risset_bell.sco.
from rtcmix import *
rtsetparams(44100, 2)
load("WAVETABLE")
# Set to 1 to write a sound file (if processor too slow for rt playback).
writeit = 0
if writeit:
set_option("play = off", "clo... |
dymkowsk/mantid | scripts/SANS/sans/algorithm_detail/scale_helpers.py | from __future__ import (absolute_import, division, print_function)
import math
from abc import (ABCMeta, abstractmethod)
from six import (with_metaclass)
from sans.common.enums import (SANSInstrument, SANSFacility, SampleShape)
from sans.common.general_functions import create_unmanaged_algorithm
from sans.common.consta... |
waldyrious/GraphUI | graphui/EdgeWidget.py | # Copyright (c) 2007 Enough Project.
# See LICENSE for details.
import math
import pygame
from gui import draw
from guilib import MovingLine, paint_arrowhead_by_direction, rotate_surface, repaint_arrowhead, get_default
from lib.Point import Point, from_polar, point_near_polyline
from gui.Widget import Widget
from gui... |
nlholdem/icodoom | tmp/testImgProc.py | #!/usr/bin/python3
import deep_feedback_learning
import numpy as np
import matplotlib.pyplot as plt
import cv2
import sys
import itertools
from PIL import Image
def buildFilters():
ksize = 35
sigma = 5.
gamma = 1.
theta_vals = np.linspace(0., np.pi, 4, endpoint=False)
# lambd_vals = (3,7)
# sigm... |
kevinpetersavage/BOUT-dev | examples/MMS/elm-pb/makegrids.py | #!/usr/bin/env python
#
# Creates the grid files and input options for
# a set of simulations. These can then be submitted
# to a batch queue and then processed with runtest
# (setting "running = False")
#
from __future__ import print_function
from __future__ import division
nxlist = [4, 8, 16, 32, 64, 128]
from bou... |
Kedrigern/example-projects | python/flask/flaskr/setup.py | import io
from setuptools import find_packages, setup
with io.open("README.rst", "rt", encoding="utf8") as f:
readme = f.read()
setup(
name="flaskr",
version="1.0.0",
url="http://flask.pocoo.org/docs/tutorial/",
license="BSD",
maintainer="Pallets team",
maintainer_email="contact@palletspr... |
citibeth/twoway | pism/std-greenland/hydro/hydro-tsshow.py | #!/usr/bin/env python
"""
Creates graph of three modeled hydrology-related time series from a single file.
"""
# example from grid-sequencing example:
# $ ./hydro-tsshow.py foo.png ts_routing-decoupled.nc
from numpy import *
import pylab as plt
import sys
try:
import netCDF4 as netCDF
except:
print "netCDF... |
sergiusens/snapcraft | snapcraft/internal/sources/_checksum.py | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2017 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... |
krfkeith/enough | livec/codegui/widget_for.py | # Copyright (c) 2007 Enough Project.
# See LICENSE for details.
import nodes
from functools import partial
from codegui import style
from gui.Box import HBox
from gui.TextEdit import TextEdit, make_label
from gui.ProxyWidget import ProxyWidget
from lib.observable.List import List
from lib.observable.FuncCall import F... |
mupi/tecsaladeaula | forum/migrations/0003_auto__add_field_question_hidden.py | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Question.hidden'
db.add_column(u'forum_question', 'hidden... |
osgcc/ryzom | nel/tools/build_gamedata/processes/copy/1_export.py | #!/usr/bin/python
#
# \file 1_export.py
# \brief Export copy
# \date 2010-05-24 13:42GMT
# \author Jan Boon (Kaetemi)
# Python port of game data build pipeline.
# Export copy
#
# NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
# Copyright (C) 2010 Winch Gate Property Limited
#
# This program is free soft... |
procangroup/edx-platform | lms/djangoapps/mobile_api/users/tests.py | """
Tests for users API
"""
# pylint: disable=no-member
import datetime
import ddt
import pytz
from django.conf import settings
from django.template import defaultfilters
from django.test import RequestFactory, override_settings
from django.utils import timezone
from milestones.tests.utils import MilestonesTestCaseMix... |
Openworx/connector-woocommerce | woocommerceerpconnect/model/backend.py | # -*- coding: utf-8 -*-
#
#
# Tech-Receptives Solutions Pvt. Ltd.
# Copyright (C) 2009-TODAY Tech-Receptives(<http://www.techreceptives.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free ... |
LLNL/spack | var/spack/repos/builtin/packages/r-crosstalk/package.py | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RCrosstalk(RPackage):
"""Inter-Widget Interactivity for HTML Widgets
Provides buildin... |
LLNL/spack | lib/spack/spack/schema/env.py | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""Schema for env.yaml configuration file.
.. literalinclude:: _spack_root/lib/spack/spack/schema/env.py
:lines: 36-
"... |
jbuchbinder/youtube-dl | youtube_dl/extractor/vodlocker.py | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
NO_DEFAULT,
sanitized_Request,
urlencode_postdata,
)
class VodlockerIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?vodlocker\.(?:com|city)/(?:embed-)?(?P<id>[0-9a-... |
ykaneko/quantum | quantum/db/agents_db.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2013 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.... |
jmakov/ggrc-core | test/integration/ggrc/api_helper.py | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: miha@reciprocitylabs.com
# Maintained By: miha@reciprocitylabs.com
from ggrc import db
from ggrc.app import app
from ggrc.services.common import Re... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.