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
sideffect0/django-tastypie
tests/basic/tests/resources.py
18
6405
from django.contrib.auth.models import User from django.http import HttpRequest from tastypie.bundle import Bundle from tastypie.fields import ToOneField, ToManyField from tastypie.resources import ModelResource from basic.api.resources import SlugBasedNoteResource from basic.models import Note, AnnotatedNote, SlugBase...
bsd-3-clause
claudep/translate
translate/storage/qph.py
1
5142
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2008, 2010 Zuza Software Foundation # # This file is part of translate. # # translate is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version ...
gpl-2.0
GoogleCloudPlatform/python-compat-runtime
appengine-compat/exported_appengine_sdk/google/appengine/ext/vmruntime/callback.py
1
1501
#!/usr/bin/env python # # Copyright 2007 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 o...
apache-2.0
blacktear23/django
django/contrib/localflavor/sk/forms.py
344
1439
""" Slovak-specific form helpers """ from django.forms.fields import Select, RegexField from django.utils.translation import ugettext_lazy as _ class SKRegionSelect(Select): """ A select widget widget with list of Slovak regions as choices. """ def __init__(self, attrs=None): from sk_regions i...
bsd-3-clause
fedorpatlin/ansible
lib/ansible/plugins/action/dellos9_config.py
113
4229
# # Copyright 2015 Peter Sprygada <psprygada@ansible.com> # # Copyright (c) 2017 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 version 3 of the L...
gpl-3.0
mobo95/pyload
module/lib/beaker/ext/google.py
45
4014
import cPickle import logging from datetime import datetime from beaker.container import OpenResourceNamespaceManager, Container from beaker.exceptions import InvalidCacheBackendError from beaker.synchronization import null_synchronizer log = logging.getLogger(__name__) db = None class GoogleNamespaceManager(OpenRe...
gpl-3.0
wujiku/EVO-3D-
scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
RydrDojo/Ridr
pylotVenv/lib/python2.7/site-packages/requests/packages/urllib3/connection.py
511
11617
from __future__ import absolute_import import datetime import logging import os import sys import socket from socket import error as SocketError, timeout as SocketTimeout import warnings from .packages import six try: # Python 3 from http.client import HTTPConnection as _HTTPConnection from http.client import...
mit
zhaohuaw/stock-logistics-warehouse
stock_reserve_sale/model/sale.py
12
9020
# -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier # Copyright 2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pu...
agpl-3.0
StackStorm/st2
st2actions/tests/unit/test_scheduler_entrypoint.py
3
3179
# Copyright 2020 The StackStorm Authors. # Copyright 2019 Extreme Networks, 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 ...
apache-2.0
dexigner/chrome-app-samples
samples/push-guestbook/guestbook-srv/third_party/oauth2client/appengine.py
26
22703
# Copyright (C) 2010 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 or agreed to in writ...
apache-2.0
darkleons/lama
addons/crm/report/crm_lead_report.py
309
5123
# -*- 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
onceuponatimeforever/oh-mainline
vendor/packages/twisted/twisted/python/test/test_fakepwd.py
18
7525
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.python.fakepwd}. """ try: import pwd except ImportError: pwd = None from operator import getitem from twisted.trial.unittest import TestCase from twisted.python.fakepwd import UserDatabase from twisted.python.co...
agpl-3.0
illicitonion/givabit
lib/sdks/google_appengine_1.7.1/google_appengine/google/appengine/ext/search/__init__.py
15
15419
#!/usr/bin/env python # # Copyright 2007 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 o...
apache-2.0
xq262144/hue
desktop/core/ext-py/BabelDjango-0.2.2/babeldjango/templatetags/babel.py
42
2171
# -*- coding: utf-8 -*- # # Copyright (C) 2007 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://babel.edgewall.org/wiki/License. # # This software consists of v...
apache-2.0
lunixbochs/actualvim
lib/asyncio/protocols.py
43
4512
"""Abstract Protocol class.""" __all__ = ['BaseProtocol', 'Protocol', 'DatagramProtocol', 'SubprocessProtocol'] class BaseProtocol: """Common base class for protocol interfaces. Usually user implements protocols that derived from BaseProtocol like Protocol or ProcessProtocol. The only ca...
mit
teamfx/openjfx-9-dev-rt
modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/port/gtk.py
1
10425
# Copyright (C) 2010 Google Inc. All rights reserved. # Copyright (C) 2013 Samsung Electronics. 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 retai...
gpl-2.0
Foxfanmedium/python_training
OnlineCoursera/mail_ru/Python_1/env/Lib/site-packages/simplegeneric.py
22
2740
__all__ = ["generic"] try: from types import ClassType, InstanceType classtypes = type, ClassType except ImportError: classtypes = type InstanceType = None def generic(func): """Create a simple generic function""" _sentinel = object() def _by_class(*args, **kw): cls = args[0].__cl...
apache-2.0
RuanJG/paparazzi
sw/lib/python/settings_xml_parse.py
32
5181
#!/usr/bin/env python from __future__ import absolute_import, print_function import os import sys from lxml import etree # if PAPARAZZI_HOME not set, then assume the tree containing this # file is a reasonable substitute PPRZ_HOME = os.getenv("PAPARAZZI_HOME", os.path.normpath(os.path.join(os.path.dirname(os.path.ab...
gpl-2.0
Syrcon/servo
tests/wpt/harness/wptrunner/wptmanifest/node.py
190
4304
# 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/. class NodeVisitor(object): def visit(self, node): # This is ugly as hell, but we don't have multimethods and...
mpl-2.0
patilsangram/erpnext
erpnext/patches/v6_0/multi_currency.py
79
2101
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe def execute(): # Reload doctype for dt in ("Account", "GL Entry", "Journal Entry", "Journal Entry Account", "Sales Invoice", "Purc...
gpl-3.0
anatol/namcap
Namcap/rules/invalidstartdir.py
4
1379
# # namcap rules - invalidstartdir # Copyright (C) 2003-2009 Jason Chu <jason@archlinux.org> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at...
gpl-2.0
nichung/wwwflaskBlogrevA
env/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py
96
2156
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. import os import sys from gunicorn.errors import ConfigError from gunicorn.app.base import Application from gunicorn import util class WSGIApplication(Application): def init(self, parse...
mit
x684867/nemesis
src/node/deps/v8/tools/testrunner/server/presence_handler.py
123
4443
# Copyright 2012 the V8 project authors. All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditi...
mit
nasa/RHEAS
src/datasets/iri.py
1
11845
""" RHEAS module for retrieving meteorological forecasts/hindcasts from the IRI FD Seasonal Forecast Tercile Probabilities. .. module:: iri :synopsis: Retrieve IRI meteorological forecast data .. moduleauthor:: Kostas Andreadis <kandread@jpl.nasa.gov> """ import datasets import dbio import netCDF4 as netcdf impo...
mit
zhreshold/mxnet
example/extensions/lib_subgraph/test_subgraph.py
1
5616
#!/usr/bin/env python3 # 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
Zopieux/django-blog-zinnia
zinnia/admin/filters.py
2
1986
"""Filters for Zinnia admin""" from django.contrib.admin import SimpleListFilter from django.db.models import Count from django.utils.encoding import smart_text from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy from zinnia.models.author import Author from zinni...
bsd-3-clause
hkchenhongyi/django
django/contrib/auth/management/__init__.py
348
6851
""" Creates permissions for all installed apps that need permissions. """ from __future__ import unicode_literals import getpass import unicodedata from django.apps import apps from django.contrib.auth import get_permission_codename from django.core import exceptions from django.core.management.base import CommandErr...
bsd-3-clause
yuyuyu101/VirtualBox-NetBSD
src/VBox/HostServices/SharedOpenGL/crserverlib/server_dispatch_header.py
8
1090
# Copyright (c) 2001, Stanford University # All rights reserved. # # See the file LICENSE.txt for information on redistributing this software. import sys import apiutil apiutil.CopyrightC() print """ /* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED BY server_dispatch_header.py SCRIPT */ #ifndef SERVER_DISPATCH_HE...
gpl-2.0
akubera/AliPhysics
PWGJE/EMCALJetTasks/Tracks/analysis/util/PtReachCalculation.py
41
2266
#************************************************************************** #* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. * #* * #* Author: The ALICE Off-line Project. * #* Contributors ...
bsd-3-clause
HaydenFaulkner/phd
processing/datasets/tennis/points_pckl_writer.py
1
1146
import pickle sents_path = '/media/hayden/UStorage/DATASETS/VIDEO/TENNIS/COMMENTARY/ALIGNED/CLASSES/Point/001' sents_files = ['/sents_test_lc_nopunc.txt', '/sents_val_lc_nopunc.txt', '/sents_train_lc_nopunc.txt'] sents = {} for s in sents_files: with open(sents_path + s) as f: x = f.readlines() x = ...
mit
kemalakyol48/python-for-android
python3-alpha/python3-src/Mac/Tools/Doc/HelpIndexingTool/Standard_Suite.py
48
10928
"""Suite Standard Suite: Common terms for most applications Level 1, version 1 Generated from /Developer/Applications/Apple Help Indexing Tool.app AETE/AEUT resource version 1/1, language 0, script 0 """ import aetools import MacOS _code = 'CoRe' from StdSuites.Standard_Suite import * class Standard_Suite_Events(St...
apache-2.0
louisLouL/pair_trading
capstone_env/lib/python3.6/site-packages/pip/commands/show.py
344
5891
from __future__ import absolute_import from email.parser import FeedParser import logging import os from pip.basecommand import Command from pip.status_codes import SUCCESS, ERROR from pip._vendor import pkg_resources from pip._vendor.packaging.utils import canonicalize_name logger = logging.getLogger(__name__) c...
mit
casanovainformationservices/LazyLibrarian
cherrypy/test/modwsgi.py
29
4832
"""Wrapper for mod_wsgi, for use as a CherryPy HTTP server. To autostart modwsgi, the "apache" executable or script must be on your system path, or you must override the global APACHE_PATH. On some platforms, "apache" may be called "apachectl" or "apache2ctl"-- create a symlink to them if needed. KNOWN BUGS ========...
gpl-3.0
dmr/Ldtools
ldtools/resource.py
1
6490
# -*- coding: utf-8 -*- import logging import rdflib from ldtools.metamodels import Manager, Model from ldtools.models import URIRefField, ObjectField from ldtools.utils import ( get_rdflib_uriref, get_slash_url, predicate2pyattr, urlparse ) logger = logging.getLogger(__name__) class ResourceManager...
bsd-2-clause
teserak/peewee
playhouse/tests/test_db_url.py
9
1494
from peewee import * from playhouse.db_url import connect, parse from playhouse.sqlite_ext import SqliteExtDatabase from playhouse.tests.base import PeeweeTestCase class TestDBURL(PeeweeTestCase): def test_db_url_parse(self): cfg = parse('mysql://usr:pwd@hst:123/db') self.assertEqual(cfg['user'], ...
mit
RAtechntukan/CouchPotatoServer
libs/requests/packages/urllib3/poolmanager.py
550
8977
# urllib3/poolmanager.py # Copyright 2008-2014 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import logging try: # Python 3 from urllib.parse import urljoin except ImportError: ...
gpl-3.0
drodri/common
utils/file_utils.py
5
5220
import os import fnmatch import re from biicode.common.exception import BiiException from biicode.common.model.blob import Blob from biicode.common.utils.bii_logging import logger def save_blob_if_modified(path, blob): '''save the file, but avoid touching it if the contents have not been modified. Useful e.g....
mit
tillschumann/nest-simulator
pynest/nest/tests/test_stdp_triplet_synapse.py
17
12675
# -*- coding: utf-8 -*- # # test_stdp_triplet_synapse.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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
ChanChiChoi/scikit-learn
examples/applications/svm_gui.py
287
11161
""" ========== Libsvm GUI ========== A simple graphical frontend for Libsvm mainly intended for didactic purposes. You can create data points by point and click and visualize the decision region induced by different kernels and parameter settings. To create positive examples click the left mouse button; to create neg...
bsd-3-clause
BenediktS/three.js
utils/exporters/blender/addons/io_three/exporter/api/material.py
124
7818
from bpy import data, types from .. import constants, logger from .constants import MULTIPLY, WIRE, IMAGE def _material(func): """ :param func: """ def inner(name, *args, **kwargs): """ :param name: :param *args: :param **kwargs: """ if isinstance(...
mit
renatofilho/python-oauth2
oauth2/__init__.py
458
29044
""" The MIT License Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the ...
mit
darongliu/Lstm_Turing_LM
lstm-neural-turing-machines-lm/experiment_version/lstm+attention+pretrain+weight/theano_lstm/__init__.py
33
21617
""" Small Theano LSTM recurrent network module. @author: Jonathan Raiman @date: December 10th 2014 Implements most of the great things that came out in 2014 concerning recurrent neural networks, and some good optimizers for these types of networks. Note (from 5 January 2015): Dropout api is a bit sophisticated due t...
mit
xifle/home-assistant
homeassistant/components/sensor/zigbee.py
14
2714
""" Support for functionality to use a ZigBee device as a sensor. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.zigbee/ """ import logging from binascii import hexlify import voluptuous as vol from homeassistant.components import zigbee from ho...
mit
JakeBrand/CMPUT410-E6
v1/lib/python2.7/site-packages/django/contrib/admin/widgets.py
61
13685
""" Form Widget classes specific to the Django admin site. """ from __future__ import unicode_literals import copy from django import forms from django.contrib.admin.templatetags.admin_static import static from django.core.urlresolvers import reverse from django.forms.widgets import RadioFieldRenderer from django.for...
apache-2.0
bak1an/django
tests/foreign_object/test_empty_join.py
22
1488
from django.test import TestCase from .models import SlugPage class RestrictedConditionsTests(TestCase): def setUp(self): slugs = [ 'a', 'a/a', 'a/b', 'a/b/a', 'x', 'x/y/z', ] SlugPage.objects.bulk_create([SlugPage(sl...
bsd-3-clause
spthaolt/VTK
Examples/Infovis/Python/variance.py
8
1345
from vtk import * from numeric import * # Define script parameters numbvert = 20 edgeprob = 0.50 # Create a random graph rgsource = vtkRandomGraphSource() degree = vtkVertexDegree() # Set number of vertices and the probability of an edge existing between any two vertices rgsource.SetNumberOfVertices(numbvert) rg...
bsd-3-clause
gangadhar-kadam/church-erpnext
stock/doctype/item/item.py
5
11976
# ERPNext - web based ERP (http://erpnext.com) # Copyright (C) 2012 Web Notes Technologies Pvt Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at yo...
agpl-3.0
zaina/nova
nova/tests/unit/api/openstack/compute/contrib/test_floating_ips.py
30
37450
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # Copyright 2011 Eldar Nugaev # 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://...
apache-2.0
saamrenton/GMBI
Utilities/sensitivity.py
1
6422
#A General Model of Biological Invasion (GMBI) #Copyright (C) 2012 David Savage and Michael Renton #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 #any later v...
gpl-3.0
adrset/kernel
tools/perf/scripts/python/netdev-times.py
11271
15048
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
gpl-2.0
tttthemanCorp/CardmeleonAppEngine
django/core/mail/backends/base.py
660
1164
"""Base email backend class.""" class BaseEmailBackend(object): """ Base class for email backend implementations. Subclasses must at least overwrite send_messages(). """ def __init__(self, fail_silently=False, **kwargs): self.fail_silently = fail_silently def open(self): """Op...
bsd-3-clause
gs0510/coala-bears
bears/vhdl/VHDLLintBear.py
11
1876
from shutil import which from coalib.bearlib.abstractions.Linter import linter @linter(executable='perl', output_format='regex', output_regex=r'.+:(?P<line>\d+):(?P<severity>.*) - (?P<message>.*)') class VHDLLintBear: """ Check VHDL code for common codestyle problems. Rules include: ...
agpl-3.0
sneaker-rohit/PI2-ns-3
src/bridge/bindings/modulegen__gcc_ILP32.py
38
201909
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)) ...
gpl-2.0
UnrememberMe/pants
contrib/jax_ws/tests/python/pants_test/contrib/jax_ws/tasks/test_jax_ws_gen_integration.py
6
4065
# coding=utf-8 # Copyright 2017 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os from conte...
apache-2.0
rubencabrera/odoo
addons/hr_expense/report/hr_expense_report.py
287
5652
# -*- 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
szaher/freezer-api
freezer_api/storage/elasticv2.py
1
24825
""" Copyright 2015 Hewlett-Packard 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, softwar...
apache-2.0
thisissoon/Flask-Store
docs/_themes/flask_theme_support.py
2228
4875
# flasky extensions. flasky pygments style based on tango style from pygments.style import Style from pygments.token import Keyword, Name, Comment, String, Error, \ Number, Operator, Generic, Whitespace, Punctuation, Other, Literal class FlaskyStyle(Style): background_color = "#f8f8f8" default_style = "...
mit
matmutant/sl4a
python/src/Demo/classes/Dbm.py
42
1574
# A wrapper around the (optional) built-in class dbm, supporting keys # and values of almost any type instead of just string. # (Actually, this works only for keys and values that can be read back # correctly after being converted to a string.) class Dbm: def __init__(self, filename, mode, perm): import ...
apache-2.0
AsherYang/ThreeLine
server/ffstore/handler/GetHomeDiscoverListHandler.py
1
2178
#!/usr/bin/python # -*- coding: utf-8 -*- """ Author: AsherYang Email : ouyangfan1991@gmail.com Date : 2018/6/29 Desc : get home discover list tornado handler api handler """ import sys sys.path.append('../') import tornado.web from BaseResponse import BaseResponse from constant import ResponseCode from FFStoreJson...
apache-2.0
shsingh/ansible
lib/ansible/modules/crypto/openssl_privatekey_info.py
8
27482
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2016-2017, Yanis Guenane <yanis+ansible@guenane.org> # Copyright: (c) 2017, Markus Teufelberger <mteufelberger+ansible@mgit.at> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import...
gpl-3.0
ptoraskar/django
tests/template_tests/syntax_tests/test_width_ratio.py
342
6095
from django.template import TemplateSyntaxError from django.test import SimpleTestCase from django.utils import six from ..utils import setup class WidthRatioTagTests(SimpleTestCase): libraries = {'custom': 'template_tests.templatetags.custom'} @setup({'widthratio01': '{% widthratio a b 0 %}'}) def test...
bsd-3-clause
2015fallproject/2015fallcase1
static/Brython3.2.0-20150701-214155/Lib/test/unittests/test___all__.py
89
3951
import unittest from test import support import os import sys class NoAll(RuntimeError): pass class FailedImport(RuntimeError): pass class AllTest(unittest.TestCase): def check_all(self, modname): names = {} with support.check_warnings( (".* (module|package)", DeprecationWa...
agpl-3.0
miguelpalacio/python-for-android
python-modules/twisted/twisted/spread/pb.py
57
47156
# -*- test-case-name: twisted.test.test_pb -*- # Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Perspective Broker \"This isn\'t a professional opinion, but it's probably got enough internet to kill you.\" --glyph Introduction ============ This is a broker for proxies for and co...
apache-2.0
chand3040/cloud_that
common/lib/xmodule/xmodule/modulestore/tests/django_utils.py
21
16292
# encoding: utf-8 """ Modulestore configuration for test cases. """ import datetime import pytz from uuid import uuid4 from mock import patch from django.conf import settings from django.contrib.auth.models import User from django.test import TestCase from django.test.utils import override_settings from request_cache...
agpl-3.0
dren-dk/AfroGovernor
lufa-LUFA-140302/Bootloaders/HID/HostLoaderApp_Python/hid_bootloader_loader.py
18
4136
""" LUFA Library Copyright (C) Dean Camera, 2014. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org """ """ Front-end programmer for the LUFA HID class bootloader. Usage: python hid_bootloader_loader.py <Device> <Input>.hex Example: python hid_bootload...
apache-2.0
lidavidm/sympy
sympy/mpmath/functions/zeta.py
16
35983
from ..libmp.backend import xrange from .functions import defun, defun_wrapped, defun_static @defun def stieltjes(ctx, n, a=1): n = ctx.convert(n) a = ctx.convert(a) if n < 0: return ctx.bad_domain("Stieltjes constants defined for n >= 0") if hasattr(ctx, "stieltjes_cache"): stieltjes_c...
bsd-3-clause
mitya57/django
tests/file_storage/tests.py
15
38679
import os import shutil import sys import tempfile import threading import time import unittest from datetime import datetime, timedelta from io import StringIO from urllib.request import urlopen from django.core.cache import cache from django.core.exceptions import SuspiciousFileOperation, SuspiciousOperation from dj...
bsd-3-clause
xrmx/django
django/contrib/sites/managers.py
472
2132
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.core import checks from django.core.exceptions import FieldDoesNotExist from django.db import models class CurrentSiteManager(models.Manager): "Use this to limit objects to those associated with the curre...
bsd-3-clause
adrianholovaty/django
django/http/__init__.py
3
27382
from __future__ import absolute_import import datetime import os import re import sys import time import warnings from io import BytesIO from pprint import pformat from urllib import urlencode, quote from urlparse import urljoin, parse_qsl import Cookie # Some versions of Python 2.7 and later won't need this encodin...
bsd-3-clause
markovmodel/thermotools
thermotools/cset.py
1
22887
# This file is part of thermotools. # # Copyright 2015, 2016 Computational Molecular Biology Group, Freie Universitaet Berlin (GER) # # thermotools 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...
lgpl-3.0
DevOps4Networks/ansible
lib/ansible/playbook/role/include.py
97
1891
# (c) 2014 Michael DeHaan, <michael@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 later ve...
gpl-3.0
zentner-kyle/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/xhr_benchmark_handler.py
415
3944
# Copyright 2014 Google Inc. All rights reserved. # # Use of this source code is governed by a BSD-style # license that can be found in the COPYING file or at # https://developers.google.com/open-source/licenses/bsd from mod_pywebsocket import util class XHRBenchmarkHandler(object): def __init__(self, headers, ...
mpl-2.0
signed/intellij-community
python/lib/Lib/distutils/dep_util.py
85
3570
"""distutils.dep_util Utility functions for simple, timestamp-based dependency of files and groups of files; also, function based entirely on such timestamp dependency analysis.""" # This module should be kept compatible with Python 2.1. __revision__ = "$Id: dep_util.py 37828 2004-11-10 22:23:15Z loewis $" import o...
apache-2.0
airelil/pywinauto
examples/test_sakura.py
4
2728
# -*- coding: UTF-8 -*- # GUI Application automation and testing library # Copyright (C) 2006-2018 Mark Mc Mahon and Contributors # https://github.com/pywinauto/pywinauto/graphs/contributors # http://pywinauto.readthedocs.io/en/latest/credits.html # All rights reserved. # # Redistribution and use in source and ...
bsd-3-clause
v-legoff/pa-poc3
src/system/reccopy.py
1
2907
# Copyright (c) 2013 LE GOFF Vincent # 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 th...
bsd-3-clause
sdague/home-assistant
homeassistant/components/smartthings/fan.py
14
3074
"""Support for fans through the SmartThings cloud API.""" from typing import Optional, Sequence from pysmartthings import Capability from homeassistant.components.fan import ( SPEED_HIGH, SPEED_LOW, SPEED_MEDIUM, SPEED_OFF, SUPPORT_SET_SPEED, FanEntity, ) from . import SmartThingsEntity from ...
apache-2.0
portfors-lab/sparkle
sparkle/run/chart_runner.py
2
1540
from sparkle.acq.players import ContinuousPlayer from sparkle.run.list_runner import ListAcquisitionRunner from sparkle.tools.util import increment_title class ChartRunner(ListAcquisitionRunner): def __init__(self, signals): super(ChartRunner, self).__init__(signals) self.chart_name = 'chart_1' ...
gpl-3.0
shaneknapp/spark
python/pyspark/ml/regression.py
15
91559
# # 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
rotofly/odoo
addons/account_financial_report_webkit/wizard/partners_ledger_wizard.py
7
5823
# -*- encoding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi, Guewen Baconnier # Copyright Camptocamp SA 2011 # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public L...
agpl-3.0
hogarthww/tinydav-fork
test/TestException.py
1
1591
# Unittests for exception module. # Copyright (C) 2009 Manuel Hermann <manuel-hermann@gmx.net> # # This file is part of tinydav. # # tinydav 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 versi...
gpl-3.0
wachub/googletest
test/gtest_catch_exceptions_test.py
2139
9901
#!/usr/bin/env python # # Copyright 2010 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 o...
bsd-3-clause
hujiajie/chromium-crosswalk
third_party/WebKit/Tools/Scripts/webkitpy/tool/steps/confirmdiff.py
46
3273
# Copyright (C) 2010 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 ...
bsd-3-clause
clebergnu/avocado-vt
virttest/libvirt_xml/nwfilter_binding.py
7
3553
""" Module simplifying manipulation of XML described at http://libvirt.org/formatnwfilter.html """ from virttest.libvirt_xml import base, accessors from virttest.libvirt_xml.devices.filterref import Filterref class NwfilterBinding(base.LibvirtXMLBase): """ Accessor methods for NwfilterXML class simple ex...
gpl-2.0
BiaDarkia/scikit-learn
examples/plot_missing_values.py
1
5117
""" ==================================================== Imputing missing values before building an estimator ==================================================== Missing values can be replaced by the mean, the median or the most frequent value using the basic ``SimpleImputer``. The median is a more robust estimator f...
bsd-3-clause
vrenaville/report-print-send
base_report_to_printer/report_xml_action.py
11
2241
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2007 Ferran Pegueroles <ferran@pegueroles.com> # Copyright (c) 2009 Albert Cervera i Areny <albert@nan-tic.com> # Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>) # ...
agpl-3.0
highweb-project/highweb-webcl-html5spec
chrome/test/ispy/common/mock_cloud_bucket.py
122
1637
# 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. """Subclass of CloudBucket used for testing.""" import os import sys sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)) import ...
bsd-3-clause
armersong/letsencrypt
letsencrypt-compatibility-test/letsencrypt_compatibility_test/test_driver.py
22
12158
"""Tests Let's Encrypt plugins against different server configurations.""" import argparse import filecmp import functools import logging import os import shutil import tempfile import time import OpenSSL from acme import challenges from acme import crypto_util from acme import messages from letsencrypt import achall...
apache-2.0
nkhuyu/zerorpc-python
tests/test_channel.py
18
4050
# -*- coding: utf-8 -*- # Open Source Initiative OSI - The MIT License (MIT):Licensing # # The MIT License (MIT) # Copyright (c) 2015 François-Xavier Bourlet (bombela+zerorpc@gmail.com) # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files...
mit
RossBrunton/django
tests/update/models.py
118
1132
""" Tests for the update() queryset method that allows in-place, multi-object updates. """ from django.db import models from django.utils import six from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class DataPoint(models.Model): name = models.CharField(max_length=20) ...
bsd-3-clause
CiviWiki/OpenCiviWiki
project/api/views/account.py
1
4217
from rest_framework.viewsets import ModelViewSet from rest_framework.decorators import action from rest_framework.response import Response from api.models import Thread, Account from api.serializers import ( ThreadSerializer, CategorySerializer, CiviSerializer, AccountSerializer, AccountListSeriali...
agpl-3.0
pararthshah/libavg-vaapi
src/python/utils.py
2
2182
# libavg - Media Playback Engine. # Copyright (C) 2003-2011 Ulrich von Zadow # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any l...
lgpl-2.1
dellysunnymtech/bitbake
lib/bb/fetch2/cvs.py
9
5770
# ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ BitBake 'Fetch' implementations Classes for obtaining upstream sources for the BitBake build tools. """ # Copyright (C) 2003, 2004 Chris Larson # # This program is free software; you can redistribute it and/or modify # it u...
gpl-2.0
modelbrouwers/django-sessionprofile
docs/conf.py
1
9314
# -*- coding: utf-8 -*- # # Django-Sessionprofile documentation build configuration file, created by # sphinx-quickstart on Thu Jun 4 19:58:18 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerat...
mit
Rcarter00/is210-week-04-warmup
tests/test_task_04.py
28
1434
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests Task 04.""" # Import Python libs import unittest import task_04 class Task04TestCase(unittest.TestCase): """Test cases for Task 04.""" testmap = { 'not_enough_litterboxes': [2, 1, True, True], 'plenty_of_litterboxes': [1, 2, True, False...
mpl-2.0
bswartz/manila
manila/share/drivers/ganesha/manager.py
1
22154
# Copyright (c) 2014 Red Hat, 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 require...
apache-2.0
clebergnu/autotest
client/virt/tests/guest_test.py
2
3051
import os, logging from autotest_lib.client.virt import virt_utils def run_guest_test(test, params, env): """ A wrapper for running customized tests in guests. 1) Log into a guest. 2) Run script. 3) Wait for script execution to complete. 4) Pass/fail according to exit status of script. @...
gpl-2.0
memsharded/conan
conans/test/unittests/client/generators/make_test.py
1
6056
import os import unittest from conans.client.generators import MakeGenerator from conans.model.build_info import CppInfo from conans.model.conan_file import ConanFile from conans.model.env_info import EnvValues from conans.model.ref import ConanFileReference from conans.model.settings import Settings from conans.test....
mit
artemh/asuswrt-merlin
release/src/router/samba36/source3/stf/smbcontrol.py
137
7998
#!/usr/bin/python # # Test for smbcontrol command line argument handling. # import comfychair class NoArgs(comfychair.TestCase): """Test no arguments produces usage message.""" def runtest(self): out = self.runcmd("smbcontrol", expectedResult = 1) self.assert_re_match("Usage: smbcontrol", out[...
gpl-2.0
timvideos/flumotion
tools/httpdigesthasher.py
3
1311
#!/usr/bin/python # -*- Mode: Python -*- # vi:si:et:sw=4:sts=4:ts=4 # Flumotion - a streaming media server # Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L. # Copyright (C) 2010,2011 Flumotion Services, S.A. # All rights reserved. # # This file may be distributed and/or modified under the terms of # the GNU ...
lgpl-2.1