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
okwow123/djangol2
example/env/lib/python2.7/site-packages/oauthlib/oauth1/rfc5849/endpoints/base.py
49
10388
# -*- coding: utf-8 -*- """ oauthlib.oauth1.rfc5849.endpoints.base ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This module is an implementation of various logic needed for signing and checking OAuth 1.0 RFC 5849 requests. """ from __future__ import absolute_import, unicode_literals import time from oauthlib.common import...
mit
karky7/wsgiuseragentmobile
tests/test_crawler.py
4
5745
# -*- coding: utf-8 -*- from uamobile import detect, Context def test_crawler(): def get_test_func(docomo=False, kddi=False, softbank=False): def func(ip, useragent): device = detect({'HTTP_USER_AGENT': useragent, 'REMOTE_ADDR' : ip}) assert device.is...
mit
marmarek/qubes-core-admin
qubes/vm/adminvm.py
1
9608
# # The Qubes OS Project, https://www.qubes-os.org/ # # Copyright (C) 2010-2015 Joanna Rutkowska <joanna@invisiblethingslab.com> # Copyright (C) 2013-2015 Marek Marczykowski-Górecki # <marmarek@invisiblethingslab.com> # Copyright (C) 2014-2015 Wojtek Porczyk <woju@invisiblethingslab.com>...
lgpl-2.1
liorvh/golismero
tools/sqlmap/lib/core/replication.py
8
4034
#!/usr/bin/env python """ Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import sqlite3 from extra.safe2bin.safe2bin import safechardecode from lib.core.common import unsafeSQLIdentificatorNaming from lib.core.exception import SqlmapGenericExcepti...
gpl-2.0
maxming2333/v2ex
html5lib/html5parser.py
95
115775
try: frozenset except NameError: # Import from the sets module for python 2.3 from sets import Set as set from sets import ImmutableSet as frozenset try: any except: # Implement 'any' for python 2.4 and previous def any(iterable): for element in iterable: if element: ...
bsd-3-clause
benjimons/FIR
fir_notifications/methods/email.py
4
1389
from django.conf import settings from django.core import mail from fir_email.helpers import prepare_email_message from fir_notifications.methods import NotificationMethod from fir_notifications.methods.utils import request class EmailMethod(NotificationMethod): use_subject = True use_description = True ...
gpl-3.0
40223117cda/cda
static/Brython3.1.1-20150328-091302/Lib/urllib/parse.py
735
35170
"""Parse (absolute and relative) URLs. urlparse module is based upon the following RFC specifications. RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding and L. Masinter, January 2005. RFC 2732 : "Format for Literal IPv6 Addresses in URL's by R.Hinden, B.Carpenter and L.Masinter, Decemb...
gpl-3.0
Krossom/python-for-android
python3-alpha/python3-src/Lib/test/test_codecencodings_cn.py
55
3144
#!/usr/bin/env python3 # # test_codecencodings_cn.py # Codec encoding tests for PRC encodings. # from test import support from test import test_multibytecodec_support import unittest class Test_GB2312(test_multibytecodec_support.TestBase, unittest.TestCase): encoding = 'gb2312' tstring = test_multibytecodec...
apache-2.0
thiagopnts/servo
tests/wpt/web-platform-tests/tools/third_party/pluggy/testing/test_method_ordering.py
43
7642
import pytest import sys import types from pluggy import PluginManager, HookImpl, HookimplMarker, HookspecMarker hookspec = HookspecMarker("example") hookimpl = HookimplMarker("example") @pytest.fixture def hc(pm): class Hooks(object): @hookspec def he_method1(self, arg): pass ...
mpl-2.0
jswope00/griffinx
common/lib/xmodule/xmodule/tests/xml/factories.py
50
4908
""" Factories for generating edXML for testing XModule import """ import inspect from fs.memoryfs import MemoryFS from factory import Factory, lazy_attribute, post_generation, Sequence from lxml import etree from xmodule.modulestore.inheritance import InheritanceMixin from xmodule.modulestore import only_xmodules ...
agpl-3.0
fdvarela/odoo8
addons/account/wizard/account_invoice_refund.py
117
12954
# -*- 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
akash1808/nova_test_latest
nova/api/openstack/wsgi.py
24
44528
# Copyright 2013 IBM Corp. # 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/LIC...
apache-2.0
Cisco-Talos/pyrebox
volatility/volatility/plugins/mac/check_syscall_table.py
4
4158
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # # This file is part of Volatility. # # Volatility 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 o...
gpl-2.0
proxysh/Safejumper-for-Desktop
buildlinux/env64/lib/python2.7/site-packages/pip/vcs/mercurial.py
514
3472
from __future__ import absolute_import import logging import os import tempfile from pip.utils import display_path, rmtree from pip.vcs import vcs, VersionControl from pip.download import path_to_url from pip._vendor.six.moves import configparser logger = logging.getLogger(__name__) class Mercurial(VersionControl...
gpl-2.0
IOSMonkey/node-gyp
gyp/pylib/gyp/input_test.py
604
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...
mit
gennad/Django-nonrel-stub-for-Google-App-Engine
django/utils/html.py
202
8105
"""HTML utilities suitable for global use.""" import re import string from django.utils.safestring import SafeData, mark_safe from django.utils.encoding import force_unicode from django.utils.functional import allow_lazy from django.utils.http import urlquote # Configuration for urlize() function. LEADING_PUNCTUATIO...
bsd-3-clause
wkritzinger/asuswrt-merlin
release/src/router/samba36/source4/scripting/python/samba/tests/param.py
22
1911
#!/usr/bin/env python # Unix SMB/CIFS implementation. # Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007 # # 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, ...
gpl-2.0
allanino/nupic
examples/opf/experiments/classification/category_SP_1/description.py
32
1721
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
sffjunkie/home-assistant
homeassistant/components/device_tracker/demo.py
30
1123
"""Demo platform for the device tracker.""" import random from homeassistant.components.device_tracker import DOMAIN def setup_scanner(hass, config, see): """Setup the demo tracker.""" def offset(): """Return random offset.""" return (random.randrange(500, 2000)) / 2e5 * random.choice((-1, 1)...
mit
yograterol/django
tests/template_backends/test_jinja2.py
315
3048
# Since this package contains a "jinja2" directory, this is required to # silence an ImportWarning warning on Python 2. from __future__ import absolute_import from unittest import skipIf from django.template import TemplateSyntaxError from .test_dummy import TemplateStringsTests try: import jinja2 except Import...
bsd-3-clause
danielsunzhongyuan/my_leetcode_in_python
lowest_common_ancestor_of_a_binary_tree_236.py
1
1928
# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): def lowestCommonAncestor(self, root, p, q): """ :type root: TreeNode :type p: TreeNode :...
apache-2.0
beyondvalence/scratch
chp01.py
1
1697
# !/usr/bin/env python27 # -*- coding: utf-8 -*- """ Created on Fri Dec 2 16:15:29 2016 @author: waynetliu """ #%% from __future__ import division users = [ { "id": 0, "name": "Hero" }, { "id": 1, "name": "Dunn" }, { "id": 2, "name": "Sue" }, { "id": 3, "name": "Chi" }, {...
bsd-2-clause
ant0nisk/pybrl
utils/pdf_utils.py
2
5108
#!/usr/bin/env python # -*- coding: utf-8 -*- """ PDF Utilities for Braille This module uses PDFMiner by Euske - https://github.com/euske/pdfminer LICENSE: Braille Grade 2 Translation in Python Copyright (C) 2016 Antonis Katzourakis This program is free software: you can redistribute it and...
gpl-3.0
tobiasgehring/qudi
interface/vacuum_pump_interface.py
4
2335
# -*- coding: utf-8 -*- """ Interface file for vacuum turbopumps with prepumps and pressure sensors. Qudi 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
wilblack/AutobahnPython
examples/twisted/wamp1/authentication/client.py
17
2416
############################################################################### ## ## Copyright (C) 2012-2013 Tavendo GmbH ## ## 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 ## ## h...
apache-2.0
colinnewell/odoo
addons/l10n_fr_rib/bank.py
335
4952
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 Numérigraphe SARL. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Genera...
agpl-3.0
Batterfii/django
tests/or_lookups/tests.py
109
7672
from __future__ import unicode_literals from datetime import datetime from operator import attrgetter from django.db.models import Q from django.test import TestCase from .models import Article class OrLookupsTests(TestCase): def setUp(self): self.a1 = Article.objects.create( headline='Hel...
bsd-3-clause
rcharp/toyota-flask
venv/lib/python2.7/site-packages/numpy/polynomial/hermite_e.py
36
56063
""" Objects for dealing with Hermite_e series. This module provides a number of objects (mostly functions) useful for dealing with Hermite_e series, including a `HermiteE` class that encapsulates the usual arithmetic operations. (General information on how this module represents and works with such polynomials is in ...
apache-2.0
arcyfelix/ML-DL-AI
Supervised Learning/GANs/GAN.py
1
3364
# -*- coding: utf-8 -*- """ GAN Example Use a generative adversarial network (GAN) to generate digit images from a noise distribution. References: - Generative adversarial nets. I Goodfellow, J Pouget-Abadie, M Mirza, B Xu, D Warde-Farley, S Ozair, Y. Bengio. Advances in neural information processing system...
apache-2.0
mbareta/edx-platform-ft
common/djangoapps/xblock_django/tests/test_models.py
20
1977
""" Tests for deprecated xblocks in XBlockDisableConfig. """ import ddt from mock import patch from django.test import TestCase from xblock_django.models import XBlockDisableConfig @ddt.ddt class XBlockDisableConfigTestCase(TestCase): """ Tests for the DjangoXBlockUserService. """ def setUp(self): ...
agpl-3.0
realsaiko/odoo
addons/hr_applicant_document/models/hr_applicant.py
385
1210
# -*- coding: utf-8 -*- from openerp.osv import fields, osv class hr_applicant(osv.Model): _inherit = 'hr.applicant' def _get_index_content(self, cr, uid, ids, fields, args, context=None): res = dict.fromkeys(ids, '') Attachment = self.pool.get('ir.attachment') attachment_ids = Attac...
agpl-3.0
TransportLayer/mc-id2name
id2name.py
1
45678
############################################################################### # Minecraft ID to Friendly Name # # Copyright (C) 2016 TransportLayer # # # ...
gpl-3.0
freedombox/debian-bts-to-github-sync
setup.py
1
1071
#!/usr/bin/env python from setuptools import setup __version__ = '0.0.1' CLASSIFIERS = map(str.strip, """Environment :: Console License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+) Natural Language :: English Operating System :: POSIX :: Linux Programming Language :: Python Programming ...
agpl-3.0
shelper/pyoct
pypeline/config.py
2
1549
# -*- coding: utf-8 -*- # below imports enables python 2 and 3 compatible codes # requires python-future, install by `pip install future` from __future__ import (absolute_import, division, print_function, unicode_literals) from builtins import * """ Config the package pypeline the pypeline pa...
isc
guglielmo/mosic2-db-delibere
project/delibere/wsgi.py
1
1588
""" WSGI config for DB delle Delibere CIPE project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI...
bsd-3-clause
GitHublong/hue
desktop/core/ext-py/python-openid-2.2.5/openid/yadis/xri.py
167
4383
# -*- test-case-name: openid.test.test_xri -*- """Utility functions for handling XRIs. @see: XRI Syntax v2.0 at the U{OASIS XRI Technical Committee<http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=xri>} """ import re XRI_AUTHORITIES = ['!', '=', '@', '+', '$', '('] try: unichr(0x10000) except ValueErr...
apache-2.0
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-2.5/Lib/test/test_codeccallbacks.py
10
31091
import test.test_support, unittest import sys, codecs, htmlentitydefs, unicodedata class PosReturn: # this can be used for configurable callbacks def __init__(self): self.pos = 0 def handle(self, exc): oldpos = self.pos realpos = oldpos if realpos<0: realpos = ...
mit
mwrightevent38/MissionPlanner
Lib/site-packages/scipy/lib/lapack/tests/test_gesv.py
55
3404
import numpy as np from numpy.testing import TestCase, assert_array_almost_equal, dec, \ assert_equal from common import FUNCS_TP, FLAPACK_IS_EMPTY, CLAPACK_IS_EMPTY, FUNCS_FLAPACK, \ FUNCS_CLAPACK, PREC A = np.array([[1,2,3],[2,2,3],[3,3,6]]) B = np.array([[10,-1,1],[-1,8...
gpl-3.0
asgard-lab/neutron
neutron/plugins/ml2/drivers/type_gre.py
28
3250
# Copyright (c) 2013 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
40223243/40223243w17
static/Brython3.1.1-20150328-091302/Lib/logging/__init__.py
733
66279
# Copyright 2001-2013 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
gpl-3.0
jaraco/pytest
testing/python/show_fixtures_per_test.py
10
3592
# -*- coding: utf-8 -*- def test_no_items_should_not_show_output(testdir): result = testdir.runpytest('--fixtures-per-test') assert 'fixtures used by' not in result.stdout.str() assert result.ret == 0 def test_fixtures_in_module(testdir): p = testdir.makepyfile(''' import pytest @pyt...
mit
benjamindeleener/odoo
openerp/tools/view_validation.py
367
2303
""" View validation code (using assertions, not the RNG schema). """ import logging _logger = logging.getLogger(__name__) def valid_page_in_book(arch): """A `page` node must be below a `book` node.""" return not arch.xpath('//page[not(ancestor::notebook)]') def valid_field_in_graph(arch): """ Children...
gpl-3.0
dymkowsk/mantid
Testing/SystemTests/tests/analysis/ReuseExistingCalibration.py
3
1552
#pylint: disable=no-init """ Verifies that a calibration file can be loaded once and reused to apply, using CopyInstrumentParameters, the same calibration in successive reductions. """ from __future__ import (absolute_import, division, print_function) import stresstesting class ReuseExistingCalibration(stress...
gpl-3.0
vyacht/carambola
package/vy-gpsd/src/gps/misc.py
6
3745
# misc.py - miscellaneous geodesy and time functions # # This file is Copyright (c) 2010 by the GPSD project # BSD terms apply: see the file COPYING in the distribution root for details. import time, calendar, math # some multipliers for interpreting GPS output METERS_TO_FEET = 3.2808399 # Meters to U.S./British feet...
gpl-2.0
dednal/chromium.src
third_party/cython/src/Cython/Compiler/AnalysedTreeTransforms.py
87
3774
from Visitor import ScopeTrackingTransform from Nodes import StatListNode, SingleAssignmentNode, CFuncDefNode, DefNode from ExprNodes import DictNode, DictItemNode, NameNode, UnicodeNode from PyrexTypes import py_object_type from StringEncoding import EncodedString import Symtab class AutoTestDictTransform(ScopeTracki...
bsd-3-clause
ksmaheshkumar/grr
parsers/windows_persistence_test.py
2
2344
#!/usr/bin/env python """Tests for grr.parsers.windows_persistence.""" from grr.lib import flags from grr.lib import rdfvalue from grr.lib import test_lib from grr.parsers import windows_persistence class WindowsPersistenceMechanismsParserTest(test_lib.FlowTestsBaseclass): def testParse(self): parser = window...
apache-2.0
yan12125/youtube-dl
youtube_dl/extractor/clyp.py
22
2496
from __future__ import unicode_literals from .common import InfoExtractor from ..compat import ( compat_parse_qs, compat_urllib_parse_urlparse, ) from ..utils import ( float_or_none, unified_timestamp, ) class ClypIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?clyp\.it/(?P<id>[a-z0-9]+)' ...
unlicense
IZSVenezie/VetEpiGIS-Tool
plugin/xitem_dialog.py
1
1545
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'xitem_dialog_base.ui' # # Created by: PyQt5 UI code generator 5.5.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Dialog(object): def setupUi(self, Dialog): Dialog....
gpl-2.0
Pelagicore/AudioManager
googleMock/scripts/generator/cpp/keywords.py
1157
2004
#!/usr/bin/env python # # Copyright 2007 Neal Norwitz # Portions Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0...
mpl-2.0
ToruNiina/ecell4
setup.py
1
4466
import os import re import sys import glob import platform import sysconfig import subprocess from setuptools import setup, Extension from setuptools.command.build_ext import build_ext from setuptools.command.test import test from distutils.version import LooseVersion class CMakeExtension(Extension): def __init_...
gpl-3.0
santidediego/LearningDjango
lib/python3.5/site-packages/django/contrib/admin/options.py
12
84462
import copy import operator import warnings from collections import OrderedDict from functools import partial, reduce, update_wrapper from django import forms from django.conf import settings from django.contrib import messages from django.contrib.admin import helpers, validation, widgets from django.contrib.admin.che...
mit
matthappens/taskqueue
taskqueue/venv_tq/lib/python2.7/site-packages/gevent/monkey.py
20
8343
# Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details. """Make the standard library cooperative.""" from __future__ import absolute_import import sys from sys import version_info __all__ = ['patch_all', 'patch_socket', 'patch_ssl', 'patch_os', 'patch_time', ...
mit
steynovich/ansible-modules-extras
network/f5/bigip_monitor_http.py
32
14385
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2013, serge van Ginderachter <serge@vanginderachter.be> # based on Matt Hite's bigip_pool module # (c) 2013, Matt Hite <mhite@hotmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GN...
gpl-3.0
ray-zhong/github_trend_spider
ENV/Lib/site-packages/pip/_vendor/requests/packages/chardet/gb2312prober.py
2994
1681
######################## 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
anbangleo/NlsdeWeb
Python-3.6.0/Lib/ctypes/test/test_anon.py
264
2051
import unittest from ctypes import * class AnonTest(unittest.TestCase): def test_anon(self): class ANON(Union): _fields_ = [("a", c_int), ("b", c_int)] class Y(Structure): _fields_ = [("x", c_int), ("_", ANON), ...
mit
gavinp/chromium
native_client_sdk/src/build_tools/build_utils.py
9
9988
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Small utility library of python functions used by the various package installers. """ import datetime import errno import fileinput import os import ...
bsd-3-clause
rukku/inasafe
third_party/raven/handlers/logbook.py
25
2539
""" raven.handlers.logbook ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import logbook import sys import traceback from raven.base import Client from raven.utils.encoding import t...
gpl-3.0
mancoast/CPythonPyc_test
cpython/234_test_quopri.py
24
5562
from test import test_support import unittest from cStringIO import StringIO from quopri import * ENCSAMPLE = """\ Here's a bunch of special=20 =A1=A2=A3=A4=A5=A6=A7=A8=A9 =AA=AB=AC=AD=AE=AF=B0=B1=B2=B3 =B4=B5=B6=B7=B8=B9=BA=BB=BC=BD=BE =BF=C0=C1=C2=C3=C4=C5=C6 =C7=C8=C9=CA=CB=CC=CD=CE=CF =D0=D1=D2=D3=D4=D5=D6=D7 ...
gpl-3.0
vasili-v/themis
vendor/github.com/apache/thrift/lib/py/src/protocol/THeaderProtocol.py
4
7373
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
vishwa91/ewaste_printer
tools/arm/arm-none-eabi/share/gdb/python/gdb/command/explore.py
137
26824
# GDB 'explore' command. # Copyright (C) 2012-2013 Free Software Foundation, Inc. # 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 late...
mit
digitalfox/yokadi
yokadi/tests/tests.py
1
1350
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ Yokadi unit tests @author: Aurélien Gâteau <aurelien.gateau@free.fr> @author: Sébastien Renard <Sebastien.Renard@digitalfox.org> @license: GPL v3 or later """ import unittest import os import sys sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir, o...
gpl-3.0
davidyezsetz/kuma
vendor/packages/pyparsing/examples/macroExpander.py
16
1830
# macroExpander.py # # Example pyparsing program for performing macro expansion, similar to # the C pre-processor. This program is not as fully-featured, simply # processing macros of the form: # #def xxx yyyyy # and replacing xxx with yyyyy in the rest of the input string. Macros # can also be composed u...
mpl-2.0
sillygod/my-travel-in-learning-python
ufile_transfer/updater.py
1
4349
import re import io import shutil import os import typing import MySQLdb from source_map import SourceMap class FileUpdater: """read origin fie and update it inplace. we give it the content and target we want to replace """ def __init__(self, filename, source_map:SourceMap=None, gcs_host=None, commi...
gpl-2.0
txemi/ansible
lib/ansible/modules/utilities/logic/include_vars.py
50
3943
# -*- mode: python -*- # Ansible is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Publ...
gpl-3.0
catapult-project/catapult-csm
third_party/gsutil/third_party/boto/tests/integration/datapipeline/test_layer1.py
136
5445
#!/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 ...
bsd-3-clause
hfiguiere/abiword
tools/build_osx_release.py
2
12008
#!/usr/bin/env python # Copyright (C) 2011 Fabiano Fidencio # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This ...
gpl-2.0
ndtran/bank-payment
account_banking_tests/tests/test_payment_roundtrip.py
11
18693
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2013 Therp BV (<http://therp.nl>) # # 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 ...
agpl-3.0
Valchris/IEEEXtreme_WorkingAsIntended
2012/AA_Alex.py
1
1107
__author__ = 'alexander' import sys initial_bunnies = long(sys.stdin.readline()) bunnies = dict() bunnies['adults'] = initial_bunnies bunnies['babies'] = long(0) bunnies['juveniles'] = long(0) bunnies['juveniles2'] = long(0) for i in range(0,365,15): if i % 2 == 0: bunnies['babies'] = long(bunnies['babi...
mit
kabracity/Flexget
flexget/plugins/output/prowl.py
5
4327
from __future__ import unicode_literals, division, absolute_import import logging from requests import RequestException from flexget import plugin from flexget.event import event from flexget.utils.template import RenderError __version__ = 0.1 log = logging.getLogger('prowl') headers = {'User-Agent': 'FlexGet Prow...
mit
tomas-edwardsson/tommi-func
func/overlord/scripts.py
2
1658
# python modules for doing normal/standard things with func command scripts # parsing/checking for errors # returning hosts # returning results # standard option parser for --forks, --outputpath, --timeout, --hosts-from-file, -- from optparse import OptionParser import sys def base_func_parser(opthosts=True, outpu...
gpl-2.0
raycarnes/odoomrp-wip
sale_product_variants_types/models/sale_order.py
9
1859
# -*- encoding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in root directory ############################################################################## from openerp import models, fields, api, exceptions, _ ...
agpl-3.0
mday299/ardupilot
Tools/scripts/generate_manifest.py
3
20111
#!/usr/bin/python from __future__ import print_function import sys import json import os import re import fnmatch import gen_stable import subprocess FIRMWARE_TYPES = ["AntennaTracker", "Copter", "Plane", "Rover", "Sub", "AP_Periph"] RELEASE_TYPES = ["beta", "latest", "stable", "stable-*", "dirty"] # mapping for bo...
gpl-3.0
sunshinelover/chanlun
vn.trader/riskManager/uiRmWidget.py
17
5075
# encoding: UTF-8 ''' 风控模块相关的GUI控制组件 ''' from uiBasicWidget import QtGui, QtCore from eventEngine import * ######################################################################## class RmSpinBox(QtGui.QSpinBox): """调整参数用的数值框""" #---------------------------------------------------------------------- d...
mit
lesina/Hack70
env/bin/painter.py
1
2129
#!/home/oleg/Web/Hack70/env/bin/python3 # # The Python Imaging Library # $Id$ # # this demo script illustrates pasting into an already displayed # photoimage. note that the current version of Tk updates the whole # image every time we paste, so to get decent performance, we split # the image into a set of tiles. # tr...
gpl-3.0
ConPaaS-team/conpaas
conpaas-services/contrib/ganglia_modules/mysql/mysql.py
3
32075
""" The MIT License Copyright (c) 2008 Gilad Raphaelli <gilad@raphaelli.com> 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,...
bsd-3-clause
epiqc/ScaffCC
rkqc/tools/gui/items/TransformationBasedSynthesisItem.py
3
3462
# RevKit: A Toolkit for Reversible Circuit Design (www.revkit.org) # Copyright (C) 2009-2011 The RevKit Developers <revkit@informatik.uni-bremen.de> # # 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 Founda...
bsd-2-clause
Grogdor/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
sparkslabs/kamaelia_
Tests/Python/Kamaelia/Audio/test_RawAudioMixer.py
3
9846
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License,...
apache-2.0
catapult-project/catapult
third_party/gsutil/gslib/tests/test_retention.py
5
28651
# -*- coding: utf-8 -*- # Copyright 2017 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 require...
bsd-3-clause
anryko/ansible
lib/ansible/modules/network/aci/aci_firmware_source.py
8
7622
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Dag Wieers (dagwieers) <dag@wieers.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_ver...
gpl-3.0
vabs22/zulip
zerver/tests/test_settings.py
1
10444
from __future__ import absolute_import from __future__ import print_function import ujson from django.http import HttpResponse from mock import patch from typing import Any, Dict from zerver.lib.initial_password import initial_password from zerver.lib.sessions import get_session_dict_user from zerver.lib.test_classe...
apache-2.0
RRSCDS/douban-mining
src/Python/api-oauth/oauthx.py
1
2742
# -*- coding: utf8 -*- import urllib, urllib2 import json # key and secret通过创建豆瓣app获得(无审核) # http://developers.douban.com/apikey/ APIKEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' SECRET = 'xxxxxxxxxxxxxxxx' CALLBACK_URL = 'http://www.douban.com' GETTOKEN_URL = 'https://www.douban.com/service/auth2/token' def getToken(cod...
mit
cauchycui/scikit-learn
sklearn/decomposition/tests/test_truncated_svd.py
240
6055
"""Test truncated SVD transformer.""" import numpy as np import scipy.sparse as sp from sklearn.decomposition import TruncatedSVD from sklearn.utils import check_random_state from sklearn.utils.testing import (assert_array_almost_equal, assert_equal, assert_raises, assert_greater, ...
bsd-3-clause
peterfpeterson/mantid
scripts/test/SANS/SANSReductionStepsUserFileTest.py
3
7817
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + impo...
gpl-3.0
py4n6/aff4
scons-local-1.2.0/SCons/Subst.py
12
33897
"""SCons.Subst SCons string substitution. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundation # # 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 withou...
gpl-3.0
klmitch/appathy
tests/unit/test_actions.py
1
26457
# Copyright (C) 2012 by Kevin L. Mitchell <klmitch@mit.edu> # # 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 p...
gpl-3.0
beezee/GAE-Django-base-app
django/contrib/syndication/views.py
151
9070
from django.conf import settings from django.contrib.sites.models import get_current_site from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist from django.http import HttpResponse, Http404 from django.template import loader, TemplateDoesNotExist, RequestContext from django.utils import feedgenera...
bsd-3-clause
Kast0rTr0y/ansible
lib/ansible/modules/cloud/cloudstack/cs_nic.py
44
8589
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2016, René Moser <mail@renemoser.net> # # 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 Lice...
gpl-3.0
CLVsol/clvsol_odoo_addons
clv_lab_test_history/wizard/lab_test_result_mass_edit.py
1
1108
# -*- coding: utf-8 -*- # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import logging from odoo import api, fields, models _logger = logging.getLogger(__name__) class LabTestResultMassEdit(models.TransientModel): _inherit = 'clv.lab...
agpl-3.0
mclois/iteexe
twisted/enterprise/xmlreflector.py
19
5780
# -*- test-case-name: twisted.test.test_reflector -*- # Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """This module is deprecated.""" import warnings warnings.warn("twisted.enterprise.xmlreflector is deprecated", DeprecationWarning) import os from twisted.internet import defer fr...
gpl-2.0
ssaeger/scikit-learn
sklearn/feature_selection/tests/test_base.py
143
3670
import numpy as np from scipy import sparse as sp from nose.tools import assert_raises, assert_equal from numpy.testing import assert_array_equal from sklearn.base import BaseEstimator from sklearn.feature_selection.base import SelectorMixin from sklearn.utils import check_array class StepSelector(SelectorMixin, Ba...
bsd-3-clause
christoph2/k-os
kosek/ImplementationDefinition/AttributeDefinitions.py
1
15627
#!/usr/bin/python # -*- coding: utf-8 -*- __version__ = '0.9.2rc-1' __copyright__ = """ k_os (Konnex Operating-System based on the OSEK/VDX-Standard). (C) 2007-2013 by Christoph Schueler <github.com/Christoph2, cpu12.gems@googlemail.com> All Rights Reserved This p...
gpl-2.0
jerli/sympy
sympy/external/tests/test_scipy.py
115
1147
# This testfile tests SymPy <-> SciPy compatibility # Don't test any SymPy features here. Just pure interaction with SciPy. # Always write regular SymPy tests for anything, that can be tested in pure # Python (without scipy). Here we test everything, that a user may need when # using SymPy with SciPy from sympy.exter...
bsd-3-clause
xdevelsistemas/taiga-back-community
taiga/mdrender/extensions/target_link.py
2
1878
# -*- coding: utf-8 -*- # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz> # Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net> # Copyright (C) 2014-2016 Alejandro Alonso...
agpl-3.0
oihane/odoo
addons/portal/mail_message.py
354
3518
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2011 OpenERP S.A (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
c0710204/mirrorsBistu
pypi/bandersnatch/lib/python2.7/site-packages/requests/packages/charade/utf8prober.py
2919
2652
######################## 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
henrysher/yum-utils
repo-rss.py
5
10315
#!/usr/bin/python # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it w...
gpl-2.0
brianrodri/oppia
core/domain/rte_component_registry.py
4
5620
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
apache-2.0
abaditsegay/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_importhooks.py
56
8330
import sys import imp import os import unittest from test import test_support test_src = """\ def get_name(): return __name__ def get_file(): return __file__ """ absimp = "import sub\n" relimp = "from . import sub\n" deeprelimp = "from .... import sub\n" futimp = "from __future__ import absolute_import\n" r...
apache-2.0
TalShafir/ansible
lib/ansible/utils/module_docs_fragments/backup.py
427
1071
# Copyright (c) 2015 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. # # Ansi...
gpl-3.0