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
insertnamehere1/maraschino
lib/jinja2/sandbox.py
122
13114
# -*- coding: utf-8 -*- """ jinja2.sandbox ~~~~~~~~~~~~~~ Adds a sandbox layer to Jinja as it was the default behavior in the old Jinja 1 releases. This sandbox is slightly different from Jinja 1 as the default behavior is easier to use. The behavior can be changed by subclassing the environm...
mit
heeraj123/oh-mainline
mysite/search/migrations/0024_hit_count_cache.py
17
4283
# This file is part of OpenHatch. # Copyright (C) 2009 OpenHatch, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later v...
agpl-3.0
zhanglab/psamm
psamm/gapfill.py
1
11063
# This file is part of PSAMM. # # PSAMM 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. # # PSAMM is distributed in the hope that it wi...
gpl-3.0
thomhastings/linux-3.17.1-parrot
tools/perf/scripts/python/syscall-counts-by-pid.py
1996
2105
# 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 system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os, sys sys.path.append(os.env...
gpl-2.0
heliodor/django-avatar
avatar/util.py
5
3086
from django.conf import settings from django.core.cache import cache from django.utils.hashcompat import md5_constructor from django.utils.encoding import smart_str from django.template.defaultfilters import slugify from django.contrib.auth.models import User from avatar.settings import (AVATAR_DEFAULT_URL, AVATAR_CA...
bsd-3-clause
suyashphadtare/sajil-final-erp
erpnext/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.py
21
3607
# 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 erpnext.accounts.report.accounts_receivable.accounts_receivable import get_ageing_data def execute...
agpl-3.0
notapresent/rtrss
tests/test_localdirectory_storage.py
1
2009
import unittest from testfixtures import TempDirectory from tests import random_key from rtrss.storage.localdirectory import LocalDirectoryStorage, mkdir_p class LocalDirectoryStorageTestCase(unittest.TestCase): test_key = 'some random key' test_value = 'some random value' def setUp(self): self...
apache-2.0
FckCoin/FuckCoin
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
novafloss/ci-formula
_states/jenkins_job.py
1
1441
# -*- coding: utf-8 -*- import os def _recreate_job_check(old, new): old_cls = old.splitlines()[-1] new_cls = new.splitlines()[-1] return old_cls != new_cls def present(name, source, template=None, context=None): update_or_create_xml = __salt__['jenkins.update_or_create_xml'] # noqa get_file_s...
mit
Killthebug/peep
peep.py
28
33560
#!/usr/bin/env python """peep ("prudently examine every package") verifies that packages conform to a trusted, locally stored hash and only then installs them:: peep install -r requirements.txt This makes your deployments verifiably repeatable without having to maintain a local PyPI mirror or use a vendor lib. Ju...
mit
VU-Cog-Sci/PRF_experiment
ColorMatcherSession.py
1
3743
from __future__ import division from psychopy import visual, core, misc, event import numpy as np from IPython import embed as shell from math import * import os, sys, time, pickle import pygame from pygame.locals import * # from pygame import mixer, time import Quest sys.path.append( 'exp_tools' ) # sys.path.append...
mit
mlalic/servo
tests/wpt/web-platform-tests/tools/wptserve/wptserve/pipes.py
180
13830
from cgi import escape import gzip as gzip_module import re import time import types import uuid from cStringIO import StringIO def resolve_content(response): rv = "".join(item for item in response.iter_content()) if type(rv) == unicode: rv = rv.encode(response.encoding) return rv class Pipeline...
mpl-2.0
ellipsis14/dolfin
demo/undocumented/petsc4py/python/demo_petsc4py.py
3
2737
"""This demo program solves Poisson's equation - div grad u(x, y) = f(x, y) on the unit square with source f given by f(x, y) = 10*exp(-((x - 0.5)^2 + (y - 0.5)^2) / 0.02) and boundary conditions given by u(x, y) = 0 for x = 0 or x = 1 du/dn(x, y) = sin(5*x) for y = 0 or y = 1 It demonstrates h...
gpl-3.0
fkolacek/FIT-VUT
bp-revok/python/lib/python2.7/test/test_doctest2.py
136
2387
# -*- coding: utf-8 -*- u"""A module to test whether doctest recognizes some 2.2 features, like static and class methods. >>> print 'yup' # 1 yup We include some (random) encoded (utf-8) text in the text surrounding the example. It should be ignored: ЉЊЈЁЂ """ import sys import unittest from test import test_sup...
apache-2.0
elkingtonmcb/scikit-learn
sklearn/neural_network/tests/test_rbm.py
225
6278
import sys import re import numpy as np from scipy.sparse import csc_matrix, csr_matrix, lil_matrix from sklearn.utils.testing import (assert_almost_equal, assert_array_equal, assert_true) from sklearn.datasets import load_digits from sklearn.externals.six.moves import cStringIO as ...
bsd-3-clause
kvesteri/validators
validators/btc_address.py
2
1530
import re from hashlib import sha256 from .utils import validator segwit_pattern = re.compile( r'^(bc|tc)[0-3][02-9ac-hj-np-z]{14,74}$') def validate_segwit_address(addr): return segwit_pattern.match(addr) def decode_base58(addr): alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"...
mit
mattclay/ansible-modules-core
files/file.py
25
19325
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <michael.dehaan@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...
gpl-3.0
alanbowman/home-assistant
homeassistant/components/sensor/efergy.py
10
4275
""" homeassistant.components.sensor.efergy ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Monitors home energy use as measured by an efergy engage hub using its (unofficial, undocumented) API. Configuration: To use the efergy sensor you will need to add something like the following to your configuration.yaml file. sensor: ...
mit
jbalogh/zamboni
apps/devhub/tests/test_helpers.py
1
7159
# -*- coding: utf8 -*- import unittest import urllib from django.utils import translation from mock import Mock from nose.tools import eq_ from pyquery import PyQuery as pq import amo import amo.tests from amo.urlresolvers import reverse from amo.tests.test_helpers import render from addons.models import Addon from ...
bsd-3-clause
neno1978/xbmctorrent
resources/site-packages/html5lib/treewalkers/pulldom.py
1729
2302
from __future__ import absolute_import, division, unicode_literals from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, \ COMMENT, IGNORABLE_WHITESPACE, CHARACTERS from . import _base from ..constants import voidElements class TreeWalker(_base.TreeWalker): def __iter__(self): ignore_until = None...
apache-2.0
davidvon/pipa-pay-server
site-packages/migrate/tests/versioning/test_keyedinstance.py
4
1286
#!/usr/bin/python # -*- coding: utf-8 -*- from migrate.tests import fixture from migrate.versioning.util.keyedinstance import * class TestKeydInstance(fixture.Base): def test_unique(self): """UniqueInstance should produce unique object instances""" class Uniq1(KeyedInstance): @classmet...
apache-2.0
aleksandr-bakanov/astropy
astropy/units/format/cds_parsetab.py
6
5504
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst # This file was automatically generated from ply. To re-generate this file, # remove it from this folder, then build astropy and run the tests in-place: # # python setup.py build_ext --inplace # pytest astropy/units # # You can...
bsd-3-clause
systers/postorius
copybump.py
1
2797
#! /usr/bin/env python3 import os import re import sys import stat import datetime FSF = 'by the Free Software Foundation, Inc.' this_year = datetime.date.today().year pyre_c = re.compile(r'# Copyright \(C\) ((?P<start>\d{4})-)?(?P<end>\d{4})') pyre_n = re.compile(r'# Copyright ((?P<start>\d{4})-)?(?P<end>\d{4})') n...
gpl-3.0
pewen/ten
ten/post.py
1
2525
""" Post processing tools """ import os import numpy as np def extrac4dir(dir_path, search): """ Extrar the epsilon, mean free path, total time and efficienci of all file in some directory. Parameters ---------- dir_path : str Path to the directory with the outputs files. search : list ...
mit
equitania/odoo-pentaho
modules/pentaho_reports_auth_crypt/pentaho_auth_crypt.py
7
2508
from openerp import models, fields, api, _ from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT import openerp from datetime import datetime, timedelta import random, string class PentahoAuthCrypt(models.Model): _name = 'pentaho.auth.crypt' _description = 'Pentah Auth Crypt' user_id = fields.Many2one(...
gpl-2.0
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/skimage/util/tests/test_arraycrop.py
2
1284
from __future__ import division, absolute_import, print_function import numpy as np from skimage.util import crop from skimage._shared.testing import (assert_array_equal, assert_equal) def test_multi_crop(): arr = np.arange(45).reshape(9, 5) out = crop(arr, ((1, 2), (2, 1))) assert_array_equal(out[0], [7...
gpl-3.0
krvss/django-social-auth
social_auth/backends/contrib/skyrock.py
3
2604
""" Skyrock OAuth support. This adds support for Skyrock OAuth service. An application must be registered first on skyrock and the settings SKYROCK_CONSUMER_KEY and SKYROCK_CONSUMER_SECRET must be defined with they corresponding values. By default account id is stored in extra_data field, check OAuthBackend class for...
bsd-3-clause
aifil/odoo
addons/stock/stock.py
2
292755
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from datetime import date, datetime from dateutil import relativedelta import json import time import sets import openerp from openerp.osv import fields, osv from openerp.tools.float_utils import float_compare, float_ro...
gpl-3.0
AstroFloyd/SolTrack
Python/soltrack/riseset.py
2
8500
"""SolTrack: a simple, free, fast and accurate C routine to compute the position of the Sun. Copyright (c) 2014-2020 Marc van der Sluys, Paul van Kan and Jurgen Reintjes, Sustainable Energy research group, HAN University of applied sciences, Arnhem, The Netherlands This file is part of the SolTrack packa...
lgpl-3.0
asd43/Structural-Variation
popgen/mergeBD2bed.py
1
1961
#!/usr/bin/env python3 # Copyright (c) 2017 Genome Research Ltd. # Author: Alistair Dunham # 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 Licens...
gpl-3.0
hyperized/ansible
lib/ansible/module_utils/network/voss/voss.py
63
7726
# 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
jayme-github/CouchPotatoServer
libs/sqlalchemy/util/_collections.py
17
25089
# util/_collections.py # Copyright (C) 2005-2012 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 """Collection classes and helpers.""" import sys import itertools import weakref...
gpl-3.0
maltsev/LatexWebOffice
app/tests/server/views/test_document.py
1
4826
# -*- coding: utf-8 -*- """ * Purpose : Test der Dokument- und Projektverwaltung (app/view/documents.py) * Creation Date : 20-11-2014 * Last Modified : Mi 26 Nov 2014 14:58:13 CET * Author : mattis * Coauthors : christian * Sprintnumber : 2 * Backlog entry : - """ from app.common.constants import ERROR_MESSAG...
gpl-3.0
itsjeyd/edx-platform
common/djangoapps/embargo/tests/test_views.py
7
3118
"""Tests for embargo app views. """ import unittest from mock import patch from django.core.urlresolvers import reverse from django.conf import settings import ddt from util.testing import UrlResetMixin from embargo import messages from openedx.core.djangolib.testing.utils import CacheIsolationTestCase from openedx.c...
agpl-3.0
x303597316/hue
desktop/core/ext-py/pysaml2-2.4.0/src/saml2/discovery.py
32
3089
from urllib import urlencode from urlparse import parse_qs from urlparse import urlparse from saml2.entity import Entity from saml2.response import VerificationError __author__ = 'rolandh' IDPDISC_POLICY = "urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol:single" class DiscoveryServer(Entity): def __...
apache-2.0
surgebiswas/poker
PokerBots_2017/Johnny/theano/sandbox/tests/test_multinomial.py
3
8396
import copy import os import sys from six import reraise from nose.plugins.skip import SkipTest import numpy import theano from theano import config, function, tensor from theano.sandbox import multinomial from theano.compile.mode import get_default_mode, predefined_linkers import theano.sandbox.cuda as cuda import t...
mit
DoubleNegativeVisualEffects/cortex
python/IECoreGL/State.py
12
2325
########################################################################## # # Copyright (c) 2012, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistribu...
bsd-3-clause
Metaswitch/horizon
horizon/base.py
11
37032
# Copyright 2012 Nebula, 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 agree...
apache-2.0
orgito/ansible
lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_cancel.py
14
2507
#!/usr/bin/python # coding: utf-8 -*- # (c) 2017, Wayne Witzel III <wayne@riotousliving.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 __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1...
gpl-3.0
dhruvsrivastava/OJ
flask/lib/python2.7/site-packages/sqlalchemy/dialects/mssql/pyodbc.py
54
9473
# mssql/pyodbc.py # Copyright (C) 2005-2015 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:: mssql+pyodbc :name: PyODBC :dbapi: pyodbc :connectstrin...
bsd-3-clause
evensonbryan/yocto-autobuilder
lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/db/migrate/versions/007_add_object_tables.py
8
1552
# This file is part of Buildbot. Buildbot 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 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
GraemeFulton/job-search
docutils-0.12/docutils/nodes.py
104
77345
# $Id: nodes.py 7595 2013-01-21 17:33:56Z milde $ # Author: David Goodger <goodger@python.org> # Maintainer: docutils-develop@lists.sourceforge.net # Copyright: This module has been placed in the public domain. """ Docutils document tree element class library. Classes in CamelCase are abstract base classes or auxilia...
gpl-2.0
swayf/doit
tests/test_runner.py
1
25023
import os from multiprocessing import Queue import pytest from mock import Mock from doit.dependency import Dependency from doit.task import Task from doit.control import TaskDispatcher, ExecNode from doit import runner # sample actions def my_print(*args): pass def _fail(): return False def _error(): r...
mit
hsr-ba-fs15-dat/python-social-auth
social/utils.py
7
5425
import re import sys import unicodedata import collections import six import social from social.p3 import urlparse, urlunparse, urlencode, \ parse_qs as battery_parse_qs SETTING_PREFIX = 'SOCIAL_AUTH' def import_module(name): __import__(name) return sys.modules[name] def module_mem...
bsd-3-clause
mhaessig/servo
tests/wpt/css-tests/tools/pytest/testing/test_runner.py
167
20633
# -*- coding: utf-8 -*- from __future__ import with_statement import _pytest._code import os import py import pytest import sys from _pytest import runner, main class TestSetupState: def test_setup(self, testdir): ss = runner.SetupState() item = testdir.getitem("def test_func(): pass") l =...
mpl-2.0
caisq/tensorflow
tensorflow/compiler/tests/binary_ops_test.py
2
51850
# Copyright 2017 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
mhaessig/servo
tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/manifestexpected.py
22
7524
import os import urlparse from wptmanifest.backends import static from wptmanifest.backends.static import ManifestItem import expected """Manifest structure used to store expected results of a test. Each manifest file is represented by an ExpectedManifest that has one or more TestNode children, one per test in the ...
mpl-2.0
rioutine/kernel_samsung_klte
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
tiangolo/ansible
lib/ansible/inventory/__init__.py
3
26110
# (c) 2012-2014, Michael DeHaan <michael.dehaan@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 License, or # (at your option) an...
gpl-3.0
xujun10110/NoSQLMap
nsmcouch.py
3
11265
#!/usr/bin/python #NoSQLMap Copyright 2014 Russell Butturini #This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by #the Free Software Foundation, either version 3 of the License, or #(at your option) any later version. #This program...
gpl-3.0
francois-berder/PyLetMeCreate
letmecreate/click/joystick.py
1
1291
#!/usr/bin/env python3 """Python binding of Joystick wrapper of LetMeCreate library.""" import ctypes _LIB = ctypes.CDLL('libletmecreate_click.so') def get_x(): """Returns the X position of the joystick. Note: An exception is thrown if it fails to read the X position from the chip. """ pos_x = ...
bsd-3-clause
GoogleCloudPlatform/appengine-config-transformer
yaml_conversion/lib/google/appengine/api/yaml_listener.py
1
7849
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
SergeyPirogov/ghost
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/lexers/_postgres_builtins.py
269
9648
# -*- coding: utf-8 -*- """ pygments.lexers._postgres_builtins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Self-updating data files for PostgreSQL lexer. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re import urllib # One man's cons...
mit
shichao-an/leetcode-python
product_of_array_except_self/solution4.py
1
1363
""" Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i]. Solve it without division and in O(n). For example, given [1,2,3,4], return [24,12,8,6]. Follow up: Could you solve it with constant space complexity? (N...
bsd-2-clause
andela-bojengwa/gui2py
gui/flowsizer.py
14
3111
#---------------------------------------------------------------------------- # Name: flowsizer.py # Purpose: Implements a Flow Sizer # # Author: Peter Damoc (peter at gmail.com) # # Created: January 2006 # Version: 0.1 # Licence: wxWindows license import wx class...
lgpl-3.0
baifenbenniao/mpv
waftools/waf_customizations.py
22
1574
from waflib.Configure import conf @conf def get_config_header(self, defines=True, headers=False, define_prefix=''): """ Only difference is it outputs `#define VAR 0` or `#define VAR value` instead of `#undef VAR` or `#define VAR val`. """ from waflib.Tools.c_config import DEFKEYS, INCKEYS lst =...
gpl-2.0
dvska/requesocks
requesocks/packages/urllib3/response.py
9
6381
# urllib3/response.py # Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import gzip import logging import zlib from io import BytesIO from .exceptions import HTTPEr...
isc
alok1974/nbCodeLines
modules/codeLines.py
1
7366
########################################################################################### ########################################################################################### ## ## ## Nb Code Lines v 1.0 (c) 2015 Alok Gandhi...
gpl-3.0
arista-eosplus/ansible
lib/ansible/module_utils/facts/hardware/sunos.py
9
9598
# 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 distributed in the hope that ...
gpl-3.0
jleclanche/fireplace
fireplace/cards/classic/neutral_common.py
1
5375
from ..utils import * ## # Free basic minions class CS2_122: """Raid Leader""" update = Refresh(FRIENDLY_MINIONS - SELF, buff="CS2_122e") CS2_122e = buff(atk=1) class CS2_222: """Stormwind Champion""" update = Refresh(FRIENDLY_MINIONS - SELF, buff="CS2_222o") CS2_222o = buff(+1, +1) class CS2_226: """Fr...
agpl-3.0
curtisz/train
train/vpc/config.py
2
3380
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import amis def check_env(env, default=None): """Check/Set environment variables""" if not os.environ.get(env) and not default: print "Error: '{0}' environment variable not set".format(env) sys.exit() return os.environ....
apache-2.0
matteoredaelli/scrapy_web
scrapy_web/spiders/nomi_maschili_femminili_nomix_it.py
1
1908
# -*- coding: utf-8 -*- # scrapy_web # Copyright (C) 2016-2017 Matteo.Redaelli@gmail.com> # # 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 # ...
gpl-3.0
Nu3001/external_chromium_org
native_client_sdk/src/build_tools/parse_dsc.py
23
7980
#!/usr/bin/env python # Copyright (c) 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 collections import fnmatch import optparse import os import sys VALID_TOOLCHAINS = ['newlib', 'glibc', 'pnacl', 'win', 'lin...
bsd-3-clause
yocome/zulip
zerver/lib/bugdown/testing_mocks.py
124
8065
from __future__ import absolute_import import ujson NORMAL_TWEET = """{ "coordinates": null, "created_at": "Sat Sep 10 22:23:38 +0000 2011", "truncated": false, "favorited": false, "id_str": "112652479837110273", "in_reply_to_user_id_str": "783214", "text": "@twitter meets @seepicturely at #tcdisrupt c...
apache-2.0
wemanuel/smry
smry/server-auth/ls/google-cloud-sdk/platform/gsutil/third_party/boto/tests/unit/ec2/test_ec2object.py
112
7770
#!/usr/bin/env python from tests.unit import unittest from tests.unit import AWSMockServiceTestCase from boto.ec2.connection import EC2Connection from boto.ec2.ec2object import TaggedEC2Object CREATE_TAGS_RESPONSE = br"""<?xml version="1.0" encoding="UTF-8"?> <CreateTagsResponse xmlns="http://ec2.amazonaws.com/doc/...
apache-2.0
2014c2g3/0623exam
static/Brython3.1.1-20150328-091302/Lib/xml/sax/xmlreader.py
824
12612
"""An XML Reader is the SAX 2 name for an XML parser. XML Parsers should be based on this code. """ from . import handler from ._exceptions import SAXNotSupportedException, SAXNotRecognizedException # ===== XMLREADER ===== class XMLReader: """Interface for reading an XML document using callbacks. XMLReade...
gpl-3.0
AdamWill/blivet
examples/factory.py
4
1560
import os import blivet from blivet.size import Size from blivet.util import set_up_logging, create_sparse_tempfile set_up_logging() b = blivet.Blivet() # create an instance of Blivet (don't add system devices) # create two disk image files on which to create new devices disk1_file = create_sparse_tempfile("disk1"...
lgpl-2.1
aayush2911/Fibonaccio
web2py/gluon/contrib/pymysql/constants/ER.py
122
12223
ERROR_FIRST = 1000 HASHCHK = 1000 NISAMCHK = 1001 NO = 1002 YES = 1003 CANT_CREATE_FILE = 1004 CANT_CREATE_TABLE = 1005 CANT_CREATE_DB = 1006 DB_CREATE_EXISTS = 1007 DB_DROP_EXISTS = 1008 DB_DROP_DELETE = 1009 DB_DROP_RMDIR = 1010 CANT_DELETE_FILE = 1011 CANT_FIND_SYSTEM_REC = 1012 CANT_GET_STAT = 1013 CANT_GET_WD = 1...
gpl-2.0
liangazhou/django-rdp
packages/PyDev/plugins/org.python.pydev.jython_4.4.0.201510052309/Lib/ihooks.py
259
18986
"""Import hook support. Consistent use of this module will make it possible to change the different mechanisms involved in loading modules independently. While the built-in module imp exports interfaces to the built-in module searching and loading algorithm, and it is possible to replace the built-in function __impor...
apache-2.0
cloudera/hue
desktop/core/ext-py/django-webpack-loader-1.0.0/tests/app/tests/test_webpack.py
2
10290
import json import os import time from subprocess import call from threading import Thread import django from django.conf import settings from django.test import RequestFactory, TestCase from django.views.generic.base import TemplateView from django_jinja.builtins import DEFAULT_EXTENSIONS from unittest2 import skipIf...
apache-2.0
hh-italian-group/HHbbTauTau
TreeProduction/python/TriggerObjectBlock_cfi.py
1
1874
## @package TriggerObjectBlock_cfi # Configuration file that defines the producer of ROOT-tuple for trigger objects. # # \author Subir Sarkar # \author Rosamaria Venditti (INFN Bari, Bari University) # \author Konstantin Androsov (University of Siena, INFN Pisa) # \author Maria Teresa Grippo (University of Siena, ...
gpl-2.0
jbzdak/edx-platform
lms/djangoapps/shoppingcart/tests/test_context_processor.py
134
3312
""" Unit tests for shoppingcart context_processor """ from django.conf import settings from django.contrib.auth.models import AnonymousUser from mock import patch, Mock from course_modes.tests.factories import CourseModeFactory from student.tests.factories import UserFactory from xmodule.modulestore.tests.django_utils...
agpl-3.0
stephanehenry27/Sickbeard-anime
sickbeard/providers/newznab.py
1
7885
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 Lice...
gpl-3.0
whereismyjetpack/ansible
lib/ansible/modules/identity/ipa/ipa_hostgroup.py
20
8701
#!/usr/bin/python # -*- coding: utf-8 -*- # 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. # ...
gpl-3.0
HellTech/NAG_IoE_2016
30_HellTech_1602_1/11_RGB_color_sensor_TCS34725/lcddriver.py
3
2503
#!/usr/bin/python import i2c_lib from time import * # LCD Address #ADDRESS = 0x27 ADDRESS = 0x3F # commands LCD_CLEARDISPLAY = 0x01 LCD_RETURNHOME = 0x02 LCD_ENTRYMODESET = 0x04 LCD_DISPLAYCONTROL = 0x08 LCD_CURSORSHIFT = 0x10 LCD_FUNCTIONSET = 0x20 LCD_SETCGRAMADDR = 0x40 LCD_SETDDRAMADDR = 0x80 # flags for displa...
gpl-3.0
MrNuggles/HeyBoet-Telegram-Bot
temboo/Library/Basecamp/GetPeopleAcrossProjects.py
5
3733
# -*- coding: utf-8 -*- ############################################################################### # # GetPeopleAcrossProjects # Retrieves all people that the logged in user has permission to see. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 ...
gpl-3.0
cparawhore/ProyectoSubastas
site-packages/django/contrib/auth/urls.py
113
1203
# The views used below are normally mapped in django.contrib.admin.urls.py # This URLs file is used to provide a reliable view deployment for test purposes. # It is also provided as a convenience to those who want to deploy these URLs # elsewhere. from django.conf.urls import patterns, url urlpatterns = patterns('', ...
mit
vericred/vericred-python
vericred_client/models/plan_deleted.py
1
11507
# coding: utf-8 """ Vericred API Vericred's API allows you to search for Health Plans that a specific doctor accepts. ## Getting Started Visit our [Developer Portal](https://developers.vericred.com) to create an account. Once you have created an account, you can create one Application for Production and an...
apache-2.0
flaxatives/leetcode
minimum_window_substring.py
1
1883
#!/usr/bin/env python """ Given strings S and T, finds the minimum substring of S which contains all the characters in T. Done in O(n) time. """ def min_window(S, T): freq = {} for letter in T: freq[letter] = 0 # search S until we find a substring with all chars start = 0 ...
mit
joshisa/taiga-back
taiga/projects/custom_attributes/permissions.py
9
3569
# Copyright (C) 2015 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2015 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2015 David Barragán <bameda@dbarragan.com> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the F...
agpl-3.0
swisscom/cleanerversion
versions/descriptors.py
1
25432
from collections import namedtuple from django import VERSION from django.core.exceptions import SuspiciousOperation, FieldDoesNotExist from django.db import router, transaction from django.db.models.base import Model from django.db.models.fields.related import (ForwardManyToOneDescriptor, ...
apache-2.0
sogelink/ansible
lib/ansible/modules/network/illumos/dladm_etherstub.py
56
4178
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Adam Števko <adam.stevko@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 __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
SlashRoot/WHAT
settings/logging_settings.py
1
2154
import sys if not 'test' in sys.argv or 'test_coverage' in sys.argv: LOGGING = { 'version': 1, 'disable_existing_loggers': True, 'formatters': { 'verbose': { 'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s' }, 'standard': { ...
mit
BeyondTheClouds/nova
nova/tests/unit/api/openstack/compute/test_scheduler_hints.py
9
9797
# 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
nimbis/django-allauth
allauth/socialaccount/providers/vk/views.py
64
1886
import requests from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter, OAuth2LoginView, OAuth2CallbackView) from .provider import VKProvider USER_FIELDS = ['first_name', ...
mit
jrbl/invenio
modules/bibauthorid/lib/bibauthorid_cluster_set.py
1
8369
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2011 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) a...
gpl-2.0
bdrung/audacity
lib-src/lv2/lv2/plugins/eg-amp.lv2/waflib/ansiterm.py
177
8189
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import sys,os try: if not(sys.stderr.isatty()and sys.stdout.isatty()): raise ValueError('not a tty') from ctypes import Structure,windll,c_short,c_ushort,c_ulong,c_int,byr...
gpl-2.0
saydulk/openhab
bundles/binding/org.openhab.binding.piface/scripts/ohpiface.py
136
5718
#!/usr/bin/python """ ohpiface.py A network listener for handling openHAB UDP commands for PiFace pins """ import getopt import signal import socket import struct import sys import thread import time import piface.pfio as pfio import SocketServer ERROR_ACK = 0 WATCHDOG_CMD = 14 WATCHDOG_ACK = 15 WRITE_OUT_CMD =...
epl-1.0
JackWoot/E2E-Messenger
Server/passlib/utils/md4.py
21
7829
""" helper implementing insecure and obsolete md4 algorithm. used for NTHASH format, which is also insecure and broken, since it's just md4(password) implementated based on rfc at http://www.faqs.org/rfcs/rfc1320.html """ #============================================================================= # imports #=====...
gpl-2.0
T2DREAM/t2dream-portal
src/encoded/tests/test_schemas.py
2
1937
import pytest from pkg_resources import resource_listdir SCHEMA_FILES = [ f for f in resource_listdir('encoded', 'schemas') if f.endswith('.json') ] @pytest.mark.parametrize('schema', SCHEMA_FILES) def test_load_schema(schema): from snovault.schema_utils import load_schema assert load_schema('encoded...
mit
chundongwang/Guess2014
minimizeJs.py
1
3325
import os import time from httplib import HTTPConnection from urllib import urlencode files = [ "js/main.js", "js/service/guesser.js", "js/service/miner.js", "js/directive/navbar.js", "js/directive/notice.js", "js/directive/footer.js", "js/directive/matchdiv.js", "js/directive/betmodal...
apache-2.0
Jeff-Tian/mybnb
Python27/Lib/bsddb/test/test_dbobj.py
8
2477
import os, string import unittest from test_all import db, dbobj, test_support, get_new_environment_path, \ get_new_database_path #---------------------------------------------------------------------- class dbobjTestCase(unittest.TestCase): """Verify that dbobj.DB and dbobj.DBEnv work properl...
apache-2.0
dinowernli/bazel
tools/build_defs/docker/rewrite_json.py
5
9999
# Copyright 2015 The Bazel 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 la...
apache-2.0
kinap/scapy
scapy/layers/smb.py
24
17900
## This file is part of Scapy ## See http://www.secdev.org/projects/scapy for more informations ## Copyright (C) Philippe Biondi <phil@secdev.org> ## This program is published under a GPLv2 license """ SMB (Server Message Block), also known as CIFS. """ from scapy.packet import * from scapy.fields import * from scapy...
gpl-2.0
kaiweifan/vse-lbaas-plugin-poc
quantum/db/migration/alembic_migrations/versions/grizzly_release.py
2
1268
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE...
apache-2.0
FlipperPA/wagtail
wagtail/admin/tests/pages/test_page_locking.py
7
10481
from django.contrib.auth.models import Group, Permission from django.test import TestCase from django.urls import reverse from django.utils import timezone from wagtail.core.models import Page from wagtail.tests.testapp.models import SimplePage from wagtail.tests.utils import WagtailTestUtils class TestLocking(TestC...
bsd-3-clause
ReachingOut/unisubs
apps/subtitles/cache.py
7
1453
# Amara, universalsubtitles.org # # Copyright (C) 2013 Participatory Culture Foundation # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your op...
agpl-3.0
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/reportlab/graphics/shapes.py
28
53762
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/shapes.py __version__=''' $Id$ ''' __doc__='''Core of the graphics library - defines Drawing and Shapes''' import os, sys from math import p...
agpl-3.0
jcpowermac/ansible
lib/ansible/modules/windows/win_timezone.py
47
2430
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Phil Schwartz <schwartzmx@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 ...
gpl-3.0
bulax41/Commands
scripts/cme_decode_pcap.py
1
1258
#!/usr/bin/env python import dpkt import argparse import struct import sys import datetime def main(): parser = argparse.ArgumentParser(description='Read PCAP file, decode CME data and output message sequence gaps') parser.add_argument('-f','--file',help="PCAP File to read") args = parser.parse_args() ...
gpl-3.0