repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
B3AU/waveTree
examples/ensemble/plot_bias_variance.py
6
7330
""" ============================================================ Single estimator versus bagging: bias-variance decomposition ============================================================ This example illustrates and compares the bias-variance decomposition of the expected mean squared error of a single estimator again...
bsd-3-clause
citrix-openstack/build-swift
test/unit/common/middleware/test_name_check.py
2
3399
# Copyright (c) 2012 OpenStack, LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
apache-2.0
zojoncj/cleanthehead
nsnitro/nsresources/nssslvserver.py
1
23417
from nsbaseresource import NSBaseResource __author__ = 'Aleksandar Topuzovic' class NSSSLVServer(NSBaseResource): def __init__(self, json_data=None): """ Supplied with json_data the object can be pre-filled """ super(NSSSLVServer, self).__init__(...
apache-2.0
sawyerlin/SEL
SEL.Service/node_modules/restify/node_modules/bunyan/tools/cutarelease.py
171
22043
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2009-2012 Trent Mick """cutarelease -- Cut a release of your project. A script that will help cut a release for a git-based project that follows a few conventions. It'll update your changelog (CHANGES.md), add a git tag, push those changes, update your ver...
apache-2.0
Oweoqi/metagoofil
hachoir_parser/game/blp.py
86
11088
""" Blizzard BLP Image File Parser Author: Robert Xiao Creation date: July 10 2007 - BLP1 File Format http://magos.thejefffiles.com/War3ModelEditor/MagosBlpFormat.txt - BLP2 File Format (Wikipedia) http://en.wikipedia.org/wiki/.BLP - S3TC (DXT1, 3, 5) Formats http://en.wikipedia.org/wiki/S3_Texture_Compression ...
gpl-2.0
AlmostBetterNetwork/pinecast
assets/migrations/0008_auto_20171202_2118.py
3
1477
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-12-02 21:18 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('assets', '0007_auto_20171202...
apache-2.0
amarzavery/AutoRest
src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/auto_rest_http_infrastructure_test_service/operations/http_redirects_operations.py
14
27015
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
benvcarr/algorithms_course
hw2/carr-hw2.py
1
5854
#!/usr/bin/python """ Benjamin Carr Homework #2 - MPCS 55001 Answers: (1) Program below. (2) My program is correct for all cases where both the numbers and the distances from the median are unique. I spent a lot of time (30+ hrs) trying to figure out other ways of doing this other than using a dictio...
apache-2.0
anirudhSK/chromium
chrome/test/functional/perf.py
3
96325
#!/usr/bin/env python # 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. """Basic pyauto performance tests. For tests that need to be run for multiple iterations (e.g., so that average and standard devia...
bsd-3-clause
lzw120/django
tests/regressiontests/localflavor/jp/tests.py
33
2762
from django.contrib.localflavor.jp.forms import (JPPostalCodeField, JPPrefectureSelect) from django.test import SimpleTestCase class JPLocalFlavorTests(SimpleTestCase): def test_JPPrefectureSelect(self): f = JPPrefectureSelect() out = u'''<select name="prefecture"> <option value="hokkaido">Ho...
bsd-3-clause
browseinfo/7.0-server
openerp/tools/misc.py
16
39088
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2013 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you ca...
agpl-3.0
MurphyMc/pox
pox/misc/pidfile.py
44
2096
# Copyright 2013 James McCauley # # 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
MostAwesomeDude/vncauthproxy
vncap/vnc/factory.py
2
2792
from twisted.internet.defer import gatherResults from twisted.internet import reactor from twisted.internet.endpoints import TCP4ClientEndpoint from twisted.internet.protocol import Factory from twisted.python import log from vncap.vnc.protocol import VNCServerAuthenticator, VNCClientAuthenticator def start_proxying(...
gpl-2.0
jonparrott/gcloud-python
firestore/tests/unit/test_watch.py
2
28027
import datetime import unittest import mock from google.cloud.firestore_v1beta1.proto import firestore_pb2 class TestWatchDocTree(unittest.TestCase): def _makeOne(self): from google.cloud.firestore_v1beta1.watch import WatchDocTree return WatchDocTree() def test_insert_and_keys(self): ...
apache-2.0
Bjay1435/capstone
rootfs/usr/share/gcc-4.8/python/libstdcxx/v6/printers.py
11
38996
# Pretty-printers for libstdc++. # Copyright (C) 2008-2013 Free Software Foundation, Inc. # 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)...
mit
Sarah-Alsinan/muypicky
lib/python3.6/site-packages/django/conf/urls/__init__.py
133
3546
import warnings from importlib import import_module from django.core.exceptions import ImproperlyConfigured from django.urls import ( LocaleRegexURLResolver, RegexURLPattern, RegexURLResolver, ) from django.utils import six from django.utils.deprecation import RemovedInDjango20Warning __all__ = ['handler400', 'ha...
mit
v0lk3r/ansible-modules-core
cloud/amazon/iam_policy.py
29
12723
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
gpl-3.0
areski/django
tests/distinct_on_fields/models.py
282
1440
from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Tag(models.Model): name = models.CharField(max_length=10) parent = models.ForeignKey( 'self', models.SET_NULL, blank=Tr...
bsd-3-clause
mikebryant/rapid-router
example_project/example_project/wsgi.py
2
2687
# -*- coding: utf-8 -*- # Code for Life # # Copyright (C) 2015, Ocado Innovation Limited # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your o...
agpl-3.0
windskyer/nova
nova/api/openstack/compute/legacy_v2/contrib/server_diagnostics.py
69
2371
# Copyright 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 requ...
gpl-2.0
idrogeno/IdroMips
lib/python/Components/EpgList.py
3
16812
from HTMLComponent import HTMLComponent from GUIComponent import GUIComponent from enigma import eEPGCache, eListbox, eListboxPythonMultiContent, gFont, \ RT_HALIGN_LEFT, RT_HALIGN_RIGHT, RT_HALIGN_CENTER, RT_VALIGN_CENTER from Tools.Alternatives import CompareWithAlternatives from Tools.LoadPixmap import LoadPixmap...
gpl-2.0
SciTools/iris
lib/iris/tests/unit/fileformats/netcdf/test_parse_cell_methods.py
5
5108
# Copyright Iris contributors # # This file is part of Iris and is released under the LGPL license. # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """ Unit tests for :func:`iris.fileformats.netcdf.parse_cell_methods`. """ # import iris tests first so that some things can ...
lgpl-3.0
phborba/dsgtoolsop
ProfileTool/pyqtgraph/opengl/__init__.py
53
1614
from .GLViewWidget import GLViewWidget ## dynamic imports cause too many problems. #from .. import importAll #importAll('items', globals(), locals()) from .items.GLGridItem import * from .items.GLBarGraphItem import * from .items.GLScatterPlotItem import * ...
gpl-2.0
VladimirTyrin/wireshark
tools/generate-bacnet-vendors.py
34
1745
#!/usr/bin/env python2 ''' Copyright 2014 Anish Bhatt <anish@chelsio.com> 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....
gpl-2.0
Mazecreator/tensorflow
tensorflow/python/util/lazy_loader.py
93
2006
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
jeremypogue/ansible
contrib/inventory/vmware.py
79
18441
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' VMware Inventory Script ======================= Retrieve information about virtual machines from a vCenter server or standalone ESX host. When `group_by=false` (in the INI file), host systems are also returned in addition to VMs. This script will attempt to read conf...
gpl-3.0
PHOTOX/fuase
ase/ase/dft/dos.py
11
2219
from math import pi, sqrt import numpy as np class DOS: def __init__(self, calc, width=0.1, window=None, npts=201): """Electronic Density Of States object. calc: calculator object Any ASE compliant calculator object. width: float Width of guassian smearing. ...
gpl-2.0
nzavagli/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/pycrypto-2.6.1/lib/Crypto/Util/randpool.py
139
2768
# # randpool.py : Cryptographically strong random number generation # # Part of the Python Cryptography Toolkit # # Written by Andrew M. Kuchling, Mark Moraes, and others # # =================================================================== # The contents of this file are dedicated to the public domain. To # the ex...
mit
alorenzo175/pvlib-python
pvlib/test/test_forecast.py
1
5733
from datetime import datetime, timedelta from pytz import timezone import warnings import pandas as pd import pytest from numpy.testing import assert_allclose from conftest import requires_siphon, has_siphon, skip_windows pytestmark = pytest.mark.skipif(not has_siphon, reason='requires siphon') if has_siphon: ...
bsd-3-clause
zhouzhenghui/python-for-android
python-modules/twisted/twisted/test/test_newcred.py
56
15084
# Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.cred}, now with 30% more starch. """ import hmac from zope.interface import implements, Interface from twisted.trial import unittest from twisted.cred import portal, checkers, credentials, error from twisted.py...
apache-2.0
moijes12/oh-mainline
vendor/packages/Django/tests/regressiontests/templates/tests.py
27
114569
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.conf import settings if __name__ == '__main__': # When running this file in isolation, we need to set up the configuration # before importing 'template'. settings.configure() from datetime import date, datetime, ...
agpl-3.0
mcalmer/spacewalk
scripts/devel/cobbler-api-example.py
20
1306
import xmlrpclib import os my_uri = "http://spacewalk.pdx.redhat.com/cobbler_api_rw" remote = xmlrpclib.Server(my_uri) testuser = "admin" testpass = "redhat" token = remote.login(testuser,testpass) print token # rc = remote.test(token) # print "test result: %s" % rc # just to make things "work" os.system("touch /tmp...
gpl-2.0
USGSDenverPychron/pychron
pychron/spectrometer/base_magnet.py
1
12604
# =============================================================================== # 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
jptomo/rpython-lang-scheme
rpython/translator/test/snippet.py
1
19453
"""Snippets for translation This module holds various snippets, to be used by translator unittests. We define argument types as default arguments to the snippet functions. """ numtype = (int, float) anytype = (int, float, str) seqtype = (list, tuple) def if_then_else(cond=anytype, x=anytype, y=anytype): if cond...
mit
prakritish/ansible
lib/ansible/modules/cloud/google/gce_lb.py
70
12726
#!/usr/bin/python # Copyright 2013 Google Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later vers...
gpl-3.0
warner83/micropython
tests/basics/set_binop.py
22
1057
sets = [set(), {1}, {1, 2}, {1, 2, 3}, {2, 3}, {2, 3, 5}, {5}, {7}] for s in sets: for t in sets: print(sorted(s), '|', sorted(t), '=', sorted(s | t)) print(sorted(s), '^', sorted(t), '=', sorted(s ^ t)) print(sorted(s), '&', sorted(t), '=', sorted(s & t)) print(sorted(s), '-', sorte...
mit
friedrich420/HTC-ONE-M7-AEL-Kernel-5.0.2
tools/perf/scripts/python/futex-contention.py
11261
1486
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PER...
gpl-2.0
cafecivet/django_girls_tutorial
Lib/site-packages/django/conf/locale/lv/formats.py
82
1912
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = r'Y. \g\a\d\a j. F' TIME_FORMAT = ...
gpl-2.0
cu-csc/automaton
tests/deployment_tests.py
1
2068
""" Module that tests various deployment functionality To run me from command line: cd automaton/tests export PYTHONPATH=$PYTHONPATH:../ python -m unittest -v deployment_tests unset PYTHONPATH I should have used nose but """ import unittest from lib import util from deployment import common class test_deployment_...
mit
agirardeaudale/nbawebstats
docs/generaterequestrst.py
1
2103
#!/usr/bin/env python from jinja2 import Environment, FileSystemLoader import json import os THIS_DIR = os.path.dirname(os.path.abspath(__file__)) DATA_PATH = os.path.abspath(os.path.join(THIS_DIR, '../nbawebstats/requests.json')) RST_PATH = os.path.abspath(os.path.join(THIS_DIR, 'requests.rst')) def format_internal...
mit
touchpro/android_kernel_lge_ls770
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # import os import sys import getopt import sh...
gpl-2.0
OpenAcademy-OpenStack/nova-scheduler
nova/api/openstack/compute/plugins/v3/admin_password.py
1
2734
# Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
apache-2.0
GeyerA/android_external_chromium_org
chrome/test/functional/pyauto_functional.py
56
3674
#!/usr/bin/env python # 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. """Setup for PyAuto functional tests. Use the following in your scripts to run them standalone: # This should be at the top impor...
bsd-3-clause
emedinaa/contentbox
third_party/unidecode/x0d7.py
4
4816
data = ( 'hwen', # 0x00 'hwenj', # 0x01 'hwenh', # 0x02 'hwed', # 0x03 'hwel', # 0x04 'hwelg', # 0x05 'hwelm', # 0x06 'hwelb', # 0x07 'hwels', # 0x08 'hwelt', # 0x09 'hwelp', # 0x0a 'hwelh', # 0x0b 'hwem', # 0x0c 'hweb', # 0x0d 'hwebs', # 0x0e 'hwes', # 0x...
apache-2.0
dfang/odoo
addons/delivery/models/delivery_price_rule.py
24
2277
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import models, fields, api import odoo.addons.decimal_precision as dp class PriceRule(models.Model): _name = "delivery.price.rule" _description = "Delivery Price Rules" _order = 'sequence, list_pr...
agpl-3.0
eirmag/weboob
weboob/capabilities/video.py
2
3192
# -*- coding: utf-8 -*- # Copyright(C) 2010-2012 Romain Bignon, Christophe Benz # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the Licen...
agpl-3.0
bgammill/namebench
libnamebench/config_test.py
173
2083
#!/usr/bin/env python # Copyright 2009 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...
apache-2.0
waseem18/oh-mainline
mysite/base/migrations/0001_initial.py
17
1726
# This file is part of OpenHatch. # Copyright (C) 2010 OpenHatch, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later v...
agpl-3.0
wemanuel/smry
smry/server-auth/ls/google-cloud-sdk/platform/gsutil/third_party/boto/boto/cloudtrail/__init__.py
145
1664
# Copyright (c) 2013 Amazon.com, Inc. or its affiliates. # 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 restriction, including # without limitation the rights...
apache-2.0
abele/bokeh
examples/plotting/file/boxplot.py
43
2269
import numpy as np import pandas as pd from bokeh.plotting import figure, show, output_file # Generate some synthetic time series for six different categories cats = list("abcdef") yy = np.random.randn(2000) g = np.random.choice(cats, 2000) for i, l in enumerate(cats): yy[g == l] += i // 2 df = pd.DataFrame(dict(s...
bsd-3-clause
pedromes/mbed
workspace_tools/paths.py
9
3412
""" mbed SDK Copyright (c) 2011-2013 ARM Limited 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 wr...
apache-2.0
kylelwm/ponus
venv/build/django/django/contrib/webdesign/tests.py
232
1092
# -*- coding: utf-8 -*- from __future__ import unicode_literals import unittest from django.contrib.webdesign.lorem_ipsum import * from django.template import loader, Context class WebdesignTest(unittest.TestCase): def test_words(self): self.assertEqual(words(7), 'lorem ipsum dolor sit amet consectetur...
mit
sudheesh001/oh-mainline
vendor/packages/Pygments/pygments/lexers/dotnet.py
71
24916
# -*- coding: utf-8 -*- """ pygments.lexers.dotnet ~~~~~~~~~~~~~~~~~~~~~~ Lexers for .net languages. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, DelegatingLexer, bygroups, include, ...
agpl-3.0
pgleeson/TestArea
lib/jython/Lib/test/test_cmp_jy.py
13
2636
"Tests for cmp() compatibility with CPython" import UserDict import unittest from test import test_support class CmpGeneralTestCase(unittest.TestCase): def test_type_crash(self): # Used to throw ArrayStoreException: # http://bugs.jython.org/issue1382 class Configuration(object, UserDict.Di...
gpl-2.0
jvoegele/picard
picard/ui/ui_options_general.py
5
5122
# -*- coding: utf-8 -*- # Automatically generated - don't edit. # Use `python setup.py build_ui` to update it. from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fromUtf8(s): return s try: _encoding = QtGui.QApplication.UnicodeUTF8 def _trans...
gpl-2.0
hoanhtien/TypeScript-Sublime-Plugin
typescript/listeners/nav_to.py
7
1797
from ..commands.nav_to import TypescriptNavToCommand from ..libs.view_helpers import * from ..libs import * from .event_hub import EventHub class NavToEventListener: """Event listeners for the TypescriptNavToCommand""" def on_activated_special_view(self, view): if TypescriptNavToCommand.nav_to_panel_s...
apache-2.0
gautam1858/tensorflow
tensorflow/python/eager/ops_test.py
3
15855
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
jjmleiro/hue
desktop/core/ext-py/Django-1.6.10/tests/admin_util/tests.py
51
11281
from __future__ import absolute_import, unicode_literals from datetime import datetime from django.conf import settings from django.contrib import admin from django.contrib.admin import helpers from django.contrib.admin.util import (display_for_field, flatten_fieldsets, label_for_field, lookup_field, NestedObject...
apache-2.0
lundjordan/mozharness
test/test_base_python.py
14
1130
import os import unittest import mozharness.base.python as python here = os.path.dirname(os.path.abspath(__file__)) class TestVirtualenvMixin(unittest.TestCase): def test_package_versions(self): example = os.path.join(here, 'pip-freeze.example.txt') output = file(example).read() mixin = ...
mpl-2.0
dvliman/jaikuengine
.google_appengine/lib/django-1.2/tests/modeltests/unmanaged_models/models.py
91
3475
""" Models can have a ``managed`` attribute, which specifies whether the SQL code is generated for the table on various manage.py operations. """ from django.db import models # All of these models are creatd in the database by Django. class A01(models.Model): f_a = models.CharField(max_length=10, db_index=True)...
apache-2.0
deokjinkim/servo
tests/wpt/web-platform-tests/tools/html5lib/html5lib/treewalkers/etree.py
658
4613
from __future__ import absolute_import, division, unicode_literals try: from collections import OrderedDict except ImportError: try: from ordereddict import OrderedDict except ImportError: OrderedDict = dict import gettext _ = gettext.gettext import re from six import text_type from . im...
mpl-2.0
halvertoluke/edx-platform
cms/djangoapps/contentstore/tests/test_i18n.py
133
3282
from unittest import skip from django.contrib.auth.models import User from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from contentstore.tests.utils import AjaxEnabledTestClient class InternationalizationTest(ModuleStoreTestCase): """ Tests to validate Internationalization. """ ...
agpl-3.0
syrusakbary/Djinja
setup.py
1
1097
from setuptools import setup, find_packages setup( name='Djinja', version=".".join(map(str, __import__("djinja").__version__)), description='A package that makes possible the integration of Jinja2 in Django, in a clean way.', long_description=open('README.rst').read(), author='Syrus Akbary Nieto', ...
bsd-3-clause
petrutlucian94/nova_dev
nova/cells/rpc_driver.py
38
6598
# Copyright (c) 2012 Rackspace Hosting # All Rights Reserved. # Copyright 2013 Red Hat, 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/license...
apache-2.0
CyanogenMod/android_kernel_motorola_omap4-kexec-common
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
wpjesus/codematch
ietf/group/mails.py
1
2488
# generation of mails import re from django.utils.html import strip_tags from django.utils.text import wrap from django.conf import settings from django.core.urlresolvers import reverse as urlreverse from ietf.utils.mail import send_mail, send_mail_text from ietf.mailtrigger.utils import gather_address_lists def ...
bsd-3-clause
MERegistro/meregistro
django/db/backends/sqlite3/creation.py
63
3259
import os import sys from django.db.backends.creation import BaseDatabaseCreation class DatabaseCreation(BaseDatabaseCreation): # SQLite doesn't actually support most of these types, but it "does the right # thing" given more verbose field definitions, so leave them as is so that # schema inspection is mor...
bsd-3-clause
yrobla/nova
nova/image/glance.py
2
18610
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 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.apach...
apache-2.0
puzan/ansible
lib/ansible/modules/cloud/amazon/ec2_snapshot_facts.py
47
7865
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
gpl-3.0
amaozhao/basecms
mptt/managers.py
1
46897
""" A custom manager for working with trees of objects. """ from __future__ import unicode_literals import contextlib from django.db import models, connections, router from django.db.models import F, ManyToManyField, Max, Q from django.utils.translation import ugettext as _ from mptt.exceptions import CantDisableUpda...
mit
pickettd/SerialPort-RealTime-Data-Plotter
com_monitor.py
1
5133
import Queue, threading, timeit, serial from globals import * class ComMonitorThread(threading.Thread): """ A thread for monitoring a COM port. The COM port is opened when the thread is started. data_q: Queue for received data. Items in the queue are (dat...
mit
fintech-circle/edx-platform
lms/djangoapps/gating/api.py
1
4680
""" API for the gating djangoapp """ from collections import defaultdict import json import logging from lms.djangoapps.courseware.entrance_exams import get_entrance_exam_content from openedx.core.lib.gating import api as gating_api from opaque_keys.edx.keys import UsageKey from util import milestones_helpers log = ...
agpl-3.0
lukeiwanski/tensorflow-opencl
tensorflow/python/kernel_tests/random_ops_test.py
39
11428
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
fatadama/mavlink-vscl
pymavlink/generator/mavgen.py
2
4139
#!/usr/bin/env python ''' parse a MAVLink protocol XML file and generate a python implementation Copyright Andrew Tridgell 2011 Released under GNU GPL version 3 or later ''' import sys, textwrap, os # allow import from the parent directory to find mavgen sys.path.append(os.path.join(os.path.dirname(os.path.realpat...
lgpl-3.0
sorenk/ansible
lib/ansible/modules/network/panos/panos_interface.py
18
5722
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage PaloAltoNetworks Firewall # (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish...
gpl-3.0
hujiajie/chromium-crosswalk
tools/telemetry/telemetry/record_wpr.py
8
10617
# Copyright 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. import argparse import logging import sys from telemetry import benchmark from telemetry import story from telemetry.core import discover from telemetry.cor...
bsd-3-clause
mbauskar/omnitech-erpnext
erpnext/startup/report_data_map.py
46
8872
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals # mappings for table dumps # "remember to add indexes!" data_map = { "Company": { "columns": ["name"], "conditions": ["docstatus < 2"] }, "Fisc...
agpl-3.0
iamkingmaker/zipline
zipline/modelling/factor/factor.py
9
12497
""" factor.py """ from operator import attrgetter from numpy import ( apply_along_axis, float64, nan, ) from scipy.stats import rankdata from zipline.errors import ( UnknownRankMethod, UnsupportedDataType, ) from zipline.modelling.term import ( CustomTermMixin, RequiredWindowLengthMixin, ...
apache-2.0
kiwicopple/MyMDb
venv/Lib/site-packages/pygments/lexers/__init__.py
73
8735
# -*- coding: utf-8 -*- """ pygments.lexers ~~~~~~~~~~~~~~~ Pygments lexers. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re import sys import types import fnmatch from os.path import basename from pygments.lexers._mapping ...
mit
javilonas/NCam
cross/android-toolchain/lib/python2.7/macurl2path.py
332
3275
"""Macintosh-specific module for conversion between pathnames and URLs. Do not import directly; use urllib instead.""" import urllib import os __all__ = ["url2pathname","pathname2url"] def url2pathname(pathname): """OS-specific conversion from a relative URL of the 'file' scheme to a file system path; not r...
gpl-3.0
Iolaum/MrSmith
AdX/src/main/cpp/reserve-price-payground/protobuf-2.5.0/python/google/protobuf/internal/reflection_cpp_generated_test.py
215
4054
#! /usr/bin/python # -*- coding: utf-8 -*- # # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following cond...
gpl-2.0
starnose/liar
liarutils.py
1
3600
################################################################################### # liarutils.py, utility calls for liar ################################################################################### # # Copyright 2013 David Hicks (Starnose Ltd) # # This file is part of Liar # # Liar is free software: you can...
gpl-3.0
Pinyto/cloud
keyserver/models.py
1
4666
# coding=utf-8 """ Pinyto cloud - A secure cloud database for your personal data Copyright (C) 2019 Pina Merkert <pina@pinae.net> 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 t...
gpl-3.0
digitie/magneto
core/util.py
1
3603
# -*- coding: UTF-8 -*- from time import sleep import logging import serial import sys import binascii from log import MainLogger def enum(*sequential, **named): enums = dict(zip(sequential, range(len(sequential))), **named) reverse = dict((value, key) for key, value in enums.iteritems()) enums['reverse_m...
unlicense
Innovahn/odoo.old
addons/purchase_analytic_plans/__init__.py
441
1220
# -*- 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
ofer43211/unisubs
apps/externalsites/subfetch.py
3
2698
# Amara, universalsubtitles.org # # Copyright (C) 2014 Participatory Culture Foundation # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your op...
agpl-3.0
barnsnake351/neutron
neutron/callbacks/registry.py
58
1454
# 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 # d...
apache-2.0
JDShu/SCOPE
askbot/tests/category_tree_tests.py
17
3972
import unittest from askbot.utils import category_tree as ct from django.utils import simplejson class CategoryTreeTests(unittest.TestCase): def setUp(self): self.tree = [ [ u'dummy', [#dummy is a sentinel node [ u'cars', [ ...
gpl-3.0
fevxie/odoo
addons/purchase/wizard/purchase_line_invoice.py
177
5258
# -*- 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
ftick/pyNES
pynes/tests/guide_test.py
28
5904
# -*- coding: utf-8 -*- import unittest from pynes.compiler import lexical, syntax ''' Those tests are based on examples from: http://nesdev.parodius.com/6502guid.txt ''' class GuideTest(unittest.TestCase): def test_example_16_bit_subtraction_routine(self): ex_2 = ''' SEC ;clear the...
bsd-3-clause
robmcmullen/pyatasm
pyatasm/assemble.py
1
3007
from .pyatasm_mac65 import mac65_assemble class Assemble(object): def __init__(self, source, verbose=False): self.verbose = verbose if isinstance(source, str): source = source.encode("utf-8") self.errors, text = mac65_assemble(source) self.segments = [] self.tran...
gpl-2.0
pratikmallya/hue
desktop/core/ext-py/Django-1.6.10/tests/dates/tests.py
59
2508
from __future__ import absolute_import import datetime from django.test import TestCase from .models import Article, Comment, Category class DatesTests(TestCase): def test_related_model_traverse(self): a1 = Article.objects.create( title="First one", pub_date=datetime.date(2005, ...
apache-2.0
igorcoding/asynctnt
asynctnt/_testbase.py
1
8329
import asyncio import contextlib import functools import inspect import logging import os import time import unittest import sys import asynctnt from asynctnt.instance import \ TarantoolSyncInstance, TarantoolSyncDockerInstance from asynctnt import TarantoolTuple __all__ = ( 'TestCase', 'TarantoolTestCase', ...
apache-2.0
tcpcloud/python-heatclient
tools/install_venv_common.py
166
5958
# Copyright 2013 OpenStack Foundation # Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
schatt/mitro
browser-ext/third_party/firefox-addon-sdk/python-lib/cuddlefish/__init__.py
28
41003
# 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/. import sys import os import optparse import webbrowser import time from copy import copy import simplejson as json from...
gpl-3.0
acshan/odoo
addons/mrp_repair/wizard/make_invoice.py
168
3151
# -*- 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
dstrockis/outlook-autocategories
lib/dill/_objects.py
6
20255
#!/usr/bin/env python # # Author: Mike McKerns (mmckerns @caltech and @uqfoundation) # Copyright (c) 2008-2016 California Institute of Technology. # Copyright (c) 2016-2017 The Uncertainty Quantification Foundation. # License: 3-clause BSD. The full license text is available at: # - http://trac.mystic.cacr.caltech.ed...
apache-2.0
nexiles/odoo
addons/l10n_at/__openerp__.py
430
1785
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) conexus # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public Lic...
agpl-3.0
stcakova/Battle-city
world.py
1
1375
import pygame from pygame import rect from constants import * from part import Wall, Brick class World: world = [[None for x in range(26)] for y in range(19)] def __init__(self): self.brick = pygame.image.load("pictures/brick.jpeg") self.wall = pygame.image.load("pictures/wall.png") ...
gpl-2.0
Pretio/boto
boto/s3/bucketlogging.py
153
3183
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
mit