repo_name stringlengths 5 104 | path stringlengths 4 248 | content stringlengths 102 99.9k |
|---|---|---|
UManPychron/pychron | pychron/hardware/mdrive/__init__.py | # ===============================================================================
# Copyright 2016 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/licenses... |
ppwwyyxx/tensorflow | tensorflow/python/saved_model/load.py | # 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... |
sparkslabs/kamaelia | Code/Python/Apps/Europython09/App/BB1.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Ver... |
sonntagsgesicht/regtest | .aux/venv/lib/python3.9/site-packages/pygments/styles/abap.py | """
pygments.styles.abap
~~~~~~~~~~~~~~~~~~~~
ABAP workbench like style.
:copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, ... |
tebeka/arrow | python/pyarrow/cuda.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... |
Kami/libcloud | docs/examples/container/kubernetes/instantiate_driver_minikube_cert_auth.py | from libcloud.container.types import Provider
from libcloud.container.providers import get_driver
import libcloud.security
# Disable cert vertification when running minikube locally using self signed
# cert
libcloud.security.VERIFY_SSL_CERT = False
cls = get_driver(Provider.KUBERNETES)
# You can retrieve cluster ip... |
ncclient/ncclient | test/unit/devices/test_alu.py | import unittest
from ncclient.devices.alu import *
from ncclient.xml_ import *
import re
xml = """<rpc-reply xmlns:junos="http://xml.alu.net/alu/12.1x46/alu">
<routing-engin>
<name>reX</name>
<commit-success/>
<!-- This is a comment -->
</routing-engin>
<ok/>
</rpc-reply>"""
class TestAluDevice(unittest.TestCase):
... |
gaocegege/treadmill | treadmill/cli/admin/discovery.py | """Trace treadmill application events.
"""
import logging
import socket
import sys
import click
from treadmill import context
from treadmill import discovery
from treadmill import cli
_LOGGER = logging.getLogger()
def _iterate(discovery_iter, check_state, sep):
"""Iterate and output discovered endpoints."""... |
ostree/plaso | plaso/parsers/mcafeeav.py | # -*- coding: utf-8 -*-
"""Parser for McAfee Anti-Virus Logs.
McAfee AV uses 4 logs to track when scans were run, when virus databases were
updated, and when files match the virus database."""
from plaso.events import text_events
from plaso.lib import errors
from plaso.lib import timelib
from plaso.parsers import man... |
amanharitsh123/zulip | zerver/migrations/0069_realmauditlog_extra_data.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-27 20:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('zerver', '0068_remove_realm_domain'),
]
operations = [
migrations.AddField(
model_name='realmauditlog',... |
Danielhiversen/home-assistant | homeassistant/components/snmp/sensor.py | """Support for displaying collected data over SNMP."""
from datetime import timedelta
import logging
import pysnmp.hlapi.asyncio as hlapi
from pysnmp.hlapi.asyncio import (
CommunityData,
ContextData,
ObjectIdentity,
ObjectType,
SnmpEngine,
UdpTransportTarget,
UsmUserData,
getCmd,
)
imp... |
StackStorm/st2 | st2common/st2common/policies/concurrency.py | # Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... |
pombredanne/PyMISP | examples/create_events.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from pymisp import PyMISP
from keys import misp_url, misp_key
import argparse
# For python2 & 3 compat, a bit dirty, but it seems to be the least bad one
try:
input = raw_input
except NameError:
pass
def init(url, key):
return PyMISP(url, key, True, 'json', ... |
drwells/pyFFTW | test/test_pyfftw_wisdom.py | # Copyright 2014 Knowledge Economy Developments Ltd
#
# Henry Gomersall
# heng@kedevelopments.co.uk
#
# 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 ret... |
vicky2135/lucious | src/oscar/apps/dashboard/orders/views.py | import datetime
from collections import OrderedDict
from decimal import Decimal as D
from decimal import InvalidOperation
from django.conf import settings
from django.contrib import messages
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
from django.db.models import ... |
DoubleNegativeVisualEffects/gaffer | python/GafferUI/OpDialogue.py | ##########################################################################
#
# Copyright (c) 2011-2012, Image Engine Design Inc. All rights reserved.
# Copyright (c) 2011-2012, John Haddon. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted ... |
azurestandard/django | django/contrib/sessions/tests.py | from datetime import datetime, timedelta
import shutil
import string
import tempfile
import warnings
from django.conf import settings
from django.contrib.sessions.backends.db import SessionStore as DatabaseSession
from django.contrib.sessions.backends.cache import SessionStore as CacheSession
from django.contrib.sessi... |
catapult-project/catapult | third_party/gsutil/gslib/tests/test_parallelism_framework.py | # -*- coding: utf-8 -*-
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to u... |
TouK/vumi | vumi/transports/smpp/smpp_transport.py | # -*- test-case-name: vumi.transports.smpp.tests.test_smpp_transport -*-
import warnings
from uuid import uuid4
from twisted.internet import reactor
from twisted.internet.defer import (
inlineCallbacks, maybeDeferred, returnValue, Deferred, succeed)
from twisted.internet.task import LoopingCall
from vumi.reconne... |
Goldmund-Wyldebeast-Wunderliebe/raven-python | raven/contrib/django/middleware/__init__.py | """
raven.contrib.django.middleware
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import threading
import logging
from django.conf import settings
def is_ig... |
2947721120/django-material | tests/test_base_layout.py | from django import forms
from django.test.utils import override_settings
from django_webtest import WebTest
from material import Layout, Row, Column
from . import build_test_urls
class LayoutForm(forms.Form):
test_field1 = forms.CharField()
test_field2 = forms.CharField()
test_field3 = forms.CharField()
... |
pkdevbox/trac | trac/dist.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#
# This software consists o... |
haakenlid/django-extensions | django_extensions/management/commands/generate_secret_key.py | # -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand
from django_extensions.management.utils import signalcommand
try:
from django.core.management.utils import get_random_secret_key
except ImportError:
from django.utils.crypto import get_random_string
def get_random_secret_key():
... |
MADindustries/WhatManager2 | books/utils.py | from subprocess import call
isbn_regex = '^(97(8|9)-?)?\d{9}(\d|X)$'
def fix_author(author):
parts = author.split(u', ')
if len(parts) == 2:
return parts[1] + u' ' + parts[0]
return author
def call_mktorrent(target, torrent_filename, announce, torrent_name=None):
args = [
'mktorren... |
denim2x/Vintageous | ex/parser/nodes.py | from Vintageous.ex.ex_error import ERR_NO_RANGE_ALLOWED
from Vintageous.ex.ex_error import VimError
from Vintageous.ex.parser.tokens import TokenDigits
from Vintageous.ex.parser.tokens import TokenDollar
from Vintageous.ex.parser.tokens import TokenDot
from Vintageous.ex.parser.tokens import TokenMark
from Vintageous.e... |
aspose-words/Aspose.Words-for-Java | Plugins/Aspose_Words_Java_for_Jython/asposewords/quickstart/HelloWorld.py | from asposewords import Settings
from com.aspose.words import Document
from com.aspose.words import DocumentBuilder
class HelloWorld:
def __init__(self):
dataDir = Settings.dataDir + 'quickstart/'
doc = Document()
builder = DocumentBuilder(doc)
builder.writeln('He... |
mandeepdhami/netvirt-ctrl | sdncon/clusterAdmin/tests/urls.py | #
# Copyright (c) 2013 Big Switch Networks, Inc.
#
# Licensed under the Eclipse Public License, Version 1.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.eclipse.org/legal/epl-v10.html
#
# Unless required by applicable l... |
rleigh-dundee/openmicroscopy | components/tools/OmeroPy/src/omero/install/logs_library.py | #!/usr/bin/env python
"""
Function for parsing OMERO log files.
The format expected is defined for Python in
omero.util.configure_logging.
Copyright 2010 Glencoe Software, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
:author: Josh Moore <josh@glencoesoftware.co... |
slashdd/sos | sos/report/plugins/mpt.py | # Copyright (C) 2015 Red Hat, Inc., Bryn M. Reeves <bmr@redhat.com>
# This file is part of the sos project: https://github.com/sosreport/sos
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# version 2 of the GNU General... |
lnielsen/invenio | invenio/legacy/weblinkback/webinterface.py | # -*- coding: utf-8 -*-
## Comments and reviews for records.
## This file is part of Invenio.
## Copyright (C) 2011 CERN.
##
## Invenio 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 2 of th... |
dmacvicar/spacewalk | client/solaris/smartpm/smart/channels/solaris_sys.py | #
# Copyright (c) 2005 Red Hat, Inc.
#
# Written by Joel Martin <jmartin@redhat.com>
#
# This file is part of Smart Package Manager.
#
# Smart Package Manager 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; ei... |
kidmaple/CoolWall | user/python/Tools/idle/keydefs.py | windows_keydefs = \
{'<<Copy>>': ['<Control-c>'],
'<<Cut>>': ['<Control-x>'],
'<<Paste>>': ['<Control-v>'],
'<<beginning-of-line>>': ['<Control-a>', '<Home>'],
'<<center-insert>>': ['<Control-l>'],
'<<close-all-windows>>': ['<Control-q>'],
'<<close-window>>': ['<Alt-F4>'],
'<<dump-undo-state>>': ['<Control-backs... |
vlvkobal/netdata | collectors/python.d.plugin/python_modules/urllib3/packages/ssl_match_hostname/__init__.py | # SPDX-License-Identifier: MIT
import sys
try:
# Our match_hostname function is the same as 3.5's, so we only want to
# import the match_hostname function if it's at least that good.
if sys.version_info < (3, 5):
raise ImportError("Fallback to vendored code")
from ssl import CertificateError, ... |
booi/aracna | pypose-old/aracna-python/driver.py | #!/usr/bin/env python
"""
PyPose: Serial driver for connection to arbotiX board or USBDynamixel.
Copyright (c) 2008,2009 Michael E. Ferguson. All right reserved.
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 Fr... |
drogenlied/qudi | qtwidgets/plotwidget_modified.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This file contains the modified PlotWidget for Qudi.
Qudi 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) an... |
Microvellum/Fluid-Designer | win64-vc/2.78/python/lib/asyncio/selector_events.py | """Event loop using a selector and related classes.
A selector is a "notify-when-ready" multiplexer. For a subclass which
also includes support for signal handling, see the unix_events sub-module.
"""
__all__ = ['BaseSelectorEventLoop']
import collections
import errno
import functools
import socket
import warnings
... |
ldjebran/robottelo | robottelo/decorators/host.py | """Implements decorator regarding satellite host"""
import logging
from functools import wraps
import unittest2
from robottelo.config import settings
from robottelo.host_info import get_host_os_version
LOGGER = logging.getLogger(__name__)
def skip_if_os(*versions):
"""Decorator to skip tests based on host vers... |
batxes/4Cin | SHH_WT_models/SHH_WT_models_final_output_0.1_-0.1_11000/mtx1_models/SHH_WT_models11760.py | import _surface
import chimera
try:
import chimera.runCommand
except:
pass
from VolumePath import markerset as ms
try:
from VolumePath import Marker_Set, Link
new_marker_set=Marker_Set
except:
from VolumePath import volume_path_dialog
d= volume_path_dialog(True)
new_marker_set= d.new_marker_set
marker_set... |
cpennington/edx-platform | common/test/acceptance/pages/lms/login.py | """
Login page for the LMS.
"""
from bok_choy.page_object import PageObject
from bok_choy.promise import EmptyPromise
from common.test.acceptance.pages.lms import BASE_URL
from common.test.acceptance.pages.lms.dashboard import DashboardPage
class LoginPage(PageObject):
"""
Login page for the LMS.
"""
... |
mupi/tecsaladeaula | core/tests/test_views.py | # -*- coding: utf-8 -*-
import pytest
from model_mommy import mommy
from conftest import create_user
from core.models import Class, Course
@pytest.mark.django_db
def test_lesson(admin_client):
lesson = mommy.make('Lesson', slug='lesson', status='published')
response = admin_client.get('/course/' + lesson.cou... |
mhellmic/davix | test/pywebdav/lib/AuthServer.py | """Authenticating HTTP Server
This module builds on BaseHTTPServer and implements basic authentication
"""
import base64
import binascii
import BaseHTTPServer
DEFAULT_AUTH_ERROR_MESSAGE = """
<head>
<title>%(code)s - %(message)s</title>
</head>
<body>
<h1>Authorization Required</h1>
this server could not verify th... |
algorhythms/LintCode | Segment Tree Query II.py | """
For an array, we can build a SegmentTree for it, each node stores an extra attribute count to denote the number of
elements in the the array which value is between interval start and end. (The array may not fully filled by elements)
Design a query method with three parameters root, start and end, find the number o... |
Senseg/robotframework | src/robot/model/itemlist.py | # Copyright 2008-2012 Nokia Siemens Networks Oyj
#
# 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... |
raphaelamorim/fbthrift | thrift/compiler/test/fixtures/namespace/gen-py/my/namespacing/test/ttypes.py | #
# Autogenerated by Thrift
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
# @generated
#
from __future__ import absolute_import
import six
from thrift.util.Recursive import fix_spec
from thrift.Thrift import *
from thrift.protocol.TProtocol import TProtocolException
import pprint
import warn... |
riga/luigi | luigi/contrib/dropbox.py | # -*- coding: utf-8 -*-
#
# Copyright (c) 2019 Jose-Ignacio Riaño Chico
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... |
luotao1/Paddle | python/paddle/fluid/contrib/layers/metric_op.py | # Copyright (c) 2019 PaddlePaddle 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... |
reyoung/Paddle | python/paddle/fluid/tests/test_if_else_op.py | # Copyright (c) 2018 PaddlePaddle 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 app... |
sniemi/SamPy | sandbox/src1/examples/ftface_props.py | #!/usr/bin/env python
"""
This is a demo script to show you how to use all the properties of an
FT2Font object. These describe global font properties. For
individual character metrices, use the Glyp object, as returned by
load_char
"""
import matplotlib
from matplotlib.ft2font import FT2Font
#fname = '/usr/local/sha... |
FCP-INDI/nipype | nipype/workflows/smri/freesurfer/ba_maps.py | import os
import nipype
from nipype.interfaces.utility import Function,IdentityInterface
import nipype.pipeline.engine as pe # pypeline engine
from nipype.interfaces.freesurfer import *
from nipype.interfaces.io import DataGrabber
from nipype.interfaces.utility import Merge
def create_ba_maps_wf(name="Brodmann_Area_M... |
wooey/Wooey | tests/test_project.py | __author__ = 'chris'
from unittest import TestCase
import subprocess
import os
import shutil
import sys
BASE_DIR = os.path.split(__file__)[0]
WOOEY_SCRIPT_PATH = os.path.join(BASE_DIR, '..', 'scripts', 'wooify')
WOOEY_TEST_PROJECT_NAME = 'wooey_project'
WOOEY_TEST_PROJECT_PATH = os.path.join(BASE_DIR, WOOEY_TEST_PROJE... |
sungyism/sungyism | gmond/python_modules/memcached/memcached.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import traceback
import os
import threading
import time
import socket
import select
descriptors = list()
Desc_Skel = {}
_Worker_Thread = None
_Lock = threading.Lock() # synchronization lock
Debug = False
def dprint(f, *v):
if Debug:
print >>sys.s... |
andymckay/addons-server | src/olympia/users/management/commands/activate_user.py | from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from olympia.access.models import Group, GroupUser
from olympia.users.models import UserProfile
class Command(BaseCommand):
"""Activate a registered user, and optionally set it as admin."""
args = 'email'
... |
ellisonbg/nbgrader | nbgrader/tests/preprocessors/test_saveautogrades.py | import pytest
from nbformat.v4 import new_notebook, new_output
from ...preprocessors import SaveCells, SaveAutoGrades
from ...api import Gradebook
from ...utils import compute_checksum
from .base import BaseTestPreprocessor
from .. import (
create_grade_cell, create_grade_and_solution_cell, create_solution_cell)
... |
utkbansal/tardis | tardis/plasma/tests/test_property_atomic.py | import numpy as np
def test_levels_property(excitation_energy):
assert np.isclose(excitation_energy.ix[2].ix[0].ix[1], 3.17545416e-11)
def test_lines_property(lines):
assert np.isclose(lines.ix[564954]['wavelength'], 10833.307)
assert lines.index[124] == 564954
def test_lines_lower_level_index_property(l... |
bp-kelley/rdkit | rdkit/Chem/MolDb/FingerprintUtils.py | # $Id$
#
# Copyright (C) 2009 Greg Landrum
# All Rights Reserved
#
import pickle
from rdkit import Chem, DataStructs
similarityMethods = {
'RDK': DataStructs.ExplicitBitVect,
'AtomPairs': DataStructs.IntSparseIntVect,
'TopologicalTorsions': DataStructs.LongSparseIntVect,
'Pharm2D': DataStructs.SparseBitVect... |
dezelin/vbox-haiku | src/VBox/GuestHost/OpenGL/packer/packer.py | # Copyright (c) 2001, Stanford University
# All rights reserved.
#
# See the file LICENSE.txt for information on redistributing this software.
# This script generates the packer.c file from the gl_header.parsed file.
import sys, string, re
import apiutil
def WriteData( offset, arg_type, arg_name, is_swapped ):
... |
Valloric/ycmd | ycmd/responses.py | # Copyright (C) 2013-2020 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd 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.
#
#... |
alvaroaleman/ansible | lib/ansible/executor/module_common.py | # (c) 2013-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2015 Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible 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... |
gregdek/ansible | lib/ansible/modules/source_control/gitlab_group.py | #!/usr/bin/python
# Copyright: (c) 2015, Werner Dijkerman (ikben@werner-dijkerman.nl)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
DreamSourceLab/DSView | libsigrokdecode4DSL/decoders/ir_nec/lists.py | ##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2014 Uwe Hermann <uwe@hermann-uwe.de>
##
## 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 2 of the Li... |
josyb/myhdl | example/uart_tx/uart_tx.py | from myhdl import always, always_seq, block, delay, enum, instance, intbv, ResetSignal, Signal, StopSimulation
@block
def uart_tx(tx_bit, tx_valid, tx_byte, tx_clk, tx_rst):
index = Signal(intbv(0, min=0, max=8))
st = enum('IDLE', 'START', 'DATA')
state = Signal(st.IDLE)
@always(tx_clk.posedg... |
shinpeimuraoka/ryu | ryu/lib/netdevice.py | # 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
#
# Unless required by appli... |
jordanemedlock/psychtruths | temboo/core/Library/Genability/TariffData/GetTariff.py | # -*- coding: utf-8 -*-
###############################################################################
#
# GetTariff
# Returns an individual Tariff object with a given id.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may no... |
Metaswitch/calico-nova | nova/tests/unit/api/openstack/compute/contrib/test_flavor_manage.py | # Copyright 2011 Andrew Bogott for the Wikimedia Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... |
zstackorg/zstack-utility | zstacklib/zstacklib/test/test_xmlobject.py | '''
@author: Frank
'''
import unittest
from zstacklib.utils import jsonobject
from zstacklib.utils import xmlobject
import os.path
import xml.dom.minidom as dom
import re
class Test(unittest.TestCase):
def testName(self):
cfg = os.path.abspath('zstacklib/test/TestCreateVm.xml')
with open(cfg, 'r... |
citrix-openstack/build-ryu | ryu/tests/unit/ofproto/test_ofproto.py | # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013 Isaku Yamahata <yamahata at private email ne jp>
#
# 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
#
# h... |
Osmose/kitsune | kitsune/search/api.py | from django.conf import settings
from rest_framework import serializers
from rest_framework.decorators import api_view
from rest_framework.response import Response
from kitsune.products.models import Product
from kitsune.questions.models import Question, QuestionMappingType
from kitsune.questions.api import QuestionS... |
vipins/ccccms | env/Lib/site-packages/cms/models/__init__.py | # -*- coding: utf-8 -*-
from django.conf import settings as d_settings
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import get_resolver, get_script_prefix, \
NoReverseMatch
from django.utils.encoding import iri_to_uri
from moderatormodels import *
from pagemodel import *
fro... |
adykstra/mne-python | tutorials/stats-sensor-space/plot_stats_cluster_time_frequency.py | """
=========================================================================
Non-parametric between conditions cluster statistic on single trial power
=========================================================================
This script shows how to compare clusters in time-frequency
power estimates between condition... |
oscaro/django | tests/middleware/tests.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import gzip
from io import BytesIO
import random
import re
from unittest import skipIf
import warnings
from django.conf import settings
from django.core import mail
from django.db import (transaction, connections, DEFAULT_DB_ALIAS,
... |
zeptonaut/catapult | dashboard/dashboard/post_data_handler.py | # 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.
"""A helper request handler for request handlers that receive data."""
import logging
from dashboard import request_handler
from dashboard import utils
c... |
jaeilepp/mne-python | mne/tests/test_fixes.py | # Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Alex Gramfort <alexandre.gramfort@telecom-paristech.fr>
# License: BSD
import numpy as np
from numpy.testing import assert_allclose
from scipy.signal import filtfilt
from scipy.spe... |
gasman/wagtaildemo | wagtaildemo/settings/base.py | # Django settings for wagtaildemo project.
import os
PROJECT_ROOT = os.path.join(os.path.dirname(__file__), '..', '..')
BASE_DIR = PROJECT_ROOT
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
# Default to dummy email backend. Configure dev/production/local backend
# ... |
Beauhurst/django | django/db/backends/sqlite3/base.py | """
SQLite3 backend for the sqlite3 module in the standard library.
"""
import decimal
import re
import warnings
from sqlite3 import dbapi2 as Database
import pytz
from django.core.exceptions import ImproperlyConfigured
from django.db import utils
from django.db.backends import utils as backend_utils
from django.db.b... |
Sorsly/subtle | google-cloud-sdk/platform/ext-runtime/go/test/runtime_test.py | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
ksmit799/Toontown-Source | toontown/parties/activityFSMs.py | from direct.directnotify import DirectNotifyGlobal
from BaseActivityFSM import BaseActivityFSM
from activityFSMMixins import IdleMixin
from activityFSMMixins import RulesMixin
from activityFSMMixins import ActiveMixin
from activityFSMMixins import DisabledMixin
from activityFSMMixins import ConclusionMixin
from activit... |
thiagof/treeio | treeio/identities/integration.py | # encoding: utf-8
# Copyright 2011 Tree.io Limited
# This file is part of Treeio.
# License www.tree.io/license
"""
Identities Integration library
"""
from treeio.core.models import Object, ModuleSetting
from treeio.identities.models import Contact, ContactType, ContactValue
from nuconnector import Connector, DataBloc... |
csherwood-usgs/landlab | landlab/ca/examples/diffusion_in_gravity.py | #!/usr/env/python
"""
diffusion_in_gravity.py
Example of a continuous-time, stochastic, pair-based cellular automaton model,
which simulates diffusion by random particle motion in a gravitational field.
The purpose of the example is to demonstrate the use of an OrientedRasterLCA.
GT, September 2014
"""
from __future... |
cmouse/buildbot | worker/buildbot_worker/util/_hangcheck.py | """
Protocol wrapper that will detect hung connections.
In particular, since PB expects the server to talk first and HTTP
expects the client to talk first, when a PB client talks to an HTTP
server, neither side will talk, leading to a hung connection. This
wrapper will disconnect in that case, and inform the caller.
"... |
atmark-techno/atmark-dist | user/python/Lib/test/test_unicodedata.py | """ Test script for the unicodedata module.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""#"
import sha
encoding = 'utf-8'
def test_methods():
h = sha.sha()
for i in range(65536):
char = unichr(i)
data = [
... |
pandel/Marlin | buildroot/share/scripts/createTemperatureLookupMarlin.py | #!/usr/bin/python
"""Thermistor Value Lookup Table Generator
Generates lookup to temperature values for use in a microcontroller in C format based on:
http://en.wikipedia.org/wiki/Steinhart-Hart_equation
The main use is for Arduino programs that read data from the circuit board described here:
http://reprap.org/wiki/... |
rodrigolucianocosta/ControleEstoque | rOne/Storage101/django-localflavor/django-localflavor-1.3/docs/conf.py | # -*- coding: utf-8 -*-
#
# django-localflavor documentation build configuration file, created by
# sphinx-quickstart on Sun Jun 2 17:56:28 2013.
#
# 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 fi... |
jeremiahyan/odoo | addons/account_test/__manifest__.py | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright (c) 2011 CCI Connect asbl (http://www.cciconnect.be) All Rights Reserved.
# Philmer <philmer@cciconnect.be>
{
'name': 'Accounting Consistency Tests',
'version': '1.0',
'cate... |
adfernandes/pcp | qa/statsd/src/cases/01.py | #!/usr/bin/env pmpython
# -*- coding: utf-8 -*-
# Exercises installation and removal of pmdastatsd
import sys
import glob
import os
utils_path = os.path.abspath(os.path.join("utils"))
sys.path.append(utils_path)
import pmdastatsd_test_utils as utils
utils.print_test_file_separator()
print(os.path.basename(__file_... |
sajuptpm/neutron-ipam | neutron/db/migration/alembic_migrations/versions/c88b6b5fea3_cisco_n1kv_tables.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 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... |
yngcan/patentprocessor | test/test_alchemy.py | import unittest
import os
import sys
import shutil
sys.path.append('../lib/')
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
import alchemy
from alchemy.schema import *
class TestAlchemy(unittest.TestCase):
def setUp(self):
# this basically resets our testing database
path = config.... |
dongguangming/requests-oauthlib | docs/conf.py | # -*- coding: utf-8 -*-
#
# Requests-OAuthlib documentation build configuration file, created by
# sphinx-quickstart on Fri May 10 11:49:01 2013.
#
# 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 fil... |
gdey/shadowsocks | tests/test.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2014 clowwindy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to u... |
dav94/plastex | plasTeX/Base/LaTeX/Document.py | #!/usr/bin/env python
"""
C.2 The Structure of the Document (p170)
"""
from plasTeX import Command, Environment
from Sectioning import SectionUtils
class document(Environment, SectionUtils):
level = Environment.DOCUMENT_LEVEL
@property
def title(self):
return self.ownerDocument.userdata.get('ti... |
noyeitan/cubes | cubes/common.py | # -*- encoding: utf-8 -*-
"""Utility functions for computing combinations of dimensions and hierarchy
levels"""
from __future__ import absolute_import
import itertools
import sys
import re
import os.path
import decimal
import datetime
import json
from collections import OrderedDict
from .errors import *
from . imp... |
kcarnold/autograd | autograd/numpy/complex_array_node.py | from __future__ import absolute_import
from autograd.core import Node, ComplexNode, primitive, cast, getval
from . import numpy_wrapper as anp
from .numpy_extra import ArrayNode, array_dtype_mappings, SparseArray
class ComplexArrayNode(ArrayNode):
@staticmethod
def zeros_like(value):
return anp.zeros(v... |
AlbertoPeon/invenio | modules/bibformat/lib/elements/bfe_references.py | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 CERN.
##
## Invenio 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 2 of the
## ... |
bcb/qutebrowser | tests/integration/features/test_tabs.py | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... |
mheap/ansible | lib/ansible/module_utils/network/f5/bigip.py | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import time
try:
from f5.bigip import ManagementRoot
from icontrol... |
filipenf/ansible | lib/ansible/cli/console.py | # (c) 2014, Nandor Sivok <dominis@haxor.hu>
# (c) 2016, Redhat Inc
#
# ansible-console 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.
... |
nagyistoce/edx-platform | lms/djangoapps/courseware/masquerade.py | '''
---------------------------------------- Masquerade ----------------------------------------
Allow course staff to see a student or staff view of courseware.
Which kind of view has been selected is stored in the session state.
'''
import logging
from django.conf import settings
from django.contrib.auth.decorators... |
stack-of-tasks/rbdlpy | tutorial/lib/python2.7/site-packages/OpenGL/GL/SGIX/sprite.py | '''OpenGL extension SGIX.sprite
This module customises the behaviour of the
OpenGL.raw.GL.SGIX.sprite to provide a more
Python-friendly API
Overview (from the spec)
This extension provides support for viewpoint dependent alignment
of geometry, in particular geometry that rotates about a point or
a ... |
stack-of-tasks/rbdlpy | tutorial/lib/python2.7/site-packages/OpenGL/raw/GL/VERSION/GL_4_1.py | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_... |
infinyte/oppia | core/controllers/reader.py | # 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 required by applicable ... |
lukecwik/incubator-beam | sdks/python/apache_beam/io/filesystems_test.py | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "L... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.