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
dlazz/ansible
lib/ansible/module_utils/network/cnos/cnos.py
5
19569
# 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
kailIII/emaresa
trunk.pe/account_modifier/__openerp__.py
3
1923
# -*- coding: utf-8 -*- ############################################################################## # # Author: OpenDrive Ltda # Copyright (c) 2014 Opendrive Ltda # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsibility of assessing all potential # cons...
agpl-3.0
yanheven/nova
nova/api/openstack/compute/plugins/v3/tenant_networks.py
8
7904
# Copyright 2013 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
diego-d5000/MisValesMd
env/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/schema.py
1
3635
import psycopg2 from django.db.backends.base.schema import BaseDatabaseSchemaEditor class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): sql_create_sequence = "CREATE SEQUENCE %(sequence)s" sql_delete_sequence = "DROP SEQUENCE IF EXISTS %(sequence)s CASCADE" sql_set_sequence_max = "SELECT setv...
mit
espadrine/opera
chromium/src/third_party/python_26/Lib/copy_reg.py
442
6800
"""Helper to provide extensibility for pickle/cPickle. This is only useful to add pickle support for extension types defined in C, not for instances of user-defined classes. """ from types import ClassType as _ClassType __all__ = ["pickle", "constructor", "add_extension", "remove_extension", "clear_extens...
bsd-3-clause
woshilapin/cjdns
node_build/dependencies/libuv/build/gyp/test/lib/TestGyp.py
46
50586
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ TestGyp.py: a testing framework for GYP integration tests. """ import collections from contextlib import contextmanager import itertools import os import ran...
gpl-3.0
VirtusLab/ansible-modules-extras
monitoring/newrelic_deployment.py
131
4675
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2013 Matt Coddington <coddington@gmail.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 version 3 ...
gpl-3.0
cjellick/rancher
tests/validation/tests/v3_api/test_gke_cluster.py
4
3791
from .common import * # NOQA import requests import pytest CREDENTIALS = os.environ.get('RANCHER_GKE_CREDENTIAL', "") GKE_MASTER_VERSION = os.environ.get('RANCHER_GKE_MASTER_VERSION', "") gkecredential = pytest.mark.skipif(not CREDENTIALS, reason='GKE Credentials ' 'not provided, ...
apache-2.0
arjoly/scikit-learn
sklearn/covariance/tests/test_covariance.py
34
11120
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Gael Varoquaux <gael.varoquaux@normalesup.org> # Virgile Fritsch <virgile.fritsch@inria.fr> # # License: BSD 3 clause import numpy as np from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_alm...
bsd-3-clause
jacquev6/MockMockMock
MockMockMock/tests/expectation_sequence.py
1
1736
# coding: utf8 # Copyright 2013-2015 Vincent Jacques <vincent@vincent-jacques.net> import unittest import MockMockMock class ExpectationSequenceTestCase(unittest.TestCase): def setUp(self): super(ExpectationSequenceTestCase, self).setUp() self.mocks = MockMockMock.Engine() self.mock = s...
mit
vitaly4uk/django
django/templatetags/future.py
129
2039
import warnings from django.template import Library, defaulttags from django.utils.deprecation import RemovedInDjango110Warning register = Library() @register.tag def cycle(parser, token): """ This is the future version of `cycle` with auto-escaping. The deprecation is now complete and this version is n...
bsd-3-clause
sylarcp/anita
venv/lib/python2.7/site-packages/jinja2/meta.py
659
4190
# -*- coding: utf-8 -*- """ jinja2.meta ~~~~~~~~~~~ This module implements various functions that exposes information about templates that might be interesting for various kinds of applications. :copyright: (c) 2010 by the Jinja Team, see AUTHORS for more details. :license: BSD, see LICENSE fo...
mit
linked67/p2pool-phicoin
nattraverso/pynupnp/upnpxml.py
288
3026
""" This module parse an UPnP device's XML definition in an Object. @author: Raphael Slinckx @copyright: Copyright 2005 @license: LGPL @contact: U{raphael@slinckx.net<mailto:raphael@slinckx.net>} @version: 0.1.0 """ __revision__ = "$id" from xml.dom import minidom import logging # Allowed UPnP services to use when ...
gpl-3.0
devclone/enigma2-9f38fd6
lib/python/Tools/CopyFiles.py
66
2220
from Components.Task import PythonTask, Task, Job, job_manager as JobManager from Tools.Directories import fileExists from enigma import eTimer from os import path from shutil import rmtree, copy2, move class DeleteFolderTask(PythonTask): def openFiles(self, fileList): self.fileList = fileList def work(self): p...
gpl-2.0
Glorf/servo
tests/wpt/web-platform-tests/tools/pytest/testing/test_parseopt.py
171
12294
from __future__ import with_statement import sys import os import py, pytest from _pytest import config as parseopt @pytest.fixture def parser(): return parseopt.Parser() class TestParser: def test_no_help_by_default(self, capsys): parser = parseopt.Parser(usage="xyz") pytest.raises(SystemExit...
mpl-2.0
snowyu/libtorrent
docs/gen_stats_doc.py
11
2401
counter_types = {} f = open('../include/libtorrent/performance_counters.hpp') counter_type = '' for l in f: l = l.strip() if l.startswith('//'): continue if l.startswith('#'): continue if l == '': continue if 'enum stats_counter_t' in l: counter_type = 'counter' continue if 'enum stats_gauges_t' in l: ...
bsd-3-clause
dattasaurabh82/internetarchive
tests/iacli/test_ia_upload.py
2
1694
import os, sys from subprocess import Popen, PIPE from time import time import pytest inc_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, inc_path) import internetarchive.config @pytest.mark.skipif('internetarchive.config.get_config().get("s3") is None', rea...
agpl-3.0
npiganeau/odoo
addons/web_tip/web_tip.py
2
2524
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General...
agpl-3.0
TeslaProject/external_chromium_org
tools/memory_inspector/memory_inspector/classification/native_heap_classifier_unittest.py
89
5824
# Copyright 2014 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. import unittest from memory_inspector.classification import native_heap_classifier from memory_inspector.core import native_heap from memory_inspector.core ...
bsd-3-clause
ScreamingUdder/mantid
qt/widgets/sliceviewer/test/suite_ColorBarWidget/tst_min_makes_max_increase/test.py
3
1623
def main(): startApplication("ColorBarWidgetDemo") spinDown(waitForObject(":valMax_QScienceSpinBox")) spinDown(waitForObject(":valMax_QScienceSpinBox")) waitFor("object.exists(':valMax_QScienceSpinBox')", 20000) test.compare(findObject(":valMax_QScienceSpinBox").value, 98) doubleClick(waitForOb...
gpl-3.0
djw8605/condor
nmi_tools/glue/build/email_on_failure.py
6
7280
#!/usr/bin/python # The purpose of this script is to email users when an automated build breaks. # Caveats: # - it has a few hardcoded spots that require the build user to be cndrauto. # - it only works for builds. I think tests are too flaky and would generate too much mail # # Written by Scot Kronenfeld 2011-06 ...
apache-2.0
aparo/django-nonrel
django/utils/cache.py
22
8766
""" This module contains helper functions for controlling caching. It does so by managing the "Vary" header of responses. It includes functions to patch the header of response objects directly and decorators that change functions to do that header-patching themselves. For information on the Vary header, see: http...
bsd-3-clause
azoft-dev-team/imagrium
env/Lib/test/test_bisect.py
41
13043
import sys import unittest from test import test_support from UserList import UserList # We do a bit of trickery here to be able to test both the C implementation # and the Python implementation of the module. # Make it impossible to import the C implementation anymore. sys.modules['_bisect'] = 0 # We must also handl...
mit
sauloal/PiCastPy
sqlalchemy/dialects/sybase/pysybase.py
18
3228
# sybase/pysybase.py # Copyright (C) 2010-2013 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 """ .. dialect:: sybase+pysybase :name: Python-Sybase :dbapi: Sybase :c...
mit
FrankNagel/qlc
src/webapp/quanthistling/scripts/annotations/annotations_for_shell1987.py
1
7100
# -*- coding: utf8 -*- import sys, os sys.path.append(os.path.abspath('.')) import re from operator import attrgetter import difflib # Pylons model init sequence import pylons.test import logging from quanthistling.config.environment import load_environment from quanthistling.model.meta import Sessi...
gpl-3.0
sikmir/QGIS
tests/src/python/test_provider_ogr_sqlite.py
30
20246
# -*- coding: utf-8 -*- """QGIS Unit tests for the OGR/GPKG provider. .. 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
Sakiut/FalltoSkyBot
cogs/vote.py
1
4199
# -*- coding: utf-8 -*- import asyncio import discord from discord.ext import commands from libraries.library import * class Vote: def __init__(self,bot): self.bot = bot self.VoteState = None self.Mess = None self.Requester = None self.subject = None self.Voters =...
agpl-3.0
isandlaTech/cohorte-demos
led/dump/led-demo-raspberry/cohorte/dist/cohorte-1.0.0-1.0.0-20141201.234602-19-python-distribution/repo/requests/packages/urllib3/connectionpool.py
155
29526
import errno import logging import sys import warnings from socket import error as SocketError, timeout as SocketTimeout import socket try: # Python 3 from queue import LifoQueue, Empty, Full except ImportError: from Queue import LifoQueue, Empty, Full import Queue as _ # Platform-specific: Windows fr...
apache-2.0
GuildMasterInfinite/OpenGL-Loader-Generator
Command.py
1
1314
from Parameter import Parameter class Command: def __init__(self, commandTag): protoTag = commandTag.find("proto") # First we need to extract the return type. returnTag = protoTag.find("ptype") if returnTag is None: self.returnType = protoTag.text.str...
mit
igor-toga/local-snat
neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/openflow/native/test_br_int.py
7
15264
# Copyright (C) 2014,2015 VA Linux Systems Japan K.K. # Copyright (C) 2014,2015 YAMAMOTO Takashi <yamamoto at valinux co jp> # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of t...
apache-2.0
impmihai/coala
coalib/settings/Setting.py
9
9567
import os from collections import OrderedDict from coala_utils.decorators import generate_repr from coala_utils.string_processing.StringConverter import StringConverter from coalib.parsing.Globbing import glob_escape def path(obj, *args, **kwargs): return obj.__path__(*args, **kwargs) def path_list(obj, *args,...
agpl-3.0
israeleriston/scientific-week
backend/venv/lib/python3.5/site-packages/sqlalchemy/dialects/mysql/gaerdbms.py
33
3387
# mysql/gaerdbms.py # Copyright (C) 2005-2017 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 """ .. dialect:: mysql+gaerdbms :name: Google Cloud SQL :dbapi: rdbms :...
mit
sti-lyneos/shop
softwarecenter/backend/oneconfhandler/__init__.py
7
1342
# -*- coding: utf-8 -*- # Copyright (C) 2011 Canonical # # Authors: # Didier Roche # # 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; version 3. # # This program is distributed in the hope that ...
lgpl-3.0
TNT-Samuel/Coding-Projects
DNS Server/Source - Copy/Lib/site-packages/pygments/lexers/sas.py
31
9449
# -*- coding: utf-8 -*- """ pygments.lexers.sas ~~~~~~~~~~~~~~~~~~~ Lexer for SAS. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, include, words from pygments.token import Comment, Key...
gpl-3.0
wargio/radare2
test/unit/legacy_unit/syscall/openbsd-gen.py
75
1396
#!/usr/bin/env python # Auto-generate radare syscall profile for OpenBSD from syscall.h # (c) Edd Barrett 2011 import sys import copy f = open("/usr/include/sys/syscall.h", "r") rec = { "name" : None, "args" : None } recs = {} for line in f: if line.startswith("/* syscall:"): # extract syscall name ...
lgpl-3.0
jeckersb/Proton
examples/python/reactor/scheduling.py
4
1876
#!/usr/bin/python # # 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 # "Lice...
apache-2.0
colinligertwood/odoo
addons/account_payment/__openerp__.py
116
2997
# -*- 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
woylaski/notebook
graphic/kivy-master/kivy/tools/packaging/factory.py
54
3457
from __future__ import print_function __all__ = ('FactoryBuild', ) from distutils.cmd import Command import fnmatch import os import kivy import types ignore_list = ( 'kivy.lib', 'kivy.input.providers', 'kivy.input.postproc', 'kivy.modules', 'kivy.tools', 'kivy.parser', 'kivy.tests', ) ...
gpl-3.0
candlepin/subscription-manager
test/cli_command_test/test_import_cert.py
1
1647
# -*- coding: utf-8 -*- import os import sys from ..test_managercli import TestCliCommand from subscription_manager import managercli from mock import patch, Mock class TestImportCertCommand(TestCliCommand): command_class = managercli.ImportCertCommand def setUp(self): super(TestImportCertCommand,...
gpl-2.0
xiaoyuanW/gem5
src/arch/x86/isa/insts/simd64/integer/data_reordering/__init__.py
91
2421
# 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
2gis/contesto
tests/utils_collect_metadata_tests.py
2
3411
# coding: utf-8 import unittest try: from StringIO import StringIO except ImportError: from io import StringIO try: from mock import Mock, patch except ImportError: from unittest.mock import Mock, patch from nose.tools import nottest from contesto import ContestoTestCase, config @nottest def fixtu...
mit
CalSol/mbed
tools/export/simplicity/__init__.py
16
5885
""" mbed SDK Copyright (c) 2014-2016 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wr...
apache-2.0
ptomasroos/vitess
py/vtdb/update_stream.py
16
2847
# Copyright 2015, Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can # be found in the LICENSE file. # mapping from protocol to python class. The protocol matches the string # used by vttablet as a -binlog_player_protocol parameter. update_stream_conn_classes = dict(...
bsd-3-clause
stackforge/refstack
refstack/db/api.py
2
9143
# Copyright (c) 2015 Mirantis, 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 requir...
apache-2.0
ihmccreery/kubernetes
vendor/github.com/ugorji/go/codec/test.py
1516
4019
#!/usr/bin/env python # This will create golden files in a directory passed to it. # A Test calls this internally to create the golden files # So it can process them (so we don't have to checkin the files). # Ensure msgpack-python and cbor are installed first, using: # sudo apt-get install python-dev # sudo apt-g...
apache-2.0
acbodine/koding
go/src/vendor/github.com/caglar10ur/lxc/config/yum/lxc-patch.py
64
1870
# Yum plugin to re-patch container rootfs after a yum update is done # # Copyright (C) 2012 Oracle # # Authors: # Dwight Engen <dwight.engen@oracle.com> # # This library 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...
agpl-3.0
szpssky/deeplearning_example
not_mnist_cnn/preprocessing/preprocessing_factory.py
14
2762
# Copyright 2016 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 applicable ...
apache-2.0
jbaayen/sympy
sympy/logic/boolalg.py
1
7565
"""Boolean algebra module for SymPy""" from sympy.core import Basic, Function, sympify, Symbol from sympy.utilities import flatten class BooleanFunction(Function): """Boolean function is a function that lives in a boolean space It is used as base class for And, Or, Not, etc. """ pass class And(Boolea...
bsd-3-clause
Altai-man/kataba-fork
wsgi/openshift/captcha/migrations/0001_initial.py
17
1523
# 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 model 'CaptchaStore' db.create_table('captcha_captchastore', ( ('id', self.gf('django...
gpl-2.0
pselle/calibre
src/calibre/devices/jetbook/driver.py
24
4184
# -*- coding: utf-8 -*- __license__ = 'GPL v3' __copyright__ = '2009, James Ralston <jralston at mindspring.com>' __docformat__ = 'restructuredtext en' ''' Device driver for Ectaco Jetbook firmware >= JL04_v030e ''' import os import re import sys from calibre.devices.usbms.driver import USBMS from calibre.ebooks....
gpl-3.0
patriciolobos/desa8
openerp/addons/marketing_campaign/marketing_campaign.py
286
41776
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2013 OpenERP SA (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of th...
agpl-3.0
tashaharrison/dress
sites/all/libraries/OpenLayers/tests/selenium/remotecontrol/selenium.py
254
69389
""" Copyright 2006 ThoughtWorks, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, sof...
gpl-2.0
DavidAndreev/indico
indico/core/signals/event/notes.py
2
1122
# This file is part of Indico. # Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
gpl-3.0
d3banjan/polyamide
webdev/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/_compat.py
901
1253
# Copyright 2014 Donald Stufft # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
bsd-2-clause
omerucn/or-tools
tools/setup_data.py
18
1550
from setuptools import setup, Extension from os.path import join as pjoin from os.path import dirname # Utility function to read the README file. # Used for the long_description. It's nice, because now 1) we have a top level # README file and 2) it's easier to type in the README file than to put a raw # string in bel...
apache-2.0
tunneln/CarnotKE
jyhton/Lib/test/test_list_jy.py
7
8716
import unittest import random import threading import time from test import test_support import test_list if test_support.is_jython: from java.util import ArrayList from java.lang import String class ListTestCase(unittest.TestCase): def test_recursive_list_slices(self): x = [1,2,3,4,5] x[...
apache-2.0
scith/htpc-manager_ynh
sources/libs/cherrypy/lib/httpauth.py
47
13030
""" This module defines functions to implement HTTP Digest Authentication (:rfc:`2617`). This has full compliance with 'Digest' and 'Basic' authentication methods. In 'Digest' it supports both MD5 and MD5-sess algorithms. Usage: First use 'doAuth' to request the client authentication for a certain resource. Yo...
gpl-3.0
ForensicTools/GRREAT-475_2141-Chaigon-Failey-Siebert
lib/flows/general/fingerprint.py
4
4119
#!/usr/bin/env python # Copyright 2012 Google Inc. All Rights Reserved. """Invoke the fingerprint client action on a file.""" from grr.lib import aff4 from grr.lib import flow from grr.lib import rdfvalue from grr.proto import flows_pb2 class FingerprintFileArgs(rdfvalue.RDFProtoStruct): protobuf = flows_pb2.Fing...
apache-2.0
snd/dejavu
dejavu/wavio.py
20
4076
# wavio.py # Author: Warren Weckesser # License: BSD 3-Clause (http://opensource.org/licenses/BSD-3-Clause) # Synopsis: A Python module for reading and writing 24 bit WAV files. # Github: github.com/WarrenWeckesser/wavio import wave as _wave import numpy as _np def _wav2array(nchannels, sampwidth, data): """data...
mit
GeyerA/android_external_chromium_org
chrome/common/extensions/docs/server2/sidenav_data_source.py
23
2419
# Copyright (c) 2012 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. import copy import json import logging class SidenavDataSource(object): """This class reads in and caches a JSON file representing the side navigation...
bsd-3-clause
amalakar/dd-agent
tests/core/test_modules.py
37
1954
# stdlib import logging import os import sys import unittest # project import modules log = logging.getLogger('datadog.test') TARGET_MODULE = 'tests.core.fixtures.target_module' default_target = 'DEFAULT' specified_target = 'SPECIFIED' has_been_mutated = False class TestModuleLoad(unittest.TestCase): def setU...
bsd-3-clause
rtfm-ctf/rtfmapi
modules/crypto/adfgx.py
1
2183
from rtfmapi.modules.crypto.base import Cipher from rtfmapi.modules.crypto.columnartransposition import ColTrans from rtfmapi.modules.crypto.polybius import PolybiusSquare #################################################################################### class ADFGX(Cipher): """The ADFGX Cipher has a key consist...
gpl-2.0
RayMick/scikit-learn
examples/neighbors/plot_species_kde.py
282
4059
""" ================================================ Kernel Density Estimate of Species Distributions ================================================ This shows an example of a neighbors-based query (in particular a kernel density estimate) on geospatial data, using a Ball Tree built upon the Haversine distance metric...
bsd-3-clause
vFense/vFenseAgent-nix
agent/deps/rpm6/Python-2.7.5/lib/python2.7/test/test_list.py
83
2642
import sys from test import test_support, list_tests class ListTest(list_tests.CommonTest): type2test = list def test_basic(self): self.assertEqual(list([]), []) l0_3 = [0, 1, 2, 3] l0_3_bis = list(l0_3) self.assertEqual(l0_3, l0_3_bis) self.assertTrue(l0_3 is not l0_3_...
lgpl-3.0
MicroTrustRepos/microkernel
src/l4/pkg/python/contrib/Lib/plat-mac/lib-scriptpackages/Finder/Files.py
80
6439
"""Suite Files: Classes representing files Level 1, version 1 Generated from /System/Library/CoreServices/Finder.app AETE/AEUT resource version 0/144, language 0, script 0 """ import aetools import MacOS _code = 'fndr' class Files_Events: pass class alias_file(aetools.ComponentItem): """alias file - An a...
gpl-2.0
leekchan/django_test
django/contrib/gis/db/backends/oracle/introspection.py
35
1975
import cx_Oracle import sys from django.db.backends.oracle.introspection import DatabaseIntrospection from django.utils import six class OracleIntrospection(DatabaseIntrospection): # Associating any OBJECTVAR instances with GeometryField. Of course, # this won't work right on Oracle objects that aren't MDSYS...
bsd-3-clause
edcast-inc/edx-platform-edcast
common/lib/symmath/symmath/symmath_check.py
36
12584
#!/usr/bin/python # -*- coding: utf-8 -*- # # File: symmath_check.py # Date: 02-May-12 (creation) # # Symbolic mathematical expression checker for edX. Uses sympy to check for expression equality. # # Takes in math expressions given as Presentation MathML (from ASCIIMathML), converts to Content MathML using Snuggl...
agpl-3.0
ingmar-k/2.6.31.14_OXNAS_kernel
scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
sivaramakrishnansr/ryu
ryu/lib/type_desc.py
8
2946
# Copyright (C) 2015 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2015 YAMAMOTO Takashi <yamamoto at valinux co 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 # # http:...
apache-2.0
redhat-cip/hardware
hardware/smart_utils_info.py
1
2135
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
apache-2.0
takeshineshiro/django
django/core/cache/backends/base.py
145
9680
"Base Cache class." from __future__ import unicode_literals import time import warnings from django.core.exceptions import DjangoRuntimeWarning, ImproperlyConfigured from django.utils.module_loading import import_string class InvalidCacheBackendError(ImproperlyConfigured): pass class CacheKeyWarning(DjangoRun...
bsd-3-clause
jackytu/newbrandx
src/oscar/apps/dashboard/orders/app.py
49
2013
from django.conf.urls import url from oscar.core.application import Application from oscar.core.loading import get_class class OrdersDashboardApplication(Application): name = None default_permissions = ['is_staff', ] permissions_map = { 'order-list': (['is_staff'], ['partner.dashboard_access']), ...
bsd-3-clause
olsaki/ansible-modules-extras
cloud/vmware/vmware_datacenter.py
3
5370
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Joseph Callen <jcallen () csc.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 version 3 of the Li...
gpl-3.0
jmesteve/openerpseda
openerp/addons/project/report/__init__.py
444
1069
# -*- 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
sdphome/UHF_Reader
rfs/rootfs/usr/lib/python2.7/_abcoll.py
14
18415
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Abstract Base Classes (ABCs) for collections, according to PEP 3119. DON'T USE THIS MODULE DIRECTLY! The classes here should be imported via collections; they are defined here only to alleviate certain bootstrappin...
gpl-3.0
yanheven/neutron
neutron/tests/tempest/services/identity/v3/json/policy_client.py
24
2505
# Copyright 2013 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
ojengwa/oh-mainline
vendor/packages/twisted/twisted/application/strports.py
19
3134
# -*- test-case-name: twisted.test.test_strports -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Construct listening port services from a simple string description. @see: L{twisted.internet.endpoints.serverFromString} @see: L{twisted.internet.endpoints.clientFromString} """ import war...
agpl-3.0
ottermegazord/ottermegazord.github.io
sortify-master/seaborn/tests/test_algorithms.py
35
6607
import numpy as np from scipy import stats from ..external.six.moves import range import numpy.testing as npt from numpy.testing import assert_array_equal import nose.tools from nose.tools import assert_equal, raises from .. import algorithms as algo rs = np.random.RandomState(sum(map(ord, "test_algorithms"))) a_nor...
mit
Revanth47/addons-server
src/olympia/zadmin/models.py
3
10439
from decimal import Decimal import json import hashlib import caching from django.conf import settings from django.db import models from django.db.models import F from olympia import amo from olympia.amo.models import ModelBase from olympia.amo.urlresolvers import reverse from olympia.applications.models import AppV...
bsd-3-clause
jkyeung/XlsxWriter
xlsxwriter/test/comparison/test_chart_combined08.py
1
2754
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """...
bsd-2-clause
open-pli/enigma2
lib/python/Components/MediaPlayer.py
32
3735
from MenuList import MenuList from Tools.Directories import SCOPE_CURRENT_SKIN, resolveFilename from os import path from enigma import eListboxPythonMultiContent, RT_VALIGN_CENTER, gFont, eServiceCenter from Tools.LoadPixmap import LoadPixmap import skin STATE_PLAY = 0 STATE_PAUSE = 1 STATE_STOP = 2 STATE_REWIND = ...
gpl-2.0
floresconlimon/qutebrowser
tests/unit/misc/test_lineparser.py
8
6158
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2015 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 Softwa...
gpl-3.0
skg-net/ansible
lib/ansible/modules/cloud/rackspace/rax_clb_nodes.py
95
8230
#!/usr/bin/python # Copyright: 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 ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
ivotron/teuthology
teuthology/task/pexec.py
10
4274
""" Handle parallel execution on remote hosts """ import logging from teuthology import misc as teuthology from teuthology.parallel import parallel from teuthology.orchestra import run as tor log = logging.getLogger(__name__) from gevent import queue as queue from gevent import event as event def _init_barrier(barr...
mit
GoogleCloudPlatform/stackdriver-metrics-export
get_timeseries/config.py
1
1308
#!/usr/bin/env python # Copyright 2019 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
geraldoandradee/pytest
_pytest/python.py
1
72287
""" Python test discovery, setup and run of test functions. """ import py import inspect import sys import pytest from _pytest.main import getfslineno from _pytest.mark import MarkDecorator, MarkInfo from _pytest.monkeypatch import monkeypatch from py._code.code import TerminalRepr import _pytest cutdir = py.path.loca...
mit
jaryn/packstack
packstack/installer/setup_controller.py
7
5428
""" Controller class is a SINGLETON which handles all groups, params, sequences, steps and replaces the CONF dictionary. """ from .core.parameters import Group from .core.sequences import Sequence def steps_new_format(steplist): # we have to duplicate title to name parameter and also only sigle # function is ...
apache-2.0
fafaman/scrapy
tests/__init__.py
95
1154
""" tests: this package contains all Scrapy unittests see http://doc.scrapy.org/en/latest/contributing.html#running-tests """ import os # ignore system-wide proxies for tests # which would send requests to a totally unsuspecting server # (e.g. because urllib does not fully understand the proxy spec) os.environ['http...
bsd-3-clause
dmitriy0611/django
tests/sitemaps_tests/test_http.py
46
10727
from __future__ import unicode_literals import os from datetime import date from unittest import skipUnless from django.apps import apps from django.conf import settings from django.contrib.sitemaps import GenericSitemap, Sitemap from django.contrib.sites.models import Site from django.core.exceptions import Improper...
bsd-3-clause
SeedScientific/luigi
test/db_task_history_test.py
25
4338
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
apache-2.0
varunarya10/tempest-lib
tempest_lib/tests/fake_identity.py
20
4526
# Copyright 2014 IBM Corp. # 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...
apache-2.0
hanicker/odoo
openerp/tools/parse_version.py
380
4462
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
jordanpina/Hax
node_modules/node-gyp/gyp/pylib/gyp/common.py
1292
20063
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from __future__ import with_statement import collections import errno import filecmp import os.path import re import tempfile import sys # A minimal memoizing d...
mit
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/xblock/django/request.py
10
4573
"""Helpers for WebOb requests and responses.""" import webob from collections import MutableMapping from lazy import lazy from itertools import chain, repeat, izip from webob.multidict import MultiDict, NestedMultiDict, NoVars def webob_to_django_response(webob_response): """Returns a django response to the `web...
agpl-3.0
ostcar/OpenSlides
server/tests/unit/agenda/test_views.py
5
5173
from unittest import TestCase from unittest.mock import MagicMock, patch import pytest from openslides.agenda.views import ListOfSpeakersViewSet class ListOfSpeakersViewSetManageSpeaker(TestCase): """ Tests views of ListOfSpeakersViewSet to manage speakers. """ def setUp(self): self.request...
mit
Karel-van-de-Plassche/PF2q
pf2q/tools.py
1
9139
#! /usr/bin/env python # -*- coding: utf-8 -*- """ This module contains tools miscellaneous tools used throughout the PF2q module. It also contains some deprecated functions that you can use at your own risk. @author: Karel van de Plassche @licence: GPLv3 """ import os import warnings from math import ceil import num...
gpl-3.0
nilbody/h2o-3
h2o-py/tests/testdir_algos/deeplearning/pyunit_iris_grid_deeplearning.py
2
1446
from __future__ import print_function from builtins import map from builtins import range import sys sys.path.insert(1,"../../../") import h2o from tests import pyunit_utils import itertools from h2o.grid.grid_search import H2OGridSearch from h2o.estimators.deeplearning import H2ODeepLearningEstimator from collections ...
apache-2.0
Robpol86/FlashAirMusic
tests/test_convert_discover.py
1
6956
"""Test functions in module.""" import json import os import time import pytest from mutagen.id3 import COMM, ID3 from flash_air_music.convert import discover, id3_flac_tags from tests import HERE @pytest.mark.parametrize('mode', ['no target', 'no prev metadata', 'st', 'ss', 'tt', 'ts', 'up to date']) def test_son...
mit
veg/idepi
idepi/__init__.py
3
1108
# # idepi :: (IDentify EPItope) python libraries containing some useful machine # learning interfaces for regression and discrete analysis (including # cross-validation, grid-search, and maximum-relevance/mRMR feature selection) # and utilities to help identify neutralizing antibody epitopes via machine # learning. # #...
gpl-3.0
mims2707/bite-project
deps/gdata-python-client/samples/apps/marketplace_sample/gdata/gauth.py
22
58099
#!/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