repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
hzlf/openbroadcast
website/apps/alibrary/migrations/0100_auto__del_field_distributor_email_main__add_field_distributor_email.py
1
53909
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'Distributor.email_main' db.delete_column('alibrary_distributor', 'email_main') # ...
gpl-3.0
allmende/synnefo
snf-cyclades-app/synnefo/logic/tests/callbacks.py
3
32469
# vim: set fileencoding=utf-8 : # Copyright (C) 2010-2014 GRNET S.A. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. #...
gpl-3.0
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.1/Lib/encodings/mac_centeuro.py
257
14102
""" Python Character Mapping Codec mac_centeuro generated from 'MAPPINGS/VENDORS/APPLE/CENTEURO.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,inp...
mit
botify-labs/moto
tests/test_swf/responses/test_workflow_types.py
12
5239
import sure import boto from moto import mock_swf_deprecated from boto.swf.exceptions import SWFResponseError # RegisterWorkflowType endpoint @mock_swf_deprecated def test_register_workflow_type(): conn = boto.connect_swf("the_key", "the_secret") conn.register_domain("test-domain", "60") conn.register_wo...
apache-2.0
cclauss/stash
bin/xargs.py
2
1537
""" Construct argument list(s) and execute utility """ import os import sys import argparse _stash = globals()['_stash'] def main(args): ap = argparse.ArgumentParser() ap.add_argument('-n', nargs='?', metavar='number', type=int, ...
mit
lmazuel/azure-sdk-for-python
azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/resource_certificate_and_aad_details.py
2
4137
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
indextbag/arsenalsuite
python/dist_Changes/__init__.py
10
21144
# This module exists to create the "best" dispatch object for a given # object. If "makepy" support for a given object is detected, it is # used, otherwise a dynamic dispatch object. # Note that if the unknown dispatch object then returns a known # dispatch object, the known class will be used. This contrasts # with...
gpl-2.0
eaas-framework/virtualbox
src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/Parser/InfSourceSectionParser.py
11
5471
## @file # This file contained the parser for [Sources] sections in INF file # # Copyright (c) 2011, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials are licensed and made available # under the terms and conditions of the BSD License which accompanies this # distribution. T...
gpl-2.0
dalegregory/odoo
addons/anonymization/anonymization.py
103
28698
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
proversity-org/edx-platform
cms/djangoapps/contentstore/tests/tests.py
3
15848
""" This test file will test registration, login, activation, and session activity timeouts """ from __future__ import print_function import datetime import time import mock import pytest from ddt import data, ddt, unpack from django.conf import settings from django.contrib.auth.models import User from django.core.cac...
agpl-3.0
cloudfoundry/php-buildpack-legacy
builds/runtimes/python-2.7.6/lib/python2.7/test/test_ast.py
45
24761
import sys, itertools, unittest from test import test_support import ast def to_tuple(t): if t is None or isinstance(t, (basestring, int, long, complex)): return t elif isinstance(t, list): return [to_tuple(e) for e in t] result = [t.__class__.__name__] if hasattr(t, 'lineno') and hasat...
mit
jodygarnett/qgis-geoserver-plugin
src/geoserverexplorer/gui/gsoperations.py
1
6538
from PyQt4 import QtCore from qgis.core import * from geoserverexplorer.qgis import layers as qgislayers from geoserverexplorer.qgis.catalog import CatalogWrapper from geoserverexplorer.gui.confirm import publishLayer from geoserverexplorer.gui.dialogs.projectdialog import PublishProjectDialog from geoserver.catalog im...
gpl-2.0
fgesora/odoo
addons/sale_crm/__openerp__.py
260
2036
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
sbrunner/QGIS
tests/src/python/test_qgsserver_wfst.py
3
12177
# -*- coding: utf-8 -*- """ Tests for WFS-T provider using QGIS Server through qgis_wrapped_server.py. This is an integration test for QGIS Desktop WFS-T provider and QGIS Server WFS-T that check if QGIS can talk to and uderstand itself. The test uses testdata/wfs_transactional/wfs_transactional.qgs and three initia...
gpl-2.0
mrquim/repository.mrquim
repo/plugin.video.live.streamspro/_ytplist.py
173
4161
import urllib import urllib2,json import xbmcvfs import requests,time import os,xbmc,xbmcaddon,xbmcgui,re addon = xbmcaddon.Addon('plugin.video.live.streamspro') profile = xbmc.translatePath(addon.getAddonInfo('profile').decode('utf-8')) cacheDir = os.path.join(profile, 'cachedir') clean_cache=os.path.join(cacheDir,'cl...
gpl-2.0
Hybrid-Cloud/Hybrid-Cloud-Patches-For-Tricircle
hybrid-cloud/cinder/volume/api.py
4
58671
# 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 ...
gpl-2.0
TeamCohen/TensorLog
tensorlog/debug.py
1
8193
# (C) William W. Cohen and Carnegie Mellon University, 2016 # # support for debugging/visualization # import sys import tkinter as TK import tkinter.ttk import tkinter.font import time from tensorlog import comline from tensorlog import config from tensorlog import dataset from tensorlog import declare from tensorlo...
apache-2.0
Blizzard/heroprotocol
heroprotocol/versions/protocol65751.py
10
26622
#!/usr/bin/env python # # Copyright 2015-2021 Blizzard Entertainment. Subject to the MIT license. # See the included LICENSE file for more information. # import six from heroprotocol.decoders import CorruptedError, BitPackedBuffer, BitPackedDecoder, VersionedDecoder # Decoding instructions for each protocol type. t...
mit
zymsys/sms-tools
lectures/07-Sinusoidal-plus-residual-model/plots-code/hprModelAnal-flute.py
21
2771
import numpy as np import matplotlib.pyplot as plt from scipy.signal import hamming, hanning, triang, blackmanharris, resample import math import sys, os, time sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) import stft as STFT import utilFunctions as UF import ...
agpl-3.0
metachris/RPIO
source/RPIO/PWM/__init__.py
5
7082
# -*- coding: utf-8 -*- # # This file is part of RPIO. # # Copyright # # Copyright (C) 2013 Chris Hager <chris@linuxuser.at> # # License # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the Free Softw...
lgpl-3.0
sajeeshcs/nested_quota_final
nova/tests/unit/virt/vmwareapi/test_read_write_util.py
6
1897
# Copyright 2013 IBM Corp. # Copyright 2011 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
marinho/geraldo
site/newsite/django_1_0/django/utils/tzinfo.py
9
2424
"Implementation of tzinfo classes for use with datetime.datetime." import locale import time from datetime import timedelta, tzinfo from django.utils.encoding import smart_unicode try: DEFAULT_ENCODING = locale.getdefaultlocale()[1] or 'ascii' except: # Any problems at all determining the locale and we fallba...
lgpl-3.0
Anlim/decode-Django
Django-1.5.1/django/utils/unittest/main.py
219
9392
"""Unittest main program""" import sys import os import types from django.utils.unittest import loader, runner try: from django.utils.unittest.signals import installHandler except ImportError: installHandler = None __unittest = True FAILFAST = " -f, --failfast Stop on first failure\n" CATCHBREAK = ...
gpl-2.0
eul-721/The-Perfect-Pokemon-Team-Balancer
libs/env/Lib/site-packages/sqlalchemy/sql/dml.py
78
29493
# sql/dml.py # Copyright (C) 2009-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ Provide :class:`.Insert`, :class:`.Update` and :class:`.Delete`. """ from .base import...
gpl-2.0
piffey/ansible
lib/ansible/module_utils/aws/direct_connect.py
97
4009
# Copyright (c) 2017 Ansible Project # # This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign...
gpl-3.0
Dhivyap/ansible
lib/ansible/modules/network/ingate/ig_config.py
5
16005
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2018, Ingate Systems AB # # 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 version 3 of the License, ...
gpl-3.0
crckyl/pixplus
tools/conf-parser.py
1
1750
import sys import json from xml.sax.saxutils import escape from xml.sax.saxutils import quoteattr format = ' <preference name="%(name)s" value=%(value)s />' if sys.argv[1] == 'safari': format = ''' <dict> <key>Title</key> <string>%(name)s</string> <key>Key</key> <string>%(name)s</string> ...
mit
laayis/yowsup
yowsup/structs/protocoltreenode.py
38
4491
import binascii import sys class ProtocolTreeNode(object): def __init__(self, tag, attributes = None, children = None, data = None): self.tag = tag self.attributes = attributes or {} self.children = children or [] self.data = data assert type(self.children) is list, "Childr...
gpl-3.0
mbeacom/locust
locust/test/test_wait_time.py
1
2327
import random import time from locust import User, TaskSet, between, constant, constant_pacing from locust.exception import MissingWaitTimeError from .testcases import LocustTestCase class TestWaitTime(LocustTestCase): def test_between(self): class MyUser(User): wait_time = between(3, 9) ...
mit
vasylbo/aiohttp
examples/mpsrv.py
18
9115
#!/usr/bin/env python3 """Simple multiprocess http server written using an event loop.""" import argparse import os import socket import signal import time import asyncio import aiohttp import aiohttp.server from aiohttp import websocket ARGS = argparse.ArgumentParser(description="Run simple http server.") ARGS.add_...
apache-2.0
annajordanous/network-analysis
detect_english2.py
2
2442
# Approximate error rate: # Of 1000 comments identified as English, only one was not judged to # be in English by the programmer (a short comment in Spanish that # included two English words and some Spanish words that are spelled # like English words). Harder to quantify what happened with those # comments not ident...
gpl-2.0
ProfessionalIT/professionalit-webiste
sdk/google_appengine/lib/cherrypy/cherrypy/__init__.py
82
21667
"""CherryPy is a pythonic, object-oriented HTTP framework. CherryPy consists of not one, but four separate API layers. The APPLICATION LAYER is the simplest. CherryPy applications are written as a tree of classes and methods, where each branch in the tree corresponds to a branch in the URL path. Each method is a 'pa...
lgpl-3.0
nzavagli/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Lib/test/test_xpickle.py
11
7929
# test_pickle dumps and loads pickles via pickle.py. # test_cpickle does the same, but via the cPickle module. # This test covers the other two cases, making pickles with one module and # loading them via the other. It also tests backwards compatibility with # previous version of Python by bouncing pickled objects thro...
mit
cessor/galena
src/galena/stopwords.py
1
1030
from .corpus import * from .document import * import itertools class Stopwords(object): def __init__(self, stopwords): self._stopwords = stopwords def remove_from(self, words): for word in words: if not word: continue if word not in self._stopwords: ...
lgpl-3.0
chouseknecht/ansible
lib/ansible/plugins/inventory/docker_swarm.py
37
11922
# -*- coding: utf-8 -*- # Copyright (c) 2018, Stefan Heitmueller <stefan.heitmueller@gmx.com> # Copyright (c) 2018 Ansible Project # 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 DOCUM...
gpl-3.0
deejross/python3-pywbem
lex.py
1
39948
# ----------------------------------------------------------------------------- # ply: lex.py # # Author: David M. Beazley (dave@dabeaz.com) # # Copyright (C) 2001-2009, David M. Beazley # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # Lice...
lgpl-2.1
samueldotj/TeeRISC-Simulator
src/arch/x86/isa/insts/simd128/integer/shift/right_logical_shift.py
91
4565
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bsd-3-clause
joernhees/scikit-learn
examples/datasets/plot_random_multilabel_dataset.py
278
3402
""" ============================================== Plot randomly generated multilabel dataset ============================================== This illustrates the `datasets.make_multilabel_classification` dataset generator. Each sample consists of counts of two features (up to 50 in total), which are differently distri...
bsd-3-clause
uclaros/QGIS
tests/src/python/test_qgsdatumtransforms.py
10
18935
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsDatumTransforms. .. note:: 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 License, or (at your option) any later version. "...
gpl-2.0
juanantoniofm/accesible-moodle
fabtools/openvz/container.py
16
2193
""" OpenVZ containers ================= """ from fabtools import openvz as vz class Container(object): """ Object-oriented interface to OpenVZ containers. """ def __init__(self, ctid): self.ctid = ctid def __enter__(self): return self def __exit__(self, exc_type, exc_value, ...
gpl-2.0
krishnazure/Flask
Work/Trivia - Module 5/env/Lib/site-packages/jinja2/optimizer.py
1401
2302
# -*- coding: utf-8 -*- """ jinja2.optimizer ~~~~~~~~~~~~~~~~ The jinja optimizer is currently trying to constant fold a few expressions and modify the AST in place so that it should be easier to evaluate it. Because the AST does not contain all the scoping information and the compiler has to ...
apache-2.0
HesselTjeerdsma/Cyber-Physical-Pacman-Game
Algor/flask/lib/python2.7/site-packages/unidecode/x00b.py
252
4132
data = ( '[?]', # 0x00 'N', # 0x01 'N', # 0x02 'H', # 0x03 '[?]', # 0x04 'a', # 0x05 'aa', # 0x06 'i', # 0x07 'ii', # 0x08 'u', # 0x09 'uu', # 0x0a 'R', # 0x0b 'L', # 0x0c '[?]', # 0x0d '[?]', # 0x0e 'e', # 0x0f 'ai', # 0x10 '[?]', # 0x11 '[?]', # 0x12 'o', # ...
apache-2.0
Azure/azure-sdk-for-python
sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tag_operations.py
1
86989
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/pandas/io/tests/parser/test_textreader.py
7
12917
# -*- coding: utf-8 -*- """ Tests the TextReader class in parsers.pyx, which is integral to the C engine in parsers.py """ from pandas.compat import StringIO, BytesIO, map from pandas import compat import os import sys import nose from numpy import nan import numpy as np from pandas import DataFrame from pandas.io...
gpl-3.0
jmmease/pandas
asv_bench/benchmarks/reindex.py
7
6523
from .pandas_vb_common import * from random import shuffle class Reindexing(object): goal_time = 0.2 def setup(self): self.rng = DatetimeIndex(start='1/1/1970', periods=10000, freq='1min') self.df = DataFrame(np.random.rand(10000, 10), index=self.rng, columns=range...
bsd-3-clause
gem/geonode
geonode/groups/urls.py
14
2422
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # 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 ...
gpl-3.0
Thoshh/wapad
lib/python2.7/site-packages/django/db/backends/sqlite3/base.py
323
18115
""" SQLite3 backend for django. Works with either the pysqlite2 module or the sqlite3 module in the standard library. """ from __future__ import unicode_literals import datetime import decimal import re import warnings from django.conf import settings from django.db import utils from django.db.backends import utils ...
mit
liangazhou/django-rdp
packages/Django-1.8.6/django/contrib/sessions/backends/base.py
99
11451
from __future__ import unicode_literals import base64 import logging import string from datetime import datetime, timedelta from django.conf import settings from django.contrib.sessions.exceptions import SuspiciousSession from django.core.exceptions import SuspiciousOperation from django.utils import timezone from dj...
apache-2.0
gVallverdu/pymatgen
pymatgen/util/provenance.py
2
14104
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ Classes and methods related to the Structure Notation Language (SNL) """ import sys import re import datetime from collections import namedtuple import json from io import StringIO from monty.json import M...
mit
percipient/datadogpy
datadog/dogstatsd/base.py
3
9678
#!/usr/bin/env python """ DogStatsd is a Python client for DogStatsd, a Statsd fork for Datadog. """ import logging from random import random from time import time import socket from functools import wraps try: from itertools import imap except ImportError: imap = map log = logging.getLogger('dogstatsd') ...
bsd-3-clause
miguelparaiso/PracticaOdoo
addons/membership/__openerp__.py
197
2207
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
pwaldo2/AWPUG-Plone-Demo
src/awpug.content/PasteScript-1.7.5-py2.7.egg/paste/script/help.py
6
1943
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org) # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php from command import Command, get_commands from command import parser as base_parser class HelpCommand(Command): summary = "Display help" usag...
gpl-2.0
michaeldavidcarr/namebench
nb_third_party/dns/rdtypes/ANY/NSEC3.py
248
6716
# Copyright (C) 2004-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
apache-2.0
4Quant/tensorflow
tensorflow/python/ops/rnn.py
1
21568
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
diagramsoftware/odoo
addons/account/wizard/account_fiscalyear_close.py
222
15660
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
sknepneklab/SAMoS
utils/make_circular_patch.py
1
3349
# *************************************************************************** # * # * Copyright (C) 2013-2016 University of Dundee # * All rights reserved. # * # * This file is part of SAMoS (Soft Active Matter on Surfaces) program. # * # * SAMoS is free software; you can redistribute it and/or modify # * it unde...
gpl-3.0
woobe/h2o
py/test_import2.py
2
4794
import unittest, time, sys, os # not needed, but in case you move it down to subdir sys.path.extend(['.','..']) import h2o_cmd import h2o import h2o_browse as h2b import h2o_import as h2i class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox_for_errors() @classmethod def setUpClass...
apache-2.0
Sorsly/subtle
google-cloud-sdk/lib/third_party/setuptools/command/build_clib.py
314
4484
import distutils.command.build_clib as orig from distutils.errors import DistutilsSetupError from distutils import log from setuptools.dep_util import newer_pairwise_group class build_clib(orig.build_clib): """ Override the default build_clib behaviour to do the following: 1. Implement a rudimentary time...
mit
chrisjrn/registrasion
registrasion/tests/controller_helpers.py
1
2034
from registrasion.controllers.cart import CartController from registrasion.controllers.credit_note import CreditNoteController from registrasion.controllers.invoice import InvoiceController from registrasion.models import commerce from django.core.exceptions import ObjectDoesNotExist class TestingCartController(Cart...
apache-2.0
shfengcj/pyminer
pyminer_setting.py
1
1142
# -*- coding: utf-8 -*- """ Created on Tue Jun 23 06:53:32 2015 @author: chaojun """ from pyminer_cos_model import lcdm from pyminer_residual import JLAresiCal, CMBresiCal, BAOresiCal # Genearl setting divMax = 15 # for romberg integral ogh2 = 2.469e-5 JLA_DIR = '/Users/chaojun/Documents/Research/2015/grb/pyc...
gpl-2.0
persandstrom/home-assistant
homeassistant/components/sensor/version.py
3
1402
""" Support for displaying the current version of Home Assistant. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.version/ """ import logging import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.compone...
apache-2.0
proxysh/Safejumper-for-Desktop
buildlinux/env64/lib/python2.7/site-packages/Crypto/SelfTest/Util/test_asn1.py
113
10239
# -*- coding: utf-8 -*- # # SelfTest/Util/test_asn.py: Self-test for the Crypto.Util.asn1 module # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone is ...
gpl-2.0
charris/numpy
numpy/ma/tests/test_deprecations.py
17
2258
"""Test deprecation and future warnings. """ import numpy as np from numpy.testing import assert_warns from numpy.ma.testutils import assert_equal from numpy.ma.core import MaskedArrayFutureWarning class TestArgsort: """ gh-8701 """ def _test_base(self, argsort, cls): arr_0d = np.array(1).view(cls) ...
bsd-3-clause
oandrew/home-assistant
homeassistant/scripts/check_config.py
6
10301
"""Script to ensure a configuration file exists.""" import argparse import logging import os from collections import OrderedDict from glob import glob from platform import system from unittest.mock import patch from typing import Dict, List, Sequence import homeassistant.bootstrap as bootstrap import homeassistant.co...
mit
phazel/pixelated-user-agent
service/test/unit/resources/test_keys_resources.py
7
2316
import json import ast from mockito import mock, when from leap.keymanager import OpenPGPKey, KeyNotFound from pixelated.resources.keys_resource import KeysResource import twisted.trial.unittest as unittest from twisted.web.test.requesthelper import DummyRequest from twisted.internet import defer from test.unit.resourc...
agpl-3.0
2013Commons/HUE-SHARK
desktop/core/ext-py/Django-1.2.3/django/contrib/gis/db/models/sql/aggregates.py
309
1804
from django.db.models.sql.aggregates import * from django.contrib.gis.db.models.fields import GeometryField from django.contrib.gis.db.models.sql.conversion import GeomField class GeoAggregate(Aggregate): # Default SQL template for spatial aggregates. sql_template = '%(function)s(%(field)s)' # Conversion ...
apache-2.0
cytsao/X-Informatics-1.3.0
tests/functional/actions.py
2
21562
# Copyright 2012 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 ...
apache-2.0
emijrp/youtube-dl
youtube_dl/extractor/bpb.py
145
1364
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor class BpbIE(InfoExtractor): IE_DESC = 'Bundeszentrale für politische Bildung' _VALID_URL = r'http://www\.bpb\.de/mediathek/(?P<id>[0-9]+)/' _TEST = { 'url': 'http://www.bpb.de/mediathek/297/joachim-gauck-zu...
unlicense
nishad-jobsglobal/odoo-marriot
openerp/addons/sync_mail_multi_attach/controllers/__init__.py
1
1157
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>) # Copyright (C) 2011-today Synconics Technologies Pvt. Ltd. (<http://www.synconics.com>) # # Th...
agpl-3.0
wdzhou/mantid
scripts/Vates/Diffraction_Workflow.py
3
4117
# pylint: disable=invalid-name # Basic parameters for Triphylite Crystal # Name of the workspaces to create import mantid.simpleapi as mantid ws_name = "TOPAZ_3132" filename = ws_name + "_event.nxs" ws = mantid.LoadEventNexus(Filename=filename, FilterByTofMin=3000, FilterByTofMax=16000) # --------------------------...
gpl-3.0
ctrezevant/doorMan
Applications/Command Line/doorctl.py
1
1846
#!/usr/bin/env python import urllib2, json, sys CONFIG = { 'API_KEY': ' ', 'API_HOST': 'http://<ip>', 'DOOR_TARGET': 0 } def main(): if 'open' in sys.argv: print 'sent open: %s' % sendCmd('/set/open') if 'close' in sys.argv: print 'sent close: %s' % sendCmd('/set/close') if 'cycle' in sys....
mit
fengshao0907/vitess
test/queryservice_test.py
1
2631
#!/usr/bin/env python import logging import optparse import traceback import unittest import sys import os import utils import framework from queryservice_tests import cache_tests from queryservice_tests import nocache_tests from queryservice_tests import stream_tests from queryservice_tests import status_tests from...
bsd-3-clause
kawasaki2013/python-for-android-x86
python-build/python-libs/gdata/src/atom/data.py
136
8060
#!/usr/bin/env python # # Copyright (C) 2009 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 ...
apache-2.0
priyaganti/rockstor-core
src/rockstor/storageadmin/views/clone_helpers.py
1
2535
""" Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com> This file is part of RockStor. RockStor 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 License, or (at your option) any la...
gpl-3.0
javachengwc/hue
apps/beeswax/src/beeswax/migrations/0003_auto__add_field_queryhistory_server_name__add_field_queryhistory_serve.py
40
7185
# encoding: utf-8 import 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 'QueryHistory.server_name' db.add_column('beeswax_queryhistory', 'server_name', self.gf('django.db....
apache-2.0
lpredova/pybookie
server/sources/footbal_db.py
1
3991
# coding=utf-8 import json import os class FootballDB: BASE_DIR = os.path.dirname(os.path.dirname(__file__)) groups_file = BASE_DIR + '/sources/groups.json' wc_history_file = BASE_DIR + '/sources/wc_history' wc_team_file = BASE_DIR + '/sources/squads/' top_teams = ['RealMadrid(ESP)', 'Barcelona...
apache-2.0
repotvsupertuga/tvsupertuga.repository
script.module.streamlink.base/resources/lib/streamlink/plugins/viasat.py
5
4436
import re from streamlink import NoStreamsError from streamlink.exceptions import PluginError from streamlink.plugin import Plugin from streamlink.plugin.api import StreamMapper, validate from streamlink.stream import HDSStream, HLSStream, RTMPStream from streamlink.utils import rtmpparse STREAM_API_URL = "https://pl...
gpl-2.0
jules185/IoT_Hackathon
.homeassistant/deps/psutil/tests/test_sunos.py
6
1322
#!/usr/bin/env python # Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Sun OS specific tests.""" import os import psutil from psutil import SUNOS from psutil.tests import run_test_module_by_name fro...
mit
gautamMalu/rootfs_xen_arndale
usr/lib/python2.7/opcode.py
264
5474
""" opcode module - potentially shared between dis and other modules which operate on bytecodes (e.g. peephole optimizers). """ __all__ = ["cmp_op", "hasconst", "hasname", "hasjrel", "hasjabs", "haslocal", "hascompare", "hasfree", "opname", "opmap", "HAVE_ARGUMENT", "EXTENDED_ARG"] cmp_op = ('<...
gpl-2.0
DiamondLightSource/diffcalc
test/diffcalc/gdasupport/minigda/test_command.py
1
5417
### # Copyright 2008-2011 Diamond Light Source Ltd. # This file is part of Diffcalc. # # Diffcalc 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 late...
gpl-3.0
RichardLitt/wyrd-django-dev
tests/test_sqlite.py
64
1142
# This is an example test settings file for use with the Django test suite. # # The 'sqlite3' backend requires only the ENGINE setting (an in- # memory database will be used). All other backends will require a # NAME and potentially authentication information. See the # following section in the docs for more informatio...
bsd-3-clause
KaiRo-at/socorro
socorro/unittest/external/es/test_index_creator.py
5
1538
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from nose.tools import ok_ from socorro.external.es.index_creator import IndexCreator from socorro.unittest.external.es...
mpl-2.0
GiantSteps/essentia
test/src/unittest/spectral/test_spectralcontrast.py
10
4457
#!/usr/bin/env python # Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra # # This file is part of Essentia # # Essentia 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 # Software Foundation (FSF), e...
agpl-3.0
solin319/incubator-mxnet
example/python-howto/debug_conv.py
44
1319
# 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...
apache-2.0
bikashgupta11/javarobot
src/main/resources/jython/Lib/unittest/test/test_case.py
89
43816
import difflib import pprint import pickle import re import sys from copy import deepcopy from test import test_support import unittest from .support import ( TestEquality, TestHashing, LoggingResult, ResultWithNoStartTestRunStopTestRun ) class Test(object): "Keep these TestCase classes out of the main nam...
gpl-3.0
flavour/eden
modules/plugins/__init__.py
5
8807
# -*- coding: utf-8 -*- import os import sys from gluon import current from gluon.storage import Storage from s3compat import reload __all__ = ("PluginLoader", ) # Name of the plugin directory in modules PLUGINS = "plugins" # Module names to ignore when scanning for plugins IGNORE = ("skeleton", "__ini...
mit
mitar/django
tests/regressiontests/localflavor/ro/tests.py
33
5449
# -*- coding: utf-8 -*- from django.contrib.localflavor.ro.forms import (ROCIFField, ROCNPField, ROCountyField, ROCountySelect, ROIBANField, ROPhoneNumberField, ROPostalCodeField) from django.test import SimpleTestCase class ROLocalFlavorTests(SimpleTestCase): def test_ROCountySelect(self): f = R...
bsd-3-clause
pilou-/ansible
lib/ansible/module_utils/oneview.py
47
18924
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
gpl-3.0
caiocsalvador/whats_the_craic
lib/python3.4/site-packages/django/utils/deconstruct.py
502
2047
from importlib import import_module from django.utils.version import get_docs_version def deconstructible(*args, **kwargs): """ Class decorator that allow the decorated class to be serialized by the migrations subsystem. Accepts an optional kwarg `path` to specify the import path. """ path =...
mit
amluto/libseccomp
tests/21-live-basic_allow.py
1
1695
#!/usr/bin/env python # # Seccomp Library test program # # Copyright (c) 2013 Red Hat <pmoore@redhat.com> # Author: Paul Moore <pmoore@redhat.com> # # # This library is free software; you can redistribute it and/or modify it # under the terms of version 2.1 of the GNU Lesser General Public License as # published by t...
lgpl-2.1
krismcfarlin/gae_endpoints_aloha
bp_includes/external/requests/packages/chardet/big5freq.py
3133
82594
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
lgpl-3.0
ewandor/home-assistant
homeassistant/components/climate/netatmo.py
1
5912
""" Support for Netatmo Smart Thermostat. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/climate.netatmo/ """ import logging from datetime import timedelta import voluptuous as vol from homeassistant.const import TEMP_CELSIUS, ATTR_TEMPERATURE from home...
apache-2.0
romain-li/edx-platform
pavelib/docs.py
16
2005
""" Open edX Documentation Builder Ties into Sphinx to generate files at the specified location(s) """ from __future__ import print_function import sys from paver.easy import cmdopts, needs, sh, task from .utils.timer import timed DOC_PATHS = { "dev": "docs/en_us/developers", "author": "docs/en_us/course_au...
agpl-3.0
geokala/cloudify-manager
rest-service/manager_rest/blueprints_manager.py
1
39060
######### # Copyright (c) 2013 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...
apache-2.0
goddardl/cortex
test/IECore/TransformOpTest.py
2
7030
########################################################################## # # Copyright (c) 2008-2015, Image Engine Design 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: # # * Redis...
bsd-3-clause
bdeak/taskmgr
fabfile/execute/install_package.py
1
2064
from fabric.api import * import re import os.path import logging import utils.log l = logging.getLogger() l = utils.log.CustomLogAdapter(l, None) @task(default=True) def check(input_params, cluster): """ Install a given version of a given package Can support multiple backends input_params para...
gpl-2.0
okolisny/integration_tests
scripts/post_jenkins_result.py
1
2181
#!/usr/bin/env python2 import json import os import os.path from datetime import datetime from artifactor.plugins.post_result import test_report from cfme.utils import read_env from cfme.utils.path import project_path from cfme.utils.trackerbot import post_jenkins_result job_name = os.environ['JOB_NAME'] number = int...
gpl-2.0
najeeb97khan/Tensorflow-CS20SI
Assignment_2/style_transfer/utils.py
3
2227
""" Utils needed for the implementation of the paper "A Neural Algorithm of Artistic Style" by Gatys et al. in TensorFlow. Author: Chip Huyen (huyenn@stanford.edu) Prepared for the class CS 20SI: "TensorFlow for Deep Learning Research" For more details, please read the assignment handout: http://web.stanford.edu/class...
mit
cetic/ansible
lib/ansible/modules/network/cloudengine/ce_vrf_interface.py
46
15550
#!/usr/bin/python # # 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 version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
blackzw/openwrt_sdk_dev1
staging_dir/host/lib/python2.7/lib2to3/fixes/fix_set_literal.py
326
1699
""" Optional fixer to transform set() calls to set literals. """ # Author: Benjamin Peterson from lib2to3 import fixer_base, pytree from lib2to3.fixer_util import token, syms class FixSetLiteral(fixer_base.BaseFix): BM_compatible = True explicit = True PATTERN = """power< 'set' trailer< '(' ...
gpl-2.0