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
MotorolaMobilityLLC/external-chromium_org
build/android/pylib/chrome_test_server_spawner.py
23
17059
# 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. """A "Test Server Spawner" that handles killing/stopping per-test test servers. It's used to accept requests from the device to spawn and kill instances of ...
bsd-3-clause
doganaltunbay/odoo
addons/l10n_ca/__init__.py
438
1056
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>). # # This program is free software: you can redistribute it and/or modify # it...
agpl-3.0
bobeirasa/virtualenvs
pygeckozabbix/lib/python2.7/site-packages/setuptools/command/build_py.py
147
10457
import os.path, sys, fnmatch from distutils.command.build_py import build_py as _build_py from distutils.util import convert_path from glob import glob try: from distutils.util import Mixin2to3 as _Mixin2to3 # add support for converting doctests that is missing in 3.1 distutils from distutils import log ...
mit
bwarren2/threes
tests/tile_test.py
1
1830
import unittest from threes import Tile class TileTest(unittest.TestCase): """Check that tiles work as expected""" def setUp(self): pass def test_tile_scoring(self): self.assertEqual(Tile().score(), 0) self.assertEqual(Tile(1).score(), 0) self.assertEqual(Tile(2).score()...
bsd-3-clause
jefffohl/nupic
src/nupic/frameworks/opf/common_models/cluster_params.py
15
4570
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2015, Numenta, Inc. Unless you have purchased from # Numenta, Inc. a separate commercial license for this software code, the # following terms and conditions apply: # # This pro...
gpl-3.0
ukBaz/python-bluezero
bluezero/broadcaster.py
1
2709
""" The level 10 file for creating beacons This requires BlueZ to have the experimental flag set """ from bluezero import adapter from bluezero import advertisement class Beacon: """ Create a non-connectable Bluetooth instance advertising information """ def __init__(self, adapter_addr=None): ...
mit
evaschalde/odoo
addons/payment/tests/common.py
392
1822
# -*- coding: utf-8 -*- from openerp.tests import common class PaymentAcquirerCommon(common.TransactionCase): def setUp(self): super(PaymentAcquirerCommon, self).setUp() self.payment_acquirer = self.registry('payment.acquirer') self.payment_transaction = self.registry('payment.transactio...
agpl-3.0
nkalodimas/invenio
modules/bibformat/lib/elements/bfe_field.py
28
6253
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## ...
gpl-2.0
shunsukeaihara/pyworld
test/test_mcep.py
1
2139
# -*- coding: utf-8 -*- from unittest import TestCase from nose.tools import eq_ import numpy as np from pysas import waveread from pysas.mcep import estimate_alpha, spec2mcep, mcep2spec, mcep2coef, coef2mcep from pysas.mcep import mcep2spec_from_matrix, spec2mcep_from_matrix from pysas.synthesis_filter.mlsa import M...
mit
berrange/nova
nova/tests/integrated/v3/test_create_backup.py
8
1458
# 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
DazWorrall/ansible
contrib/inventory/zabbix.py
27
4495
#!/usr/bin/env python # (c) 2013, Greg Buehler # # 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 ve...
gpl-3.0
cjermain/numpy
numpy/distutils/core.py
174
7955
from __future__ import division, absolute_import, print_function import sys from distutils.core import * if 'setuptools' in sys.modules: have_setuptools = True from setuptools import setup as old_setup # easy_install imports math, it may be picked up from cwd from setuptools.command import easy_instal...
bsd-3-clause
heeraj123/oh-mainline
vendor/packages/Django/tests/regressiontests/string_lookup/models.py
113
1457
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Foo(models.Model): name = models.CharField(max_length=50) friend = models.CharField(max_length=50, blank=True) def...
agpl-3.0
reversefold/mysql-connector-python
lib/mysqlx/crud.py
2
17123
# MySQL Connector/Python - MySQL driver written in Python. # Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. # MySQL Connector/Python is licensed under the terms of the GPLv2 # <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most # MySQL Connectors. There are special exceptions to ...
gpl-2.0
dimtruck/magnum
magnum/tests/unit/common/test_urlfetch.py
2
1921
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
apache-2.0
ryfeus/lambda-packs
H2O/ArchiveH2O/h2o/transforms/decomposition.py
2
8112
from ..estimators.estimator_base import H2OEstimator from h2o.utils.typechecks import Enum from h2o.utils.typechecks import assert_is_type from h2o.frame import H2OFrame from h2o.utils.typechecks import assert_is_type, Enum, numeric class H2OPCA(H2OEstimator): """ Principal Component Analysis """ algo ...
mit
CalebM1987/serverAdminTools
serverAdminTools/restapi/requests/packages/urllib3/contrib/appengine.py
154
7938
from __future__ import absolute_import import logging import os import warnings from ..exceptions import ( HTTPError, HTTPWarning, MaxRetryError, ProtocolError, TimeoutError, SSLError ) from ..packages.six import BytesIO from ..request import RequestMethods from ..response import HTTPResponse ...
gpl-3.0
jesserobertson/pymaxion
setup.py
1
1868
#!/usr/bin/env python """ file: setup.py (pysiss) author: Jess Robertson, CSIRO Earth Science and Resource Engineering date: Wednesday 1 April, 2015 description: Setuptools installer script for pymaxion. """ from setuptools import setup, find_packages import os def read(*paths): """ Build a file path...
mit
dgquintas/grpc
examples/python/route_guide/route_guide_client.py
6
4089
# Copyright 2015 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...
apache-2.0
compston/TAP-Workshop
utilities/Gnip-Python-Historical-Utilities/src/gnip_historical/gnip_historical_cmd.py
1
1841
#!/usr/bin/env python import ConfigParser from optparse import OptionParser from gnip_historical import * DEFAULT_FILE_NAME='./.gnip' class GnipHistoricalCmd(object): def __init__(self, jobPar=None): self.config = ConfigParser.ConfigParser() self.config.read(DEFAULT_FILE_NAME) un = self.co...
mit
SebastianMerz/calalert
Server/venv/lib/python2.7/site-packages/werkzeug/_internal.py
301
13713
# -*- coding: utf-8 -*- """ werkzeug._internal ~~~~~~~~~~~~~~~~~~ This module provides internally used helpers and constants. :copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import re import string import inspect from weakre...
gpl-2.0
lsinfo/odoo
addons/account/report/account_report.py
144
12839
# -*- 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
mzdanieltest/pex
tests/test_environment.py
5
3792
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import os from contextlib import contextmanager from twitter.common.contextutil import temporary_dir from pex.compatibility import nested from pex.environment import PEXEnvironment from ...
apache-2.0
yidongliu/scrapy
extras/qps-bench-server.py
178
1640
#!/usr/bin/env python from __future__ import print_function from time import time from collections import deque from twisted.web.server import Site, NOT_DONE_YET from twisted.web.resource import Resource from twisted.internet import reactor class Root(Resource): def __init__(self): Resource.__init__(self...
bsd-3-clause
attilaz/bgfx
3rdparty/spirv-tools/utils/check_copyright.py
4
8550
#!/usr/bin/env python # Copyright (c) 2016 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
bsd-2-clause
nkgilley/home-assistant
homeassistant/components/binary_sensor/device_trigger.py
5
7723
"""Provides device triggers for binary sensors.""" import voluptuous as vol from homeassistant.components.automation import state as state_automation from homeassistant.components.device_automation import TRIGGER_BASE_SCHEMA from homeassistant.components.device_automation.const import ( CONF_TURNED_OFF, CONF_T...
apache-2.0
tjamet/dotfiles
vim/eclim/autoload/eclim/python/rope/base/default_config.py
387
3461
# The default ``config.py`` def set_prefs(prefs): """This function is called before opening the project""" # Specify which files and folders to ignore in the project. # Changes to ignored resources are not added to the history and # VCSs. Also they are not returned in `Project.get_files()`. # No...
gpl-3.0
windyuuy/opera
chromium/src/third_party/python_26/Lib/test/test_sha.py
58
1694
# Testing sha module (NIST's Secure Hash Algorithm) # use the three examples from Federal Information Processing Standards # Publication 180-1, Secure Hash Standard, 1995 April 17 # http://www.itl.nist.gov/div897/pubs/fip180-1.htm import warnings warnings.filterwarnings("ignore", "the sha module is deprecated.*", ...
bsd-3-clause
Hybrid-Cloud/cinder
cinder/tests/unit/volume/drivers/emc/scaleio/test_misc.py
5
9270
# Copyright (c) 2013 - 2015 EMC Corporation. # 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 # # Unle...
apache-2.0
KennethPierce/pylearnk
pylearn2/models/pca.py
5
28981
""" .. todo:: WRITEME """ # Standard library imports import logging import sys # Third-party imports import numpy N = numpy import warnings from scipy import linalg, sparse # Warning: ridiculous. try: # scipy 0.9 from scipy.sparse.linalg import eigsh as eigen_symmetric except ImportError: try: ...
bsd-3-clause
jruiperezv/ANALYSE
lms/djangoapps/shoppingcart/migrations/0010_auto__add_registrationcoderedemption__del_field_courseregistrationcode.py
25
14505
# -*- coding: 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 model 'RegistrationCodeRedemption' db.create_table('shoppingcart_registrationcoderedemption', ( ...
agpl-3.0
EricCline/CEM_inc
env/lib/python2.7/site-packages/IPython/nbconvert/writers/base.py
14
1771
""" Contains writer base class. """ #----------------------------------------------------------------------------- #Copyright (c) 2013, the IPython Development Team. # #Distributed under the terms of the Modified BSD License. # #The full license is in the file COPYING.txt, distributed with this software. #-------------...
mit
yamanobori-old/LanguageExercises
37_配列・リストの結合/python/main.py
1
1356
#!/usr/bin/env python # coding: -utf8 import user_input as ui import random def validate_number(s): return int(s) def generate_password(num_special, num_number, num_min): assert(num_special + num_number <= num_min) alphabets = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" numbers = "01234...
mit
zzicewind/nova
nova/tests/unit/virt/libvirt/test_blockinfo.py
5
46802
# Copyright 2010 OpenStack Foundation # Copyright 2012 University Of Minho # # 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....
apache-2.0
marc-sensenich/ansible
lib/ansible/modules/network/netscaler/netscaler_cs_vserver.py
57
43992
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2017 Citrix Systems # 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', ...
gpl-3.0
citrix-openstack-build/keystone
keystone/openstack/common/rpc/impl_kombu.py
5
32923
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 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/LICEN...
apache-2.0
googleapis/python-datacatalog
google/cloud/datacatalog_v1beta1/services/policy_tag_manager_serialization/transports/base.py
1
7501
# -*- coding: utf-8 -*- # Copyright 2020 Google 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...
apache-2.0
CS-SI/QGIS
scripts/process_function_template.py
12
4210
import sys import os import json import glob sys.path.append( os.path.join( os.path.dirname(os.path.realpath(__file__)), '../python/ext-libs')) from six import string_types cpp = open(sys.argv[1], "w") cpp.write( "#include \"qgsexpression.h\"\n" "\n" "QHash<QString, QgsExpression::Hel...
gpl-2.0
eriksf/atmosphere-cli
tests/test_providers.py
1
1786
from .mock_server import get_free_port, start_mock_server from atmosphere.api import AtmosphereAPI from atmosphere.main import AtmosphereApp from atmosphere.provider import ProviderList class TestProviders(object): @classmethod def setup_class(cls): cls.mock_server_port = get_free_port() cls.m...
bsd-3-clause
matthappens/taskqueue
taskqueue/venv_tq/lib/python2.7/site-packages/Crypto/Random/random.py
125
5284
# -*- coding: utf-8 -*- # # Random/random.py : Strong alternative for the standard 'random' module # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent tha...
mit
DHI-GRAS/processing_SWAT
GetECMWFClimateData.py
2
9450
""" *************************************************************************** GetECMWFClimateData.py ------------------------------------- Copyright (C) 2014 TIGER-NET (www.tiger-net.org) *************************************************************************** * This plugin is part of the Water Observation...
gpl-3.0
kyvinh/home-assistant
tests/components/test_mqtt_eventstream.py
3
6853
"""The tests for the MQTT eventstream component.""" from collections import namedtuple import json from unittest.mock import ANY, patch from homeassistant.bootstrap import setup_component import homeassistant.components.mqtt_eventstream as eventstream import homeassistant.components.mqtt as mqtt from homeassistant.con...
apache-2.0
fernandoacorreia/DjangoWAWSLogging
DjangoWAWSLogging/env/Lib/site-packages/pywin32-218-py2.7-win32.egg/pywin/Demos/app/dlgappdemo.py
17
1238
# dlgappdemo - a demo of a dialog application. # This is a demonstration of both a custom "application" module, # and a Python program in a dialog box. # # NOTE: You CAN NOT import this module from either PythonWin or Python. # This module must be specified on the commandline to PythonWin only. # eg, PythonWin /app dl...
mit
jss-emr/openerp-7-src
openerp/addons/document_webdav/test_davclient.py
6
27804
#!/usr/bin/env python # -*- encoding: utf-8 -*- # # Copyright P. Christeas <p_christ@hol.gr> 2008,2009 # Copyright OpenERP SA. (http://www.openerp.com) 2010 # # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsability of assessing all potential # consequence...
agpl-3.0
trachelr/mne-python
mne/inverse_sparse/_gamma_map.py
16
10643
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Martin Luessi <mluessi@nmr.mgh.harvard.edu> # License: Simplified BSD from copy import deepcopy import numpy as np from scipy import linalg from ..forward import is_fixed_orient, _to_fixed_ori from ..minimum_norm.inverse import _check...
bsd-3-clause
shybovycha/buck
scripts/artificialproject/target_generator.py
19
7910
import collections import itertools import os import sys from artificialproject.field_generators import ( BuildTargetSetGenerator, EnumSetGenerator, NullableGenerator, PathSetGenerator, SingletonGenerator, SourcePathSetGenerator, SourcesWithFlagsGenerator, StringGenerator, Visibilit...
apache-2.0
pocketpimps/pocketpimps-app
node_modules/cordova-lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py
2779
1665
# Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """gypsh output module gypsh is a GYP shell. It's not really a generator per se. All it does is fire up an interactive Python session with a few local variables...
mit
nushio3/chainer
examples/imagenet/train_imagenet.py
2
9557
#!/usr/bin/env python """Example code of learning a large scale convnet from ILSVRC2012 dataset. Prerequisite: To run this example, crop the center of ILSVRC2012 training and validation images and scale them to 256x256, and make two lists of space- separated CSV whose first column is full path to image and second colu...
mit
pshchelo/heat
heat/tests/test_cloud_config.py
12
2483
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
apache-2.0
szibis/Diamond
src/collectors/kafkastat/kafkastat.py
54
4706
# coding=utf-8 """ Collect stats via MX4J from Kafka #### Dependencies * urllib2 * xml.etree """ import urllib2 from urllib import urlencode try: from xml.etree import ElementTree except ImportError: ElementTree = None try: from ElementTree import ParseError as ETParseError except ImportError: E...
mit
Taranys/Sick-Beard
sickbeard/providers/binnewz/__init__.py
1
11203
# Author: Guillaume Serre <guillaume.serre@gmail.com> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 versi...
gpl-3.0
agualis/test-django-nonrel
django/views/i18n.py
188
9673
import os import gettext as gettext_module from django import http from django.conf import settings from django.utils import importlib from django.utils.translation import check_for_language, activate, to_locale, get_language from django.utils.text import javascript_quote from django.utils.encoding import smart_unicod...
bsd-3-clause
beardypig/streamlink
src/streamlink/plugins/tv4play.py
2
2739
import logging import re from urllib.parse import urljoin from streamlink.exceptions import PluginError from streamlink.plugin import Plugin from streamlink.plugin.api import validate from streamlink.stream import HLSStream log = logging.getLogger(__name__) class TV4Play(Plugin): """Plugin for TV4 Play, swedish...
bsd-2-clause
saradbowman/osf.io
website/notifications/constants.py
17
1348
NODE_SUBSCRIPTIONS_AVAILABLE = { 'comments': 'Comments added', 'file_updated': 'Files updated' } # Note: if the subscription starts with 'global_', it will be treated like a default # subscription. If no notification type has been assigned, the user subscription # will default to 'email_transactional'. USER_SU...
apache-2.0
jslhs/sunpy
sunpy/sun/sun.py
1
9386
"""Provides Sun-related parameters The following code is heavily based on IDL function get_sun.pro which itself is based on algorithms presented in the book Astronomical Formulae for Calculators, by Jean Meeus. A correct answer set to compare to Solar Ephemeris for 1-JAN-01 00:00:00 Distance (AU) = 0.98330468 ...
bsd-2-clause
mgit-at/ansible
lib/ansible/modules/network/cloudengine/ce_netstream_aging.py
7
18012
#!/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
torifier/PyBitmessage
src/class_singleWorker.py
4
56961
from __future__ import division import threading import shared import time from time import strftime, localtime, gmtime import random from subprocess import call # used when the API must execute an outside program from addresses import * import highlevelcrypto import proofofwork import sys import tr from debug import...
mit
likit/gimme
src/utils/gff2bed.py
2
2311
'''This script converts GTF/GFF format to BED format. The output is written to standard output. Usage gff2bed.py file.gtf/gff ''' import csv import sys from collections import namedtuple stderr = sys.stderr Transcript = namedtuple('Transcript', ['chrom', 'id', 'strand', 'exons', 'geneid']) def parse(file...
gpl-3.0
the0forge/sp
frontend/migrations/0010_auto__del_field_invoice_slug.py
1
21451
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'Invoice.slug' db.delete_column(u'frontend_invoice', 'sl...
gpl-3.0
catalyst/l3overlay
src/l3overlay/l3overlayd/overlay/interface.py
1
2365
# # IPsec overlay network manager (l3overlay) # l3overlay/l3overlayd/overlay/interface.py - overlay interface abstract base class # # Copyright (c) 2017 Catalyst.net Ltd # 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 Fr...
gpl-3.0
julienvey/solum
solum/objects/sqlalchemy/extension.py
9
1589
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under th...
apache-2.0
mjourdan/paperwork
src/paperwork/frontend/util/imgcutting.py
1
12953
# Paperwork - Using OCR to grep dead trees the easy way # Copyright (C) 2013-2014 Jerome Flesch # # Paperwork 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
skirsdeda/django
tests/dates/tests.py
14
3733
from __future__ import unicode_literals import datetime from django.core.exceptions import FieldError from django.test import TestCase from django.utils import six from .models import Article, Comment, Category class DatesTests(TestCase): def test_related_model_traverse(self): a1 = Article.objects.crea...
bsd-3-clause
Arkapravo/morse-0.6
src/morse/sensors/odometry.py
1
3822
import logging; logger = logging.getLogger("morse." + __name__) from morse.helpers.morse_math import normalise_angle import morse.core.sensor import copy from morse.helpers.components import add_data class OdometryClass(morse.core.sensor.MorseSensorClass): """Odometer sensor """ _name = "Odometry" _sh...
bsd-3-clause
openaire/iis
iis-3rdparty-madis/src/main/resources/eu/dnetlib/iis/3rdparty/scripts/madis/functions/aggregate/jpacks.py
1
7174
__docformat__ = 'reStructuredText en' import lib.jopts as jopts import json try: from collections import OrderedDict except ImportError: # Python 2.6 from lib.collections26 import OrderedDict class jgroup: """ .. function:: jgroup(columns) Groups columns of a group into a jpack. Exampl...
apache-2.0
mycodeday/crm-platform
stock_account/__openerp__.py
269
2348
# -*- 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...
gpl-3.0
gdgellatly/OCB1
openerp/addons/base/ir/ir_ui_view.py
34
15306
# -*- 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
r-owen/TUI
TUI/Inst/SPIcam/SPIcamWindow.py
1
1692
#!/usr/bin/env python """Status and configuration for SPIcam. History: 2007-05-22 ROwen 2008-02-11 ROwen Modified to use new TUI.Inst.StatusConfigWdg. 2008-02-12 ROwen Bug fix: was using instName=Expose for the expose window. 2008-03-13 ROwen Simplified the test code (copying that for NICFPS). 2011-08-11 ROwe...
bsd-3-clause
thjashin/tensorflow
tensorflow/python/kernel_tests/fifo_queue_test.py
30
60512
# 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
krismcfarlin/todo_angular_endpoints
bp_includes/external/httplib2/socks.py
91
18456
"""SocksiPy - Python SOCKS module. Version 1.00 Copyright 2006 Dan-Haim. 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 ...
lgpl-3.0
blrm/openshift-tools
openshift/installer/vendored/openshift-ansible-3.9.14-1/roles/openshift_health_checker/action_plugins/openshift_health_check.py
32
13798
""" Ansible action plugin to execute health checks in OpenShift clusters. """ import sys import os import base64 import traceback import errno import json from collections import defaultdict from ansible.plugins.action import ActionBase from ansible.module_utils.six import string_types try: from __main__ import d...
apache-2.0
jefftc/changlab
Betsy/Betsy/modules/add_coverage_to_simplevariantmatrix.py
1
4518
from Module import AbstractModule class Module(AbstractModule): def __init__(self): AbstractModule.__init__(self) def run( self, network, antecedents, out_attributes, user_options, num_cores, out_filename): from genomicode import filelib simple_node, coverage_node = an...
mit
thisisALPINE/subterfuge
sslstrip.py
72
4066
#!/usr/bin/env python """sslstrip is a MITM tool that implements Moxie Marlinspike's SSL stripping attacks.""" __author__ = "Moxie Marlinspike" __email__ = "moxie@thoughtcrime.org" __license__= """ Copyright (c) 2004-2009 Moxie Marlinspike <moxie@thoughtcrime.org> This program is free software; you can redistribu...
gpl-3.0
tseaver/google-cloud-python
vision/google/cloud/vision_v1/proto/text_annotation_pb2.py
2
39204
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/vision_v1/proto/text_annotation.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 ...
apache-2.0
RickyXwang/transf-badapple
util/audio.py
2
2612
#!/usr/bin/env python3 import sys if (len(sys.argv) < 6): print("Usage: audio.py INPUTFILE OUTPUT1 OUTPUT2 OUTPUT3 OUTPUT4") exit(-1) import xml.etree.ElementTree import math try: tree = xml.etree.ElementTree.parse(sys.argv[1]) except: print("Error opening input file") exit(-1) def keyToCount(keyN...
mit
milseman/swift
utils/swift_build_support/swift_build_support/cache_util.py
48
1586
# swift_build_support/cache_util.py -----------------------------*- python -*- # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https://swift.org/LICENSE.tx...
apache-2.0
travs/PyOpenWorm
PyOpenWorm/experiment.py
1
3101
from PyOpenWorm import * class Condition(DataObject): """ Class for storing a condition of an experiment. Takes one value and stores it with a key. Parameters ---------- name : String Name of the condition (ex: "subject"). value : any State of the condition for the experime...
mit
erwinsanchez/bitcoinwithkeccak
contrib/linearize/linearize-hashes.py
214
3037
#!/usr/bin/python # # linearize-hashes.py: List blocks in a linear, no-fork version of the chain. # # Copyright (c) 2013-2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from __future__ import pr...
mit
tuxfux-hlp-notes/python-batches
archieves/batch-58/modules/sheets/lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/_base.py
169
6718
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type import gettext _ = gettext.gettext from ..constants import voidElements, spaceCharacters spaceCharacters = "".join(spaceCharacters) class TreeWalker(object): def __init__(self, tree): self.tree = tre...
gpl-3.0
librasungirl/openthread
tests/scripts/thread-cert/Cert_6_1_01_RouterAttach.py
2
4376
#!/usr/bin/env python3 # # Copyright (c) 2016, The OpenThread Authors. # 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 # ...
bsd-3-clause
jaruba/chromium.src
third_party/pycoverage/coverage/data.py
209
9188
"""Coverage data for Coverage.""" import os from coverage.backward import iitems, pickle, sorted # pylint: disable=W0622 from coverage.files import PathAliases from coverage.misc import file_be_gone class CoverageData(object): """Manages collected coverage data, including file storage. The data file for...
bsd-3-clause
fooelisa/netmiko
netmiko/netapp/netapp_cdot_ssh.py
2
1379
from __future__ import unicode_literals from netmiko.base_connection import BaseConnection class NetAppcDotSSH(BaseConnection): def session_preparation(self): """Prepare the session after the connection has been established.""" self.set_base_prompt() cmd = self.RETURN + "rows 0" + self.R...
mit
sparkslabs/kamaelia_
Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/UI/Tk/__init__.py
6
1052
# -*- coding: utf-8 -*- # Needed to allow import # # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache Lice...
apache-2.0
markfinger/recipe-crawler-for-beaney
requests/packages/chardet/big5freq.py
3133
82594
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
mit
sidartaoliveira/ansible
lib/ansible/modules/network/nxos/nxos_ospf.py
42
4167
#!/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
cube2matrix/Krypton
test/networkx/generators/intersection.py
55
3919
# -*- coding: utf-8 -*- """ Generators for random intersection graphs. """ # Copyright (C) 2011 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. import random import networkx as nx from networkx.algorithms im...
gpl-2.0
opengisch/OSGeo4A
tools/depsort.py
1
5451
#! /usr/bin/env python2 import argparse import sys class Graph(object): def __init__(self): # `graph`: dict that maps each package to a set of its dependencies. self.graph = {} def add(self, dependent, dependency): """Add a dependency relationship to the graph""" self.graph.se...
mit
tunneln/CarnotKE
jyhton/lib-python/2.7/test/test_zipimport_support.py
90
10850
# This test module covers support in various parts of the standard library # for working with modules located inside zipfiles # The tests are centralised in this fashion to make it easy to drop them # if a platform doesn't support zipimport import test.test_support import os import os.path import sys import textwrap im...
apache-2.0
KelSolaar/sIBL_GUI
sibl_gui/components/core/collections_outliner/models.py
1
2343
#!/usr/bin/env python # -*- coding: utf-8 -*- """ **models.py** **Platform:** Windows, Linux, Mac Os X. **Description:** Defines the :class:`sibl_gui.components.core.collections_outliner.collections_outliner.CollectionsOutliner` Component Interface class Models. **Others:** """ from __future__ import ...
gpl-3.0
YYKI/blog-webapp
www/pymonitor.py
1
1816
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'syuson' import os, sys, time, subprocess from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler def log(s): print('[Monitor] %s ' % s) class MyFileSystemEventHandler(FileSystemEventHandler): """docstring for ...
gpl-3.0
nju520/django
tests/generic_views/models.py
382
1631
from django.core.urlresolvers import reverse from django.db import models from django.db.models import QuerySet from django.db.models.manager import BaseManager from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Artist(models.Model): name = models.CharField(max_length...
bsd-3-clause
fniephaus/alfred-readability
src/httplib2/iri2uri.py
706
3828
""" iri2uri Converts an IRI to a URI. """ __author__ = "Joe Gregorio (joe@bitworking.org)" __copyright__ = "Copyright 2006, Joe Gregorio" __contributors__ = [] __version__ = "1.0.0" __license__ = "MIT" __history__ = """ """ import urlparse # Convert an IRI to a URI following the rules in RFC 3987 # # The character...
mit
proxysh/Safejumper-for-Desktop
buildlinux/env64/lib/python2.7/site-packages/pyasn1/debug.py
26
3279
# # This file is part of pyasn1 software. # # Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com> # License: http://pyasn1.sf.net/license.html # import logging from pyasn1.compat.octets import octs2ints from pyasn1 import error from pyasn1 import __version__ __all__ = ['Debug', 'setLogger', 'hexdump'] flagNone ...
gpl-2.0
dbertha/odoo
addons/l10n_ae/__init__.py
669
1059
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2014 Tech Receptives (<http://techreceptives.com>). # # This program is free software: you can redistribute it and/or modify # it under the te...
agpl-3.0
renatofb/weblate
weblate/trans/templatetags/permissions.py
3
3184
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <http://weblate.org/> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, eithe...
gpl-3.0
x303597316/hue
desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/__init__.py
44
2052
""" ldap - base module See http://www.python-ldap.org/ for details. $Id: __init__.py,v 1.70 2011/02/19 14:36:53 stroeder Exp $ """ # This is also the overall release version number __version__ = '2.3.13' import sys if __debug__: # Tracing is only supported in debugging mode import traceback _trace_level = 0...
apache-2.0
kzvyahin/cfme_tests
cfme/tests/services/test_request.py
1
1239
# -*- coding: utf-8 -*- import pytest from cfme.common.provider import cleanup_vm from cfme.services.catalogs.service_catalogs import ServiceCatalogs from cfme.services import requests from cfme import test_requirements from utils import testgen from utils.wait import wait_for pytestmark = [ pytest.mark.meta(serv...
gpl-2.0
Caian/ostools
tests/test2.py
1
2063
#!/usr/bin/env python3 # MIT License # # Copyright (c) 2017 Caian Benedicto # # 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 #...
mit
tfroehlich82/saleor
tests/dashboard/test_product.py
7
5663
from __future__ import unicode_literals import pytest from django import forms from django.core.urlresolvers import reverse from django.utils.encoding import smart_text from mock import Mock from saleor.dashboard.product.forms import (ProductClassForm, ProductClassSelectorF...
bsd-3-clause
ppanczyk/ansible
test/units/playbook/test_block.py
119
2795
# (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