repo_name
stringlengths
5
104
path
stringlengths
4
248
content
stringlengths
102
99.9k
gregkorte/Python-Koans
python3/koans/about_comprehension.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * class AboutComprehension(Koan): def test_creating_lists_with_list_comprehensions(self): feast = ['lambs', 'sloths', 'orangutans', 'breakfast cereals', 'fruit bats'] comprehension = [delicacy.capitalize() for de...
flavour/eden
modules/templates/locations/MK/config.py
# -*- coding: utf-8 -*- from gluon import current def config(settings): """ Template settings for North Macedonia - designed to be used in a Cascade with an application template """ #T = current.T # Pre-Populate settings.base.prepopulate.append("locations/MK") # Restrict to ...
domenicosolazzo/practice-django
venv/lib/python2.7/site-packages/django/db/backends/creation.py
import hashlib import sys import time import warnings from django.conf import settings from django.db.utils import load_backend from django.utils.deprecation import RemovedInDjango18Warning from django.utils.encoding import force_bytes from django.utils.functional import cached_property from django.utils.six.moves imp...
ACJTeam/enigma2
lib/python/Components/ConfigList.py
from HTMLComponent import HTMLComponent from GUIComponent import GUIComponent from config import KEY_LEFT, KEY_RIGHT, KEY_HOME, KEY_END, KEY_0, KEY_DELETE, KEY_BACKSPACE, KEY_OK, KEY_TOGGLEOW, KEY_ASCII, KEY_TIMEOUT, KEY_NUMBERS, ConfigElement, ConfigText, ConfigPassword from Components.ActionMap import NumberActionMap...
GabrieleNunez/fofix
fofix/core/Scene.py
##################################################################### # -*- coding: iso-8859-1 -*- # # # # Frets on Fire X (FoFiX) # # Copyright (C) 2006 Sami Kyöstilä ...
makerbot/ReplicatorG
skein_engines/skeinforge-35/skeinforge_application/skeinforge_plugins/analyze_plugins/vectorwrite.py
""" This page is in the table of contents. Vectorwrite is a script to write Scalable Vector Graphics for a gcode file. The vectorwrite manual page is at: http://www.bitsfrombytes.com/wiki/index.php?title=Skeinforge_Vectorwrite Vectorwrite generates a Scalable Vector Graphics file which can be opened by an SVG viewer ...
HiSPARC/station-software
user/python/Lib/site-packages/google/protobuf/internal/import_test_package/inner_pb2.py
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/internal/import_test_package/inner.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 _message from ...
psychopy/versions
psychopy/contrib/configobj/validate.py
# validate.py # -*- coding: utf-8 -*- # pylint: disable= # # A Validator object. # # Copyright (C) 2005-2014: # (name) : (email) # Michael Foord: fuzzyman AT voidspace DOT org DOT uk # Mark Andrews: mark AT la-la DOT com # Nicola Larosa: nico AT tekNico DOT net # Rob Dennis: rdennis AT gmail DOT com # Eli Courtwright: ...
smurfy/ardupilot-mpng
Tools/autotest/autotest.py
#!/usr/bin/env python # APM automatic test suite # Andrew Tridgell, October 2011 import pexpect, os, sys, shutil, atexit import optparse, fnmatch, time, glob, traceback, signal sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), 'pysim')) import util os.environ['PYTHONUNBUFFERED'] = '1' os...
sadmansk/servo
tests/wpt/web-platform-tests/webdriver/tests/element_click/scroll_into_view.py
import pytest from tests.support.asserts import assert_error, assert_success from tests.support.inline import inline def element_click(session, element): return session.transport.send( "POST", "session/{session_id}/element/{element_id}/click".format( session_id=session.session_id, ...
LLNL/spack
var/spack/repos/builtin/packages/py-tzlocal/package.py
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyTzlocal(PythonPackage): """tzinfo object for the local timezone.""" homepage = "htt...
haukepetersen/RIOT
tests/thread_exit/tests/01-run.py
#!/usr/bin/env python3 import os import sys def testfunc(child): child.expect("main: starting") child.expect("main: exiting") child.expect("2nd: starting") child.expect("3rd: starting") child.expect("3rd: exiting") child.expect("2nd: exiting") child.expect("4th: starting") child.expec...
xsm110/Apache-Beam
sdks/python/apache_beam/io/gcp/datastore/v1/datastoreio.py
# # 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...
dmlc/mxnet
example/capsnet/capsulelayers.py
# 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 ...
ted-gould/nova
nova/api/openstack/compute/servers.py
# Copyright 2010 OpenStack Foundation # Copyright 2011 Piston Cloud Computing, 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.apach...
gizmag/django-fsm-log
django_fsm_log/apps.py
from __future__ import unicode_literals from django.apps import AppConfig from django.conf import settings from django.utils.module_loading import import_string from django_fsm.signals import pre_transition, post_transition class DjangoFSMLogAppConfig(AppConfig): name = 'django_fsm_log' verbose_name = "Djang...
ulif/pulp
bindings/test/unit/test_search.py
import mock from pulp.bindings.search import SearchAPI, Operator, IntOperator, CSVOperator from pulp.common.compat import unittest class TestSearchAPI(unittest.TestCase): def setUp(self): super(TestSearchAPI, self).setUp() self.api = SearchAPI(mock.MagicMock()) self.api.PATH = '/some/path...
ulif/pulp
run-tests.py
#!/usr/bin/env python2 # -*- coding: utf-8 -*- import os import subprocess import sys from pulp.devel.test_runner import run_tests from pulp.server.constants import PULP_DJANGO_SETTINGS_MODULE # Find and eradicate any existing .pyc files, so they do not eradicate us! PROJECT_DIR = os.path.dirname(__file__) subproce...
kustodian/ansible
lib/ansible/module_utils/ec2.py
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
jeremiahyan/odoo
addons/website_links/controller/main.py
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import http from odoo.http import request class WebsiteUrl(http.Controller): @http.route('/website_links/new', type='json', auth='user', methods=['POST']) def create_shorten_url(self, **post): ...
BehavioralInsightsTeam/edx-platform
cms/djangoapps/contentstore/views/tests/test_import_export.py
""" Unit tests for course import and export """ import copy import json import logging import os import shutil import tarfile import tempfile from uuid import uuid4 import ddt import lxml from django.conf import settings from django.core.files.storage import FileSystemStorage from django.test.utils import override_set...
jtl999/certbot
certbot/tests/colored_logging_test.py
"""Tests for certbot.colored_logging.""" import logging import unittest import six from certbot import util class StreamHandlerTest(unittest.TestCase): """Tests for certbot.colored_logging.""" def setUp(self): from certbot import colored_logging self.stream = six.StringIO() self.st...
CollabQ/CollabQ
vendor/django/contrib/gis/db/models/fields/__init__.py
from django.contrib.gis import forms # Getting the SpatialBackend container and the geographic quoting method. from django.contrib.gis.db.backend import SpatialBackend, gqn # GeometryProxy, GEOS, and Distance imports. from django.contrib.gis.db.models.proxy import GeometryProxy from django.contrib.gis.measure import Di...
JackieXie168/rethinkdb
drivers/python/rethinkdb/_dump.py
#!/usr/bin/env python '''`rethinkdb dump` creates an archive of data from a RethinkDB cluster''' from __future__ import print_function import datetime, optparse, os, platform, shutil, sys, tarfile, tempfile, time, traceback from . import utils_common, net, _export usage = "rethinkdb dump [-c HOST:PORT] [-p] [--pas...
wagnerand/zamboni
mkt/webpay/tests/test_tasks.py
from datetime import datetime, timedelta import os from django.conf import settings from django.core.files.storage import default_storage as storage import fudge from fudge.inspector import arg from nose.tools import eq_ from requests.exceptions import RequestException from amo.tests import TestCase from mkt.webpay...
lucienfostier/gaffer
python/GafferUITest/ExamplesTest.py
########################################################################## # # Copyright (c) 2019, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistrib...
teoliphant/scipy
scipy/weave/accelerate_tools.py
#**************************************************************************# #* FILE ************** accelerate_tools.py ************************# #**************************************************************************# #* Author: Patrick Miller February 9 2002 *# #***********...
chromium/chromium
tools/android/build_speed/benchmark.py
#!/usr/bin/env python3 # Copyright 2020 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. """Tool to run build benchmarks (e.g. incremental build time). Example Command: tools/android/build_speed/benchmark.py all_increme...
aasoliz/Bitcoin-Statistics
venv/lib/python2.7/site-packages/sqlalchemy/dialects/oracle/base.py
# oracle/base.py # Copyright (C) 2005-2016 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:: oracle :name: Oracle Oracle version 8 through current (11g ...
okuta/chainer
examples/pix2pix/facade_dataset.py
from PIL import Image from chainer.dataset import dataset_mixin import numpy as np # download `BASE` dataset from http://cmp.felk.cvut.cz/~tylecr1/facade/ class FacadeDataset(dataset_mixin.DatasetMixin): def __init__(self, dataDir='./facade/base', data_range=(1, 300)): print('load dataset start') ...
jmartinm/invenio
modules/bibindex/lib/tokenizers/BibIndexFulltextTokenizer.py
# -*- coding:utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2010, 2011, 2012 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 you...
magicwifi/opkg
tests/regress/issue58.py
#!/usr/bin/python3 import os import opk, cfg, opkgcl opk.regress_init() o = opk.OpkGroup() o.add(Package="a", Version="1.0", Architecture="all", Recommends="b") o.add(Package="b", Version="1.0", Architecture="all") o.add(Package="c", Version="1.0", Architecture="all", Recommends="b") o.write_opk() o.write_list() op...
tectronics/opencamlib
scripts/ocl_test0.py
import ocl if __name__ == "__main__": p = ocl.Point() p.x=7 p.y=8 p.z=-3 print p q = ocl.Point(1,2,3) print q r = p + q s = ocl.Point(66,66,66) s += r print r print s print "2*s=", (s*2) print "s.norm=", s.norm() print "normalizing" s.normalize() pri...
mpharrigan/mixtape
msmbuilder/tpt/committor.py
# Author(s): TJ Lane (tjlane@stanford.edu) and Christian Schwantes # (schwancr@stanford.edu) # Contributors: Vince Voelz, Kyle Beauchamp, Robert McGibbon # Copyright (c) 2014, Stanford University # All rights reserved. """ Functions for computing forward committors for an MSM. The forward committor is defin...
shakamunyi/neutron-vrrp
neutron/plugins/cisco/extensions/credential.py
# Copyright 2013 Cisco Systems, 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 requir...
seibert/numba
numba/testing/loader.py
from unittest import loader, case from os.path import isdir, isfile, join, dirname, basename class TestLoader(loader.TestLoader): def __init__(self, topleveldir=None): super(TestLoader, self).__init__() self._top_level_dir = topleveldir or dirname(dirname(dirname(__file__))) def _find_tests(...
yashsharan/sympy
sympy/matrices/expressions/matadd.py
from __future__ import print_function, division from sympy.core.compatibility import reduce from operator import add from sympy.core import Add, Basic, sympify from sympy.functions import adjoint from sympy.matrices.matrices import MatrixBase from sympy.matrices.expressions.transpose import transpose from sympy.strat...
newvem/pytz
pytz/zoneinfo/Pacific/Niue.py
'''tzinfo timezone information for Pacific/Niue.''' from pytz.tzinfo import DstTzInfo from pytz.tzinfo import memorized_datetime as d from pytz.tzinfo import memorized_ttinfo as i class Niue(DstTzInfo): '''Pacific/Niue timezone definition. See datetime.tzinfo for details''' zone = 'Pacific/Niue' _utc_tra...
pombredanne/dxr
tests/test_indexers.py
from nose import SkipTest from nose.tools import eq_, assert_raises from dxr.indexers import (unsparsify, by_line, group_needles, span_to_lines, key_object_pair, Extent, Position, split_into_lines, FileToSkim) KV1 = ('x', 'v1') KV2 = ('y', 'v2') KV3 = ('z', 'v3') ...
hzruandd/AutobahnPython
examples/twisted/websocket/wrapping/server.py
############################################################################### # # The MIT License (MIT) # # Copyright (c) Tavendo GmbH # # 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 with...
skiz/warzone2100
tools/conversion/ini2json/ini2json_body.py
import ConfigParser import json import sys if len(sys.argv) < 3: print 'Need body.ini and bodypropulsionimd.ini parameters' sys.exit(1) config = ConfigParser.ConfigParser() config.optionxform = str # stop making keys lowercase config.read(sys.argv[1]) config2 = ConfigParser.ConfigParser() config2.optionxform = str...
dongjoon-hyun/tensorflow
tensorflow/compiler/tests/qr_op_test.py
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
nkunihiko/django-bootstrap3-datetimepicker
sample/settings.py
# Django settings for sample project. import os DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. ...
TieWei/nova
nova/tests/virt/baremetal/test_tilera.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # coding=utf-8 # Copyright (c) 2011-2013 University of Southern California / ISI # 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 ...
jianglu/mojo
mojo/tools/roll/update_from_chromium.py
#!/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. import argparse import json import os import subprocess import sys import urllib2 from utils import commit from utils import mojo_root_...
sdgdsffdsfff/monitor-core
gmond/python_modules/network/traffic1.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import os import threading import time descriptors = list() Desc_Skel = {} _Worker_Thread = None _Lock = threading.Lock() # synchronization lock Debug = False def dprint(f, *v): if Debug: print >> sys.stderr, "DEBUG: "+f % v class UpdateTraffic...
flavour/eden
modules/templates/historic/NZRC/config.py
# -*- coding: utf-8 -*- from collections import OrderedDict from gluon import current from gluon.storage import Storage def config(settings): """ New Zealand Red Cross - designed to be used with locations.NZ & VM templates """ T = current.T #settings.base.system_name = T("Sahana Ske...
grnet/synnefo
snf-pithos-backend/pithos/backends/lib/sqlalchemy/alembic/versions/165ba3fbfe53_update_path_account.py
"""update account in paths Revision ID: 165ba3fbfe53 Revises: 3dd56e750a3 Create Date: 2012-12-04 19:08:23.933634 """ # revision identifiers, used by Alembic. revision = '165ba3fbfe53' down_revision = '3dd56e750a3' from alembic import op from sqlalchemy.sql import table, column, and_ from astakosclient import Asta...
shreyasp/erpnext
erpnext/stock/doctype/delivery_note/test_delivery_note.py
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import unittest import frappe import json import frappe.defaults from frappe.utils import cint, nowdate, nowtime, cstr, add_days, flt, today from erpne...
daniel-j-born/grpc
src/python/grpcio_testing/grpc_testing/_server/_rpc.py
# Copyright 2017 gRPC 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 applicable law or agreed to in writing...
QingChenmsft/azure-cli
src/azure-cli-core/azure/cli/core/tests/test_progress.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
pxquim/pelican-plugins
thumbnailer/thumbnailer.py
import os import os.path as path import re from pelican import signals import logging logger = logging.getLogger(__name__) try: from PIL import Image, ImageOps enabled = True except ImportError: logging.warning("Unable to load PIL, disabling thumbnailer") enabled = False DEFAULT_IMAGE_DIR = "pictures...
frreiss/tensorflow-fred
tensorflow/python/autograph/converters/conditional_expressions.py
# Copyright 2017 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...
iansf/sky_engine
sky/tools/webkitpy/common/system/executive_unittest.py
# Copyright (C) 2010 Google Inc. All rights reserved. # Copyright (C) 2009 Daniel Bates (dbates@intudata.com). 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 co...
Gabotero/GNURadioNext
gr-digital/python/psk.py
# # Copyright 2005,2006,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 ...
stanlyxiang/incubator-hawq
tools/bin/gppylib/commands/san.py
#!/usr/bin/env python # 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 # "Li...
EricMuller/mynotes-backend
requirements/twisted/Twisted-17.1.0/src/twisted/positioning/base.py
# -*- test-case-name: twisted.positioning.test.test_base,twisted.positioning.test.test_sentence -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Generic positioning base classes. @since: 14.0 """ from __future__ import absolute_import, division from functools import partial from operat...
hzlf/openbroadcast
website/__filer/management/commands/import_files.py
#-*- coding: utf-8 -*- from django.core.files import File as DjangoFile from django.core.management.base import BaseCommand, NoArgsCommand from filer.models.filemodels import File from filer.models.foldermodels import Folder from filer.models.imagemodels import Image from filer.settings import FILER_IS_PUBLIC_DEFAULT f...
xtiankisutsa/MARA_Framework
tools/qark/qark/lib/progressbar/compat.py
#!/usr/bin/python # -*- coding: utf-8 -*- # # progressbar - Text progress bar library for Python. # Copyright (c) 2005 Nilton Volpato # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; ei...
ml-lab/neon
neon/models/balance.py
# ---------------------------------------------------------------------------- # Copyright 2014 Nervana 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.o...
treejames/viewfinder
backend/www/test/remove_photos_test.py
# Copyright 2012 Viewfinder Inc. All Rights Reserved. """Tests remove_photos method. """ __author__ = 'andy@emailscrubbed.com (Andy Kimball)' import mock import time from copy import deepcopy from functools import partial from viewfinder.backend.base import util from viewfinder.backend.base.testing import async_tes...
x86Labs/wal-e
wal_e/retries.py
import functools import sys import traceback import gevent from wal_e import log_help logger = log_help.WalELogger(__name__) def generic_exception_processor(exc_tup, **kwargs): logger.warning( msg='retrying after encountering exception', detail=('Exception information dump: \n{0}' ...
trankmichael/scipy
scipy/sparse/construct.py
"""Functions to construct sparse matrices """ from __future__ import division, print_function, absolute_import __docformat__ = "restructuredtext en" __all__ = ['spdiags', 'eye', 'identity', 'kron', 'kronsum', 'hstack', 'vstack', 'bmat', 'rand', 'random', 'diags', 'block_diag'] import numpy as np from sc...
flavour/helios
tests/selenium/scripts/xmlrunner.py
""" XML Test Runner for PyUnit """ # Written by Sebastian Rittau <srittau@jroger.in-berlin.de> and placed in # the Public Domain. With contributions by Paolo Borelli and others. from __future__ import with_statement __version__ = "0.1" import os.path import re import sys import time import traceback import unittest...
Goutte/Ni
v1/web/apostrophePlugin/web/js/fckeditor/editor/filemanager/connectors/py/fckutil.py
#!/usr/bin/env python """ FCKeditor - The text editor for Internet - http://www.fckeditor.net Copyright (C) 2003-2009 Frederico Caldeira Knabben == BEGIN LICENSE == Licensed under the terms of any of the following licenses at your choice: - GNU General Public License Version 2 or later (the "GPL") http://www.gnu.or...
ashang/calibre
src/calibre/ebooks/metadata/sources/worker.py
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' import os fro...
xiaoyaozi5566/GEM5_DRAMSim2
tests/configs/realview-simple-atomic.py
# Copyright (c) 2006-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 ...
xbmc/atv2
xbmc/lib/libPython/Python/Lib/test/test_pyexpat.py
# Very simple test - Parse a file and print what happens # XXX TypeErrors on calling handlers, or on bad return values from a # handler, are obscure and unhelpful. import pyexpat from xml.parsers import expat from test.test_support import sortdict, TestFailed class Outputter: def StartElementHandler(self, name,...
liavkoren/djangoDev
docs/_ext/djangodocs.py
""" Sphinx plugins for Django documentation. """ import json import os import re from docutils import nodes from docutils.parsers.rst import directives from sphinx import addnodes, __version__ as sphinx_ver from sphinx.builders.html import StandaloneHTMLBuilder from sphinx.writers.html import SmartyPantsHTMLTranslato...
CenturylinkTechnology/ansible-modules-extras
network/openvswitch_port.py
#!/usr/bin/python #coding: utf-8 -*- # pylint: disable=C0111 # (c) 2013, David Stygstra <david.stygstra@gmail.com> # # Portions copyright @ 2015 VMware, Inc. # # This file is part of Ansible # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License ...
v0ila/Lauwersscan
pyspider/database/base/taskdb.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<i@binux.me> # http://binux.me # Created on 2014-02-08 10:28:48 # task schema { 'task': { 'taskid': str, # new, not change 'project': str, # new, not change 'url': str, ...
kyvinh/home-assistant
tests/components/media_player/test_yamaha.py
"""The tests for the Yamaha Media player platform.""" import unittest import xml.etree.ElementTree as ET import rxv def sample_content(name): """Read content into a string from a file.""" with open('tests/components/media_player/yamaha_samples/%s' % name, encoding='utf-8') as content: r...
balajikris/autorest
src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/models/array_wrapper.py
# 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 ...
burzillibus/RobHome
venv/lib/python2.7/site-packages/dns/rdtypes/ANY/EUI48.py
# Copyright (C) 2015 Red Hat, Inc. # Author: Petr Spacek <pspacek@redhat.com> # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # #...
leki75/ansible
lib/ansible/modules/cloud/smartos/vmadm.py
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Jasper Lievisse Adriaanse <j@jasper.la> # # 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 t...
bealdav/OpenUpgrade
addons/sale/sale.py
# -*- 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...
jirikuncar/invenio-deposit
invenio_deposit/form.py
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2013, 2015 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any...
waseem18/oh-mainline
vendor/packages/celery/celery/worker/job.py
# -*- coding: utf-8 -*- """ celery.worker.job ~~~~~~~~~~~~~~~~~ This module defines the :class:`TaskRequest` class, which specifies how tasks are executed. :copyright: (c) 2009 - 2011 by Ask Solem. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import...
maroux/django-extensions
django_extensions/management/shells.py
import traceback import django import six class ObjectImportError(Exception): pass def import_items(import_directives, style, quiet_load=False): """ Import the items in import_directives and return a list of the imported items Each item in import_directives should be one of the following forms ...
wakamori/luigi
test/postgres_with_server_test.py
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
nycholas/ask-undrgz
src/ask-undrgz/django/contrib/gis/geos/tests/test_geos.py
import ctypes, random, unittest, sys from django.contrib.gis.geos import * from django.contrib.gis.geos.base import gdal, numpy, GEOSBase from django.contrib.gis.tests.geometries import * class GEOSTest(unittest.TestCase): @property def null_srid(self): """ Returns the proper null SRID dependi...
e-gob/plataforma-kioscos-autoatencion
scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/plugins/callback/logstash.py
# (C) 2016, Ievgen Khmelenko <ujenmr@gmail.com> # (C) 2017 Ansible Project # 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 DOCUMENTATION = ''' callback: logstash type: notificat...
barnsnake351/neutron
neutron/db/migration/alembic_migrations/versions/liberty/contract/11926bcfe72d_add_geneve_ml2_type_driver.py
# Copyright 2015 OpenStack Foundation # # 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 ...
devinbalkind/eden
modules/tests/volunteer/export_volunteers.py
# -*- coding: utf-8 -*- """ Sahana Eden Volunteer Module Automated Tests @copyright: 2011-2012 (c) Sahana Software Foundation @license: MIT 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...
bluemini/kuma
vendor/packages/translate/storage/test_directory.py
#!/usr/bin/env python """Tests for the directory module""" import os from translate.storage import directory class TestDirectory(object): """a test class to run tests on a test Pootle Server""" def setup_method(self, method): """sets up a test directory""" print("setup_method called on", s...
liuqr/edx-xiaodun
i18n/tests/test_segment.py
"""Test i18n/segment.py""" import os.path import shutil import unittest from path import path import polib from i18n.segment import segment_pofile HERE = path(__file__).dirname() TEST_DATA = HERE / "data" WORK = HERE / "work" class SegmentTest(unittest.TestCase): """Test segment_pofile.""" def setUp(sel...
dslutz/qemu
scripts/tracetool/format/ust_events_h.py
# -*- coding: utf-8 -*- """ trace/generated-ust-provider.h """ __author__ = "Mohamad Gebai <mohamad.gebai@polymtl.ca>" __copyright__ = "Copyright 2012, Mohamad Gebai <mohamad.gebai@polymtl.ca>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi" __email__ ...
e-gob/plataforma-kioscos-autoatencion
scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/modules/network/avi/avi_hardwaresecuritymodulegroup.py
#!/usr/bin/python # # Created on Aug 25, 2016 # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # # # 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...
mikehow1984/PokemonGo-Map
pogom/pgoapi/pgoapi.py
""" pgoapi - Pokemon Go API Copyright (c) 2016 tjado <https://github.com/tejado> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use...
moreati/django
tests/template_tests/test_custom.py
from __future__ import unicode_literals import os from django.template import Context, Engine, TemplateSyntaxError from django.template.base import Node from django.template.library import InvalidTemplateLibrary from django.test import SimpleTestCase, ignore_warnings from django.test.utils import extend_sys_path from...
saurabh6790/medsyn-lib
webnotes/sessions.py
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals """ Boot session from cache or build Session bootstraps info needed by common client side activities including permission, homepage, control panel variables, system defaults ...
e-gob/plataforma-kioscos-autoatencion
scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/modules/cloud/centurylink/clc_loadbalancer.py
#!/usr/bin/python # # Copyright (c) 2015 CenturyLink # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['prev...
firmlyjin/brython
www/tests/unittests/test/test_importlib/import_/test_path.py
from importlib import _bootstrap from importlib import machinery from importlib import import_module from .. import util from . import util as import_util import os import sys from types import ModuleType import unittest import warnings import zipimport class FinderTests(unittest.TestCase): """Tests for PathFind...
valexandersaulys/airbnb_kaggle_contest
venv/lib/python3.4/site-packages/sklearn/utils/graph.py
""" Graph utilities and algorithms Graphs are represented with their adjacency matrices, preferably using sparse matrices. """ # Authors: Aric Hagberg <hagberg@lanl.gov> # Gael Varoquaux <gael.varoquaux@normalesup.org> # Jake Vanderplas <vanderplas@astro.washington.edu> # License: BSD 3 clause impo...
XWARIOSWX/wnframework
webnotes/install_lib/setup_public_folder.py
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt # make public folders from __future__ import unicode_literals import os import webnotes def make(site=None): """make public folder symlinks if missing""" from webnotes.utils import get_site_base_path, get_base_pa...
ThiagoGarciaAlves/erpnext
erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import unittest import frappe from frappe.utils import flt from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry cl...
dgweber/CertAuth
pyOpenSSL-0.13.1/doc/tools/support.py
"""Miscellaneous support code shared by some of the tool scripts. This includes option parsing code, HTML formatting code, and a couple of useful helpers. """ __version__ = '$Revision: 1.1.1.1 $' import getopt import string import sys class Options: __short_args = "a:c:ho:" __long_args = [ # scrip...
BillBillBillBill/Tickeys-linux
tickeys/kivy_32/kivy/tools/generate-icons.py
#!/usr/bin/env python ''' Icon generator ============== This tool will help you to generate all the icons wanted for Google Play Store, App Store, Amazon store. ''' import sys from PIL import Image from os.path import exists, join, realpath, basename, dirname from os import makedirs from argparse import ArgumentParse...
alxgu/ansible
test/units/modules/remote_management/oneview/oneview_module_loader.py
# Copyright (c) 2016-2017 Hewlett Packard Enterprise Development LP # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) import sys from units.compat.mock import patch, Mock # FIXME: These should be done inside of a fixture so that they're only mocked during # these unittests s...
BenoitDherin/data-analysis-with-R
website/plugins/subcategory/subcategory.py
# -*- coding: utf-8 -*- """ @Author: Alistair Magee Adds support for subcategories on pelican articles """ import os from collections import defaultdict from operator import attrgetter from functools import partial from pelican import signals from pelican.urlwrappers import URLWrapper, Category from pelican.utils imp...