repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
girving/tensorflow
tensorflow/contrib/distributions/python/ops/shape.py
32
20029
# 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
miipl-naveen/optibizz
addons/hr_holidays/hr_holidays.py
6
33614
# -*- coding: utf-8 -*- ################################################################################## # # Copyright (c) 2005-2006 Axelor SARL. (http://www.axelor.com) # and 2004-2010 Tiny SPRL (<http://tiny.be>). # # $Id: hr.py 4656 2006-11-24 09:58:42Z Cyp $ # # This program is free software: you can redistri...
agpl-3.0
kartoza/geonode
geonode/base/management/commands/restore.py
2
21256
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2018 OSGeo # # 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 ...
gpl-3.0
CityOfNewYork/NYCOpenRecords
app/lib/onelogin/saml2/logout_request.py
1
13394
# -*- coding: utf-8 -*- """ OneLogin_Saml2_Logout_Request class Copyright (c) 2010-2018 OneLogin, Inc. MIT License Logout Request class of OneLogin's Python Toolkit. """ from app.lib.onelogin.saml2 import compat from app.lib.onelogin.saml2.constants import OneLogin_Saml2_Constants from app.lib.onelogin.saml2.utils...
apache-2.0
tux-00/ansible
lib/ansible/modules/cloud/vmware/vmware_vmkernel_ip_config.py
70
3992
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Joseph Callen <jcallen () csc.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 Li...
gpl-3.0
Einsteinish/PyTune3
vendor/feedvalidator/author.py
16
1386
"""$Id: author.py 699 2006-09-25 02:01:18Z rubys $""" __author__ = "Sam Ruby <http://intertwingly.net/> and Mark Pilgrim <http://diveintomark.org/>" __version__ = "$Revision: 699 $" __date__ = "$Date: 2006-09-25 02:01:18 +0000 (Mon, 25 Sep 2006) $" __copyright__ = "Copyright (c) 2002 Sam Ruby and Mark Pilgrim" from b...
mit
xmaruto/mcord
xos/synchronizers/ec2/deleters/slice_deployment_deleter.py
4
1652
from core.models import Slice, SliceDeployments, User from synchronizers.base.deleter import Deleter from openstack.driver import OpenStackDriver class SliceDeploymentsDeleter(Deleter): model='SliceDeployments' def call(self, pk): slice_deployment = SliceDeployments.objects.get(pk=pk) user = U...
apache-2.0
majek/ziutek
ziutek/lrucache.py
1
1553
class LRUCache: ''' >>> l = LRUCache(maxsize=3) >>> l.add('a') >>> l.add('b') >>> l.add('c') >>> l.add('d') >>> l.to_list() ['b', 'c', 'd'] >>> l.add('b') >>> l.to_list() ['c', 'b', 'd'] >>> l.add('b') >>> l.to_list() ['c', 'd', 'b'] >>> l.add('b') >>> l...
bsd-3-clause
seanlong/crosswalk
tools/increment-version.py
9
2640
#!/usr/bin/env python # Copyright (c) 2013 Intel Corporation. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ increment-version.py -- Bump Beta or Canary version number across all required files. Crosswalk's versioning schema is "MAJOR.MI...
bsd-3-clause
mdworks2016/work_development
Python/20_Third_Certification/venv/lib/python3.7/site-packages/celery/exceptions.py
1
7700
# -*- coding: utf-8 -*- """Celery error types. Error Hierarchy =============== - :exc:`Exception` - :exc:`celery.exceptions.CeleryError` - :exc:`~celery.exceptions.ImproperlyConfigured` - :exc:`~celery.exceptions.SecurityError` - :exc:`~celery.exceptions.TaskPredicate` - :exc:`...
apache-2.0
racker/omnibus
source/db-5.0.26.NC/dist/winmsi/genWix.py
2
10906
# # # genWix.py is used to generate a WiX .wxs format file that # can be compiled by the candle.exe WiX compiler. # # Usage: python genWix.py <output_file> # # The current directory is expected to be the top of a tree # of built programs, libraries, documentation and files. # # The list of directories traversed is at ...
apache-2.0
liorvh/golismero
thirdparty_libs/nltk/corpus/reader/util.py
12
31147
# Natural Language Toolkit: Corpus Reader Utilities # # Copyright (C) 2001-2012 NLTK Project # Author: Steven Bird <sb@ldc.upenn.edu> # Edward Loper <edloper@gradient.cis.upenn.edu> # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT import os import sys import bisect import re import temp...
gpl-2.0
dronefly/dronefly.github.io
flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/charsetprober.py
3127
1902
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
apache-2.0
mohrtw/algorithms
algorithms/tests/test_deque.py
1
3879
import unittest from unittest import TestCase from algorithms.dataStructures.Deque import Deque class deque_Test(TestCase): def setUp(self): self.d = Deque() def test_create_deque(self): self.assertIsInstance(self.d, Deque) def test_push_to_empty_deque(self): self.d.push(1) ...
mit
endlessm/chromium-browser
third_party/catapult/third_party/gsutil/third_party/pyasn1-modules/pyasn1_modules/rfc5208.py
6
1426
# # This file is part of pyasn1-modules software. # # Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com> # License: http://pyasn1.sf.net/license.html # # PKCS#8 syntax # # ASN.1 source from: # http://tools.ietf.org/html/rfc5208 # # Sample captures could be obtained with "openssl pkcs8 -topk8" command # from pyas...
bsd-3-clause
ychen820/microblog
y/google-cloud-sdk/lib/googlecloudsdk/compute/lib/ssh_utils.py
4
13028
# Copyright 2014 Google Inc. All Rights Reserved. """Utilities for subcommands that need to SSH into virtual machine guests.""" import logging import os import subprocess from googlecloudsdk.calliope import exceptions from googlecloudsdk.compute.lib import base_classes from googlecloudsdk.compute.lib import constants...
bsd-3-clause
zouyapeng/horizon-newtouch
openstack_dashboard/dashboards/project/volumes/urls.py
6
1689
# Copyright 2012 Nebula, 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 agree...
apache-2.0
wesm/arrow
dev/archery/archery/integration/tester.py
6
1993
# 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 u...
apache-2.0
DoubleNegativeVisualEffects/cortex
test/IECore/PointsMotionOpTest.py
12
7993
########################################################################## # # Copyright (c) 2010, Image Engine Design 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: # # * Redistribu...
bsd-3-clause
ericlink/adms-server
playframework-dist/1.1-src/python/Lib/stringprep.py
30
13794
# 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. """ from unicodedata import ucd_3_2_0 as unicodeda...
mit
xiaolonginfo/decode-Django
Django-1.5.1/tests/modeltests/custom_managers/tests.py
41
2797
from __future__ import absolute_import from django.test import TestCase from django.utils import six from .models import (ObjectQuerySet, RelatedObject, Person, Book, Car, PersonManager, PublishedBookManager) class CustomManagerTests(TestCase): def test_manager(self): p1 = Person.objects.create(firs...
gpl-2.0
patochectp/navitia
source/navitiacommon/navitiacommon/default_values.py
1
4496
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility and open public t...
agpl-3.0
kk9599/pupy
pupy/packages/windows/x86/psutil/_pswindows.py
66
19166
#!/usr/bin/env python # Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Windows platform implementation.""" import errno import functools import os import sys from collections import namedtuple from ...
bsd-3-clause
erjohnso/ansible
lib/ansible/modules/network/panos/panos_object.py
42
16678
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage PaloAltoNetworks Firewall # (c) 2016, techbizdev <techbizdev@paloaltonetworks.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publish...
gpl-3.0
HrWangChengdu/CS231n
assignment3/cs231n/image_utils.py
16
2342
import urllib2, os, tempfile import numpy as np from scipy.misc import imread from cs231n.fast_layers import conv_forward_fast """ Utility functions used for viewing and processing images. """ def blur_image(X): """ A very gentle image blurring operation, to be used as a regularizer for image generation. ...
mit
smarter/aom
test/android/get_files.py
9
3344
# # Copyright (c) 2016, Alliance for Open Media. All rights reserved # # This source code is subject to the terms of the BSD 2 Clause License and # the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License # was not distributed with this source code in the LICENSE file, you can # obtain it at www.aome...
bsd-2-clause
mwmuni/LIGGGHTS_GUI
OpenGL/GL/NV/parameter_buffer_object.py
9
2582
'''OpenGL extension NV.parameter_buffer_object This module customises the behaviour of the OpenGL.raw.GL.NV.parameter_buffer_object to provide a more Python-friendly API Overview (from the spec) This extension, in conjunction with NV_gpu_program4, provides a new type of program parameter than can be used as a c...
gpl-3.0
GiovanniConserva/TestDeploy
venv/Lib/site-packages/django/templatetags/i18n.py
219
19311
from __future__ import unicode_literals import sys from django.conf import settings from django.template import Library, Node, TemplateSyntaxError, Variable from django.template.base import TOKEN_TEXT, TOKEN_VAR, render_value_in_context from django.template.defaulttags import token_kwargs from django.utils import six...
bsd-3-clause
withanage/meTypeset
bin/interactive.py
2
15252
#!/usr/bin/env python from __future__ import print_function __author__ = "Martin Paul Eve" __email__ = "martin@martineve.com" """ A class to handle an interactive prompt. Portions of this file are Copyright 2014, Adrian Sampson. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of thi...
gpl-2.0
neurodebian/htcondor
src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/Languages/bg.py
10
18721
apiAttachAvailable = u'\u0414\u043e\u0441\u0442\u044a\u043f\u0435\u043d \u0447\u0440\u0435\u0437 API' apiAttachNotAvailable = u'\u041d\u0435\u0434\u043e\u0441\u0442\u044a\u043f\u0435\u043d' apiAttachPendingAuthorization = u'\u0427\u0430\u043a\u0430 \u0441\u0435 \u043e\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u...
apache-2.0
Jumpscale/ays9
JumpScale9AYS/clients/sync_client/client_support.py
3
6067
""" support methods for python clients """ import json import collections from datetime import datetime from uuid import UUID from enum import Enum from dateutil import parser # python2/3 compatible basestring, for use in to_dict try: basestring except NameError: basestring = str def timestamp_from_datetim...
apache-2.0
tparks5/tor-stem
test/unit/util/str_tools.py
1
6327
""" Unit tests for the stem.util.str_tools functions. """ import datetime import unittest from stem.util import str_tools class TestStrTools(unittest.TestCase): def test_to_int(self): """ Checks the _to_int() function. """ test_inputs = { '': 0, 'h': 104, 'hi': 26729, 'hel...
lgpl-3.0
achals/servo
tests/wpt/web-platform-tests/tools/wptserve/tests/functional/base.py
293
1831
import base64 import logging import os import unittest import urllib import urllib2 import urlparse import wptserve logging.basicConfig() here = os.path.split(__file__)[0] doc_root = os.path.join(here, "docroot") class Request(urllib2.Request): def __init__(self, *args, **kwargs): urllib2.Request.__init...
mpl-2.0
schaubl/libcloud
libcloud/storage/drivers/local.py
37
19092
# 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
kuiwei/edx-platform
common/djangoapps/user_api/tests/test_account_api.py
8
13151
# -*- coding: utf-8 -*- """ Tests for the account API. """ import re from unittest import skipUnless from nose.tools import raises from mock import patch import ddt from dateutil.parser import parse as parse_datetime from django.core import mail from django.test import TestCase from django.conf import settings from ...
agpl-3.0
josecolella/PLD
bin/osx/treasurehunters.app/Contents/Resources/lib/python3.4/numpy/oldnumeric/ufuncs.py
13
1297
from __future__ import division, absolute_import, print_function __all__ = ['less', 'cosh', 'arcsinh', 'add', 'ceil', 'arctan2', 'floor_divide', 'fmod', 'hypot', 'logical_and', 'power', 'sinh', 'remainder', 'cos', 'equal', 'arccos', 'less_equal', 'divide', 'bitwise_or', 'bitwise_and', ...
mit
springmeyer/gyp
test/errors/gyptest-errors.py
54
1921
#!/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. """ Test that two targets with the same name generates an error. """ import os import sys import TestGyp import TestCmd # TODO(sbc): Remo...
bsd-3-clause
Kazade/NeHe-Website
google_appengine/lib/django-1.2/django/templatetags/cache.py
309
2406
from django.template import Library, Node, TemplateSyntaxError, Variable, VariableDoesNotExist from django.template import resolve_variable from django.core.cache import cache from django.utils.encoding import force_unicode from django.utils.http import urlquote from django.utils.hashcompat import md5_constructor regi...
bsd-3-clause
florentx/OpenUpgrade
addons/hr_payroll/wizard/__init__.py
442
1159
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # it ...
agpl-3.0
byterom/android_external_chromium_org
chrome/browser/resources/chromeos/chromevox/PRESUBMIT.py
86
1391
# 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. """Presubmit script for ChromeVox.""" def CheckChangeOnUpload(input_api, output_api): paths = input_api.AbsoluteLocalPaths() def ShouldCheckFile(path):...
bsd-3-clause
mantidproject/mantid
Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/IndirectILLEnergyTransferTest.py
3
6789
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + impo...
gpl-3.0
open-synergy/hr
hr_employee_benefit/models/hr_contract.py
15
1171
# -*- coding:utf-8 -*- ############################################################################## # # Copyright (C) 2015 Savoir-faire Linux. All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as publish...
agpl-3.0
cloudfoundry/php-buildpack-legacy
builds/runtimes/python-2.7.6/lib/python2.7/test/test_nis.py
91
1344
from test import test_support import unittest nis = test_support.import_module('nis') class NisTests(unittest.TestCase): def test_maps(self): try: maps = nis.maps() except nis.error, msg: # NIS is probably not active, so this test isn't useful if test_support.ve...
mit
steventimberman/masterDebater
env/lib/python2.7/site-packages/django/core/mail/message.py
36
19471
from __future__ import unicode_literals import mimetypes import os import random import time from email import ( charset as Charset, encoders as Encoders, generator, message_from_string, ) from email.header import Header from email.message import Message from email.mime.base import MIMEBase from email.mime.message...
mit
pytest-dev/pytest-services
tests/test_plugin.py
1
1365
"""Tests for pytest-services plugin.""" import os.path import socket import pylibmc import MySQLdb def test_memcached(request, memcached, memcached_socket): """Test memcached service.""" mc = pylibmc.Client([memcached_socket]) mc.set('some', 1) assert mc.get('some') == 1 # check memcached cleane...
mit
anryko/ansible
test/units/modules/network/onyx/test_onyx_snmp_users.py
9
4077
# # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.onyx impor...
gpl-3.0
fbradyirl/home-assistant
homeassistant/components/joaoapps_join/notify.py
4
2731
"""Support for Join notifications.""" import logging import voluptuous as vol from homeassistant.components.notify import ( ATTR_DATA, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotificationService, ) from homeassistant.const import CONF_API_KEY import homeassistant.helpers.config_validati...
apache-2.0
sbellem/django-rest-framework
rest_framework/reverse.py
56
2304
""" Provide urlresolver functions that return fully qualified URLs or view names """ from __future__ import unicode_literals from django.core.urlresolvers import reverse as django_reverse from django.core.urlresolvers import NoReverseMatch from django.utils import six from django.utils.functional import lazy from res...
bsd-2-clause
MrMC/mrmc
tools/EventClients/lib/python/ps3/sixpair.py
208
2903
#!/usr/bin/python # -*- coding: utf-8 -*- import sys import usb vendor = 0x054c product = 0x0268 timeout = 5000 passed_value = 0x03f5 def find_sixaxes(): res = [] for bus in usb.busses(): for dev in bus.devices: if dev.idVendor == vendor and dev.idProduct == product: res.append(dev) return r...
gpl-2.0
qusp/orange3
Orange/canvas/gui/dropshadow.py
16
13298
""" ================= Drop Shadow Frame ================= A widget providing a drop shadow (gaussian blur effect) around another widget. """ from PyQt4.QtGui import ( QWidget, QPainter, QPixmap, QGraphicsScene, QGraphicsRectItem, QGraphicsDropShadowEffect, QColor, QPen, QPalette, QStyleOption, QAbstractS...
bsd-2-clause
yk5/incubator-airflow
tests/operators/python_operator.py
6
9948
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
neumerance/deploy
openstack_dashboard/dashboards/admin/domains/tests.py
12
16094
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Hewlett-Packard Development Company, L.P. # # 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....
apache-2.0
avances123/huertos-api
farms/tests.py
1
5079
from rest_framework import status from rest_framework.test import APITestCase from django.urls import reverse from faker import Factory from django.contrib.auth.models import User from farms.models import Farm,Zone from farms.serializers import FarmSerializer from collections import OrderedDict ###### Module configs ...
gpl-2.0
dstroppa/openstack-smartos-nova-grizzly
nova/tests/api/openstack/compute/contrib/test_flavorextradata.py
7
3554
# Copyright 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 # # Unless requ...
apache-2.0
vmthunder/nova
nova/virt/libvirt/vif.py
9
27229
# Copyright (C) 2011 Midokura KK # Copyright (C) 2011 Nicira, Inc # Copyright 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # ...
apache-2.0
victorbriz/rethinkdb
test/rql_test/connections/http_support/flask/globals.py
783
1137
# -*- coding: utf-8 -*- """ flask.globals ~~~~~~~~~~~~~ Defines all the global objects that are proxies to the current active context. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from functools import partial from werkzeug.local import LocalStack, ...
agpl-3.0
Kazade/NeHe-Website
google_appengine/lib/django-1.4/tests/modeltests/delete/models.py
44
3200
from django.db import models class R(models.Model): is_default = models.BooleanField(default=False) def __str__(self): return "%s" % self.pk get_default_r = lambda: R.objects.get_or_create(is_default=True)[0] class S(models.Model): r = models.ForeignKey(R) class T(models.Model): s = mod...
bsd-3-clause
sudheesh001/oh-mainline
vendor/packages/Pygments/pygments/lexers/templates.py
72
55945
# -*- coding: utf-8 -*- """ pygments.lexers.templates ~~~~~~~~~~~~~~~~~~~~~~~~~ Lexers for various template engines' markup. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexers.web import \ PhpLexer, H...
agpl-3.0
mensler/ansible
lib/ansible/plugins/connection/ssh.py
25
40554
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # Copyright 2015 Abhijit Menon-Sen <ams@2ndQuadrant.com> # Copyright 2017 Toshio Kuratomi <tkuratomi@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 Lice...
gpl-3.0
AladdinSonni/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/systemhost.py
129
2196
# Copyright (c) 2011 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
msegado/edx-platform
common/djangoapps/terrain/stubs/youtube.py
88
6138
""" Stub implementation of YouTube for acceptance tests. To start this stub server on its own from Vagrant: 1.) Locally, modify your Vagrantfile so that it contains: config.vm.network :forwarded_port, guest: 8031, host: 8031 2.) From within Vagrant dev environment do: cd common/djangoapps/terrain pyth...
agpl-3.0
fpsw/Servo
servo/tasks.py
1
5336
# -*- coding: utf-8 -*- from email.parser import BytesParser from django.core.cache import cache from servo.lib.utils import empty from servo.exceptions import ConfigurationError from servo.models import Configuration, User, Order, Note, Template def get_rules(): """ Get the rules from the JSON file and cac...
bsd-2-clause
sestrella/ansible
lib/ansible/modules/cloud/lxd/lxd_container.py
15
22900
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2016, Hiroaki Nakamura <hnakamur@gmail.com> # 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_vers...
gpl-3.0
atlefren/beerdatabase
alembic/versions/2b35f2f2adcb_add_geoloc_tables.py
1
1700
"""add geoloc tables Revision ID: 2b35f2f2adcb Revises: 29474f196c96 Create Date: 2015-11-09 00:12:02.604229 """ # revision identifiers, used by Alembic. revision = '2b35f2f2adcb' down_revision = '29474f196c96' branch_labels = None depends_on = None import os import json from alembic import op import sqlalchemy as...
mit
hectord/lettuce
tests/integration/lib/Django-1.2.5/django/utils/cache.py
44
9146
""" This module contains helper functions for controlling caching. It does so by managing the "Vary" header of responses. It includes functions to patch the header of response objects directly and decorators that change functions to do that header-patching themselves. For information on the Vary header, see: http...
gpl-3.0
apark263/tensorflow
tensorflow/contrib/learn/python/learn/estimators/tensor_signature_test.py
137
8063
# 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
listamilton/supermilton.repository
plugin.video.efilmes/bs4/tests/test_builder_registry.py
485
5374
"""Tests of the builder registry.""" import unittest from bs4 import BeautifulSoup from bs4.builder import ( builder_registry as registry, HTMLParserTreeBuilder, TreeBuilderRegistry, ) try: from bs4.builder import HTML5TreeBuilder HTML5LIB_PRESENT = True except ImportError: HTML5LIB_PRESENT =...
gpl-2.0
shubhamdhama/zulip
zerver/lib/bugdown/fenced_code.py
2
14935
""" Fenced Code Extension for Python Markdown ========================================= This extension adds Fenced Code Blocks to Python-Markdown. >>> import markdown >>> text = ''' ... A paragraph before a fenced code block: ... ... ~~~ ... Fenced code block ... ~~~ ... ''' >>> ht...
apache-2.0
liberation/sesql
sesql/daemon/sesql-update.py
1
4201
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) Pilot Systems and Libération, 2010-2011 # This file is part of SeSQL. # SeSQL 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 th...
gpl-2.0
jfwood/barbican-1
barbican/openstack/common/rpc/matchmaker_redis.py
1
4862
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Cloudscaling Group, 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/LI...
apache-2.0
kratorius/ads
python/sorting/merge_sort.py
1
1064
import unittest def merge_sort(array): if len(array) <= 1: return array mid = len(array) / 2 merge1, merge2 = merge_sort(array[:mid]), merge_sort(array[mid:]) def merge(left, right): l, r = 0, 0 while l < len(left) and r < len(right): if left[l] < right[r]: ...
mit
a40223217/2015cdb_g6team3
static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/version.py
607
1334
## pygame - Python Game Library ## Copyright (C) 2000-2003 Pete Shinners ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Library General Public ## License as published by the Free Software Foundation; either ## version 2 of the License, or (...
gpl-3.0
Nowheresly/odoo
openerp/addons/base/tests/test_api.py
56
17851
from openerp import models from openerp.tools import mute_logger from openerp.osv.orm import except_orm from openerp.tests import common class TestAPI(common.TransactionCase): """ test the new API of the ORM """ def assertIsRecordset(self, value, model): self.assertIsInstance(value, models.BaseModel...
agpl-3.0
denovator/myfriki
lib/jinja2/jinja2/parser.py
637
35186
# -*- coding: utf-8 -*- """ jinja2.parser ~~~~~~~~~~~~~ Implements the template parser. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ from jinja2 import nodes from jinja2.exceptions import TemplateSyntaxError, TemplateAssertionError from jinja2.lexer impo...
apache-2.0
orbitfp7/nova
nova/tests/unit/objects/test_virt_cpu_topology.py
94
1397
# 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
nesdis/djongo
tests/django_tests/tests/v22/tests/validation/test_unique.py
86
6715
import datetime import unittest from django.apps.registry import Apps from django.core.exceptions import ValidationError from django.db import models from django.test import TestCase from .models import ( CustomPKModel, FlexibleDatePost, ModelToValidate, Post, UniqueErrorsModel, UniqueFieldsModel, UniqueForDa...
agpl-3.0
mzdaniel/oh-mainline
vendor/packages/Django/django/core/files/utils.py
901
1230
class FileProxyMixin(object): """ A mixin class used to forward file methods to an underlaying file object. The internal file object has to be called "file":: class FileProxy(FileProxyMixin): def __init__(self, file): self.file = file """ encoding = property(la...
agpl-3.0
f3zz3h/Embedded-Systems-Development
Client/Python-RTSP/keypad.py
1
6324
__author__ = "Luke Hart" __copyright__ = "Copyright 2014, The Jeff Museum" __credits__ = ["Luke Hart","Joe Ellis", "Chris Sewell", "Matt Ribbins", "Sebastian Beaven", "Joshua Webb", "Andrew Bremmer"] __license__ = "GPL" __version__ = "0.9" __maintainer__ = "Luke Hart" __email__ = "luke2.hart@live.uwe.ac....
gpl-3.0
beni55/olympia
apps/search/views.py
13
23178
from django import http from django.conf import settings from django.db.models import Q from django.shortcuts import render from django.utils import translation from django.utils.encoding import smart_str from django.views.decorators.vary import vary_on_headers import commonware.log from mobility.decorators import mob...
bsd-3-clause
sogelink/ansible
lib/ansible/modules/cloud/profitbricks/profitbricks_volume_attachments.py
26
7794
#!/usr/bin/python # Copyright: 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 ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
cccfran/sympy
sympy/liealgebras/tests/test_weyl_group.py
22
1587
from sympy.liealgebras.weyl_group import WeylGroup from sympy.liealgebras.type_a import TypeA from sympy.liealgebras.type_b import TypeB from sympy.matrices import Matrix def test_weyl_group(): c = WeylGroup("A3") assert c.matrix_form('r1*r2') == Matrix([[0, 0, 1, 0], [1, 0, 0, 0], [0, 1, 0, 0], [0, 0,...
bsd-3-clause
mozilla/build-relengapi
relengapi/blueprints/badpenny/__init__.py
3
4007
# 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/. from __future__ import absolute_import import structlog from flask import Blueprint from flask import current_app from ...
mpl-2.0
mitodl/open-discussions
channels/serializers/comments.py
1
10793
"""Serializers for commment REST APIs""" from datetime import datetime, timezone from django.contrib.auth import get_user_model from praw.models import Comment, MoreComments from praw.models.reddit.submission import Submission from rest_framework import serializers from rest_framework.exceptions import ValidationError...
bsd-3-clause
m42e/jirash
deps/requests/packages/charade/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...
mit
abstract-open-solutions/OCB
openerp/report/custom.py
338
25091
# -*- 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
dbrattli/aioreactive
test/test_flat_map.py
1
2446
import aioreactive as rx import pytest from aioreactive.notification import OnCompleted, OnNext from aioreactive.testing import AsyncTestObserver, VirtualTimeEventLoop from aioreactive.types import AsyncObservable from expression.core import pipe @pytest.yield_fixture() # type: ignore def event_loop(): loop = Vi...
mit
pbrady/sympy
sympy/vector/scalar.py
42
1640
from sympy.core.symbol import Symbol from sympy.core.compatibility import u, range from sympy.printing.pretty.stringpict import prettyForm class BaseScalar(Symbol): """ A coordinate symbol/base scalar. Ideally, users should not instantiate this class. """ def __new__(cls, name, index, system, p...
bsd-3-clause
mgit-at/ansible
test/units/modules/network/f5/test_bigip_smtp.py
21
5016
# -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # 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 os import json import pytest import sys if sys.version_info < (2...
gpl-3.0
mmilidoni/system-utility
vim-config/.vim/ftplugin/python/pyflakes/pyflakes/scripts/pyflakes.py
41
2656
""" Implementation of the command-line I{pyflakes} tool. """ import sys import os import _ast checker = __import__('pyflakes.checker').checker def check(codeString, filename): """ Check the Python source given by C{codeString} for flakes. @param codeString: The Python source to check. @type codeStr...
gpl-2.0
lunyang/pylearn2
pylearn2/training_algorithms/tests/test_sgd.py
32
61311
from __future__ import print_function import numpy as np from theano.compat.six.moves import cStringIO, xrange import theano.tensor as T from theano.tests import disturb_mem from theano.tests.record import Record, RecordMode from pylearn2.compat import first_key from pylearn2.costs.cost import Cost, SumOfCosts, Defau...
bsd-3-clause
ehashman/oh-mainline
vendor/packages/PyYaml/lib/yaml/serializer.py
560
4171
__all__ = ['Serializer', 'SerializerError'] from error import YAMLError from events import * from nodes import * class SerializerError(YAMLError): pass class Serializer(object): ANCHOR_TEMPLATE = u'id%03d' def __init__(self, encoding=None, explicit_start=None, explicit_end=None, version=No...
agpl-3.0
NonLogicalDev/ucsd_cat125
client/libs/custom/three.js/utils/exporters/maya/plug-ins/threeJsFileTranslator.py
210
16160
__author__ = 'Sean Griffin' __version__ = '1.0.0' __email__ = 'sean@thoughtbot.com' import sys import os.path import json import shutil from pymel.core import * from maya.OpenMaya import * from maya.OpenMayaMPx import * kPluginTranslatorTypeName = 'Three.js' kOptionScript = 'ThreeJsExportScript' kDefaultOptionsStri...
mit
epyatopal/geocoder-1
geocoder/here_reverse.py
3
1251
#!/usr/bin/python # coding: utf8 from __future__ import absolute_import from geocoder.base import Base from geocoder.keys import app_id, app_code from geocoder.location import Location from geocoder.here import Here class HereReverse(Here, Base): """ HERE Geocoding REST API ======================= Se...
mit
etherkit/OpenBeacon2
macos/venv/lib/python3.8/site-packages/pip/_vendor/msgpack/fallback.py
21
37133
"""Fallback pure Python implementation of msgpack""" from datetime import datetime as _DateTime import sys import struct PY2 = sys.version_info[0] == 2 if PY2: int_types = (int, long) def dict_iteritems(d): return d.iteritems() else: int_types = int unicode = str xrange = range de...
gpl-3.0
edisongustavo/Syrupy
setup.py
1
2177
#! /usr/bin/env python ############################################################################ ## setup.py ## ## Copyright 2008 Jeet Sukumaran. ## ## 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 Softwa...
gpl-3.0
evensonbryan/yocto-autobuilder
lib/python2.7/site-packages/SQLAlchemy-0.8.0b2-py2.7-linux-x86_64.egg/sqlalchemy/util/_collections.py
6
24911
# util/_collections.py # Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Collection classes and helpers.""" import sys import itertools import weakref...
gpl-2.0
newsteinking/docker
tests/unit/test_unit_outdated.py
8
4870
import sys import datetime import os from contextlib import contextmanager import freezegun import pytest import pretend import pip from pip._vendor import lockfile from pip.utils import outdated @pytest.mark.parametrize( ['stored_time', 'newver', 'check', 'warn'], [ ('1970-01-01T10:00:00Z', '2.0', ...
mit
sharkykh/SickRage
lib/subliminal/providers/subscenter.py
25
9252
# -*- coding: utf-8 -*- import bisect from collections import defaultdict import io import json import logging import zipfile from babelfish import Language from guessit import guessit from requests import Session from . import ParserBeautifulSoup, Provider from .. import __short_version__ from ..cache import SHOW_EX...
gpl-3.0
kvalo/ath10k
tools/perf/tests/attr.py
3174
9441
#! /usr/bin/python import os import sys import glob import optparse import tempfile import logging import shutil import ConfigParser class Fail(Exception): def __init__(self, test, msg): self.msg = msg self.test = test def getMsg(self): return '\'%s\' - %s' % (self.test.path, self.msg)...
gpl-2.0
CydarLtd/ansible
docs/bin/dump_keywords.py
33
2403
#!/usr/bin/env python import optparse import yaml from jinja2 import Environment, FileSystemLoader from ansible.playbook import Play from ansible.playbook.block import Block from ansible.playbook.role import Role from ansible.playbook.task import Task template_file = 'playbooks_keywords.rst.j2' oblist = {} clist = ...
gpl-3.0