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
Honry/crosswalk-test-suite
webapi/tct-csp-w3c-tests/csp-py/csp_frame-src_cross-origin_multi_allowed_one-manual.py
30
2514
def main(request, response): import simplejson as json f = file('config.json') source = f.read() s = json.JSONDecoder().decode(source) url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1]) url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0]) _CSP = "frame-src " + url1 + ...
bsd-3-clause
bnoordhuis/suv
deps/gyp/test/mac/gyptest-sourceless-module.py
200
2485
#!/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 bundles that have no 'sources' (pure resource containers) work. """ import TestGyp import sys if sys.platform == 'darwi...
isc
openstack/tacker
tacker/tests/functional/legacy/vnfm/test_tosca_vnf_reservation.py
1
10315
# # # 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
Kiiv/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/daum.py
16
2754
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urllib_parse, ) class DaumIE(InfoExtractor): _VALID_URL = r'https?://(?:m\.)?tvpot\.daum\.net/(?:v/|.*?clipid=)(?P<id>[^?#&]+)' IE_NAME = 'daum.net' _TESTS = [{ ...
gpl-3.0
okwow123/djangol2
example/env/lib/python2.7/site-packages/pip/_vendor/html5lib/constants.py
249
86469
from __future__ import absolute_import, division, unicode_literals import string import gettext _ = gettext.gettext EOF = None E = { "null-character": _("Null character in input stream, replaced with U+FFFD."), "invalid-codepoint": _("Invalid codepoint in stream."), "incorrectly-placed-so...
mit
fpiotrow/caldav-tester-packaging
src/serverinfo.py
1
8926
## # Copyright (c) 2006-2015 Apple Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
apache-2.0
OsirisSPS/osiris-sps
client/share/plugins/AF9A4C281070FDB0F34CF417CDB168AB38C8A388/lib/lib-tk/SimpleDialog.py
204
3728
"""A simple but flexible modal dialog box.""" from Tkinter import * class SimpleDialog: def __init__(self, master, text='', buttons=[], default=None, cancel=None, title=None, class_=None): if class_: self.root = Toplevel(master, class_=class_) else:...
gpl-3.0
acsone/odoo
addons/bus/bus.py
325
7324
# -*- coding: utf-8 -*- import datetime import json import logging import select import threading import time import random import simplejson import openerp from openerp.osv import osv, fields from openerp.http import request from openerp.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT _logger = logging.getLogger(__...
agpl-3.0
tinloaf/home-assistant
homeassistant/components/camera/usps.py
5
2585
""" Support for a camera made up of usps mail images. For more details about this component, please refer to the documentation at https://home-assistant.io/components/camera.usps/ """ from datetime import timedelta import logging from homeassistant.components.camera import Camera from homeassistant.components.usps im...
apache-2.0
kuiwei/kuiwei
common/lib/xmodule/xmodule/lti_module.py
7
31868
""" Learning Tools Interoperability (LTI) module. Resources --------- Theoretical background and detailed specifications of LTI can be found on: http://www.imsglobal.org/LTI/v1p1p1/ltiIMGv1p1p1.html This module is based on the version 1.1.1 of the LTI specifications by the IMS Global authority. For authenticat...
agpl-3.0
imtapps/django-imt-fork
django/db/models/loading.py
104
10633
"Utilities for loading models and the modules that contain them." from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.datastructures import SortedDict from django.utils.importlib import import_module from django.utils.module_loading import module_has_submodule fro...
bsd-3-clause
bjolivot/ansible
lib/ansible/modules/source_control/git.py
7
42160
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, 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...
gpl-3.0
jmesteve/asterisk
openerp/addons/web/static/lib/py.js/doc/conf.py
543
7829
# -*- coding: utf-8 -*- # # py.js documentation build configuration file, created by # sphinx-quickstart on Sun Sep 9 19:36:23 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All c...
agpl-3.0
pombredanne/rekall
rekall-core/rekall/plugins/windows/registry/getservicesids.py
6
2660
# Rekall Memory Forensics # Copyright (C) 2011 Volatile Systems # Copyright (C) 2011 Jamie Levy (Gleeda) <jamie.levy@gmail.com> # Copyright 2013 Google Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published b...
gpl-2.0
andreadelrio/bedrock
bedrock/grants/grants_db.py
43
39061
# -*- coding: utf-8 -*- from collections import namedtuple Grant = namedtuple('Grant', 'url, grantee, location, title, type, total_support, ' 'year, description, break_down, urls') GRANTS = [ Grant( u'dream-yard', u'DreamYard Project', u'United States', ...
mpl-2.0
MER-GROUP/intellij-community
python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_exitfunc.py
291
2505
""" Convert use of sys.exitfunc to use the atexit module. """ # Author: Benjamin Peterson from lib2to3 import pytree, fixer_base from lib2to3.fixer_util import Name, Attr, Call, Comma, Newline, syms class FixExitfunc(fixer_base.BaseFix): keep_line_order = True BM_compatible = True PATTERN = """ ...
apache-2.0
Nite69/Axis
share/qt/extract_strings_qt.py
1294
1784
#!/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 OUT_CPP="src/qt/bitcoinstrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' format produced by xgettext. Ret...
mit
rnikiforova/GuruTubeProject
GuruTube/libraries/django/middleware/transaction.py
113
2641
import warnings from django.core.exceptions import MiddlewareNotUsed from django.db import connection, 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 ...
bsd-3-clause
MoisesTedeschi/python
Scripts-Python/Modulos-Diversos/deteccao-de-faces-com-python-e-opencv/Lib/site-packages/pip/_vendor/chardet/utf8prober.py
290
2766
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org 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 Reserved. # # Con...
gpl-3.0
dbinetti/barberscore-django
project/apps/bhs/management/commands/update_membercenter.py
3
6525
# Standard Library import datetime import logging import requests # Django from django.core.management.base import BaseCommand from django.utils import timezone from django.contrib.auth import get_user_model from django.apps import apps from django.conf import settings from apps.bhs.tasks import update_person_from_me...
bsd-2-clause
cookbrite/flyingcloud
examples/flask-web-app/salt/app/application/flask_example_app/app.py
1
3120
#!/usr/bin/env python from __future__ import unicode_literals, print_function import logging import os from StringIO import StringIO from logging.handlers import RotatingFileHandler import cv2 from PIL import Image from flask import Flask, make_response, request, send_from_directory, jsonify, render_template, send_...
apache-2.0
grayjay/aenea
client/test/test_proxy_actions.py
7
5890
# This file is part of Aenea # # Aenea is free software: you can redistribute it and/or modify it under # the terms of version 3 of the GNU Lesser General Public License as # published by the Free Software Foundation. # # Aenea is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even ...
lgpl-3.0
Ninjakow/TrueSkill
lib/numpy/f2py/tests/test_array_from_pyobj.py
82
22124
from __future__ import division, absolute_import, print_function import unittest import os import sys import copy from numpy import ( array, alltrue, ndarray, zeros, dtype, intp, clongdouble ) from numpy.testing import ( run_module_suite, assert_, assert_equal, SkipTest ) from numpy.core.multiarray import typ...
gpl-3.0
shermp/KoboPatchGUI
KoboPatchGUI-Qt.py
1
6014
from __future__ import absolute_import, division, print_function, unicode_literals import sys from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QWidget, QApplication, QMainWindow, QMessageBox, QFileDialog, QGridLayout, QHBoxLayout, \ QVBoxLayout, QGroupBox, QCheckBox, QPushButton, QAction from PatchEdit impor...
mit
geary/claslite
web/app/lib/dist/tipfy/appengine/db/properties.py
9
7099
# -*- coding: utf-8 -*- """ tipfy.appengine.db.properties ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Extra db.Model property classes. :copyright: 2011 by tipfy.org. :license: BSD, see LICENSE.txt for more details. """ import hashlib import pickle import decimal from google.appengine.ext import db from tipfy....
unlicense
SamaraCardoso27/eMakeup
backend/venv/lib/python2.7/site-packages/tekton/gae/middleware/json_middleware.py
9
1065
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import json from tekton.gae.middleware import Middleware from tekton.gae.middleware.response import ResponseBase class JsonResponse(ResponseBase): def __init__(self, context, secure_prefix=")]}',\n"): super(JsonResponse, self...
mit
uclouvain/OSIS-Louvain
features/steps/4_offer_create.py
1
4004
# ############################################################################ # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core business i...
agpl-3.0
ksrajkumar/openerp-6.1
openerp/addons/base/res/report/__init__.py
79
1201
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 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
bhuvanshankar/userinfuser
serverside/dao/accounts_dao.py
12
5968
# Copyright (C) 2011, CloudCaptive # # 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 program is distributed i...
gpl-3.0
40223227/2015cdbg6w0622-40223227-
static/Brython3.1.1-20150328-091302/Lib/decimal.py
623
230510
# Copyright (c) 2004 Python Software Foundation. # All rights reserved. # Written by Eric Price <eprice at tjhsst.edu> # and Facundo Batista <facundo at taniquetil.com.ar> # and Raymond Hettinger <python at rcn.com> # and Aahz <aahz at pobox.com> # and Tim Peters # This module should be kept in sync with ...
gpl-3.0
GameTechDev/PresentMon
Tests/googletest/googletest/scripts/common.py
1180
2919
# Copyright 2013 Google Inc. All Rights Reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the foll...
mit
dmitriy0611/django
tests/admin_views/custom_has_permission_admin.py
380
1089
""" A custom AdminSite for AdminViewPermissionsTest.test_login_has_permission(). """ from __future__ import unicode_literals from django.contrib import admin from django.contrib.auth import get_permission_codename from django.contrib.auth.forms import AuthenticationForm from . import admin as base_admin, models PERM...
bsd-3-clause
adoosii/edx-platform
lms/djangoapps/open_ended_grading/open_ended_notifications.py
66
7357
import datetime import json import logging from django.conf import settings from xmodule.open_ended_grading_classes import peer_grading_service from xmodule.open_ended_grading_classes.controller_query_service import ControllerQueryService from courseware.access import has_access from edxmako.shortcuts import render_...
agpl-3.0
bitmazk/django-good-practice-examples
setup.py
1
1406
import os from setuptools import setup, find_packages import good_practice_examples as app def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except IOError: return '' dependency_links = [ # needs this dev version for django 1.6 fixes 'https://gi...
mit
manisandro/QGIS
python/plugins/processing/algs/gdal/tri.py
4
4593
# -*- coding: utf-8 -*- """ *************************************************************************** tri.py --------------------- Date : October 2013 Copyright : (C) 2013 by Alexander Bruy Email : alexander dot bruy at gmail dot com *********************...
gpl-2.0
ehashman/oh-mainline
vendor/packages/whoosh/src/whoosh/support/levenshtein.py
64
2379
""" Contains functions implementing edit distance algorithms. """ from whoosh.compat import xrange def levenshtein(seq1, seq2, limit=None): """Returns the Levenshtein edit distance between two strings. """ oneago = None thisrow = range(1, len(seq2) + 1) + [0] for x in xrange(len(seq1)): ...
agpl-3.0
FuzzyHobbit/letsencrypt
letsencrypt-nginx/letsencrypt_nginx/tests/util.py
11
3355
"""Common utilities for letsencrypt_nginx.""" import os import pkg_resources import unittest import mock import zope.component from acme import jose from letsencrypt import configuration from letsencrypt.tests import test_util from letsencrypt.plugins import common from letsencrypt_nginx import constants from let...
apache-2.0
danielpalomino/gem5
src/arch/x86/isa/insts/simd128/integer/shift/__init__.py
91
2403
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bsd-3-clause
evanma92/routeh
flask/lib/python2.7/site-packages/pip/utils/build.py
899
1312
from __future__ import absolute_import import os.path import tempfile from pip.utils import rmtree class BuildDirectory(object): def __init__(self, name=None, delete=None): # If we were not given an explicit directory, and we were not given an # explicit delete option, then we'll default to del...
bsd-3-clause
dr0pz0ne/sibble
lib/ansible/plugins/lookup/indexed_items.py
127
1237
# (c) 2012, 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) any lat...
gpl-3.0
coded-by-hand/mass
env/lib/python2.7/site-packages/pip-1.0.2-py2.7.egg/pip/commands/search.py
9
4078
import sys import textwrap import pkg_resources import pip.download from pip.basecommand import Command from pip.util import get_terminal_size from pip.log import logger from pip.backwardcompat import xmlrpclib, reduce, cmp from distutils.version import StrictVersion, LooseVersion class SearchCommand(Command): na...
bsd-2-clause
mikf/gallery-dl
gallery_dl/extractor/fuskator.py
1
3698
# -*- coding: utf-8 -*- # Copyright 2019 Mike Fährmann # # 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. """Extractors for https://fuskator.com/""" from .common import GalleryExtrac...
gpl-2.0
th0mmeke/toyworld
evaluators/evaluator_summary.py
1
5124
""" Created on 6/05/2013 @author: thom """ import logging import string from rdkit.Chem import AllChem as Chem from evaluator import Evaluator from molecular_population import MolecularPopulation from molecule import Molecule class EvaluatorSummary(Evaluator): def get_result_titles(self): return ["N...
gpl-3.0
khchine5/opal
opal/tests/test_utils.py
1
2258
""" Unittests for opal.utils """ import sys from django.test import TestCase from django.db.models import ForeignKey, CharField from mock import patch from opal.core.test import OpalTestCase from opal import utils class StringportTestCase(TestCase): def test_import(self): import collections sel...
agpl-3.0
pigate/mongo-python-driver
bson/son.py
68
8684
# Copyright 2009-2015 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
apache-2.0
aleaxit/pysolper
latrop/lib/dist/werkzeug/contrib/profiler.py
25
3962
# -*- coding: utf-8 -*- """ werkzeug.contrib.profiler ~~~~~~~~~~~~~~~~~~~~~~~~~ This module provides a simple WSGI profiler middleware for finding bottlenecks in web application. It uses the :mod:`profile` or :mod:`cProfile` module to do the profiling and writes the stats to the stream provide...
apache-2.0
diogocs1/comps
web/openerp/report/printscreen/ps_list.py
381
11955
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
apache-2.0
TeamTwisted/external_chromium_org
net/tools/testserver/testserver_base.py
57
8501
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import BaseHTTPServer import errno import json import optparse import os import re import socket import SocketServer import struct import sys import warnings...
bsd-3-clause
fxfitz/ansible
lib/ansible/modules/cloud/amazon/ec2_lc.py
17
24341
#!/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
buptlsl/django-rest-framework
rest_framework/utils/encoders.py
88
2310
""" Helper classes for parsers. """ from __future__ import unicode_literals import datetime import decimal import json import uuid from django.db.models.query import QuerySet from django.utils import six, timezone from django.utils.encoding import force_text from django.utils.functional import Promise from rest_fram...
bsd-2-clause
google/pyaedj
toybox/server_py3/services.py
1
25101
"""Google Service API classes.""" __author__ = 'Pavel Simakov (psimakov@google.com)' import datetime import logging import time from dateutil import parser from googleapiclient import discovery from googleapiclient import errors import pytz from google.cloud import datastore RFC3339_FORMAT = '%Y-%m-%dT%H:%M:%SZ' ...
apache-2.0
junrao/kafka
tests/kafkatest/tests/connect_test.py
12
4906
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
apache-2.0
cjh1/AutobahnPython
examples/wamp/rpc/simple/example2/server.py
27
3522
############################################################################### ## ## Copyright 2011,2012 Tavendo GmbH ## ## Licensed under the Apache License, Version 2.0 (the "License"); ## you may not use this file except in compliance with the License. ## You may obtain a copy of the License at ## ## http:...
apache-2.0
runeh/dragonfly-stp-1
tools/get-interfaces/class_analizer.py
2
18250
import test_server, sys, os """ script to retrieve and analize javascript objects starts a server ( test_server.py ) and loads one test after the other it writes the results to "js_object_filters.js" with -i flag it writes a list with all interfaces to "interfaces.txt" """ # for abstract interfaces inheritances = \ {...
apache-2.0
stackforge/refstack
refstack/db/utils.py
2
1871
# Copyright (c) 2015 Mirantis, 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
loseblue/vim-ycm-windows-64
third_party/requests/requests/packages/urllib3/contrib/pyopenssl.py
216
13871
'''SSL with SNI_-support for Python 2. This needs the following packages installed: * pyOpenSSL (tested with 0.13) * ndg-httpsclient (tested with 0.3.2) * pyasn1 (tested with 0.1.6) To activate it call :func:`~urllib3.contrib.pyopenssl.inject_into_urllib3`. This can be done in a ``sitecustomize`` module, or at any o...
gpl-3.0
Intel-tensorflow/tensorflow
tensorflow/python/kernel_tests/random/random_poisson_test.py
9
6887
# 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
diegocortassa/TACTIC
src/context/client/tactic-api-python-4.0.api04/Lib/pkgutil.py
8
20584
"""Utilities to support packages.""" # NOTE: This module must remain compatible with Python 2.3, as it is shared # by setuptools for distribution with Python 2.3 and up. import os import sys import imp import os.path from types import ModuleType __all__ = [ 'get_importer', 'iter_importers', 'get_load...
epl-1.0
jreinhardt/BOLTS
backends/website/__init__.py
2
2331
from flask import Flask, render_template, abort, redirect, url_for, request, g from flask_babelex import Babel,format_datetime, gettext, lazy_gettext from flask_assets import Bundle, Environment from os.path import exists from os import environ, makedirs, getenv from shutil import rmtree from .blog import blog from .do...
gpl-3.0
nicko96/Chrome-Infra
appengine/sheriff_o_matic/alerts_test.py
1
12204
# 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 alerts import json import random import string import unittest import webtest from google.appengine.api import memcache from google.appengine.ext imp...
bsd-3-clause
skosukhin/spack
lib/spack/external/_pytest/recwarn.py
10
7361
""" recording warnings during test function execution. """ import inspect import _pytest._code import py import sys import warnings import pytest @pytest.yield_fixture def recwarn(request): """Return a WarningsRecorder instance that provides these methods: * ``pop(category=None)``: return last warning matc...
lgpl-2.1
wldcordeiro/servo
components/script/dom/bindings/codegen/parser/tests/test_special_method_signature_mismatch.py
241
6622
def WebIDLTest(parser, harness): threw = False try: parser.parse(""" interface SpecialMethodSignatureMismatch1 { getter long long foo(long index); }; """) results = parser.finish() except: threw = True harness.ok(threw, "Should have...
mpl-2.0
bogde/xbmc.serialepenet.ro
requests/packages/charade/cp949prober.py
2801
1782
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org 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 Reserved. # # Con...
mit
jetpacapp/closure-linter
build/lib/closure_linter/common/error.py
155
2070
#!/usr/bin/env python # # Copyright 2007 The Closure Linter 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 #...
apache-2.0
simone-campagna/invoice
tests/unittests/test_invoice_main_stats.py
1
21684
# -*- coding: utf-8 -*- # # Copyright 2015 Simone Campagna # # 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
jcoady9/python-for-android
python3-alpha/python3-src/Lib/ctypes/test/test_pointers.py
53
6273
import unittest, sys from ctypes import * import _ctypes_test ctype_types = [c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint, c_long, c_ulong, c_longlong, c_ulonglong, c_double, c_float] python_types = [int, int, int, int, int, int, int, int, int, int, float, float] class PointersT...
apache-2.0
zasdfgbnm/qutip
qutip/testing.py
1
2011
# This file is part of QuTiP: Quantum Toolbox in Python. # # Copyright (c) 2011 and later, Paul D. Nation and Robert J. Johansson. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: ...
bsd-3-clause
1tush/reviewboard
reviewboard/webapi/resources/original_file.py
1
1231
from __future__ import unicode_literals from django.core.exceptions import ObjectDoesNotExist from djblets.webapi.errors import DOES_NOT_EXIST from reviewboard.webapi.resources import resources from reviewboard.webapi.resources.base_original_file import \ BaseOriginalFileResource class OriginalFileResource(Base...
mit
ff94315/hiwifi-openwrt-HC5661-HC5761
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/logging/__init__.py
27
59975
# Copyright 2001-2010 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
gpl-2.0
hargup/sympy
sympy/polys/subresultants_qq_zz.py
33
79948
# -*- coding: utf-8 -*- """ This module contains functions for the computation of Euclidean, generalized Sturmian and (modified) subresultant polynomial remainder sequences (prs's). The pseudo-remainder function prem() of sympy is _not_ used by any of the functions in the module. Instead of prem() we use the function...
bsd-3-clause
acsone/social
mail_notification_email_template/tests/test_mail_notification_email_template.py
1
1446
# -*- coding: utf-8 -*- # © 2016 Therp BV <http://therp.nl> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from mock import patch from openerp.tests.common import TransactionCase class TestMailNotificationEmailTemplate(TransactionCase): def test_mail_notification_email_template(self): ...
agpl-3.0
rgayon/plaso
tests/parsers/symantec.py
1
2461
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Tests for the Symantec AV Log parser.""" from __future__ import unicode_literals import unittest from plaso.parsers import symantec from tests.parsers import test_lib class SymantecAccessProtectionUnitTest(test_lib.ParserTestCase): """Tests for the Symantec AV L...
apache-2.0
zploskey/servo
tests/wpt/css-tests/tools/wptserve/tests/functional/test_server.py
86
1285
import unittest import urllib2 import wptserve from .base import TestUsingServer class TestFileHandler(TestUsingServer): def test_not_handled(self): with self.assertRaises(urllib2.HTTPError) as cm: resp = self.request("/not_existing") self.assertEqual(cm.exception.code, 404) class Te...
mpl-2.0
beckdaniel/GPy
GPy/inference/latent_function_inference/svgp.py
15
5144
from . import LatentFunctionInference from ...util import linalg from ...util import choleskies import numpy as np from .posterior import Posterior from scipy.linalg.blas import dgemm, dsymm, dtrmm class SVGP(LatentFunctionInference): def inference(self, q_u_mean, q_u_chol, kern, X, Z, likelihood, Y, mean_functio...
bsd-3-clause
datsfosure/ansible
lib/ansible/inventory/expand_hosts.py
71
4415
# (c) 2012, Zettar Inc. # Written by Chin Fang <fangchin@zettar.com> # # This file is part of Ansible # # 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 y...
gpl-3.0
gangadhar-kadam/smrterp
erpnext/setup/install.py
3
3025
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _ default_mail_footer = """<div style="padding: 7px; text-align: right; color: #888"><small>Sent via <a style="c...
agpl-3.0
fvcproductions/dotfiles
bin/alfred/Alfred.alfredpreferences/workflows/user.workflow.DEDF5652-6FEF-4776-80D8-ACEDF577D06A/lxml/html/_html5builder.py
110
3246
""" Legacy module - don't use in new code! html5lib now has its own proper implementation. This module implements a tree builder for html5lib that generates lxml html element trees. This module uses camelCase as it follows the html5lib style guide. """ from html5lib.treebuilders import _base, etree as etree_builder...
mit
bobcyw/django
tests/model_validation/tests.py
292
2117
from django.core import management from django.core.checks import Error, run_checks from django.db.models.signals import post_init from django.test import SimpleTestCase from django.test.utils import override_settings from django.utils import six class OnPostInit(object): def __call__(self, **kwargs): pas...
bsd-3-clause
md384/media-reminder
mediadownloader/subtitles/open_subtitles.py
1
3048
import io import os import struct import urllib.request import zipfile from xmlrpc.client import ServerProxy from mediadownloader.subtitles.base_subtitles import BaseSubtitles class OpenSubtitles(BaseSubtitles): OPENSUBTITLES_SERVER = 'http://api.opensubtitles.org/xml-rpc' USER_AGENT = 'OSTestUserAgentTemp'...
mit
faint32/shadowsocks
tests/test_udp_src.py
1009
2482
#!/usr/bin/python import socket import socks SERVER_IP = '127.0.0.1' SERVER_PORT = 1081 if __name__ == '__main__': # Test 1: same source port IPv4 sock_out = socks.socksocket(socket.AF_INET, socket.SOCK_DGRAM, socket.SOL_UDP) sock_out.set_proxy(socks.SOCKS5, SERVER_IP, S...
apache-2.0
USGSDenverPychron/pychron
pychron/experiment/tests/renumber_aliquot_test.py
1
1352
from pychron.experiment.utilities.aliquot_numbering import renumber_aliquots __author__ = 'ross' import unittest class MockRun(object): def __init__(self, l, uda, pos): self.labnumber = l self.user_defined_aliquot = uda self.position = pos class RenumberAliquotTestCase(unittest.TestCas...
apache-2.0
morreene/tradenews
venv/Lib/site-packages/webassets/ext/jinja2.py
4
10611
from __future__ import absolute_import import warnings import jinja2 from jinja2.ext import Extension from jinja2 import nodes from webassets import Bundle from webassets.loaders import GlobLoader, LoaderError from webassets.exceptions import ImminentDeprecationWarning __all__ = ('assets', 'Jinja2Loader',) class A...
bsd-3-clause
Anonymouslemming/ansible
lib/ansible/utils/helpers.py
38
1272
# (c) 2016, Ansible by Red Hat <info@ansible.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later v...
gpl-3.0
avanov/django
tests/unmanaged_models/models.py
98
3699
""" 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 from django.utils.encoding import python_2_unicode_compatible # All of these models are created in the database by Django. @python_2_unicod...
bsd-3-clause
ikargis/horizon_fod
openstack_dashboard/dashboards/project/networks/ports/views.py
12
2782
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 NEC Corporation # # 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 #...
apache-2.0
daler/trackhub
trackhub/base.py
1
4408
from __future__ import absolute_import import os import warnings import tempfile from collections import OrderedDict def deprecation_handler(source, filename, kwargs): if 'local_fn' in kwargs: warnings.warn( 'Please use the argument "source" instead of "local_fn"', DeprecationWarni...
mit
lukeiwanski/tensorflow
tensorflow/contrib/distributions/python/ops/mvn_diag.py
13
8814
# 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
Petr-Kovalev/nupic-win32
external/linux32/lib/python2.6/site-packages/matplotlib/_mathtext_data.py
69
57988
""" font data tables for truetype and afm computer modern fonts """ # this dict maps symbol names to fontnames, glyphindex. To get the # glyph index from the character code, you have to use get_charmap """ from matplotlib.ft2font import FT2Font font = FT2Font('/usr/local/share/matplotlib/cmr10.ttf') items = font.get_...
gpl-3.0
mlperf/training_results_v0.5
v0.5.0/google/cloud_v2.8/resnet-tpuv2-8/code/resnet/model/tpu/models/official/retinanet/retinanet_segmentation_model.py
5
9530
# 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
fly19890211/edx-platform
lms/djangoapps/mobile_api/video_outlines/tests.py
54
33406
# -*- coding: utf-8 -*- """ Tests for video outline API """ import ddt import itertools from uuid import uuid4 from collections import namedtuple from edxval import api from mobile_api.models import MobileApiConfig from xmodule.modulestore.tests.factories import ItemFactory from xmodule.video_module import transcripts...
agpl-3.0
mdibaiee/servo
tests/wpt/css-tests/tools/html5lib/html5lib/tests/test_stream.py
446
6264
from __future__ import absolute_import, division, unicode_literals from . import support # flake8: noqa import unittest import codecs from io import BytesIO from six.moves import http_client from html5lib.inputstream import (BufferedStream, HTMLInputStream, HTMLUnicodeInputStream, ...
mpl-2.0
apeyser/nest-simulator
pynest/nest/__init__.py
5
7625
# -*- coding: utf-8 -*- # # __init__.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # ...
gpl-2.0
supergentle/migueltutorial
flask/lib/python2.7/site-packages/werkzeug/wrappers.py
147
76919
# -*- coding: utf-8 -*- """ werkzeug.wrappers ~~~~~~~~~~~~~~~~~ The wrappers are simple request and response objects which you can subclass to do whatever you want them to do. The request object contains the information transmitted by the client (webbrowser) and the response object contains al...
bsd-3-clause
siggame/server
game_utils.py
1
7951
import random from functools import wraps from heapq import heappop, heappush from math import ceil from os import listdir from os.path import isfile, join class Grid(object): def __init__(self, game, type, dimensions = ('x', 'y')): self.game = game self.type = type self.grid = {} ...
bsd-3-clause
bigswitch/horizon
openstack_dashboard/dashboards/admin/aggregates/tests.py
3
20839
# 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
youdar/work
work/FAB/test2.py
1
5768
from __future__ import division from phenix.command_line import superpose_pdbs from iotbx import pdb from iotbx.pdb import fetch from libtbx import easy_run from libtbx.utils import Sorry import shutil import tempfile import os,sys def run(fn): ''' ''' # Test if FAB # Devide to pdb_hierarchy_var_H,pdb_hierarc...
mit
GPrathap/carbon-device-mgt-plugins
features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/src/mindwavemobile/tests/MindwavePacketPayloadParserTest.py
6
4397
import unittest from MindwavePacketPayloadParser import MindwavePacketPayloadParser from MindwaveDataPoints import RawDataPoint, PoorSignalLevelDataPoint,\ MeditationDataPoint, AttentionDataPoint, EEGPowersDataPoint, BlinkDataPoint class ParseRawValueTest(unittest.TestCase): @classmethod def setUpClass(c...
apache-2.0
feliperfranca/django-nonrel-example
django/contrib/gis/utils/wkt.py
419
1846
""" Utilities for manipulating Geometry WKT. """ 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 to that number: >>> pnt =...
bsd-3-clause
jackru/pybrain
pybrain/tests/unittests/structure/networks/custom/test_convolutional_nets.py
25
1916
""" Let's build a convolutional network designed for board games: >>> from pybrain.structure.networks.custom.convboard import ConvolutionalBoardNetwork >>> from scipy import array, ravel, var >>> N = ConvolutionalBoardNetwork(4, 3, 5) >>> print(N.paramdim) 97 This is what a typical input would loo...
bsd-3-clause
ombre5733/weos
src/_cmsis_rtos/test/runAllTests.py
1
1953
# -*- coding: utf-8 -*- """ ******************************************************************************* WEOS - Wrapper for embedded operating systems Copyright (c) 2013, Manuel Freiberger All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted ...
bsd-2-clause