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
kittiu/odoo
addons/mrp_operations/report/mrp_code_barcode.py
381
1511
# -*- 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
Philmod/mongo-connector
mongo_connector/doc_managers/solr_doc_manager.py
8
11225
# Copyright 2013-2014 MongoDB, 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 writin...
apache-2.0
Srisai85/scipy
scipy/linalg/tests/test_lapack.py
28
17002
#!/usr/bin/env python # # Created by: Pearu Peterson, September 2002 # from __future__ import division, print_function, absolute_import from numpy.testing import TestCase, run_module_suite, assert_equal, \ assert_array_almost_equal, assert_, assert_raises, assert_allclose, \ assert_almost_equal import numpy ...
bsd-3-clause
edx/edx-analytics-dashboard
analytics_dashboard/learner_analytics_api/v0/views.py
1
6267
from requests.exceptions import ConnectTimeout from rest_framework.exceptions import PermissionDenied from rest_framework.generics import RetrieveAPIView from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response from .clients import LearnerAPIClient from .permissions import Ha...
agpl-3.0
schlueter/ansible
lib/ansible/modules/commands/telnet.py
33
2576
# this is a virtual module that is entirely implemented server side # 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...
gpl-3.0
wshallum/ansible
lib/ansible/modules/network/netvisor/pn_vrouterbgp.py
29
15078
#!/usr/bin/python """ PN-CLI vrouter-bgp-add/vrouter-bgp-remove/vrouter-bgp-modify """ # # 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
therandomcode/Fanalytics
lib/oauth2client/service_account.py
52
5038
# 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 applicable law or ...
apache-2.0
donald-pinckney/EM-Simulator
EM Sim/EM SimContent/Lib/lib2to3/pgen2/token.py
353
1244
#! /usr/bin/env python """Token constants (from "token.h").""" # Taken from Python (r53757) and modified to include some tokens # originally monkeypatched in by pgen2.tokenize #--start constants-- ENDMARKER = 0 NAME = 1 NUMBER = 2 STRING = 3 NEWLINE = 4 INDENT = 5 DEDENT = 6 LPAR = 7 RPAR = 8 LSQB = 9 RSQB = 10 C...
apache-2.0
wbinventor/openmc
openmc/data/kalbach_mann.py
1
14224
from collections.abc import Iterable from numbers import Real, Integral from warnings import warn import numpy as np import openmc.checkvalue as cv from openmc.stats import Tabular, Univariate, Discrete, Mixture from .function import Tabulated1D, INTERPOLATION_SCHEME from .angle_energy import AngleEnergy from .data i...
mit
bclau/nova
nova/tests/integrated/test_servers.py
8
19688
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apach...
apache-2.0
havard024/prego
sales/api/tests.py
3
17262
# encoding: utf-8 # Copyright 2011 Tree.io Limited # This file is part of Treeio. # License www.tree.io/license #-*- codeing: utf-8 -*- import json from django.test import TestCase from django.test.client import Client from django.core.urlresolvers import reverse from django.contrib.auth.models import User as DjangoU...
mit
iwoca/django-deep-collector
tests/test_serializer.py
1
1514
from copy import copy import json from django.test import TestCase from .factories import ChildModelFactory from deep_collector.compat.serializers import MultiModelInheritanceSerializer class TestMultiModelInheritanceSerializer(TestCase): def test_that_parent_model_fields_are_in_serializated_object_if_parent_is...
bsd-3-clause
garyjyao1/ansible
lib/ansible/plugins/connection/docker.py
15
8622
# Based on the chroot connection plugin by Maykel Moya # # Connection plugin for configuring docker containers # (c) 2014, Lorin Hochstein # (c) 2015, Leendert Brouwer # (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com> # # Maintainer: Leendert Brouwer (https://github.com/objectified) # # This file is part of Ansible #...
gpl-3.0
Achuth17/scikit-learn
examples/linear_model/plot_logistic.py
312
1426
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Logit function ========================================================= Show in the plot is how the logistic regression would, in this synthetic dataset, classify values as either 0 or 1, i.e. class one or two, u...
bsd-3-clause
c0defreak/python-for-android
python3-alpha/extra_modules/gdata/geo/__init__.py
45
6005
# -*-*- encoding: utf-8 -*-*- # # This is gdata.photos.geo, implementing geological positioning in gdata structures # # $Id: __init__.py 81 2007-10-03 14:41:42Z havard.gulldahl $ # # Copyright 2007 Håvard Gulldahl # Portions copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License");...
apache-2.0
ycaihua/kbengine
kbe/res/scripts/common/Lib/encodings/rot_13.py
155
2428
#!/usr/bin/env python """ Python Character Mapping Codec for ROT13. This codec de/encodes from str to str. Written by Marc-Andre Lemburg (mal@lemburg.com). """ import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self, input, errors='strict'): return (input.translate(rot13_map), len(input...
lgpl-3.0
woutersmet/Molmodsummer
lib/molmod/io/dlpoly.py
1
9363
# MolMod is a collection of molecular modelling tools for python. # Copyright (C) 2007 - 2008 Toon Verstraelen <Toon.Verstraelen@UGent.be> # # This file is part of MolMod. # # MolMod 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...
gpl-3.0
Empeeric/dirometer
django/views/csrf.py
289
3834
from django.http import HttpResponseForbidden from django.template import Context, Template from django.conf import settings # We include the template inline since we need to be able to reliably display # this error message, especially for the sake of developers, and there isn't any # other way of making it available ...
mit
lucalianas/openmicroscopy
components/tools/OmeroPy/src/omero/gateway/scripts/testdb_create.py
9
9835
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Library for gateway tests Copyright 2009 Glencoe Software, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt """ import omero from omero.rtypes import rstring from omero.gateway.scripts import dbhelpers dbhelpers.USERS = { ...
gpl-2.0
blacklin/kbengine
kbe/src/lib/python/Lib/test/test_pickle.py
72
4522
import pickle import io import collections from test import support from test.pickletester import AbstractPickleTests from test.pickletester import AbstractPickleModuleTests from test.pickletester import AbstractPersistentPicklerTests from test.pickletester import AbstractPicklerUnpicklerObjectTests from test.picklet...
lgpl-3.0
mottosso/pyblish-magenta
pyblish_magenta/vendor/cquery/vendor/nose/result.py
68
6711
""" Test Result ----------- Provides a TextTestResult that extends unittest's _TextTestResult to provide support for error classes (such as the builtin skip and deprecated classes), and hooks for plugins to take over or extend reporting. """ import logging try: # 2.7+ from unittest.runner import _TextTestResu...
lgpl-3.0
ivankelly/Rhythmbox-Spotify-Plugin
plugins/rb/__init__.py
2
3597
# -*- Mode: python; coding: utf-8; tab-width: 8; indent-tabs-mode: t; -*- # # Copyright 2006, James Livingston <doclivingston@gmail.com> # Copyright 2006, Ed Catmur <ed@catmur.co.uk> # Copyright 2007, Jonathan Matthew # # This program is free software; you can redistribute it and/or modify # it under the terms of the G...
gpl-2.0
Intel-bigdata/s3-tests
s3tests/functional/__init__.py
3
12312
import ConfigParser import boto.exception import boto.s3.connection import bunch import itertools import os import random import string from .utils import region_sync_meta s3 = bunch.Bunch() config = bunch.Bunch() targets = bunch.Bunch() # this will be assigned by setup() prefix = None calling_formats = dict( o...
mit
imtapps/django-imt-fork
django/db/backends/__init__.py
52
38612
from django.db.utils import DatabaseError try: from django.utils.six.moves import _thread as thread except ImportError: from django.utils.six.moves import _dummy_thread as thread from contextlib import contextmanager from django.conf import settings from django.db import DEFAULT_DB_ALIAS from django.db.backen...
bsd-3-clause
westinedu/newertrends
django/views/generic/date_based.py
246
14025
import datetime import time from django.template import loader, RequestContext from django.core.exceptions import ObjectDoesNotExist from django.core.xheaders import populate_xheaders from django.db.models.fields import DateTimeField from django.http import Http404, HttpResponse import warnings warnings.warn( 'Fu...
bsd-3-clause
keen99/SickRage
lib/github/CommitStatus.py
49
4721
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
gpl-3.0
xuweiliang/Codelibrary
novaclient/exceptions.py
1
8967
# Copyright 2010 Jacob Kaplan-Moss # # 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
QijunPan/ansible
lib/ansible/plugins/action/eos_config.py
7
1247
# # Copyright 2015 Peter Sprygada <psprygada@ansible.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...
gpl-3.0
ironbox360/django
tests/select_related_regress/models.py
282
3677
from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Building(models.Model): name = models.CharField(max_length=10) def __str__(self): return "Building: %s" % self.name @python_2_unicod...
bsd-3-clause
JackDanger/sentry
src/sentry/utils/versioning.py
6
1883
from __future__ import absolute_import import six from sentry.exceptions import InvalidConfiguration from sentry.utils import warnings class Version(tuple): def __str__(self): return '.'.join(map(six.binary_type, self)) def summarize(sequence, max=3): items = sequence[:max] remainder = len(seq...
bsd-3-clause
tildaslash/RatticWeb
cred/tests/test_ssh_key.py
7
2827
from django.test import TestCase from django.core.files import File from django.core.urlresolvers import reverse from django.test.utils import override_settings from ratticweb.tests.helper import TestData from cred.models import Cred, Group import os here = os.path.abspath(os.path.dirname(__file__)) ssh_keys = os.pa...
gpl-2.0
kinow-io/kinow-python-sdk
kinow_client/models/employees.py
1
3370
# coding: utf-8 """ Server API Reference for Server API (REST/Json) OpenAPI spec version: 1.4.41 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class Employees(object): """ NOTE: This class is auto g...
apache-2.0
mhvk/numpy
numpy/distutils/misc_util.py
5
86629
import os import re import sys import copy import glob import atexit import tempfile import subprocess import shutil import multiprocessing import textwrap import importlib.util from threading import local as tlocal import distutils from distutils.errors import DistutilsError # stores temporary directory of each thre...
bsd-3-clause
ChromiumWebApps/chromium
build/android/pylib/utils/test_options_parser.py
54
3471
# Copyright (c) 2012 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. """Parses options for the instrumentation tests.""" import os # TODO(gkanwar): Some downstream scripts current rely on these functions # existing. Thi...
bsd-3-clause
endlessm/chromium-browser
tools/site_compare/commands/timeload.py
189
4936
# 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. """SiteCompare command to time page loads Loads a series of URLs in a series of browsers (and browser versions) and measures how long the page takes to ...
bsd-3-clause
xuanzhui/SoochowOraWIFIPW
Python3/getFileSSORequests.py
1
2330
__author__ = 'xuanzhui' # http://docs.python-requests.org/en/latest/user/quickstart/ import requests, re def printDebugInfo(resp): print('respond status code : ', resp.status_code) print('respond cookies : ', resp.cookies) print('respond headers : ', resp.headers) print('respond content : ', resp.con...
apache-2.0
dongpinglai/my_tornado
tornado/test/util_test.py
5
9781
from io import StringIO import re import sys import datetime import unittest import tornado.escape from tornado.escape import utf8 from tornado.util import ( raise_exc_info, Configurable, exec_in, ArgReplacer, timedelta_to_seconds, import_object, re_unescape, is_finalizing, ) import ty...
apache-2.0
uni2u/neutron
neutron/extensions/multiprovidernet.py
18
4327
# Copyright (c) 2013 OpenStack Foundation. # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
apache-2.0
justathoughtor2/atomicApe
cygwin/lib/python2.7/site-packages/pylint/test/unittest_lint.py
3
27410
# Copyright (c) 2003-2014 LOGILAB S.A. (Paris, FRANCE). # 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...
gpl-3.0
teamblueridge/gerrit
tools/gitlog2asciidoc.py
22
3306
#!/usr/bin/python from optparse import OptionParser import re import subprocess import sys """ This script generates a release note from the output of git log between the specified tags. Options: --issues Show output the commits with issues associated with them. --issue-numbers Show outputs issue numbers o...
apache-2.0
prospwro/odoo
addons/l10n_multilang/__openerp__.py
339
1670
# -*- 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
afrolov1/nova
nova/tests/api/openstack/compute/test_versions.py
1
27566
# Copyright 2010-2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
apache-2.0
srivassumit/servo
etc/ci/performance/gecko_driver.py
42
3804
#!/usr/bin/env python3 # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from contextlib import contextmanager import json import os from selenium import webdriver from ...
mpl-2.0
odootr/odoo
addons/payment_paypal/models/res_company.py
422
1752
# -*- coding: utf-8 -*- from openerp.osv import fields, osv class ResCompany(osv.Model): _inherit = "res.company" def _get_paypal_account(self, cr, uid, ids, name, arg, context=None): Acquirer = self.pool['payment.acquirer'] company_id = self.pool['res.users'].browse(cr, uid, uid, context=co...
agpl-3.0
renanrodm/namebench
nb_third_party/dns/rdtypes/IN/NAPTR.py
248
4889
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
apache-2.0
dustymabe/ansible-modules-core
utilities/logic/async_wrapper.py
10
7027
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>, and others # # 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 ...
gpl-3.0
vikatory/kbengine
kbe/src/lib/python/Lib/test/test_tcl.py
68
24957
import unittest import sys import os from test import support # Skip this test if the _tkinter module wasn't built. _tkinter = support.import_module('_tkinter') # Make sure tkinter._fix runs to set up the environment tkinter = support.import_fresh_module('tkinter') from tkinter import Tcl from _tkinter import TclErr...
lgpl-3.0
haad/ansible-modules-extras
network/asa/asa_command.py
31
7099
#!/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
fduraffourg/servo
tests/wpt/css-tests/tools/pywebsocket/src/example/close_wsh.py
495
2835
# Copyright 2012, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
mpl-2.0
virtualnobi/MediaFiler
Model/MediaOrganization/testOrganizationByDate.py
1
3086
#!python # -*- coding: latin-1 -*- """ (c) by nobisoft 2016- """ # Imports ## Standard from __future__ import print_function import unittest import StringIO ## Contributed ## nobi ## Project #import Model.Installer # to resolve import sequence issues from OrganizationByDate import OrganizationByDate class TestOrg...
gpl-3.0
xpansa/stock-logistics-tracking
stock_packaging_usability_ul/wizard/__init__.py
1
1076
# -*- encoding: utf-8 -*- ############################################################################## # # Stock Packaging Usability UL module for Odoo # Copyright (C) 2014 Akretion (http://www.akretion.com) # @author Alexis de Lattre <alexis.delattre@akretion.com> # # This program is free software: you c...
agpl-3.0
mapleoin/cuZmeura
ads/migrations/0006_added_articles.py
3
8975
# -*- coding: utf-8 -*- from south.db import db from django.db import models from cuZmeura.ads.models import * class Migration: def forwards(self, orm): # Adding model 'Article' db.create_table('ads_article', ( ('id', orm['ads.article:id']), ('title', orm['ads...
agpl-3.0
mollstam/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/reportlab-3.2.0/demos/gadflypaper/gfe.py
15
32480
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details __doc__='' __version__=''' $Id$ ''' #REPORTLAB_TEST_SCRIPT import sys from reportlab.platypus import * from reportlab.lib.styles import getSampleStyleSheet from reportlab.rl_config import defaultPageSize PAGE_HEIGHT=defaultPageSize[1] sty...
mit
Plantain/sms-mailinglist
lib/googlecloudapis/resourceviews/v1beta1/resourceviews_v1beta1_messages.py
5
15478
"""Generated message classes for resourceviews version v1beta1. The Resource View API allows users to create and manage logical sets of Google Compute Engine instances. """ from protorpc import messages package = 'resourceviews' class Label(messages.Message): """The Label to be applied to the resource views. ...
apache-2.0
John-NY/overo-oe
contrib/opie/opie_checksum_rewrite.py
26
2820
#!/usr/bin/env python # ex:ts=4:sw=4:sts=4:et # Opie recipe checksum rewriter # # A crude script for rewriting recipes to contain checksum information # # Some portions copied from oe-source-checker.py, copyright (C) 2007 OpenedHand import os import sys def rewrite(recpfilename, sourcedir): insrc = False srcfirst ...
mit
ArcherSys/ArcherSys
entertainment/gheddobox/Lib/site-packages/_markerlib/markers.py
1769
3979
# -*- coding: utf-8 -*- """Interpret PEP 345 environment markers. EXPR [in|==|!=|not in] EXPR [or|and] ... where EXPR belongs to any of those: python_version = '%s.%s' % (sys.version_info[0], sys.version_info[1]) python_full_version = sys.version.split()[0] os.name = os.name sys.platform = sys.platfo...
mit
chrisidefix/devide.johannes
extra/soappy-cvp/bid/inventoryClient.py
8
9035
#!/usr/bin/env python import getopt import sys import string import re import time sys.path.insert(1,"..") from SOAPpy import SOAP import traceback DEFAULT_SERVERS_FILE = './inventory.servers' DEFAULT_METHODS = ('SimpleBuy', 'RequestForQuote','Buy','Ping') def usage (error = None): sys.stdout = sys.std...
bsd-3-clause
sjthespian/ISYlib-python
ISY/IsyNodeClass.py
2
21244
""" Devices controlled my the ISY are represented as "nodes" on the ISY device and with Node Objects in the API There are three types of Node Object: * IsyNode - Node Object Represent lights, switches, motion sensors * IsyScene - Scene Object Represents Scenes contains Nodes that comprise a "...
bsd-2-clause
victoryckl/zxing-2.2
cpp/scons/scons-local-2.0.0.final.0/SCons/Errors.py
34
7440
# # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation # # 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 li...
apache-2.0
fin-ger/alternative-toolbar
alttoolbar_repeat.py
1
16340
# This is a part of the external Repeat One Song plugin for Rhythmbox # # Author: Eduardo Mucelli Rezende Oliveira # E-mail: edumucelli@gmail.com or eduardom@dcc.ufmg.br # Version: 0.4 (Unstable) for Rhythmbox 3.0.1 or later # # # reworked for alternative-toolbar # Author: fossfreedom # # This program is free software:...
gpl-3.0
christer155/PTVS
Python/Tests/TestData/VirtualEnv/env/Lib/encodings/base64_codec.py
88
2417
""" Python 'base64_codec' Codec - base64 content transfer encoding Unlike most of the other codecs which target Unicode, this codec will return Python string objects for both encode and decode. Written by Marc-Andre Lemburg (mal@lemburg.com). """ import codecs, base64 ### Codec APIs def bas...
apache-2.0
edisonlz/fruit
web_project/base/site-packages/androguard/core/binaries/idapipe.py
7
6942
# This file is part of Androguard. # # Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr> # All rights reserved. # # Androguard is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of th...
apache-2.0
nlloyd/SubliminalCollaborator
libs/twisted/test/test_epoll.py
10
4326
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for epoll wrapper. """ import socket, errno, time from twisted.trial import unittest from twisted.python.util import untilConcludes try: from twisted.python import _epoll except ImportError: _epoll = None class EPoll(unittes...
apache-2.0
tj93/pymtl
accel/strsearch/StrSearchFunc_test.py
7
1324
#========================================================================= # StrSearchFunc_test.py #========================================================================= # # PyMTL Functional Model of strsearch. from pymtl import * from StrSearchOO_test import strings, docs, reference #---------------------...
bsd-3-clause
shoyer/numpy
numpy/distutils/line_endings.py
6
2085
""" Functions for converting from DOS to UNIX line endings """ from __future__ import division, absolute_import, print_function import sys, re, os def dos2unix(file): "Replace CRLF with LF in argument files. Print names of changed files." if os.path.isdir(file): print(file, "Directory!") ret...
bsd-3-clause
ilendl2/wagtail-cookiecutter-foundation
{{cookiecutter.project_slug}}/products/migrations/0008_auto_20180607_1804.py
2
1109
# Generated by Django 2.0 on 2018-06-07 18:04 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('products', '0007_productindexpage_feed_image'), ] operations = [ migrations.AlterField( model_nam...
mit
claws/txBOM
setup.py
1
1666
#!/usr/bin/env python """ A distutils installation script for txBOM. """ from distutils.core import setup import txbom long_description = """txBOM is a Python Twisted package that lets you retrieve forecasts and observations from the Australian Bureau of Meteorology (BOM). Use it to integrate non blocking retrieva...
mit
Threak/easyrel
getfav.py
1
3507
#!/usr/bin/env python2 # -*- coding: utf-8 -*- import os import os.path import oauth2 as oauth import json from font_colors import font_colors import getrel import setfav import time from torrentApi import torrent_api as api #name of config file where all keys get stored config = '~/.config/getrel/getrel.json' nzb_pa...
mit
Forage/Gramps
gramps/gen/plug/docgen/graphdoc.py
1
41769
# -*- coding: utf-8 -*- #!/usr/bin/env python # # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2002 Gary Shao # Copyright (C) 2007 Brian G. Matherly # Copyright (C) 2009 Benny Malengier # Copyright (C) 2009 Gary Burton # # This pr...
gpl-2.0
SmithsonianEnterprises/django-cms
cms/tests/test_permissions.py
50
3054
# -*- coding: utf-8 -*- from django.contrib.sites.models import Site from django.test.utils import override_settings from cms.models import Page from cms.api import create_page, assign_user_to_page from cms.cache.permissions import (get_permission_cache, set_permission_cache, clear_u...
bsd-3-clause
jrwdunham/old
onlinelinguisticdatabase/tests/functional/test_phonologybackups.py
1
8705
# Copyright 2016 Joel Dunham # # 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 writi...
apache-2.0
hmightypirate/guided-backprop-chainerrl
examples/mygym/guided_relu.py
1
2720
import numpy import chainer from chainer import cuda from chainer import function from chainer import utils from chainer.utils import type_check if cuda.cudnn_enabled: cudnn = cuda.cudnn _mode = cudnn.cudnn.CUDNN_ACTIVATION_RELU class GuidedReLU(function.Function): """Rectified Linear Unit.""" # T...
apache-2.0
atmark-techno/atmark-dist
user/python/Lib/plat-irix5/TERMIOS.py
4
10049
# Generated by h2py from /usr/include/sys/termios.h # Included from sys/ttydev.h B0 = 0 B50 = 0000001 B75 = 0000002 B110 = 0000003 B134 = 0000004 B150 = 0000005 B200 = 0000006 B300 = 0000007 B600 = 0000010 B1200 = 0000011 B1800 = 0000012 B2400 = 0000013 B4800 = 0000014 B9600 = 0000015 B19200 = 0000016 EXTA = 0000016 B...
gpl-2.0
goldmedal/spark
python/pyspark/sql/tests/test_group.py
21
1831
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.3.0/Lib/test/list_tests.py
106
17676
""" Tests common to list and UserList.UserList """ import sys import os from functools import cmp_to_key from test import support, seq_tests class CommonTest(seq_tests.CommonTest): def test_init(self): # Iterable arg is optional self.assertEqual(self.type2test([]), self.type2test()) # ...
mit
vbshah1992/microblog
flask/lib/python2.7/site-packages/markupsafe/_native.py
1243
1187
# -*- coding: utf-8 -*- """ markupsafe._native ~~~~~~~~~~~~~~~~~~ Native Python implementation the C module is not compiled. :copyright: (c) 2010 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from markupsafe import Markup from markupsafe._compat import text_type def escape(...
bsd-3-clause
bowang/tensorflow
tensorflow/python/ops/nn_fused_batchnorm_test.py
5
14553
# 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
Venturi/cms
env/lib/python2.7/site-packages/cms/cms_plugins.py
46
4350
# -*- coding: utf-8 -*- from cms.models import CMSPlugin, Placeholder from cms.models.aliaspluginmodel import AliasPluginModel from cms.models.placeholderpluginmodel import PlaceholderReference from cms.plugin_base import CMSPluginBase, PluginMenuItem from cms.plugin_pool import plugin_pool from cms.plugin_rendering im...
gpl-2.0
thedrow/samsa
pykafka/connection.py
2
4337
from __future__ import division """ Author: Keith Bourgoin, Emmett Butler """ __license__ = """ Copyright 2015 Parse.ly, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.o...
apache-2.0
massmutual/scikit-learn
examples/manifold/plot_compare_methods.py
259
4031
""" ========================================= Comparison of Manifold Learning methods ========================================= An illustration of dimensionality reduction on the S-curve dataset with various manifold learning methods. For a discussion and comparison of these algorithms, see the :ref:`manifold module...
bsd-3-clause
ddico/odoo
addons/website/models/website_visitor.py
1
13772
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from datetime import datetime, timedelta import uuid from odoo import fields, models, api, registry, _ from odoo.addons.base.models.res_partner import _tz_get from odoo.exceptions import UserError from odoo.tools.misc i...
agpl-3.0
404d/Temporals-Web
temporals_web/migration/versions/201508070005_1d84b7d16aa9_add_principal_group_system.py
1
1285
"""Add principal group system Revision ID: 1d84b7d16aa9 Revises: 179651effcbd Create Date: 2015-08-07 00:05:42.996683 """ # revision identifiers, used by Alembic. revision = '1d84b7d16aa9' down_revision = '179651effcbd' from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql def u...
mit
Andrei-Stepanov/avocado-vt
virttest/libvirt_xml/devices/serial.py
22
2004
""" Classes to support XML for serial devices http://libvirt.org/formatdomain.html#elementCharSerial """ from virttest.libvirt_xml import base, accessors, xcepts from virttest.libvirt_xml.devices.character import CharacterBase class Serial(CharacterBase): __slots__ = ('protocol_type', 'target_port', 'target_ty...
gpl-2.0
Kast0rTr0y/ansible
lib/ansible/galaxy/api.py
12
11035
#!/usr/bin/env python ######################################################################## # # (C) 2013, James Cammarata <jcammarata@ansible.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 ...
gpl-3.0
Distrotech/dia
plug-ins/python/otypes.py
10
5934
# PyDia Self Documentation Series - Part II : Object Types # Copyright (c) 2003, Hans Breuer <hans@breuer.org> # # generates a new diagram which contains all the currently # registered object types sorted by their containing package # # This program is free software; you can redistribute it and/or m...
gpl-2.0
danluu/BitFunnel
NativeJIT/googletest/googletest/test/gtest_help_test.py
2968
5856
#!/usr/bin/env python # # Copyright 2009, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
mit
chrismeyersfsu/ansible
lib/ansible/modules/system/lvg.py
23
9903
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Alexander Bulimov <lazywolf0@gmail.com> # based on lvol module by Jeroen Hoekx <jeroen.hoekx@dsquare.be> # # 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 p...
gpl-3.0
Celthi/youtube-dl-GUI
youtube_dl/extractor/foxgay.py
146
1735
from __future__ import unicode_literals from .common import InfoExtractor class FoxgayIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?foxgay\.com/videos/(?:\S+-)?(?P<id>\d+)\.shtml' _TEST = { 'url': 'http://foxgay.com/videos/fuck-turkish-style-2582.shtml', 'md5': '80d72beab5d04e1655a56ad37...
mit
myerpengine/odoo
addons/base_report_designer/plugin/openerp_report_designer/bin/script/Change.py
90
4696
######################################################################### # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gene...
agpl-3.0
SteveHNH/ansible
lib/ansible/modules/network/vyos/vyos_banner.py
15
5123
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # # This file is part of Ansible by Red Hat # # 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
jasmas/DiscoNet
DiscoNet/_platform_detect.py
1
1264
import sys, os from subprocess import call as subcall class Detect(): doc_path = '' icon = '' def open_method(filename): pass def resource_path(relative_path): """ Get absolute path to resource, works for dev and for PyInstaller """ try: # PyInstaller creates a temp folder and sto...
mit
samuelhavron/heroku-buildpack-python
Python-3.4.3/Lib/test/test_dictcomps.py
121
3782
import unittest from test import support # For scope testing. g = "Global variable" class DictComprehensionTest(unittest.TestCase): def test_basics(self): expected = {0: 10, 1: 11, 2: 12, 3: 13, 4: 14, 5: 15, 6: 16, 7: 17, 8: 18, 9: 19} actual = {k: k + 10 for k in range(10)...
mit
marcoitur/Freecad_test
src/Mod/Ship/shipUtils/Units.py
17
3605
#*************************************************************************** #* * #* Copyright (c) 2011, 2012 * #* Jose Luis Cercos Pita <jlcercos@gmail.com> * #* ...
lgpl-2.1
ruuk/script.module.youtube.dl
lib/youtube_dl/extractor/twentyfourvideo.py
11
4756
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( parse_iso8601, int_or_none, xpath_attr, xpath_element, ) class TwentyFourVideoIE(InfoExtractor): IE_NAME = '24video' _VALID_URL = r'''(?x) https?:// ...
gpl-2.0
joshua-cogliati-inl/moose
framework/contrib/nsiqcppstyle/nsiqcppstyle_state.py
43
3572
# Copyright (c) 2009 NHN Inc. All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the follow...
lgpl-2.1
dmitriy0611/django
tests/migrations/test_operations.py
64
93154
from __future__ import unicode_literals import unittest from django.db import connection, migrations, models, transaction from django.db.migrations.migration import Migration from django.db.migrations.state import ProjectState from django.db.models.fields import NOT_PROVIDED from django.db.transaction import atomic f...
bsd-3-clause
Changaco/oh-mainline
vendor/packages/gdata/tests/gdata_tests/calendar_resource/data_test.py
41
3292
#!/usr/bin/python # # Copyright (C) 2008 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 ...
agpl-3.0
flavour/eden
modules/templates/SHARE/config.py
1
118243
# -*- coding: utf-8 -*- from collections import OrderedDict from gluon import current, URL from gluon.storage import Storage from s3 import S3ReportRepresent def config(settings): """ Settings for the SHARE Template Migration Issues: req_need.name is now length=64 (SHARE...
mit
josherick/bokeh
bokeh/resources.py
26
9535
''' The resources module provides the Resources class for easily configuring how BokehJS code and CSS resources should be located, loaded, and embedded in Bokeh documents. Also provides some pre-configured Resources objects: Attributes: CDN : load minified BokehJS from CDN INLINE : provide minified BokehJS fr...
bsd-3-clause
zenodo/invenio
invenio/modules/submit/models.py
5
17359
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2011, 2012 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any...
gpl-2.0