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
JeckoHeroOrg/three.js
utils/exporters/blender/addons/io_three/exporter/api/object.py
54
13118
import math import mathutils import bpy from bpy import data, context, types from bpy_extras.io_utils import axis_conversion from .. import constants, logger, utilities, exceptions from .constants import ( MESH, EMPTY, ARMATURE, LAMP, SPOT, SUN, POINT, HEMI, CAMERA, PERSP, OR...
mit
pjz/Zappa
test_settings.py
1
1325
APP_MODULE = 'tests.test_app' APP_FUNCTION = 'hello_world' DJANGO_SETTINGS = None DEBUG = 'True' LOG_LEVEL = 'DEBUG' SCRIPT_NAME = 'hello_world' DOMAIN = None API_STAGE = 'ttt888' PROJECT_NAME = 'ttt888' REMOTE_ENV='s3://lmbda/test_env.json' ## test_env.json #{ # "hello": "world" #} # AWS_EVENT_MAPPING = { 'arn:...
mit
dawagner/parameter-framework
test/functional-tests-legacy/ACTCampaignEngine.py
20
3241
#!/usr/bin/python2 # -*-coding:utf-8 -* # Copyright (c) 2011-2015, Intel Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above co...
bsd-3-clause
chokribr/invenio
invenio/ext/sqlalchemy/engines/mysql.py
12
6252
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2011, 2012, 2013, 2014 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your...
gpl-2.0
MariusCC/packstack
packstack/modules/ospluginutils.py
2
4613
import logging import os import re from packstack.installer import basedefs from packstack.installer.setup_controller import Controller from packstack.installer.exceptions import PackStackError controller = Controller() PUPPET_DIR = os.path.join(basedefs.DIR_PROJECT_DIR, "puppet") PUPPET_TEMPLATE_DIR = os.path.join...
apache-2.0
bak1an/django
tests/expressions/test_queryset_values.py
103
2622
from django.db.models.aggregates import Sum from django.db.models.expressions import F from django.test import TestCase from .models import Company, Employee class ValuesExpressionsTests(TestCase): @classmethod def setUpTestData(cls): Company.objects.create( name='Example Inc.', num_emplo...
bsd-3-clause
daira/tahoe-lafs-debian
src/allmydata/unknown.py
9
8348
from zope.interface import implements from twisted.internet import defer from allmydata.interfaces import IFilesystemNode, MustNotBeUnknownRWError, \ MustBeDeepImmutableError from allmydata import uri from allmydata.uri import ALLEGED_READONLY_PREFIX, ALLEGED_IMMUTABLE_PREFIX # See ticket #833 for design rationa...
gpl-2.0
freedomhui/cinder
cinder/tests/test_netapp_nfs.py
4
7564
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2012 NetApp, 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.or...
apache-2.0
bryceguo/robotframework-selenium2library
src/Selenium2Library/locators/tableelementfinder.py
33
3235
from selenium.common.exceptions import NoSuchElementException from Selenium2Library import utils from elementfinder import ElementFinder class TableElementFinder(object): def __init__(self, element_finder=None): if not element_finder: element_finder = ElementFinder() self._element_find...
apache-2.0
ujenmr/ansible
lib/ansible/modules/system/alternatives.py
50
5280
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2014, Gabe Mulley <gabe.mulley@gmail.com> # Copyright: (c) 2015, David Wittman <dwittman@gmail.com> # 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 _...
gpl-3.0
BayesianLogic/blog
tools/blog_py_lexer/blog/lexer.py
1
3373
from pygments.lexer import RegexLexer, bygroups, include from pygments.token import * class BlogLexer(RegexLexer): name = 'BLOG' aliases = ['blog'] filenames = ['*.blog', '*.dblog'] operators = ['\\-\\>', ':', '\\+', '\\-', '\\*', '/', '\\[', ']', '\\{', '}', '!', '\\<', '\\>', '\\<=', '\\>=', '==', ...
bsd-3-clause
ananthonline/grpc
src/python/grpcio/tests/unit/framework/face/testing/coverage.py
2
4002
# Copyright 2015, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
pombredanne/MOG
nova/tests/api/openstack/compute/plugins/v3/test_hypervisors.py
8
22884
# Copyright (c) 2012 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 ...
apache-2.0
Thoshh/wapad
lib/python2.7/site-packages/django/contrib/gis/maps/google/zoom.py
527
6676
from __future__ import unicode_literals from math import atan, exp, log, pi, sin from django.contrib.gis.geos import GEOSGeometry, LinearRing, Point, Polygon from django.contrib.gis.maps.google.gmap import GoogleMapException from django.utils.six.moves import range # Constants used for degree to radian conversion, a...
mit
technologiescollege/Blockly-rduino-communication
scripts/Lib/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py
9
1102
from __future__ import division from datetime import datetime from pip._vendor.cachecontrol.cache import BaseCache def total_seconds(td): """Python 2.6 compatability""" if hasattr(td, 'total_seconds'): return int(td.total_seconds()) ms = td.microseconds secs = (td.seconds + td.days * 24 * 36...
gpl-3.0
davidzchen/tensorflow
tensorflow/python/kernel_tests/sparse_reshape_op_test.py
6
17718
# 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 applica...
apache-2.0
terencehonles/mailman
src/mailman/handlers/replybot.py
3
5031
# Copyright (C) 1998-2012 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 you...
gpl-3.0
taliax/easybuild-easyblocks
easybuild/easyblocks/i/imkl.py
5
17376
# # # Copyright 2009-2015 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # the Hercules foundation (ht...
gpl-2.0
salguarnieri/intellij-community
python/lib/Lib/site-packages/django/core/mail/backends/console.py
308
1295
""" Email backend that writes messages to console instead of sending them. """ import sys import threading from django.core.mail.backends.base import BaseEmailBackend class EmailBackend(BaseEmailBackend): def __init__(self, *args, **kwargs): self.stream = kwargs.pop('stream', sys.stdout) self._loc...
apache-2.0
mancoast/CPythonPyc_test
cpython/260_test_call.py
90
3124
import unittest from test import test_support # The test cases here cover several paths through the function calling # code. They depend on the METH_XXX flag that is used to define a C # function, which can't be verified from Python. If the METH_XXX decl # for a C function changes, these tests may not cover the righ...
gpl-3.0
haematologic/cellcounter
cellcounter/accounts/views.py
1
7496
from braces.views import LoginRequiredMixin from django.contrib import messages from django.contrib.auth import authenticate, login from django.contrib.auth.forms import PasswordChangeForm from django.contrib.auth.forms import SetPasswordForm from django.contrib.auth.models import User from django.contrib.auth.tokens i...
mit
alrusdi/lettuce
tests/integration/lib/Django-1.2.5/django/core/management/commands/reset.py
81
2273
from optparse import make_option from django.conf import settings from django.core.management.base import AppCommand, CommandError from django.core.management.color import no_style from django.core.management.sql import sql_reset from django.db import connections, transaction, DEFAULT_DB_ALIAS class Command(AppComman...
gpl-3.0
rohitwaghchaure/digitales_erpnext
erpnext/accounts/report/budget_variance_report/budget_variance_report.py
1
4804
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _, msgprint from frappe.utils import flt from frappe.utils import formatdate import time from erpnext.accounts.utils...
agpl-3.0
blueburningcoder/pybrain
pybrain/structure/modules/statedependentlayer.py
25
3256
__author__ = 'Thomas Rueckstiess, ruecksti@in.tum.de' from scipy import random, asarray, zeros, dot from pybrain.structure.modules.neuronlayer import NeuronLayer from pybrain.tools.functions import expln, explnPrime from pybrain.structure.parametercontainer import ParameterContainer class StateDependentLayer(Neuron...
bsd-3-clause
dennisguse/pjsip
tests/pjsua/scripts-recvfrom/231_reg_bad_fail_stale_false_nonce_changed.py
42
1562
# $Id$ import inc_sip as sip import inc_sdp as sdp # In this test we simulate broken server, where: # - it wants to signal that NONCE has change # - but it sets stale=false # For this case pjsip will retry authentication until # PJSIP_MAX_STALE_COUNT is exceeded. # pjsua = "--null-audio --id=sip:CLIENT --registrar s...
gpl-2.0
lexman/tuttle
tests/test_log_follower.py
1
8283
# -*- coding: utf-8 -*- from tests.functional_tests import isolate, run_tuttle_file from cStringIO import StringIO from tuttle.log_follower import LogTracer, LogsFollower import logging import sys class CaptureOutputs(object): """ Captures stdin and stdout """ def __init__(self): self._oldout...
mit
JulyKikuAkita/PythonPrac
cs15211/LongestWordInDictionaryThroughDeleting.py
1
4177
__source__ = 'https://leetcode.com/problems/longest-word-in-dictionary-through-deleting/' # Time: O(nlogn + n*x), Sorting takes O(nlogn) and isSubsequence takes O(x) # Space: O(logn) Sorting takes O(logn) space in average case. # # Description: 524. Longest Word in Dictionary through Deleting # # Given a string and a ...
apache-2.0
rakeshmi/tempest
tempest/api/compute/admin/test_aggregates_negative.py
8
9415
# Copyright 2013 Huawei Technologies Co.,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 # # Unl...
apache-2.0
tbadgu/Barcamp-Bangalore-Android-App
gcm_flask/werkzeug/exceptions.py
84
16350
# -*- coding: utf-8 -*- """ werkzeug.exceptions ~~~~~~~~~~~~~~~~~~~ This module implements a number of Python exceptions you can raise from within your views to trigger a standard non-200 response. Usage Example ------------- :: from werkzeug.wrappers import BaseRequest ...
apache-2.0
uclouvain/osis_louvain
assessments/forms/score_file.py
1
1880
############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core ...
agpl-3.0
martinbuc/missionplanner
Lib/site-packages/scipy/fftpack/benchmarks/bench_basic.py
63
7559
""" Test functions for fftpack.basic module """ import sys from numpy.testing import * from scipy.fftpack import ifft, fft, fftn, irfft, rfft from numpy import arange, asarray, zeros, dot, exp, pi, double, cdouble import numpy.fft from numpy.random import rand def random(size): return rand(*size) def direct_dft(...
gpl-3.0
flwh/KK_mt6589_iq451
prebuilts/python/linux-x86/2.7.5/lib/python2.7/idlelib/dynOptionMenuWidget.py
160
1302
""" OptionMenu widget modified to allow dynamic menu reconfiguration and setting of highlightthickness """ from Tkinter import OptionMenu from Tkinter import _setit import copy class DynOptionMenu(OptionMenu): """ unlike OptionMenu, our kwargs can include highlightthickness """ def __init__(self, maste...
gpl-2.0
watonyweng/horizon
horizon/loaders.py
36
2340
# 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
hsharsha/perfrunner
perfrunner/tests/functional.py
1
1852
import unittest from perfrunner.__main__ import get_options from perfrunner.helpers.memcached import MemcachedHelper from perfrunner.helpers.remote import RemoteHelper from perfrunner.helpers.rest import RestHelper from perfrunner.settings import ClusterSpec, TestConfig from perfrunner.tests import TargetIterator cl...
apache-2.0
mfasq1Monash/FIT3140
interpreter.py
1
6491
''' Author: Michael Asquith, Aaron Gruneklee Created: 2014.12.08 Last Modified: 2014.12.23 Interpreter for a simple functional programming language. Access with interpret(command) Based on Peter Norvig's Lispy interpreter, http://norvig.com/lispy.html ''' import math, operator as op from robotio import RobotIO Symbo...
mit
pyfisch/servo
tests/wpt/web-platform-tests/webdriver/tests/find_element/user_prompts.py
24
3954
# META: timeout=long import pytest from tests.support.asserts import ( assert_error, assert_same_element, assert_success, assert_dialog_handled, ) from tests.support.inline import inline def find_element(session, using, value): return session.transport.send( "POST", "session/{session_id}...
mpl-2.0
nico01f/nifo.github.io
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexers/_phpbuiltins.py
95
122088
# -*- coding: utf-8 -*- """ pygments.lexers._phpbuiltins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This file loads the function names and their modules from the php webpage and generates itself. Do not alter the MODULES dict by hand! WARNING: the generation transfers quite much data over your ...
mit
scottrice/Ice
ice/tasks/engine.py
1
1118
# encoding: utf-8 import os from pysteam import paths as steam_paths from pysteam import shortcuts from pysteam import steam as steam_module from ice import backups from ice import configuration from ice import consoles from ice import emulators from ice import paths from ice import settings from ice.logs import log...
mit
Peddle/hue
desktop/core/ext-py/Django-1.6.10/django/utils/image.py
98
4983
# -*- coding: utf-8 -*- """ To provide a shim layer over Pillow/PIL situation until the PIL support is removed. Combinations To Account For =========================== * Pillow: * never has ``_imaging`` under any Python * has the ``Image.alpha_composite``, which may aid in detection * PIL * CPython 2....
apache-2.0
glidernet/python-ogn-client
tests/client/test_AprsClient.py
1
6185
import unittest import unittest.mock as mock from ogn.parser import parse from ogn.client.client import create_aprs_login, AprsClient from ogn.client.settings import APRS_APP_NAME, APRS_APP_VER, APRS_KEEPALIVE_TIME class AprsClientTest(unittest.TestCase): def test_create_aprs_login(self): basic_login = c...
agpl-3.0
mujiansu/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Tools/pynche/ChipViewer.py
94
4998
"""Chip viewer and widget. In the lower left corner of the main Pynche window, you will see two ChipWidgets, one for the selected color and one for the nearest color. The selected color is the actual RGB value expressed as an X11 #COLOR name. The nearest color is the named color from the X11 database that is closest ...
apache-2.0
TheWitchers/Team
TestingArea/TESTZONE_methods.py
1
1111
__author__ = 'dvir' import tkFileDialog import sqlite3 conn = sqlite3.connect(tkFileDialog.askopenfilename()) c = conn.cursor() # using example db def ex_show_purch(price): l = [] for row in c.execute("SELECT symbol FROM stocks WHERE price > " + str(price) + ""): print row l.append(row) p...
gpl-2.0
plaes/numpy
numpy/distutils/core.py
3
8524
import sys from distutils.core import * if 'setuptools' in sys.modules: have_setuptools = True from setuptools import setup as old_setup # easy_install imports math, it may be picked up from cwd from setuptools.command import easy_install try: # very old versions of setuptools don't have t...
bsd-3-clause
rudhir-upretee/SUMO_Src
tools/output/analyze_teleports.py
2
2664
#!/usr/bin/env python # -*- coding: utf-8 -*- """ @file analyze_teleports.py @author Jakob Erdmann @date 2012-11-20 @version $Id: analyze_teleports.py 13106 2012-12-02 13:44:57Z behrisch $ Extract statistics from the warning outputs of a simulation run for plotting. SUMO, Simulation of Urban MObility; see http...
gpl-3.0
kagayakidan/scikit-learn
examples/linear_model/plot_lasso_and_elasticnet.py
249
1982
""" ======================================== Lasso and Elastic Net for Sparse Signals ======================================== Estimates Lasso and Elastic-Net regression models on a manually generated sparse signal corrupted with an additive noise. Estimated coefficients are compared with the ground-truth. """ print(...
bsd-3-clause
cyberthrone/pupy
pupy/modules/socks5proxy.py
19
7572
# -*- coding: UTF8 -*- # -------------------------------------------------------------- # Copyright (c) 2015, Nicolas VERDIER (contact@n1nj4.eu) # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: # ...
bsd-3-clause
attilahorvath/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/validatereviewer.py
119
2894
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and th...
bsd-3-clause
avinashkunuje/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/adduserstogroups.py
124
3195
# Copyright (c) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
wendlers/edubot-snap
ext/requests/packages/chardet/eucjpprober.py
2919
3678
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org 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 Reserved. # # Con...
mit
kangkot/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/isapi/install.py
17
23014
"""Installation utilities for Python ISAPI filters and extensions.""" # this code adapted from "Tomcat JK2 ISAPI redirector", part of Apache # Created July 2004, Mark Hammond. import sys, os, imp, shutil, stat from win32com.client import GetObject, Dispatch from win32com.client.gencache import EnsureModule, EnsureDisp...
apache-2.0
wlonk/warehouse
tests/functional/pages/base.py
3
2225
# 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 the Li...
apache-2.0
Galax-e/laravel-enterprise-starter-kit
vendor/mockery/mockery/docs/conf.py
468
8442
# -*- coding: utf-8 -*- # # Mockery Docs documentation build configuration file, created by # sphinx-quickstart on Mon Mar 3 14:04:26 2014. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. ...
gpl-3.0
yavalvas/yav_com
build/matplotlib/lib/mpl_examples/pylab_examples/centered_ticklabels.py
6
1355
# sometimes it is nice to have ticklabels centered. mpl currently # associates a label with a tick, and the label can be aligned # 'center', 'left', or 'right' using the horizontal alignment property: # # # for label in ax.xaxis.get_xticklabels(): # label.set_horizontalalignment('right') # # # but this doesn't...
mit
ammarkhann/FinalSeniorCode
lib/python2.7/site-packages/sympy/series/tests/test_gruntz.py
51
15626
from sympy import Symbol, exp, log, oo, Rational, I, sin, gamma, loggamma, S, \ atan, acot, pi, cancel, E, erf, sqrt, zeta, cos, digamma, Integer, Ei, EulerGamma from sympy.functions.elementary.hyperbolic import cosh, coth, sinh, tanh from sympy.series.gruntz import compare, mrv, rewrite, mrv_leadterm, gruntz, \ ...
mit
MagicStack/asyncpg
asyncpg/transaction.py
1
8297
# Copyright (C) 2016-present the asyncpg authors and contributors # <see AUTHORS file> # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import enum from . import connresource from . import exceptions as apg_errors class TransactionState(e...
apache-2.0
y-zeng/grpc
src/python/grpcio_tests/tests/unit/_metadata_code_details_test.py
15
19823
# Copyright 2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
zangree/ryu
ryu/services/protocols/bgp/operator/commands/show/count.py
52
1840
import logging from ryu.services.protocols.bgp.operator.command import Command from ryu.services.protocols.bgp.operator.command import CommandsResponse from ryu.services.protocols.bgp.operator.command import STATUS_ERROR from ryu.services.protocols.bgp.operator.command import STATUS_OK from ryu.services.protocols.bgp....
apache-2.0
rnicoll/bitcoin
test/functional/feature_settings.py
30
3812
#!/usr/bin/env python3 # Copyright (c) 2017-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test various command line arguments and configuration file parameters.""" import json from pathlib im...
mit
AntonPalich/sublime-evernote
lib/pygments/formatters/rtf.py
9
4535
# -*- coding: utf-8 -*- """ pygments.formatters.rtf ~~~~~~~~~~~~~~~~~~~~~~~ A formatter that generates RTF files. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.formatter import Formatter __all__ = ['RtfFormatter'] ...
mit
turtledb/0install
zeroinstall/injector/qdom.py
1
3485
"""A quick DOM implementation. Python's xml.dom is very slow. The xml.sax module is also slow (as it imports urllib2). This is our light-weight version. """ # Copyright (C) 2009, Thomas Leonard # See the README file for details, or visit http://0install.net. from xml.parsers import expat import zeroinstall from zer...
lgpl-2.1
ychen820/microblog
y/google-cloud-sdk/platform/google_appengine/lib/django-1.4/django/views/decorators/vary.py
329
1197
from functools import wraps from django.utils.cache import patch_vary_headers from django.utils.decorators import available_attrs def vary_on_headers(*headers): """ A view decorator that adds the specified headers to the Vary header of the response. Usage: @vary_on_headers('Cookie', 'Accept-languag...
bsd-3-clause
rkharwar/ubuntu-saucy-powerpc
tools/perf/scripts/python/futex-contention.py
11261
1486
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PER...
gpl-2.0
Lukiqq/GT-I9100-Galaxian-ICS-Kernel
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
11088
3246
# Core.py - Python extension for perf script, core functions # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. from collections import defaultdict def aut...
gpl-2.0
thinkopensolutions/hr
hr_language/models/hr_language.py
23
1774
# -*- encoding: utf-8 -*- ############################################################################### # # OpenERP, Open Source Management Solution # Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). # # This program is free software: you can redistribute it and/or modify # it un...
agpl-3.0
andyh616/mne-python
mne/forward/_compute_forward.py
8
34968
# -*- coding: utf-8 -*- # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Matti Hamalainen <msh@nmr.mgh.harvard.edu> # Martin Luessi <mluessi@nmr.mgh.harvard.edu> # Eric Larson <larsoner@uw.edu> # Mark Wronkiewicz <wronk@uw.edu> # # License: BSD (3-clause) # #...
bsd-3-clause
agiliopadua/lammps
tools/i-pi/ipi/inputs/simulation.py
41
8482
"""Deals with creating the simulation class. Copyright (C) 2013, Joshua More and Michele Ceriotti 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)...
gpl-2.0
fkorotkov/pants
tests/python/pants_test/backend/jvm/tasks/test_classmap_integration.py
9
2536
# coding=utf-8 # Copyright 2016 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 pants_test.pant...
apache-2.0
darkleons/lama
addons/mrp_repair/wizard/__init__.py
445
1096
# -*- 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...
agpl-3.0
wileeam/airflow
tests/sensors/test_external_task_sensor.py
4
18108
# # 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...
apache-2.0
Mic92/ansible
contrib/inventory/nagios_ndo.py
213
3842
#!/usr/bin/env python # (c) 2014, Jonathan Lestrelin <jonathan.lestrelin@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 of the Licens...
gpl-3.0
bandit145/ans-between
src/dictops.py
1
1886
#TODO: allow missing params and args lists to pass tests from src import logging class dict_mgm: #creates ansible command to run def make_play(data,db_data,location): if dict_mgm.data_check(data, db_data) == 'OK': command = 'ansible-playbook {location}'.format(location=location) #did and incredi bad if else t...
mit
eufarn7sp/egads
egads/thirdparty/nappy/nc_interface/na_to_nc.py
2
3191
# Copyright (C) 2004 CCLRC & NERC( Natural Environment Research Council ). # This software may be distributed under the terms of the # Q Public License, version 1.0 or later. http://ndg.nerc.ac.uk/public_docs/QPublic_license.txt """ na_to_nc.py =========== Contains the NAToNC class for converting a NASA...
gpl-3.0
xwolf12/django
django/conf/locale/hr/formats.py
504
2106
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. E Y.' TIME_FORMAT = 'H:i' DATE...
bsd-3-clause
mne-tools/mne-tools.github.io
0.21/_downloads/ae7d4d6bcae82f99a78c3f8a0c94f7b0/plot_mne_inverse_envelope_correlation.py
3
4522
""" .. _ex-envelope-correlation: ============================================= Compute envelope correlations in source space ============================================= Compute envelope correlations of orthogonalized activity [1]_ [2]_ in source space using resting state CTF data. """ # Authors: Eric Larson <larso...
bsd-3-clause
broferek/ansible
lib/ansible/plugins/action/net_system.py
648
1057
# (c) 2017, Ansible Inc, # # 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 di...
gpl-3.0
titom1986/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/kickstarter.py
9
2230
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor class KickStarterIE(InfoExtractor): _VALID_URL = r'https?://www\.kickstarter\.com/projects/(?P<id>[^/]*)/.*' _TESTS = [{ 'url': 'https://www.kickstarter.com/projects/1404461844/intersection-the-stor...
gpl-3.0
indx/indx-core
lib/indx/webserver/handlers/app.py
2
5788
# Copyright (C) 2011-2013 University of Southampton # Copyright (C) 2011-2013 Daniel Alexander Smith # Copyright (C) 2011-2013 Max Van Kleek # Copyright (C) 2011-2013 Nigel R. Shadbolt # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Gener...
agpl-3.0
nbetcher/latte-2.6.35-crc
scripts/rt-tester/rt-tester.py
1094
5362
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # import os import sys import getopt import sh...
gpl-2.0
alwayskidd/LRB
bindings/python/rad_util.py
212
26013
# Copyright (c) 2007 RADLogic # # 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, distribut...
gpl-2.0
JNeiger/robocup-software
soccer/gameplay/tactics/one_touch_pass.py
2
4562
import composite_behavior import behavior import skills.move import tactics.coordinated_pass import robocup import constants import main import skills.angle_receive import evaluation.touchpass_positioning import evaluation.passing import evaluation.chipping import enum ## A tactic that causes a robot to pass to anoth...
apache-2.0
credativ/pulp
server/test/unit/server/db/migrations/test_0017_distributor_list_published.py
3
1618
from copy import deepcopy from datetime import datetime from unittest import TestCase from mock import patch, Mock, call from pulp.server.db.migrate.models import MigrationModule LAST_PUBLISH = 'last_publish' MIGRATION = 'pulp.server.db.migrations.0017_distributor_last_published' class TestMigration(TestCase): ...
gpl-2.0
GenericStudent/home-assistant
tests/components/openalpr_cloud/test_image_processing.py
13
6882
"""The tests for the openalpr cloud platform.""" import asyncio from homeassistant.components import camera, image_processing as ip from homeassistant.components.openalpr_cloud.image_processing import OPENALPR_API_URL from homeassistant.core import callback from homeassistant.setup import setup_component from tests.a...
apache-2.0
dvliman/jaikuengine
.google_appengine/lib/django-1.4/django/contrib/staticfiles/handlers.py
85
2316
import urllib from urlparse import urlparse from django.conf import settings from django.core.handlers.wsgi import WSGIHandler from django.contrib.staticfiles import utils from django.contrib.staticfiles.views import serve class StaticFilesHandler(WSGIHandler): """ WSGI middleware that intercepts calls to th...
apache-2.0
eino-makitalo/odoo
addons/account/report/account_aged_partner_balance.py
16
21514
# -*- 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
phense/check_duplicate_files
check_duplicate_files.py
1
21660
#!/usr/bin/env python # -*- coding: utf-8 -*- """check_duplicate_files.py Finds all duplicate files in given directories using a hash-algorithm. After scanning the filesystem for possible duplicate files (all files with a unique filesize are dismissed, except for Images when selecting the perceptual hash algorithm)....
apache-2.0
rds0751/colinkers
env/Lib/site-packages/wheel/util.py
345
4890
"""Utility functions.""" import sys import os import base64 import json import hashlib try: from collections import OrderedDict except ImportError: OrderedDict = dict __all__ = ['urlsafe_b64encode', 'urlsafe_b64decode', 'utf8', 'to_json', 'from_json', 'matches_requirement'] def urlsafe_b64encode(d...
agpl-3.0
BizzCloud/PosBox
addons/website_customer/__openerp__.py
52
1511
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP S.A. (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the term...
agpl-3.0
yg257/Pangea
lib/boto-2.34.0/tests/unit/vpc/test_vpngateway.py
114
8709
# -*- coding: UTF-8 -*- from tests.compat import OrderedDict from tests.unit import unittest from tests.unit import AWSMockServiceTestCase from boto.vpc import VPCConnection, VpnGateway, Attachment class TestDescribeVpnGateways(AWSMockServiceTestCase): connection_class = VPCConnection def default_body(self...
apache-2.0
petrpulc/git-cmp
checkers/references.py
1
1113
""" Reference level checker (existence of given references or all refs/heads ans refs/tags). """ from common import Common from utils import check_diff def __filter(reference_list): return set(reference for reference in reference_list if reference.split('/')[1] in ('heads', 'tags')) def check():...
mit
kubeflow/kfp-tekton
backend/api/python_http_client/kfp_server_api/__init__.py
1
3915
# coding: utf-8 # flake8: noqa """ Kubeflow Pipelines API This file contains REST API specification for Kubeflow Pipelines. The file is autogenerated from the swagger definition. Contact: kubeflow-pipelines@google.com Generated by: https://openapi-generator.tech """ from __future__ import absolute...
apache-2.0
dsquareindia/scikit-learn
examples/model_selection/plot_confusion_matrix.py
63
3231
""" ================ Confusion matrix ================ Example of confusion matrix usage to evaluate the quality of the output of a classifier on the iris data set. The diagonal elements represent the number of points for which the predicted label is equal to the true label, while off-diagonal elements are those that ...
bsd-3-clause
puzan/ansible
lib/ansible/modules/network/panos/panos_check.py
25
4104
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage PaloAltoNetworks Firewall # (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish...
gpl-3.0
Allow2CEO/browser-ios
brave/node_modules/ad-block/vendor/depot_tools/testing_support/git_test_utils.py
26
15715
# Copyright 2013 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 atexit import collections import copy import datetime import hashlib import os import shutil import subprocess import sys import tempfile import unitt...
mpl-2.0
vegetableman/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py
119
12170
# Copyright (C) 2012 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
noba3/KoTos
addons/script.module.youtube.dl/lib/youtube_dl/extractor/ubu.py
126
1719
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( int_or_none, qualities, ) class UbuIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?ubu\.com/film/(?P<id>[\da-z_-]+)\.html' _TEST = { 'url': 'http://ubu.com/film/her_noise.html', ...
gpl-2.0
Ravenm/2143-OOP-NASH
python3env/Lib/site-packages/pip/_vendor/requests/models.py
187
29277
# -*- coding: utf-8 -*- """ requests.models ~~~~~~~~~~~~~~~ This module contains the primary objects that power Requests. """ import collections import datetime from io import BytesIO, UnsupportedOperation from .hooks import default_hooks from .structures import CaseInsensitiveDict from .auth import HTTPBasicAuth ...
cc0-1.0
mikegagnon/sidenote
prefix-links.py
1
1725
#!/usr/bin/env python # # This is free and unencumbered software released into the public domain. # # Sometimes you want to include one sidenote document into another. # One way you could do that is copy the .md files from one project into another. # However, this creates a risk of link-tag collisions. I.e. one project...
unlicense
maxrosan/NS-3-support-for-OBS
bindings/python/apidefs/gcc-LP64/ns3_module_virtual_net_device.py
6
14172
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers def register_types(module): root_module = module.get_root() ## virtual-net-device.h: ns3::VirtualNetDevice [class] module.add_class('VirtualNetDevice', parent=root_module['ns3::NetDevice']) ## Register a nested ...
gpl-2.0
TheTacoScott/GoAtThrottleUp
ServerRelay/cherrypy/lib/auth.py
40
3142
import cherrypy from cherrypy.lib import httpauth def check_auth(users, encrypt=None, realm=None): """If an authorization header contains credentials, return True, else False.""" request = cherrypy.serving.request if 'authorization' in request.headers: # make sure the provided credentials are corr...
mit
taotie12010/bigfour
lms/djangoapps/ccx/tests/test_ccx_modulestore.py
24
5387
""" Test the CCXModulestoreWrapper """ from collections import deque from ccx_keys.locator import CCXLocator import datetime from itertools import izip_longest, chain import pytz from student.tests.factories import AdminFactory from xmodule.modulestore.tests.django_utils import ( ModuleStoreTestCase, TEST_DATA_...
agpl-3.0