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
catapult-project/catapult-csm
third_party/Paste/tests/test_recursive.py
47
4178
from .test_errordocument import simple_app from paste.fixture import * from paste.recursive import RecursiveMiddleware, ForwardRequestException def error_docs_app(environ, start_response): if environ['PATH_INFO'] == '/not_found': start_response("404 Not found", [('Content-type', 'text/plain')]) ret...
bsd-3-clause
vmanoria/bluemix-hue-filebrowser
hue-3.8.1-bluemix/desktop/core/ext-py/python-ldap-2.3.13/Demo/Lib/ldap/async/sizelimit.py
40
1056
""" ldifwriter - using ldap.async module for retrieving partial results in a list even though the exception ldap.SIZELIMIT_EXCEEDED was raised.output of LDIF stream Written by Michael Stroeder <michael@stroeder.com> $Id: sizelimit.py,v 1.4 2006/03/26 12:23:07 stroeder Exp $ This example tra...
gpl-2.0
google-code-export/google-app-engine-django
appengine_django/__init__.py
17
23021
#!/usr/bin/python2.4 # # Copyright 2008 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
memnonila/django-cms
cms/tests/test_navextender.py
35
3568
# -*- coding: utf-8 -*- from __future__ import with_statement from cms.models import Page from cms.test_utils.fixtures.navextenders import NavextendersFixture from cms.test_utils.testcases import CMSTestCase from cms.test_utils.util.menu_extender import TestMenu from django.conf import settings from django.template imp...
bsd-3-clause
vojtechtrefny/anaconda
tests/glade/format_string/check_format_string.py
7
2914
#!/usr/bin/python2 # # Copyright (C) 2014 Red Hat, Inc. # # 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 2.1 of the License, or # (at your option) any later version. # # ...
gpl-2.0
hoosteeno/mozillians
vendor-local/lib/python/celery/tests/test_concurrency/test_pool.py
14
2446
from __future__ import absolute_import import sys import time import logging import itertools from nose import SkipTest from celery.datastructures import ExceptionInfo from celery.tests.utils import Case def do_something(i): return i * i def long_something(): time.sleep(1) def raise_something(i): t...
bsd-3-clause
deepaklukose/grpc
src/python/grpcio_testing/grpc_testing/_common.py
2
4429
# Copyright 2017 gRPC 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 agreed to in writing...
apache-2.0
benjaminjkraft/django
django/conf/locale/ko/formats.py
404
2320
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'Y년 n월 j일' TIME_FORMAT = 'A g:i' D...
bsd-3-clause
HyperloopTeam/FullOpenMDAO
lib/python2.7/site-packages/Sphinx-1.2.2-py2.7.egg/sphinx/websupport/search/__init__.py
11
4617
# -*- coding: utf-8 -*- """ sphinx.websupport.search ~~~~~~~~~~~~~~~~~~~~~~~~ Server side search support for the web support package. :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re class BaseSearch(object): def __init__...
gpl-2.0
sshnaidm/ru
plugin.video.pokerstars.tv/html5lib/treebuilders/__init__.py
102
4478
"""A collection of modules for building different kinds of tree from HTML documents. To create a treebuilder for a new type of tree, you need to do implement several things: 1) A set of classes for various types of elements: Document, Doctype, Comment, Element. These must implement the interface of _base.treebuilders...
gpl-2.0
alsotoes/vsphere-examples
python/.venv/lib/python2.6/site-packages/pip/_vendor/requests/exceptions.py
341
1877
# -*- coding: utf-8 -*- """ requests.exceptions ~~~~~~~~~~~~~~~~~~~ This module contains the set of Requests' exceptions. """ from .packages.urllib3.exceptions import HTTPError as BaseHTTPError class RequestException(IOError): """There was an ambiguous exception that occurred while handling your request.""...
gpl-3.0
Microsoft/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/symtable.py
11
7274
"""Interface to the compiler's internal symbol tables""" import _symtable from _symtable import (USE, DEF_GLOBAL, DEF_LOCAL, DEF_PARAM, DEF_IMPORT, DEF_BOUND, DEF_ANNOT, SCOPE_OFF, SCOPE_MASK, FREE, LOCAL, GLOBAL_IMPLICIT, GLOBAL_EXPLICIT, CELL) import weakref __all__ = ["symtable", "SymbolTable", "Class",...
apache-2.0
danakj/chromium
third_party/WebKit/Source/build/scripts/license.py
80
1875
# Copyright (C) 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 ...
bsd-3-clause
Kriechi/hyper-h2
src/h2/connection.py
1
82921
# -*- coding: utf-8 -*- """ h2/connection ~~~~~~~~~~~~~ An implementation of a HTTP/2 connection. """ import base64 from enum import Enum, IntEnum from hyperframe.exceptions import InvalidPaddingError from hyperframe.frame import ( GoAwayFrame, WindowUpdateFrame, HeadersFrame, DataFrame, PingFrame, PushPromi...
mit
brymaster5000/Elite_darksLide_kernel
scripts/gcc-wrapper.py
364
3936
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2011-2012, The Linux Foundation. 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 th...
gpl-2.0
stephane-martin/salt-debian-packaging
salt-2016.3.3/salt/runners/state.py
2
5996
# -*- coding: utf-8 -*- ''' Execute orchestration functions ''' # Import pytohn libs from __future__ import absolute_import, print_function import logging # Import salt libs import salt.loader import salt.utils import salt.utils.event from salt.exceptions import SaltInvocationError LOGGER = logging.getLogger(__name__...
apache-2.0
cuongnv23/ansible
test/units/modules/cloud/amazon/test_elb_application_lb.py
21
4573
# # (c) 2017 Michael Tinning # # 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) from nose.plugins.skip import SkipTest import json import pytest from copy import deepcopy from ansible.module_utils._text impo...
gpl-3.0
code-sauce/tensorflow
tensorflow/python/ops/rnn.py
18
44669
# 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
rawoul/gst-plugins-good
tests/examples/rtp/client-PCMA.py
21
4295
#! /usr/bin/env python import gi import sys gi.require_version('Gst', '1.0') from gi.repository import GObject, Gst # # A simple RTP receiver # # receives alaw encoded RTP audio on port 5002, RTCP is received on port 5003. # the receiver RTCP reports are sent to port 5007 # # .-------. .----------...
lgpl-2.1
sandan/sqlalchemy
test/aaa_profiling/test_orm.py
27
14495
from sqlalchemy import Integer, String, ForeignKey from sqlalchemy.orm import mapper, relationship, \ sessionmaker, Session, defer from sqlalchemy import testing from sqlalchemy.testing import profiling from sqlalchemy.testing import fixtures from sqlalchemy.testing.schema import Table, Column class MergeTest(fix...
mit
uglyboxer/linear_neuron
net-p3/lib/python3.5/site-packages/numpy/f2py/tests/test_return_logical.py
145
4943
from __future__ import division, absolute_import, print_function from numpy import array from numpy.compat import long from numpy.testing import run_module_suite, assert_, assert_raises, dec import util class TestReturnLogical(util.F2PyTest): def check_function(self, t): assert_(t(True) == 1, repr(t(Tru...
mit
tinloaf/home-assistant
homeassistant/components/switch/lutron.py
2
1365
""" Support for Lutron switches. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/switch.lutron/ """ import logging from homeassistant.components.switch import SwitchDevice from homeassistant.components.lutron import ( LutronDevice, LUTRON_DEVICES, LU...
apache-2.0
zstackio/zstack-woodpecker
zstackwoodpecker/zstackwoodpecker/header/image.py
1
1692
import zstackwoodpecker.header.header as zstack_header CREATED = 'created' DELETED = 'deleted' EXPUNGED = 'expunged' class TestImage(zstack_header.ZstackObject): def __init__(self): self.image = None self.state = None self.delete_policy = None self.delete_delay_time = None def ...
apache-2.0
ihipi/Sick-Beard
lib/hachoir_parser/container/mkv.py
90
20373
# # Matroska parser # Author Julien Muchembled <jm AT jm10.no-ip.com> # Created: 8 june 2006 # from lib.hachoir_parser import Parser from lib.hachoir_core.field import (FieldSet, Link, MissingField, ParserError, Enum as _Enum, String as _String, Float32, Float64, NullBits, Bits, Bit, RawBytes, Bytes, ...
gpl-3.0
barryHub20/ServerAss2
lib/flask/sessions.py
348
12882
# -*- coding: utf-8 -*- """ flask.sessions ~~~~~~~~~~~~~~ Implements cookie based sessions based on itsdangerous. :copyright: (c) 2012 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import uuid import hashlib from datetime import datetime from werkzeug.http import http_date, ...
apache-2.0
edmundgentle/schoolscript
SchoolScript/bin/Debug/pythonlib/Lib/test/test_isinstance.py
3
10462
# Tests some corner cases with isinstance() and issubclass(). While these # tests use new style classes and properties, they actually do whitebox # testing of error conditions uncovered when using extension types. import unittest from test import support import sys class TestIsInstanceExceptions(unittes...
gpl-2.0
SilentCircle/sentry
src/sentry/web/frontend/alerts.py
4
2338
""" sentry.web.frontend.alerts ~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2013 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import division from datetime import timedelta from django.core.urlresolvers import reverse from django.http import Ht...
bsd-3-clause
bq/bitbloq-offline
app/res/web2board/linux/res/Scons/sconsFiles/SCons/Tool/qt.py
6
13283
"""SCons.Tool.qt Tool-specific initialization for Qt. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2015 The SCons Foundation # # Permission is hereby granted, free of charge, to ...
gpl-3.0
Gateworks/platform-external-chromium_org
tools/perf/measurements/memory.py
23
1638
# 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. from metrics import memory from telemetry.page import page_measurement class Memory(page_measurement.PageMeasurement): def __init__(self): super(M...
bsd-3-clause
alextruberg/custom_django
tests/queries/tests.py
4
131371
from __future__ import absolute_import,unicode_literals import datetime from operator import attrgetter import pickle import sys from django.conf import settings from django.core.exceptions import FieldError from django.db import DatabaseError, connection, connections, DEFAULT_DB_ALIAS from django.db.models import Co...
bsd-3-clause
brijeshkesariya/odoo
addons/sale_journal/sale_journal.py
276
4290
# -*- 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
epandurski/django
tests/prefetch_related/models.py
57
7656
import uuid from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.encoding import python_2_unicode_compatible # Basic tests @python_2_unicode_compatible class Author(models....
bsd-3-clause
loop1024/pymo-global
android/pgs4a-0.9.6/python-install/lib/python2.7/test/test_dumbdbm.py
138
4839
#! /usr/bin/env python """Test script for the dumbdbm module Original by Roger E. Masse """ import os import unittest import dumbdbm from test import test_support _fname = test_support.TESTFN def _delete_files(): for ext in [".dir", ".dat", ".bak"]: try: os.unlink(_fname + ext) exc...
mit
pandastrail/InfoEng
scripting/exercises/p04_1_2.py
1
2308
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Sep 20 22:23:39 2017 @author: hase 1.2 Trail Length Write a program that computes the total length of a trail tracked with your GPS device. Let’s assume your GPS device saves your coordinates every 5 second into a list of tuples. For the trail in th...
gpl-3.0
joaormatos/anaconda
mmfparser/bitdict.py
1
3174
# Copyright (c) Mathias Kaerlev 2012. # This file is part of Anaconda. # Anaconda 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
carmenfdezb/Zimpedia
sailfish/libs/libzim/subprojects/gtest/googletest/scripts/pump.py
2471
23673
#!/usr/bin/env python # # Copyright 2008, 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...
mpl-2.0
inasafe/inasafe
safe/gui/tools/wizard/step_fc90_analysis.py
6
15583
# coding=utf-8 """InaSAFE Wizard Step Analysis.""" import logging import os from qgis.PyQt import QtGui, QtCore, QtWidgets from qgis.PyQt.QtCore import pyqtSlot from qgis.core import ( QgsProject, QgsGeometry, QgsCoordinateReferenceSystem, QgsApplication, ) from safe import messaging as m from safe.c...
gpl-3.0
pbfy0/visvis
functions/bar.py
3
6860
# -*- coding: utf-8 -*- # Copyright (C) 2012, Almar Klein # # Visvis is distributed under the terms of the (new) BSD License. # The full license can be found in 'license.txt'. import visvis as vv import numpy as np import OpenGL.GL as gl def bar(data1, data2=None, bottom=None, width=0.75, ...
bsd-3-clause
sleshepic/SM-G900P_kernel_ND2
scripts/build-all.py
329
10325
#! /usr/bin/env python # Copyright (c) 2009-2013, The Linux Foundation. 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 # ...
gpl-2.0
OneBitSoftware/jwtSample
src/Spa/env1/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/request.py
1008
2089
from base64 import b64encode from ..packages.six import b ACCEPT_ENCODING = 'gzip,deflate' def make_headers(keep_alive=None, accept_encoding=None, user_agent=None, basic_auth=None, proxy_basic_auth=None, disable_cache=None): """ Shortcuts for generating request headers. :param keep_ali...
mit
HPI-DeepLearning/CaptchaService
server/api/captcha_service/views.py
1
9782
from django.shortcuts import render from django.http import HttpResponseRedirect, HttpResponse from django.http import JsonResponse from django.core.management import call_command from django.core.exceptions import ObjectDoesNotExist from rest_framework.response import Response from rest_framework import status from re...
mit
VikParuchuri/percept
percept/tasks/preprocess.py
1
1942
""" Preprocess data before sending to algorithms """ from __future__ import division from base import Task from percept.fields.base import List, Complex import numpy as np from percept.conf.base import settings from percept.utils.models import RegistryCategories from percept.tests.framework import NormalizationTester ...
apache-2.0
dbaxa/django
tests/many_to_many/models.py
279
1343
""" Many-to-many relationships To define a many-to-many relationship, use ``ManyToManyField()``. In this example, an ``Article`` can be published in multiple ``Publication`` objects, and a ``Publication`` has multiple ``Article`` objects. """ from __future__ import unicode_literals from django.db import models from ...
bsd-3-clause
luiseduardohdbackup/odoo
addons/l10n_fr/report/base_report.py
163
5686
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsability of assessing all potential #...
agpl-3.0
sajeeshcs/nested_quota_latest
nova/virt/ironic/patcher.py
12
6532
# coding=utf-8 # # Copyright 2014 Hewlett-Packard Development Company, L.P. # Copyright 2014 Red Hat, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # ...
apache-2.0
tsgit/invenio
modules/miscutil/lib/upgrades/invenio_2014_08_07_new_journalpage_index.py
5
3149
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2014 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) a...
gpl-2.0
hperala/kontuwikibot
pywikibot/families/wikinews_family.py
1
2351
# -*- coding: utf-8 -*- """Family module for Wikinews.""" from __future__ import unicode_literals from pywikibot import family __version__ = '$Id: 43df5bb323c11be1fdd185a819893ad2f9a17f25 $' # The Wikimedia family that is known as Wikinews class Family(family.WikimediaFamily): """Family class for Wikinews."""...
mit
loco-odoo/localizacion_co
openerp/addons-extra/odoo-pruebas/odoo-server/addons/purchase_requisition/purchase_requisition.py
20
23282
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
houssine78/vertical-cooperative
easy_my_coop_website_taxshelter/controllers/main.py
1
5684
# -*- coding: utf-8 -*- # Copyright 2017-2018 Coop IT Easy SCRLfs <remy@gcoopiteasy.be> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from werkzeug.exceptions import Forbidden, NotFound from openerp import http from openerp.exceptions import AccessError, MissingError from openerp.http import reque...
agpl-3.0
cristianquaglio/odoo
addons/base_geolocalize/__openerp__.py
49
1459
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013_Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
apache-2.0
deepmind/open_spiel
open_spiel/python/examples/example.py
1
3663
# Copyright 2019 DeepMind Technologies Ltd. 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 appl...
apache-2.0
jmcfarlane/chula
chula/session/backends/memcached.py
1
1782
"""Chula memcached based session store""" import hashlib from chula import logger from chula.session.backends import base from chula.vendor import memcache class Backend(base.Backend): def __init__(self, config, guid): super(Backend, self).__init__(config, guid) self.connect() self.calcul...
gpl-2.0
OpenMined/PySyft
packages/syft/src/syft/ast/module.py
1
10425
"""This module contains `Module` attribute representing a module which contains other models or callables.""" # stdlib import inspect import sys from types import ModuleType from typing import Any from typing import Callable as CallableT from typing import List from typing import Optional from typing import Union # s...
apache-2.0
epssy/hue
apps/sqoop/src/sqoop/api/connector.py
32
2356
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
apache-2.0
benjixx/ansible
lib/ansible/inventory/group.py
9
4842
# (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
laiqiqi886/kbengine
kbe/res/scripts/common/Lib/unittest/test/test_suite.py
108
15184
import unittest import gc import sys import weakref from unittest.test.support import LoggingResult, TestEquality ### Support code for Test_TestSuite ################################################################ class Test(object): class Foo(unittest.TestCase): def test_1(self): pass def test...
lgpl-3.0
stefanseefeld/qmtest
qm/test/execution_thread.py
2
4188
######################################################################## # # File: execution_thread.py # Author: Mark Mitchell # Date: 2001-08-04 # # Contents: # Code for coordinating the running of tests. # # Copyright (c) 2001, 2002 by CodeSourcery, LLC. All rights reserved. # # For license terms see the file...
gpl-2.0
jmehnle/ansible
lib/ansible/plugins/terminal/sros.py
43
1387
# # (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is d...
gpl-3.0
emdodds/DictLearner
tf_sparsenet.py
1
13831
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import numpy as np try: import matplotlib.pyplot as plt except: print("Can't import matplotlib.") import tensorflow as tf import sparsenet class Sparsenet(sparsenet.Sparsenet): """ A sparse dictiona...
mit
Azure/azure-sdk-for-python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_route_filter_rules_operations.py
1
28520
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
Hybrid-Power/bricked-mako
tools/perf/scripts/python/futex-contention.py
11261
1486
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PER...
gpl-2.0
dzigor92/TNUI2013
p3/ystockquote.py
2
3979
#!/usr/bin/env python # # Copyright (c) 2007-2008, Corey Goldberg (corey@goldb.org) # # license: GNU LGPL # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of t...
gpl-2.0
sileht/aodh
aodh/tests/evaluator/test_combination.py
2
16296
# # Copyright 2013 eNovance <licensing@enovance.com> # # Authors: Mehdi Abaakouk <mehdi.abaakouk@enovance.com> # # 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...
apache-2.0
bstell/TachyFont
run_time/src/gae_server/third_party/old-fonttools-master/Lib/fontTools/misc/bezierTools.py
11
13427
"""fontTools.misc.bezierTools.py -- tools for working with bezier path segments. """ from __future__ import print_function, division, absolute_import from fontTools.misc.py23 import * __all__ = [ "calcQuadraticBounds", "calcCubicBounds", "splitLine", "splitQuadratic", "splitCubic", "splitQuadr...
apache-2.0
nzavagli/UnrealPy
UnrealPyEmbed/Source/Python/Lib/python27/encodings/cp1256.py
593
13070
""" Python Character Mapping Codec cp1256 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1256.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,in...
mit
Russell-IO/ansible
test/sanity/import/importer.py
29
6122
#!/usr/bin/env python """Import the given python module(s) and report error(s) encountered.""" from __future__ import absolute_import, print_function import contextlib import imp import os import re import sys import traceback try: from StringIO import StringIO except ImportError: from io import StringIO im...
gpl-3.0
rartino/ENVISIoN
envisionpy/hdf5parser/vasp/volume.py
1
6402
# # ENVISIoN # # Copyright (c) 2017-2021 Fredrik Segerhammar, Marian Brännvall, Anders Rehult # Gabriel Anderberg, Didrik Axén, Adam Engman, Kristoffer Gubberud Maras, # Joakim Stenborg # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted pr...
bsd-2-clause
torchingloom/edx-platform
lms/envs/devstack.py
10
2843
""" Specific overrides to the base prod settings to make development easier. """ from .aws import * # pylint: disable=wildcard-import, unused-wildcard-import DEBUG = True USE_I18N = True TEMPLATE_DEBUG = True SITE_NAME = 'localhost:8000' # By default don't use a worker, execute tasks as if they were local functions C...
agpl-3.0
davidcusatis/horizon
openstack_dashboard/api/rest/heat.py
10
1695
# 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 # distributed under the...
apache-2.0
elventear/ansible
test/units/plugins/strategy/test_strategy_base.py
32
20994
# (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
bobobox/ansible
test/units/plugins/action/test_raw.py
51
3898
# (c) 2016, Saran Ahluwalia <ahlusar.ahluwalia@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...
gpl-3.0
ProjectSWGCore/NGECore2
scripts/object/tangible/wearables/armor/mandalorian_imperial/armor_mandalorian_imperial_bicep_l.py
14
1049
import sys def setup(core, object): object.setStringAttribute('faction_restriction', 'Imperial') object.setIntAttribute('required_combat_level', 75) object.setStringAttribute('armor_category', '@obj_attr_n:armor_battle') object.setIntAttribute('cat_stat_mod_bonus.@stat_n:constitution_modified', 18) object.setIntA...
lgpl-3.0
Juniper/tempest
tempest/tests/lib/fake_auth_provider.py
7
1314
# Copyright 2014 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/LICENSE-2...
apache-2.0
arista-eosplus/ansible-modules-extras
monitoring/uptimerobot.py
58
4159
#!/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
fangxingli/hue
desktop/core/ext-py/Django-1.6.10/tests/prefetch_related/tests.py
46
30197
from __future__ import absolute_import, unicode_literals from django.contrib.contenttypes.models import ContentType from django.db import connection from django.db.models.query import get_prefetcher from django.test import TestCase from django.test.utils import override_settings from django.utils import six from djang...
apache-2.0
schlueter/ansible
lib/ansible/modules/packaging/os/pulp_repo.py
16
23299
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Joe Adams <@sysadmind> # # 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 ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
googlearchive/appengine-flask-skeleton
lib/werkzeug/_reloader.py
59
8548
import os import sys import time import subprocess import threading from itertools import chain from werkzeug._internal import _log from werkzeug._compat import PY2, iteritems, text_type def _iter_module_files(): """This iterates over all relevant Python files. It goes through all loaded files from modules,...
apache-2.0
LEXmono/q
requests/compat.py
71
1595
# -*- coding: utf-8 -*- """ requests.compat ~~~~~~~~~~~~~~~ This module handles import compatibility issues between Python 2 and Python 3. """ import chardet import sys # ------- # Pythons # ------- # Syntax sugar. _ver = sys.version_info #: Python 2.x? is_py2 = (_ver[0] == 2) #: Python 3.x? is_py3 = (_ver[0] =...
apache-2.0
jeasoft/odoo
addons/stock_account/product.py
166
11361
# -*- 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
HesselTjeerdsma/Cyber-Physical-Pacman-Game
Algor/flask/lib/python2.7/site-packages/botocore/vendored/requests/packages/chardet/langhebrewmodel.py
2763
11318
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Simon Montagu # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved...
apache-2.0
kinoc/opencog
opencog/python/pln_old/examples/deception_demo/deception_example.py
28
1389
__author__ = 'sebastian, amen' """ For running the deception_agent """ from pln.rules.boolean_rules import simplify_boolean from pln.examples.deception_demo import deception_agent from opencog.atomspace import AtomSpace from opencog.scheme_wrapper import load_scm, __init__ from pln.examples.interactive_agent import In...
agpl-3.0
haad/ansible-modules-extras
packaging/os/apk.py
29
8342
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Kevin Brebanov <https://github.com/kbrebanov> # Based on pacman (Afterburn <http://github.com/afterburn>, Aaron Bull Schaefer <aaron@elasticdog.com>) # and apt (Matthew Williams <matthew@flowroute.com>>) modules. # # This module is free software: you can redistribu...
gpl-3.0
sadaf2605/django
tests/auth_tests/test_mixins.py
30
8520
from django.contrib.auth import models from django.contrib.auth.mixins import ( LoginRequiredMixin, PermissionRequiredMixin, UserPassesTestMixin, ) from django.contrib.auth.models import AnonymousUser from django.core.exceptions import PermissionDenied from django.http import HttpResponse from django.test import Re...
bsd-3-clause
pnedunuri/scipy
scipy/special/setup.py
77
4626
#!/usr/bin/env python from __future__ import division, print_function, absolute_import import os import sys from os.path import join from distutils.sysconfig import get_python_inc import numpy from numpy.distutils.misc_util import get_numpy_include_dirs try: from numpy.distutils.misc_util import get_info except ...
bsd-3-clause
dhp-denero/LibrERP
hr_attendance_extended/__openerp__.py
2
1537
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (C) 2015 Didotech srl (<http://www.didotech.com>). # # All Rights Reserved # # This program is free software: you can redistr...
agpl-3.0
frenchfrywpepper/ansible-modules-extras
cloud/amazon/ecs_taskdefinition.py
60
7958
#!/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
XiaodunServerGroup/xiaodun-platform
lms/envs/test.py
6
10367
""" This config file runs the simplest dev environment using sqlite, and db-based sessions. Assumes structure: /envroot/ /db # This is where it'll write the database file /edx-platform # The location of this repo /log # Where we're going to write log files """ # We intentionally define lot...
agpl-3.0
gsantovena/marathon
tests/system/utils.py
1
1270
import os import requests import uuid from shakedown import util from shakedown.clients.authentication import dcos_acs_token, DCOSAcsAuth from shakedown.clients.rpcclient import verify_ssl from shakedown.errors import DCOSException from os.path import join def make_id(app_id_prefix=None, parent_group="/"): app_i...
apache-2.0
StratusLab/client
api/code/src/main/python/stratuslab/messaging/MessagePublishers.py
1
1796
import base64 import json from stratuslab.messaging.MsgClientFactory import getMsgClient from stratuslab.Exceptions import InputException from stratuslab.image.Image import Image class SingleMessagePublisher(object): def __init__(self, message, configHolder): if not isinstance(message, basestring): ...
apache-2.0
molobrakos/home-assistant
tests/components/unifi/test_device_tracker.py
6
9346
"""The tests for the Unifi WAP device tracker platform.""" from unittest import mock from datetime import datetime, timedelta from pyunifi.controller import APIError import pytest import voluptuous as vol import homeassistant.util.dt as dt_util from homeassistant.components.device_tracker import DOMAIN import homeas...
apache-2.0
jesonyang001/qarepo
askbot/migrations/0045_delete_has_custom_avatar.py
21
27032
# encoding: 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): db.delete_column(u'auth_user', 'has_custom_avatar') def backwards(self, orm): try: db.add_column(u...
gpl-3.0
Fritz449/DQN_Agent
Gym.py
1
3955
import gym import numpy as np import time import Agent_DQN as AI import cv2 ENV_NAME = 'Pong-v0' np.set_printoptions(threshold=np.inf) env = gym.make(ENV_NAME) ATARI = True state_dim = env.observation_space.shape print state_dim action_dim = env.action_space.n print action_dim if ATARI: state_shape = (4, 80, 80)...
apache-2.0
tinloaf/home-assistant
tests/components/http/test_auth.py
3
10245
"""The tests for the Home Assistant HTTP component.""" from datetime import timedelta from ipaddress import ip_network from unittest.mock import patch import pytest from aiohttp import BasicAuth, web from aiohttp.web_exceptions import HTTPUnauthorized from homeassistant.auth.providers import legacy_api_password from ...
apache-2.0
caseyrollins/osf.io
tests/utils.py
3
8295
import contextlib import datetime import functools import mock from django.http import HttpRequest from django.utils import timezone from nose import SkipTest from nose.tools import assert_equal, assert_not_equal from framework.auth import Auth from framework.celery_tasks.handlers import celery_teardown_request from ...
apache-2.0
pmarks-net/grpc
examples/python/route_guide/route_guide_pb2_grpc.py
85
4291
import grpc from grpc.framework.common import cardinality from grpc.framework.interfaces.face import utilities as face_utilities import route_guide_pb2 as route__guide__pb2 class RouteGuideStub(object): """Interface exported by the server. """ def __init__(self, channel): """Constructor. Args: ...
bsd-3-clause
JTarball/generator-dockerized-django-polymer
app/templates/docker/app/app/backend/apps/_archive/blog_codewheel/utils.py
4
7088
""" utils.py - a list of utility functions """ import logging import hashlib from difflib import get_close_matches from sets import Set from markdown2 import markdown # BeautifulSoup: http://www.crummy.com/software/BeautifulSoup/ from bs4 import BeautifulSoup # Pygments: http://pygments.org -- a generic syntax hig...
gpl-2.0
snnn/tensorflow
tensorflow/contrib/keras/api/keras/utils/__init__.py
27
1925
# 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
ufosky-server/zulip
api/integrations/asana/zulip_asana_config.py
124
2157
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright © 2014 Zulip, 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, including without limitation the rights #...
apache-2.0
ysekky/chainer
chainer/links/connection/convolution_2d.py
2
5653
from chainer.functions.connection import convolution_2d from chainer import initializers from chainer import link from chainer.utils import argument from chainer import variable class Convolution2D(link.Link): """__init__(self, in_channels, out_channels, ksize=None, stride=1, pad=0, nobias=False, initialW=None, ...
mit
kaixinjxq/wpt-tools
webdriver/webdriver/searchcontext.py
251
2153
"""WebDriver element location functionality.""" class SearchContext(object): """Abstract class that provides the core element location functionality.""" def find_element_by_css(self, selector): """Find the first element matching a css selector.""" return self._find_element('css selector', sele...
bsd-3-clause