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
EvanK/ansible-modules-extras
cloud/lxc/lxc_container.py
9
56678
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Kevin Carter <kevin.carter@rackspace.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...
gpl-3.0
jpmpentwater/cvxpy
cvxpy/interface/numpy_interface/sparse_matrix_interface.py
11
3787
""" Copyright 2013 Steven Diamond This file is part of CVXPY. CVXPY 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. CVXPY is distributed i...
gpl-3.0
TheBraveWarrior/pyload
module/plugins/captcha/CoinHive.py
4
4503
# -*- coding: utf-8 -*- import re from ..internal.CaptchaService import CaptchaService class CoinHive(CaptchaService): __name__ = 'CoinHive' __type__ = 'captcha' __version__ = '0.01' __status__ = 'testing' __description__ = 'CoinHive captcha service plugin' __license__ = 'GPLv3' __author...
gpl-3.0
alirizakeles/zato
code/zato-web-admin/src/zato/admin/static/brython/_brython/Lib/importlib/basehook.py
7
1415
from javascript import JSObject from browser import window import urllib.request class TempMod: def __init__(self, name): self.name=name #define my custom import hook (just to see if it get called etc). class BaseHook: def __init__(self, fullname=None, path=None): self._fullname=fullname ...
gpl-3.0
willhardy/django
tests/view_tests/models.py
281
1329
""" Regression tests for Django built-in views. """ from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Author(models.Model): name = models.CharField(max_length=100) def __str__(self): return self.name def get_absolute_ur...
bsd-3-clause
jpoirier/linux
tools/perf/scripts/python/event_analyzing_sample.py
4719
7393
# event_analyzing_sample.py: general event handler in python # # Current perf report is already very powerful with the annotation integrated, # and this script is not trying to be as powerful as perf report, but # providing end user/developer a flexible way to analyze the events other # than trace points. # # The 2 dat...
gpl-2.0
jfchevrette/ansible-modules-core
commands/raw.py
32
1845
# this is a virtual module that is entirely implemented server side DOCUMENTATION = ''' --- module: raw version_added: historical short_description: Executes a low-down and dirty SSH command options: free_form: description: - the raw module takes a free form command to run required: true executable: ...
gpl-3.0
waynesun09/virt-test
virttest/element_path.py
28
6054
# # ElementTree # $Id: ElementPath.py 1858 2004-06-17 21:31:41Z Fredrik $ # # limited xpath support for element trees # # history: # 2003-05-23 fl created # 2003-05-28 fl added support for // etc # 2003-08-27 fl fixed parsing of periods in element names # # Copyright (c) 2003-2004 by Fredrik Lundh. All rights re...
gpl-2.0
Spleen64/Sick-Beard
lib/tvdb_api/tvdb_exceptions.py
28
1249
#!/usr/bin/env python #encoding:utf-8 #author:dbr/Ben #project:tvdb_api #repository:http://github.com/dbr/tvdb_api #license:unlicense (http://unlicense.org/) """Custom exceptions used or raised by tvdb_api """ __author__ = "dbr/Ben" __version__ = "1.8.2" __all__ = ["tvdb_error", "tvdb_userabort", "tvdb_shownotfound"...
gpl-3.0
wiedzmin/python-cudet
util/build-md5-database-from-files.py
5
2416
#!/usr/bin/python import csv import sqlite3 import os db = sqlite3.connect(':memory:') cur = db.cursor() release = '6.0' with open('../db/versions/'+release+'/versions.tsv','r') as file: reader = csv.reader(file, delimiter='\t') cur.execute(''' CREATE TABLE versions ( id INTEGER, ...
gpl-2.0
framon/samba
lib/testtools/testtools/matchers/_basic.py
12
8869
# Copyright (c) 2009-2012 testtools developers. See LICENSE for details. __all__ = [ 'Contains', 'EndsWith', 'Equals', 'GreaterThan', 'Is', 'IsInstance', 'LessThan', 'MatchesRegex', 'NotEquals', 'StartsWith', ] import operator from pprint import pformat import re from ..co...
gpl-3.0
Endika/edx-platform
lms/djangoapps/courseware/tests/test_grades.py
3
19262
""" Test grade calculation. """ from django.http import Http404 from django.test import TestCase from django.test.client import RequestFactory from mock import patch, MagicMock from nose.plugins.attrib import attr from opaque_keys.edx.locations import SlashSeparatedCourseKey from opaque_keys.edx.locator import CourseL...
agpl-3.0
azumimuo/family-xbmc-addon
script.module.youtube.dl/lib/youtube_dl/extractor/cultureunplugged.py
64
2508
from __future__ import unicode_literals import re import time from .common import InfoExtractor from ..utils import ( int_or_none, HEADRequest, ) class CultureUnpluggedIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?cultureunplugged\.com/documentary/watch-online/play/(?P<id>\d+)(?:/(?P<display_id>[...
gpl-2.0
sadleader/odoo
openerp/fields.py
4
70751
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-2014 OpenERP (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
neumerance/cloudloon2
.venv/lib/python2.7/site-packages/cinderclient/v1/shell.py
2
29941
# Copyright 2010 Jacob Kaplan-Moss # Copyright 2011 OpenStack LLC. # 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/...
apache-2.0
mariocannistra/radio-astronomy
findsessionrange.py
1
1973
#!/usr/bin/python # this source is part of my Hackster.io project: https://www.hackster.io/mariocannistra/radio-astronomy-with-rtl-sdr-raspberrypi-and-amazon-aws-iot-45b617 # this program will determine the overall range of signal strengths received during the whole session. # this program can be run standalone bu...
mit
mhnatiuk/phd_sociology_of_religion
scrapper/lib/python2.7/site-packages/twisted/python/systemd.py
42
2784
# -*- test-case-name: twisted.python.test.test_systemd -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Integration with systemd. Currently only the minimum APIs necessary for using systemd's socket activation feature are supported. """ __all__ = ['ListenFDs'] from os import getpid ...
gpl-2.0
Omegaphora/external_chromium_org
tools/usb_gadget/gadget_test.py
58
9866
#!/usr/bin/python # 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 import mock import gadget import usb_constants import usb_descriptors device_desc = usb_descriptors.DeviceDescriptor( ...
bsd-3-clause
jmesteve/openerpseda
openerp/addons/base/res/res_partner.py
10
40033
# -*- 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 GNU...
agpl-3.0
r39132/airflow
airflow/operators/check_operator.py
1
9963
# -*- 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 #...
apache-2.0
j-carl/boto
tests/unit/dynamodb/test_layer2.py
114
4826
#!/usr/bin/env python # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. 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 ...
mit
jonashaag/django-nonrel-nohistory
tests/modeltests/many_to_many/tests.py
92
17756
from django.test import TestCase from models import Article, Publication class ManyToManyTests(TestCase): def setUp(self): # Create a couple of Publications. self.p1 = Publication.objects.create(id=None, title='The Python Journal') self.p2 = Publication.objects.create(id=None, title='Scien...
bsd-3-clause
cloudnautique/python-agent
cattle/plugins/docker/network/setup.py
2
1451
import logging from ..util import net_util from ..compute import DockerCompute from cattle.agent.handler import BaseHandler log = logging.getLogger('docker') class NetworkSetup(BaseHandler): def __init__(self): self.compute = DockerCompute() pass def before_start(self, instance, host, confi...
apache-2.0
timokoola/hslbot
concurrent/futures/process.py
31
14894
# Copyright 2009 Brian Quinlan. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Implements ProcessPoolExecutor. The follow diagram and text describe the data-flow through the system: |======================= In-process =====================|== Out-of-process ==| +----------+ +----------...
apache-2.0
912/M-new
virtualenvironment/experimental/lib/python2.7/site-packages/django/db/backends/oracle/schema.py
15
4248
import copy import datetime from django.utils import six from django.db.backends.schema import BaseDatabaseSchemaEditor from django.db.utils import DatabaseError class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): sql_create_column = "ALTER TABLE %(table)s ADD %(column)s %(definition)s" sql_alter_column_t...
gpl-2.0
rwaldron/Espruino
boards/STM32F429IDISCOVERY.py
1
5051
#!/bin/false # This file is part of Espruino, a JavaScript interpreter for Microcontrollers # # Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk> # # 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 h...
mpl-2.0
halwai/cvxpy
cvxpy/tests/test_mip_vars.py
12
3693
""" Copyright 2013 Steven Diamond, Eric Chu This file is part of CVXPY. CVXPY 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. CVXPY is dis...
gpl-3.0
erdc-cm/air-water-vv
2d/numericalTanks/linearWaves/ls_p.py
4
1048
from proteus.default_p import * from proteus.mprans import NCLS from proteus import Context ct = Context.get() domain = ct.domain nd = domain.nd mesh = domain.MeshOptions genMesh = mesh.genMesh movingDomain = ct.movingDomain T = ct.T LevelModelType = NCLS.LevelModel coefficients = NCLS.Coefficients(V_model=int(ct....
mit
ininex/geofire-python
resource/lib/python2.7/site-packages/flask/logging.py
122
2751
# -*- coding: utf-8 -*- """ flask.logging ~~~~~~~~~~~~~ Implements the logging support for Flask. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import sys from werkzeug.local import LocalProxy from logging import ...
mit
allaboutbit/Cludcoin-project
share/qt/extract_strings_qt.py
2945
1844
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt4 stringdefs so that they can be picked up by Qt linguist. ''' from subprocess import Popen, PIPE import glob import operator OUT_CPP="src/qt/bitcoinstrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' format produced by x...
mit
tefasmile/Mi_Blog
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/styles/emacs.py
364
2486
# -*- coding: utf-8 -*- """ pygments.styles.emacs ~~~~~~~~~~~~~~~~~~~~~ A highlighting style for Pygments, inspired by Emacs. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import ...
mit
chongtianfeiyu/kbengine
kbe/src/lib/python/Lib/test/test_xdrlib.py
162
1596
from test import support import unittest import xdrlib class XDRTest(unittest.TestCase): def test_xdr(self): p = xdrlib.Packer() s = b'hello world' a = [b'what', b'is', b'hapnin', b'doctor'] p.pack_int(42) p.pack_int(-17) p.pack_uint(9) p.pack_bool(True) ...
lgpl-3.0
jamiecurle/django-omblog
omblog/templatetags/omblog_tags.py
2
2249
from django import template from django.utils.safestring import mark_safe from omblog.forms import CreatePostForm register = template.Library() @register.inclusion_tag('omblog/_create_form.html', takes_context=True) def create_form(context): return{ 'form': CreatePostForm(), 'context': context} ...
bsd-3-clause
pchmieli/h2o-3
h2o-py/tests/testdir_algos/glm/pyunit_DEPRECATED_covtypeGLM.py
2
1155
import sys sys.path.insert(1,"../../../") import h2o from tests import pyunit_utils import random def covtype(): # Log.info("Importing covtype.20k.data...\n") covtype = h2o.import_file(path=pyunit_utils.locate("smalldata/covtype/covtype.20k.data")) # myY = 54 myX = [x for x in range(0,54) if x not...
apache-2.0
Yukarumya/Yukarum-Redfoxes
testing/web-platform/tests/old-tests/webdriver/user_input/clear_test.py
142
2601
# -*- mode: python; fill-column: 100; comment-column: 100; -*- import os import sys import unittest sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../.."))) import base_test from selenium.common import exceptions class ElementClearTest(base_test.WebDriverBaseTest): def test_writable_text_input_eleme...
mpl-2.0
fernandog/Medusa
ext/boto/gs/__init__.py
265
1076
# Copyright 2010 Google Inc. # # 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 use, copy, modify, merge, publish, dis- # trib...
gpl-3.0
pavlova-marina/QGIS
python/plugins/processing/tests/ParametersTest.py
21
3292
# -*- coding: utf-8 -*- """ *************************************************************************** ParametersTest.py --------------------- Date : March 2013 Copyright : (C) 2013 by Victor Olaya Email : volayaf at gmail dot com *************************...
gpl-2.0
broferek/ansible
lib/ansible/module_utils/network/junos/facts/l2_interfaces/l2_interfaces.py
21
4662
# # -*- coding: utf-8 -*- # Copyright 2019 Red Hat # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) """ The junos l2_interfaces fact class It is in this file the configuration is collected from the device for a given resource, parsed, and the facts tree is populated based o...
gpl-3.0
nzavagli/UnrealPy
UnrealPyEmbed/Source/Python/Lib/python27/test/test_with.py
45
26417
"""Unit tests for the with statement specified in PEP 343.""" __author__ = "Mike Bland" __email__ = "mbland at acm dot org" import sys import unittest from collections import deque from contextlib import GeneratorContextManager, contextmanager from test.test_support import run_unittest class MockContextManager(Gen...
mit
unode/jug
jug/hooks/register.py
2
2374
# Copyright (C) 2014-2015, Luis Pedro Coelho <luis@luispedro.org> # vim: set ts=4 sts=4 sw=4 expandtab smartindent: # License: MIT _hooks = {} _known_hooks = frozenset([ 'execute.task-loadable', 'execute.task-executed1', 'execute.task-pre-execute', 'execute.finished_pre_status', ...
mit
dongguangming/pexpect
examples/topip.py
20
10535
#!/usr/bin/env python ''' This runs netstat on a local or remote server. It calculates some simple statistical information on the number of external inet connections. It groups by IP address. This can be used to detect if one IP address is taking up an excessive number of connections. It can also send an email alert i...
isc
luzfcb/pip
pip/wheel.py
5
30496
""" Support for installing and building the "wheel" binary package format. """ from __future__ import absolute_import import compileall import csv import errno import functools import hashlib import logging import os import os.path import re import shutil import stat import sys import tempfile import warnings from ba...
mit
BonexGu/Blik2D-SDK
Blik2D/addon/tensorflow-1.2.1_for_blik/tensorflow/contrib/saved_model/python/saved_model/signature_def_utils_test.py
64
8192
# Copyright 2015 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...
mit
qubitcoin/QubitCoin-p2pool
p2pool/__init__.py
278
1595
import os import re import sys import traceback import subprocess def check_output(*popenargs, **kwargs): process = subprocess.Popen(stdout=subprocess.PIPE, *popenargs, **kwargs) output, unused_err = process.communicate() retcode = process.poll() if retcode: raise ValueError((retcode, output)) ...
gpl-3.0
tomkralidis/QGIS
tests/src/python/test_db_manager_spatialite.py
15
26599
# -*- coding: utf-8 -*- """QGIS Unit tests for the DBManager SPATIALITE plugin .. 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...
gpl-2.0
geminy/aidear
oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/testing/scripts/webkit_python_tests.py
7
1156
#!/usr/bin/env python # Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import json import os import sys import common def main_run(args): with common.temporary_file() as tempfile_path: rc = common...
gpl-3.0
TAMU-CPT/galaxy-tools
tools/genome_viz/brigaid.py
1
36126
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ AUTHOR Pedro Cerqueira github: @pedrorvc DESCRIPTION This script serves to create xml files contaning the information necessary for the execution of BRIG (Blast Ring Image Generator), reducing the time performing the tedious task of setting u...
gpl-3.0
pongem/python-bot-project
appengine/standard/botapp/lib/django/contrib/gis/admin/widgets.py
73
4807
import logging from django.contrib.gis.gdal import GDALException from django.contrib.gis.geos import GEOSException, GEOSGeometry from django.forms.widgets import Textarea from django.template import loader from django.utils import six, translation # Creating a template context that contains Django settings # values n...
apache-2.0
dvliman/jaikuengine
.google_appengine/lib/django-1.5/tests/regressiontests/admin_views/models.py
43
17694
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime import tempfile import os from django.contrib.auth.models import User from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from django.core.files.storage import FileSystemStorage from ...
apache-2.0
pombredanne/pants
contrib/node/tests/python/pants_test/contrib/node/tasks/test_node_repl_integration.py
16
2459
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from textwrap import...
apache-2.0
YanjieGao/sparrow
deploy/third_party/boto-2.1.1/boto/mashups/order.py
101
7564
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # 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 use, copy, modi...
apache-2.0
mdeemer/XlsxWriter
xlsxwriter/test/workbook/test_workbook03.py
8
1798
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # import unittest from ...compatibility import StringIO from ..helperfunctions import _xml_to_list from ...workbook import Workbook class TestAssem...
bsd-2-clause
yuanagain/seniorthesis
venv/lib/python2.7/site-packages/matplotlib/tests/test_basic.py
7
1290
from __future__ import (absolute_import, division, print_function, unicode_literals) from matplotlib.externals import six from nose.tools import assert_equal from matplotlib.testing.decorators import knownfailureif from pylab import * def test_simple(): assert_equal(1 + 1, 2) @knownfa...
mit
dansantee/OctoPrint
src/octoprint/server/api/connection.py
37
3313
# coding=utf-8 from __future__ import absolute_import __author__ = "Gina Häußge <osd@foosel.net>" __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' __copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License" from flask import request, j...
agpl-3.0
GaneshPandey/alex-scraper
alexscrapper/spiders/luckyshops_spider.py
1
3002
# -*- coding: utf-8 -*- import scrapy from scrapy.http import Request, FormRequest from scrapy.spiders import CrawlSpider from alexscrapper.items import * from datetime import datetime from scrapy.conf import settings import urllib import csv import json import re from datetime import datetime, timedelta from dateutil...
gpl-3.0
janewilson90/auchtermuchty
node_modules/node-gyp/gyp/pylib/gyp/input_test.py
1841
3207
#!/usr/bin/env python # Copyright 2013 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. """Unit tests for the input.py file.""" import gyp.input import unittest import sys class TestFindCycles(unittest.TestCase): def setUp(self...
gpl-2.0
JVillella/tensorflow
tensorflow/contrib/testing/__init__.py
178
1066
# Copyright 2015 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...
apache-2.0
jrsmith3/gits
test/test_fs_utils.py
1
6045
# -*- coding: utf-8 -*- import os import shutil import unittest from gits import fs_utils test_dir_root = os.path.dirname(os.path.realpath(__file__)) class MethodsInput(unittest.TestCase): """ Tests behavior of methods which take input arguments. """ scratch_dir = os.path.join(test_dir_root, "scratch"...
mit
fooelisa/ansible-modules-extras
system/open_iscsi.py
50
11954
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Serge van Ginderachter <serge@vanginderachter.be> # # 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 vers...
gpl-3.0
AMOboxTV/AMOBox.LegoBuild
plugin.video.specto/resources/lib/resolvers/exashare.py
23
1135
# -*- coding: utf-8 -*- ''' Specto Add-on Copyright (C) 2015 lambda 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 l...
gpl-2.0
ntuecon/server
pyenv/Lib/site-packages/zope/interface/tests/advisory_testing.py
57
1260
############################################################################## # # Copyright (c) 2003 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
bsd-3-clause
luca-morreale/reinforcement-gym
generalizer/state_generalizer.py
1
1668
# -*- coding: utf-8 -*- import numpy as np from state_action import StateAction class StateGeneralizer: """ Creates the Generalizer. Args: updater: object in charge of update the value of actions """ def __init__(self, m): self.Q = {} self.m = m def getRepresentation(s...
gpl-3.0
kennethgillen/ansible
lib/ansible/plugins/action/dellos6_config.py
111
4194
# Copyright 2015 Peter Sprygada <psprygada@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 version 3 of the License, or # (at your option) any l...
gpl-3.0
asoplata/dynasim-benchmark-brette-2007
Brian2/brian2_benchmark_COBAHH_nosyn_compiled_500.py
1
3481
""" # Notes: - This simulation seeks to emulate the COBAHH benchmark simulations of (Brette et al. 2007) using the Brian2 simulator for speed benchmark comparison to DynaSim. However, this simulation does NOT include synapses, for better comparison to Figure 5 of (Goodman and Brette, 2008) - although it uses the...
gpl-3.0
donkirkby/donimoes
test_queued_board.py
2
4362
from unittest import TestCase from domino_puzzle import Domino from queued_board import QueuedBoard from test_domino_puzzle import DummyRandom class QueuedBoardTest(TestCase): def test_create(self): state = """\ 0 1|2 - 1 0|0 === 4 5 - - 5 6 """ expected_queue = [Domino(4, 5), Domino(5, 6)] ...
mit
LilithWittmann/bootev-tickets
tickets/conference/migrations/0001_initial.py
1
1388
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.Create...
gpl-2.0
zander/bitcoinclassic
contrib/devtools/symbol-check.py
4
6097
#!/usr/bin/python2 # Copyright (c) 2014 Wladimir J. van der Laan # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' A script to check that the (Linux) executables produced by gitian only contain allowed gcc, glibc and libstdc++ ve...
mit
binarydud/django-logicaldelete
docs/source/conf.py
5
6397
# -*- coding: utf-8 -*- # # django-logicaldelete documentation build configuration file, created by # sphinx-quickstart on Fri Mar 12 00:48:02 2010. # # 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 ...
bsd-3-clause
eamonnbell/cltk
cltk/tests/test_stop.py
4
2689
"""Test cltk.stop.""" __author__ = 'Kyle P. Johnson <kyle@kyle-p-johnson.com>' __license__ = 'MIT License. See LICENSE.' from cltk.corpus.utils.importer import CorpusImporter from cltk.stop.greek.stops import STOPS_LIST as GREEK_STOPS from cltk.stop.latin.stops import STOPS_LIST as LATIN_STOPS from nltk.tokenize.punk...
mit
goodwinnk/intellij-community
python/lib/Lib/site-packages/django/shortcuts/__init__.py
71
4248
""" This module collects helper functions and classes that "span" multiple levels of MVC. In other words, these functions/classes introduce controlled coupling for convenience's sake. """ from django.template import loader, RequestContext from django.http import HttpResponse, Http404 from django.http import HttpRespon...
apache-2.0
jwelker110/p4-conference-central
Lesson_4/00_Conference_Central/utils.py
384
1576
import json import os import time import uuid from google.appengine.api import urlfetch from models import Profile def getUserId(user, id_type="email"): if id_type == "email": return user.email() if id_type == "oauth": """A workaround implementation for getting userid.""" auth = os.ge...
gpl-3.0
stggh/PyAbel
abel/tools/circularize.py
2
12563
# -*- coding: utf-8 -*- from __future__ import division import numpy as np from scipy import ndimage from scipy.interpolate import UnivariateSpline from scipy.optimize import leastsq import abel ######################################################################### # circularize.py # # Image circularization by fol...
mit
40223149/2015springfinal
static/Brython3.1.1-20150328-091302/Lib/itertools.py
630
16041
import operator class accumulate: def __init__(self, iterable, func = operator.add): self.it = iter(iterable) self._total = None self.func = func def __iter__(self): return self def __next__(self): if not self._total: self._total = next(self.it)...
gpl-3.0
punitvara/linux-1
tools/perf/scripts/python/failed-syscalls-by-pid.py
1996
2233
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
gpl-2.0
ssdi-drive/nuxeo-drive
nuxeo-drive-client/nxdrive/engine/next/engine_next.py
1
1582
# coding: utf-8 """ Evolution to try new engine solution. """ from nxdrive.client.remote_document_client import RemoteDocumentClient from nxdrive.client.remote_file_system_client import RemoteFileSystemClient from nxdrive.client.remote_filtered_file_system_client import \ RemoteFilteredFileSystemClient from nxdriv...
lgpl-2.1
jianghuaw/nova
nova/tests/unit/scheduler/test_chance_scheduler.py
2
3641
# Copyright 2011 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
hellsgate1001/bookit
docs/env/Lib/site-packages/django/db/models/sql/datastructures.py
114
1853
""" Useful auxilliary data structures for query construction. Not useful outside the SQL domain. """ class EmptyResultSet(Exception): pass class MultiJoin(Exception): """ Used by join construction code to indicate the point at which a multi-valued join was attempted (if the caller wants to treat that ...
mit
AmI-2015/python-intermediate
metrics.py
1
2662
''' Created on Mar 19, 2014 @author: Dario Bonino <dario.bonino@gmail.com> Copyright (c) 2014 Dario Bonino 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/LICE...
apache-2.0
HelpMeRuth/Ruthless_Kernel
scripts/build-all.py
704
14699
#! /usr/bin/env python # Copyright (c) 2009-2014, The Linux Foundation. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # ...
gpl-2.0
scribblemaniac/MCEdit2Blender
blocks/Transparent.py
1
3837
import bpy import mathutils from Block import Block class Transparent(Block): """A block with a texture that contains transparent or translucent pixels""" def makeObject(self, x, y, z, metadata): mesh = bpy.data.meshes.new(name="Block") mesh.from_pydata([[-0.5,-0.5,-0.5],[0.5,-0.5,-0.5],[-...
gpl-3.0
nischalshrestha/recognize
lib/pyasn1/type/tag.py
162
4499
# ASN.1 types tags from operator import getitem from pyasn1 import error tagClassUniversal = 0x00 tagClassApplication = 0x40 tagClassContext = 0x80 tagClassPrivate = 0xC0 tagFormatSimple = 0x00 tagFormatConstructed = 0x20 tagCategoryImplicit = 0x01 tagCategoryExplicit = 0x02 tagCategoryUntagged = 0x04 class Tag: ...
mit
evolvedlight/statusmap
statusmap/database.py
30
2251
# -*- coding: utf-8 -*- """Database module, including the SQLAlchemy database object and DB-related utilities. """ from sqlalchemy.orm import relationship from .extensions import db from .compat import basestring # Alias common SQLAlchemy names Column = db.Column relationship = relationship class CRUDMixin(object): ...
bsd-3-clause
chetan51/neon
tests/grad_funcs.py
10
5513
# ---------------------------------------------------------------------------- # Copyright 2015 Nervana Systems Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
apache-2.0
nirvn/QGIS
python/plugins/processing/algs/qgis/IdwInterpolation.py
2
6770
# -*- coding: utf-8 -*- """ *************************************************************************** IdwInterpolation.py --------------------- Date : October 2016 Copyright : (C) 2016 by Alexander Bruy Email : alexander dot bruy at gmail dot com ********...
gpl-2.0
ambyte/Vertaler
src/modules/startupapp.py
1
2108
# -*- coding: utf-8 -*- # ---------------------------------------------------------------------------- # Copyright (c) 2011 Sergey Gulyaev <astraway@gmail.com> # # This file is part of Vertaler. # # Vertaler is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License ...
gpl-2.0
ChrisGoedhart/Uforia
source/django/contrib/gis/db/backends/spatialite/base.py
77
3463
from ctypes.util import find_library from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db.backends.sqlite3.base import ( _sqlite_extract, _sqlite_date_trunc, _sqlite_regexp, _sqlite_format_dtdelta, connection_created, Database, DatabaseWrapper as SQLiteDatabas...
gpl-2.0
SoCdesign/EHA
Tools/Minimization_Tool/essential_checker_extraction.py
1
7029
# copyright 2016 Siavoosh Payandeh Azad and Behrad Niazmand import package_file import copy def extract_checker_info(name_string): package_file.list_of_detection_info_sa0[name_string] = [] package_file.list_of_detection_info_sa1[name_string] = [] package_file.list_of_true_misses_sa0[name_string] = [] ...
gpl-3.0
miconof/CouchPotatoServer
libs/pyutil/test/out_of_shape/test_strutil.py
106
1713
#!/usr/bin/env python # Copyright (c) 2004-2009 Zooko "Zooko" Wilcox-O'Hearn # This file is part of pyutil; see README.rst for licensing terms. import unittest from pyutil.assertutil import _assert from pyutil import strutil class Teststrutil(unittest.TestCase): def test_short_input(self): self.failUnl...
gpl-3.0
snpabilonia/rgims
modules/tests/member/create_member.py
4
4125
# -*- coding: utf-8 -*- """ Sahana Eden Member Module Automated Tests @copyright: 2011-2012 (c) Sahana Software Foundation @license: MIT 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 th...
mit
valexandersaulys/prudential_insurance_kaggle
venv/lib/python2.7/site-packages/pandas/tests/test_algos.py
9
24744
# -*- coding: utf-8 -*- from pandas.compat import range import numpy as np from numpy.random import RandomState from pandas.core.api import Series, Categorical, CategoricalIndex import pandas as pd from pandas import compat import pandas.core.algorithms as algos import pandas.util.testing as tm import pandas.hashtab...
gpl-2.0
funkbit/django-funky-user
funky_user/managers.py
1
1568
from datetime import datetime from django.contrib.auth.models import BaseUserManager as DjangoBaseUserManager from django.utils import timezone class UserManager(DjangoBaseUserManager): """ Default manager for the User model. """ ################################### # Required Django manager meth...
bsd-2-clause
muzixing/ryu
ryu/app/simple_switch_14.py
20
3770
# Copyright (C) 2011 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...
apache-2.0
tdozat/Parser
dataset.py
1
5660
#!/usr/bin/env python # -*- coding: UTF-8 -*- # Copyright 2016 Timothy Dozat # # 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
hoytak/SFrame
oss_src/unity/python/sframe/test/test_dataframe.py
5
1775
''' Copyright (C) 2016 Turi All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. ''' import unittest import pandas import array from .. import SFrame from pandas.util.testing import assert_frame_equal from sys import version_info clas...
bsd-3-clause
mspark93/VTK
ThirdParty/Twisted/twisted/test/test_persisted.py
41
10220
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. # System Imports import sys from twisted.trial import unittest try: import cPickle as pickle except ImportError: import pickle try: import cStringIO as StringIO except ImportError: import StringIO # Twisted Imports from twist...
bsd-3-clause
SWENG500-Team1/FitnessForSplunk
misc/python-oauth2-test/python_server.py
1
1192
from bottle import route, run, request # Python server library import sys import httplib2, urllib import base64 # Hello World route example @route('/hello') def hello(): return "Hello World!" # Fitbit callback route @route('/auth/fitbit/callback') def fitbit_callback(): # Edit these variables to suit you...
mit
shreyasp/erpnext
erpnext/hr/doctype/expense_claim/test_expense_claim.py
7
2178
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors # See license.txt from __future__ import unicode_literals import frappe import unittest test_records = frappe.get_test_records('Expense Claim') class TestExpenseClaim(unittest.TestCase): def test_total_expense_claim_for_project(se...
gpl-3.0
bravomikekilo/mxconsole
mxconsole/protobuf/summary_pb2.py
1
18317
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: mxconsole/protobuf/summary.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import r...
apache-2.0
mgax/babel
tests/test_util.py
29
1047
# -*- coding: utf-8 -*- # # Copyright (C) 2007-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://babel.edgewall.org/wiki/License. # # This software consists...
bsd-3-clause
HEP-DL/root2hdf5
root2hdf5/plugins/larcv/pmt.py
1
1321
from root2hdf5.data_types.base import BaseData import numpy as np import logging class PMTData(BaseData): logger = logging.getLogger('root2hdf5.data_types.pmt') tree_name = 'image2d_pmt_tree' def __init__(self, _file, output_file): super(PMTData, self).__init__(_file) from larcv import larcv self.ar...
gpl-3.0