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
emidln/django_roa
env/lib/python2.7/site-packages/django/contrib/contenttypes/tests.py
152
2951
from django import db from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.contrib.sites.models import Site from django.contrib.contenttypes.views import shortcut from django.core.exceptions import ObjectDoesNotExist from django.http import HttpRequest from django.test...
bsd-3-clause
jnerin/ansible
lib/ansible/modules/network/panos/panos_security_rule.py
15
20157
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 ANSIBLE_METADATA = {'metadata_version':...
gpl-3.0
skyddv/neutron
neutron/scheduler/base_scheduler.py
46
2778
# Copyright (c) 2015 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
apache-2.0
xxsergzzxx/python-for-android
python3-alpha/extra_modules/pyxmpp2/ext/delay.py
46
6722
# # (C) Copyright 2003-2010 Jacek Konieczny <jajcus@jajcus.net> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License Version # 2.1 as published by the Free Software Foundation. # # This program is distributed in the hope that it will be u...
apache-2.0
sgraham/nope
third_party/webdriver/pylib/selenium/webdriver/chrome/service.py
17
3451
#!/usr/bin/python # # Copyright 2011 Webdriver_name committers # Copyright 2011 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 ...
bsd-3-clause
EvanK/ansible
test/units/modules/network/ironware/test_ironware_config.py
30
6809
# # (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is d...
gpl-3.0
wangjun/odoo
addons/payment_paypal/controllers/main.py
260
3738
# -*- coding: utf-8 -*- try: import simplejson as json except ImportError: import json import logging import pprint import urllib2 import werkzeug from openerp import http, SUPERUSER_ID from openerp.http import request _logger = logging.getLogger(__name__) class PaypalController(http.Controller): _noti...
agpl-3.0
emyarod/OSS
1_intro/6.00.1x/Week 3/L5 Problems/L5 Problem 9.py
1
1795
# A semordnilap is a word or a phrase that spells a different word when # backwards ("semordnilap" is a semordnilap of "palindromes"). Here are some # examples: # # nametag / gateman # dog / god # live / evil # desserts / stressed # # Write a recursive program, `semordnilap`, that takes in two words and...
mit
luhanhan/horizon
openstack_dashboard/test/api_tests/glance_rest_tests.py
35
3890
# Copyright 2015, Rackspace, US, Inc. # Copyright 2015, Hewlett-Packard Development Company, L.P. # # 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...
apache-2.0
axilleas/ansible-modules-core
cloud/amazon/ec2_key.py
29
7267
#!/usr/bin/python # -*- coding: utf-8 -*- DOCUMENTATION = ''' --- module: ec2_key version_added: "1.5" short_description: maintain an ec2 key pair. description: - maintains ec2 key pairs. This module has a dependency on python-boto >= 2.5 options: name: description: - Name of the key pair. require...
gpl-3.0
mancoast/CPythonPyc_test
cpython/278_test_tempfile.py
21
33801
# tempfile.py unit tests. import tempfile import errno import io import os import signal import shutil import sys import re import warnings import contextlib import unittest from test import test_support as support warnings.filterwarnings("ignore", category=RuntimeWarning, ...
gpl-3.0
klmitch/nova
nova/tests/functional/api_sample_tests/test_instance_actions.py
3
6192
# Copyright 2012 Nebula, Inc. # Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
apache-2.0
Stavitsky/neutron
neutron/db/migration/alembic_migrations/versions/3c346828361e_metering_label_shared.py
15
1107
# Copyright 2014 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 ...
apache-2.0
h-naoto/gobgp
test/lib/bagpipe.py
4
2768
# Copyright (C) 2015 Nippon Telegraph and Telephone Corporation. # # 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
jalabort/ijcv-2014-aam
aam/transform.py
1
23059
import scipy import numpy as np from menpo.base import DP, Targetable, Vectorizable from menpo.shape import PointCloud from menpo.transform import Transform, AlignmentSimilarity from menpo.model import Similarity2dInstanceModel from menpo.model.modelinstance import ModelInstance # Point Distribution Models ---------...
bsd-2-clause
carolinux/QGIS
python/plugins/GdalTools/tools/doTranslate.py
12
13134
# -*- coding: utf-8 -*- """ *************************************************************************** doTranslate.py --------------------- Date : June 2010 Copyright : (C) 2010 by Giuseppe Sucameli Email : brush dot tyler at gmail dot com ****************...
gpl-2.0
schinckel/django-countries
django_countries/data.py
1
17503
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This is a self-generating script that contains all of the iso3166-1 data. To regenerate, a CSV file must be created that contains the latest data. Here's how to do that: 1. Visit https://www.iso.org/obp 2. Click the "Country Codes" radio option and click the search bu...
mit
kanagasabapathi/python-for-android
python3-alpha/python3-src/Lib/ctypes/test/test_numbers.py
45
8794
from ctypes import * import unittest import struct def valid_ranges(*types): # given a sequence of numeric types, collect their _type_ # attribute, which is a single format character compatible with # the struct module, use the struct module to calculate the # minimum and maximum value allowed for this...
apache-2.0
hunter007/django
tests/gis_tests/geoapp/test_sitemaps.py
190
3235
from __future__ import unicode_literals import zipfile from io import BytesIO from xml.dom import minidom from django.conf import settings from django.contrib.sites.models import Site from django.test import ( TestCase, ignore_warnings, modify_settings, override_settings, skipUnlessDBFeature, ) from django.ut...
bsd-3-clause
seanli9jan/tensorflow
tensorflow/python/kernel_tests/matrix_exponential_op_test.py
3
9042
# 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...
apache-2.0
stanlyxiang/incubator-hawq
tools/bin/pythonSrc/pychecker-0.8.18/pychecker/Stack.py
8
3656
#!/usr/bin/env python # Copyright (c) 2001-2002, MetaSlash Inc. All rights reserved. """ Module to hold manipulation of elements on the stack. """ import types from pychecker import utils DATA_UNKNOWN = "-unknown-" LOCALS = 'locals' # These should really be defined by subclasses TYPE_UNKNOWN = "-unknown-" TYPE_FU...
apache-2.0
zsiciarz/django
tests/sitemaps_tests/test_generic.py
22
1679
from datetime import datetime from django.contrib.sitemaps import GenericSitemap from django.test import override_settings from .base import SitemapTestsBase from .models import TestModel @override_settings(ABSOLUTE_URL_OVERRIDES={}) class GenericViewsSitemapTests(SitemapTestsBase): def test_generic_sitemap_at...
bsd-3-clause
ChristosChristofidis/bokeh
bokeh/models/mappers.py
34
1948
""" Models for mapping values from one range or space to another. """ from __future__ import absolute_import from ..plot_object import PlotObject from ..properties import Float, Color, Enum, Seq from ..enums import Palette from .. import palettes class ColorMapper(PlotObject): """ Base class for color mapper typ...
bsd-3-clause
ujjvala-addsol/addsol_hr
openerp/service/db.py
64
13823
# -*- coding: utf-8 -*- from contextlib import closing from functools import wraps import logging import os import shutil import threading import traceback import tempfile import zipfile import psycopg2 import openerp from openerp import SUPERUSER_ID from openerp.exceptions import Warning import openerp.release impor...
agpl-3.0
MeGotsThis/Hanabi-AI
multitagbot_v2_2/hint.py
3
1420
class Hint: def __init__(self, *, fitness=0, to=None, color=None, value=None): self.fitness = fitness self.to = to self.color = color self.value = value def give(self, bot): assert self.to is not None assert self.to != bot.position if self.color is not N...
gpl-3.0
my-first/octocoin
contrib/devtools/symbol-check.py
149
4348
#!/usr/bin/python # Copyright (c) 2014 Wladimir J. van der Laan # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' A script to check that the (Linux) executables produced by gitian only contain allowed gcc, glibc and libstdc++...
mit
alexpearce/thesis
scripts/background_categories.py
1
3206
from __future__ import absolute_import, division, print_function import os import matplotlib.pyplot as plt import ROOT import root_pandas from histograms import histogram from root_converters import roocurve, tgraphasymerrors from plotting_utilities import ( COLOURS as colours, set_axis_labels ) PREFIX = 'ro...
mit
mtmarsh2/vislab
vislab/tests/vw3.py
4
6227
import logging import unittest import pandas as pd import numpy as np import gzip import os import test_context import vislab.predict import vislab.vw3 class TestVW(unittest.TestCase): @classmethod def setUpClass(cls): cls.temp_dirname = vislab.util.cleardirs( test_context.temp_dirname + '...
bsd-2-clause
mfherbst/spack
var/spack/repos/builtin/packages/py-memory-profiler/package.py
5
1681
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
yuchangfu/pythonfun
flaskenv/Lib/encodings/iso8859_3.py
593
13345
""" Python Character Mapping Codec iso8859_3 generated from 'MAPPINGS/ISO8859/8859-3.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors='...
gpl-3.0
jas14/khmer
scripts/filter-stoptags.py
2
2982
#! /usr/bin/env python # # This file is part of khmer, https://github.com/dib-lab/khmer/, and is # Copyright (C) Michigan State University, 2009-2015. It is licensed under # the three-clause BSD license; see LICENSE. # Contact: khmer-project@idyll.org # # pylint: disable=invalid-name,missing-docstring """ Sequence trim...
bsd-3-clause
gregdek/ansible
test/integration/targets/inventory_plugin_config/test_inventory.py
92
1318
from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' name: test_inventory plugin_type: inventory authors: - Pierre-Louis Bonicoli (@pilou-) short_description: test inventory description: - test inventory (fetch parameters using c...
gpl-3.0
LyonsLab/coge
bin/last_wrapper/Bio/SeqIO/_convert.py
3
15717
# Copyright 2009 by Peter Cock. All rights reserved. # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """Optimised sequence conversion code (PRIVATE). You are not expected to access this module, or a...
bsd-2-clause
matthiasdiener/spack
var/spack/repos/builtin/packages/gapfiller/package.py
5
2227
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
cloudbrain/cloudbrain
src/cloudbrain/modules/sources/beat.py
3
1899
import time import logging import threading from cloudbrain.modules.interface import ModuleInterface _NANOSECONDS = 1000000 _LOGGER = logging.getLogger(__name__) """ Publish constant values at regular intervals on each channel. Note that this module could be easily turned into a transformer that turns bpm in beats b...
agpl-3.0
eudoxos/woodem
scripts/test-OLD/WireMatPM/net-2part-strain.py
3
3628
# -*- coding: utf-8 -*- # encoding: utf-8 from woo import utils, ymport, qt #### logging from woo import log log.setLevel('Law2_ScGeom_WirePhys_WirePM',log.TRACE) # must compile with debug option to get logs #log.setLevel('Law2_ScGeom_WirePhys_WirePM',log.DEBUG) #log.setLevel('',log.WARN) ## definition of some color...
gpl-2.0
jhawkesworth/ansible
test/units/module_utils/facts/hardware/test_linux.py
93
7748
# 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 in the hope that ...
gpl-3.0
scrollback/kuma
kuma/wiki/migrations/0015_add_topical_parent.py
5
13477
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Document.parent_topic' db.add_column('wiki_document', 'parent_topic', self.gf('django.db.m...
mpl-2.0
feer56/Kitsune2
kitsune/wiki/tests/test_facets.py
16
4768
from nose.tools import eq_ from kitsune.products.tests import product, topic from kitsune.search.tests.test_es import ElasticTestCase from kitsune.sumo.tests import TestCase from kitsune.wiki.facets import ( topics_for, documents_for, _documents_for, _db_documents_for) from kitsune.wiki.tests import revision cla...
bsd-3-clause
Anonymous-X6/django
tests/template_tests/syntax_tests/test_named_endblock.py
521
2312
from django.template import TemplateSyntaxError from django.test import SimpleTestCase from ..utils import setup class NamedEndblockTests(SimpleTestCase): @setup({'namedendblocks01': '1{% block first %}_{% block second %}' '2{% endblock second %}_{% endblock first %}3'}) def ...
bsd-3-clause
rottenbytes/Sick-Beard
sickbeard/clients/requests/api.py
637
4333
# -*- coding: utf-8 -*- """ requests.api ~~~~~~~~~~~~ This module implements the Requests API. :copyright: (c) 2012 by Kenneth Reitz. :license: Apache2, see LICENSE for more details. """ from . import sessions def request(method, url, **kwargs): """Constructs and sends a :class:`Request <Request>`. Retur...
gpl-3.0
40223231/2015cd_midterm2
static/Brython3.1.1-20150328-091302/Lib/unittest/mock.py
739
71473
# mock.py # Test tools for mocking and patching. # Maintained by Michael Foord # Backport for other versions of Python available from # http://pypi.python.org/pypi/mock __all__ = ( 'Mock', 'MagicMock', 'patch', 'sentinel', 'DEFAULT', 'ANY', 'call', 'create_autospec', 'FILTER_DIR', ...
agpl-3.0
esotericnonsense/bitcoind-ncurses
net.py
2
3040
#!/usr/bin/env python import curses, math import global_mod as g def draw_window(state, old_window): old_window.clear() old_window.refresh() window_height = state['y'] - 1 window_width = state['x'] window = curses.newwin(window_height, window_width, 0, 0) history = state['history']['getnettot...
mit
kaiserroll14/301finalproject
main/numpy/distutils/command/config.py
75
15895
# Added Fortran compiler support to config. Currently useful only for # try_compile call. try_run works but is untested for most of Fortran # compilers (they must define linker_exe first). # Pearu Peterson from __future__ import division, absolute_import, print_function import os, signal import warnings import sys fr...
gpl-3.0
Dubrzr/django-push-notifications
push_notifications/api/tastypie.py
21
1413
from tastypie.authorization import Authorization from tastypie.authentication import BasicAuthentication from tastypie.resources import ModelResource from push_notifications.models import APNSDevice, GCMDevice class APNSDeviceResource(ModelResource): class Meta: authorization = Authorization() queryset = APNSDev...
mit
KenjiTakahashi/qoss
middleendv2.py
1
8570
# -*- coding: utf-8 -*- # This is a part of qoss @ http://github.com/KenjiTakahashi/qoss/ # Karol "Kenji Takahashi" Wozniak (C) 2011 # # 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 vers...
gpl-3.0
fugitifduck/exabgp
lib/exabgp/bgp/message/update/attribute/pmsi.py
1
4143
# encoding: utf-8 """ pmsi_tunnel.py Created by Thomas Morin on 2014-06-10. Copyright (c) 2014-2015 Orange. All rights reserved. Copyright (c) 2014-2015 Exa Networks. All rights reserved. """ from struct import pack from struct import unpack from exabgp.protocol.ip import IPv4 from exabgp.bgp.message.update.attribut...
bsd-3-clause
Qalthos/ansible
lib/ansible/modules/network/nxos/nxos_command.py
39
7159
#!/usr/bin/python # Copyright: 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 ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
sssllliang/silverberry
lib/setuptools/config.py
41
16088
from __future__ import absolute_import, unicode_literals import io import os import sys from collections import defaultdict from functools import partial from distutils.errors import DistutilsOptionError, DistutilsFileError from setuptools.py26compat import import_module from six import string_types def read_configu...
apache-2.0
alviano/wasp
tests/sat/Models/c677.150.UNSAT.dimacs.test.py
5
9128
input = """ c num blocks = 1 c num vars = 150 c minblockids[0] = 1 c maxblockids[0] = 150 p cnf 150 677 138 149 113 0 122 -73 -7 0 108 33 145 0 -21 -138 134 0 80 63 -59 0 -24 98 129 0 57 -135 -148 0 -35 -20 106 0 -127 106 148 0 -28 -29 66 0 -147 57 89 0 -19 3 -47 0 112 43 70 0 138 2 -134 0 -72 122 -119 0 91 76 -79 0 11...
apache-2.0
wujianguo/proxy
shadowsocks/asyncdns.py
7
18340
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2014 clowwindy # # 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 # ...
apache-2.0
yeahwhat-mc/CloudBotLegacy
lib/bs4/tests/test_builder_registry.py
485
5374
"""Tests of the builder registry.""" import unittest from bs4 import BeautifulSoup from bs4.builder import ( builder_registry as registry, HTMLParserTreeBuilder, TreeBuilderRegistry, ) try: from bs4.builder import HTML5TreeBuilder HTML5LIB_PRESENT = True except ImportError: HTML5LIB_PRESENT =...
gpl-3.0
MicroPyramid/django-payu
payu/tests.py
1
3386
from django.test import TestCase from django.conf import settings from payu.models import * from payu.gateway import ( get_hash, check_hash, get_webservice_hash, payu_url, post, verify_payment, check_payment, capture_transaction, refund_transaction, cancel_transaction, check_...
mit
helenst/django
tests/model_inheritance/tests.py
17
15747
from __future__ import unicode_literals from operator import attrgetter from django.core.exceptions import FieldError from django.core.management import call_command from django.db import connection from django.test import TestCase from django.test.utils import CaptureQueriesContext from django.utils import six from...
bsd-3-clause
Alberto-Beralix/Beralix
i386-squashfs-root/usr/share/system-config-printer/ppdsloader.py
1
11100
#!/usr/bin/python ## system-config-printer ## Copyright (C) 2010, 2011 Red Hat, Inc. ## Author: Tim Waugh <twaugh@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...
gpl-3.0
AntonioMtn/NZBMegaSearch
jinja2/testsuite/security.py
90
6157
# -*- coding: utf-8 -*- """ jinja2.testsuite.security ~~~~~~~~~~~~~~~~~~~~~~~~~ Checks the sandbox and other security features. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest from jinja2.testsuite import JinjaTestCase from jinja2 import E...
gpl-2.0
wilbert-abreu/flask
tests/test_user_error_handler.py
150
3483
# -*- coding: utf-8 -*- from werkzeug.exceptions import Forbidden, InternalServerError import flask def test_error_handler_no_match(): app = flask.Flask(__name__) class CustomException(Exception): pass @app.errorhandler(CustomException) def custom_exception_handler(e): assert isinsta...
bsd-3-clause
NEricN/RobotCSimulator
Python/App/Lib/SocketServer.py
33
24036
"""Generic socket server classes. This module tries to capture the various aspects of defining a server: For socket-based servers: - address family: - AF_INET{,6}: IP (Internet Protocol) sockets (default) - AF_UNIX: Unix domain sockets - others, e.g. AF_DECNET are conceivable (see <socket.h> ...
apache-2.0
rmfitzpatrick/ansible
lib/ansible/plugins/shell/csh.py
69
1478
# (c) 2014, Chris Church <chris@ninemoreminutes.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) any lat...
gpl-3.0
jorik041/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/checkout/scm/svn.py
119
17277
# Copyright (c) 2009, 2010, 2011 Google Inc. All rights reserved. # Copyright (c) 2009 Apple 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 reta...
bsd-3-clause
dmnyu/bitcurator
bctools/dfxml.py
3
54144
#!/usr/bin/env python # # dfxml.py # Digital Forensics XML classes """Digital Forensics XML classes. This module contains a number of classes for dealing with dfxml files, both using the XML DOM model and using the EXPAT model. The following moduel functions are defined: isone(x) - returns true if something is eq...
gpl-3.0
simone/django-gb
tests/many_to_one/tests.py
34
21685
from copy import deepcopy import datetime from django.core.exceptions import MultipleObjectsReturned, FieldError from django.db import transaction from django.test import TestCase from django.utils import six from django.utils.translation import ugettext_lazy from .models import Article, Reporter class ManyToOneTes...
bsd-3-clause
dvarrazzo/arduino
thermo/client/serial_read.py
1
1174
#!/usr/bin/env python """Read from the serial and emit one ts/value per minute. Log messages on stderr. """ import sys import serial from datetime import datetime, timedelta import logging logging.basicConfig() logger = logging.getLogger() def main(): opt = parse_options() buf = [] ser = serial.Serial('...
gpl-3.0
mgood7123/UPM
Tests/PACKAGES/hexchat-2.12.4-6-x86_64/usr/share/glib-2.0/codegen/codegen_main.py
1
7967
# -*- Mode: Python -*- # GDBus - GLib D-Bus Library # # Copyright (C) 2008-2011 Red Hat, Inc. # # 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; either # version 2.1 of the License, or (a...
gpl-3.0
40223119/2015cda
static/Brython3.1.3-20150514-095342/Lib/linecache.py
785
3864
"""Cache lines from files. This is intended to read lines from modules imported -- hence if a filename is not found, it will look down the module search path for a file by that name. """ import sys import os import tokenize __all__ = ["getline", "clearcache", "checkcache"] def getline(filename, lineno, module_globa...
gpl-3.0
zde/librepo
tests/python/tests/test_yum_repo_downloading.py
1
58125
from tests.base import TestCaseWithFlask, MOCKURL, TEST_DATA from tests.servermock.server import app import tests.servermock.yum_mock.config as config import os.path import unittest import tempfile import shutil import gpgme import librepo PUB_KEY = TEST_DATA+"/key.pub" class TestCaseYumRepoDownloading(TestCaseWithFl...
gpl-2.0
SM-G920P/Hacker_Kernel_SM-G92X
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
11088
3246
# Core.py - Python extension for perf script, core functions # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. from collections import defaultdict def aut...
gpl-2.0
pkimber/block
block/migrations/0004_auto_20150810_1651.py
1
6379
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('block', '0003_auto_20150419_2130'), ] operations = [ migrations.CreateModel( name='Document', fields...
apache-2.0
karyon/django
tests/one_to_one/tests.py
15
20501
from __future__ import unicode_literals from django.db import IntegrityError, connection, transaction from django.test import TestCase from .models import ( Bar, Director, Favorites, HiddenPointer, ManualPrimaryKey, MultiModel, Place, Pointer, RelatedModel, Restaurant, School, Target, UndergroundBar, Wait...
bsd-3-clause
lgrootnoob/android_kernel_asus_grouper
tools/perf/scripts/python/check-perf-trace.py
11214
2503
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
gpl-2.0
nrc/rustc-perf
collector/benchmarks/style-servo/components/script/dom/bindings/codegen/parser/tests/test_identifier_conflict.py
53
1193
# Import the WebIDL module, so we can do isinstance checks and whatnot import WebIDL def WebIDLTest(parser, harness): try: parser.parse(""" enum Foo { "a" }; interface Foo; """) results = parser.finish() harness.ok(False, "Should fail to parse") except Ex...
mit
CybOXProject/python-cybox
cybox/test/objects/win_driver_test.py
1
1972
# Copyright (c) 2017, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. import unittest from cybox.objects.win_driver_object import WinDriver from cybox.compat import long from cybox.test import EntityTestCase, round_trip from cybox.test.objects import ObjectTestCase class TestWinDr...
bsd-3-clause
Vachounet/acer_iconia_tab_kernel
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
183
3245
# Core.py - Python extension for perf trace, core functions # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. from collections import defaultdict def auto...
gpl-2.0
dylan-reeves/home_backup
backupclient-env/Lib/site-packages/pip/vcs/subversion.py
280
10468
from __future__ import absolute_import import logging import os import re from pip._vendor.six.moves.urllib import parse as urllib_parse from pip.index import Link from pip.utils import rmtree, display_path from pip.utils.logging import indent_log from pip.vcs import vcs, VersionControl _svn_xml_url_re = re.compile...
gpl-3.0
jaingaurav/ansible
examples/scripts/yaml_to_ini.py
133
7634
# (c) 2012, 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) any lat...
gpl-3.0
shakalaca/ASUS_ZenFone_A500CG_A600CG
linux/kernel/tools/perf/python/twatch.py
7370
1334
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
gpl-2.0
keithroe/vtkoptix
ThirdParty/Twisted/twisted/conch/test/keydata.py
47
12370
# -*- test-case-name: twisted.conch.test.test_keys -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Data used by test_keys as well as others. """ RSAData = { 'n':long('1062486685755247411169438309495398947372127791189432809481' '382072971106157632182084539383569281493...
bsd-3-clause
tchernomax/ansible
lib/ansible/modules/cloud/ovirt/ovirt_quota_facts.py
16
3955
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat, Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or #...
gpl-3.0
synconics/odoo
addons/payment_buckaroo/models/buckaroo.py
33
9169
# -*- coding: utf-'8' "-*-" from hashlib import sha1 import logging import urllib import urlparse from openerp.addons.payment.models.payment_acquirer import ValidationError from openerp.addons.payment_buckaroo.controllers.main import BuckarooController from openerp.osv import osv, fields from openerp.tools.float_utils...
agpl-3.0
CapOM/ChromiumGStreamerBackend
build/android/buildbot/bb_host_steps.py
43
4328
#!/usr/bin/env python # 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. import os import json import sys import bb_utils import bb_annotations sys.path.append(os.path.join(os.path.dirname(__file__), '..'))...
bsd-3-clause
ophiry/dvc
dvc/data_cloud.py
1
16388
import base64 import hashlib import os import threading import configparser import tempfile from boto.s3.connection import S3Connection from google.cloud import storage as gc import dvc from dvc.logger import Logger from dvc.exceptions import DvcException from dvc.config import ConfigError from dvc.progress import pr...
apache-2.0
asnorkin/sentiment_analysis
site/lib/python2.7/site-packages/numpy/distutils/command/__init__.py
264
1098
"""distutils.command Package containing implementation of all the standard Distutils commands. """ from __future__ import division, absolute_import, print_function def test_na_writable_attributes_deletion(): a = np.NA(2) attr = ['payload', 'dtype'] for s in attr: assert_raises(AttributeError, de...
mit
fnordahl/nova
nova/tests/unit/objects/test_objects.py
1
61175
# Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
apache-2.0
nikitabiradar/student_registration
janastu/lib/python2.7/site-packages/pip/commands/freeze.py
45
4647
import re import sys import pip from pip.req import InstallRequirement from pip.log import logger from pip.basecommand import Command from pip.util import get_installed_distributions import pkg_resources class FreezeCommand(Command): """Output installed packages in requirements format.""" name = 'freeze' ...
mit
sekaiamber/PredictionIO
examples/scala-parallel-similarproduct/filterbyyear/data/import_eventserver.py
142
1844
""" Import sample data for similar product engine """ import predictionio import argparse import random SEED = 3 def import_events(client): random.seed(SEED) count = 0 print client.get_status() print "Importing data..." # generate 10 users, with user ids u1,u2,....,u10 user_ids = ["u%s" % i for i in ran...
apache-2.0
igemsoftware/SYSU-Software2013
project/Python27/Lib/warnings.py
265
14044
"""Python part of the warnings subsystem.""" # Note: function level imports should *not* be used # in this module as it may cause import lock deadlock. # See bug 683658. import linecache import sys import types __all__ = ["warn", "showwarning", "formatwarning", "filterwarnings", "resetwarnings", "catch_war...
mit
eonpatapon/nova
nova/objects/instance.py
3
57365
# Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
apache-2.0
mrtnrdl/.macdots
scripts/bin/platform-tools/systrace/catapult/devil/devil/android/tools/flash_device.py
6
2471
#!/usr/bin/env python # Copyright 2015 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 logging import os import sys if __name__ == '__main__': sys.path.append(os.path.abspath(os.path.join( o...
unlicense
quinot/ansible
lib/ansible/modules/system/aix_inittab.py
46
7274
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Joris Weijters <joris.weijters@gmail.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 ANSIBLE_METADATA = {'metadata_version': '1...
gpl-3.0
tedi3231/openerp
build/lib/openerp/addons/project_issue/res_config.py
441
1492
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
mikeh77/mi-instrument
mi/idk/dataset_agent.py
4
4826
#!/usr/bin/env python """ @package mi.idk.instrument_agent IDK Instrument resource agent @file mi/idk/instrument_agent.py @author Bill French @brief Speciaized instrument agent for the IDK to trap event and publish. In the IDK we don't test all the way to a data granule, but stop at the data particle. This is so if ...
bsd-2-clause
swaroop-sridhar/llilc
test/llilc_checkpass.py
9
24936
#!/usr/bin/env python # #title :llilc_checkpass.py #description : # # llilc_checkpass checks one or two test results, no matter summary or verbose, # and checks if any function successfully compiled by LLILC in base result (if any) # failed to compile in the target result or if any function that was new...
mit
eoyilmaz/anima
anima/env/mayaEnv/reference.py
1
28756
# -*- coding: utf-8 -*- from anima.utils import do_db_setup from pymel import core as pm class Reference(object): """supplies reference related tools """ @classmethod def select_reference_in_reference_editor(cls): """selects the reference node in the reference editor related to the s...
mit
111t8e/h2o-2
py/testdir_single_jvm/test_delete_all_keys.py
9
1634
import unittest, time, sys, random sys.path.extend(['.','..','../..','py']) import h2o, h2o_browse as h2b, h2o_import as h2i class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox_for_errors() @classmethod def setUpClass(cls): h2o.init(1,java_heap_GB=10) @classmethod ...
apache-2.0
orchidinfosys/odoo
addons/purchase/__openerp__.py
19
2592
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Purchase Management', 'version': '1.2', 'category': 'Purchase Management', 'sequence': 60, 'summary': 'Purchase Orders, Receipts, Vendor Bills', 'description': """ Manage goods require...
gpl-3.0
joke2k/faker
faker/providers/geo/__init__.py
1
70104
from decimal import Decimal from .. import BaseProvider localized = True class Provider(BaseProvider): """ land_coords data extracted from geonames.org, under the Creative Commons Attribution 3.0 License. Coordinates are in decimal format for mapping purposes. Country code is in Alpha 2 format (http...
mit
laiqiqi886/kbengine
kbe/src/lib/python/Lib/multiprocessing/popen_spawn_win32.py
102
2998
import os import msvcrt import signal import sys import _winapi from . import context from . import spawn from . import reduction from . import util __all__ = ['Popen'] # # # TERMINATE = 0x10000 WINEXE = (sys.platform == 'win32' and getattr(sys, 'frozen', False)) WINSERVICE = sys.executable.lower().endswith("python...
lgpl-3.0
bobisme/odoo
addons/board/board.py
70
6623
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2013 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you ca...
agpl-3.0
bruce2728/kernel_lge_d802
Documentation/networking/cxacru-cf.py
14668
1626
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # # This program i...
gpl-2.0
joone/chromium-crosswalk
tools/perf/page_sets/startup_pages.py
18
2069
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.page import page as page_module from telemetry.page import shared_page_state from telemetry import story class BrowserStartupSharedState(shar...
bsd-3-clause