repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
teriyakichild/ansible-modules-extras
cloud/vmware/vmware_dvs_portgroup.py
4
6557
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Joseph Callen <jcallen () csc.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 Li...
gpl-3.0
hantek/pylearn2
pylearn2/packaged_dependencies/theano_linear/unshared_conv/gpu_unshared_conv.py
44
23194
""" WRITEME """ from __future__ import print_function import inspect import os import StringIO import theano from theano.sandbox.cuda import CudaNdarrayType from theano.gof import local_optimizer from theano.sandbox.cuda.opt import register_opt from theano.sandbox.cuda import gpu_from_host, host_from_gpu from theano....
bsd-3-clause
steedos/odoo7
openerp/addons/base_action_rule/__openerp__.py
57
1998
# -*- 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
mkieszek/odoo
addons/product_extended/wizard/wizard_price.py
39
2197
# -*- encoding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp.exceptions import UserError from openerp.osv import fields, osv from openerp.tools.translate import _ class wizard_price(osv.osv): _name = "wizard.price" _description = "Compute price wizard" ...
agpl-3.0
tpodowd/boto
boto/sqs/regioninfo.py
167
1524
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without res...
mit
tpaszkowski/quantum
quantum/extensions/portsecurity.py
4
2607
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 Nicira Networks, 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.apac...
apache-2.0
funkring/fdoo
addons/account/project/project.py
273
2423
# -*- 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
nocarryr/AV-Asset-Manager
avam/assettags/tag_handler.py
1
8030
from io import BytesIO import random import xml.etree.ElementTree as ET from base64 import b64encode import qrcode from qrcode.image.svg import SvgPathFillImage from wand.image import Image as WandImage from assettags import settings def _generate_code(num_chars=None): if num_chars is None: num_chars = s...
gpl-3.0
m11s/MissionPlanner
ExtLibs/Mavlink/mavgen_c.py
33
18071
#!/usr/bin/env python ''' parse a MAVLink protocol XML file and generate a C implementation Copyright Andrew Tridgell 2011 Released under GNU GPL version 3 or later ''' import sys, textwrap, os, time import mavparse, mavtemplate t = mavtemplate.MAVTemplate() def generate_version_h(directory, xml): ...
gpl-3.0
anandbhoraskar/Diamond
src/collectors/portstat/tests/test_portstat.py
21
2057
from test import CollectorTestCase from test import get_collector_config from mock import call, Mock, patch from unittest import TestCase from diamond.collector import Collector from portstat import get_port_stats, PortStatCollector class PortStatCollectorTestCase(CollectorTestCase): TEST_CONFIG = { '...
mit
Johnzero/erp
openerp/addons/auth_openid/controllers/main.py
3
9131
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
amenonsen/ansible
lib/ansible/modules/cloud/google/gcp_compute_instance_group_manager_info.py
5
10526
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
tosunkaya/adsbypasser
deploy/mirrors/openuserjs.py
3
1968
import mechanize import requests import urllib from summary import make_summary def exec_(config, edition, another_edition, script): USERNAME = config['USERNAME'] SCRIPTNAME = config[edition]['SCRIPTNAME'] GITHUB_USERNAME = config['GITHUB_USERNAME'] GITHUB_PASSWORD = config['GITHUB_PASSWORD'] HO...
bsd-2-clause
NeostreamTechnology/Microservices
venv/lib/python2.7/site-packages/werkzeug/wsgi.py
85
42838
# -*- coding: utf-8 -*- """ werkzeug.wsgi ~~~~~~~~~~~~~ This module implements WSGI related helpers. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import re import os import posixpath import mimetypes from itertools import...
mit
stevedevelope17/Pizzerie
node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py
1509
17165
# Copyright (c) 2013 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. """Handle version information related to Visual Stuio.""" import errno import os import re import subprocess import sys import gyp import glob class VisualStudi...
mit
Scalr/libcloud
libcloud/utils/publickey.py
1
2711
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
apache-2.0
ichuang/sympy
sympy/polys/tests/test_distributedpolys.py
2
7404
"""Tests for sparse distributed polynomials. """ from sympy.polys.distributedpolys import ( sdp_LC, sdp_LM, sdp_LT, sdp_del_LT, sdp_coeffs, sdp_monoms, sdp_sort, sdp_strip, sdp_normal, sdp_from_dict, sdp_to_dict, sdp_indep_p, sdp_one_p, sdp_one, sdp_term_p, sdp_abs, sdp_neg, sdp_add_term, s...
bsd-3-clause
timothyclemans/checklistsforglass
checklistsforglass/urls.py
1
2844
from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() from .views import AuthComplete, LoginError urlpatterns = patterns('', # Examples: url(r'^$', 'checklistsforglass.views.home', name='home'), url(r'^...
apache-2.0
mastizada/kuma
vendor/packages/ipython/IPython/Extensions/ipy_rehashdir.py
8
4425
# -*- coding: utf-8 -*- """ IPython extension: add %rehashdir magic Usage: %rehashdir c:/bin c:/tools - Add all executables under c:/bin and c:/tools to alias table, in order to make them directly executable from any directory. This also serves as an example on how to extend ipython with new magic functions. ...
mpl-2.0
patrioticcow/MessagesForSkype
packages/win32/bundle/MessagesForSkype/modules/python/1.3.1-beta/Lib/email/errors.py
468
1628
# Copyright (C) 2001-2006 Python Software Foundation # Author: Barry Warsaw # Contact: email-sig@python.org """email package exception classes.""" class MessageError(Exception): """Base class for errors in the email package.""" class MessageParseError(MessageError): """Base class for message parsing erro...
mit
ticosax/django
tests/template_tests/templatetags/inclusion.py
174
8479
import operator from django.template import Engine, Library from django.utils import six engine = Engine(app_dirs=True) register = Library() @register.inclusion_tag('inclusion.html') def inclusion_no_params(): """Expected inclusion_no_params __doc__""" return {"result": "inclusion_no_params - Expected resul...
bsd-3-clause
twobob/buildroot-kindle
output/build/host-python-2.7.2/Lib/test/test_xrange.py
36
5209
# Python test set -- built-in functions import test.test_support, unittest import sys import pickle import itertools import warnings warnings.filterwarnings("ignore", "integer argument expected", DeprecationWarning, "unittest") # pure Python implementations (3 args only), for comparison def p...
gpl-2.0
pylover/network-interfaces
network_interfaces/iface.py
1
1727
# -*- coding: utf-8 -*- from .stanza import MultilineStanza from .errors import ValidationError __author__ = 'vahid' class IfaceBase(MultilineStanza): startup = None @property def name(self): return self._headers[1] @name.setter def name(self, val): self._headers[1] = val de...
gpl-3.0
marcsans/cnn-physics-perception
phy/lib/python2.7/site-packages/scipy/linalg/interpolative.py
41
31146
#****************************************************************************** # Copyright (C) 2013 Kenneth L. Ho # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # Redistributions of source code must retain t...
mit
keflavich/scikit-image
skimage/feature/tests/test_censure.py
30
3606
import numpy as np from numpy.testing import assert_array_equal, assert_raises from skimage.data import moon from skimage.feature import CENSURE from skimage._shared.testing import test_parallel from skimage.transform import rescale img = moon() np.random.seed(0) def test_censure_on_rectangular_images(): """Cen...
bsd-3-clause
sebady/selenium
py/test/selenium/webdriver/browser_specific_template.py
19
1503
#!/usr/bin/python # # Copyright 2011 Software Freedom Conservancy # # 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 app...
apache-2.0
CSC301H-Fall2013/JuakStore
site-packages/django/template/smartif.py
239
6269
""" Parser and utilities for the smart 'if' tag """ # Using a simple top down parser, as described here: # http://effbot.org/zone/simple-top-down-parsing.htm. # 'led' = left denotation # 'nud' = null denotation # 'bp' = binding power (left = lbp, right = rbp) class TokenBase(object): """ Base class for ope...
mit
yanheven/neutron
neutron/agent/l3/item_allocator.py
25
4083
# Copyright 2015 IBM 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 applicable law or ag...
apache-2.0
USGSDenverPychron/pychron
pychron/experiment/utilities/comment_template.py
1
1619
# =============================================================================== # Copyright 2014 Jake Ross # # 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...
apache-2.0
kingvuplus/EGAMI-B
lib/python/Plugins/SystemPlugins/DiseqcTester/plugin.py
63
27159
import random from Screens.Satconfig import NimSelection from Screens.Screen import Screen from Screens.TextBox import TextBox from Screens.MessageBox import MessageBox from Plugins.Plugin import PluginDescriptor from Components.ActionMap import ActionMap, NumberActionMap from Components.NimManager import nimmanager f...
gpl-2.0
mageia/dpark
examples/shortpath.py
16
1397
#!/usr/bin/env python2.6 import sys, os.path sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from dpark import Bagel, DparkContext from dpark.bagel import Vertex, Edge, BasicCombiner def to_vertex((id, lines)): outEdges = [Edge(tid, int(v)) for _, tid, v in lines] retur...
bsd-3-clause
CVML/cvxpy
cvxpy/tests/test_constraints.py
7
8743
""" Copyright 2013 Steven Diamond This file is part of CVXPY. CVXPY 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. CVXPY is distributed i...
gpl-3.0
40423126/2016fallcadp_ag9
plugin/liquid_tags/test_audio.py
273
1456
from . import audio import pytest import re @pytest.mark.parametrize('input,expected', [ ('http://foo.bar https://bar.foo', ('http://foo.bar', 'https://bar.foo', None)), ('http://test.foo', ('http://test.foo', None, None)), ('https://test.foo', ('https://test.foo', None, None)), ('http:...
agpl-3.0
regular/pyglet-avbin-optimizations
tools/al_info.py
4
2207
#!/usr/bin/env python '''Print OpenAL driver information. Options: -d <device> Optionally specify device to query. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import ctypes import optparse import sys from pyglet.media.drivers import openal from pyglet.media.drivers.openal import lib_openal as a...
bsd-3-clause
wlerin/streamlink
src/streamlink/plugins/trtspor.py
4
1230
from __future__ import print_function import re from streamlink.plugin import Plugin from streamlink.plugin.api import validate from streamlink.stream import AkamaiHDStream from streamlink.stream import HDSStream from streamlink.stream import HLSStream class TRTSpor(Plugin): """ Support for trtsport.com a Tu...
bsd-2-clause
ekwoodrich/nirha
nirhalib/venv/lib/python2.7/site-packages/flask/testsuite/helpers.py
405
21973
# -*- coding: utf-8 -*- """ flask.testsuite.helpers ~~~~~~~~~~~~~~~~~~~~~~~ Various helpers. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os import flask import unittest from logging import StreamHandler from flask.testsuite import FlaskTestCase,...
apache-2.0
ericfc/django
tests/model_fields/test_durationfield.py
296
2724
import datetime import json from django import forms from django.core import exceptions, serializers from django.db import models from django.test import SimpleTestCase, TestCase from .models import DurationModel, NullDurationModel class TestSaveLoad(TestCase): def test_simple_roundtrip(self): duration...
bsd-3-clause
jordanemedlock/psychtruths
temboo/Library/NYTimes/CampaignFinance/PresidentialCampaigns/PresidentialCandidateTotals.py
5
3920
# -*- coding: utf-8 -*- ############################################################################### # # PresidentialCandidateTotals # Retrieves the total receipts and disbursements for all presidential candidates for a particular campaign cycle. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # #...
apache-2.0
andysim/psi4
psi4/driver/qcdb/exceptions.py
3
3684
# # @BEGIN LICENSE # # Psi4: an open-source quantum chemistry software package # # Copyright (c) 2007-2017 The Psi4 Developers. # # The copyrights for code used from other parties are included in # the corresponding files. # # This program is free software; you can redistribute it and/or modify # it under the terms of ...
gpl-2.0
sillydan1/WhatEverEngine
openglcsharp/Lib/encodings/mac_latin2.py
647
8565
""" Python Character Mapping Codec generated from 'LATIN2.TXT' with gencodec.py. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. (c) Copyright 2000 Guido van Rossum. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,erro...
apache-2.0
vinilios/synnefo
snf-cyclades-app/synnefo/logic/management/commands/port-create.py
9
6075
# Copyright (C) 2010-2014 GRNET S.A. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed i...
gpl-3.0
double12gzh/nova
nova/api/openstack/compute/contrib/flavor_rxtx.py
79
2175
# Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
apache-2.0
hyunchel/webargs
tests/test_tornadoparser.py
1
18291
# -*- coding: utf-8 -*- import json try: from urllib import urlencode # python2 except ImportError: from urllib.parse import urlencode # python3 import mock import pytest import tornado.web import tornado.httputil import tornado.httpserver import tornado.http1connection import tornado.concurrent import tor...
mit
xzturn/tensorflow
tensorflow/python/kernel_tests/linalg/linear_operator_test.py
9
14495
# 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
KamillaKhabibrakhmanova/fish
node_modules/ionic/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py
2354
10366
# Unmodified from http://code.activestate.com/recipes/576693/ # other than to add MIT license header (as specified on page, but not in code). # Linked from Python documentation here: # http://docs.python.org/2/library/collections.html#collections.OrderedDict # # This should be deleted once Py2.7 is available on all bot...
mit
espressopp/espressopp
src/integrator/FixPositions.py
1
2020
# Copyright (C) 2012,2013 # Max Planck Institute for Polymer Research # Copyright (C) 2008,2009,2010,2011 # Max-Planck-Institute for Polymer Research & Fraunhofer SCAI # # This file is part of ESPResSo++. # # ESPResSo++ is free software: you can redistribute it and/or modify # it under the terms of the G...
gpl-3.0
mhnatiuk/phd_sociology_of_religion
scrapper/lib/python2.7/site-packages/twisted/lore/lmath.py
60
3037
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ LaTeX-defined image support for Lore documents. """ import os, tempfile from xml.dom import minidom as dom from twisted.web import domhelpers import latex, tree, lint, default class MathLatexSpitter(latex.LatexSpitter): start_html = '...
gpl-2.0
pluskid/mxnet
python/mxnet/executor.py
14
19510
# coding: utf-8 # pylint: disable=invalid-name, protected-access, too-many-locals, too-many-arguments """Symbolic Executor component of MXNet.""" from __future__ import absolute_import import ctypes import copy import warnings import numpy as np from .base import _LIB from .base import mx_uint, NDArrayHandle, Executor...
apache-2.0
dhruvsrivastava/OJ
flask/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.py
36
12495
# testing/exclusions.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import operator from ..util import decorator from . import config from .. imp...
bsd-3-clause
softDi/clusim
ns3/ns-3.26/src/tap-bridge/bindings/modulegen__gcc_ILP32.py
19
283308
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
apache-2.0
beernarrd/gramps
gramps/gen/filters/rules/family/_isbookmarked.py
5
1841
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2008 Brian Matherly # # 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 opt...
gpl-2.0
glennhickey/teHmm
scripts/multibench.py
1
4173
#!/usr/bin/env python #Copyright (C) 2014 by Glenn Hickey # #Released under the MIT license, see LICENSE.txt import unittest import sys import os import argparse import logging import random import numpy as np from teHmm.common import runShellCommand, setLogLevel, addLoggingFileHandler setLogLevel("INFO") addLogging...
mit
analurandis/Tur
backend/venv/Lib/site-packages/unidecode/x01e.py
246
3853
data = ( 'A', # 0x00 'a', # 0x01 'B', # 0x02 'b', # 0x03 'B', # 0x04 'b', # 0x05 'B', # 0x06 'b', # 0x07 'C', # 0x08 'c', # 0x09 'D', # 0x0a 'd', # 0x0b 'D', # 0x0c 'd', # 0x0d 'D', # 0x0e 'd', # 0x0f 'D', # 0x10 'd', # 0x11 'D', # 0x12 'd', # 0x13 'E', # 0...
mit
slurps-mad-rips/color
color/__init__.py
1
2118
from contextlib import contextmanager import builtins import sys __all__ = ['print'] # There's quite a bit of setup for windows, but oh well. if sys.platform == 'win32': from ctypes import windll, Structure, byref from ctypes import c_ushort as ushort, c_short as short class Coord(Structure): _f...
bsd-2-clause
Javiercerna/MissionPlanner
Lib/sndhdr.py
63
6201
"""Routines to help recognizing sound files. Function whathdr() recognizes various types of sound file headers. It understands almost all headers that SOX can decode. The return tuple contains the following items, in this order: - file type (as SOX understands it) - sampling rate (0 if unknown or hard to decod...
gpl-3.0
Jeff-Tian/mybnb
Python27/Lib/lib-tk/test/test_tkinter/test_text.py
3
1515
import unittest import Tkinter as tkinter from test.test_support import requires, run_unittest from test_ttk.support import AbstractTkTest requires('gui') class TextTest(AbstractTkTest, unittest.TestCase): def setUp(self): super(TextTest, self).setUp() self.text = tkinter.Text(self.roo...
apache-2.0
fearlessspider/python-social-auth
social/backends/lastfm.py
70
1888
import hashlib from social.utils import handle_http_errors from social.backends.base import BaseAuth class LastFmAuth(BaseAuth): """ Last.Fm authentication backend. Requires two settings: SOCIAL_AUTH_LASTFM_KEY SOCIAL_AUTH_LASTFM_SECRET Don't forget to set the Last.fm callback to somethi...
bsd-3-clause
RedHat-Eng-PGM/python-schedules-tools
schedules_tools/schedule_handlers/__init__.py
1
3014
from datetime import datetime import logging import pytz log = logging.getLogger(__name__) # Handle implementation must be in format ScheduleHandler_format # where 'format' is used as a uniq label for the format and # 'ScheduleHandler' can be whatever. class ScheduleHandlerBase(object): handle = None sched...
gpl-3.0
azurestandard/django
tests/regressiontests/introspection/tests.py
8
6625
from __future__ import absolute_import,unicode_literals from functools import update_wrapper from django.db import connection from django.test import TestCase, skipUnlessDBFeature, skipIfDBFeature from .models import Reporter, Article # # The introspection module is optional, so methods tested here might raise # No...
bsd-3-clause
Michaelmwirigi/lynsays
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/lexers/asm.py
292
13314
# -*- coding: utf-8 -*- """ pygments.lexers.asm ~~~~~~~~~~~~~~~~~~~ Lexers for assembly languages. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, include, bygroups, using, DelegatingL...
mit
iut-ibk/DynaMind-UrbanSim
3rdparty/opus/src/urbansim_parcel/zone/population_per_acre.py
2
2455
# Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE from opus_core.variables.variable import Variable from variable_functions import my_attribute_label class population_per_acre(Variable): """population in a zone / acres in a zone""" ...
gpl-2.0
rsethur/ThinkStats2
code/thinkstats2_test.py
66
12723
"""This file contains code for use with "Think Stats", by Allen B. Downey, available from greenteapress.com Copyright 2014 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ from __future__ import print_function, division import unittest import random from collections import Counter import ...
gpl-3.0
JVillella/tensorflow
tensorflow/python/util/decorator_utils_test.py
139
4197
# 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
henrytao-me/openerp.positionq
openerp/addons/delivery/report/__init__.py
74
1071
# -*- 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...
agpl-3.0
pniebla/test-repo-console
svn/git-1.8.3.3.tar/git-1.8.3.3/git-1.8.3.3/git_remote_helpers/git/exporter.py
46
1700
import os import subprocess import sys from git_remote_helpers.util import check_call class GitExporter(object): """An exporter for testgit repositories. The exporter simply delegates to git fast-export. """ def __init__(self, repo): """Creates a new exporter for the specified repo. ...
mit
roger-zhao/ardupilot-3.5-dev
Tools/mavproxy_modules/magcal_graph.py
108
3748
# Copyright (C) 2016 Intel Corporation. All rights reserved. # # This file is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This fi...
gpl-3.0
Slater-Victoroff/scrapy
scrapy/utils/benchserver.py
130
1312
import random from six.moves.urllib.parse import urlencode from twisted.web.server import Site from twisted.web.resource import Resource from twisted.internet import reactor class Root(Resource): isLeaf = True def getChild(self, name, request): return self def render(self, request): tot...
bsd-3-clause
GiorgosMethe/Soft-Robots-Novelty-Search
cppn-neat/NE/HyperNEAT/HyperNEAT_Visualizer/src/HyperNEATVisualizer.py
2
17730
from Defines import * from SubstrateRenderer import * #populationFileName = "C:/Programming/NE/HyperNEAT/out/Results/GoNoScaling1000Gens/testGoNoScaling_T2610_Euler_Run$RUN_NUMBER$.xm_best.xml.gz" #populationFileName = "C:/Programming/NE/HyperNEAT/out/Results/GoNoScaling_T2718/testGoNoScaling_T2718_Hilbert_Run...
mit
mattjmorrison/ReportLab
src/reportlab/graphics/samples/runall.py
20
2011
# runs all the GUIedit charts in this directory - # makes a PDF sample for eaxh existing chart type import sys import glob import string import inspect import types def moduleClasses(mod): def P(obj, m=mod.__name__, CT=types.ClassType): return (type(obj)==CT and obj.__module__==m) try: return i...
bsd-3-clause
tareqalayan/ansible
lib/ansible/modules/cloud/google/gcp_compute_instance_group.py
8
14223
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
rohlandm/servo
tests/wpt/web-platform-tests/tools/manifest/sourcefile.py
84
10635
import os import urlparse from fnmatch import fnmatch try: from xml.etree import cElementTree as ElementTree except ImportError: from xml.etree import ElementTree import html5lib import vcs from item import Stub, ManualTest, WebdriverSpecTest, RefTest, TestharnessTest from utils import rel_path_to_url, is_bla...
mpl-2.0
damdam-s/OpenUpgrade
addons/calendar/controllers/main.py
329
3390
import simplejson import openerp import openerp.http as http from openerp.http import request import openerp.addons.web.controllers.main as webmain import json class meeting_invitation(http.Controller): @http.route('/calendar/meeting/accept', type='http', auth="calendar") def accept(self, db, token, action, ...
agpl-3.0
rsoulliere/Evergreen_Mohawk
build/i18n/scripts/marc_tooltip_maker.py
11
11459
#!/usr/bin/env python # vim: set fileencoding=utf-8 : # vim:et:ts=4:sw=4: # Copyright (C) 2008 Laurentian University # Dan Scott <dscott@laurentian.ca> # # 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 Fo...
gpl-2.0
WhySoGeeky/DroidPot
venv/lib/python2.7/site-packages/pip/_vendor/pkg_resources/tests/test_resources.py
242
23622
import os import sys import tempfile import shutil import string import pytest import pkg_resources from pkg_resources import (parse_requirements, VersionConflict, parse_version, Distribution, EntryPoint, Requirement, safe_version, safe_name, WorkingSet) packaging = pkg_resources.packaging def safe_repr(ob...
mit
Hodorable/0602
openstack_dashboard/dashboards/project/loadbalancers/tests.py
23
36421
# 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
alqfahad/odoo
addons/purchase/wizard/purchase_order_group.py
376
3379
# -*- 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
xingyepei/edx-platform
common/djangoapps/status/tests.py
115
2136
# -*- coding: utf-8 -*- """ Tests for setting and displaying the site status message. """ import ddt import unittest from django.test import TestCase from django.core.cache import cache from django.conf import settings from opaque_keys.edx.locations import CourseLocator from .status import get_site_status_msg from .m...
agpl-3.0
octopus-platform/octopus
python/octopus-mlutils/octopus/shell/completer/octopus_rlcompleter.py
5
2125
import readline class OctopusShellCompleter(object): def __init__(self, shell): self.shell = shell self.context = None self.matches = None readline.set_completer_delims(".") def complete(self, text, state): if state == 0: self.set_context() if s...
lgpl-3.0
omprakasha/odoo
addons/l10n_in_hr_payroll/report/payslip_report.py
340
3978
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
anryko/ansible
lib/ansible/module_utils/network/eos/facts/lldp_global/lldp_global.py
21
2946
# # -*- coding: utf-8 -*- # Copyright 2019 Red Hat # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) """ The eos lldp_global fact class It is in this file the configuration is collected from the device for a given resource, parsed, and the facts tree is populated based on th...
gpl-3.0
ternus/war-reporter
panoptic/modules/iostat.py
1
1795
from base import PanopticStatPlugin import subprocess class PanopticIOStat(PanopticStatPlugin): diffable = False """ Example output of iostat command: Linux 3.2.44-3.2.1.3-amd64-10875514 (foo.bar.com) 10/10/13 avg-cpu: %user %nice %system %iowait %steal %idle 0.29 0....
mit
boyuegame/kbengine
kbe/src/lib/python/Lib/distutils/command/bdist_msi.py
152
35217
# Copyright (C) 2005, 2006 Martin von Löwis # Licensed to PSF under a Contributor Agreement. # The bdist_wininst command proper # based on bdist_wininst """ Implements the bdist_msi command. """ import sys, os from distutils.core import Command from distutils.dir_util import remove_tree from distutils.sysconfig import...
lgpl-3.0
zadgroup/edx-platform
common/test/acceptance/fixtures/edxnotes.py
86
1723
""" Tools for creating edxnotes content fixture data. """ import json import factory import requests from . import EDXNOTES_STUB_URL class Range(factory.Factory): FACTORY_FOR = dict start = "/div[1]/p[1]" end = "/div[1]/p[1]" startOffset = 0 endOffset = 8 class Note(factory.Factory): FACTO...
agpl-3.0
popazerty/dvbapp2-gui
lib/python/Plugins/SystemPlugins/SoftwareManager/BackupRestore.py
1
12814
from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Screens.Console import Console from Components.ActionMap import ActionMap, NumberActionMap from Components.Pixmap import Pixmap from Components.Label import Label from Components.Sources.StaticText import StaticText from Components.MenuLis...
gpl-2.0
ptoraskar/django
tests/model_meta/test_legacy.py
199
7556
import warnings from django import test from django.contrib.contenttypes.fields import GenericRelation from django.core.exceptions import FieldDoesNotExist from django.db.models.fields import CharField, related from django.utils.deprecation import RemovedInDjango110Warning from .models import BasePerson, Person from ...
bsd-3-clause
heliortf/Google-Forum-Engine
lib/werkzeug/local.py
97
14123
# -*- coding: utf-8 -*- """ werkzeug.local ~~~~~~~~~~~~~~ This module implements context-local objects. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from functools import update_wrapper from werkzeug.wsgi import ClosingIt...
apache-2.0
quinot/ansible
lib/ansible/plugins/callback/yaml.py
23
4317
# (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' callback: yaml type: stdout short_description: ...
gpl-3.0
efiring/scipy
scipy/misc/tests/test_common.py
20
4028
from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import (assert_array_equal, assert_almost_equal, assert_array_almost_equal, assert_equal) from scipy.misc import pade, logsumexp, face, ascent from scipy._lib._version import NumpyVersion...
bsd-3-clause
2014c2g5/2014c2
exts/wsgi/static/Brython2.1.0-20140419-113919/Lib/unittest/suite.py
748
9715
"""TestSuite""" import sys from . import case from . import util __unittest = True def _call_if_exists(parent, attr): func = getattr(parent, attr, lambda: None) func() class BaseTestSuite(object): """A simple test suite that doesn't provide class or module shared fixtures. """ def __init__(se...
gpl-2.0
simobasso/ansible
lib/ansible/plugins/lookup/csvfile.py
37
2629
# (c) 2013, 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
RoyalTS/econ-python-environment
.mywaflib/waflib/Tools/c_osx.py
10
5517
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy 2008-2010 """ MacOSX related tools """ import os, shutil, sys, platform from waflib import TaskGen, Task, Build, Options, Utils, Errors from waflib.TaskGen import taskgen_method, feature, after_method, before_method app_info = ''' <?xml version="1.0" encoding="UT...
bsd-3-clause
sagangwee/sagangwee.github.io
build/pygments/build/lib.linux-i686-2.7/pygments/formatters/rtf.py
73
5049
# -*- coding: utf-8 -*- """ pygments.formatters.rtf ~~~~~~~~~~~~~~~~~~~~~~~ A formatter that generates RTF files. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.formatter import Formatter from pygments.util import get_i...
mit
songmonit/CTTMSONLINE
addons/account/account_financial_report.py
339
7636
# -*- 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
MachineLearningControl/OpenMLC-Python
MLC/GUI/Experiment/ArduinoConfigManager/test.py
1
2275
# -*- coding: utf-8 -*- # MLC (Machine Learning Control): A genetic algorithm library to solve chaotic problems # Copyright (C) 2015-2017, Thomas Duriez (thomas.duriez@gmail.com) # Copyright (C) 2015, Adrian Durán (adrianmdu@gmail.com) # Copyright (C) 2015-2017, Ezequiel Torres Feyuk (ezequiel.torresfeyuk@gmail.com) # ...
gpl-3.0
noseka1/ansible-modules-core
system/user.py
16
72414
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Stephen Fromm <sfromm@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 Lice...
gpl-3.0
SuYiling/chrome_depot_tools
testing_support/super_mox.py
25
5140
# Copyright (c) 2011 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. """Simplify unit tests based on pymox.""" import os import random import shutil import string import StringIO import subprocess import sys sys.path.app...
bsd-3-clause
jaesivsm/pyAggr3g470r
src/web/lib/article_cleaner.py
1
2011
from urllib.parse import urlparse, urlunparse, ParseResult from bs4 import BeautifulSoup from bootstrap import is_secure_served HTTPS_IFRAME_DOMAINS = ('vimeo.com', 'youtube.com', 'youtu.be') def clean_urls(article_content, article_link): parsed_article_url = urlparse(article_link) parsed_content = Beautiful...
agpl-3.0
daniponi/django
django/db/migrations/autodetector.py
5
56018
from __future__ import unicode_literals import datetime import re from itertools import chain from django.conf import settings from django.db import models from django.db.migrations import operations from django.db.migrations.migration import Migration from django.db.migrations.operations.models import AlterModelOpti...
bsd-3-clause
gmsn-ita/vaspirin
scripts/plot_compared_bands.py
2
6165
#!/usr/bin/env python3 import sys from vaspirin import outcar,graceIO,datIO import argparse ################################ ## PARSING AND HELLO MESSAGES ## ################################ def positive_int (value): ''' Type for allowing only positive int values for argparser taken from http://stackoverflow.com/...
gpl-3.0
incaser/project
__unported__/project_service_type/__openerp__.py
21
1886
# -*- coding: utf-8 -*- ############################################################################## # # @author Grand-Guillaume Joel # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsability of assessing all potential # consequences resulting from its even...
agpl-3.0