repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
AlexanderFabisch/scikit-learn | sklearn/metrics/pairwise.py | 9 | 45248 | # -*- coding: utf-8 -*-
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Mathieu Blondel <mathieu@mblondel.org>
# Robert Layton <robertlayton@gmail.com>
# Andreas Mueller <amueller@ais.uni-bonn.de>
# Philippe Gervais <philippe.gervais@inria.fr>
# Lars Buitinck ... | bsd-3-clause |
jschultz/Gooey | gooey/python_bindings/config_generator.py | 1 | 2477 | import os
import sys
from gooey.gui.windows import layouts
from gooey.python_bindings import argparse_to_json
from gooey.gui.util.quoting import quote
def create_from_parser(parser, source_path, cmd_args, **kwargs):
auto_start = kwargs.get('auto_start', False)
if hasattr(sys, 'frozen'):
run_cmd = ... | mit |
timokoola/hslbot | docutils/parsers/rst/languages/fi.py | 128 | 3661 | # -*- coding: utf-8 -*-
# $Id: fi.py 7119 2011-09-02 13:00:23Z milde $
# Author: Asko Soukka <asko.soukka@iki.fi>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files ... | apache-2.0 |
bgxavier/neutron | neutron/db/metering/metering_db.py | 17 | 11434 | # Copyright (C) 2013 eNovance SAS <licensing@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/licenses/LICENSE-2.0
#
# Unless required by applicabl... | apache-2.0 |
abdulbaqi/quranf | venv/lib/python2.7/site-packages/pip/vcs/bazaar.py | 393 | 4943 | import os
import tempfile
import re
from pip.backwardcompat import urlparse
from pip.log import logger
from pip.util import rmtree, display_path, call_subprocess
from pip.vcs import vcs, VersionControl
from pip.download import path_to_url
class Bazaar(VersionControl):
name = 'bzr'
dirname = '.bzr'
repo_na... | mit |
Juniper/neutron | neutron/tests/unit/ml2/test_type_vxlan.py | 5 | 9439 | # Copyright (c) 2013 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 ... | apache-2.0 |
dingocuster/scikit-learn | examples/applications/plot_species_distribution_modeling.py | 254 | 7434 | """
=============================
Species distribution modeling
=============================
Modeling species' geographic distributions is an important
problem in conservation biology. In this example we
model the geographic distribution of two south american
mammals given past observations and 14 environmental
varia... | bsd-3-clause |
mdj2/django | django/contrib/auth/tests/test_forms.py | 6 | 16393 | from __future__ import unicode_literals
import os
from django.contrib.auth import get_user_model
from django.contrib.auth.models import User
from django.contrib.auth.forms import (UserCreationForm, AuthenticationForm,
PasswordChangeForm, SetPasswordForm, UserChangeForm, PasswordResetForm,
ReadOnlyPasswordHash... | bsd-3-clause |
TemplateVoid/mapnik | scons/scons-local-2.3.1/SCons/Tool/suncc.py | 8 | 1998 | """SCons.Tool.suncc
Tool-specific initialization for Sun Solaris (Forte) CC and cc.
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, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010... | lgpl-2.1 |
motion2015/a3 | common/lib/xmodule/xmodule/library_tools.py | 5 | 6842 | """
XBlock runtime services for LibraryContentModule
"""
from django.core.exceptions import PermissionDenied
from opaque_keys.edx.locator import LibraryLocator
from xmodule.library_content_module import ANY_CAPA_TYPE_VALUE
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.exceptions import ItemNo... | agpl-3.0 |
andresailer/DIRAC | tests/Integration/DataManagementSystem/Test_FileCatalogDB.py | 1 | 56699 | """ This is a test of the FileCatalogDB
It supposes that the DB is present.
"""
# pylint: disable=invalid-name,wrong-import-position
import unittest
import itertools
import os
import sys
from DIRAC.Core.Base import Script
Script.parseCommandLine()
from DIRAC.DataManagementSystem.DB.FileCatalogDB import FileCat... | gpl-3.0 |
Eric89GXL/mne-python | mne/datasets/sleep_physionet/temazepam.py | 8 | 4230 | # -*- coding: utf-8 -*-
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Joan Massich <mailsik@gmail.com>
#
# License: BSD Style.
import numpy as np
from ...utils import verbose
from ._utils import _fetch_one, _data_path, TEMAZEPAM_SLEEP_RECORDS
from ._utils import _check_subjects
data_path = _... | bsd-3-clause |
lmazuel/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_peering_py3.py | 1 | 4752 | # 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 ... | mit |
justnom/ansible-modules-core | cloud/openstack/os_image.py | 109 | 6129 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013, Benno Joy <benno@ansible.com>
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either vers... | gpl-3.0 |
jarvys/django-1.7-jdb | django/contrib/gis/geos/prototypes/errcheck.py | 66 | 3563 | """
Error checking functions for GEOS ctypes prototype functions.
"""
import os
from ctypes import c_void_p, string_at, CDLL
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.libgeos import GEOS_VERSION
from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc
# Getting the... | bsd-3-clause |
cynngah/uofthacksIV | generate-jobs/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.py | 395 | 25647 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""Utility functions for copying and archiving files and directory trees.
XXX The functions here don't copy the resource fork or other metadata on Mac.
"""
import os
import sys
import stat
from os... | mit |
NelleV/pyconfr-test | symposion_project/settings.py | 1 | 6854 | # -*- coding: utf-8 -*-
# Django settings for account project
import os.path
import posixpath
PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
# tells Pinax to serve media through the stat... | bsd-3-clause |
muffinresearch/olympia | apps/zadmin/tests/test_tasks.py | 10 | 6460 | # -*- coding: utf-8 -*-
from django.conf import settings
import mock
import urlparse
import amo
import amo.tests
from addons.models import Addon
from applications.models import AppVersion
from files.utils import make_xpi
from versions.compare import version_int
from zadmin import tasks
def RequestMock(response='', ... | bsd-3-clause |
javipalanca/Django-facebook | django_facebook/auth_urls.py | 24 | 2822 | """
URL patterns for the views included in ``django.contrib.auth``.
Including these URLs (via the ``include()`` directive) will set up the
following patterns based at whatever URL prefix they are included
under:
* User login at ``login/``.
* User logout at ``logout/``.
* The two-step password change at ``password/c... | bsd-3-clause |
atlashealth/ansible | lib/ansible/plugins/connections/jail.py | 131 | 7291 | # Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# and chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com>
# (c) 2013, Michael Scherer <misc@zarb.org>
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it... | gpl-3.0 |
vinayvenu/orthanc | Resources/Samples/Python/ChangesLoop.py | 9 | 2347 | #!/usr/bin/python
# Orthanc - A Lightweight, RESTful DICOM Store
# Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics
# Department, University Hospital of Liege, Belgium
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# publishe... | gpl-3.0 |
akalipetis/django-rest-framework | rest_framework/permissions.py | 71 | 6444 | """
Provides a set of pluggable permission policies.
"""
from __future__ import unicode_literals
from django.http import Http404
from rest_framework.compat import get_model_name
SAFE_METHODS = ('GET', 'HEAD', 'OPTIONS')
class BasePermission(object):
"""
A base class from which all permission classes should... | bsd-2-clause |
itmanagerro/tresting | contrib/devtools/symbol-check.py | 52 | 6191 | #!/usr/bin/python2
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
A script to check that the (Linux) executables produced by gitian only contain
allowed gcc, glibc and libstdc++ ve... | mit |
mathdd/numpy | numpy/core/tests/test_umath.py | 29 | 69197 | from __future__ import division, absolute_import, print_function
import sys
import platform
import warnings
from numpy.testing.utils import _gen_alignment_data
import numpy.core.umath as ncu
import numpy as np
from numpy.testing import (
TestCase, run_module_suite, assert_, assert_equal, assert_raises,
assert... | bsd-3-clause |
denisff/python-for-android | python3-alpha/extra_modules/gdata/Crypto/Cipher/__init__.py | 271 | 1145 | """Secret-key encryption algorithms.
Secret-key encryption algorithms transform plaintext in some way that
is dependent on a key, producing ciphertext. This transformation can
easily be reversed, if (and, hopefully, only if) one knows the key.
The encryption modules here all support the interface described in PEP
272... | apache-2.0 |
leeseuljeong/leeseulstack_neutron | neutron/tests/unit/test_l3_dvr.py | 34 | 3931 | # Copyright 2014 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.org/licenses/LICENSE-2.0
#
# Unless requir... | apache-2.0 |
wilvk/ansible | lib/ansible/modules/notification/flowdock.py | 27 | 5713 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2013 Matt Coddington <coddington@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_version':... | gpl-3.0 |
Ahmad31/Web_Flask_Cassandra | flask/lib/python2.7/site-packages/jinja2/exceptions.py | 222 | 4428 | # -*- coding: utf-8 -*-
"""
jinja2.exceptions
~~~~~~~~~~~~~~~~~
Jinja exceptions.
:copyright: (c) 2017 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from jinja2._compat import imap, text_type, PY2, implements_to_string
class TemplateError(Exception):
"""Baseclass for al... | apache-2.0 |
rrrrrr8/vnpy | vnpy/api/fcoin/vnfcoin.py | 1 | 8705 | # encoding: UTF-8
from __future__ import print_function
import hashlib
import hmac
import json
import ssl
import traceback
import base64
from queue import Queue, Empty
from multiprocessing.dummy import Pool
from time import time
from urlparse import urlparse
from copy import copy
from urllib import urlencode
from thr... | mit |
gilisagreen/Project4 | lib/flask/blueprints.py | 773 | 16320 | # -*- coding: utf-8 -*-
"""
flask.blueprints
~~~~~~~~~~~~~~~~
Blueprints are the recommended way to implement larger or more
pluggable applications in Flask 0.7 and later.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from functools import update_wrap... | apache-2.0 |
Metronote/metronotesd-alpha | lib/blockchain/sochain.py | 6 | 3142 | '''
chain.sp
'''
import logging
from lib import config, util
def get_host():
if config.BLOCKCHAIN_SERVICE_CONNECT:
return config.BLOCKCHAIN_SERVICE_CONNECT
else:
return 'https://chain.so'
def sochain_network():
network = config.BTC
if config.TESTNET:
network += 'TEST'
return network
def... | mit |
knossos-project/PythonQt | examples/NicePyConsole/pygments/lexers/inferno.py | 52 | 3110 | # -*- coding: utf-8 -*-
"""
pygments.lexers.inferno
~~~~~~~~~~~~~~~~~~~~~~~
Lexers for Inferno os and all the related stuff.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, by... | lgpl-2.1 |
tzewangdorje/SIPserv | Twisted-13.1.0/twisted/internet/test/reactormixins.py | 7 | 12552 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Utilities for unit testing reactor implementations.
The main feature of this module is L{ReactorBuilder}, a base class for use when
writing interface/blackbox tests for reactor implementations. Test case classes
for reactor features should s... | gpl-3.0 |
mbareta/edx-platform-ft | common/djangoapps/student/tests/test_user_profile_properties.py | 11 | 3560 | """Unit tests for custom UserProfile properties."""
import datetime
import ddt
from django.test import TestCase
from student.models import UserProfile
from student.tests.factories import UserFactory
from django.core.cache import cache
from openedx.core.djangolib.testing.utils import CacheIsolationTestCase
@ddt.ddt
... | agpl-3.0 |
kkintaro/termite-data-server | web2py/gluon/contrib/memdb.py | 9 | 28472 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This file is part of web2py Web Framework (Copyrighted, 2007-2009).
Developed by Massimo Di Pierro <mdipierro@cs.depaul.edu> and
Robin B <robi123@gmail.com>.
License: GPL v2
"""
__all__ = ['MEMDB', 'Field']
import re
import sys
import os
import types
import datetime
... | bsd-3-clause |
cfg2015/EPT-2015-2 | 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 |
patpatpatpatpat/digestus | digestus/users/migrations/0002_auto_20160411_0706.py | 1 | 1042 | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-04-11 07:06
from __future__ import unicode_literals
import django.contrib.auth.models
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
... | bsd-3-clause |
kkdd/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_str.py | 51 | 15114 |
import struct
import sys
from test import test_support, string_tests
class StrTest(
string_tests.CommonTest,
string_tests.MixinStrUnicodeUserStringTest,
string_tests.MixinStrUserStringTest,
string_tests.MixinStrUnicodeTest,
):
type2test = str
# We don't need to propagate to str
def ... | apache-2.0 |
cchamanEE/pydare | test/dlyaptest.py | 2 | 1617 | from pydare.dlyap import dlyap_iterative, dlyap_schur, dlyap_slycot
import numpy
import unittest
class DlyapTestCase(unittest.TestCase):
def setUp(self):
self.a = numpy.matrix([[0.5,1.0],[-1.0,-1.0]])
self.q = numpy.matrix([[2.0,0.0],[0.0,0.5]])
def testIterative(self):
x = dl... | gpl-3.0 |
mortada/numpy | tools/swig/test/testFlat.py | 108 | 6906 | #! /usr/bin/env python
from __future__ import division, absolute_import, print_function
# System imports
from distutils.util import get_platform
import os
import sys
import unittest
import struct
# Import NumPy
import numpy as np
major, minor = [ int(d) for d in np.__version__.split(".")[:2] ]
if major == 0: BadLi... | bsd-3-clause |
plaes/flask-sendmail | docs/_themes/flask_theme_support.py | 2228 | 4875 | # flasky extensions. flasky pygments style based on tango style
from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic, Whitespace, Punctuation, Other, Literal
class FlaskyStyle(Style):
background_color = "#f8f8f8"
default_style = "... | bsd-3-clause |
jhamman/xarray | xarray/core/dask_array_ops.py | 1 | 3415 | import numpy as np
from . import dtypes, nputils
def dask_rolling_wrapper(moving_func, a, window, min_count=None, axis=-1):
"""Wrapper to apply bottleneck moving window funcs on dask arrays
"""
import dask.array as da
dtype, fill_value = dtypes.maybe_promote(a.dtype)
a = a.astype(dtype)
# in... | apache-2.0 |
jds2001/ocp-checkbox | plainbox/plainbox/impl/checkbox.py | 1 | 11485 | # This file is part of Checkbox.
#
# Copyright 2012, 2013 Canonical Ltd.
# Written by:
# Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
#
# Checkbox 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 ... | gpl-3.0 |
slarosa/QGIS | python/plugins/sextante/algs/SaveSelectedFeatures.py | 3 | 4504 | # -*- coding: utf-8 -*-
"""
***************************************************************************
SaveSelectedFeatures.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
******************... | gpl-2.0 |
prds21/barrial-movie | barrial-movie/channels/quierodibujosanimados.py | 9 | 5799 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Canal para quierodibujosanimados
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os, sys
... | gpl-3.0 |
username115/FRCScouting | gen_scripts/SQLITEContractGen.py | 1 | 8061 | #! /usr/bin/python
_description = '''
This script take in a SQL file with INSERTS and CREATES and transforms
it into a SQLite contract in Java. Meant to be used with a phpmyadmin
exported sql file. Defaults assume the FRC 836 file structure.
'''
_defaultRun = '''
python SQLITEContractGen.py
--packagename=org.frc... | apache-2.0 |
grlee77/scipy | scipy/spatial/tests/test_slerp.py | 11 | 15434 | from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.testing import assert_allclose
import pytest
from scipy.spatial import geometric_slerp
def _generate_spherical_points(ndim=3, n_pts=2):
# generate uniform points on sphere
# see: https://stackoverflow.com/a/237853... | bsd-3-clause |
mariopro/youtube-dl | youtube_dl/extractor/npo.py | 18 | 17167 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
fix_xml_ampersands,
parse_duration,
qualities,
strip_jsonp,
unified_strdate,
)
class NPOBaseIE(InfoExtractor):
def _get_token(self, video_id):
token_page = self._download_webpage... | unlicense |
w1ll1am23/home-assistant | tests/components/sql/test_sensor.py | 3 | 2727 | """The test for the sql sensor platform."""
import pytest
import voluptuous as vol
from homeassistant.components.sql.sensor import validate_sql_select
from homeassistant.const import STATE_UNKNOWN
from homeassistant.setup import async_setup_component
async def test_query(hass):
"""Test the SQL sensor."""
con... | apache-2.0 |
cloakedcode/CouchPotatoServer | libs/suds/bindings/document.py | 204 | 5792 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | gpl-3.0 |
williamfeng323/py-web | flask/lib/python3.6/site-packages/sqlalchemy/dialects/mssql/pymssql.py | 32 | 3143 | # mssql/pymssql.py
# Copyright (C) 2005-2017 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
"""
.. dialect:: mssql+pymssql
:name: pymssql
:dbapi: pymssql
:connects... | mit |
jkonecny12/anaconda | tests/nosetests/pyanaconda_tests/core/signal_test.py | 5 | 5383 | #
# Martin Kolman <mkolman@redhat.com>
#
# Copyright 2016 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# General Public License v.2. This program is distributed in the hope that it
# will be use... | gpl-2.0 |
PXke/invenio | invenio/ext/logging/wrappers.py | 1 | 19138 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013 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 |
hwu25/AppPkg | Applications/Python/Python-2.7.2/Lib/test/test_isinstance.py | 14 | 10083 | # 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 test_support
import sys
class TestIsInstanceExceptions(un... | bsd-2-clause |
parkrrr/skybot | plugins/snopes.py | 22 | 1057 | import re
from util import hook, http
search_url = "http://search.atomz.com/search/?sp_a=00062d45-sp00000000"
@hook.command
def snopes(inp):
".snopes <topic> -- searches snopes for an urban legend about <topic>"
search_page = http.get_html(search_url, sp_q=inp, sp_c="1")
result_urls = search_page.xpat... | unlicense |
ldoktor/autotest | frontend/afe/model_logic.py | 4 | 43717 | """
Extensions to Django's model logic.
"""
import re
import django.core.exceptions
from django.db import models as dbmodels, backend, connection
from django.db.models.sql import query
import django.db.models.sql.where
from django.utils import datastructures
from autotest.frontend.afe import readonly_connection
class... | gpl-2.0 |
djangosporti/python-oauth2 | tests/test_oauth.py | 301 | 53269 | # -*- coding: utf-8 -*-
"""
The MIT License
Copyright (c) 2009 Vic Fryzel
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, co... | mit |
2014c2g3/0623exam | static/Brython3.1.0-20150301-090019/Lib/weakref_1.py | 769 | 11495 | """Weak reference support for Python.
This module is an implementation of PEP 205:
http://www.python.org/dev/peps/pep-0205/
"""
# Naming convention: Variables named "wr" are weak reference objects;
# they are called this instead of "ref" to avoid name collisions with
# the module-global ref() function imported from ... | gpl-3.0 |
zhukaixy/kbengine | kbe/src/lib/python/Lib/test/test_getopt.py | 173 | 6968 | # test_getopt.py
# David Goodger <dgoodger@bigfoot.com> 2000-08-19
from test.support import verbose, run_doctest, run_unittest, EnvironmentVarGuard
import unittest
import getopt
sentinel = object()
class GetoptTests(unittest.TestCase):
def setUp(self):
self.env = EnvironmentVarGuard()
if "POSIXL... | lgpl-3.0 |
SanchayanMaity/gem5 | tests/configs/realview-switcheroo-full.py | 18 | 2450 | # Copyright (c) 2012 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | bsd-3-clause |
goldenbull/grpc | src/python/grpcio/tests/unit/_crust_over_core_over_links_face_interface_test.py | 5 | 6763 | # Copyright 2015, 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 f... | bsd-3-clause |
mujiansu/pip | pip/_vendor/requests/packages/chardet/gb2312prober.py | 2994 | 1681 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mit |
matthdsm/bioconda-recipes | recipes/peptide-shaker/1.16.16/peptide-shaker.py | 45 | 3272 | #!/usr/bin/env python
#
# Wrapper script for Java Conda packages that ensures that the java runtime
# is invoked with the right options. Adapted from the bash script (http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246128).
#
# Program Parameters
#
import os
import s... | mit |
nguy/brawl4d | LMA/controller.py | 1 | 10240 | """ Support for LMA data display in brawl4d.
These are meant to be lightweight wrappers to coordinate data formats
understood by the lmatools package.
"""
import numpy as np
from lmatools.flashsort.autosort.LMAarrayFile import LMAdataFile
from stormdrain.bounds import Bounds, BoundsFilter
from stormdra... | bsd-2-clause |
DirtyUnicorns/android_external_chromium-org | tools/telemetry_tools/telemetry_bootstrap.py | 24 | 5468 | # 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.
"""Bootstrap Chrome Telemetry by downloading all its files from SVN servers.
Requires a DEPS file to specify which directories on which SVN servers
are ... | bsd-3-clause |
troya2/pjsip | pjsip-apps/src/swig/python/test.py | 44 | 3447 | import pjsua2 as pj
import sys
import time
#
# Basic data structure test, to make sure basic struct
# and array operations work
#
def ua_data_test():
#
# AuthCredInfo
#
print "UA data types test.."
the_realm = "pjsip.org"
ci = pj.AuthCredInfo()
ci.realm = the_realm
ci.dataType = 20
ci2 = ci
assert ci.dataT... | gpl-2.0 |
ashokpant/clandmark | python_interface/bin/flandmark_demo.py | 6 | 2152 | import numpy as np
import os
from fnmatch import fnmatch
from py_flandmark import PyFlandmark
from PIL import Image
import ImageDraw
import matplotlib.pyplot as plt
def rgb2gray(rgb):
"""
converts rgb array to grey scale variant
accordingly to fomula taken from wiki
(this function is missing in python)
"""
ret... | gpl-3.0 |
mzdanieltest/pex | pex/interpreter.py | 52 | 12996 | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
"""pex support for interacting with interpreters."""
from __future__ import absolute_import
import os
import re
import subprocess
import sys
from collections import defaultdict
from pkg... | apache-2.0 |
apache/bloodhound | trac/trac/tests/core.py | 2 | 13792 | # -*- coding: utf-8 -*-
#
# Copyright (C)2005-2009 Edgewall Software
# Copyright (C) 2005 Christopher Lenz <cmlenz@gmx.de>
# 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://trac.e... | apache-2.0 |
ChinaMassClouds/copenstack-server | openstack/src/horizon-2014.2/openstack_dashboard/dashboards/project/applyhost/workflows/update_instance.py | 11 | 5708 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# 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... | gpl-2.0 |
kans/birgo | deps/breakpad/src/tools/gyp/test/rules/gyptest-default.py | 137 | 1063 | #!/usr/bin/env 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.
"""
Verifies simple rules when using an explicit build target of 'all'.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('actions... | apache-2.0 |
gurneyalex/hr | __unported__/hr_resume/__init__.py | 28 | 1047 | # -*- encoding: utf-8 -*-
###############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or modify
# it un... | agpl-3.0 |
bsmithers/CLIgraphs | histogram.py | 1 | 8515 | #!/usr/bin/env python2
from __future__ import division
import itertools
import math
import sys
import numpy
import scipy.stats
import cligraph
import utils
"""
TODO:
- Auto-detect number of bins
- Fixed width or variable width bins
- Stacked bins, overlapped bins or bins next to each other
- Change which side of bi... | agpl-3.0 |
vivekkodu/robotframework-selenium2library | src/Selenium2Library/keywords/_selectelement.py | 9 | 14906 | from selenium.webdriver.support.ui import Select
from keywordgroup import KeywordGroup
class _SelectElementKeywords(KeywordGroup):
# Public
def get_list_items(self, locator):
"""Returns the values in the select list identified by `locator`.
Select list keywords work on both lists and combo b... | apache-2.0 |
WUJISHANXIA/wujishanxia | bootcamp/articles/tests/test_views.py | 1 | 6318 | from django.contrib.auth import get_user_model
from django.http import HttpResponseBadRequest
from django.core.urlresolvers import reverse
from django.test import Client, TestCase
from bootcamp.articles.models import Article
class TestViews(TestCase):
"""
Includes tests for all the functionality
associat... | mit |
Vizerai/grpc | tools/buildgen/plugins/generate_vsprojects.py | 19 | 3036 | # Copyright 2015 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 |
overtherain/scriptfile | software/googleAppEngine/lib/PyAMF/pyamf/tests/test_xml.py | 26 | 2009 | # -*- coding: utf-8 -*-
#
# Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
Tests for XML library integration
@since: 0.4
"""
import unittest
import pyamf.xml
from pyamf import util
class ElementTreeTestCase(unittest.TestCase):
"""
Tests the type mappings.
"""
xml = '<foo bar=... | mit |
albertrdixon/CouchPotatoServer | libs/bs4/builder/__init__.py | 447 | 11151 | from collections import defaultdict
import itertools
import sys
from bs4.element import (
CharsetMetaAttributeValue,
ContentMetaAttributeValue,
whitespace_re
)
__all__ = [
'HTMLTreeBuilder',
'SAXTreeBuilder',
'TreeBuilder',
'TreeBuilderRegistry',
]
# Some useful features for a Tree... | gpl-3.0 |
CReSIS/OPS | conf/tools/createUserExample.py | 1 | 1232 | # After editing the script (e.g. with gedit), run this script by following these steps:
# (1) Switch to root user: sudo -i
# (2) Activate VirtualEnv: source /usr/bin/venv/bin/activate
# (3) Open a Python shell with Django environment: python /var/django/ops/manage.py shell
# (4) Run this script: execfile('createU... | gpl-3.0 |
newemailjdm/pybrain | pybrain/rl/agents/agent.py | 31 | 1153 | __author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.utilities import abstractMethod, Named
class Agent(Named):
""" An agent is an entity capable of producing actions, based on previous observations.
Generally it will also learn from experience. It can interact directly with a Task.
"""
def integ... | bsd-3-clause |
barykaed/Pelican-Test | fsp_env/Lib/re.py | 206 | 15262 | #
# Secret Labs' Regular Expression Engine
#
# re-compatible interface for the sre matching engine
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# This version of the SRE library can be redistributed under CNRI's
# Python 1.6 license. For any other use, please contact Secret Labs
# AB (info@py... | mit |
riklaunim/django-custom-multisite | 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... | bsd-3-clause |
motion2015/a3 | common/djangoapps/embargo/migrations/0005_add_courseaccessrulehistory.py | 102 | 7906 | # -*- coding: 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):
# Adding model 'CourseAccessRuleHistory'
db.create_table('embargo_courseaccessrulehistory', (
('... | agpl-3.0 |
sanyaade-teachings/oppia | core/domain/exp_domain.py | 6 | 68060 | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | apache-2.0 |
rrampage/rethinkdb | test/rql_test/connections/http_support/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... | agpl-3.0 |
boxlab/UltraEnc-X | 0.3.1/model/main_functions.py | 1 | 1133 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
impelement the main functions required by enc.py.
'''
from random import randint
from model.requirements import lmap, repeat
def generate_otp(sheets, strength, length):
for sheet in range(sheets):
filename = "uexor_%s.uep" % (str(sheet),)
... | gpl-3.0 |
fluxw42/youtube-dl | youtube_dl/extractor/shahid.py | 38 | 5255 | # coding: utf-8
from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..compat import compat_HTTPError
from ..utils import (
ExtractorError,
int_or_none,
parse_iso8601,
str_or_none,
urlencode_postdata,
clean_html,
)
class ShahidIE(InfoExtractor)... | unlicense |
tima/ansible | lib/ansible/modules/network/asa/asa_command.py | 20 | 5713 | #!/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 |
fkorotkov/pants | contrib/android/tests/python/pants_test/contrib/android/test_android_manifest_parser.py | 14 | 3340 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants_test.util... | apache-2.0 |
eurosata1/e2 | lib/python/Screens/LocationBox.py | 2 | 16935 | #
# Generic Screen to select a path/filename combination
#
# GUI (Screens)
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Screens.InputBox import InputBox
from Screens.HelpMenu import HelpableScreen
from Screens.ChoiceBox import ChoiceBox
# Generic
from Tools.BoundFunction import bou... | gpl-2.0 |
groovecoder/kuma | vendor/packages/nose/config.py | 48 | 25238 | import logging
import optparse
import os
import re
import sys
import ConfigParser
from optparse import OptionParser
from nose.util import absdir, tolist
from nose.plugins.manager import NoPlugins
from warnings import warn, filterwarnings
log = logging.getLogger(__name__)
# not allowed in config files
option_blacklist... | mpl-2.0 |
ngoix/OCRF | sklearn/neighbors/setup.py | 308 | 1219 | import os
def configuration(parent_package='', top_path=None):
import numpy
from numpy.distutils.misc_util import Configuration
config = Configuration('neighbors', parent_package, top_path)
libraries = []
if os.name == 'posix':
libraries.append('m')
config.add_extension('ball_tree',
... | bsd-3-clause |
dpausp/arguments | tests/concepts/document/test_documents.py | 1 | 1326 | import factory
from assert_helpers import assert_difference, assert_no_difference
from ekklesia_portal.datamodel import Document
from webtest_helpers import assert_deform, fill_form
def test_create_document(client, db_query, document_factory, proposition_type_factory, logged_in_department_admin):
department = lo... | agpl-3.0 |
leiferikb/bitpop | src/tools/python/google/gethash_timer.py | 182 | 4366 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Issue a series of GetHash requests to the SafeBrowsing servers and measure
the response times.
Usage:
$ ./gethash_timer.py -... | gpl-3.0 |
kn-bibs/dotplot | dotplot/matrices.py | 1 | 3681 | """This module works with similarity matrices of aminoacids"""
import os
available_matrices = {
'PAM120': 'matrices/PAM120.txt'
}
class SimilarityMatrix:
def __init__(self, name):
filename = available_matrices[name]
# get the raw matrix from file
matrix = self.read_raw_matrix(filen... | lgpl-3.0 |
lmazuel/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/local_network_gateway.py | 1 | 3220 | # 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 ... | mit |
kmod/icbd | stdlib/python2.5/lib-tk/Canvas.py | 19 | 7344 | # This module exports classes for the various canvas item types
# NOTE: This module was an experiment and is now obsolete.
# It's best to use the Tkinter.Canvas class directly.
from Tkinter import Canvas, _cnfmerge, _flatten
class CanvasItem:
def __init__(self, canvas, itemType, *args, **kw):
self.canva... | mit |
ahb0327/intellij-community | python/lib/Lib/signal.py | 93 | 6858 | """
This module provides mechanisms to use signal handlers in Python.
Functions:
signal(sig,action) -- set the action for a given signal (done)
pause(sig) -- wait until a signal arrives [Unix only]
alarm(seconds) -- cause SIGALRM after a specified time [Unix only]
getsignal(sig) -- get the sig... | apache-2.0 |
shumingch/molecule_simulation | init.py | 1 | 2823 | #init from camera
from bge import logic, render
from particle import Particle
from mathutils import Vector, Matrix
gdict = logic.globalDict
def draw():
camera = scene.objects["Camera"]
string = "BondCraft"
###draws bonds and changes text before frame load
atoms = gdict["atoms"].copy()
for atom ... | mit |
orchidinfosys/odoo | addons/survey_crm/survey.py | 47 | 1162 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp.osv import osv
class survey_mail_compose_message(osv.TransientModel):
_inherit = 'survey.mail.compose.message'
def default_get(self, cr, uid, fields, context=None):
res = super(survey_mail... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.