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
Aloomaio/googleads-python-lib
examples/ad_manager/v201811/premium_rate_service/get_all_premium_rates.py
1
1967
#!/usr/bin/env python # # Copyright 2016 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 requir...
apache-2.0
tryolabs/luminoth
luminoth/utils/bbox_transform_tf.py
1
4791
import tensorflow as tf def get_width_upright(bboxes): with tf.name_scope('BoundingBoxTransform/get_width_upright'): bboxes = tf.cast(bboxes, tf.float32) x1, y1, x2, y2 = tf.split(bboxes, 4, axis=1) width = x2 - x1 + 1. height = y2 - y1 + 1. # Calculate up right point of b...
bsd-3-clause
KonradBreitsprecher/espresso
testsuite/coulomb_tuning.py
1
3369
# # Copyright (C) 2017 The ESPResSo project # # This file is part of ESPResSo. # # ESPResSo is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ver...
gpl-3.0
saurabh6790/test-med-app
accounts/report/item_wise_sales_register/item_wise_sales_register.py
14
3553
# 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 webnotes from webnotes.utils import flt def execute(filters=None): if not filters: filters = {} columns = get_columns() last_col = len(col...
agpl-3.0
Weihonghao/ECM
Vpy34/lib/python3.5/site-packages/tensorflow/python/framework/importer.py
8
18388
# 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...
agpl-3.0
MiltosD/CEFELRC
lib/python2.7/site-packages/django/contrib/localflavor/in_/forms.py
309
1741
""" India-specific Form helpers. """ from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select from django.utils.encoding import smart_unicode from django.utils.translation import gettext import re class INZipCodeField(RegexFiel...
bsd-3-clause
simeonmiteff/junkbox
wbx.py
1
1978
#!/usr/bin/python # wbx.py - dump MikroTik winbox addresses.wbx file format # Mon Oct 13 10:03:26 SAST 2008 import sys def munge_pair(pair): """ Convert integer values to integers """ name, value, offset = pair if name in ['secure-mode', 'keep-pwd']: value = ord(value) return (name, value, off...
apache-2.0
llooker/python_sdk
test/test_prefetch_access_filter_value.py
1
2462
# coding: utf-8 """ Looker API 3.0 Reference ### Authorization The Looker API uses Looker **API3** credentials for authorization and access control. Looker admins can create API3 credentials on Looker's **Admin/Users** page. Pass API3 credentials to the **/login** endpoint to obtain a temporary access_token....
mit
bukzor/sympy
sympy/galgebra/debug.py
52
4148
# sympy/galgebra/debug.py from __future__ import print_function from itertools import islice def ostr(obj, dict_mode=False): """ Recursively convert iterated object (list/tuple/dict/set) to string. """ def ostr_rec(obj, dict_mode): global ostr_s if isinstance(obj, tuple): ...
bsd-3-clause
fujunwei/chromium-crosswalk
tools/memory_inspector/memory_inspector/classification/mmap_classifier_unittest.py
109
3441
# Copyright 2014 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 unittest from memory_inspector.classification import mmap_classifier from memory_inspector.core import memory_map _TEST_RULES = """ [ { 'name': '...
bsd-3-clause
natebeacham/saml2
src/saml2/__init__.py
1
32985
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2006 Google Inc. # Copyright (C) 2009 Umeå University # # 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.apa...
bsd-2-clause
crs4/pydoop
examples/avro/py/avro_container_dump_results.py
2
1109
# BEGIN_COPYRIGHT # # Copyright 2009-2021 CRS4. # # 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 ...
apache-2.0
google-research/seed_rl
football/vtrace_main.py
1
1875
# coding=utf-8 # Copyright 2019 The SEED Authors # 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
Limezero/libreoffice
wizards/com/sun/star/wizards/ui/DocumentPreview.py
6
3783
# # This file is part of the LibreOffice project. # # 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/. # # This file incorporates work covered by the following license noti...
gpl-3.0
amorwilliams/chameleon
client/tools/buildscript/chameleon_upgrade.py
4
1737
#encoding=utf-8 import os, zipfile, sys BASEDIR = os.path.split(os.path.abspath(__file__))[0] class UpgradeEnv(object): def __init__(self, basedir): self.basedir = basedir def upgradeFromZip(self, filename): with zipfile.ZipFile(filename) as fs: try: with fs.open('...
mit
gberl001/vlfeat
python/vlfeat/misc/colorspaces.py
6
3124
import numpy def vl_xyz2lab(I,il='E'): # VL_XYZ2LAB Convert XYZ color space to LAB # J = VL_XYZ2LAB(I) converts the image from XYZ format to LAB format. # # VL_XYZ2LAB(I,IL) uses one of the illuminants A, B, C, E, D50, D55, # D65, D75, D93. The default illuminant is E. # # See also:: VL_XYZ2LUV(), VL_HELP(). ...
gpl-2.0
CeltonMcGrath/TACTIC
src/pyasm/deprecated/flash/widget/flash_status_filter.py
6
3018
########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
epl-1.0
EvenStrangest/tensorflow
tensorflow/python/framework/function_test.py
8
20920
# 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
bregman-arie/ansible
lib/ansible/modules/cloud/amazon/aws_ssm_parameter_store.py
18
7495
#!/usr/bin/python # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'status': ['preview'], 'supported_by': 'community', 'metadata_version': '1.1'} DOCUMENTATION = ''' --- modul...
gpl-3.0
a-doumoulakis/tensorflow
tensorflow/python/debug/cli/tensor_format_test.py
41
37994
# 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
jonparrott/google-cloud-python
api_core/tests/unit/future/test__helpers.py
3
1334
# Copyright 2017, Google 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 writing, ...
apache-2.0
charitychain/Charitychain
Simplechaindb/clusterdeploy/write_keypairs_file.py
1
1603
"""A Python 3 script to write a file with a specified number of keypairs, using bigchaindb.crypto.generate_key_pair() The written file is always named keypairs.py and it should be interpreted as a Python 2 script. Usage: $ python3 write_keypairs_file.py num_pairs Using the list in other Python scripts: # in a...
apache-2.0
jakevdp/supersmoother
supersmoother/windowed_sum.py
2
9106
import numpy as np def windowed_sum_slow(arrays, span, t=None, indices=None, tpowers=0, period=None, subtract_mid=False): """Compute the windowed sum of the given arrays. This is a slow function, used primarily for testing and validation of the faster version of ``windowed_sum()`` ...
bsd-2-clause
mcardillo55/django
tests/signals/tests.py
311
10273
from __future__ import unicode_literals from django.db import models from django.db.models import signals from django.dispatch import receiver from django.test import TestCase from django.utils import six from .models import Author, Book, Car, Person class BaseSignalTest(TestCase): def setUp(self): # Sa...
bsd-3-clause
haoyunfeix/crosswalk-test-suite
stability/stability-lowresource-android-tests/lowresource/Webapp_Operations_UnderLowDisk.py
7
9653
#!/usr/bin/env python # coding=utf-8 # # Copyright (c) 2015 Intel Corporation. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of works must retain the original copyright notice, this # list of c...
bsd-3-clause
no-zone6/pimouse_ros_2
scripts/motors2.py
1
2299
#!/usr/bin/env python #enchoding: utf8 import sys, rospy, math from pimouse_ros_2.msg import MotorFreqs from geometry_msgs.msg import Twist from std_srvs.srv import Trigger, TriggerResponse class Motor(): def __init__(self): if not self.set_power(False): sys.exit(1) rospy.on_shutdown(self.set_power) sel...
gpl-3.0
jeasoft/odoo
addons/portal/wizard/__init__.py
447
1098
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2011 OpenERP S.A (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
Omegaice/smartcontainers
sc/configmanager.py
3
3152
"""Configuration manager for reading and writing SC configuration files.""" import simplejson as json import os import rdflib __author__ = 'cwilli34' # noinspection PyBroadException,PyBroadException class ConfigManager(object): """ Configuration File Creator """ def __init__(self, filename='sc.config'): ...
apache-2.0
mpare002/HackTech_2017
env/Lib/site-packages/flask/blueprints.py
773
16320
# -*- coding: utf-8 -*- """ flask.blueprints ~~~~~~~~~~~~~~~~ Blueprints are the recommended way to implement larger or more pluggable applications in Flask 0.7 and later. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from functools import update_wrap...
mit
Krossom/python-for-android
python3-alpha/python3-src/Misc/Vim/syntax_test.py
82
1457
"""Test file for syntax highlighting of editors. Meant to cover a wide range of different types of statements and expressions. Not necessarily sensical or comprehensive (assume that if one exception is highlighted that all are, for instance). Extraneous trailing whitespace can't be tested because of svn pre-commit ho...
apache-2.0
starrybeam/samba
source4/dsdb/tests/python/token_group.py
26
20392
#!/usr/bin/env python # -*- coding: utf-8 -*- # test tokengroups attribute against internal token calculation import optparse import sys import os sys.path.insert(0, "bin/python") import samba from samba.tests.subunitrun import SubunitOptions, TestProgram import samba.getopt as options from samba.auth import syste...
gpl-3.0
weimingtom/python-for-android
python3-alpha/python3-src/Lib/test/test_pkgimport.py
57
2757
import os import sys import shutil import string import random import tempfile import unittest from imp import cache_from_source from test.support import run_unittest class TestImport(unittest.TestCase): def __init__(self, *args, **kw): self.package_name = 'PACKAGE_' while self.package_name in sy...
apache-2.0
rcbops/python-django-buildpackage
django/test/simple.py
150
15012
import unittest as real_unittest from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db.models import get_app, get_apps from django.test import _doctest as doctest from django.test.utils import setup_test_environment, teardown_test_environment from django.test.testcases ...
bsd-3-clause
Meee32/Net-kgw
share/qt/extract_strings_qt.py
2945
1844
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt4 stringdefs so that they can be picked up by Qt linguist. ''' from subprocess import Popen, PIPE import glob import operator OUT_CPP="src/qt/bitcoinstrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' format produced by x...
mit
msmolens/VTK
Interaction/Widgets/Testing/Python/TestSphereWidget.py
21
14176
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' ========================================================================= Program: Visualization Toolkit Module: TestNamedColorsIntegration.py Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www....
bsd-3-clause
drexly/openhgsenti
lib/django/db/models/fields/reverse_related.py
106
11166
""" "Rel objects" for related fields. "Rel objects" (for lack of a better name) carry information about the relation modeled by a related field and provide some utility functions. They're stored in the ``remote_field`` attribute of the field. They also act as reverse fields for the purposes of the Meta API because th...
apache-2.0
peteralfonso/platform_kernel_tegra
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
timduru/platform-external-chromium_org
chrome/test/install_test/chrome_options.py
36
1375
# 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. """Chrome-specific options for configuring a ChromeDriver instance.""" import base64 class ChromeOptions(object): """Chrome-specific options for con...
bsd-3-clause
TeamEOS/external_chromium_org
build/android/buildbot/bb_run_bot.py
10
11374
#!/usr/bin/env python # # Copyright (c) 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. import collections import copy import json import os import pipes import re import subprocess import sys import bb_utils sys.pa...
bsd-3-clause
tkinz27/ansible
lib/ansible/inventory/script.py
80
6338
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
chugunovyar/factoryForBuild
env/lib/python2.7/site-packages/numpy/lib/tests/test_io.py
29
77244
from __future__ import division, absolute_import, print_function import sys import gzip import os import threading from tempfile import NamedTemporaryFile import time import warnings import gc from io import BytesIO from datetime import datetime import numpy as np import numpy.ma as ma from numpy.lib._iotools import ...
gpl-3.0
grammarly/browser-extensions
firefox/addon-sdk/python-lib/cuddlefish/tests/test_init.py
34
9626
# 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 os, unittest, shutil import zipfile from StringIO import StringIO from cuddlefish import initializer from cuddlef...
bsd-3-clause
dscho/hg
tests/test-minirst.py
1
5259
from __future__ import absolute_import, print_function import pprint from mercurial import ( minirst, ) def debugformat(text, form, **kwargs): if form == 'html': print("html format:") out = minirst.format(text, style=form, **kwargs) else: print("%d column format:" % form) ou...
gpl-2.0
rkq/cxxexp
third-party/src/boost_1_56_0/tools/build/src/tools/cast.py
45
2707
# Status: ported # Base revision: 64432. # Copyright 2005-2010 Vladimir Prus. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) # Defines main target 'cast', used to change type for target. For example, in Qt # libra...
mit
flavour/RedHat
modules/geopy/geocoders/yahoo.py
46
3135
""" Wrapper to the Yahoo's new PlaceFinder API. (doc says that the API RELEASE 1.0 (22 JUNE 2010)) """ import xml.dom.minidom from geopy import util from geopy import Point from urllib import urlencode from urllib2 import urlopen from geopy.geocoders.base import Geocoder try: import json except ImportError: try...
mit
adfernandes/mbed
tools/host_tests/stdio_auto.py
13
2147
""" mbed SDK Copyright (c) 2011-2013 ARM Limited SPDX-License-Identifier: Apache-2.0 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
shuishoudage/CloudappCLI
env/lib/python2.7/site-packages/setuptools/command/rotate.py
389
2164
from distutils.util import convert_path from distutils import log from distutils.errors import DistutilsOptionError import os import shutil from setuptools.extern import six from setuptools import Command class rotate(Command): """Delete older distributions""" description = "delete older distributions, kee...
gpl-3.0
paypal/keystone
tests/test_import_legacy.py
4
4145
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 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 requ...
apache-2.0
cs564/heron
heron/tools/tracker/tests/python/topology_helpers_unittest.py
8
10177
''' topology_helpers_unittest.py ''' # pylint: disable=missing-docstring import unittest2 as unittest from heron.common.src.python import constants from heron.tools.tracker.src.python import topology_helpers from mock_proto import MockProto class TopologyHelpersTest(unittest.TestCase): def setUp(self): self.moc...
apache-2.0
ertugruldeveloper/hesapmak1
hesapmak1.py
1
14146
# hesapmak1 print("\nSürüm kontrolü yapıldı, 3.X sürümü kullanılıyor\n") karşılama = open("karşılama.txt","r") print("\n",karşılama.read()) karşılama.close() def kimlik(): #KİMLİK FONKSİYONU print("1.) Merhabalar Yeni Kullanıcı Detaylı Kimlik Kartını Oluşturmak\n\ ister misin? Evet için 'E', Hayır içi...
gpl-3.0
trivoldus28/pulsarch-verilog
tools/local/bas-release/bas,3.9/lib/python/lib/python2.3/email/MIMEMessage.py
11
1244
# Copyright (C) 2001,2002 Python Software Foundation # Author: barry@zope.com (Barry Warsaw) """Class representing message/* MIME documents. """ from email import Message from email.MIMENonMultipart import MIMENonMultipart class MIMEMessage(MIMENonMultipart): """Class representing message/* MIME documents."""...
gpl-2.0
SnappleCap/oh-mainline
vendor/packages/scrapy/scrapy/tests/test_selector_libxml2.py
17
3028
""" Selectors tests, specific for libxml2 backend """ import unittest from scrapy.http import TextResponse, HtmlResponse, XmlResponse from scrapy.selector.libxml2sel import XmlXPathSelector, HtmlXPathSelector, \ XPathSelector from scrapy.selector.document import Libxml2Document from scrapy.utils.test import libxm...
agpl-3.0
Yen-Chung-En/w16b_test
static/Brython3.1.1-20150328-091302/Lib/importlib/_bootstrap.py
623
63710
"""Core implementation of import. This module is NOT meant to be directly imported! It has been designed such that it can be bootstrapped into Python as the implementation of import. As such it requires the injection of specific modules and attributes in order to work. One should use importlib as the public-facing ver...
agpl-3.0
maelg/RaspiNotifier
checker/facebook.py
1
1031
import RPi.GPIO as GPIO, subprocess #if( int(time.strftime('%H')) >= 8 and int(time.strftime('%H')) <= 21 ): def checkFacebook(): nbr_notif = int(open("/home/pi/RaspiNotifier/nbr/nbr_facebook.txt", "r").read()) GPIO_PIN = int(config.get("Facebook", "gpioPin")) GPIO.setmode(GPIO.BOARD) GPIO.setup(GPIO_PIN,...
gpl-2.0
openshift/openshift-tools
ansible/roles/lib_openshift_3.2/library/oc_process.py
6
37409
#!/usr/bin/env python # pylint: disable=too-many-lines # ___ ___ _ _ ___ ___ _ _____ ___ ___ # / __| __| \| | __| _ \ /_\_ _| __| \ # | (_ | _|| .` | _|| / / _ \| | | _|| |) | # \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____ # | \ / _ \ | \| |/ _ \_ _| | __| \_ _|_ _| # | |) | (_) ...
apache-2.0
boxuk/ansible-boxuk-modules-passwordstate
passwordstate_password/passwordstate_password.py
1
9460
#!/usr/bin/python """ PasswordState Ansible Module """ from ansible.module_utils.basic import * import urllib import urllib2 import json class PasswordIdException(Exception): msg = 'Either the password id or the match ' \ 'field id and value must be configured' class Password(object): """ Passwor...
mit
nekohayo/snowy
lib/south/management/commands/startmigration.py
4
34660
""" Startmigration command, version 2. """ import sys import os import re import string import random import inspect import parser from optparse import make_option from django.core.management.base import BaseCommand from django.core.management.color import no_style from django.db import models from django.db.models.f...
agpl-3.0
beni55/edx-platform
lms/lib/xblock/test/test_mixin.py
37
14587
""" Tests of the LMS XBlock Mixin """ import ddt from xblock.validation import ValidationMessage from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, TEST_DATA_MIXED_TOY_MODULES...
agpl-3.0
Deester4x4jr/team-altitude
app/user/plugins/shoppingcart/vendor/guzzle/guzzle/docs/conf.py
469
3047
import sys, os from sphinx.highlighting import lexers from pygments.lexers.web import PhpLexer lexers['php'] = PhpLexer(startinline=True, linenos=1) lexers['php-annotations'] = PhpLexer(startinline=True, linenos=1) primary_domain = 'php' # -- General configuration -----------------------------------------------------...
gpl-3.0
klmitch/nova
nova/objects/instance_action.py
3
12223
# 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 agree...
apache-2.0
wli/django-allauth
allauth/socialaccount/providers/oauth2/views.py
1
5403
from __future__ import absolute_import from datetime import timedelta from django.core.exceptions import PermissionDenied from django.http import HttpResponseRedirect from django.utils import timezone from allauth.compat import reverse from allauth.exceptions import ImmediateHttpResponse from allauth.utils import bu...
mit
Work4Labs/lettuce
tests/integration/lib/Django-1.3/django/contrib/redirects/middleware.py
447
1105
from django.contrib.redirects.models import Redirect from django import http from django.conf import settings class RedirectFallbackMiddleware(object): def process_response(self, request, response): if response.status_code != 404: return response # No need to check for a redirect for non-404 re...
gpl-3.0
MTG/acousticbrainz-client
abz/vendor/requests/packages/chardet/jisfreq.py
3131
47315
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
gpl-3.0
birm/Elemental
python/blas_like/level3.py
2
29133
# # Copyright (c) 2009-2015, Jack Poulson # All rights reserved. # # This file is part of Elemental and is under the BSD 2-Clause License, # which can be found in the LICENSE file in the root directory, or at # http://opensource.org/licenses/BSD-2-Clause # from ..core import * # BLAS 3 # ====== # Gemm # ---- ...
bsd-3-clause
pyjs/pyjs
pyjswidgets/pyjamas/ui/StackPanel.py
9
5080
# Copyright 2006 James Tauber and contributors # Copyright (C) 2009, 2010 Luke Kenneth Casson Leighton <lkcl@lkcl.net> # # 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
jbedorf/tensorflow
tensorflow/contrib/image/python/ops/sparse_image_warp.py
19
8517
# Copyright 2018 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
britcey/ansible
lib/ansible/modules/notification/mattermost.py
49
5291
#!/usr/bin/python # -*- coding: utf-8 -*- # Benjamin Jolivot <bjolivot@gmail.com> # Inspired by slack module : # # (c) 2017, Steve Pletcher <steve@steve-pletcher.com> # # (c) 2016, René Moser <mail@renemoser.net> # # (c) 2015, Stefan Berggren <nsg@nsg.cc> # # (c) 2014, Ramon de la Fuente <ramon@delafuente....
gpl-3.0
zuphilip/ocropy
ocrolib/exceptions.py
5
2139
import inspect import numpy def summary(x): """Summarize a datatype as a string (for display and debugging).""" if type(x)==numpy.ndarray: return "<ndarray %s %s>"%(x.shape,x.dtype) if type(x)==str and len(x)>10: return '"%s..."'%x if type(x)==list and len(x)>10: return '%s...'%...
apache-2.0
ksrajkumar/openerp-6.1
openerp/addons/sale/report/sale_order.py
10
1447
# -*- 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
mu-editor/mu
tests/test_logic.py
2
115644
# -*- coding: utf-8 -*- """ Tests for the Editor and REPL logic. """ import sys import os import atexit import codecs import contextlib import json import locale import random import re import shutil import subprocess import tempfile from unittest import mock import uuid import pytest import mu.config import mu.logic ...
gpl-3.0
doirisks/dori
models/10.1161:CIRCULATIONAHA.108.816694/example.py
1
5090
""" example.py by Ted Morin contains example code for 30-year CVD calculator - all models 10.1161/CIRCULATIONAHA.108.816694 2009 Predicting the Thirty-year Risk of Cardiovascular Disease The Framingham Heart Study """ #ismale,age,sbp,antihyp,smoke,diabet,totchol,hdlchol #tests from modela import model as a from mod...
gpl-3.0
Br1an6/ACS_Netplumber_Implementation
hassel-c/net_plumbing/examples/template/run_reachability.py
5
1972
''' Created on Aug 1, 2012 @author: Peyman Kazemian ''' from examples.utils.network_loader import load_network from config_parser.cisco_router_parser import cisco_router from utils.wildcard import wildcard_create_bit_repeat from utils.wildcard_utils import set_header_field from headerspace.hs import headerspace from ...
gpl-2.0
keiranFTW/android_kernel_sony_msm8660
arch/ia64/scripts/unwcheck.py
13143
1714
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
gpl-2.0
remh/dd-agent
transaction.py
22
7764
# stdlib from datetime import datetime, timedelta import logging from operator import attrgetter import sys import time # project from checks.check_status import ForwarderStatus from util import get_tornado_ioloop, plural log = logging.getLogger(__name__) FLUSH_LOGGING_PERIOD = 20 FLUSH_LOGGING_INITIAL = 5 class Tr...
bsd-3-clause
atosorigin/ansible
test/units/module_utils/common/parameters/test_check_arguments.py
11
2059
# -*- coding: utf-8 -*- # Copyright (c) 2020 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.common.parameters import get_unsuppo...
gpl-3.0
kabuku/blender-python
blenderlib/bpy.props.py
1
10232
'''Property Definitions (bpy.props) This module defines properties to extend blenders internal data, the result of these functions is used to assign properties to classes registered with blender and can't be used directly. ''' def BoolProperty(name="", description="", default=False, options={'ANIMATABLE'...
mit
kant/inasafe
safe/postprocessors/building_type_postprocessor.py
4
8986
# -*- coding: utf-8 -*- """**Postprocessors package.** """ __author__ = 'Marco Bernasocchi <marco@opengis.ch>' __revision__ = '$Format:%H$' __date__ = '10/10/2012' __license__ = "GPL" __copyright__ = 'Copyright 2012, Australia Indonesia Facility for ' __copyright__ += 'Disaster Reduction' from collections import Ord...
gpl-3.0
Eivindbergman/Skrapa
libs/chardet/big5prober.py
291
1757
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
gpl-3.0
titienmiami/mmc.repository
plugin.video.tvalacarta/servers/bitshare.py
1
1991
# -*- coding: utf-8 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector para bitshare # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import urlparse,urllib2,urllib,re import os from core impo...
gpl-2.0
QinerTech/QinerApps
openerp/tools/mail.py
1
31289
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from lxml import etree import cgi import logging import lxml.html import lxml.html.clean as clean import random import re import socket import threading import time from email.utils import getaddresses, formataddr impor...
gpl-3.0
a-parhom/edx-platform
common/lib/capa/capa/capa_problem.py
10
50215
# # File: capa/capa_problem.py # # Nomenclature: # # A capa Problem is a collection of text and capa Response questions. # Each Response may have one or more Input entry fields. # The capa problem may include a solution. # """ Main module which shows problems (of "capa" type). This is used by capa_module. """ impor...
agpl-3.0
lumig242/Hue-Integration-with-CDAP
desktop/core/ext-py/Django-1.6.10/django/contrib/auth/tests/test_remote_user.py
47
8774
from datetime import datetime from django.conf import settings from django.contrib.auth import authenticate from django.contrib.auth.backends import RemoteUserBackend from django.contrib.auth.models import User from django.contrib.auth.tests.utils import skipIfCustomUser from django.test import TestCase from django.ut...
apache-2.0
sergey-shandar/autorest
src/generator/AutoRest.Python.Tests/AcceptanceTests/dictionary_tests.py
8
11966
# -------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All rights reserved. # # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the ""Software""),...
mit
Nate-Devv/Tuxemon
tuxemon/core/components/eztext.py
3
12040
#!/usr/bin/python # -*- coding: utf-8 -*- # # Tuxemon # Copyright (C) 2014, William Edwards <shadowapex@gmail.com>, # Benjamin Bean <superman2k5@gmail.com> # # This file is part of Tuxemon. # # Tuxemon is free software: you can redistribute it and/or modify # it under the terms of the GNU ...
gpl-3.0
clemkoa/scikit-learn
examples/covariance/plot_outlier_detection.py
15
5121
""" ========================================== Outlier detection with several methods. ========================================== When the amount of contamination is known, this example illustrates three different ways of performing :ref:`outlier_detection`: - based on a robust estimator of covariance, which is assum...
bsd-3-clause
backtou/longlab
gnuradio-core/src/python/gnuradio/gr/qa_copy.py
18
1851
#!/usr/bin/env python # # Copyright 2009,2010 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
dimdung/boto
tests/unit/vpc/test_internetgateway.py
114
6080
from tests.unit import unittest from tests.unit import AWSMockServiceTestCase from boto.vpc import VPCConnection, InternetGateway class TestDescribeInternetGateway(AWSMockServiceTestCase): connection_class = VPCConnection def default_body(self): return b""" <DescribeInternetGatewaysResp...
mit
tanderegg/ansible-modules-core
cloud/amazon/ec2_facts.py
110
6444
#!/usr/bin/python # -*- coding: utf-8 -*- # 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. #...
gpl-3.0
SantosDevelopers/sborganicos
venv/lib/python3.5/site-packages/django/contrib/gis/measure.py
100
12463
# Copyright (c) 2007, Robert Coup <robert.coup@onetrackmind.co.nz> # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, #...
mit
diagramsoftware/odoo
addons/l10n_tr/__openerp__.py
259
2056
# -*- 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
edxnercel/edx-platform
lms/djangoapps/course_wiki/tests/test_tab.py
158
2454
""" Tests for wiki views. """ from django.conf import settings from django.test.client import RequestFactory from courseware.tabs import get_course_tab_list from student.tests.factories import AdminFactory, UserFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tes...
agpl-3.0
edulramirez/nova
nova/weights.py
70
4450
# Copyright (c) 2011-2012 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 # # Un...
apache-2.0
Fizzixnerd/frontdown
installer.py
1
1654
import subprocess class InstallError(Exception): pass class AptError(InstallError): pass class YumError(InstallError): pass class UnsupportedInstallerError(InstallError): pass class Installer: """Abstract Base Class for an installer. Represents the installation system for the current ...
gpl-3.0
darmaa/odoo
addons/base_import/test_models.py
97
2366
from openerp.osv import orm, fields def name(n): return 'base_import.tests.models.%s' % n class char(orm.Model): _name = name('char') _columns = { 'value': fields.char('unknown', size=None) } class char_required(orm.Model): _name = name('char.required') _columns = { 'value': fie...
agpl-3.0
agusc/scrapy
tests/test_spidermiddleware_offsite.py
113
2551
from unittest import TestCase from six.moves.urllib.parse import urlparse from scrapy.http import Response, Request from scrapy.spiders import Spider from scrapy.spidermiddlewares.offsite import OffsiteMiddleware from scrapy.utils.test import get_crawler class TestOffsiteMiddleware(TestCase): def setUp(self): ...
bsd-3-clause
kontais/EFI-MIPS
ToolKit/cmds/python/Lib/stringprep.py
12
13492
# This file is generated by mkstringprep.py. DO NOT EDIT. """Library that exposes various tables found in the StringPrep RFC 3454. There are two kinds of tables: sets, for which a member test is provided, and mappings, for which a mapping function is provided. """ import unicodedata assert unicodedata.unidata_versio...
bsd-3-clause
bhavin04890/finaldashboard
modules/savage/graph/__init__.py
24
9731
from base import BaseGraph, UnifiedGraph from canvas import ScatterCanvas, DoubleScatterCanvas, BarCanvas, HorizontalBarCanvas, PieCanvas, LineCanvas from axes import YAxis from ..utils.struct import Vector as V from ..graphics.utils import ViewBox, Translate, Rotate, addAttr, blank, boolean from ..graphics.color imp...
mit
lianqiw/maos
scripts/interface.py
1
12202
#!/Usr/bin/env python #Use ctypes to interface with C libraries #POINTER is the class type of pointer #pointer() acts on actual array, while POINTER() works on class type. #pointer(cell(arr)) #creates cell Structure for np.array type arr and makes a pointer #pcell=POINTER(cell) ; pcell() #Creates a class for cell Stru...
gpl-3.0
Chilledheart/gyp
test/compiler-override/gyptest-compiler-env.py
14
3332
#!/usr/bin/env python # Copyright (c) 2012 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. """ Verifies that the user can override the compiler and linker using CC/CXX/LD environment variables. """ import TestGyp import os import co...
bsd-3-clause
pfnet/chainercv
chainercv/links/model/faster_rcnn/region_proposal_network.py
3
6706
import numpy as np import chainer from chainer.backends import cuda import chainer.functions as F import chainer.links as L from chainercv.links.model.faster_rcnn.utils.generate_anchor_base import \ generate_anchor_base from chainercv.links.model.faster_rcnn.utils.proposal_creator import \ ProposalCreator c...
mit