repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
zulip/django
tests/model_inheritance/models.py
227
4810
""" XX. Model inheritance Model inheritance exists in two varieties: - abstract base classes which are a way of specifying common information inherited by the subclasses. They don't exist as a separate model. - non-abstract base classes (the default), which are models in their own right with ...
bsd-3-clause
dostavro/dotfiles
sublime2/Packages/Package Control/package_control/package_io.py
10
3962
import os import zipfile import sublime from .console_write import console_write from .open_compat import open_compat, read_compat from .unicode import unicode_from_os from .file_not_found_error import FileNotFoundError def read_package_file(package, relative_path, binary=False, debug=False): package_dir = _get...
mit
resmo/ansible
test/units/modules/network/opx/opx_module.py
52
2604
# (c) 2018 Red Hat Inc. # # (c) 2018 Dell Inc. or its subsidiaries. All Rights Reserved. # # 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 Lic...
gpl-3.0
kbc-developers/android_kernel_htc_m7wlj
tools/perf/scripts/python/syscall-counts-by-pid.py
11180
1927
# system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os, sys sys.path.append(os.env...
gpl-2.0
sjperkins/tensorflow
tensorflow/compiler/tests/xla_test.py
27
6751
# 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
7kbird/chrome
third_party/cython/src/Cython/Shadow.py
87
11238
# cython.* namespace for pure mode. __version__ = "0.20.2" # BEGIN shameless copy from Cython/minivect/minitypes.py class _ArrayType(object): is_array = True subtypes = ['dtype'] def __init__(self, dtype, ndim, is_c_contig=False, is_f_contig=False, inner_contig=False, broadcasting=None...
bsd-3-clause
ajmssc/py-nilsimsa
nilsimsa/test.py
4
1847
""" Purpose: Set of unit tests for nilsimsa package. Test data consists of 20 randomly selected documents from a Diffeo corpus. This software is released under an MIT/X11 open source license. Copyright 2012-2014 Diffeo, Inc. """ import cPickle as pickle import dircache import os import pytest import random from dep...
mit
pjs7678/python-kubernetes
kubernetes/_file_cache.py
2
3465
#!/usr/bin/env python # # Copyright 2014 tigmi # # 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 agre...
apache-2.0
txm/potato
django/core/management/commands/dbshell.py
313
1261
from optparse import make_option from django.core.management.base import BaseCommand, CommandError from django.db import connections, DEFAULT_DB_ALIAS class Command(BaseCommand): help = ("Runs the command-line client for specified database, or the " "default database if none is provided.") option_lis...
bsd-3-clause
vrenaville/account-invoice-reporting
__unported__/invoice_print_report_balance_payment/account_invoice.py
11
3487
# -*- encoding: utf-8 -*- ############################################################################### # # OpenERP, Open Source Management Solution # Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). # # This program is free software: you can redistribute it and/or modify # it un...
agpl-3.0
RPGOne/scikit-learn
sklearn/cluster/spectral.py
25
18535
# -*- coding: utf-8 -*- """Algorithms for spectral clustering""" # Author: Gael Varoquaux gael.varoquaux@normalesup.org # Brian Cheung # Wei LI <kuantkid@gmail.com> # License: BSD 3 clause import warnings import numpy as np from ..base import BaseEstimator, ClusterMixin from ..utils import check_rand...
bsd-3-clause
fintech-circle/edx-platform
lms/djangoapps/ccx/modulestore.py
17
13435
# -*- coding: utf-8 -*- """A modulestore wrapper It will 'unwrap' ccx keys on the way in and re-wrap them on the way out In practical terms this means that when an object is retrieved from modulestore using a CCXLocator or CCXBlockUsageLocator as the key, the equivalent CourseLocator or BlockUsageLocator will actuall...
agpl-3.0
nsat/gnuradio
gr-vocoder/examples/cvsd_audio_loopback.py
58
2425
#!/usr/bin/env python # # Copyright 2007,2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your optio...
gpl-3.0
olegpshenichniy/Booktype
lib/booktype/apps/core/migrations/0001_initial.py
7
2680
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('editor', '0001_initial'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] oper...
agpl-3.0
jitendra29/servo
tests/wpt/web-platform-tests/tools/wptserve/tests/functional/test_handlers.py
293
9198
import json import os import unittest import urllib2 import uuid import wptserve from base import TestUsingServer, doc_root class TestFileHandler(TestUsingServer): def test_GET(self): resp = self.request("/document.txt") self.assertEquals(200, resp.getcode()) self.assertEquals("text/plain"...
mpl-2.0
aranega/pyecore
tests/test_utils.py
1
1868
import pytest from pyecore.ecore import * from pyecore.utils import DynamicEPackage @pytest.fixture(scope='module') def simplemm(): A = EClass('A') B = EClass('B') Root = EClass('Root') pack = EPackage('pack', nsURI='http://pack/1.0', nsPrefix='pack') pack.eClassifiers.extend([Root, A, B]) ret...
bsd-3-clause
smunix/ns-3-rfid
src/applications/bindings/modulegen__gcc_ILP32.py
14
594373
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
Juniper/python-neutronclient
neutronclient/neutron/v2_0/policy.py
1
1686
import argparse import logging from neutronclient.neutron.v2_0 import CreateCommand from neutronclient.neutron.v2_0 import DeleteCommand from neutronclient.neutron.v2_0 import ListCommand from neutronclient.neutron.v2_0 import UpdateCommand from neutronclient.neutron.v2_0 import ShowCommand class ListPolicy(ListComm...
apache-2.0
michalkurka/h2o-3
h2o-py/h2o/model/extensions/feature_interaction.py
2
2636
import h2o class FeatureInteraction: def _feature_interaction(self, max_interaction_depth=100, max_tree_depth=100, max_deepening=-1, path=None): """ Feature interactions and importance, leaf statistics and split value histograms in a tabular form. Available for XGBoost and GBM. M...
apache-2.0
SEL-Columbia/dokomoforms
webapp.py
1
13564
#!/usr/bin/env python3 """Main Dokomo Forms entry point. Execute this script to start the Tornado server and WSGI container. It will ensure that the proper tables and extensions exist in the specified schema of the PostgreSQL database. The application looks for gettext translation files like locale/{locale}/LC_MESSAG...
gpl-3.0
monikasulik/django-oscar
tests/integration/order/model_tests.py
41
15136
from datetime import timedelta, datetime from decimal import Decimal as D from django.test import TestCase from django.utils import timezone from django.utils.translation import ugettext_lazy as _ import mock from oscar.apps.order.exceptions import ( InvalidOrderStatus, InvalidLineStatus, InvalidShippingEvent) fr...
bsd-3-clause
eino-makitalo/odoo
addons/l10n_in_hr_payroll/report/report_hr_yearly_salary_detail.py
374
6855
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
agpl-3.0
TEDICpy/write-it
nuntium/migrations/0032_auto__chg_field_ratelimiter_day.py
2
15579
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'RateLimiter.day' db.alter_column(u'nuntium_ratelimiter', 'day', self.gf('django.db.models...
gpl-3.0
nxnfufunezn/servo
tests/wpt/web-platform-tests/eventsource/resources/cors.py
132
1330
import os from wptserve import pipes def run_other(request, response, path): #This is a terrible hack environ = {"__file__": path} execfile(path, environ, environ) rv = environ["main"](request, response) return rv def main(request, response): origin = request.GET.first("origin", request.header...
mpl-2.0
CyanogenMod/android_kernel_samsung_exynos5410
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
2058
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
gpl-2.0
jazztpt/edx-platform
common/lib/xmodule/xmodule/annotator_mixin.py
184
1631
""" Annotations Tool Mixin This file contains global variables and functions used in the various Annotation Tools. """ from lxml import etree from urlparse import urlparse from os.path import splitext, basename from HTMLParser import HTMLParser def get_instructions(xmltree): """ Removes <instructions> from the xm...
agpl-3.0
oliverlee/sympy
sympy/polys/numberfields.py
37
31789
"""Computational algebraic field theory. """ from __future__ import print_function, division from sympy import ( S, Rational, AlgebraicNumber, Add, Mul, sympify, Dummy, expand_mul, I, pi ) from sympy.functions.elementary.exponential import exp from sympy.functions.elementary.trigonometric import cos, sin fr...
bsd-3-clause
wsmith323/django
tests/sites_tests/tests.py
251
10760
from __future__ import unicode_literals from django.apps import apps from django.conf import settings from django.contrib.sites import models from django.contrib.sites.management import create_default_site from django.contrib.sites.middleware import CurrentSiteMiddleware from django.contrib.sites.models import Site, c...
bsd-3-clause
mikel-egana-aranguren/SADI-Galaxy-Docker
galaxy-dist/eggs/numpy-1.6.0-py2.7-linux-x86_64-ucs4.egg/numpy/compat/_inspect.py
94
9117
"""Subset of inspect module from upstream python We use this instead of upstream because upstream inspect is slow to import, and significanly contributes to numpy import times. Importing this copy has almost no overhead. """ import types __all__ = ['getargspec', 'formatargspec'] # ----------------------------------...
gpl-3.0
xHeliotrope/injustice_dropper
env/lib/python3.4/site-packages/django/contrib/gis/utils/wkt.py
589
1923
""" Utilities for manipulating Geometry WKT. """ from django.utils import six def precision_wkt(geom, prec): """ Returns WKT text of the geometry according to the given precision (an integer or a string). If the precision is an integer, then the decimal places of coordinates WKT will be truncated t...
mit
VaneCloud/openstack-ansible
playbooks/plugins/callbacks/profile_tasks.py
17
2918
# The MIT License (MIT) # # Copyright (c) 2015, Red Hat, Inc. and others # Copyright (c) 2015, Rackspace US, Inc. # # 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, includ...
apache-2.0
laosiaudi/tensorflow
tensorflow/contrib/bayesflow/python/ops/entropy.py
14
15131
# 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
armoredsoftware/protocol
measurer/gdb-7.9/gdb/testsuite/gdb.python/py-typeprint.py
46
1128
# Copyright (C) 2012-2015 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) any later version. # # This progr...
bsd-3-clause
v-superuser/android_kernel_htc_msm8974
Documentation/target/tcm_mod_builder.py
4981
41422
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
garyjs/Newfiesautodialer
newfies/dnc/forms.py
3
3521
# # Newfies-Dialer License # http://www.newfies-dialer.org # # 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/. # # Copyright (C) 2011-2013 Star2Billing S.L. # # The Initia...
mpl-2.0
ilpianista/ansible
test/units/module_utils/common/validation/test_check_type_float.py
83
1067
# -*- coding: utf-8 -*- # Copyright (c) 2019 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 import pytest from ansible.module_utils._text import to_native from ansible.m...
gpl-3.0
enlighter/simple-crawler-in-python
baby_steps/timeDisplay.py
1
2711
def seconds_difference(time_1, time_2): '''(float, float) -> float Return the number of seconds later that a time in seconds time_2 is than a time in seconds time_1. >>> seconds_difference(1800.0, 3600.0) 1800.0 >>> seconds_difference(3600.0, 1800.0) -1800.0 >>> seconds_differe...
mit
ashemedai/ansible
test/units/module_utils/ec2/test_aws.py
51
2972
# -*- coding: utf-8 -*- # (c) 2015, Allen Sanabria <asanabria@linuxdynasty.org> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or ...
gpl-3.0
utkbansal/kuma
vendor/packages/translate/convert/test_prop2mozfunny.py
26
2182
#!/usr/bin/env python from translate.convert import prop2mozfunny from translate.misc import wStringIO class TestPO2Prop: def merge2inc(self, incsource, posource): """helper that merges po translations to .inc source without requiring files""" inputfile = wStringIO.StringIO(posource) tem...
mpl-2.0
eneldoserrata/marcos_openerp
addons/report_geraldo/lib/geraldo/site/newsite/django_1_0/django/template/defaulttags.py
9
38786
"""Default tags used by the template system, available to all templates.""" import sys import re from itertools import cycle as itertools_cycle try: reversed except NameError: from django.utils.itercompat import reversed # Python 2.3 fallback from django.template import Node, NodeList, Template, Context, ...
agpl-3.0
utopiaprince/micropython
tests/basics/with1.py
118
1628
class CtxMgr: def __enter__(self): print("__enter__") return self def __exit__(self, a, b, c): print("__exit__", repr(a), repr(b)) with CtxMgr() as a: print(isinstance(a, CtxMgr)) try: with CtxMgr() as a: raise ValueError except ValueError: print("ValueError") ...
mit
stgraber/snapd
tests/main/fake-netplan-apply/fake-netplan-service.py
8
1761
#!/usr/bin/python3 from gi.repository import GLib import dbus.mainloop.glib import dbus.service import sys BUS_NAME = "io.netplan.Netplan" OBJECT_PATH = "/io/netplan/Netplan" DOC_IFACE = "io.netplan.Netplan" class NetplanApplyService(dbus.service.Object): def __init__(self, connection, object_path, logfile): ...
gpl-3.0
cdrooom/odoo
addons/stock_dropshipping/__openerp__.py
7
1971
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2014 OpenERP S.A. (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
spiralsyzygy/cloudbuster
ansible_tasks/models.py
1
1089
from django.db import models from ansible_modules.models import AnsibleModule class Task(models.Model): name = models.CharField(max_length=40) module = models.ForeignKey(AnsibleModule, null=True, blank=True) module_args = models.TextField(blank=True, null=True) notify = models.ManyToManyField('self', n...
gpl-3.0
cchristelis/watchkeeper
django_project/event_mapper/models/daily_report.py
4
1473
# coding=utf-8 """Docstring for this file.""" __author__ = 'ismailsunni' __project_name = 'watchkeeper' __filename = 'daily_report' __date__ = '8/3/15' __copyright__ = 'imajimatika@gmail.com' __doc__ = '' from django.db import models class DailyReport(models.Model): """Model for Daily Report.""" date_time ...
bsd-2-clause
pteichman/kibot
kibot/modules/base.py
1
14929
import sys import kibot.Options from kibot.BaseModule import BaseModule mainhelp = """syntax: help <topic> <topic> can be either a module or a command. \ Typing "help modules" provides a list of loaded modules. You may also find "help help" useful. Help using the standard module (with a little more detail) \ can be ...
gpl-2.0
CubicERP/odoo
addons/stock/partner.py
375
1766
# -*- 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
altai/focus
focus/views/generic_billing.py
1
6825
# -*- coding: utf-8 -*- # Focus # Copyright (C) 2010-2012 Grid Dynamics Consulting Services, Inc # All Rights Reserved # # This program 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 ...
lgpl-2.1
juanleal/perfilResolve
node_modules/laravel-elixir/node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/xml_fix.py
2767
2174
# Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Applies a fix to CR LF TAB handling in xml.dom. Fixes this: http://code.google.com/p/chromium/issues/detail?id=76293 Working around this: http://bugs.python.or...
mit
AOKP/external_chromium_org
tools/perf/measurements/rasterize_and_record.py
23
7924
# 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. import time from metrics import smoothness from telemetry.page import page_measurement class StatsCollector(object): def __init__(self, timeline): ...
bsd-3-clause
zephyrplugins/zephyr
zephyr.plugin.jython/jython2.5.2rc3/Lib/test/test_runpy.py
19
6377
# Test the runpy module import unittest import os import os.path import sys import tempfile from test.test_support import verbose, run_unittest from runpy import _run_module_code, run_module # Set up the test code and expected results class RunModuleCodeTest(unittest.TestCase): expected_result = ["Top level assi...
epl-1.0
ntt-sic/cinder
cinder/tests/test_backup_swift.py
2
7773
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P. # 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/LICEN...
apache-2.0
shanglt/youtube-dl
youtube_dl/downloader/f4m.py
37
12840
from __future__ import division, unicode_literals import base64 import io import itertools import os import time import xml.etree.ElementTree as etree from .fragment import FragmentFD from ..compat import ( compat_urlparse, compat_urllib_error, ) from ..utils import ( encodeFilename, sanitize_open, ...
unlicense
mozilla/stoneridge
python/src/Lib/sqlite3/test/userfunctions.py
15
13845
#-*- coding: ISO-8859-1 -*- # pysqlite2/test/userfunctions.py: tests for user-defined functions and # aggregates. # # Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de> # # This file is part of pysqlite. # # This software is provided 'as-is', without any express or implied # warran...
mpl-2.0
mcrowson/django
tests/generic_relations/models.py
188
4327
""" Generic relations Generic relations let an object have a foreign key to any object through a content-type/object-id field. A ``GenericForeignKey`` field can point to any object, be it animal, vegetable, or mineral. The canonical example is tags (although this example implementation is *far* from complete). """ f...
bsd-3-clause
gg7/sentry
src/sentry/web/forms/__init__.py
15
3194
""" sentry.web.forms ~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from django import forms from django.utils.translation import ugettext_lazy as _ from sentry.constants import HTTP_...
bsd-3-clause
GinnyN/Team-Fortress-RPG-Generators
django/middleware/transaction.py
447
1090
from django.db import transaction class TransactionMiddleware(object): """ Transaction middleware. If this is enabled, each view function will be run with commit_on_response activated - that way a save() doesn't do a direct commit, the commit is done when a successful response is created. If an exc...
bsd-3-clause
BoltzmannBrain/nupic.research
projects/nlp/junit_test5.py
11
3818
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2016, Numenta, Inc. Unless you have purchased from # Numenta, Inc. a separate commercial license for this software code, the # following terms and conditio...
agpl-3.0
roofit-dev/parallel-roofit-scripts
lydia1_obs_par.py
2
28784
observables = ["obs_x_CR_0j_DF_WW", "obs_x_CR_0j_DF_Ztt", "obs_x_CR_1j_DF_WW", "obs_x_CR_1j_DF_Ztt", "obs_x_CR_1j_DF_top", "obs_x_SR_0j_DF_Mll1_PtSubLead2_e", "obs_x_SR_0j_DF_Mll1_PtSubLead2_m", "obs_x_SR_0j_DF_Mll1_PtSubLead3_e", "obs_x_SR_0j_DF_Mll1_PtSubLead3_m", "obs_x_SR_0j_DF_Mll2_PtSubLead2_e", "obs_x_SR_0j_DF_M...
apache-2.0
tingsystems/toshare-python
tests/messages.py
1
1924
from . import BaseEndpointTestCase class MessageEndpointTestCase(BaseEndpointTestCase): def test_message_get(self): self.client._credentials = ( '2zSiihsjuX5Eas6wv9kFAellKJk3CvS3xqcz7Uim', 'uJJaW9AcwJhkKHXH6b9XkwWpYGwz6DrS7lALOzuh8NmRn0HUwqUMVmjwZXMn9BTFxy3WNNjk9GROYJ5efPmmvV3l99Js...
mit
sbidoul/pip
tests/unit/test_link.py
6
5024
import pytest from pip._internal.models.link import Link from pip._internal.utils.hashes import Hashes class TestLink: @pytest.mark.parametrize('url, expected', [ ( 'https://user:password@example.com/path/page.html', '<Link https://user:****@example.com/path/page.html>', ...
mit
flavour/eden
modules/s3cfg.py
1
204464
# -*- coding: utf-8 -*- """ Deployment Settings @requires: U{B{I{gluon}} <http://web2py.com>} @copyright: 2009-2019 (c) Sahana Software Foundation @license: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (t...
mit
Balaji2198/coala
tests/collecting/ImportersTest.py
25
3559
import os import unittest from collections import OrderedDict from coalib.collecting.Importers import import_objects class ImportObjectsTest(unittest.TestCase): def setUp(self): current_dir = os.path.split(__file__)[0] self.testfile1_path = os.path.join(current_dir, ...
agpl-3.0
vv1133/home_web
build/lib.linux-armv6l-2.7/django/core/files/images.py
117
2181
""" Utility functions for handling images. Requires Pillow (or PIL), as you might imagine. """ import zlib from django.core.files import File class ImageFile(File): """ A mixin for use alongside django.core.files.base.File, which provides additional features for dealing with images. """ def _get...
bsd-3-clause
DayGitH/Python-Challenges
DailyProgrammer/DP20141231B.py
1
1290
""" [2014-12-31] Challenge #195 [Intermediate] Math Dice https://www.reddit.com/r/dailyprogrammer/comments/2qxrtk/20141231_challenge_195_intermediate_math_dice/ #Description: Math Dice is a game where you use dice and number combinations to score. It's a neat way for kids to get mathematical dexterity. In the game, y...
mit
repotvsupertuga/repo
plugin.video.jami/resources/lib/libraries/f4mproxy/flvlib/scripts/retimestamp_flv.py
98
8234
import os import sys import shutil import logging import tempfile from optparse import OptionParser from flvlib import __versionstr__ from flvlib.constants import TAG_TYPE_AUDIO, TAG_TYPE_VIDEO, TAG_TYPE_SCRIPT from flvlib.constants import AAC_PACKET_TYPE_SEQUENCE_HEADER from flvlib.constants import H264_PACKET_TYPE_...
gpl-2.0
mzizzi/ansible
lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_list.py
36
4523
#!/usr/bin/python # coding: utf-8 -*- # (c) 2017, Wayne Witzel III <wayne@riotousliving.com> # # This module 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 opti...
gpl-3.0
abspoel/YouCompleteMe
third_party/pythonfutures/test_futures.py
74
24336
from __future__ import with_statement import os import subprocess import sys import threading import functools import contextlib import logging import re import time from concurrent import futures from concurrent.futures._base import ( PENDING, RUNNING, CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED, Future) try: ...
gpl-3.0
brython-dev/brython
www/src/Lib/test/test_asyncore.py
3
26460
import asyncore import unittest import select import os import socket import sys import time import errno import struct import threading from test import support from test.support import socket_helper from io import BytesIO if support.PGO: raise unittest.SkipTest("test is not helpful for PGO") HAS_UNIX_SOCKETS ...
bsd-3-clause
AladdinSonni/youtube-dl
youtube_dl/extractor/clubic.py
120
1882
# coding: utf-8 from __future__ import unicode_literals import json import re from .common import InfoExtractor from ..utils import ( clean_html, qualities, ) class ClubicIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?clubic\.com/video/[^/]+/video.*-(?P<id>[0-9]+)\.html' _TEST = { 'url'...
unlicense
chauhanhardik/populo
common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_modulev1.py
76
53383
import json import logging import traceback from lxml import etree from xmodule.timeinfo import TimeInfo from xmodule.capa_module import ComplexEncoder from xmodule.progress import Progress from xmodule.stringify import stringify_children from xmodule.open_ended_grading_classes import self_assessment_module from xmodul...
agpl-3.0
StefanRijnhart/OpenUpgrade
addons/l10n_in_hr_payroll/report/report_payslip_details.py
374
1791
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
agpl-3.0
synappio/chapman
chapman/tests/test_base.py
1
1260
import unittest import ming from mongotools import mim from chapman.task import Task, Function from chapman import model as M class TaskTest(unittest.TestCase): def setUp(self): M.doc_session.bind = ming.create_datastore( 'test', bind=ming.create_engine( use_class=lambda *a,*...
mit
cdawei/shogun
examples/undocumented/python_modular/modelselection_parameter_tree_modular.py
14
3540
#!/usr/bin/env python # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Written (W) 2011-2012 Heiko Strathmann # Cop...
gpl-3.0
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/idlelib/configSectionNameDialog.py
37
3979
""" Dialog that allows user to specify a new config file section name. Used to get new highlight theme and keybinding set names. The 'return value' for the dialog, used two placed in configDialog.py, is the .result attribute set in the Ok and Cancel methods. """ from Tkinter import * import tkMessageBox class GetCfgSec...
gpl-3.0
RafaelTorrealba/odoo
addons/base_report_designer/plugin/openerp_report_designer/bin/script/Repeatln.py
293
13228
######################################################################### # # 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
stackArmor/security_monkey
security_monkey/tests/watchers/test_route53.py
2
1859
# Copyright 2016 Bridgewater Associates # # 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 appli...
apache-2.0
ryfeus/lambda-packs
Keras_tensorflow_nightly/source2.7/numpy/ma/mrecords.py
25
27435
""":mod:`numpy.ma..mrecords` Defines the equivalent of :class:`numpy.recarrays` for masked arrays, where fields can be accessed as attributes. Note that :class:`numpy.ma.MaskedArray` already supports structured datatypes and the masking of individual fields. .. moduleauthor:: Pierre Gerard-Marchant """ from __future...
mit
Ernesto99/odoo
addons/hr_attendance/wizard/hr_attendance_error.py
377
2896
# -*- 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
sysalexis/kbengine
kbe/res/scripts/common/Lib/test/audiotests.py
72
12345
from test.support import findfile, TESTFN, unlink import unittest import array import io import pickle import sys class UnseekableIO(io.FileIO): def tell(self): raise io.UnsupportedOperation def seek(self, *args, **kwargs): raise io.UnsupportedOperation class AudioTests: close_fd = False...
lgpl-3.0
youprofit/scikit-image
doc/examples/plot_regionprops.py
23
1297
""" ========================= Measure region properties ========================= This example shows how to measure properties of labelled image regions. """ import math import matplotlib.pyplot as plt import numpy as np from skimage.draw import ellipse from skimage.measure import label, regionprops from skimage.tra...
bsd-3-clause
tanghaibao/goatools
goatools/godag/consts.py
1
1226
"""GO-DAG constants.""" __copyright__ = "Copyright (C) 2010-2019, DV Klopfenstein, H Tang, All rights reserved." __author__ = "DV Klopfenstein" NAMESPACE2NS = { 'biological_process' : 'BP', 'molecular_function' : 'MF', 'cellular_component' : 'CC'} NS2NAMESPACE = { 'BP': 'biological_process', 'MF...
bsd-2-clause
jfantom/incubator-airflow
tests/ti_deps/deps/test_dag_unpaused_dep.py
38
1342
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
bpow/gemini
gemini/infotag.py
9
3487
""" Utility functions for extracting specific attributes from the VCF INFO field. """ def _safe_single_attr(x): """Handle cleaning of attributes after extraction: - '.'s to indicate None - tuples where we expect a single value """ if x is None or x is ".": return None elif ...
mit
NervanaSystems/neon
examples/imagenet/network_alexnet.py
2
2788
from neon.initializers import Gaussian, Constant from neon.layers import Conv, Pooling, GeneralizedCost, Affine, Dropout, LRN from neon.transforms import Rectlin, Softmax, CrossEntropyMulti from neon.models import Model def create_network(): layers = [ Conv((11, 11, 64), init=Gaussian(scale=0.01), bias=Co...
apache-2.0
Noviat/odoo
addons/gamification/__openerp__.py
299
2464
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 OpenERP SA (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
seansu4you87/kupo
projects/molt/venv/lib/python2.7/site-packages/pip/compat/ordereddict.py
141
4110
# Copyright (c) 2009 Raymond Hettinger # # 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, modify, merge, # publish,...
mit
ostcar/OpenSlides
server/openslides/motions/migrations/0010_auto_20180822_1042.py
9
1780
# Generated by Django 2.1 on 2018-08-22 08:42 from decimal import Decimal import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("motions", "0009_motionversion_modified_final_version")] operations = [ migrations.AlterField( ...
mit
kg-bot/SupyBot
plugins/Website/test.py
1
2073
### # Copyright (c) 2011, Valentin Lorentz # 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...
gpl-3.0
herow/planning_qgis
python/plugins/processing/algs/saga/versioncheck.py
10
2438
import os import subprocess def getAlgParams(f): params = [] booleanparams = [] numparams = [] lines = open(f) line = lines.readline().strip('\n').strip() name = line if '|' in name: tokens = name.split('|') cmdname = tokens[1] else: cmdname = name line = line...
gpl-2.0
romeoabulencia/booking_order
models/employee.py
1
1191
from odoo import api from odoo import fields from odoo import models class hr_employee(models.Model): _inherit="hr.employee" @api.multi def get_employee_calendar_events(self): target_user_id = [] target_partner_id = [] if self.user_id: target_user_id.append...
gpl-3.0
pgroudas/pants
src/python/pants/backend/jvm/tasks/jvm_compile/execution_graph.py
1
8512
# coding=utf-8 # Copyright 2015 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 Queue as queu...
apache-2.0
TimYi/django
django/views/debug.py
50
46821
from __future__ import unicode_literals import re import sys import types from django.conf import settings from django.core.urlresolvers import Resolver404, resolve from django.http import HttpResponse, HttpResponseNotFound from django.template import Context, Engine, TemplateDoesNotExist from django.template.default...
bsd-3-clause
pla1/plugin.image.500px
resources/lib/fivehundredpx/utils.py
2
2626
from fivehundredpx.settings import * from fivehundredpx.errors import * import os, mimetypes import urllib class Util(object): @staticmethod def replace_space(value): return str(value).replace(" ", "+") @staticmethod def encode_string(value): return value.encode('utf-8') if isinstanc...
gpl-2.0
mbayon/TFG-MachineLearning
vbig/lib/python2.7/site-packages/django/core/cache/backends/dummy.py
629
1213
"Dummy cache backend" from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache class DummyCache(BaseCache): def __init__(self, host, *args, **kwargs): BaseCache.__init__(self, *args, **kwargs) def add(self, key, value, timeout=DEFAULT_TIMEOUT, version=None): key = self.make_key...
mit
mttr/django
tests/check_framework/tests_1_8_compatibility.py
176
1121
from django.core.checks.compatibility.django_1_8_0 import \ check_duplicate_template_settings from django.test import SimpleTestCase from django.test.utils import override_settings class CheckDuplicateTemplateSettingsTest(SimpleTestCase): def test_not_raised_if_no_templates_setting(self): self.assert...
bsd-3-clause
boundlessgeo/qgis-webappbuilder-plugin
webappbuilder/treelayeritem.py
1
12085
# -*- coding: utf-8 -*- # # (c) 2016 Boundless, http://boundlessgeo.com # This code is licensed under the GPL 2.0 license. # from PyQt4.QtGui import * from PyQt4.QtCore import * import os from qgis.core import * from popupeditor import PopupEditorDialog from utils import * from exceptions import WrongValueException fro...
gpl-3.0
meejah/AutobahnPython
examples/twisted/wamp/app/calculator/calculator.py
3
3319
############################################################################### # # The MIT License (MIT) # # Copyright (c) Tavendo GmbH # # 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 with...
mit
palominodb/PalominoDB-Public-Code-Repository
vfa/pdb_dump.py
1
18188
#!/usr/bin/python # purpose perform a parallel backup of databases. # # Copyright 2013 Palominodb # # 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/l...
gpl-2.0
andr00ib/3.0.94-victor-kernel
Documentation/target/tcm_mod_builder.py
3119
42754
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0