repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
msvbhat/distaf
distaf/util.py
1
4872
# This file is part of DiSTAF # Copyright (C) 2015-2016 Red Hat, Inc. <http://www.redhat.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # any l...
gpl-2.0
pombredanne/psd-tools
tests/test_pixels.py
8
5675
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import pytest from psd_tools import PSDImage, Layer, Group from .utils import full_name PIXEL_COLORS = ( # filename probe point pixel value ('1layer.psd', (5, 5), (0x27, 0xBA, 0x0F)), (...
mit
jazkarta/edx-platform-for-isc
common/djangoapps/track/tests/test_util.py
239
1203
from datetime import datetime import json from pytz import UTC from django.test import TestCase from track.utils import DateTimeJSONEncoder class TestDateTimeJSONEncoder(TestCase): def test_datetime_encoding(self): a_naive_datetime = datetime(2012, 05, 01, 07, 27, 10, 20000) a_tz_datetime = dat...
agpl-3.0
Red-M/CloudBot-legacy
plugins/tell.py
2
3615
""" tell.py: written by sklnd in July 2009 2010.01.25 - modified by Scaevolus""" import time import re from util import hook, timesince db_ready = [] def db_init(db, conn): """Check that our db has the tell table, create it if not.""" global db_ready if not conn.name in db_ready: db.exec...
gpl-3.0
swenson/sagewiki
unidecode/unidecode/x025.py
252
3871
data = ( '-', # 0x00 '-', # 0x01 '|', # 0x02 '|', # 0x03 '-', # 0x04 '-', # 0x05 '|', # 0x06 '|', # 0x07 '-', # 0x08 '-', # 0x09 '|', # 0x0a '|', # 0x0b '+', # 0x0c '+', # 0x0d '+', # 0x0e '+', # 0x0f '+', # 0x10 '+', # 0x11 '+', # 0x12 '+', # 0x13 '+', # 0...
gpl-2.0
jakub-d/kubernetes
hack/lookup_pull.py
246
1299
#!/usr/bin/env python # Copyright 2015 The Kubernetes Authors. # # 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 appli...
apache-2.0
snowballstem/snowball
python/stemwords.py
1
3437
import sys import codecs import snowballstemmer def usage(): print('''usage: %s [-l <language>] [-i <input file>] [-o <output file>] [-c <character encoding>] [-p[2]] [-h] The input file consists of a list of words to be stemmed, one per line. Words should be in lower case, but (for English) A-Z letters are mappe...
bsd-3-clause
markYoungH/chromium.src
media/tools/constrained_network_server/traffic_control.py
186
12569
# 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. """Traffic control library for constraining the network configuration on a port. The traffic controller sets up a constrained network configuration on a...
bsd-3-clause
marcelocure/django
tests/gis_tests/utils.py
327
1377
from unittest import skip from django.conf import settings from django.db import DEFAULT_DB_ALIAS def no_backend(test_func, backend): "Use this decorator to disable test on specified backend." if settings.DATABASES[DEFAULT_DB_ALIAS]['ENGINE'].rsplit('.')[-1] == backend: @skip("This test is skipped on...
bsd-3-clause
chromium/chromium
components/policy/tools/generate_policy_source.py
1
66390
#!/usr/bin/env python3 # 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. '''python3 %(prog)s [options] Pass at least: --chrome-version-file <path to src/chrome/VERSION> or --all-chrome-versions --target-...
bsd-3-clause
ader1990/linux-kernel-3-13-5-scsi-fix
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
5411
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
gpl-2.0
aferr/TimingCompartments
configs/topologies/BaseTopology.py
15
2949
# Copyright (c) 2012 Advanced Micro Devices, 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...
bsd-3-clause
helloworldajou/webserver
demos/classifier_webcam.py
4
7059
#!/usr/bin/env python2 # # Example to run classifier on webcam stream. # Brandon Amos & Vijayenthiran # 2016/06/21 # # Copyright 2015-2016 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 ...
apache-2.0
ibinti/intellij-community
python/helpers/pycharm/__jb.for_twisted/twisted/plugins/teamcity_plugin.py
11
1180
import sys from teamcity.unittestpy import TeamcityTestResult from twisted.trial.reporter import Reporter from twisted.python.failure import Failure from twisted.plugins.twisted_trial import _Reporter class FailureWrapper(Failure): def __getitem__(self, key): return self.value[key] class TeamcityReport...
apache-2.0
Lujeni/ansible
lib/ansible/modules/network/nxos/nxos_vrf.py
5
17884
#!/usr/bin/python # # 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 distribut...
gpl-3.0
sonaht/ansible
lib/ansible/modules/cloud/amazon/ec2_metric_alarm.py
57
11596
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
gpl-3.0
murraymeehan/marsyas
scripts/Python/batch.py
7
1475
import os from glob import glob inputDirectory = "../../../../Databases/taslp/"; outputDirectory = "../../../output3 "; testCommand = " "; #testCommand = " -q 1 "; beginCommand = "../../bin/release/peakClustering "; beginCommand = "..\\..\\bin\\release\\peakClustering.exe "; endCommand = " -P -f -S 0 ...
gpl-2.0
sathiamour/foursquared
util/oget.py
262
3416
#!/usr/bin/python """ Pull a oAuth protected page from foursquare. Expects ~/.oget to contain (one on each line): CONSUMER_KEY CONSUMER_KEY_SECRET USERNAME PASSWORD Don't forget to chmod 600 the file! """ import httplib import os import re import sys import urllib import urllib2 import urlparse import user from xml....
apache-2.0
dmarteau/QGIS
python/plugins/db_manager/db_plugins/gpkg/sql_dictionary.py
71
1200
# -*- coding: utf-8 -*- """ *************************************************************************** sql_dictionary.py --------------------- Date : April 2012 Copyright : (C) 2012 by Giuseppe Sucameli Email : brush dot tyler at gmail dot com ************...
gpl-2.0
smourph/PGo-TrainerTools
pgoapi/protos/POGOProtos/Networking/Responses/GetIncensePokemonResponse_pb2.py
12
6521
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: POGOProtos/Networking/Responses/GetIncensePokemonResponse.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _messag...
gpl-3.0
renegelinas/mi-instrument
mi/idk/platform/test/test_metadata.py
11
2605
#!/usr/bin/env python """ @package mi.idk.platform.test.test_metadata @file mi.idk/platform/test/test_metadata.py @author Bill French @brief test metadata object """ __author__ = 'Bill French' __license__ = 'Apache 2.0' from os.path import basename, dirname from os import makedirs from os.path import exists import s...
bsd-2-clause
pgoeser/gnuradio
gr-howto-write-a-block/apps/howto_square.py
36
2164
#!/usr/bin/env python ################################################## # Gnuradio Python Flow Graph # Title: Howto Square # Generated: Thu Nov 12 11:26:07 2009 ################################################## import howto from gnuradio import eng_notation from gnuradio import gr from gnuradio.eng_option import eng...
gpl-3.0
EricMuller/mynotes-backend
requirements/twisted/Twisted-17.1.0/src/twisted/test/test_paths.py
13
74412
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test cases covering L{twisted.python.filepath}. """ from __future__ import division, absolute_import import os, time, pickle, errno, stat from pprint import pformat from twisted.python.compat import _PY3, unicode from twisted.python.win32 i...
mit
blockstack/packaging
imported/future/src/libpasteurize/fixes/fix_add_all_future_builtins.py
60
1270
""" For the ``future`` package. Adds this import line:: from builtins import (ascii, bytes, chr, dict, filter, hex, input, int, list, map, next, object, oct, open, pow, range, round, str, super, zip) to a module, irrespective of whether each definition is used....
gpl-3.0
manpen/thrill
frontends/swig_python/python_test.py
4
4291
#!/usr/bin/env python ########################################################################## # frontends/swig_python/python_test.py # # Part of Project Thrill - http://project-thrill.org # # Copyright (C) 2015 Timo Bingmann <tb@panthema.net> # # All rights reserved. Published under the BSD-2 license in the LICENSE ...
bsd-2-clause
lkeijser/func
test/unittest/test_func_arg.py
8
4973
## ## Copyright 2007, Red Hat, Inc ## see AUTHORS ## ## This software may be freely redistributed under the terms of the GNU ## general public license. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave...
gpl-2.0
mujiansu/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/distutils/command/bdist_dumb.py
53
4901
"""distutils.command.bdist_dumb Implements the Distutils 'bdist_dumb' command (create a "dumb" built distribution -- i.e., just an archive to be unpacked under $prefix or $exec_prefix).""" # This module should be kept compatible with Python 2.1. __revision__ = "$Id: bdist_dumb.py 61000 2008-02-23 17:40:11Z christian...
apache-2.0
shujaatak/UAV_MissionPlanner
Lib/site-packages/numpy/lib/tests/test__datasource.py
54
10225
import os import sys from tempfile import mkdtemp, mkstemp, NamedTemporaryFile from shutil import rmtree from urlparse import urlparse from urllib2 import URLError import urllib2 from numpy.testing import * from numpy.compat import asbytes import numpy.lib._datasource as datasource def urlopen_stub(url, data=None):...
gpl-2.0
omarocegueda/dipy
dipy/segment/tissue.py
6
6207
import numpy as np from dipy.sims.voxel import add_noise from dipy.segment.mrf import (ConstantObservationModel, IteratedConditionalModes) class TissueClassifierHMRF(object): r""" This class contains the methods for tissue classification using the Markov Random Fields modelin...
bsd-3-clause
davidharrigan/django
tests/csrf_tests/tests.py
78
23643
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from django.conf import settings from django.http import HttpRequest, HttpResponse from django.middleware.csrf import ( CSRF_KEY_LENGTH, CsrfViewMiddleware, get_token, ) from django.template import RequestContext, Template from django....
bsd-3-clause
wizyoung/workflows.kyoyue
PIL/ImageWin.py
9
7167
# # The Python Imaging Library. # $Id$ # # a Windows DIB display interface # # History: # 1996-05-20 fl Created # 1996-09-20 fl Fixed subregion exposure # 1997-09-21 fl Added draw primitive (for tzPrint) # 2003-05-21 fl Added experimental Window/ImageWindow classes # 2003-09-05 fl Added fromstring/tostring me...
mit
detiber/openshift-ansible-contrib
reference-architecture/aws-ansible/add-cns-storage.py
1
13272
#!/usr/bin/env python # vim: sw=2 ts=2 import click import os import sys @click.command() ### Cluster options @click.option('--console-port', default='443', type=click.IntRange(1,65535), help='OpenShift web console port', show_default=True) @click.option('--deployment-type', default='openshift-enterpri...
apache-2.0
lmazuel/azure-sdk-for-python
azure-mgmt-eventhub/azure/mgmt/eventhub/models/__init__.py
2
2621
# 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
mileswwatkins/pupa
pupa/scrape/schemas/bill.py
2
4736
""" Schema for bill objects. """ from .common import sources, extras, fuzzy_date_blank, fuzzy_date from opencivicdata import common versions_or_documents = { "items": { "properties": { "note": {"type": "string"}, "date": fuzzy_date_blank, "links": { ...
bsd-3-clause
EmmanuelJohnson/ssquiz
flask/lib/python2.7/site-packages/whoosh/query/__init__.py
96
1843
# Copyright 2012 Matt Chaput. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the...
bsd-3-clause
robhudson/django
tests/template_tests/filter_tests/test_escapejs.py
324
2055
from __future__ import unicode_literals from django.template.defaultfilters import escapejs_filter from django.test import SimpleTestCase from ..utils import setup class EscapejsTests(SimpleTestCase): @setup({'escapejs01': '{{ a|escapejs }}'}) def test_escapejs01(self): output = self.engine.render_...
bsd-3-clause
0111001101111010/open-health-inspection-api
venv/lib/python2.7/site-packages/pip/commands/install.py
342
12694
import os import sys import tempfile import shutil from pip.req import InstallRequirement, RequirementSet, parse_requirements from pip.log import logger from pip.locations import (src_prefix, virtualenv_no_global, distutils_scheme, build_prefix) from pip.basecommand import Command from pip.in...
gpl-2.0
glwu/python-for-android
python3-alpha/python3-src/Lib/test/test_posixpath.py
49
21964
import unittest from test import support, test_genericpath import posixpath import os import sys from posixpath import realpath, abspath, dirname, basename try: import posix except ImportError: posix = None # An absolute path to a temporary filename for testing. We can't rely on TESTFN # being an absolute pa...
apache-2.0
tysonclugg/django
django/contrib/gis/gdal/srs.py
72
11540
""" The Spatial Reference class, represents OGR Spatial Reference objects. Example: >>> from django.contrib.gis.gdal import SpatialReference >>> srs = SpatialReference('WGS84') >>> print(srs) GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS 84",6378137,298.257223563, AUTHORITY...
bsd-3-clause
arjclark/cylc
lib/jinja2/__init__.py
71
2614
# -*- coding: utf-8 -*- """ jinja2 ~~~~~~ Jinja2 is a template engine written in pure Python. It provides a Django inspired non-XML syntax but supports inline expressions and an optional sandboxed environment. Nutshell -------- Here a small example of a Jinja2 template:: {% ...
gpl-3.0
JudoWill/ResearchNotebooks
DownloadMicroData.py
1
1738
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <codecell> import os, os.path import concurrent.futures import csv import urllib.request import shutil import gzip os.chdir('/home/will/AutoMicroAnal/') # <codecell> with open('MicroarraySamples.tsv') as handle: microdata = list(csv.DictReader(handle, delimi...
mit
collex100/odoo
addons/account_check_writing/account.py
379
2032
# -*- 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
iemejia/incubator-beam
sdks/python/apache_beam/runners/portability/flink_uber_jar_job_server.py
1
8979
# # 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
roxyboy/scikit-learn
sklearn/mixture/tests/test_dpgmm.py
261
4490
import unittest import sys import numpy as np from sklearn.mixture import DPGMM, VBGMM from sklearn.mixture.dpgmm import log_normalize from sklearn.datasets import make_blobs from sklearn.utils.testing import assert_array_less, assert_equal from sklearn.mixture.tests.test_gmm import GMMTester from sklearn.externals.s...
bsd-3-clause
coderfi/ansible-modules-extras
packaging/macports.py
61
6679
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Jimmy Tang <jcftang@gmail.com> # Based on okpg (Patrick Pelletier <pp.pelletier@gmail.com>), pacman # (Afterburn) and pkgin (Shaun Zinck) modules # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public ...
gpl-3.0
ShawnPengxy/Flask-madeBlog
site-packages/httpie/output.py
5
16098
"""Output streaming, processing and formatting. """ import json import xml.dom.minidom from functools import partial from itertools import chain import pygments from pygments import token, lexer from pygments.styles import get_style_by_name, STYLE_MAP from pygments.lexers import get_lexer_for_mimetype, get_lexer_by_n...
mit
EttusResearch/gnuradio
gr-channels/python/channels/qa_channel_model.py
47
1900
#!/usr/bin/env python # # Copyright 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 your optio...
gpl-3.0
wwright2/dcim3-angstrom1
sources/openembedded-core/meta/lib/oeqa/utils/commands.py
2
4475
# Copyright (c) 2013-2014 Intel Corporation # # Released under the MIT license (see COPYING.MIT) # DESCRIPTION # This module is mainly used by scripts/oe-selftest and modules under meta/oeqa/selftest # It provides a class and methods for running commands on the host in a convienent way for tests. import os import s...
mit
technic-tec/onedrive-d-old
onedrive_d/od_onedrive_api.py
2
23966
#!/usr/bin/python3 """ OneDrive REST API for onedrive_d. Refer to http://msdn.microsoft.com/en-us/library/dn659752.aspx Notes: * The API object can be called by any arbitrary thread in the program. * Call get_instance() will realize a API singleton object. * When there is network issue at an API call, the calling...
lgpl-3.0
scieloorg/wayta
setup.py
1
1219
import os from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, 'README.txt')) as f: README = f.read() with open(os.path.join(here, 'CHANGES.txt')) as f: CHANGES = f.read() requires = [ 'elasticsearch>=1.1.1', 'pyramid>=1.5.2', ...
bsd-2-clause
zorroz/microblog
flask/lib/python2.7/site-packages/setuptools/sandbox.py
221
9994
import os import sys import tempfile import operator import functools import itertools import re import pkg_resources if os.name == "java": import org.python.modules.posix.PosixModule as _os else: _os = sys.modules[os.name] try: _file = file except NameError: _file = None _open = open from distutils.e...
bsd-3-clause
uglyboxer/linear_neuron
net-p3/lib/python3.5/site-packages/setuptools/compat.py
456
2094
import sys import itertools PY3 = sys.version_info >= (3,) PY2 = not PY3 if PY2: basestring = basestring import __builtin__ as builtins import ConfigParser from StringIO import StringIO BytesIO = StringIO func_code = lambda o: o.func_code func_globals = lambda o: o.func_globals im_func...
mit
guewen/OpenUpgrade
addons/account_payment/wizard/__init__.py
436
1144
# -*- 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
zhuwenping/python-for-android
python-build/python-libs/gdata/build/lib/gdata/health/service.py
263
10007
#!/usr/bin/python # # Copyright 2009 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 b...
apache-2.0
pp-mo/iris
lib/iris/quickplot.py
2
9074
# Copyright Iris contributors # # This file is part of Iris and is released under the LGPL license. # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """ High-level plotting extensions to :mod:`iris.plot`. These routines work much like their :mod:`iris.plot` counterparts, but...
lgpl-3.0
suizokukan/urwid
urwid/tests/test_str_util.py
20
1258
import unittest from urwid.compat import B from urwid.escape import str_util class DecodeOneTest(unittest.TestCase): def gwt(self, ch, exp_ord, exp_pos): ch = B(ch) o, pos = str_util.decode_one(ch,0) assert o==exp_ord, " got:%r expected:%r" % (o, exp_ord) assert pos==exp_pos, " go...
lgpl-2.1
igabriel85/dmon-adp
misc/keras_test.py
1
1530
import numpy import pandas as pd from keras.models import Sequential from keras.layers import Dense from keras.wrappers.scikit_learn import KerasClassifier from keras.utils import np_utils from sklearn.model_selection import cross_val_score from sklearn.model_selection import KFold from sklearn.preprocessing import Lab...
apache-2.0
dreadworks/college-cg
t2-objv/parser.py
1
10996
#!/usr/bin/env python # -*- coding: utf-8 -*- import re import numpy as np from util import LOG log = LOG.out.info """ Parser Library. Every class gets instantiated with the name of the file that should be parsed. Every instance of a parser is bound to a file and thus maintains the files data. The classes shou...
mit
fujunwei/chromium-crosswalk
tools/telemetry/telemetry/core/platform/power_monitor/power_monitor_controller.py
69
1214
# 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 telemetry.core.platform.power_monitor as power_monitor class PowerMonitorController(power_monitor.PowerMonitor): """ PowerMonitor that acts as f...
bsd-3-clause
globocom/oauth2u
tests/helpers.py
1
2130
import sys import urllib import cgi import base64 import json from functools import partial import requests __all__ = ('TEST_SERVER_HOST', 'build_root_url', 'build_basic_authorization_header', 'build_access_token_url', 'parse_json_response', 'parse_query_string',...
mit
Conchylicultor/DeepQA
chatbot/corpus/scotusdata.py
10
1602
# Copyright 2015 Conchylicultor. 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 ...
apache-2.0
DevMine/devmine-core
devmine/__init__.py
1
1683
__devmine_version__ = '0.1.0' __api_version__ = '1' import logging import bottle from bottle.ext import sqlalchemy from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from devmine.app.models import Base from devmine.config import routes from devmine.lib import composition class Devmine: ...
bsd-3-clause
walterreade/scikit-learn
sklearn/externals/joblib/my_exceptions.py
31
3690
""" Exceptions """ # Author: Gael Varoquaux < gael dot varoquaux at normalesup dot org > # Copyright: 2010, Gael Varoquaux # License: BSD 3 clause import sys from ._compat import PY3_OR_LATER class JoblibException(Exception): """A simple exception with an error message that you can get to.""" def __init__(se...
bsd-3-clause
alianmohammad/pd-gem5
src/arch/micro_asm_test.py
86
3195
# Copyright (c) 2007 The Regents of The University of Michigan # 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 ...
bsd-3-clause
akash1808/nova_test_latest
nova/tests/unit/scheduler/weights/test_weights_ioopsweight.py
73
2785
# 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
jabez1314/shadowsocks
tests/coverage_server.py
1072
1655
#!/usr/bin/env python # # Copyright 2015 clowwindy # # 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
BeATz-UnKNoWN/python-for-android
python-build/python-libs/gdata/src/gdata/alt/app_engine.py
136
3386
#!/usr/bin/python # # Copyright (C) 2009 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 # # Unless required by applicable law ...
apache-2.0
leafclick/intellij-community
python/helpers/py2only/docutils/languages/fr.py
148
1893
# $Id: fr.py 4564 2006-05-21 20:44:42Z wiemann $ # Author: Stefane Fermigier <sf@fermigier.com> # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be # translat...
apache-2.0
play113/swer
heekscnc-read-only/nc/nc.py
25
20718
################################################################################ # nc.py # # Base class for NC code creation # And global functions for calling current creator # # Hirutso Enni, 2009-01-13 # altered by Dan Falck 2010-08-04 # added tap() arguments Michael Haberler 2010-10-07 ####################...
mit
ParticulateSolutions/django-paydirekt
django_paydirekt/migrations/0001_initial.py
1
4278
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='PaydirektCapture', fields=[ ('id', models.AutoF...
mit
MrLoick/python-for-android
python-modules/twisted/twisted/test/test_stringtransport.py
56
9941
# Copyright (c) 2009-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.test.proto_helpers}. """ from zope.interface.verify import verifyObject from twisted.internet.interfaces import (ITransport, IPushProducer, IConsumer, IReactorTCP, IReactorSSL, IReactorUNIX, IAddress, IListe...
apache-2.0
jagg81/translate-toolkit
translate/lang/si.py
4
1048
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2010 Zuza Software Foundation # # This file is part of the Translate Toolkit. # # 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...
gpl-2.0
geodrinx/gearthview
ext-libs/twisted/internet/_posixserialport.py
42
2068
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Serial Port Protocol """ # system imports import os, errno # dependent on pyserial ( http://pyserial.sf.net/ ) # only tested w/ 1.18 (5 Dec 2002) import serial from serial import PARITY_NONE, PARITY_EVEN, PARITY_ODD from serial import STOPB...
gpl-3.0
GeoNode/geonode
geonode/monitoring/views.py
4
27048
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2017 OSGeo # # 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 ...
gpl-3.0
rackerlabs/ironic
ironic/drivers/modules/deploy_utils.py
1
17645
# Copyright (c) 2012 NTT DOCOMO, 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 requ...
apache-2.0
xzturn/tensorflow
tensorflow/tools/docs/generate_lib.py
4
22402
# Lint as: python2, python3 # 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 # ...
apache-2.0
Mevlock/xbmc
lib/gtest/test/gtest_env_var_test.py
184
3546
#!/usr/bin/env python # # Copyright 2008, 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...
gpl-2.0
sudiptpa/google-diff-match-patch
python2/diff_match_patch_test.py
319
41744
#!/usr/bin/python2.4 """Test harness for diff_match_patch.py Copyright 2006 Google Inc. http://code.google.com/p/google-diff-match-patch/ 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://...
apache-2.0
chaluemwut/fbserver
venv/lib/python2.7/site-packages/scipy/io/matlab/tests/test_mio_funcs.py
17
1816
#!/usr/bin/env python ''' Jottings to work out format for __function_workspace__ matrix at end of mat file. ''' from __future__ import division, print_function, absolute_import from os.path import join as pjoin, dirname import sys from io import BytesIO from numpy.testing import \ assert_array_equal, \ as...
apache-2.0
uclaros/QGIS
tests/src/python/test_qgsoptional.py
74
2145
# -*- coding: utf-8 -*- ''' test_qgsoptional.py -------------------------------------- Date : September 2016 Copyright : (C) 2016 Matthias Kuhn email : matthias@opengis.ch ***************************************...
gpl-2.0
JingZhou0404/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/build.py
119
2636
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and th...
bsd-3-clause
simartin/servo
python/servo/build_commands.py
2
45345
# Copyright 2013 The Servo Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your #...
mpl-2.0
MalkIPP/ipp_work
ipp_work/simulations/ir_marg_rate.py
1
8481
# -*- coding: utf-8 -*- # OpenFisca -- A versatile microsimulation software # By: OpenFisca Team <contact@openfisca.fr> # # Copyright (C) 2011, 2012, 2013, 2014, 2015 OpenFisca Team # https://github.com/openfisca # # This file is part of OpenFisca. # # OpenFisca is free software; you can redistribute it and/or modify...
agpl-3.0
agx/git-buildpackage
gbp/scripts/import_ref.py
1
8733
# vim: set fileencoding=utf-8 : # # (C) 2018 Michael Stapelberg <stapelberg@debian.org> # 2018 Guido Günther <agx@sigxcpu.org> # 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...
gpl-2.0
yodalee/servo
tests/wpt/web-platform-tests/tools/py/testing/log/test_warning.py
161
2253
import pytest import py mypath = py.path.local(__file__).new(ext=".py") @pytest.mark.xfail def test_forwarding_to_warnings_module(): pytest.deprecated_call(py.log._apiwarn, "1.3", "..") def test_apiwarn_functional(recwarn): capture = py.io.StdCapture() py.log._apiwarn("x.y.z", "something", stacklevel=1) ...
mpl-2.0
quasiben/bokeh
examples/plotting/server/selection_histogram.py
4
3752
# You must first run "bokeh serve" to view this example import numpy as np from bokeh.client import push_session from bokeh.models import BoxSelectTool, LassoSelectTool, Paragraph from bokeh.plotting import curdoc, figure, hplot, vplot # create three normal population samples with different parameters x1 = np.random...
bsd-3-clause
shownomercy/django
django/conf/locale/lt/formats.py
504
1830
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = r'Y \m. E j \d.' TIME_FORMAT = 'H:...
bsd-3-clause
uwcirg/true_nth_usa_portal
tests/test_portal.py
1
11562
"""Unit test module for portal views""" from datetime import datetime import tempfile import urllib from flask_swagger import swagger from flask_webtest import SessionScope from swagger_spec_validator import validate_spec_url from portal.config.config import TestConfig from portal.extensions import db from portal.fa...
bsd-3-clause
andersinno/foosball
config/settings/production.py
1
4603
# -*- coding: utf-8 -*- """ Production Configurations """ from __future__ import absolute_import, unicode_literals from django.utils import six from .common import * # noqa # Enable social integration plugins SOCIAL_ACCOUNTS = ( 'allauth.socialaccount.providers.google', 'allauth.socialaccount.providers.face...
mit
ducthien1490/youtube-dl
youtube_dl/extractor/instagram.py
93
4498
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( int_or_none, limit_length, ) class InstagramIE(InfoExtractor): _VALID_URL = r'https://instagram\.com/p/(?P<id>[\da-zA-Z]+)' _TEST = { 'url': 'https://instagram.com/p/aye83DjauH/?foo=bar#...
unlicense
bloopletech/Comix
src/preferences.py
6
22727
"""preferences.py - Preference handler.""" import os import cPickle import gtk import pango import constants import labels ZOOM_MODE_BEST = 0 ZOOM_MODE_WIDTH = 1 ZOOM_MODE_HEIGHT = 2 ZOOM_MODE_MANUAL = 3 # All the preferences are stored here. prefs = { 'comment extensions': ['txt', 'nfo'], 'auto load last ...
gpl-2.0
ghxandsky/zstack-utility
kvmagent/kvmagent/plugins/network_plugin.py
1
7289
''' @author: frank ''' from kvmagent import kvmagent from zstacklib.utils import jsonobject from zstacklib.utils import http from zstacklib.utils import log from zstacklib.utils import lock from zstacklib.utils import shell from zstacklib.utils import linux import os import traceback CHECK_PHYSICAL_NETW...
apache-2.0
KanoComputing/nush
cherrypy/test/test_auth_basic.py
54
2853
# This file is part of CherryPy <http://www.cherrypy.org/> # -*- coding: utf-8 -*- # vim:ts=4:sw=4:expandtab:fileencoding=utf-8 import cherrypy from cherrypy._cpcompat import md5, ntob from cherrypy.lib import auth_basic from cherrypy.test import helper class BasicAuthTest(helper.CPWebCase): def setup_server():...
gpl-3.0
ghickman/tvrenamr
tvrenamr/logs.py
2
2377
import logging import logging.handlers import os def convert_log_level(level=26): """ Get a numeric log level from a string. The default 26 is for SHORT logs. :param level :return level """ # annoying but the level can be passed in as None if not level: level = 26 levels = {'...
mit
simleo/openmicroscopy
components/tools/OmeroPy/test/integration/test_chgrp.py
2
46241
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2012-2015 University of Dundee & Open Microscopy Environment. # All rights reserved. Use is subject to license terms supplied in LICENSE.txt # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General P...
gpl-2.0
MarcosCommunity/odoo
addons/base_report_designer/plugin/openerp_report_designer/bin/script/Repeatln.py
293
13228
######################################################################### # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gene...
agpl-3.0
NitroKK/kernel_lge_iproj
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
CLVsol/oehealth
oehealth_pharmacy/oehealth_annotation.py
1
1638
# -*- encoding: utf-8 -*- ################################################################################ # # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # ...
agpl-3.0
SrNetoChan/Quantum-GIS
python/plugins/processing/algs/qgis/Heatmap.py
15
11238
# -*- coding: utf-8 -*- """ *************************************************************************** Heatmap.py --------------------- Date : November 2016 Copyright : (C) 2016 by Nyall Dawson Email : nyall dot dawson at gmail dot com ********************...
gpl-2.0
SnabbCo/neutron
neutron/tests/unit/services/firewall/agents/l3reference/test_firewall_l3_agent.py
3
16283
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # 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.ap...
apache-2.0