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 |
|---|---|---|---|---|---|
huawei-cloud/compass-core | compass/tests/config_management/installers/test_os_installer.py | 4 | 1069 | import unittest2
from compass.config_management.installers import os_installer
class DummyInstaller(os_installer.Installer):
NAME = 'dummy'
def __init__(self):
pass
class Dummy2Installer(os_installer.Installer):
NAME = 'dummy'
def __init__(self):
pass
class TestInstallerFunction... | apache-2.0 |
akosyakov/intellij-community | python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/main.py | 250 | 11605 | """
Main program for 2to3.
"""
from __future__ import with_statement
import sys
import os
import difflib
import logging
import shutil
import optparse
from . import refactor
def diff_texts(a, b, filename):
"""Return a unified diff of two strings."""
a = a.splitlines()
b = b.splitlines()
return diffl... | apache-2.0 |
ckuethe/gr-nmea | docs/doxygen/swig_doc.py | 220 | 8657 | #
# Copyright 2010,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later version... | gpl-3.0 |
RalfJung/lilass | qt_frontend.py | 1 | 7267 | # DSL - easy Display Setup for Laptops
# Copyright (C) 2012-2015 Ralf Jung <post@ralfj.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 Foundation; either version 2 of the License, or
# (at your option... | gpl-2.0 |
RulersOfAsgard/ALAMO-worker | alamo_worker/plugins/tests/test_evaluate.py | 1 | 14081 | # -*- coding: utf-8 -*-
from collections import OrderedDict
from unittest.case import TestCase
from unittest import mock
from alamo_common.test.utils import override_settings
from alamo_worker.plugins.druid import DruidResult
from alamo_worker.plugins.evaluate import ResultEvaluator
from alamo_worker.plugins.http_che... | apache-2.0 |
UT-Austin-FIS/django-coverage | django_coverage/settings.py | 6 | 4126 | """
Copyright 2009 55 Minutes (http://www.55minutes.com)
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 t... | apache-2.0 |
mollstam/UnrealPy | UnrealPyEmbed/Source/Python/Lib/python27/plat-mac/lib-scriptpackages/CodeWarrior/__init__.py | 73 | 5499 | """
Package generated from /Volumes/Sap/Applications (Mac OS 9)/Metrowerks CodeWarrior 7.0/Metrowerks CodeWarrior/CodeWarrior IDE 4.2.5
"""
from warnings import warnpy3k
warnpy3k("In 3.x, the CodeWarrior package is removed.", stacklevel=2)
import aetools
Error = aetools.Error
import CodeWarrior_suite
import Standard_... | mit |
Lyleo/OmniMarkupPreviewer | OmniMarkupLib/Renderers/libs/python3/genshi/input.py | 2 | 16564 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2009 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | mit |
vladsaveliev/bcbio-nextgen | bcbio/pipeline/main.py | 1 | 27548 | """Main entry point for distributed next-gen sequencing pipelines.
Handles running the full pipeline based on instructions
"""
from __future__ import print_function
from collections import defaultdict
import copy
import os
import sys
import resource
import tempfile
import toolz as tz
from bcbio import log, heterogen... | mit |
justinvforvendetta/electrum-pkb | lib/asn1tinydecoder.py | 15 | 3835 | # 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 will be usefu... | gpl-3.0 |
p4datasystems/CarnotKEdist | dist/Lib/test/test_cmath.py | 10 | 19937 | from test.test_support import run_unittest, verbose
from test.test_math import parse_testfile, test_file
import unittest
import cmath, math
from cmath import phase, polar, rect, pi
INF = float('inf')
NAN = float('nan')
complex_zeros = [complex(x, y) for x in [0.0, -0.0] for y in [0.0, -0.0]]
complex_infinities = [com... | apache-2.0 |
tbombach/autorest | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyBoolean/autorestbooltestservice/auto_rest_bool_test_service.py | 8 | 2187 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
trbs/kafka-python | kafka/consumer/multiprocess.py | 15 | 10401 | from __future__ import absolute_import
from collections import namedtuple
import logging
from multiprocessing import Process, Manager as MPManager
try:
from Queue import Empty, Full # python 3
except ImportError:
from queue import Empty, Full # python 2
import time
from .base import (
Consumer,
AUTO_C... | apache-2.0 |
jtimberman/omnibus | source/libxml2-2.7.7/python/tests/xpathret.py | 87 | 1312 | #!/usr/bin/python -u
import sys
import libxml2
#memory debug specific
libxml2.debugMemory(1)
#
# A document hosting the nodes returned from the extension function
#
mydoc = libxml2.newDoc("1.0")
def foo(ctx, str):
global mydoc
#
# test returning a node set works as expected
#
parent = mydoc.newD... | apache-2.0 |
OpenEdgeComputing/elijah-openstack | compute/cloudlet_driver.py | 2 | 39971 | # Elijah: Cloudlet Infrastructure for Mobile Computing
#
# Author: Kiryong Ha <krha@cmu.edu>
#
# Copyright (C) 2011-2014 Carnegie Mellon University
# 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 th... | apache-2.0 |
BichenWuUCB/squeezeDet | src/dataset/kitti.py | 1 | 10284 | # Author: Bichen Wu (bichen@berkeley.edu) 08/25/2016
"""Image data base class for kitti"""
import cv2
import os
import numpy as np
import subprocess
from dataset.imdb import imdb
from utils.util import bbox_transform_inv, batch_iou
class kitti(imdb):
def __init__(self, image_set, data_path, mc):
imdb.__init_... | bsd-2-clause |
infinitecoin/infinitecoin | contrib/bitrpc/bitrpc.py | 2348 | 7835 | from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:8332")
else:
access = Ser... | mit |
2uller/LotF | App/Lib/encodings/gb18030.py | 61 | 1070 | #
# gb18030.py: Python Unicode Codec for GB18030
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_cn, codecs
import _multibytecodec as mbc
codec = _codecs_cn.getcodec('gb18030')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(m... | gpl-2.0 |
0x7E/ubuntu-tweak | ubuntutweak/tweaks/sound.py | 4 | 3087 | # Ubuntu Tweak - Ubuntu Configuration Tool
#
# Copyright (C) 2007-2012 Tualatrix Chou <tualatrix@gmail.com>
#
# Ubuntu Tweak 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
... | gpl-2.0 |
LTLMoP/slugs | tools/translateSafetySlugsSpecToSyntCompAIGFormat.py | 6 | 12021 | #!/usr/bin/python
#
import random
import os
import sys
import subprocess, md5, time
# =====================================================
# Option configuration
# =====================================================
slugsExecutableAndBasicOptions = sys.argv[0][0:sys.argv[0].rfind("tools/findMinimalUnrealizableCore... | bsd-3-clause |
gvb/odoo | addons/purchase_analytic_plans/purchase_analytic_plans.py | 378 | 1667 | # -*- 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 |
ryfeus/lambda-packs | Tensorflow/source/tensorflow/contrib/nn/python/ops/cross_entropy.py | 104 | 7764 | # 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... | mit |
blaiseli/p4-phylogenetics | p4/nexussets.py | 1 | 69575 | import os
import sys
import string
import array
import types
import copy
from var import var
# Don't bother with NexusToken2, cuz sets blocks are small
from nexustoken import nexusSkipPastNextSemiColon, safeNextTok
import func
from p4exceptions import P4Error
# [Examples from the paup manual,
# but note the bad charp... | gpl-2.0 |
mennis/dpkt | dpkt/ssl.py | 16 | 19632 | # $Id$
# Portion Copyright 2012 Google Inc. All rights reserved.
"""Secure Sockets Layer / Transport Layer Security."""
import dpkt
import ssl_ciphersuites
import struct
import binascii
import traceback
import datetime
#
# Note from April 2011: cde...@gmail.com added code that parses SSL3/TLS messages more in depth.... | bsd-3-clause |
NikolaYolov/invenio_backup | modules/websubmit/lib/functions/CaseEDS.py | 35 | 4620 | ## This file is part of Invenio.
## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 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... | gpl-2.0 |
simbha/mAngE-Gin | lib/django/contrib/formtools/tests/tests.py | 32 | 7417 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import os
import unittest
import warnings
from django import http
from django.contrib.formtools import preview, utils
from django.test import TestCase, override_settings
from django.utils._os import upath
from django.contrib.formtools.te... | mit |
nanditav/15712-TensorFlow | tensorflow/python/saved_model/signature_constants.py | 10 | 1977 | # 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 |
dkubiak789/odoo | addons/sale_stock/sale_stock.py | 21 | 26561 | # -*- 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 |
AndrewGYork/tools | zaber.py | 1 | 8750 | import time
import serial
class Stage:
"""Zaber stage(s), attached through the (USB?) serial port."""
def __init__(
self,
port_name, # For example, 'COM3' on Windows
timeout=1,
verbose=True,
very_verbose=False):
"""port_name: which serial port the stage is connec... | gpl-2.0 |
alkyl1978/gnuradio | gr-trellis/examples/python/test_tcm.py | 45 | 4831 | #!/usr/bin/env python
from gnuradio import gr
from gnuradio import trellis, digital, blocks
from gnuradio import eng_notation
import math
import sys
import random
from gnuradio.trellis import fsm_utils
from gnuradio.eng_option import eng_option
from optparse import OptionParser
import numpy
try:
from gnuradio imp... | gpl-3.0 |
adilimad1/google-blog-converters-appengine | src/movabletype2blogger/movabletype2blogger.py | 30 | 2023 | #!/usr/bin/env python
# Copyright 2008 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.txt
#
# Unless required by applicable law or... | apache-2.0 |
jfunez/scielo-manager | scielomanager/journalmanager/tests/modelfactories.py | 1 | 7014 | # coding: utf-8
import factory
import datetime
from journalmanager import models
class ArticleFactory(factory.Factory):
FACTORY_FOR = models.Article
front = {
'default-language': 'en',
'title-group': {
'en': u'Article Title',
'pt': u'Título do Artigo',
}
... | bsd-2-clause |
rbharvs/mnd-learning | supervised.py | 1 | 8636 | import sys
import parsetags
import numpy as np
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.naive_bayes import MultinomialNB
from sklearn import svm
from sklearn.decomposition import PCA as PCA
from mpl_toolkits.mplot3d import Axes... | mit |
scottkmaxwell/modified | setup.py | 2 | 1319 | import os
import modified
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def get_description():
f = open(os.path.abspath(os.path.join(os.path.dirname(__file__), 'README.md')), 'r')
try:
return f.read()
finally:
f.close()
setup(
name="m... | mit |
liorvh/raspberry_pwn | src/pentest/metagoofil/hachoir_parser/common/msdos.py | 95 | 1455 | """
MS-DOS structures.
Documentation:
- File attributes:
http://www.cs.colorado.edu/~main/cs1300/include/ddk/winddk.h
"""
from hachoir_core.field import StaticFieldSet
from hachoir_core.field import Bit, NullBits
_FIELDS = (
(Bit, "read_only"),
(Bit, "hidden"),
(Bit, "system"),
(NullBits, "reserved... | gpl-3.0 |
adityasharad/storm | dev-tools/travis/save-logs.py | 37 | 1806 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 t... | apache-2.0 |
jamiefolsom/xblock-sdk | script/startnew.py | 6 | 1834 | #!/usr/bin/env python
"""
Use cookiecutter to create a new XBlock project.
"""
import os
import re
import textwrap
from cookiecutter.main import cookiecutter
EXPLANATION = """\
This script will create a new XBlock project.
You will be prompted for two pieces of information:
* Short name: a single word, all lower-... | agpl-3.0 |
XXMrHyde/android_external_chromium_org | build/mac/change_mach_o_flags.py | 232 | 10318 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Usage: change_mach_o_flags.py [--executable-heap] [--no-pie] <executablepath>
Arranges for the executable at |executable_path| ... | bsd-3-clause |
medspx/QGIS | python/plugins/processing/algs/gdal/GdalAlgorithmProvider.py | 2 | 6534 | # -*- coding: utf-8 -*-
"""
***************************************************************************
GdalAlgorithmProvider.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*****************... | gpl-2.0 |
kenwang815/KodiPlugins | script.module.youtube.dl/lib/youtube_dl/extractor/criterion.py | 38 | 1279 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class CriterionIE(InfoExtractor):
_VALID_URL = r'https?://www\.criterion\.com/films/(?P<id>[0-9]+)-.+'
_TEST = {
'url': 'http://www.criterion.com/films/184-le-samourai',
'md5': 'bc51be... | gpl-2.0 |
davgibbs/django | django/core/files/locks.py | 725 | 3516 | """
Portable file locking utilities.
Based partially on an example by Jonathan Feignberg in the Python
Cookbook [1] (licensed under the Python Software License) and a ctypes port by
Anatoly Techtonik for Roundup [2] (license [3]).
[1] http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65203
[2] http://sourceforg... | bsd-3-clause |
apeyser/nest-simulator | pynest/examples/precise_spiking.py | 17 | 4794 | # -*- coding: utf-8 -*-
#
# precise_spiking.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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... | gpl-2.0 |
jorisvandenbossche/numpy | tools/swig/test/testArray.py | 121 | 12933 | #! /usr/bin/env python
from __future__ import division, absolute_import, print_function
# System imports
from distutils.util import get_platform
import os
import sys
import unittest
# Import NumPy
import numpy as np
major, minor = [ int(d) for d in np.__version__.split(".")[:2] ]
if major == 0:
BadListError = T... | bsd-3-clause |
sburnett/seattle | seattlegeni/website/html/tests/ut_html_test_get_resources.py | 1 | 5863 | """
<Program>
test_get_resources.py
<Started>
8/30/2009
<Author>
Jason Chen
jchen@cs.washington.edu
<Purpose>
Tests that the get_resources view function
handles normal operation and exceptions correctly.
<Notes>
See test_register.py for an explanation of our usage of the Django test... | mit |
trondeau/gnuradio | gr-digital/python/digital/qa_pn_correlator_cc.py | 57 | 1657 | #!/usr/bin/env python
#
# Copyright 2007,2010,2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at ... | gpl-3.0 |
huobaowangxi/scikit-learn | sklearn/decomposition/dict_learning.py | 83 | 44062 | """ Dictionary learning
"""
from __future__ import print_function
# Author: Vlad Niculae, Gael Varoquaux, Alexandre Gramfort
# License: BSD 3 clause
import time
import sys
import itertools
from math import sqrt, ceil
import numpy as np
from scipy import linalg
from numpy.lib.stride_tricks import as_strided
from ..b... | bsd-3-clause |
daGrevis/squirrel | ware.py | 1 | 2640 | import inspect
class MiddlewareDuplicationError(Exception):
def __init__(self, middleware_name, middleware_names):
message = ("Middleware `{}` was already found in `{}` middlewares!"
.format(middleware_name, middleware_names))
super().__init__(message)
class MiddlewareMissing... | mit |
sam-tsai/django | django/core/management/commands/runserver.py | 203 | 7383 | from __future__ import unicode_literals
import errno
import os
import re
import socket
import sys
from datetime import datetime
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.management.base import BaseCommand, CommandError
from django.core.servers.basehttp i... | bsd-3-clause |
nadavitay/linux-3.14.1 | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
ejekt/rigging-system | Modules/System/groupSelected.py | 1 | 9019 | import maya.cmds as mc
from functools import partial
import os
import System.utils as utils
class GroupSelected:
def __init__(self):
self.objectsToGroup = []
def showUI(self):
# build the grouping GUI
self.findSelectionToGroup()
if len(self.objectsToGroup) == 0:
return
self.dUiElement... | mit |
Hillshum/gPodder-tagging | src/gpodder/gtkui/desktop/podcastdirectory.py | 2 | 6986 | # -*- coding: utf-8 -*-
#
# gPodder - A media aggregator and podcast client
# Copyright (c) 2005-2010 Thomas Perl and the gPodder Team
#
# gPodder 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... | gpl-3.0 |
tersmitten/ansible | contrib/inventory/libvirt_lxc.py | 196 | 1357 | #!/usr/bin/env python
# (c) 2013, Michael Scherer <misc@zarb.org>
#
# 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 o... | gpl-3.0 |
ai-se/parGALE | algorithms/serial/gale/gale.py | 1 | 6295 | from __future__ import print_function, division
import sys, os
sys.path.append(os.path.abspath("."))
from utils.lib import *
from algorithms.serial.algorithm import Algorithm
from where import Node, sqrt
__author__ = 'panzer'
def default_settings():
"""
Default Settings for NSGA 3
:return: default settings
""... | unlicense |
alxgu/ansible | lib/ansible/modules/cloud/ovirt/ovirt_template_facts.py | 55 | 3558 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (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
#... | gpl-3.0 |
Serag8/Bachelor | google_appengine/lib/django-1.4/django/template/loaders/eggs.py | 103 | 1038 | # Wrapper for loading templates from eggs via pkg_resources.resource_string.
try:
from pkg_resources import resource_string
except ImportError:
resource_string = None
from django.template.base import TemplateDoesNotExist
from django.template.loader import BaseLoader
from django.conf import settings
class Loa... | mit |
yksalun/hugula | Client/tools/site-packages/pyExcelerator/Bitmap.py | 25 | 12183 | #!/usr/bin/env python
# -*- coding: windows-1251 -*-
# Copyright (C) 2005 Roman V. Kiseliov
# Portions are Copyright (c) 2004 Evgeny Filatov <fufff@users.sourceforge.net>
# Portions are Copyright (c) 2002-2004 John McNamara (Perl Spreadsheet::WriteExcel)
# All rights reserved.
#
# Redistribution and use in s... | mit |
nuxeh/keystone | keystone/tests/unit/test_ldap_tls_livetest.py | 5 | 4398 | # Copyright 2013 OpenStack Foundation
# Copyright 2013 IBM Corp.
#
# 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 app... | apache-2.0 |
vmax-feihu/hue | desktop/core/ext-py/Django-1.6.10/extras/csrf_migration_helper.py | 59 | 12998 | #!/usr/bin/env python
# This script aims to help developers locate forms and view code that needs to
# use the new CSRF protection in Django 1.2. It tries to find all the code that
# may need the steps described in the CSRF documentation. It does not modify
# any code directly, it merely attempts to locate it. Deve... | apache-2.0 |
davidvon/pipa-pay-server | site-packages/distribute-0.6.27-py2.7.egg/setuptools/tests/test_develop.py | 64 | 2377 | """develop tests
"""
import sys
import os, shutil, tempfile, unittest
import tempfile
import site
from StringIO import StringIO
from distutils.errors import DistutilsError
from setuptools.command.develop import develop
from setuptools.command import easy_install as easy_install_pkg
from setuptools.dist import Distribu... | apache-2.0 |
mancoast/CPythonPyc_test | fail/340_test_format.py | 84 | 17219 | from test.support import verbose, TestFailed
import locale
import sys
import test.support as support
import unittest
maxsize = support.MAX_Py_ssize_t
# test string formatting operator (I am not sure if this is being tested
# elsewhere but, surely, some of the given cases are *not* tested because
# they crash python)
... | gpl-3.0 |
fbradyirl/home-assistant | tests/components/remote/test_init.py | 4 | 3632 | """The tests for the Remote component, adapted from Light Test."""
# pylint: disable=protected-access
import unittest
from homeassistant.const import (
ATTR_ENTITY_ID,
STATE_ON,
STATE_OFF,
CONF_PLATFORM,
SERVICE_TURN_ON,
SERVICE_TURN_OFF,
)
import homeassistant.components.remote as remote
fro... | apache-2.0 |
nolanliou/tensorflow | tensorflow/python/kernel_tests/zero_division_test.py | 139 | 2389 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
mush42/mezzanine | mezzanine/blog/tests.py | 39 | 2373 | from __future__ import unicode_literals
from unittest import skipUnless
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
from django.core.urlresolvers import reverse
from mezzanine.blog.models import BlogPost
from mezzanine.conf import settings
from mezzanine.core.mod... | bsd-2-clause |
intake/filesystem_spec | fsspec/implementations/tests/test_ftp.py | 1 | 3434 | import os
import subprocess
import sys
import time
import pytest
import fsspec
from fsspec import open_files
from fsspec.implementations.ftp import FTPFileSystem
here = os.path.dirname(os.path.abspath(__file__))
@pytest.fixture()
def ftp():
pytest.importorskip("pyftpdlib")
P = subprocess.Popen(
[sy... | bsd-3-clause |
endlessm/chromium-browser | tools/metrics/histograms/update_use_counter_css.py | 10 | 2761 | #!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Scans the Chromium source of UseCounter, formats the Feature enum for
histograms.xml and merges it. This script can also generate a ... | bsd-3-clause |
bdh1011/wau | venv/lib/python2.7/site-packages/celery/events/dumper.py | 8 | 3285 | # -*- coding: utf-8 -*-
"""
celery.events.dumper
~~~~~~~~~~~~~~~~~~~~
This is a simple program that dumps events to the console
as they happen. Think of it like a `tcpdump` for Celery events.
"""
from __future__ import absolute_import, print_function
import sys
from datetime import datetime
from ce... | mit |
LBenzahia/cltk | cltk/stop/old_english/stops.py | 2 | 5395 | """This stopword list is adapted from the
Introduction to Old English website at ``https://lrc.la.utexas.edu/eieol/engol``.
"""
__author__ = ['Sourav Singh <ssouravsingh12@gmail.com>']
__license__ = 'GPL License.'
STOPS_LIST = ['and',
'on',
'þonne',
'wið',
'... | mit |
0111001101111010/open-health-inspection-api | venv/lib/python2.7/site-packages/pip/_vendor/distlib/markers.py | 1261 | 6282 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""Parser for the environment markers micro-language defined in PEP 345."""
import ast
import os
import sys
import platform
from .compa... | gpl-2.0 |
FNCS/ns-3.24 | src/topology-read/bindings/modulegen__gcc_LP64.py | 28 | 172229 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
bratsche/Neutron-Drive | google_appengine/lib/django_1_2/django/contrib/localflavor/za/forms.py | 273 | 1908 | """
South Africa-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField
from django.utils.checksums import luhn
from django.utils.translation import gettext as _
import re
from datetime import date
id_re = re... | bsd-3-clause |
google/importlab | importlab/import_finder.py | 1 | 5424 | # NOTE: Do not add any dependencies to this file - it needs to be run in a
# subprocess by a python version that might not have any installed packages,
# including importlab itself.
from __future__ import print_function
import ast
import json
import os
import sys
# Pytype doesn't recognize the `major` attribute:
# h... | apache-2.0 |
shakalaca/ASUS_ZenFone_A450CG | external/chromium_org/third_party/mesa/src/src/gallium/drivers/svga/svgadump/svga_dump.py | 50 | 11879 | #!/usr/bin/env python
'''
Generates dumper for the SVGA 3D command stream using pygccxml.
Jose Fonseca <jfonseca@vmware.com>
'''
copyright = '''
/**********************************************************
* Copyright 2009 VMware, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any p... | gpl-2.0 |
automl/paramsklearn | tests/test_classification.py | 1 | 31256 | import os
import resource
import sys
import traceback
import unittest
import mock
import numpy as np
import sklearn.datasets
import sklearn.decomposition
import sklearn.cross_validation
import sklearn.ensemble
import sklearn.svm
from sklearn.utils.testing import assert_array_almost_equal
from HPOlibConfigSpace.config... | bsd-3-clause |
Drvanon/Game | venv/lib/python3.3/site-packages/sqlalchemy/sql/visitors.py | 1 | 10003 | # sql/visitors.py
# Copyright (C) 2005-2013 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
"""Visitor/traversal interface and library functions.
SQLAlchemy schema and expressio... | apache-2.0 |
rynomster/django | django/db/backends/sqlite3/base.py | 4 | 18967 | """
SQLite3 backend for django.
Works with either the pysqlite2 module or the sqlite3 module in the
standard library.
"""
from __future__ import unicode_literals
import datetime
import decimal
import re
import warnings
from django.conf import settings
from django.db import utils
from django.db.backends import utils ... | bsd-3-clause |
znoland3/zachdemo | venvdir/lib/python3.4/site-packages/setuptools/msvc9_support.py | 429 | 2187 | try:
import distutils.msvc9compiler
except ImportError:
pass
unpatched = dict()
def patch_for_specialized_compiler():
"""
Patch functions in distutils.msvc9compiler to use the standalone compiler
build for Python (Windows only). Fall back to original behavior when the
standalone compiler is no... | mit |
edlabh/SickRage | lib/tvdb_api/tvdb_api.py | 12 | 35715 | # !/usr/bin/env python2
# encoding:utf-8
# author:dbr/Ben
#project:tvdb_api
#repository:http://github.com/dbr/tvdb_api
#license:unlicense (http://unlicense.org/)
from functools import wraps
import traceback
__author__ = "dbr/Ben"
__version__ = "1.9"
import os
import re
import time
import getpass
import StringIO
impo... | gpl-3.0 |
blackbliss/medity-expo-2014 | remote-api/flask/lib/python2.7/site-packages/flask_httpauth.py | 2 | 3984 | """
flask.ext.httpauth
==================
This module provides Basic and Digest HTTP authentication for Flask routes.
:copyright: (C) 2014 by Miguel Grinberg.
:license: BSD, see LICENSE for more details.
"""
from functools import wraps
from hashlib import md5
from random import Random, SystemRandom
from flask impo... | mit |
vrum/yaml-cpp | test/gmock-1.7.0/gtest/scripts/fuse_gtest_files.py | 2577 | 8813 | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | mit |
mattrobenolt/django | tests/redirects_tests/tests.py | 336 | 3396 | from django import http
from django.conf import settings
from django.contrib.redirects.middleware import RedirectFallbackMiddleware
from django.contrib.redirects.models import Redirect
from django.contrib.sites.models import Site
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase, ... | bsd-3-clause |
ppwwyyxx/tensorflow | tensorflow/python/ops/structured/structured_tensor_spec_test.py | 3 | 9305 | # Copyright 2019 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 |
tastynoodle/django | django/contrib/gis/feeds.py | 5 | 5930 | from __future__ import unicode_literals
from django.contrib.syndication.views import Feed as BaseFeed
from django.utils.feedgenerator import Atom1Feed, Rss201rev2Feed
class GeoFeedMixin(object):
"""
This mixin provides the necessary routines for SyndicationFeed subclasses
to produce simple GeoRSS or W3C G... | bsd-3-clause |
arbrandes/edx-platform | openedx/core/lib/tests/assertions/events.py | 3 | 9890 | """Assertions related to event validation"""
import json
import pprint
def assert_event_matches(expected, actual, tolerate=None):
"""
Compare two event dictionaries.
Fail if any discrepancies exist, and output the list of all discrepancies. The intent is to produce clearer
error messages than "{ so... | agpl-3.0 |
samsu/neutron | services/loadbalancer/drivers/driver_base.py | 12 | 3022 | # Copyright 2014 A10 Networks
#
# 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 |
NickelMedia/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/views/printing_unittest.py | 121 | 8467 | # Copyright (C) 2010, 2012 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions an... | bsd-3-clause |
rodrigocaldas/trabalho_programacao_web | modules/requests/packages/chardet/big5freq.py | 3133 | 82594 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 R... | mit |
KaranToor/MA450 | google-cloud-sdk/.install/.backup/lib/surface/compute/instance_groups/unmanaged/describe.py | 3 | 1636 | # 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 ag... | apache-2.0 |
tedlaz/pyted | tests/pyappgen/pyappgen/qtreports.py | 1 | 3002 | # -*- coding: utf-8 -*-
'''
Created on 2014-01-24
@author: tedlaz
'''
from PyQt4 import QtGui, Qt
class rptDlg(QtGui.QDialog):
def __init__(self,html=u'Δοκιμή',title='Document1',parent=None):
super(rptDlg, self).__init__(parent)
self.setAttribute(Qt.Qt.WA_DeleteOnClose)
... | gpl-3.0 |
thresholdsoftware/asylum | openerp/addons/account_budget/wizard/__init__.py | 444 | 1196 | # -*- 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 |
southpawtech/TACTIC-DEV | src/bin/js_compactor.py | 7 | 3086 | ############################################################
#
# Copyright (c) 2009, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way witho... | epl-1.0 |
libvirt/autotest | client/common_lib/magic.py | 1 | 58623 | #!/usr/bin/python
"""
Library used to determine a file MIME type by its magic number, it doesn't have
any external dependencies. Based on work of Jason Petrone (jp_py@jsnp.net),
adapted to autotest.
Command Line Usage: Running as 'python magic.py file_path' will print a
mime string (or just a description) of t... | gpl-2.0 |
klickagent/phantomjs | src/qt/qtwebkit/Tools/gdb/webkit.py | 115 | 11357 | # Copyright (C) 2010, Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the... | bsd-3-clause |
Mitchkoens/sympy | sympy/physics/quantum/fermion.py | 59 | 4518 | """Fermionic quantum operators."""
from sympy.core.compatibility import u
from sympy import Integer
from sympy.physics.quantum import Operator
from sympy.physics.quantum import HilbertSpace, Ket, Bra
from sympy.functions.special.tensor_functions import KroneckerDelta
__all__ = [
'FermionOp',
'FermionFockKet'... | bsd-3-clause |
olemis/sqlalchemy | lib/sqlalchemy/dialects/mssql/base.py | 9 | 66501 | # mssql/base.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
:name: Microsoft SQL Server
Auto Increment Behavior
-----... | mit |
lshain-android-source/external-chromium_org | tools/telemetry/telemetry/core/chrome/inspector_console.py | 29 | 1991 | # 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.
import json
import logging
class InspectorConsole(object):
def __init__(self, inspector_backend):
self._inspector_backend = inspector_backend
s... | bsd-3-clause |
Adnn/django | tests/migrations/test_graph.py | 167 | 11672 | import warnings
from django.db.migrations.exceptions import (
CircularDependencyError, NodeNotFoundError,
)
from django.db.migrations.graph import RECURSION_DEPTH_WARNING, MigrationGraph
from django.test import SimpleTestCase
from django.utils.encoding import force_text
class GraphTests(SimpleTestCase):
"""
... | bsd-3-clause |
nirmeshk/oh-mainline | vendor/packages/Django/django/views/decorators/cache.py | 106 | 3973 | from functools import wraps
from django.utils.decorators import decorator_from_middleware_with_args, available_attrs
from django.utils.cache import patch_cache_control, add_never_cache_headers
from django.middleware.cache import CacheMiddleware
def cache_page(*args, **kwargs):
"""
Decorator for views that tri... | agpl-3.0 |
simonzhangsm/voltdb | third_party/python/schemaobject/schemaobject/foreignkey.py | 15 | 7854 | import re
from schemaobject.collections import OrderedDict
REGEX_FK_REFERENCE_OPTIONS = r"""
`%s`(?:.(?!ON\ DELETE)(?!ON\ UPDATE))*
(?:\sON\sDELETE\s(?P<on_delete>(?:RESTRICT|CASCADE|SET\ NULL|NO\ ACTION)))?
(?:\sON\sUPDATE\s(?P<on_update>(?:RESTRICT|CASCADE|SET\ NULL|NO\ ACTION)))?
"""
def ForeignK... | agpl-3.0 |
Distrotech/scons | build/scons/build/lib/SCons/Tool/sunlink.py | 2 | 2417 | """SCons.Tool.sunlink
Tool-specific initialization for the Sun Solaris (Forte) linker.
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, 2009, 2... | mit |
alfa-jor/addon | mediaserver/platformcode/html_info_window.py | 3 | 9787 | # -*- coding: utf-8 -*-
from core.tmdb import Tmdb
from platformcode import logger
class InfoWindow(object):
otmdb = None
item_title = ""
item_serie = ""
item_temporada = 0
item_episodio = 0
result = {}
@staticmethod
def get_language(lng):
# Cambiamos el formato del Idioma
... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.