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 |
|---|---|---|---|---|---|
BehavioralInsightsTeam/edx-platform | cms/djangoapps/contentstore/management/commands/tests/test_git_export.py | 19 | 7342 | """
Unittests for exporting to git via management command.
"""
import copy
import os
import shutil
import StringIO
import subprocess
import unittest
from uuid import uuid4
from django.conf import settings
from django.core.management import call_command
from django.core.management.base import CommandError
from django.... | agpl-3.0 |
srowen/spark | examples/src/main/python/ml/vector_indexer_example.py | 27 | 1646 | #
# 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 us... | apache-2.0 |
wso2-dev/device-cloud-appliances | Arduino Robot/PC_Clients/PythonTestClients/PublishDirectToBAM/BAMPythonPublisher/gen-py/ThriftSecureEventTransmissionService/ThriftSecureEventTransmissionService.py | 15 | 47576 | #
# Autogenerated by Thrift Compiler (0.9.1)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
from ttypes import *
from thrift.Thrift import TProcessor
from thrift.transport import TTransport
... | apache-2.0 |
0x27/clusterd | src/platform/jboss/deployers/jmxinvokerservlet.py | 6 | 2732 | from src.platform.jboss.interfaces import JINTERFACES
from src.module.deploy_utils import invkdeploy, parse_war_path
from os.path import abspath
from random import randint
from log import LOG
import utility
versions = ["Any", "3.2", "4.0", "4.2", "5.0", "5.1"]
title = JINTERFACES.JIN
def deploy(fingerengine, fingerpri... | mit |
alianmohammad/pd-gem5 | src/arch/x86/isa/insts/simd128/floating_point/data_transfer/__init__.py | 91 | 2383 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
kirca/OpenUpgrade | addons/event/res_partner.py | 329 | 1228 | # -*- 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 |
marmarek/pykickstart | pykickstart/commands/upgrade.py | 8 | 3931 | #
# Chris Lumens <clumens@redhat.com>
#
# Copyright 2005, 2006, 2007 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# General Public License v.2. This program is distributed in the hope that it
# ... | gpl-2.0 |
ecoal95/servo | tests/wpt/web-platform-tests/tools/third_party/attrs/tests/test_funcs.py | 41 | 17193 | """
Tests for `attr._funcs`.
"""
from __future__ import absolute_import, division, print_function
from collections import Mapping, OrderedDict, Sequence
import pytest
from hypothesis import HealthCheck, assume, given, settings
from hypothesis import strategies as st
import attr
from attr import asdict, assoc, ast... | mpl-2.0 |
proxysh/Safejumper-for-Mac | buildlinux/env32/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/pyopenssl.py | 501 | 11778 | '''SSL with SNI_-support for Python 2. Follow these instructions if you would
like to verify SSL certificates in Python 2. Note, the default libraries do
*not* do certificate checking; you need to do additional work to validate
certificates yourself.
This needs the following packages installed:
* pyOpenSSL (tested wi... | gpl-2.0 |
DoubleNegativeVisualEffects/cortex | test/IECore/config/scope/testScope.py | 12 | 1899 | ##########################################################################
#
# Copyright (c) 2011, 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 |
SRabbelier/Melange | thirdparty/google_appengine/lib/django_0_96/django/utils/translation/trans_real.py | 32 | 18516 | "Translation helper functions"
import locale
import os
import re
import sys
import gettext as gettext_module
from cStringIO import StringIO
from django.utils.functional import lazy
try:
import threading
hasThreads = True
except ImportError:
hasThreads = False
if hasThreads:
currentThread = threading.... | apache-2.0 |
yhoshino11/pytest_example | .tox/flake8/bin/activate_this.py | 1076 | 1137 | """By using execfile(this_file, dict(__file__=this_file)) you will
activate this virtualenv environment.
This can be used when you must use an existing Python interpreter, not
the virtualenv bin/python
"""
try:
__file__
except NameError:
raise AssertionError(
"You must run this like execfile('path/to/... | mit |
stanlyxiang/incubator-hawq | tools/bin/pythonSrc/pexpect-4.2/tests/test_async.py | 8 | 1824 | try:
import asyncio
except ImportError:
asyncio = None
import sys
import unittest
import pexpect
from .PexpectTestCase import PexpectTestCase
def run(coro):
return asyncio.get_event_loop().run_until_complete(coro)
@unittest.skipIf(asyncio is None, "Requires asyncio")
class AsyncTests(PexpectTestCase):
... | apache-2.0 |
magic0704/python-keystoneclient | keystoneclient/openstack/common/apiclient/exceptions.py | 4 | 3611 | # Copyright 2010 Jacob Kaplan-Moss
# Copyright 2011 Nebula, Inc.
# Copyright 2013 Alessio Ababilov
# Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# ... | apache-2.0 |
xsleonard/wsgisubdomain | wsgisubdomain.py | 1 | 2974 | import socket
from threading import Lock
from __about__ import __version__, __title__, __description__
__all__ = ['__version__', '__title__', '__description__',
'SubdomainDispatcher']
class SubdomainDispatcher(object):
""" A WSGI application that gets or creates other WSGI applications
based on t... | mit |
JsNoNo/scikit-learn | sklearn/utils/validation.py | 29 | 24630 | """Utilities for input validation"""
# Authors: Olivier Grisel
# Gael Varoquaux
# Andreas Mueller
# Lars Buitinck
# Alexandre Gramfort
# Nicolas Tresegnie
# License: BSD 3 clause
import warnings
import numbers
import numpy as np
import scipy.sparse as sp
from ..externals i... | bsd-3-clause |
CallaJun/hackprince | indico/requests/compat.py | 1039 | 1469 | # -*- coding: utf-8 -*-
"""
pythoncompat
"""
from .packages import chardet
import sys
# -------
# Pythons
# -------
# Syntax sugar.
_ver = sys.version_info
#: Python 2.x?
is_py2 = (_ver[0] == 2)
#: Python 3.x?
is_py3 = (_ver[0] == 3)
try:
import simplejson as json
except (ImportError, SyntaxError):
# si... | lgpl-3.0 |
NikolaYolov/invenio_backup | modules/bibsword/lib/bibsword_config.py | 10 | 4567 | ## This file is part of Invenio.
## Copyright (C) 2010, 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) any later version.
##
... | gpl-2.0 |
fnouama/intellij-community | python/lib/Lib/distutils/fancy_getopt.py | 85 | 18441 | """distutils.fancy_getopt
Wrapper around the standard getopt module that provides the following
additional features:
* short and long options are tied together
* options have help strings, so fancy_getopt could potentially
create a complete usage summary
* options set attributes of a passed-in object
"""
# ... | apache-2.0 |
idem2lyon/persomov | couchpotato/core/plugins/category/main.py | 61 | 3963 | import traceback
from couchpotato import get_db
from couchpotato.api import addApiView
from couchpotato.core.event import addEvent
from couchpotato.core.helpers.encoding import toUnicode
from couchpotato.core.logger import CPLog
from couchpotato.core.plugins.base import Plugin
from .index import CategoryIndex, Categor... | gpl-3.0 |
Accelerite/cinder | cinder/volume/drivers/ibm/flashsystem.py | 2 | 53461 | # Copyright 2014 IBM Corp.
# Copyright 2014 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 |
omprakasha/odoo | addons/purchase/__openerp__.py | 259 | 3787 | # -*- 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 |
sugarguo/Flask_Blog | ext_lib/pip/_vendor/html5lib/html5parser.py | 169 | 117500 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import with_metaclass
import types
from . import inputstream
from . import tokenizer
from . import treebuilders
from .treebuilders._base import Marker
from . import utils
from . import constants
from .constants import spaceChara... | gpl-3.0 |
CML/GP0-2.6.35-Kernel | tools/perf/scripts/python/failed-syscalls-by-pid.py | 944 | 1869 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
collinjackson/mojo | third_party/cython/python_flags.py | 53 | 1266 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import os
import sys
import sysconfig
def main():
"""Command line utility to retrieve compilation options for python modules'
"""
pars... | bsd-3-clause |
django-nonrel/django | django/template/base.py | 105 | 50229 | from __future__ import absolute_import, unicode_literals
import re
from functools import partial
from inspect import getargspec
from django.conf import settings
from django.template.context import (BaseContext, Context, RequestContext,
ContextPopException)
from django.utils.importlib import import_module
from dja... | bsd-3-clause |
olysonek/tuned | tests/unit/hardware/test_device_matcher_udev.py | 1 | 1221 | import unittest2
import pyudev
from tuned.hardware.device_matcher_udev import DeviceMatcherUdev
class DeviceMatcherUdevTestCase(unittest2.TestCase):
@classmethod
def setUpClass(cls):
cls.udev_context = pyudev.Context()
cls.matcher = DeviceMatcherUdev()
def test_simple_search(self):
try:
device = pyudev.D... | gpl-2.0 |
hamiltont/CouchPotatoServer | libs/tornado/auth.py | 4 | 60110 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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 a... | gpl-3.0 |
LynxyssCZ/Flexget | flexget/plugins/modify/trackers.py | 9 | 4009 | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import logging
import re
from flexget import plugin
from flexget.event import event
log = logging.getLogger('modify_torrents')
class AddTrackers(object):
"""
... | mit |
d2bit/compose | compose/cli/verbose_proxy.py | 67 | 1691 |
import functools
from itertools import chain
import logging
import pprint
import six
def format_call(args, kwargs):
args = (repr(a) for a in args)
kwargs = ("{0!s}={1!r}".format(*item) for item in six.iteritems(kwargs))
return "({0})".format(", ".join(chain(args, kwargs)))
def format_return(result, ma... | apache-2.0 |
anorfleet/turntable | test/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.py | 895 | 2517 | # -*- coding: utf-8 -*-
"""
requests.exceptions
~~~~~~~~~~~~~~~~~~~
This module contains the set of Requests' exceptions.
"""
from .packages.urllib3.exceptions import HTTPError as BaseHTTPError
class RequestException(IOError):
"""There was an ambiguous exception that occurred while handling your
request.""... | mit |
spbguru/repo1 | tests/unit/py2/nupic/encoders/category_test.py | 7 | 8756 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# 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 ... | gpl-3.0 |
Microsoft/PTVS | Python/Product/PythonTools/ptvsd/repl/ipython_client.py | 4 | 15596 | # Python Tools for Visual Studio
# Copyright(c) Microsoft Corporation
# 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
#
# THI... | apache-2.0 |
TheDSCPL/SSRE_2017-2018_group8 | Projeto/Python/cryptopy/crypto/cipher/arc4.py | 1 | 2710 | # -*- coding: utf-8 -*-
""" crypto.cipher.arc4
A Stream Cipher Encryption Algorithm 'Arcfour'
A few lines of code/ideas borrowed from [PING]
[PING] CipherSaber implementation by Ka-Ping Yee <ping@lfw.org>, 5 May 2000.
Some documentation text and test vectors taken from [IDARC4]
[IDARC... | mit |
shacker/django | django/contrib/gis/gdal/libgdal.py | 32 | 3612 | import logging
import os
import re
from ctypes import CDLL, CFUNCTYPE, c_char_p, c_int
from ctypes.util import find_library
from django.contrib.gis.gdal.error import GDALException
from django.core.exceptions import ImproperlyConfigured
logger = logging.getLogger('django.contrib.gis')
# Custom library path set?
try:
... | bsd-3-clause |
pauloschilling/sentry | src/sentry/migrations/0079_auto__del_unique_affecteduserbygroup_project_ident_group__add_unique_a.py | 36 | 22695 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'AffectedUserByGroup', fields ['project', 'ident', 'group']
db.delete_unique... | bsd-3-clause |
peterm-itr/edx-platform | common/lib/xmodule/xmodule/seq_module.py | 16 | 6368 | import json
import logging
import warnings
from lxml import etree
from xblock.fields import Integer, Scope
from xblock.fragment import Fragment
from pkg_resources import resource_string
from .exceptions import NotFoundError
from .fields import Date
from .mako_module import MakoModuleDescriptor
from .progress import ... | agpl-3.0 |
dstftw/youtube-dl | youtube_dl/extractor/zapiks.py | 53 | 3870 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
parse_duration,
parse_iso8601,
xpath_with_ns,
xpath_text,
int_or_none,
)
class ZapiksIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?zapiks\.(?:fr|com)/(?:(?:[a-z]{2... | unlicense |
zerovm/zerovm-cli | zpmlib/tests/test_zapptemplate.py | 2 | 3058 | # Copyright 2014 Rackspace, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | apache-2.0 |
MobinRanjbar/hue | desktop/core/ext-py/Django-1.6.10/tests/admin_custom_urls/models.py | 67 | 2501 | from functools import update_wrapper
from django.contrib import admin
from django.core.urlresolvers import reverse
from django.db import models
from django.http import HttpResponseRedirect
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Action(models.Model):
name ... | apache-2.0 |
lochiiconnectivity/exabgp | lib/exabgp/application/cli.py | 1 | 4426 | #!/usr/bin/env python
# encoding: utf-8
"""
cli.py
Created by Thomas Mangin on 2014-12-22.
Copyright (c) 2009-2015 Exa Networks. All rights reserved.
"""
import sys
from exabgp.dep.cmd2 import cmd
from exabgp.version import version
class Completed (cmd.Cmd):
# use_rawinput = False
# prompt = ''
# doc_header =... | bsd-3-clause |
taiwenko/python | acs/acs_cold_start.py | 1 | 7587 | #!/usr/bin/env python
from time import sleep
import twk_utils
import math
import sys
import xpf6020
import tools.utils as tools
import watlowf4
from tools import shell
from blessings import Terminal
t = Terminal()
franz_num = raw_input('How many Franz are you testing? [1,2,3,or 4]: ').strip()
cycle_num = raw_input('... | mit |
2014cdbg6/cdbg6 | wsgi/static/Brython2.1.0-20140419-113919/Lib/sre_constants.py | 692 | 7172 | #
# Secret Labs' Regular Expression Engine
#
# various symbols used by the regular expression engine.
# run this script to update the _sre include files!
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support modul... | gpl-2.0 |
spring-week-topos/nova-week | nova/tests/api/openstack/compute/contrib/test_console_output.py | 17 | 7261 | # Copyright 2011 Eldar Nugaev
# 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 ... | apache-2.0 |
SmileyJames/shopify_python_api | setup.py | 1 | 1764 | from setuptools import setup
NAME='ShopifyAPI'
exec(open('shopify/version.py').read())
DESCRIPTION='Shopify API for Python'
LONG_DESCRIPTION="""\
The ShopifyAPI library allows python developers to programmatically
access the admin section of stores using an ActiveResource like
interface similar the ruby Shopify API ge... | mit |
MDAnalysis/pyQuteMol | python/OctaMap.py | 1 | 5260 |
import numpy
def Area(a, b, c):
v = numpy.cross(b-a,c-a)
return numpy.sqrt(numpy.dot(v,v))*0.5
class OctaMapSamp:
def __init__(self):
self.size = 0
self.dir = None
self.dirrot = None
self.weight = None
def nsamp(self):
return len(self.dir)
def DuplicateT... | gpl-2.0 |
3ev0/android-whitelist | blackswan/core/modularity.py | 1 | 1286 | __author__ = 'ivo'
import logging
import argparse
from blackswan import config
_log = logging.getLogger(__name__)
class ModuleBase():
argparser = None
def __init__(self):
self.config = {}
@classmethod
def register(cls):
cls.argparser = argparse.ArgumentParser(description=cls.descri... | apache-2.0 |
alsrgv/tensorflow | tensorflow/python/autograph/operators/slices.py | 16 | 4572 | # Copyright 2018 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 |
vmanoria/bluemix-hue-filebrowser | hue-3.8.1-bluemix/desktop/core/ext-py/django-nose-1.3/django_nose/tools.py | 52 | 1647 | # vim: tabstop=4 expandtab autoindent shiftwidth=4 fileencoding=utf-8
"""
Provides Nose and Django test case assert functions
"""
from django.test.testcases import TransactionTestCase
from django.core import mail
import re
## Python
from nose import tools
for t in dir(tools):
if t.startswith('assert_'):
... | gpl-2.0 |
rbuffat/pyidf | tests/test_surfacecontaminantsourceandsinkgenericboundarylayerdiffusion.py | 1 | 2309 | import os
import tempfile
import unittest
import logging
from pyidf import ValidationLevel
import pyidf
from pyidf.idf import IDF
from pyidf.internal_gains import SurfaceContaminantSourceAndSinkGenericBoundaryLayerDiffusion
log = logging.getLogger(__name__)
class TestSurfaceContaminantSourceAndSinkGenericBoundaryLaye... | apache-2.0 |
wakatime/sketch-wakatime | WakaTime.sketchplugin/Contents/Resources/wakatime/packages/pytz/__init__.py | 70 | 34435 | '''
datetime.tzinfo timezone definitions generated from the
Olson timezone database:
ftp://elsie.nci.nih.gov/pub/tz*.tar.gz
See the datetime section of the Python Library Reference for information
on how to use these modules.
'''
# The IANA (nee Olson) database is updated several times a year.
OLSON_VERSION = '2... | bsd-3-clause |
webmasterraj/FogOrNot | flask/lib/python2.7/site-packages/boto3/docs/waiter.py | 4 | 3546 | # Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | gpl-2.0 |
fuzeman/Catalytic | deluge/ui/coreconfig.py | 6 | 2408 | #
# coreconfig.py
#
# Copyright (C) 2008 Andrew Resch <andrewresch@gmail.com>
#
# Deluge is free software.
#
# You may 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 ve... | gpl-3.0 |
daoluan/decode-Django | Django-1.5.1/django/contrib/localflavor/sk/sk_districts.py | 543 | 2453 | """
Slovak districts according to http://sk.wikipedia.org/wiki/Administrat%C3%ADvne_%C4%8Dlenenie_Slovenska
"""
from django.utils.translation import ugettext_lazy as _
DISTRICT_CHOICES = (
('BB', _('Banska Bystrica')),
('BS', _('Banska Stiavnica')),
('BJ', _('Bardejov')),
('BN', _('Banovce nad Bebravo... | gpl-2.0 |
heke123/chromium-crosswalk | tools/perf/page_sets/image_decoding_measurement.py | 35 | 1492 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import page as page_module
from telemetry import story
class ImageDecodingMeasurementPage(page_module.Page):
def __init__(self, url, ... | bsd-3-clause |
drammock/pyeparse | pyeparse/utils.py | 1 | 3374 | # Authors: Denis Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
import numpy as np
from os import path as op
import glob
import tempfile
from shutil import rmtree
import atexit
def create_chunks(sequence, size):
"""Generate chunks from a sequence
Note. copied from MNE-Python
Parameters... | bsd-3-clause |
adaussy/eclipse-monkey-revival | plugins/python/org.eclipse.eclipsemonkey.lang.python/Lib/email/parser.py | 392 | 3300 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw, Thomas Wouters, Anthony Baxter
# Contact: email-sig@python.org
"""A parser of RFC 2822 and MIME email messages."""
__all__ = ['Parser', 'HeaderParser']
import warnings
from cStringIO import StringIO
from email.feedparser import FeedParser
... | epl-1.0 |
pinkflozd/android_kernel_motorola_falcon | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # 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 |
hrachyastepanyan/ace-ios | tools/python/unittests/linphonetester.py | 14 | 32001 | from datetime import timedelta, datetime
from nose.tools import assert_equals
from copy import deepcopy
import linphone
import logging
import os
import sys
import time
import weakref
test_domain = "sipopen.example.org"
auth_domain = "sip.example.org"
test_username = "liblinphone_tester"
test_password = "secret"
test_... | gpl-2.0 |
wilvk/ansible | lib/ansible/plugins/action/sros.py | 10 | 3128 | #
# (c) 2016 Red Hat 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 d... | gpl-3.0 |
gzorin/RSXGL | extsrc/mesa/src/mapi/glapi/gen/gl_XML.py | 1 | 25960 | #!/usr/bin/env python
# (C) Copyright IBM Corporation 2004, 2005
# 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 limitation
# ... | bsd-2-clause |
houzhenggang/hiwifi-openwrt-HC5661-HC5761 | staging_dir/host/lib/python2.7/idlelib/PathBrowser.py | 133 | 2640 | import os
import sys
import imp
from idlelib.TreeWidget import TreeItem
from idlelib.ClassBrowser import ClassBrowser, ModuleBrowserTreeItem
class PathBrowser(ClassBrowser):
def __init__(self, flist):
self.init(flist)
def settitle(self):
self.top.wm_title("Path Browser")
self.top.wm_... | gpl-2.0 |
eadgarchen/tensorflow | tensorflow/python/ops/linalg/linear_operator_diag.py | 19 | 9005 | # 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 |
nuagenetworks/vspk-python | vspk/v6/fetchers/nuegressadvfwdtemplates_fetcher.py | 2 | 2191 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# 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 copyrigh... | bsd-3-clause |
Gussy/bigcouch | couchjs/scons/scons-local-2.0.1/SCons/Tool/sunf77.py | 61 | 2166 | """SCons.Tool.sunf77
Tool-specific initialization for sunf77, the Sun Studio F77 compiler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 20... | apache-2.0 |
tchellomello/home-assistant | homeassistant/components/switchbot/switch.py | 7 | 2810 | """Support for Switchbot."""
import logging
from typing import Any, Dict
# pylint: disable=import-error, no-member
import switchbot
import voluptuous as vol
from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchEntity
from homeassistant.const import CONF_MAC, CONF_NAME, CONF_PASSWORD
import homeassistant... | apache-2.0 |
RockySteveJobs/python-for-android | python3-alpha/python3-src/Lib/lib2to3/fixes/fix_idioms.py | 203 | 4876 | """Adjust some old Python 2 idioms to their modern counterparts.
* Change some type comparisons to isinstance() calls:
type(x) == T -> isinstance(x, T)
type(x) is T -> isinstance(x, T)
type(x) != T -> not isinstance(x, T)
type(x) is not T -> not isinstance(x, T)
* Change "while 1:" into "while True:".... | apache-2.0 |
bayandin/selenium | py/setup.py | 2 | 3684 | #!/usr/bin/env python
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# ... | apache-2.0 |
poryfly/scikit-learn | sklearn/cross_decomposition/cca_.py | 209 | 3150 | from .pls_ import _PLS
__all__ = ['CCA']
class CCA(_PLS):
"""CCA Canonical Correlation Analysis.
CCA inherits from PLS with mode="B" and deflation_mode="canonical".
Read more in the :ref:`User Guide <cross_decomposition>`.
Parameters
----------
n_components : int, (default 2).
numb... | bsd-3-clause |
zhjunlang/kbengine | kbe/res/scripts/common/Lib/encodings/uu_codec.py | 77 | 2725 | """Python 'uu_codec' Codec - UU content transfer encoding.
This codec de/encodes from bytes to bytes.
Written by Marc-Andre Lemburg (mal@lemburg.com). Some details were
adapted from uu.py which was written by Lance Ellinghouse and
modified by Jack Jansen and Fredrik Lundh.
"""
import codecs
import binascii
from io i... | lgpl-3.0 |
lifei/flask-admin | flask_admin/contrib/mongoengine/typefmt.py | 44 | 1357 | from jinja2 import Markup, escape
from mongoengine.base import BaseList
from mongoengine.fields import GridFSProxy, ImageGridFsProxy
from flask_admin.model.typefmt import BASE_FORMATTERS, list_formatter
from . import helpers
def grid_formatter(view, value):
if not value.grid_id:
return ''
args = h... | bsd-3-clause |
wesleywerner/conspire | src/const.py | 1 | 7542 | STATE_MENU = 1
STATE_BUILD = 2
STATE_UFO = 3
STATE_FLIGHT = 4
STATE_RESULTS = 5
STATE_END = 100
# parts available for use per level number.
LEVEL_PARTS = {
1: ('tax returns', 'shopping list', 'todo list',
'ludum dare comments', 'bank accounts',
'website passwords', 'IP address scamlist',
),... | gpl-3.0 |
thomasvincent/utilities | NagiosPlugins/check_procs/pexpect/FSM.py | 21 | 13318 | #!/usr/bin/env python
"""This module implements a Finite State Machine (FSM). In addition to state
this FSM also maintains a user defined "memory". So this FSM can be used as a
Push-down Automata (PDA) since a PDA is a FSM + memory.
The following describes how the FSM works, but you will probably also need to
see the... | apache-2.0 |
rhertzog/django | tests/generic_views/test_list.py | 31 | 12130 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase, override_settings
from django.utils.encoding import force_str
from django.views.generic.base import View
from .models import Artist, Author, Book, ... | bsd-3-clause |
proxysh/Safejumper-for-Desktop | buildmac/Resources/env/lib/python2.7/site-packages/twisted/internet/base.py | 11 | 43587 | # -*- test-case-name: twisted.test.test_internet,twisted.internet.test.test_core -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Very basic functionality for a Reactor implementation.
"""
from __future__ import division, absolute_import
import socket # needed only for sync-dns
from zo... | gpl-2.0 |
novel/fbsd-libvirt | docs/apibuild.py | 3 | 97034 | #!/usr/bin/python -u
#
# This is the API builder, it parses the C sources and build the
# API formal description in XML.
#
# See Copyright for the status of this software.
#
# daniel@veillard.com
#
import os, sys
import string
import glob
quiet=True
warnings=0
debug=False
debugsym=None
#
# C parser analysis code
#
in... | lgpl-2.1 |
vIiRuS/Lagerregal | devices/migrations/0002_auto_20151105_0513.py | 1 | 5237 | from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('users', '0006_auto_20151105_0513'),
('devices', '0001_initial'),
('devicetypes', '0001_initial'),
migrations.swappab... | bsd-3-clause |
akshaybabloo/Car-ND | Project_5/laneline.py | 1 | 21371 | import cv2
import glob
import pickle
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from sklearn.metrics import mean_squared_error
x_cor = 9 #Number of corners to find
y_cor = 6
# Prepare object points, like (0,0,0), (1,0,0), (2,0,0) ....,(6,5,0)
objp = np.zeros((y_cor*x_cor,3), np... | mit |
amir-qayyum-khan/lore | ui/tests/test_learningresources_views.py | 1 | 12408 | """
Test the importer views to make sure they work.
"""
from __future__ import unicode_literals
import json
import logging
import os
from django.conf import settings
from django.core.files.storage import default_storage
from django.core.urlresolvers import resolve
import ui.urls
from learningresources.models import... | agpl-3.0 |
mozilla/bramble | vendor-local/lib/python/werkzeug/security.py | 75 | 4705 | # -*- coding: utf-8 -*-
"""
werkzeug.security
~~~~~~~~~~~~~~~~~
Security related helpers such as secure password hashing tools.
:copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import os
import hmac
import posixpath
from iter... | mpl-2.0 |
python-mode/python-mode | pymode/__init__.py | 2 | 1191 | """Pymode support functions."""
import sys
from importlib.machinery import PathFinder as _PathFinder
import vim # noqa
if not hasattr(vim, 'find_module'):
vim.find_module = _PathFinder.find_module
def auto():
"""Fix PEP8 erorrs in current buffer.
pymode: uses it in command PymodeLintAuto with pymode#... | lgpl-3.0 |
bsmr-ansible/ansible-modules-extras | cloud/amazon/ec2_eni.py | 18 | 19563 | #!/usr/bin/python
#
# This is a 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 Ansible library is distributed in the hope that i... | gpl-3.0 |
tosh/mongrel2 | examples/http_0mq/upload.py | 96 | 1431 | from mongrel2 import handler
try:
import json
except:
import simplejson as json
import hashlib
sender_id = "82209006-86FF-4982-B5EA-D1E29E55D481"
conn = handler.Connection(sender_id, "tcp://127.0.0.1:9997",
"tcp://127.0.0.1:9996")
while True:
print "WAITING FOR REQUEST"
req... | bsd-3-clause |
ElDeveloper/qiime | qiime/make_per_library_sff.py | 15 | 3549 | #!/usr/bin/env python
from __future__ import division
__author__ = "Kyle Bittinger"
__copyright__ = "Copyright 2011, The QIIME Project"
__credits__ = ["Kyle Bittinger"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Kyle Bittinger"
__email__ = "kylebittinger@gmail.com"
import itertools
import os
imp... | gpl-2.0 |
uganikov/qemu | scripts/tracetool/backend/__init__.py | 3 | 3270 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Backend management.
Creating new backends
---------------------
A new backend named 'foo-bar' corresponds to Python module
'tracetool/backend/foo_bar.py'.
A backend module should provide a docstring, whose first non-empty line will be
considered its short descripti... | gpl-2.0 |
abhishek-ch/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/gis/sitemaps/kml.py | 121 | 2480 | from django.core import urlresolvers
from django.contrib.sitemaps import Sitemap
from django.contrib.gis.db.models.fields import GeometryField
from django.db import models
class KMLSitemap(Sitemap):
"""
A minimal hook to produce KML sitemaps.
"""
geo_format = 'kml'
def __init__(self, locations=Non... | apache-2.0 |
40223148/finaltest | static/Brython3.1.0-20150301-090019/Lib/inspect.py | 637 | 78935 | """Get useful information from live Python objects.
This module encapsulates the interface provided by the internal special
attributes (co_*, im_*, tb_*, etc.) in a friendlier fashion.
It also provides some help for examining source code and class layout.
Here are some of the useful functions provided by this module:... | gpl-3.0 |
ayoubg/gem5-graphics | gem5/src/sim/probe/Probe.py | 62 | 2370 | # -*- mode:python -*-
# Copyright (c) 2013 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementatio... | bsd-3-clause |
aricchen/openHR | openerp/addons/purchase_requisition/report/requisition.py | 53 | 1558 | # -*- 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 |
randynobx/ansible | test/units/test_constants.py | 187 | 3203 | # -*- coding: utf-8 -*-
# (c) 2017 Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... | gpl-3.0 |
tlatzko/spmcluster | .tox/docs/lib/python2.7/site-packages/sphinx/ext/autosummary/__init__.py | 4 | 19494 | # -*- coding: utf-8 -*-
"""
sphinx.ext.autosummary
~~~~~~~~~~~~~~~~~~~~~~
Sphinx extension that adds an autosummary:: directive, which can be
used to generate function/method/attribute/etc. summary lists, similar
to those output eg. by Epydoc and other API doc generation tools.
An :autolink: r... | bsd-2-clause |
sklnet/beyonwiz-enigma2 | lib/python/Screens/Ci.py | 6 | 11343 | from Screen import Screen
from Components.ActionMap import ActionMap
from Components.ActionMap import NumberActionMap
from Components.Label import Label
from Components.config import config, ConfigSubsection, ConfigSelection, ConfigSubList, getConfigListEntry, KEY_LEFT, KEY_RIGHT, KEY_0, ConfigNothing, ConfigPIN
from ... | gpl-2.0 |
Joergen/zamboni | apps/tags/tests/test_models.py | 4 | 5503 | from nose.tools import eq_
import amo.tests
from addons.models import Addon
from tags.models import AddonTag, Tag, TagStat
from tags.tasks import clean_tag
class TestTagManager(amo.tests.TestCase):
def test_not_blacklisted(self):
"""Make sure Tag Manager filters right for not blacklisted tags."""
... | bsd-3-clause |
foobacca/django-cms | cms/tests/toolbar.py | 1 | 7223 | from __future__ import with_statement
from cms.api import create_page
from cms.toolbar.toolbar import CMSToolbar
from cms.middleware.toolbar import ToolbarMiddleware
from cms.test_utils.testcases import SettingsOverrideTestCase
from cms.test_utils.util.context_managers import SettingsOverride
from django.contrib.auth.... | bsd-3-clause |
davidcusatis/horizon | horizon/test/tests/exceptions.py | 28 | 2588 | # 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
# d... | apache-2.0 |
googlegenomics/gcp-variant-transforms | gcp_variant_transforms/options/variant_transform_options_test.py | 1 | 10813 | # 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 required by applicable law or... | apache-2.0 |
edx/course-discovery | course_discovery/apps/course_metadata/migrations/0068_auto_20171108_1614.py | 1 | 1536 | # Generated by Django 1.11.3 on 2017-11-08 16:14
import django.db.models.deletion
import django_extensions.db.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0007_auto_20171004_1133'),
('course_metadata', '0067_auto_20171108_1432... | agpl-3.0 |
mabevillar/rmtk | rmtk/vulnerability/mdof_to_sdof/first_mode/first_mode.py | 3 | 4228 | #!/usr/bin/env python
# LICENSE
#
# Copyright (c) 2015, GEM Foundation, Anirudh Rao
#
# The rmtk 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) an... | agpl-3.0 |
thegooglecodearchive/tvstreamrecord | cherrypy/_cpwsgi_server.py | 82 | 2836 | """WSGI server interface (see PEP 333). This adds some CP-specific bits to
the framework-agnostic wsgiserver package.
"""
import sys
import cherrypy
from cherrypy import wsgiserver
class CPWSGIServer(wsgiserver.CherryPyWSGIServer):
"""Wrapper for wsgiserver.CherryPyWSGIServer.
wsgiserver has been design... | gpl-3.0 |
testmana2/test | QScintilla/Lexers/LexerPerl.py | 2 | 2856 | # -*- coding: utf-8 -*-
# Copyright (c) 2004 - 2015 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Module implementing a Perl lexer with some additional methods.
"""
from __future__ import unicode_literals
from PyQt5.Qsci import QsciLexerPerl
from .Lexer import Lexer
import Preferences
class LexerPerl(Lexer, ... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.