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 |
|---|---|---|---|---|---|
manaris/jythonMusic | library/jython2.5.3/Lib/wsgiref/validate.py | 162 | 14737 | # (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
# Also licenced under the Apache License, 2.0: http://opensource.org/licenses/apache2.0.php
# Licensed to PSF under a Contributor Agreement
"""
Middlew... | gpl-3.0 |
JioCloud/horizon | openstack_dashboard/dashboards/project/data_processing/data_image_registry/forms.py | 3 | 4238 | # 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 |
wskplho/sl4a | python-build/python-libs/gdata/src/gdata/Crypto/Protocol/AllOrNothing.py | 226 | 10952 | """This file implements all-or-nothing package transformations.
An all-or-nothing package transformation is one in which some text is
transformed into message blocks, such that all blocks must be obtained before
the reverse transformation can be applied. Thus, if any blocks are corrupted
or lost, the original message... | apache-2.0 |
Samsung/skia | third_party/externals/gyp/test/win/gyptest-link-large-pdb.py | 218 | 2332 | #!/usr/bin/env python
# Copyright (c) 2013 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.
"""
Make sure msvs_large_pdb works correctly.
"""
import TestGyp
import struct
import sys
CHDIR = 'large-pdb'
def CheckImageAndPdb(tes... | bsd-3-clause |
epssy/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/gis/tests/geoapp/models.py | 109 | 1890 | from django.contrib.gis.db import models
from django.contrib.gis.tests.utils import mysql, spatialite
from django.utils.encoding import python_2_unicode_compatible
# MySQL spatial indices can't handle NULL geometries.
null_flag = not mysql
@python_2_unicode_compatible
class Country(models.Model):
name = models.Ch... | apache-2.0 |
craftytrickster/servo | tests/wpt/web-platform-tests/tools/pytest/testing/test_recwarn.py | 174 | 8300 | import warnings
import py
import pytest
from _pytest.recwarn import WarningsRecorder
def test_recwarn_functional(testdir):
reprec = testdir.inline_runsource("""
import warnings
oldwarn = warnings.showwarning
def test_method(recwarn):
assert warnings.showwarning != oldwarn
... | mpl-2.0 |
seankelly/buildbot | master/buildbot/steps/package/rpm/mock.py | 11 | 5749 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
vipulroxx/sympy | sympy/series/tests/test_order.py | 6 | 13941 | from sympy import (Symbol, Rational, Order, exp, ln, log, nan, oo, O, pi, I,
S, Integral, sin, cos, sqrt, conjugate, expand, transpose, symbols,
Function)
from sympy.utilities.pytest import raises
from sympy.abc import w, x, y, z
def test_caching_bug():
#needs to be a first test, so that all caches are cl... | bsd-3-clause |
jrbl/invenio | modules/websearch/lib/search_engine_tests.py | 2 | 12267 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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 ... | gpl-2.0 |
kawamon/hue | desktop/core/ext-py/retry-decorator-1.0.0/retry_decorator/retry_decorator.py | 36 | 1190 | #!/usr/bin/env python
from __future__ import print_function
import traceback
import logging
import time
import random
import sys
def retry(ExceptionToCheck, tries=10, timeout_secs=1.0, logger=None):
"""
Retry calling the decorated function using an exponential backoff.
"""
def deco_retry(f):
... | apache-2.0 |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.6.0/Lib/encodings/cp855.py | 272 | 33850 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP855.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_map)
def decode(self,input,errors='strict'):
... | mit |
fishky/django-rest-framework | rest_framework/routers.py | 52 | 11664 | """
Routers provide a convenient and consistent way of automatically
determining the URL conf for your API.
They are used by simply instantiating a Router class, and then registering
all the required ViewSets with that router.
For example, you might have a `urls.py` that looks something like this:
router = route... | bsd-2-clause |
hplustree/trove | trove/tests/scenario/runners/instance_error_create_runners.py | 3 | 4773 | # Copyright 2016 Tesora 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 a... | apache-2.0 |
xujb/odoo | addons/purchase/purchase.py | 10 | 89960 | # -*- 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 |
40223117cda/2015cdaw13 | static/Brython3.1.1-20150328-091302/Lib/markdown2.py | 669 | 8143 | import browser.html
import re
class URL:
def __init__(self,src):
elts = src.split(maxsplit=1)
self.href = elts[0]
self.alt = ''
if len(elts)==2:
alt = elts[1]
if alt[0]=='"' and alt[-1]=='"':self.alt=alt[1:-1]
elif alt[0]=="'" and alt[-1]=="'":sel... | gpl-3.0 |
plissonf/scikit-learn | sklearn/ensemble/tests/test_bagging.py | 72 | 25573 | """
Testing for the bagging ensemble module (sklearn.ensemble.bagging).
"""
# Author: Gilles Louppe
# License: BSD 3 clause
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.te... | bsd-3-clause |
BioRoboticsUNAM/pyRobotics | pyrobotics/shared_variables.py | 1 | 10146 | import re
from StringIO import StringIO
import BB
from messages import Message, MessageTypes, Command, Response
class SharedVarTypes(object):
'''
Pseudo-enum of the types of shared variables.
The existing values are:
* SharedVarTypes.BYTE_ARRAY
* SharedVarTypes.INT
* Shar... | mit |
icasdri/pybatterymonitor | setup.py | 1 | 1441 | # Copyright 2014 icasdri
#
# This file is part of pybatterymonitor.
#
# pybatterymonitor 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 |
aspidites/django | django/contrib/sessions/backends/signed_cookies.py | 383 | 2895 | from django.conf import settings
from django.contrib.sessions.backends.base import SessionBase
from django.core import signing
class SessionStore(SessionBase):
def load(self):
"""
We load the data from the key itself instead of fetching from
some external data store. Opposite of _get_sess... | bsd-3-clause |
tectronics/cortex-vfx | test/IECore/ops/mayaUserData/mayaUserData-1.py | 12 | 2775 | ##########################################################################
#
# 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 |
rickerc/nova_audit | nova/openstack/common/strutils.py | 25 | 7322 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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
#
# http://www.apac... | apache-2.0 |
ramanajee/phantomjs | src/breakpad/src/tools/gyp/pylib/gyp/generator/xcode.py | 137 | 50429 | #!/usr/bin/python
# Copyright (c) 2009 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.
import filecmp
import gyp.common
import gyp.xcodeproj_file
import errno
import os
import posixpath
import re
import shutil
import subprocess
imp... | bsd-3-clause |
prds21/barrial-movie | barrial-movie/channels/mitube.py | 2 | 6850 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Canal para buscar y ver video de yotube (por gasmuro1)
#
#------------------------------------------------------------
import urlparse,urllib2,urllib,re,pafy
import os, sys,json,time
if sys.version_i... | gpl-3.0 |
mbareta/edx-platform-ft | cms/djangoapps/contentstore/views/tests/test_container_page.py | 158 | 9232 | """
Unit tests for the container page.
"""
import re
import datetime
from pytz import UTC
from mock import patch, Mock
from django.http import Http404
from django.test.client import RequestFactory
from django.utils import http
import contentstore.views.component as views
from contentstore.views.tests.utils import Stu... | agpl-3.0 |
aonotas/chainer | chainer/functions/math/det.py | 3 | 3637 | import numpy
import chainer
from chainer.backends import cuda
from chainer import function_node
import chainer.functions
from chainer.functions.math import matmul
from chainer import utils
from chainer.utils import type_check
def _det_gpu(b):
# We do a batched LU decomposition on the GPU to compute
# and com... | mit |
jvazquez/job_seeker | job_seeker/scrape/tasks.py | 1 | 4823 | from __future__ import absolute_import
import datetime
import logging
import urllib2
import sys
from bs4 import BeautifulSoup
from celery import Celery
from scrape.models import ClSite, ClOffer, ClOfferText
from utils.dbutils import session_scope
QS = "/search/eng?is_telecommuting=1"
logger = logging.getLogger(_... | gpl-2.0 |
dwightgunning/django | tests/view_tests/models.py | 281 | 1329 | """
Regression tests for Django built-in views.
"""
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Author(models.Model):
name = models.CharField(max_length=100)
def __str__(self):
return self.name
def get_absolute_ur... | bsd-3-clause |
SiccarPoint/landlab | landlab/grid/raster_mappers.py | 1 | 24611 | #! /usr/bin/env python
"""Grid element mappers that are specific to raster grids.
Mapping functions unique to raster grids
+++++++++++++++++++++++
.. autosummary::
:toctree: generated/
~landlab.grid.raster_mappers.map_sum_of_inlinks_to_node
~landlab.grid.raster_mappers.map_mean_of_inlinks_to_node
~la... | mit |
mydongistiny/external_chromium_org | third_party/re2/re2/make_unicode_groups.py | 219 | 2849 | #!/usr/bin/python
# Copyright 2008 The RE2 Authors. All Rights Reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
"""Generate C++ tables for Unicode Script and Category groups."""
import sys
import unicode
_header = """
// GENERATED BY make_unicode_groups... | bsd-3-clause |
fluidinfo/Tickery | bin/list-friends.py | 2 | 1256 | #!/usr/bin/python
# Copyright 2010 Fluidinfo 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 agr... | apache-2.0 |
repotvsupertuga/tvsupertuga.repository | script.module.TVsupertuga/lib/js2py/host/jseval.py | 33 | 1522 | from js2py.base import *
import inspect
try:
from js2py.translators.translator import translate_js
except:
pass
@Js
def Eval(code):
local_scope = inspect.stack()[3][0].f_locals['var']
global_scope = this.GlobalObject
# todo fix scope - we have to behave differently if called through variable other ... | gpl-2.0 |
pdebuyl/lammps | tools/i-pi/ipi/inputs/normalmodes.py | 41 | 3951 | """Deals with creating the normal mode representation arrays.
Copyright (C) 2013, Joshua More and Michele Ceriotti
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... | gpl-2.0 |
wakatime/komodo-wakatime | components/wakatime/packages/urllib3/util/response.py | 316 | 2343 | from __future__ import absolute_import
from ..packages.six.moves import http_client as httplib
from ..exceptions import HeaderParsingError
def is_fp_closed(obj):
"""
Checks whether a given file-like object is closed.
:param obj:
The file-like object to check.
"""
try:
# Check `i... | bsd-3-clause |
anish/buildbot | master/buildbot/steps/source/darcs.py | 1 | 8652 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
GeoscienceAustralia/geodesy-domain-model | aws/amazonia/test/sys_tests/test_sys_lambda_leaf.py | 3 | 1195 | #!/usr/bin/python3
from amazonia.classes.lambda_config import LambdaConfig
from amazonia.classes.amz_lambda import LambdaLeaf
from troposphere import Template
def main():
template = Template()
lambda_config = LambdaConfig(
lambda_s3_bucket='smallest-bucket-in-history',
lambda_s3_key='test_la... | bsd-3-clause |
RichardLitt/wyrd-django-dev | django/template/loaders/cached.py | 110 | 2533 | """
Wrapper class that takes a list of template loaders as an argument and attempts
to load templates from them in order, caching the result.
"""
import hashlib
from django.template.base import TemplateDoesNotExist
from django.template.loader import BaseLoader, get_template_from_string, find_template_loader, make_orig... | bsd-3-clause |
team-ferret/pip-in-toto | pip/baseparser.py | 339 | 10465 | """Base option parser setup"""
from __future__ import absolute_import
import sys
import optparse
import os
import re
import textwrap
from distutils.util import strtobool
from pip._vendor.six import string_types
from pip._vendor.six.moves import configparser
from pip.locations import (
legacy_config_file, config_b... | mit |
huonw/servo | tests/wpt/web-platform-tests/html/tools/update_html5lib_tests.py | 125 | 5358 | import sys
import os
import hashlib
import urllib
import itertools
import re
import json
import glob
import shutil
try:
import genshi
from genshi.template import MarkupTemplate
from html5lib.tests import support
except ImportError:
print """This script requires the Genshi templating library and html5l... | mpl-2.0 |
ritchyteam/odoo | addons/multi_company/__openerp__.py | 52 | 1754 | # -*- 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 |
larsbutler/swift | test/unit/account/test_reaper.py | 1 | 33365 | # Copyright (c) 2010-2012 OpenStack Foundation
#
# 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 |
vrieni/orange | Orange/orng/updateOrange.py | 6 | 24544 | #import orngOrangeFoldersQt4
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import os, re, urllib, sys
import md5, cPickle
# This is Orange Update program. It can check on the web if there are any updates available and download them.
# User can select a list of folders that he wants to update and a list of folde... | gpl-3.0 |
juped/your-urbit | outside/commonmark/test/spec_tests.py | 23 | 5234 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from difflib import unified_diff
import argparse
import re
import json
from cmark import CMark
from normalize import normalize_html
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Run cmark tests.')
parser.add_argument('--progra... | mit |
joeythesaint/yocto-autobuilder | lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/test/unit/test_changes_base.py | 8 | 2873 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
xpansa/odoomrp-wip | purchase_homologation/__init__.py | 61 | 1629 | # -*- encoding: utf-8 -*-
##############################################################################
# #
# OpenERP, Open Source Management Solution. #
# ... | agpl-3.0 |
tojonmz/treeherder | treeherder/etl/push.py | 3 | 1993 | import logging
from datetime import datetime
from django.db import transaction
from treeherder.model.models import (Commit,
Push)
logger = logging.getLogger(__name__)
def store_push(repository, push_dict):
push_revision = push_dict.get('revision')
if not push_dict.get('... | mpl-2.0 |
romain-li/edx-platform | cms/envs/dev.py | 21 | 5916 | """
This config file runs the simplest dev environment"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=wildcard-import, unused-wildcard-import
from .common import *
from openedx.core.lib.logsettings import get_logger_config... | agpl-3.0 |
tomchristie/django-rest-framework | rest_framework/renderers.py | 1 | 40037 | """
Renderers are used to serialize a response into specific media types.
They give us a generic way of being able to handle various media types
on the response, such as JSON encoded data or HTML output.
REST framework also provides an HTML renderer that renders the browsable API.
"""
import base64
from collections i... | bsd-2-clause |
hydroshare/hydroshare | hs_core/management/commands/check_bag.py | 1 | 12581 | # -*- coding: utf-8 -*-
"""
Generate metadata and bag for a resource from Django
"""
import os
import requests
from django.conf import settings
from django.core.management.base import BaseCommand
from hs_core.models import BaseResource
from hs_core.hydroshare import hs_requests
from hs_core.hydroshare.hs_bagit impor... | bsd-3-clause |
vivekananda/fbeats | django/contrib/gis/db/backends/postgis/adapter.py | 94 | 1501 | """
This object provides quoting for GEOS geometries into PostgreSQL/PostGIS.
"""
from psycopg2 import Binary
from psycopg2.extensions import ISQLQuote
class PostGISAdapter(object):
def __init__(self, geom):
"Initializes on the geometry."
# Getting the WKB (in string form, to allow easy pickling ... | bsd-3-clause |
Weicong-Lin/pymo-global | android/pgs4a-0.9.6/python-install/lib/python2.7/test/test_difflib.py | 86 | 10297 | import difflib
from test.test_support import run_unittest, findfile
import unittest
import doctest
import sys
class TestWithAscii(unittest.TestCase):
def test_one_insert(self):
sm = difflib.SequenceMatcher(None, 'b' * 100, 'a' + 'b' * 100)
self.assertAlmostEqual(sm.ratio(), 0.995, places=3)
... | mit |
mdietrichc2c/OCB | addons/l10n_mx/__openerp__.py | 379 | 2559 | # -*- encoding: utf-8 -*-
###########################################################################
# Module Writen to OpenERP, Open Source Management Solution
# All Rights Reserved
###############Credits######################################################
# Coded by: Alejandro Negrin anegrin@vauxoo.com,
#... | agpl-3.0 |
kuiwei/kuiwei | common/lib/capa/capa/tests/response_xml_factory.py | 47 | 34688 | from lxml import etree
from abc import ABCMeta, abstractmethod
class ResponseXMLFactory(object):
""" Abstract base class for capa response XML factories.
Subclasses override create_response_element and
create_input_element to produce XML of particular response types"""
__metaclass__ = ABCMeta
@a... | agpl-3.0 |
andreamerello/linux-stm32 | Documentation/sphinx/kernel-doc.py | 43 | 5741 | # coding=utf-8
#
# Copyright © 2016 Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, me... | gpl-2.0 |
eric-stanley/robotframework | utest/conf/test_settings.py | 1 | 5837 | import unittest
import os
from os.path import abspath
from robot.conf.settings import _BaseSettings, RobotSettings, RebotSettings
from robot.errors import DataError
from robot.utils.asserts import assert_equals, assert_false
class SettingWrapper(_BaseSettings):
def __init__(self):
pass
class TestSplit... | apache-2.0 |
jayceyxc/hue | desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/Protocol/AllOrNothing.py | 125 | 11897 | #
# AllOrNothing.py : all-or-nothing package transformations
#
# Part of the Python Cryptography Toolkit
#
# Written by Andrew M. Kuchling and others
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication ... | apache-2.0 |
marc-sensenich/ansible | lib/ansible/modules/cloud/cloudstack/cs_user.py | 15 | 11663 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015, René Moser <mail@renemoser.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterface'],
'supporte... | gpl-3.0 |
zachjustice/schemaverse_ai | db.py | 1 | 5792 | import psycopg2 #import postgresql connection library
from psycopg2.extras import NamedTupleConnection
import traceback
class db:
def __init__(self, conn_str):
self.conn = psycopg2.connect( conn_str ) #establish DB connection
self.conn.autocommit = True #disable transactions (transactions left... | mit |
Kev/maybelater | maybelater/urls.py | 1 | 1563 | from django.conf.urls.defaults import *
from django.contrib.auth.views import *
urlpatterns = patterns('maybelater.views',
#(r'^report/$', 'all_tasks'), #this one's just a test, don't enable it (allows you to see all tasks for all users)
#(r'^archived/$', 'archived'),
(r'^profile/$', 'editProfile'),
(r... | gpl-2.0 |
angdraug/nova | nova/api/openstack/compute/schemas/v3/aggregates.py | 14 | 2559 | # Copyright 2014 NEC Corporation. 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 ... | apache-2.0 |
ecthros/uncaptcha | audio.py | 1 | 16077 | import speech_recognition as sr
import os
import time
import json
import logging, sys
import multiprocessing
import pprint
import csv
import threading
import googleapiclient
from collections import Counter
# Set up logging and pretty printing
LEVEL = logging.INFO
logging.basicConfig(stream=sys.stderr, level=LEVEL)
lo... | mit |
xme1226/horizon | openstack_dashboard/dashboards/project/firewalls/workflows.py | 4 | 11755 | # Copyright 2013, Big Switch Networks, 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 applic... | apache-2.0 |
seem-sky/kbengine | kbe/src/lib/python/Lib/encodings/charmap.py | 860 | 2084 | """ Generic Python Character Mapping Codec.
Use this codec directly rather than through the automatic
conversion mechanisms supplied by unicode() and .encode().
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""#"
import codecs
### Codec APIs
class... | lgpl-3.0 |
zopim/babel-localization | babel/messages/plurals.py | 67 | 7207 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# This software cons... | bsd-3-clause |
gmarciani/pymple | sort/MergeSort.py | 1 | 1370 | '''
Created on May 25, 2013
@author: Giacomo
'''
def mergeSort(L):
recursiveMergeSort(L, 0, len(L) - 1)
def recursiveMergeSort(L, left, right):
if left >= right:
return
mid = int((left + right) / 2)
recursiveMergeSort(L, left, mid)
recursiveMergeSort(L, mid + 1, right)
... | mit |
eduNEXT/edunext-platform | common/test/acceptance/tests/studio/base_studio_test.py | 4 | 6142 | """
Base classes used by studio tests.
"""
from bok_choy.page_object import XSS_INJECTION
from common.test.acceptance.fixtures.course import CourseFixture
from common.test.acceptance.fixtures.library import LibraryFixture
from common.test.acceptance.pages.common.auto_auth import AutoAuthPage
from common.test.accepta... | agpl-3.0 |
2014cdag11/2014cadg11 | wsgi/programs/cdag3/__init__.py | 12 | 16404 | import cherrypy
# 這是 CDAG3 類別的定義
class CDAG3(object):
# 各組利用 index 引導隨後的程式執行
@cherrypy.expose
def index(self, *args, **kwargs):
outstring = '''
這是 2014CDA 協同專案下的 cdag3 分組程式開發網頁, 以下為 W12 的任務執行內容.<br />
<!-- 這裡採用相對連結, 而非網址的絕對連結 (這一段為 html 註解) -->
<a href="cube1">cdag3 正方體參數繪圖</a>(尺寸變數 a, b, c)<br />... | gpl-2.0 |
bigyanbhar/single-file-code | multiFileLogging.py | 1 | 2184 | __author__ = 'bigyan'
import logging
import os
class class2:
__logger = None
def __init__(self):
self.__logger = logging.getLogger("class2Log")
def log(self, message):
self.__logger.info(message)
#logging.basicConfig(
# filename=self.__expId + ".log",
# format='[%(asctime)s]' + ... | apache-2.0 |
bpsinc-native/src_third_party_trace-viewer | third_party/tvcm/tvcm/parse_html_deps.py | 1 | 6994 | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import re
from HTMLParser import HTMLParser
from tvcm import module
from tvcm import strip_js_comments
from tvcm import html_generation_controller
CHU... | bsd-3-clause |
Bismarrck/tensorflow | tensorflow/python/framework/op_def_library_test.py | 30 | 56095 | # 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 |
neiudemo1/django | tests/template_tests/syntax_tests/test_load.py | 475 | 3378 | from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import setup
class LoadTagTests(SimpleTestCase):
libraries = {
'subpackage.echo': 'template_tests.templatetags.subpackage.echo',
'testtags': 'template_tests.templatetags.testtags',
}
@setu... | bsd-3-clause |
bestvibes/neo4j-social-network | mac_env/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/euctwfreq.py | 3133 | 34872 | ######################## 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 |
kubeflow/kfp-tekton | components/gcp/container/component_sdk/python/kfp_component/google/dataproc/_submit_hadoop_job.py | 1 | 2945 | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
agriggio/pysmt | setup.py | 1 | 2121 | from setuptools import setup, find_packages
import pysmt
long_description=\
"""============================================================
pySMT: A library for SMT formulae manipulation and solving
============================================================
pySMT makes working with Satisfiability Modulo Theory si... | apache-2.0 |
weiqiangdragonite/blog_tmp | python/flask/microblog/app/forms.py | 2 | 1204 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask_wtf import Form
from wtforms import TextField, PasswordField, BooleanField, SubmitField, TextAreaField
from wtforms.validators import Required, Length
class LoginForm(Form):
openid = TextField("openid", validators = [Required()])
# password = PasswordFie... | gpl-2.0 |
trademob/boto | boto/rds/vpcsecuritygroupmembership.py | 177 | 3131 | # Copyright (c) 2013 Anthony Tonns http://www.corsis.com/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify... | mit |
dcroc16/skunk_works | google_appengine/lib/django-1.4/django/utils/unittest/loader.py | 353 | 13437 | """Loading unittests."""
import os
import re
import sys
import traceback
import types
import unittest
from fnmatch import fnmatch
from django.utils.unittest import case, suite
try:
from os.path import relpath
except ImportError:
from django.utils.unittest.compatibility import relpath
__unittest = True
de... | mit |
soldag/home-assistant | homeassistant/components/smart_meter_texas/config_flow.py | 10 | 2811 | """Config flow for Smart Meter Texas integration."""
import asyncio
import logging
from aiohttp import ClientError
from smart_meter_texas import Account, Client
from smart_meter_texas.exceptions import (
SmartMeterTexasAPIError,
SmartMeterTexasAuthError,
)
import voluptuous as vol
from homeassistant import co... | apache-2.0 |
patsissons/Flexget | flexget/plugins/urlrewrite_bakabt.py | 11 | 1604 | from __future__ import unicode_literals, division, absolute_import
import urllib2
import logging
from flexget import plugin
from flexget.event import event
from flexget.plugins.plugin_urlrewriting import UrlRewritingError
from flexget.utils.tools import urlopener
from flexget.utils.soup import get_soup
log = logging.... | mit |
AltSchool/django-allauth | test_settings.py | 1 | 5873 | SECRET_KEY = 'psst'
SITE_ID = 1
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': '',
}
}
ROOT_URLCONF = 'allauth.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.... | mit |
Tithen-Firion/youtube-dl | youtube_dl/YoutubeDL.py | 2 | 105297 | #!/usr/bin/env python
# coding: utf-8
from __future__ import absolute_import, unicode_literals
import collections
import contextlib
import copy
import datetime
import errno
import fileinput
import io
import itertools
import json
import locale
import operator
import os
import platform
import re
import shutil
import su... | unlicense |
kalxas/geonode | geonode/maps/management/commands/fix_baselayers.py | 24 | 1412 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 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 |
TangHao1987/intellij-community | python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/btm_matcher.py | 326 | 6834 | """A bottom-up tree matching algorithm implementation meant to speed
up 2to3's matching process. After the tree patterns are reduced to
their rarest linear path, a linear Aho-Corasick automaton is
created. The linear automaton traverses the linear paths from the
leaves to the root of the AST and returns a set of nodes ... | apache-2.0 |
BobCromwell/gyp | test/win/gyptest-link-opt-ref.py | 344 | 1145 | #!/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.
"""
Make sure reference optimization setting is extracted properly.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = Te... | bsd-3-clause |
tlatzko/spmcluster | .tox/docs/lib/python2.7/site-packages/pygments/lexers/ambient.py | 72 | 2557 | # -*- coding: utf-8 -*-
"""
pygments.lexers.ambient
~~~~~~~~~~~~~~~~~~~~~~~
Lexers for AmbientTalk language.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, words
from pygment... | bsd-2-clause |
marma/rdflib | setup.py | 5 | 5640 | #!/usr/bin/env python
import sys
import os
import re
def setup_python3():
# Taken from "distribute" setup.py
from distutils.filelist import FileList
from distutils import dir_util, file_util, util, log
from os.path import join, exists
tmp_src = join("build", "src")
# Not covered by "setup.py ... | bsd-3-clause |
vrsource/mapproxy | mapproxy/util/yaml.py | 2 | 1593 | # This file is part of the MapProxy project.
# Copyright (C) 2011 Omniscale <http://omniscale.de>
#
# 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... | apache-2.0 |
grevutiu-gabriel/phantomjs | src/qt/qtwebkit/Source/ThirdParty/gtest/scripts/upload_gtest.py | 1963 | 2851 | #!/usr/bin/env python
#
# Copyright 2009, 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... | bsd-3-clause |
coordcn/LuaIO | tools/gyp/pylib/gyp/input_test.py | 1841 | 3207 | #!/usr/bin/env python
# Copyright 2013 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.
"""Unit tests for the input.py file."""
import gyp.input
import unittest
import sys
class TestFindCycles(unittest.TestCase):
def setUp(self... | mit |
sjbog/ajenti | plugins/samba/main.py | 17 | 11071 | from ajenti.api import *
from ajenti.ui import *
from ajenti.utils import *
from ajenti import apis
import backend
class SambaPlugin(apis.services.ServiceControlPlugin):
text = 'Samba'
icon = '/dl/samba/icon.png'
folder = 'servers'
service_name = 'smbd'
def on_session_start(self):
se... | lgpl-3.0 |
tenvick/hugular_cstolua | Client/tools/site-packages/PIL/ImageDraw.py | 13 | 11655 | #
# The Python Imaging Library
# $Id: ImageDraw.py 2817 2006-10-07 15:34:03Z fredrik $
#
# drawing interface operations
#
# History:
# 1996-04-13 fl Created (experimental)
# 1996-08-07 fl Filled polygons, ellipses.
# 1996-08-13 fl Added text support
# 1998-06-28 fl Handle I and F images
# 1998-12-29 fl Added ... | mit |
epsilonorion/python-xbee | scripts/shell.py | 48 | 1646 | #!/usr/bin/env python
"""
shell.py
Amit Snyderman, 2009
<amit@amitsnyderman.com>
Updated by Paul Malmsten, 2010
pmalmsten@gmail.com
Provides a simple shell for testing XBee devices. Currently, the shell
only allows one to parse and print received data; sending is not
supported.
"""
# $Id: xbee-serial-terminal.py 7 2... | mit |
yg257/Pangea | lib/boto-2.34.0/tests/mturk/selenium_support.py | 115 | 1741 | from __future__ import absolute_import
from boto.mturk.test.support import unittest
sel_args = ('localhost', 4444, '*chrome', 'https://workersandbox.mturk.com')
class SeleniumFailed(object):
def __init__(self, message):
self.message = message
def __nonzero__(self):
return False
def has_selenium():
try:
from... | apache-2.0 |
sumedhasingla/VTK | Imaging/Core/Testing/Python/TestAllMathematics.py | 26 | 3800 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
=========================================================================
Program: Visualization Toolkit
Module: TestNamedColorsIntegration.py
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.... | bsd-3-clause |
aktech/sympy | sympy/polys/fields.py | 29 | 19557 | """Sparse rational function fields. """
from __future__ import print_function, division
from operator import add, mul, lt, le, gt, ge
from sympy.core.compatibility import is_sequence, reduce, string_types
from sympy.core.expr import Expr
from sympy.core.symbol import Symbol
from sympy.core.sympify import CantSympify... | bsd-3-clause |
lichong012245/django-lfs-0.7.8 | lfs/portlet/models/recent_products.py | 1 | 1892 | # django imports
from django import forms
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.template import RequestContext
from django.template.loader import render_to_string
# portlets imports
from portlets.models import Portlet
# lfs imports
from lfs.catalog.mod... | bsd-3-clause |
ColinIanKing/autotest | cli/action_common_unittest.py | 4 | 23407 | #!/usr/bin/python
#
# Copyright 2008 Google Inc. All Rights Reserved.
"""Tests for action_common."""
import unittest, sys, copy
try:
import autotest.common as common
except ImportError:
import common
from autotest.cli import cli_mock, action_common, rpc
#
# List action
#
class atest_list_unittest(cli_mock.c... | gpl-2.0 |
eoinmurray/icarus | notebooks/fid_v_dephase_helpers.py | 1 | 3271 | import os
import sys
import numpy as np
import matplotlib.pyplot as plt
def calculate_g2(delay_peak, hold_int):
if np.array(hold_int).mean() > 0:
g2 = delay_peak/np.array(hold_int).mean()
g2 = np.around(g2, decimals=3)
return g2
else:
return 0
def normalize(arr):
... | mit |
cherrypy/cherrypy | cherrypy/tutorial/tut10_http_errors.py | 6 | 2706 | """
Tutorial: HTTP errors
HTTPError is used to return an error response to the client.
CherryPy has lots of options regarding how such errors are
logged, displayed, and formatted.
"""
import os
import os.path
import cherrypy
localDir = os.path.dirname(__file__)
curpath = os.path.normpath(os.path.join(os.getcwd(),... | bsd-3-clause |
NunoEdgarGub1/nupic | tests/swarming/nupic/swarming/experiments/field_contrib_temporal/description.py | 8 | 15369 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | gpl-3.0 |
SlimRemix/android_external_chromium_org | third_party/cython/src/Cython/Debugger/libcython.py | 101 | 44489 | """
GDB extension that adds Cython support.
"""
from __future__ import with_statement
import sys
import textwrap
import traceback
import functools
import itertools
import collections
import gdb
try:
from lxml import etree
have_lxml = True
except ImportError:
have_lxml = False
try:
# Python 2... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.