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
BT-ojossen/odoo
addons/website_blog/wizard/document_page_show_diff.py
372
2184
# -*- 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
yetsky/extra
packages/my-application/python-all/files/usr/lib/python2.7/unittest/test/test_setups.py
152
16460
import sys from cStringIO import StringIO import unittest def resultFactory(*_): return unittest.TestResult() class TestSetups(unittest.TestCase): def getRunner(self): return unittest.TextTestRunner(resultclass=resultFactory, stream=StringIO()) def ru...
gpl-2.0
ashhher3/ibis
ibis/impala/tests/test_sql.py
9
1100
# Copyright 2014 Cloudera Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
apache-2.0
imsplitbit/nova
nova/tests/api/openstack/compute/contrib/test_quotas.py
2
24320
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack Foundation # Copyright 2013 IBM Corp. # 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 #...
apache-2.0
koharjidan/dogecoin
contrib/linearize/linearize-data.py
6
8723
#!/usr/bin/python # # linearize-data.py: Construct 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 print_func...
mit
roadmapper/ansible
lib/ansible/plugins/doc_fragments/iosxr.py
21
2859
# -*- coding: utf-8 -*- # Copyright: (c) 2015, Peter Sprygada <psprygada@ansible.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) class ModuleDocFragment(object): # Standard files documentation fragment DOCUMENTATION = r''' options: provider: descriptio...
gpl-3.0
simonwydooghe/ansible
lib/ansible/modules/cloud/amazon/sns.py
13
6439
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2014, Michael J. Schultz <mjschultz@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_v...
gpl-3.0
gymnasium/edx-platform
common/lib/xmodule/xmodule/modulestore/tests/test_assetstore.py
9
34735
""" Tests for assetstore using any of the modulestores for metadata. May extend to testing the storage options too. """ from datetime import datetime, timedelta import ddt from django.test import TestCase from nose.plugins.attrib import attr import pytz import unittest from opaque_keys.edx.keys import CourseKey from o...
agpl-3.0
stevekuznetsov/ansible
lib/ansible/modules/cloud/azure/azure_rm_virtualmachineimage_facts.py
50
7694
#!/usr/bin/python # # Copyright (c) 2016 Matt Davis, <mdavis@ansible.com> # Chris Houseknecht, <house@redhat.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 Soft...
gpl-3.0
syphar/django-drip
drip/tests.py
1
12109
from datetime import datetime, timedelta from django.test import TestCase from django.contrib.auth.models import User from django.core.exceptions import ValidationError from django.core import mail from django.conf import settings from drip.models import Drip, SentDrip, QuerySetRule from drip.drips import DripBase, D...
mit
thingbits/iot
src/sensors/light/actionLight.py
1
1846
from serial import * import serial.tools.list_ports import time import datetime ports = sorted(serial.tools.list_ports.comports()) i = 1 for elem in ports: print i, " - " + elem[0] i = i + 1 selectedPort = input("Select COM port option: ") comPort = ports[selectedPort - 1][0] serialPort = Serial(comPort, 57600, t...
gpl-3.0
Jgarcia-IAS/SAT
openerp/addons-extra/odoo-pruebas/odoo-server/addons/project_timesheet/__openerp__.py
47
2256
# -*- 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
ondra-novak/blink
Tools/Scripts/webkitpy/style/optparser_unittest.py
48
11027
# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org) # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and...
bsd-3-clause
hynnet/hiwifi-openwrt-HC5661-HC5761
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/gzip.py
33
18445
"""Functions that read and write gzipped files. The user of the file doesn't have to worry about the compression, but random access is not allowed.""" # based on Andrew Kuchling's minigzip.py distributed with the zlib module import struct, sys, time, os import zlib import io import __builtin__ __all__ = ["GzipFile"...
gpl-2.0
bnavarma/netsnmp
pysmi/debug.py
6
3256
import logging from pysmi import error from pysmi import __version__ flagNone = 0x0000 flagSearcher = 0x0001 flagReader = 0x0002 flagLexer = 0x0004 flagParser = 0x0008 flagGrammar = 0x0010 flagCodegen = 0x0020 flagWriter = 0x0040 flagCompiler = 0x0080 flagBorrower = 0x0100 flagAll = 0xffff flagMap...
bsd-2-clause
katstalk/android_external_chromium_org
tools/perf/metrics/rendering_stats_unittest.py
23
7828
# 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 random import unittest from metrics.rendering_stats import RenderingStats from telemetry.core.timeline import model class MockTimer(object): """A...
bsd-3-clause
stvstnfrd/configuration
util/helm_values_to_rst_table_util/helm_values_to_rst_table_util.py
4
2712
import click import yaml @click.command() @click.option('--values', help='Path to a values.yaml file', required=True) @click.option('--subcharts', help='Sub chart values to ignore', multiple=True) def cli(values, subcharts): with open(values, 'r') as stream: parsed_dict = yaml.safe_load(stream) keys_fr...
agpl-3.0
HenryTheHamster/cloud-init
cloudinit/handlers/cloud_config.py
7
6030
# vi: ts=4 expandtab # # Copyright (C) 2012 Canonical Ltd. # Copyright (C) 2012 Hewlett-Packard Development Company, L.P. # Copyright (C) 2012 Yahoo! Inc. # # Author: Scott Moser <scott.moser@canonical.com> # Author: Juerg Haefliger <juerg.haefliger@hp.com> # Author: Joshua Harlow <harlowja@yahoo-inc....
gpl-3.0
google/fplutil
setuputil/linux.py
1
2505
#!/usr/bin/python # Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
apache-2.0
3dfxsoftware/cbss-addons
account_reconcile_advance_tax/model/__init__.py
1
1276
#!/usr/bin/python # -*- encoding: utf-8 -*- ########################################################################### # Module Writen to OpenERP, Open Source Management Solution # Copyright (C) Vauxoo (<http://vauxoo.com>). # All Rights Reserved ###############Credits#########################################...
gpl-2.0
jvgomez/guiicode
BiiDesigns/cppBlockWidget.py
1
4404
from PySide.QtCore import * from PySide.QtGui import * class CppBlockWidget(QWidget): def setupUi(self): self.setObjectName("CppBlockWidget") self.resize(344, 162) self.formLayout = QFormLayout(self) self.formLayout.setObjectName("formLayout") self.label_8 = QLabel(self) ...
gpl-3.0
deKupini/erp
addons/l10n_do/__openerp__.py
8
2888
# -*- coding: utf-8 -*- # ############################################################################# # # First author: Jose Ernesto Mendez <tecnologia@obsdr.com> (Open Business Solutions SRL.) # Copyright (c) 2012 -TODAY Open Business Solutions, SRL. (http://obsdr.com). All rights reserved. # # This is a fork to upg...
agpl-3.0
zhoulingjun/django
tests/defer_regress/models.py
282
2692
""" Regression tests for defer() / only() behavior. """ from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Item(models.Model): name = models.CharField(max_length=15) text = models.TextField(default="xyzzy") value = models.IntegerF...
bsd-3-clause
takeshineshiro/heat
heat/engine/resources/openstack/magnum/baymodel.py
4
4917
# # 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
retr0h/ansible
lib/ansible/runner/lookup_plugins/env.py
22
1201
# (c) 2012, Jan-Piet Mens <jpmens(at)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 later ver...
gpl-3.0
googleads/google-ads-python
google/ads/googleads/v7/errors/types/custom_audience_error.py
1
1428
# -*- 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
salguarnieri/intellij-community
python/lib/Lib/site-packages/django/contrib/auth/__init__.py
71
4556
import datetime from warnings import warn from django.core.exceptions import ImproperlyConfigured from django.utils.importlib import import_module from django.contrib.auth.signals import user_logged_in, user_logged_out SESSION_KEY = '_auth_user_id' BACKEND_SESSION_KEY = '_auth_user_backend' REDIRECT_FIELD_NAME = 'next...
apache-2.0
wetneb/django
tests/unmanaged_models/tests.py
296
2174
from __future__ import unicode_literals from django.db import connection from django.test import TestCase from .models import A01, A02, B01, B02, C01, C02, Managed1, Unmanaged2 class SimpleTests(TestCase): def test_simple(self): """ The main test here is that the all the models can be created w...
bsd-3-clause
scottdangelo/RemoveVolumeMangerLocks
cinder/db/sqlalchemy/migrate_repo/versions/017_add_encryption_information.py
20
3137
# Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory # 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/...
apache-2.0
axinging/chromium-crosswalk
tools/perf/page_sets/tough_animation_cases.py
14
15875
# 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 import story class ToughAnimationCasesPage(page_module.Page): def __init__(self, url, page_...
bsd-3-clause
campbe13/openhatch
vendor/packages/twisted/twisted/mail/bounce.py
17
1538
# -*- test-case-name: twisted.mail.test.test_bounce -*- # # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. import StringIO import rfc822 import string import time import os from twisted.mail import smtp BOUNCE_FORMAT = """\ From: postmaster@%(failedDomain)s To: %(failedFrom)s Subject: Return...
agpl-3.0
chrisidefix/visvis
utils/guisupport.py
3
6137
#!/usr/bin/env python # coding: utf-8 """ Support for creating GUI apps and starting event loops. IPython's GUI integration allows interative plotting and GUI usage in IPython session. IPython has two different types of GUI integration: 1. The terminal based IPython supports GUI event loops through Python's PyOS_I...
bsd-3-clause
mantidproject/mantid
docs/sphinxext/mantiddoc/directives/categories.py
3
18467
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + """ ...
gpl-3.0
tudelft/network_chargers
seriallog.py
1
1304
#!/usr/bin/python import time import serial import charger import threading def serial_server(port, mycharger): timestr = time.strftime("%Y%m%d-%H%M%S") p = open('logs/logfile_' + timestr + '.csv', 'w') f = open('logs/raw_' + timestr + '.bin', 'w+b') p.write(charger.Channel().header()+ " " + charger....
gpl-3.0
ShawnPengxy/Flask-madeBlog
site-packages/pip/_vendor/requests/packages/chardet/escsm.py
2930
7839
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org 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 Reserved. # # Con...
mit
adityahase/frappe
frappe/custom/doctype/custom_field/custom_field.py
1
5575
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe import json from frappe.utils import cstr from frappe import _ from frappe.model.document import Document from frappe.model.docfield import supports_translation from...
mit
robclark/stk-code
tools/nightbuilder/svn.py
20
3069
#!/bin/python # From Supertuxkart SVN revision $Revision$ # Copyright (C) 2012 Jean-manuel clemencon (samuncle) # Class for the SVN ################################################################################ import os from subprocess import check_output from utils import * class Svn: """ Interface for t...
gpl-3.0
alantygel/ckanext-tagmanager
ckanext/tagmanager/controller.py
1
5591
import ckan.plugins.toolkit as toolkit import ckan.lib.helpers as helpers import ckan.plugins as p from ckan.lib.base import BaseController, response, request import json import db import Levenshtein from unidecode import unidecode c = p.toolkit.c render = p.toolkit.render class TagmanagerController(BaseControlle...
agpl-3.0
nazo/ansible
lib/ansible/modules/network/dellos9/dellos9_config.py
62
10668
#!/usr/bin/python # # (c) 2015 Peter Sprygada, <psprygada@ansible.com> # # Copyright (c) 2016 Dell 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 versi...
gpl-3.0
jdemon519/cfme_tests
artifactor/plugins/logger.py
5
2875
""" Logger plugin for Artifactor Add a stanza to the artifactor config like this, artifactor: log_dir: /home/username/outdir per_run: test #test, run, None overwrite: True plugins: logger: enabled: True plugin: logger level: DEBUG """ import os from logging i...
gpl-2.0
szibis/ansible-modules-core
files/file.py
9
16615
#!/usr/bin/python # -*- coding: utf-8 -*- # (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...
gpl-3.0
taedori81/wagtail
wagtail/wagtailembeds/views/chooser.py
28
1951
from django.forms.utils import ErrorList from django.utils.translation import ugettext as _ from wagtail.wagtailadmin.modal_workflow import render_modal_workflow from wagtail.wagtailembeds.forms import EmbedForm from wagtail.wagtailembeds.format import embed_to_editor_html from wagtail.wagtailembeds.embeds import Emb...
bsd-3-clause
40223136/w17test1
static/Brython3.1.0-20150301-090019/Lib/token.py
743
3034
"""Token constants (from "token.h").""" __all__ = ['tok_name', 'ISTERMINAL', 'ISNONTERMINAL', 'ISEOF'] # This file is automatically generated; please don't muck it up! # # To update the symbols in this file, 'cd' to the top directory of # the python source tree after building the interpreter and run: # # ./pyth...
gpl-3.0
innovacoin/innova
contrib/zmq/zmq_sub.py
69
1726
#!/usr/bin/env python import array import binascii import zmq import struct port = 28332 zmqContext = zmq.Context() zmqSubSocket = zmqContext.socket(zmq.SUB) zmqSubSocket.setsockopt(zmq.SUBSCRIBE, b"hashblock") zmqSubSocket.setsockopt(zmq.SUBSCRIBE, b"hashtx") zmqSubSocket.setsockopt(zmq.SUBSCRIBE, b"hashtxlock") zm...
mit
Curious72/sympy
sympy/physics/quantum/tests/test_spin.py
80
320440
from __future__ import division from sympy import cos, exp, expand, I, Matrix, pi, S, sin, sqrt, Sum, symbols from sympy.abc import alpha, beta, gamma, j, m from sympy.physics.quantum import hbar, represent, Commutator, InnerProduct from sympy.physics.quantum.qapply import qapply from sympy.physics.quantum.tensorproduc...
bsd-3-clause
vbshah1992/microblog
flask/lib/python2.7/site-packages/whoosh/lang/isri.py
95
17041
# -*- coding: utf-8 -*- # # Natural Language Toolkit: The ISRI Arabic Stemmer # # Copyright (C) 2001-2012 NLTK Proejct # Algorithm: Kazem Taghva, Rania Elkhoury, and Jeffrey Coombs (2005) # Author: Hosam Algasaier <hosam_hme@yahoo.com> # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT """ ISRI A...
bsd-3-clause
dgjustice/ansible
lib/ansible/modules/windows/win_tempfile.py
15
2003
#!/usr/bin/python #coding: utf-8 -*- # (c) 2017 Dag Wieers <dag@wieers.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 # (...
gpl-3.0
Bjay1435/capstone
rootfs/usr/lib/python3.4/distutils/command/clean.py
205
2776
"""distutils.command.clean Implements the Distutils 'clean' command.""" # contributed by Bastian Kleineidam <calvin@cs.uni-sb.de>, added 2000-03-18 import os from distutils.core import Command from distutils.dir_util import remove_tree from distutils import log class clean(Command): description = "clean up tem...
mit
royc1/gpdb
gpMgmt/bin/ext/yaml/nodes.py
985
1440
class Node(object): def __init__(self, tag, value, start_mark, end_mark): self.tag = tag self.value = value self.start_mark = start_mark self.end_mark = end_mark def __repr__(self): value = self.value #if isinstance(value, list): # if len(value) == 0: ...
apache-2.0
Kriechi/mitmproxy
mitmproxy/net/http/user_agents.py
14
1777
""" A small collection of useful user-agent header strings. These should be kept reasonably current to reflect common usage. """ # pylint: line-too-long # A collection of (name, shortcut, string) tuples. UASTRINGS = [ ("android", "a", "Mozilla/5.0 (Linux; U; Android 4.1.1; en-gb; Nexus 7 Build/...
mit
jcoady9/python-for-android
python3-alpha/extra_modules/gdata/Crypto/Protocol/AllOrNothing.py
45
11026
"""This file implements all-or-nothing package transformations. An all-or-nothing package transformation is one in which some text is transformed into message blocks, such that all blocks must be obtained before the reverse transformation can be applied. Thus, if any blocks are corrupted or lost, the original message...
apache-2.0
sander76/home-assistant
homeassistant/components/serial_pm/sensor.py
2
2646
"""Support for particulate matter sensors connected to a serial port.""" import logging from pmsensor import serial_pm as pm import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity from homeassistant.const import CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, CONF_NAME import hom...
apache-2.0
mathstuf/bodhi
bodhi/services/builds.py
1
3552
# 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 is distributed in the hope that it will be useful, # bu...
gpl-2.0
t794104/ansible
lib/ansible/plugins/inventory/yaml.py
54
7175
# Copyright (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 = ''' inventory: yaml version_added: "2.4" short_description: Uses a speci...
gpl-3.0
ilya-epifanov/ansible
lib/ansible/template/__init__.py
4
14059
# (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
wufeifei/cobra
cobra/__init__.py
2
5242
#!/usr/bin/env python # -*- coding: utf-8 -*- """ cobra ~~~~~ Implements cobra main :author: Feei <feei@feei.cn> :homepage: https://github.com/WhaleShark-Team/cobra :license: MIT, see LICENSE for more details. :copyright: Copyright (c) 2018 Feei. All rights reserved """ import sys i...
mit
hsaputra/tensorflow
tensorflow/python/debug/cli/profile_analyzer_cli_test.py
59
17966
# 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
heeraj123/oh-mainline
vendor/packages/Django/tests/modeltests/m2m_through/tests.py
117
12908
from __future__ import absolute_import from datetime import datetime from operator import attrgetter from django.test import TestCase from .models import (Person, Group, Membership, CustomMembership, PersonSelfRefM2M, Friendship) class M2mThroughTests(TestCase): def setUp(self): self.bob = Person.o...
agpl-3.0
macs03/demo-cms
cms/lib/python2.7/site-packages/setuptools/depends.py
410
6221
from __future__ import generators import sys, imp, marshal from imp import PKG_DIRECTORY, PY_COMPILED, PY_SOURCE, PY_FROZEN from distutils.version import StrictVersion, LooseVersion __all__ = [ 'Require', 'find_module', 'get_module_constant', 'extract_constant' ] class Require: """A prerequisite to building o...
mit
ColOfAbRiX/ansible
lib/ansible/plugins/callback/junit.py
31
8269
# (c) 2016 Matt Clay <matt@mystile.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 later version. # ...
gpl-3.0
RonnyPfannschmidt/execnet-test
execnet/deprecated.py
4
1560
""" some deprecated calls (c) 2008-2009, Holger Krekel and others """ import execnet def PopenGateway(python=None): """ instantiate a gateway to a subprocess started with the given 'python' executable. """ APIWARN("1.0.0b4", "use makegateway('popen')") spec = execnet.XSpec("popen") spec.p...
mit
vitay/ANNarchy
ANNarchy/parser/StringManipulation.py
2
7633
""" StringManipulation.py This file is part of ANNarchy. Copyright (C) 2013-2016 Julien Vitay <julien.vitay@gmail.com>, Helge Uelo Dinkelbach <helge.dinkelbach@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public Licens...
gpl-2.0
gacarrillor/QGIS
python/plugins/db_manager/db_plugins/oracle/data_model.py
57
6152
# -*- coding: utf-8 -*- """ /*************************************************************************** Name : DB Manager Description : Database manager plugin for QGIS (Oracle) Date : Aug 27, 2014 copyright : (C) 2014 by Médéric RIBREUX email : meder...
gpl-2.0
imamol555/Machine-Learning
knn_math_iris.py
1
1355
from sklearn.datasets import load_iris iris = load_iris() from scipy.spatial import distance def euc(a,b): return distance.euclidean(a,b) class MyKNN(): def fit(self,X_train, y_train): self.X_train = X_train self.y_train = y_train def predict(self,X_test): predictions...
mit
OuterDeepSpace/OuterDeepSpace
libs/client/osci/dialog/FleetSpecsDlg.py
3
12970
# # Copyright 2001 - 2006 Ludek Smid [http://www.ospace.net/] # # This file is part of IGE - Outer Space. # # IGE - Outer Space 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 t...
gpl-2.0
aimas/TuniErp-8.0
openerp/addons/base/res/res_country.py
283
4728
# -*- 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...
agpl-3.0
jeanlinux/calibre
src/calibre/gui2/lrf_renderer/text.py
15
21059
__license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>' import sys, collections, operator, copy, re from PyQt5.Qt import ( Qt, QRectF, QFont, QColor, QPixmap, QGraphicsPixmapItem, QGraphicsItem, QFontMetrics, QPen, QBrush, QGraphicsRectItem) from calibre.ebooks.lrf.fonts import ...
gpl-3.0
ronie/script.cu.lrclyrics
resources/lib/broken-scrapers/letssingit/lyricsScraper.py
1
1935
#-*- coding: UTF-8 -*- import re import urllib import requests import socket import difflib from utilities import * __title__ = 'letssingit' __priority__ = '230' __lrc__ = False socket.setdefaulttimeout(10) class LyricsFetcher: def __init__(self): self.url = 'https://search.letssingit.com/?s=%s&a=search...
gpl-2.0
cgranade/qutip
qutip/control/pulseoptim.py
2
81339
# -*- coding: utf-8 -*- # This file is part of QuTiP: Quantum Toolbox in Python. # # Copyright (c) 2014 and later, Alexander J G Pitchford # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # ...
bsd-3-clause
weidnem/IntroPython2016
students/cowhey/session03/slicing.py
3
1079
def switch_first_and_last(sequence): '''return a sequence with the first and last items exchanged.''' first = sequence[0] last = sequence[-1] # the problem here is that array[0] returns an int, not an arr # and you can't concatenate an int and an arr # so test for type before concatenating i...
unlicense
netgio/voicecount
devicecode/MakeSpeechProject.py
1
5015
#SpeakPython allows developers to add speech recognition support to their Python applications #Copyright (C) 2015 Eric Matthews #This program is free software: you can redistribute it and/or modify #it under the terms of the GNU General Public License as published by #the Free Software Foundation, either version 3 o...
mit
dgladkov/django
django/db/models/expressions.py
4
34882
import copy import datetime from django.conf import settings from django.core.exceptions import FieldError from django.db.backends import utils as backend_utils from django.db.models import fields from django.db.models.constants import LOOKUP_SEP from django.db.models.query_utils import Q, refs_aggregate from django.u...
bsd-3-clause
audaciouscode/Books-Mac-OS-X
Versions/Books_3.0b6/Library of Congress.plugin/Contents/Resources/PyZ3950/oids.py
30
36489
from PyZ3950 import asn1 oids = {} oids['Z3950'] = {'oid': asn1.OidVal([1, 2, 840, 10003]), 'val': [1, 2, 840, 10003]} oids['Z3950']['ATTRS'] = {'oid': asn1.OidVal([1, 2, 840, 10003, 3]), 'val': [1, 2, 840, 10003, 3]} oids['Z3950']['DIAG'] = {'oid': asn1.OidVal([1, 2, 840, 10003, 4]), 'val': [1, 2, 840, 10003, 4]} oids...
mit
andmos/ansible
test/units/modules/network/f5/test_bigip_tunnel.py
21
3091
# -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytest import sys if sys.version_info < (2...
gpl-3.0
timlinux/geonode
geonode/contrib/createlayer/forms.py
5
1636
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2017 OSGeo # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 ...
gpl-3.0
noseka1/ansible-modules-core
cloud/amazon/cloudformation.py
28
14879
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
gpl-3.0
jawilson/home-assistant
homeassistant/components/rollershutter/scsgate.py
5
2955
""" Allow to configure a SCSGate roller shutter. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/rollershutter.scsgate/ """ import logging import homeassistant.components.scsgate as scsgate from homeassistant.components.rollershutter import Rollershutter...
mit
veger/ansible
lib/ansible/plugins/action/junos.py
7
6012
# # (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
gisinc/slap
slap/api.py
1
6318
import requests import json class Api: def __init__(self, ags_url, token_url, portal_url, username, password, verify_certs=False): self._ags_url = ags_url self._token_url = token_url if token_url else ags_url + '/generateToken' self._portal_url = portal_url self._username = userna...
mit
okolisny/integration_tests
cfme/tests/perf/workloads/test_refresh_providers.py
8
4107
"""Runs Refresh Workload by adding specified providers, refreshing the providers, waiting, then repeating for specified length of time.""" from cfme.utils.conf import cfme_performance from cfme.utils.grafana import get_scenario_dashboard_urls from cfme.utils.log import logger from cfme.utils.providers import get_crud f...
gpl-2.0
PaloAltoNetworks-BD/SplunkforPaloAltoNetworks
Splunk_TA_paloalto/bin/splunk_ta_paloalto/aob_py3/solnlib/packages/requests/status_codes.py
73
4129
# -*- coding: utf-8 -*- r""" The ``codes`` object defines a mapping from common names for HTTP statuses to their numerical codes, accessible either as attributes or as dictionary items. >>> requests.codes['temporary_redirect'] 307 >>> requests.codes.teapot 418 >>> requests.codes['\o/'] 200 Some codes have multiple n...
isc
EvilMcJerkface/kudu
build-support/run_dist_test.py
2
6958
#!/usr/bin/env python2 # # 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 # ...
apache-2.0
adrienbrault/home-assistant
homeassistant/components/adguard/config_flow.py
3
5817
"""Config flow to configure the AdGuard Home integration.""" from __future__ import annotations from typing import Any from adguardhome import AdGuardHome, AdGuardHomeConnectionError import voluptuous as vol from homeassistant import config_entries from homeassistant.config_entries import ConfigFlow from homeassista...
mit
p4datasystems/CarnotKE
jyhton/lib-python/2.7/lib2to3/fixes/fix_urllib.py
325
8385
"""Fix changes imports of urllib which are now incompatible. This is rather similar to fix_imports, but because of the more complex nature of the fixing for urllib, it has its own fixer. """ # Author: Nick Edds # Local imports from lib2to3.fixes.fix_imports import alternates, FixImports from lib2to3 import fixer...
apache-2.0
Vimos/scikit-learn
doc/tutorial/text_analytics/solutions/exercise_01_language_train_model.py
73
2264
"""Build a language detector model The goal of this exercise is to train a linear classifier on text features that represent sequences of up to 3 consecutive characters so as to be recognize natural languages by using the frequencies of short character sequences as 'fingerprints'. """ # Author: Olivier Grisel <olivie...
bsd-3-clause
moondrop-entertainment/django-nonrel-drawp
django/contrib/gis/db/models/sql/where.py
309
3938
from django.db.models.fields import Field, FieldDoesNotExist from django.db.models.sql.constants import LOOKUP_SEP from django.db.models.sql.expressions import SQLEvaluator from django.db.models.sql.where import Constraint, WhereNode from django.contrib.gis.db.models.fields import GeometryField class GeoConstraint(Con...
bsd-3-clause
albertomurillo/ansible
lib/ansible/modules/cloud/amazon/ec2_ami.py
39
27362
#!/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': ['stableinterfa...
gpl-3.0
edmorley/django
django/utils/inspect.py
42
1688
import inspect def get_func_args(func): sig = inspect.signature(func) return [ arg_name for arg_name, param in sig.parameters.items() if param.kind == inspect.Parameter.POSITIONAL_OR_KEYWORD ] def get_func_full_args(func): """ Return a list of (argument name, default value) tuple...
bsd-3-clause
gmr/queries
queries/pool.py
1
22022
""" Connection Pooling """ import datetime import logging import os import threading import time import weakref import psycopg2 LOGGER = logging.getLogger(__name__) DEFAULT_IDLE_TTL = 60 DEFAULT_MAX_SIZE = int(os.environ.get('QUERIES_MAX_POOL_SIZE', 1)) class Connection(object): """Contains the handle to the ...
bsd-3-clause
libsmelt/Simulator
contrib/python-graph/tests/unittests-minmax.py
1
8515
# Copyright (c) Pedro Matiello <pmatiello@gmail.com> # Johannes Reinhardt <jreinhardt@ist-dein-freund.de> # # 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...
mit
hesseltuinhof/mxnet
example/reinforcement-learning/ddpg/strategies.py
15
1705
import numpy as np class BaseStrategy(object): """ Base class of exploration strategy. """ def get_action(self, obs, policy): raise NotImplementedError def reset(self): pass class OUStrategy(BaseStrategy): """ Ornstein-Uhlenbeck process: dxt = theta * (mu - xt) * dt +...
apache-2.0
PeterWangIntel/chromium-crosswalk
tools/cr/cr/actions/builder.py
71
2484
# 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 module for the Builder base class.""" import difflib import cr class Builder(cr.Action, cr.Plugin.Type): """Base class for implementing builders. ...
bsd-3-clause
MatthewWilkes/django
tests/custom_managers/tests.py
92
23329
from __future__ import unicode_literals from django.db import models from django.test import TestCase from django.utils import six from .models import ( Book, Car, CustomManager, CustomQuerySet, DeconstructibleCustomManager, FunPerson, OneToOneRestrictedModel, Person, PersonFromAbstract, PersonManager, Pu...
bsd-3-clause
stregoika/aislib
scripts/ais_uscg_splitstations.py
1
3298
#!/usr/bin/env python __version__ = '$Revision: 7470 $'.split()[1] __date__ = '$Date: 2007-11-06 10:31:44 -0500 (Tue, 06 Nov 2007) $'.split()[1] __author__ = 'Kurt Schwehr' __doc__=''' Split USCG N-AIS messages into separate stations @requires: U{epydoc<http://epydoc.sourceforge.net/>} > 3.0alpha3 @author: '''+__a...
gpl-3.0
rdipietro/tensorflow
tensorflow/python/debug/wrappers/hooks.py
8
3522
# Copyright 2016 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
rcomer/iris
lib/iris/tests/unit/fileformats/pp/test__data_bytes_to_shaped_array.py
1
6051
# Copyright Iris contributors # # This file is part of Iris and is released under the LGPL license. # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """ Unit tests for the `iris.fileformats.pp._data_bytes_to_shaped_array` function. """ # Import iris.tests first so that some...
lgpl-3.0
toshywoshy/ansible
lib/ansible/module_utils/exoscale.py
13
5246
# -*- coding: utf-8 -*- # Copyright (c) 2016, René Moser <mail@renemoser.net> # Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause) from __future__ import absolute_import, division, print_function __metaclass__ = type import os from ansible.module_utils.six.moves ...
gpl-3.0
zhengzhihust/tablib
tablib/packages/xlrd3/sheet.py
54
74917
# Portions copyright © 2005-2009 Stephen John Machin, Lingfo Pty Ltd # This module is part of the xlrd3 package, which is released under a # BSD-style licence. # 2009-05-31 SJM Fixed problem with no CODEPAGE record on extremely minimal BIFF2.x 3rd-party file # 2009-04-27 SJM Integrated on_demand patch by Armando ...
mit
matthieucan/debsources
debsources/plugins/hook_checksums.py
5
5171
# Copyright (C) 2013-2015 The Debsources developers <info@sources.debian.net>. # See the AUTHORS file at the top-level directory of this distribution and at # https://anonscm.debian.org/gitweb/?p=qa/debsources.git;a=blob;f=AUTHORS;hb=HEAD # # This file is part of Debsources. Debsources is free software: you can # redi...
agpl-3.0
sephalon/pylibtiff
libtiff/script_options.py
13
4443
__all__ = ['set_formatter', 'set_info_options', 'set_convert_options'] import os from optparse import OptionGroup, NO_DEFAULT from optparse import TitledHelpFormatter try: import wx have_wx = True except ImportError: have_wx = False class MyHelpFormatter(TitledHelpFormatter): def format_option(sel...
bsd-3-clause