repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
bencarle/odl-learning-labs
src/settings/pod2-5.py
1
2262
# Copyright 2015 Cisco Systems, 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 writ...
apache-2.0
aljscott/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/openbugs_unittest.py
124
2412
# Copyright (C) 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 of conditions and the f...
bsd-3-clause
jacobsenanaizabel/shoop
shoop/admin/modules/categories/__init__.py
4
1967
# -*- coding: utf-8 -*- # This file is part of Shoop. # # Copyright (c) 2012-2015, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from django.db.models import Q from shoop.admin.base import AdminModule, Men...
agpl-3.0
braingram/pizco
tests/test_protocol.py
3
1663
import unittest from pizco.protocol import Protocol class TestProtocol(unittest.TestCase): def test_protocol(self): prot = Protocol() self.assertRaises(ValueError, prot.parse, []) msg = prot.format('friend', 'bla', 'here goes the content') sender, topic, content, msgid = prot.pa...
bsd-3-clause
sangoma/aiosip
aiosip/dialog.py
1
14964
import asyncio import enum import logging from collections import defaultdict from multidict import CIMultiDict from async_timeout import timeout as Timeout from . import utils from .message import Request, Response from .transaction import UnreliableTransaction, ProxyTransaction from .auth import Auth LOG = loggi...
apache-2.0
nrgaway/qubes-core-admin
qubes/vm/templatevm.py
1
4118
# # The Qubes OS Project, http://www.qubes-os.org # # Copyright (C) 2014-2016 Wojtek Porczyk <woju@invisiblethingslab.com> # Copyright (C) 2016 Marek Marczykowski <marmarek@invisiblethingslab.com>) # Copyright (C) 2016 Bahtiar `kalkin-` Gadimov <bahtiar@gadimov.de> # # This library is free software; you ca...
gpl-2.0
tasoc/photometry
notes/tests_time_offset_ffis_ecsv.py
1
4345
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Create input data for tests of time offset of FFIs. .. codeauthor:: Rasmus Handberg <rasmush@phys.au.dk> """ import sys import os.path import numpy as np from astropy.io import fits from astropy.table import Table import itertools import gzip sys.path.insert(0, os.pa...
gpl-3.0
diagramsoftware/odoo
addons/l10n_ca/__openerp__.py
260
3087
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
agpl-3.0
objmagic/heron
third_party/pex/pex/resolver_options.py
52
5775
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import print_function from pkg_resources import safe_name from .crawler import Crawler from .fetcher import Fetcher, PyPIFetcher from .http import Context from .installer...
apache-2.0
slohse/ansible
test/units/modules/network/f5/test_bigip_routedomain.py
27
3915
# -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytest import sys from nose.plugins.skip i...
gpl-3.0
trhd/meson
mesonbuild/modules/qt.py
2
8978
# Copyright 2015 The Meson development team # 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 ...
apache-2.0
wfxiang08/ansible
lib/ansible/plugins/inventory/ini.py
90
2220
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
mverwe/diall
test/PYTHIA_2760GeV_GEN_SIM_PU_cfg.py
2
14472
# Auto generated configuration file # using: # Revision: 1.19 # Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v # with command line options: Pyquen_ZeemumuJets_pt10_2760GeV_cfi.py --conditions MCHI2_75_V2 -s GEN,SIM --pileup_input das:/Hydjet_Quenched_MinBias_5020GeV/HiFall14-ST...
cc0-1.0
TNosredna/CouchPotatoServer
couchpotato/core/downloaders/pneumatic/main.py
6
1955
from __future__ import with_statement from couchpotato.core.downloaders.base import Downloader from couchpotato.core.logger import CPLog import os import traceback log = CPLog(__name__) class Pneumatic(Downloader): type = ['nzb'] strm_syntax = 'plugin://plugin.program.pneumatic/?mode=strm&type=add_file&nzb=%...
gpl-3.0
noba3/KoTos
addons/plugin.video.youtube/resources/lib/kodion/constants/const_sort_methods.py
7
2196
__author__ = 'bromix' _xbmc = True try: from xbmcplugin import * except: _xbmc = False _count = 0 pass def _const(name): if _xbmc: return eval(name) else: global _count _count += 1 return _count pass ALBUM = _const('SORT_METHOD_ALBUM') ALBUM_IGNORE_THE =...
gpl-2.0
jck/myhdl
myhdl/test/core/test_always_seq.py
5
1187
import myhdl from myhdl import * from myhdl import Signal from myhdl._always_seq import AlwaysSeqError, _error, always_seq from helpers import raises_kind def test_clock(): """ check the edge parameter """ # should fail without a valid Signal clock = Signal(bool(0)) reset = ResetSignal(0, active=0, i...
lgpl-2.1
KaranToor/MA450
google-cloud-sdk/.install/.backup/platform/gsutil/third_party/boto/tests/unit/ec2/test_instancestatus.py
114
1811
#!/usr/bin/env python from tests.compat import mock, unittest from boto.ec2.connection import EC2Connection INSTANCE_STATUS_RESPONSE = br"""<?xml version="1.0" encoding="UTF-8"?> <DescribeInstanceStatusResponse xmlns="http://ec2.amazonaws.com/doc/2013-02-01/"> <requestId>3be1508e-c444-4fef-89cc-0b1223c4f02fEXAMP...
apache-2.0
mateon1/servo
etc/ci/performance/submit_to_perfherder.py
55
11981
#!/usr/bin/env python3 # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import argparse from functools import partial, reduce import json import operator import os impo...
mpl-2.0
Teamxrtc/webrtc-streaming-node
third_party/webrtc/src/chromium/src/third_party/pywebsocket/src/mod_pywebsocket/__init__.py
552
8263
# Copyright 2011, 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 f...
mit
chdecultot/erpnext
erpnext/accounts/doctype/c_form/c_form.py
49
2722
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import flt from frappe import _ from frappe.model.document import Document class CForm(Document): def validate(self): ...
gpl-3.0
ProjectSWGCore/NGECore2
scripts/mobiles/generic/faction/imperial/imp_invasion_at_at.py
2
1389
import sys from services.spawn import MobileTemplate from services.spawn import WeaponTemplate from resources.datatables import WeaponType from resources.datatables import Difficulty from resources.datatables import Options from resources.datatables import FactionStatus from java.util import Vector def addTemplate(co...
lgpl-3.0
unicri/edx-platform
common/djangoapps/third_party_auth/tests/test_pipeline_integration.py
78
8194
"""Integration tests for pipeline.py.""" import unittest from django.conf import settings from django import test from django.contrib.auth import models from third_party_auth import pipeline, provider from third_party_auth.tests import testutil from social.apps.django_app.default import models as social_models # G...
agpl-3.0
fpadoan/metasyntactic
protobuf-2.2.0/python/google/protobuf/internal/message_listener.py
17
2635
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
apache-2.0
globau/servo
components/script/dom/bindings/codegen/parser/tests/test_global_extended_attr.py
107
2977
def WebIDLTest(parser, harness): parser.parse(""" [Global] interface Foo : Bar { getter any(DOMString name); }; interface Bar {}; """) results = parser.finish() harness.ok(results[0].isOnGlobalProtoChain(), "[Global] interface should be on global's proto ...
mpl-2.0
keithhamilton/blackmaas
lib/python2.7/site-packages/pip/_vendor/requests/auth.py
294
6173
# -*- coding: utf-8 -*- """ requests.auth ~~~~~~~~~~~~~ This module contains the authentication handlers for Requests. """ import os import re import time import hashlib import logging from base64 import b64encode from .compat import urlparse, str from .cookies import extract_cookies_to_jar from .utils import pars...
bsd-3-clause
mattcaldwell/boto
boto/ec2/elb/healthcheck.py
185
3775
# Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. # All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software wi...
mit
2013Commons/HUE-SHARK
desktop/core/ext-py/Django-1.2.3/build/lib.linux-i686-2.7/django/contrib/gis/gdal/field.py
264
6059
from ctypes import byref, c_int from datetime import date, datetime, time from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.error import OGRException from django.contrib.gis.gdal.prototypes import ds as capi # For more information, see the OGR C API source code: # http://www.gdal.org/ogr/...
apache-2.0
ujenmr/ansible
lib/ansible/modules/network/fortios/fortios_log_memory_setting.py
23
7514
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lic...
gpl-3.0
chriscrosscutler/scikit-image
skimage/draw/draw.py
15
5252
# coding: utf-8 import numpy as np from ._draw import _coords_inside_image def _ellipse_in_shape(shape, center, radiuses): """Generate coordinates of points within ellipse bounded by shape.""" y, x = np.ogrid[0:float(shape[0]), 0:float(shape[1])] cy, cx = center ry, rx = radiuses distances = ((y -...
bsd-3-clause
lebabouin/CouchPotatoServer-develop
libs/tornado/gen.py
2
20329
"""``tornado.gen`` is a generator-based interface to make it easier to work in an asynchronous environment. Code using the ``gen`` module is technically asynchronous, but it is written as a single generator instead of a collection of separate functions. For example, the following asynchronous handler:: class Asy...
gpl-3.0
ESOedX/edx-platform
cms/djangoapps/contentstore/views/tests/test_group_configurations.py
1
48420
#-*- coding: utf-8 -*- """ Group Configuration Tests. """ from __future__ import absolute_import import json from operator import itemgetter import ddt import six from mock import patch from six.moves import range from contentstore.course_group_config import CONTENT_GROUP_CONFIGURATION_NAME, ENROLLMENT_SCHEME, Grou...
agpl-3.0
40223229/2015cdb_g9
static/Brython3.1.1-20150328-091302/Lib/contextlib.py
737
8788
"""Utilities for with-statement contexts. See PEP 343.""" import sys from collections import deque from functools import wraps __all__ = ["contextmanager", "closing", "ContextDecorator", "ExitStack"] class ContextDecorator(object): "A base class or mixin that enables context managers to work as decorators." ...
gpl-2.0
tersmitten/ansible
lib/ansible/modules/network/cloudengine/ce_evpn_global.py
31
6897
#!/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
javelinanddart/Canuck
tools/perf/util/setup.py
4998
1330
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
gpl-2.0
GhostThrone/django
tests/foreign_object/tests.py
5
18904
import datetime from operator import attrgetter from django.core.exceptions import FieldError from django.db import models from django.db.models.fields.related import ForeignObject from django.test import SimpleTestCase, TestCase, skipUnlessDBFeature from django.utils import translation from .models import ( Arti...
bsd-3-clause
macobo/Bomberman
models/Explosion.py
1
1538
# -*- coding: utf-8 -*- from misc import * from Objects import ExplosionTile, Tile from Player import Player class Explosion(Tile): CHAINTIME = 100 EXPLOSIONTIME = 700 def __init__(self, bomb, map): Tile.__init__(self, None, solid = False) x, y = bomb.getPos() self.affected = calcul...
mit
openpli-arm/openembedded
contrib/mtnpatch.py
45
2048
#!/usr/bin/env python import sys, os, string, getopt, re mtncmd = "mtn" def main(argv = None): if argv is None: argv = sys.argv opts, list = getopt.getopt(sys.argv[1:], ':R') if len(list) < 1: print "You must specify a file" return 2 reverse = False for o, a in opts: ...
mit
buqing2009/MissionPlanner
Lib/imputil.py
59
26489
""" Import utilities Exported classes: ImportManager Manage the import process Importer Base class for replacing standard import functions BuiltinImporter Emulate the import mechanism for builtin and frozen modules DynLoadSuffixImporter """ from warnings import warnpy3k warnpy3k(...
gpl-3.0
shrimpboyho/git.js
emscript/python/2.7.5.1_32bit/Lib/site-packages/win32com/client/combrowse.py
18
20235
"""A utility for browsing COM objects. Usage: Command Prompt Use the command *"python.exe catbrowse.py"*. This will display display a fairly small, modal dialog. Pythonwin Use the "Run Script" menu item, and this will create the browser in an MDI window. This window can be fully resized. D...
gpl-2.0
Osmose/normandy
recipe-server/normandy/recipes/utils.py
1
1406
import hashlib def fraction_to_key(frac): """Map from the range [0, 1] to [0, max(sha256)]. The result is a string.""" # SHA 256 hashes are 64-digit hexadecimal numbers. The largest possible SHA 256 # hash is 2^256 - 1 if frac < 0 or frac > 1: raise ValueError('frac must be between 0 and 1 in...
mpl-2.0
immenz/pyload
module/plugins/accounts/FourSharedCom.py
3
1094
# -*- coding: utf-8 -*- from module.plugins.Account import Account class FourSharedCom(Account): __name__ = "FourSharedCom" __type__ = "account" __version__ = "0.04" __description__ = """FourShared.com account plugin""" __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidber...
gpl-3.0
p0psicles/SickRage
lib/unidecode/x053.py
252
4616
data = ( 'Yun ', # 0x00 'Mwun ', # 0x01 'Nay ', # 0x02 'Gai ', # 0x03 'Gai ', # 0x04 'Bao ', # 0x05 'Cong ', # 0x06 '[?] ', # 0x07 'Xiong ', # 0x08 'Peng ', # 0x09 'Ju ', # 0x0a 'Tao ', # 0x0b 'Ge ', # 0x0c 'Pu ', # 0x0d 'An ', # 0x0e 'Pao ', # 0x0f 'Fu ', # 0x10 'Gong...
gpl-3.0
Winand/pandas
pandas/tests/io/msgpack/test_case.py
13
2740
# coding: utf-8 from pandas.io.msgpack import packb, unpackb def check(length, obj): v = packb(obj) assert len(v) == length, \ "%r length should be %r but get %r" % (obj, length, len(v)) assert unpackb(v, use_list=0) == obj def test_1(): for o in [None, True, False, 0, 1, (1 << 6), (1 << 7)...
bsd-3-clause
jhprinz/openpathsampling
openpathsampling/engines/features/statics.py
1
2708
import numpy as np from .shared import StaticContainerStore, StaticContainer import mdtraj from openpathsampling.netcdfplus import WeakLRUCache variables = ['statics'] lazy = ['statics'] storables = ['statics'] dimensions = ['n_atoms', 'n_spatial'] def netcdfplus_init(store): static_store = StaticContainerStor...
lgpl-2.1
tzaffi/git-in-practice-repo
book/lib/python2.7/site-packages/setuptools/command/rotate.py
125
2034
import os from setuptools import Command from setuptools.compat import basestring from distutils.util import convert_path from distutils import log from distutils.errors import DistutilsOptionError class rotate(Command): """Delete older distributions""" description = "delete older distributions, keeping N new...
mit
dimara/ganeti
lib/netutils.py
6
20765
# # # Copyright (C) 2010, 2011, 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: # # 1. Redistributions of source code must retain the above copyright notice, # this list of con...
bsd-2-clause
Krossom/python-for-android
python3-alpha/python3-src/Lib/idlelib/Bindings.py
130
3295
"""Define the menu contents, hotkeys, and event bindings. There is additional configuration information in the EditorWindow class (and subclasses): the menus are created there based on the menu_specs (class) variable, and menus not created are silently skipped in the code here. This makes it possible, for example, to...
apache-2.0
rednach/krill
test/test_macroresolver.py
17
8483
#!/usr/bin/env python # Copyright (C) 2009-2014: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # # This file is part of Shinken. # # Shinken is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the F...
agpl-3.0
nelsonag/openmc
tests/regression_tests/track_output/test.py
10
1359
import glob import os from subprocess import call import shutil import pytest from tests.testing_harness import TestHarness class TrackTestHarness(TestHarness): def _test_output_created(self): """Make sure statepoint.* and track* have been created.""" TestHarness._test_output_created(self) ...
mit
Sutto/cloud-custodian
tests/zpill.py
1
10961
# Copyright 2016-2017 Capital One Services, LLC # # 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 ...
apache-2.0
Mhynlo/SickRage
lib/hachoir_parser/video/mpeg_ts.py
72
3528
""" MPEG-2 Transport Stream parser. Documentation: - MPEG-2 Transmission http://erg.abdn.ac.uk/research/future-net/digital-video/mpeg2-trans.html Author: Victor Stinner Creation date: 13 january 2007 """ from hachoir_parser import Parser from hachoir_core.field import (FieldSet, ParserError, MissingField, UInt...
gpl-3.0
songmonit/CTTMSONLINE_V8
addons/resource/__openerp__.py
261
1941
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 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
40023154/40023154_test2
static/Brython3.1.1-20150328-091302/Lib/_codecs.py
526
4147
def ascii_decode(*args,**kw): pass def ascii_encode(*args,**kw): pass def charbuffer_encode(*args,**kw): pass def charmap_build(*args,**kw): pass def charmap_decode(*args,**kw): pass def charmap_encode(*args,**kw): pass def decode(*args,**kw): """decode(obj, [encoding[,errors]]) -> ob...
gpl-3.0
emailhippo/email-verify-api-docs
docs/conf.py
1
8412
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Email Address Verification API documentation build configuration file, created by # sphinx-quickstart on Sat Aug 29 13:07:24 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values a...
apache-2.0
samkuehn/box-python-sdk
test/functional/mock_box/util/json_utils.py
8
2196
# coding: utf-8 from __future__ import unicode_literals import codecs import json from test.functional.mock_box.db_model.file_model import FileModel from test.functional.mock_box.db_model import DbModel def serializer_factory(cls): class BoxObjectSerializer(json.JSONEncoder): # pylint:disable=method-hid...
apache-2.0
ZsTizy/heekscnc
nc/tnc151.py
34
2662
################################################################################ # tnc151.py # # Post Processor for the Heidenhain TNC151 machine # import nc import iso_modal import math ################################################################################ class Creator(iso_modal.Creator): ...
bsd-3-clause
JamesClough/dagology
dagology/algorithms/midpoint_scaling_dimension.py
1
1758
""" Midpoint Scaling dimension estimator """ # Copyright (C) 2016 by # James Clough <james.clough91@gmail.com> # All rights reserved. # BSD license. __author__ = "\n".join(["James Clough (james.clough91@gmail.com)"]) import networkx as nx import numpy as np import dagology as dag __all__ = ['mpsd'] def...
mit
ojdo/rivus
replot.py
2
1589
import glob import os from rivus.main import rivus import sys def replot(directory): """Recreate result figures for all pickled rivus results in directory Args: directory: a directory with 1 or multiple pickled rivus instances Returns: Nothing """ glob_pattern = os.path.join(direc...
gpl-3.0
albertyw/albertyw.com
app/tests/test_data.py
1
1618
import unittest from app import data, util class TestProjects(unittest.TestCase): def setUp(self) -> None: self.original_cache = util.SHOULD_CACHE util.SHOULD_CACHE = True def tearDown(self) -> None: util.SHOULD_CACHE = self.original_cache def test_load_from_file(self) -> None: ...
mit
bgris/ODL_bgris
lib/python3.5/site-packages/scipy/sparse/linalg/isolve/utils.py
108
3840
from __future__ import division, print_function, absolute_import __docformat__ = "restructuredtext en" __all__ = [] from warnings import warn from numpy import asanyarray, asarray, asmatrix, array, matrix, zeros from scipy.sparse.linalg.interface import aslinearoperator, LinearOperator, \ IdentityOperator _c...
gpl-3.0
ebu/ebu-tt-live-toolkit
ebu_tt_live/bindings/pyxb_utils.py
2
6824
""" This file contains those bits and pieces that are necessary to give PyXB extra functionality. """ import threading import logging from ebu_tt_live.errors import StopBranchIteration from pyxb.binding.basis import NonElementContent, ElementContent, complexTypeDefinition from pyxb.exceptions_ import NotComplexContent...
bsd-3-clause
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-2.1/Lib/test/test_pty.py
3
3106
import pty, os, sys from test_support import verbose, TestFailed, TestSkipped TEST_STRING_1 = "I wish to buy a fish license.\n" TEST_STRING_2 = "For my pet fish, Eric.\n" if verbose: def debug(msg): print msg else: def debug(msg): pass # Marginal testing of pty suite. Cannot do extensive 'do ...
mit
kurikaesu/arsenalsuite
cpp/lib/PyQt4/examples/layouts/borderlayout.py
20
8069
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2010 Riverbank Computing Limited. ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ## All rights reserved. ## ## This file is part of the examples of PyQt. ## ## $QT_BEGIN_LICENS...
gpl-2.0
empeeu/numpy
numpy/lib/tests/test_regression.py
120
8927
from __future__ import division, absolute_import, print_function import os import sys import numpy as np from numpy.testing import ( run_module_suite, TestCase, assert_, assert_equal, assert_array_equal, assert_array_almost_equal, assert_raises ) from numpy.testing.utils import _assert_valid_refcount from...
bsd-3-clause
ytoyama/yans_chainer_hackathon
tests/cupy_tests/manipulation_tests/test_transpose.py
13
1256
import unittest import cupy from cupy import testing @testing.gpu class TestTranspose(unittest.TestCase): _multiprocess_can_split_ = True @testing.numpy_cupy_array_equal() def test_rollaxis(self, xp): a = testing.shaped_arange((2, 3, 4), xp) return xp.rollaxis(a, 2) def test_rollax...
mit
tongwang01/tensorflow
tensorflow/python/client/notebook.py
33
4608
# 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
torchbox/django-mailer-2
django_mailer/models.py
1
2844
from django.db import models from django_mailer import constants, managers import datetime PRIORITIES = ( (constants.PRIORITY_HIGH, 'high'), (constants.PRIORITY_NORMAL, 'normal'), (constants.PRIORITY_LOW, 'low'), ) RESULT_CODES = ( (constants.RESULT_SENT, 'success'), (constants.RESULT_SKIPPED, 'n...
mit
tkas/osmose-backend
mapcss/generated/MapCSSLexer.py
4
18673
# Generated from MapCSS.g4 by ANTLR 4.8 from antlr4 import * from io import StringIO from typing.io import TextIO import sys def serializedATN(): with StringIO() as buf: buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2\67") buf.write("\u01a2\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\...
gpl-3.0
ddico/odoo
addons/product/models/res_company.py
2
2888
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, models, _ class ResCompany(models.Model): _inherit = "res.company" @api.model def create(self, vals): new_company = super(ResCompany, self).create(vals) ProductPriceli...
agpl-3.0
mhogg/scipy
scipy/signal/waveforms.py
64
14818
# Author: Travis Oliphant # 2003 # # Feb. 2010: Updated by Warren Weckesser: # Rewrote much of chirp() # Added sweep_poly() from __future__ import division, print_function, absolute_import import numpy as np from numpy import asarray, zeros, place, nan, mod, pi, extract, log, sqrt, \ exp, cos, sin, polyval, po...
bsd-3-clause
Antiun/server-tools
base_optional_quick_create/__openerp__.py
23
1737
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public Licen...
agpl-3.0
xsynergy510x/android_external_chromium_org
tools/cr/cr/base/client.py
64
6651
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Client configuration management. This module holds the code for detecting and configuring the current client and it's output directories. It is responsib...
bsd-3-clause
ian-garrett/meetMe
env/lib/python3.4/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...
artistic-2.0
fighterCui/L4ReFiascoOC
l4/pkg/python/contrib/Lib/distutils/command/bdist_msi.py
2
31388
# -*- coding: iso-8859-1 -*- # Copyright (C) 2005, 2006 Martin v. Löwis # Licensed to PSF under a Contributor Agreement. # The bdist_wininst command proper # based on bdist_wininst """ Implements the bdist_msi command. """ import sys, os from distutils.core import Command from distutils.dir_util import remove_tree fro...
gpl-2.0
Azure/azure-sdk-for-python
sdk/communication/azure-communication-sms/samples/send_sms_to_multiple_recipients_sample_async.py
1
2517
# 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. # --------------------------------------------------------------------...
mit
chyeh727/django
django/core/serializers/json.py
320
3782
""" Serialize data to/from JSON """ # Avoid shadowing the standard library json module from __future__ import absolute_import, unicode_literals import datetime import decimal import json import sys import uuid from django.core.serializers.base import DeserializationError from django.core.serializers.python import ( ...
bsd-3-clause
daniel-de-vries/OpenLEGO
openlego/docs/_exts/tags.py
1
2483
# tag.py, this custom Sphinx extension is activated in conf.py # and allows the use of the custom directive for tags in our rst (e.g.): # .. tags:: tag1, tag2, tag3 from sphinx.util.compat import Directive from docutils.parsers.rst.directives.admonitions import Admonition from docutils import nodes from sphinx.locale i...
apache-2.0
tigeorgia/GeorgiaCorporationScraper
registry/terms.py
1
18013
# -*- coding: utf-8 -*- positions = set([u"პარტნიორი", u"შეზღუდული პარტნიორები", u"სრული პარტნიორები", u"ხელმძღვანელი", u"კომანდიტი", u"კომპლემენტარი", u"დამფუძნებელი/დამფუძნებლები", u"დირექტორი", u"წარმომადგენელი", ...
mit
Jusedawg/SickRage
lib/unidecode/x057.py
252
4631
data = ( 'Guo ', # 0x00 'Yin ', # 0x01 'Hun ', # 0x02 'Pu ', # 0x03 'Yu ', # 0x04 'Han ', # 0x05 'Yuan ', # 0x06 'Lun ', # 0x07 'Quan ', # 0x08 'Yu ', # 0x09 'Qing ', # 0x0a 'Guo ', # 0x0b 'Chuan ', # 0x0c 'Wei ', # 0x0d 'Yuan ', # 0x0e 'Quan ', # 0x0f 'Ku ', # 0x10 'F...
gpl-3.0
woutersmet/Molmodsummer
lib/molmod/similarity.py
1
5212
# MolMod is a collection of molecular modelling tools for python. # Copyright (C) 2007 - 2008 Toon Verstraelen <Toon.Verstraelen@UGent.be> # # This file is part of MolMod. # # MolMod 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...
gpl-3.0
fabioz/Pydev
plugins/org.python.pydev.jython/Lib/json/tests/test_scanstring.py
97
3784
import sys from json.tests import PyTest, CTest class TestScanstring(object): def test_scanstring(self): scanstring = self.json.decoder.scanstring self.assertEqual( scanstring('"z\\ud834\\udd20x"', 1, None, True), (u'z\U0001d120x', 16)) if sys.maxunicode == 65535: ...
epl-1.0
surgebiswas/poker
PokerBots_2017/Johnny/numpy/linalg/setup.py
78
1735
from __future__ import division, print_function import os import sys def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration from numpy.distutils.system_info import get_info config = Configuration('linalg', parent_package, top_path) config.add_data_dir...
mit
H1ghT0p/kitsune
kitsune/forums/tests/test_posts.py
16
6715
from datetime import datetime, timedelta from django.conf import settings from nose.tools import eq_, raises from kitsune.forums.models import Thread, Forum, ThreadLockedError from kitsune.forums.tests import ForumTestCase, thread, post from kitsune.forums.views import sort_threads from kitsune.sumo.tests import get...
bsd-3-clause
konsP/synnefo
snf-cyclades-app/synnefo/logic/management/commands/pool-show.py
8
2499
# Copyright (C) 2010-2014 GRNET S.A. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed i...
gpl-3.0
ramjothikumar/Diamond
src/collectors/files/files.py
52
1995
# coding=utf-8 """ This class collects data from plain text files #### Dependencies """ import diamond.collector import os import re _RE = re.compile(r'([A-Za-z0-9._-]+)[\s=:]+(-?[0-9]+)(\.?\d*)') class FilesCollector(diamond.collector.Collector): def get_default_config_help(self): config_help = sup...
mit
davidjb/sqlalchemy
lib/sqlalchemy/util/langhelpers.py
11
41177
# util/langhelpers.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 """Routines to help with the creation, loading and introspection of modules, cla...
mit
Jgarcia-IAS/localizacion
openerp/addons/website_mail/tests/test_controllers.py
390
1644
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
candrews/portage
pym/portage/tests/lafilefixer/test_lafilefixer.py
17
6498
# test_lafilefixer.py -- Portage Unit Testing Functionality # Copyright 2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from portage.tests import TestCase from portage.exception import InvalidData class test_lafilefixer(TestCase): def get_test_cases_clean(self): yield b"d...
gpl-2.0
mustajarvi/slick
slick/src/sphinx/exts/includecode.py
121
5444
import os import codecs from os import path from docutils import nodes from docutils.parsers.rst import Directive, directives class IncludeCode(Directive): """ Include a code example from a file with sections delimited with special comments. """ has_content = False required_arguments = 1 opti...
bsd-2-clause
KurtDeGreeff/infernal-twin
build/reportlab/src/reportlab/graphics/charts/barcharts.py
29
66757
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/charts/barcharts.py __version__=''' $Id$ ''' __doc__="""This module defines a variety of Bar Chart components. The basic flavors are stacked ...
gpl-3.0
harry159821/Tickeys-linux
tickeys/kivy/core/camera/__init__.py
14
4426
''' Camera ====== Core class for acquiring the camera and converting its input into a :class:`~kivy.graphics.texture.Texture`. .. versionchanged:: 1.8.0 There is now 2 distinct Gstreamer implementation: one using Gi/Gst working for both Python 2+3 with Gstreamer 1.0, and one using PyGST working only for P...
mit
stephane-martin/salt-debian-packaging
salt-2016.3.2/tests/unit/pillar/hg_test.py
2
2302
# -*- coding: utf-8 -*- '''test for pillar hg_pillar.py''' # Import python libs from __future__ import absolute_import import os import tempfile import shutil import subprocess import yaml # Import Salt Testing libs from salttesting import TestCase, skipIf from salttesting.mock import NO_MOCK, NO_MOCK_REASON import...
apache-2.0
ag-wood/ansible-modules-extras
packaging/os/swdepot.py
102
6139
#!/usr/bin/python -tt # -*- coding: utf-8 -*- # (c) 2013, Raul Melo # Written by Raul Melo <raulmelo@gmail.com> # Based on yum module written by Seth Vidal <skvidal at fedoraproject.org> # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pu...
gpl-3.0
edina/lockss-daemon
test/frameworks/clean_up_daemon/clean_cache.py
1
7087
#!/usr/bin/env python # $Id$ # Copyright (c) 2000-2015 Board of Trustees of Leland Stanford Jr. University, # 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 ...
bsd-3-clause
mollstam/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/libxml2-2.9.1/python/libxml2class.py
10
321118
# # Functions from module HTMLparser # def htmlCreateMemoryParserCtxt(buffer, size): """Create a parser context for an HTML in-memory document. """ ret = libxml2mod.htmlCreateMemoryParserCtxt(buffer, size) if ret is None:raise parserError('htmlCreateMemoryParserCtxt() failed') return parserCtxt(_obj=re...
mit
nzavagli/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/django-1.8.2/django/contrib/gis/maps/google/zoom.py
527
6676
from __future__ import unicode_literals from math import atan, exp, log, pi, sin from django.contrib.gis.geos import GEOSGeometry, LinearRing, Point, Polygon from django.contrib.gis.maps.google.gmap import GoogleMapException from django.utils.six.moves import range # Constants used for degree to radian conversion, a...
mit
KohlsTechnology/ansible
lib/ansible/modules/network/f5/bigip_facts.py
13
63421
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # Copyright (c) 2013 Matt Hite <mhite@hotmail.com> # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBL...
gpl-3.0
SCSSG/Odoo-SCS
addons/account/wizard/account_validate_account_move.py
381
3203
# -*- 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
AlexOugh/horizon
horizon/messages.py
85
3425
# Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
apache-2.0
meganbkratz/acq4
acq4/devices/Laser/taskTemplate.py
3
5816
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file './acq4/devices/Laser/taskTemplate.ui' # # Created: Tue Dec 24 01:49:07 2013 # by: PyQt4 UI code generator 4.10 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QStrin...
mit