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
837468220/python-for-android
python-build/python-libs/gdata/build/lib/gdata/tlslite/X509CertChain.py
238
6861
"""Class representing an X.509 certificate chain.""" from utils import cryptomath class X509CertChain: """This class represents a chain of X.509 certificates. @type x509List: list @ivar x509List: A list of L{tlslite.X509.X509} instances, starting with the end-entity certificate and with ever...
apache-2.0
dav-stott/phd-thesis
spectra_thesis_ais.py
1
70177
# -*- coding: utf-8 -*- """ Created on Fri Jul 25 08:48:28 2014 @author: david """ #*************** IMPORT DEPENDANCIES******************************************* import numpy as np #import spec_gdal4 as spg from osgeo import gdal import os import csv #import h5py import datetime import numpy.ma as ma #from StringIO ...
mit
makinacorpus/odoo
openerp/addons/test_new_api/tests/test_domain.py
87
1672
# -*- coding: utf-8 -*- from openerp.tests import common class test_domain(common.TransactionCase): def setUp(self): super(test_domain, self).setUp() self.bool = self.env['domain.bool'] def test_00_test_bool_undefined(self): """ Check that undefined/empty values in database i...
agpl-3.0
pheanex/ansible
contrib/inventory/openstack.py
103
5759
#!/usr/bin/env python # Copyright (c) 2012, Marco Vito Moscaritolo <marco@agavee.com> # Copyright (c) 2013, Jesse Keating <jesse.keating@rackspace.com> # Copyright (c) 2014, Hewlett-Packard Development Company, L.P. # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU...
gpl-3.0
oscaro/django
tests/generic_relations_regress/models.py
44
5515
from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation ) from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.db.models.deletion import ProtectedError __all__ = ('Link', 'Place...
bsd-3-clause
alex/django-old
tests/regressiontests/forms/localflavor/au.py
8
3529
# -*- coding: utf-8 -*- # Tests for the contrib/localflavor/ AU form fields. tests = r""" ## AUPostCodeField ########################################################## A field that accepts a four digit Australian post code. >>> from django.contrib.localflavor.au.forms import AUPostCodeField >>> f = AUPostCodeField()...
bsd-3-clause
pattern3/pattern
pattern/text/de/inflect.py
3
32013
#### PATTERN | DE | INFLECT ############################################## # -*- coding: utf-8 -*- # Copyright (c) 2012 University of Antwerp, Belgium # Author: Tom De Smedt <tom@organisms.be> # License: BSD (see LICENSE.txt for details). ########################################################################## # Reg...
bsd-3-clause
ivan-fedorov/intellij-community
python/helpers/pycharm_generator_utils/pyparsing.py
70
149851
# module pyparsing.py # # Copyright (c) 2003-2009 Paul T. McGuire # # 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, cop...
apache-2.0
nhomar/cookiecutter
tests/test_cli.py
12
1632
import os import pytest from click.testing import CliRunner from cookiecutter.cli import main from cookiecutter import utils runner = CliRunner() @pytest.fixture def remove_fake_project_dir(request): """ Remove the fake project directory created during the tests. """ def fin_remove_fake_project_dir...
bsd-3-clause
ohyeah521/Shadowsocks-combine-manyuser
shadowsocks/server_pool.py
2
5190
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2014 clowwindy # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # ...
apache-2.0
fivezh/Keepgoing
py_spider/py_spider.py
1
1520
#!/bin/python # -*- coding: utf-8 -*- import urllib import urllib2 import HTMLParser import re import urlparse import threading import ConfigParser import argparse import time import logging import sys import logger import config_load import seedfile_load import crawl_thread if __name__ == "__main__": logger.ini...
mit
rosenvladimirov/odoo
stock/tests/test_owner_available.py
233
3002
# Author: Leonardo Pistone # Copyright 2015 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any la...
agpl-3.0
LITMUS-RT/rt-kernelshark
tracecmd.py
4
7308
# # Copyright (C) International Business Machines Corp., 2009 # # 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 2 of the License, or # (at your option) any later version. # # Thi...
gpl-2.0
alheinecke/tensorflow-xsmm
tensorflow/compiler/tests/lstm_test.py
130
12982
# Copyright 2017 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
adelton/django
django/utils/html_parser.py
348
5155
import re import sys from django.utils import six from django.utils.six.moves import html_parser as _html_parser current_version = sys.version_info use_workaround = current_version < (2, 7, 3) try: HTMLParseError = _html_parser.HTMLParseError except AttributeError: # create a dummy class for Python 3.5+ whe...
bsd-3-clause
TheAlgorithms/Python
project_euler/problem_006/sol4.py
1
1038
""" Project Euler Problem 6: https://projecteuler.net/problem=6 Sum square difference The sum of the squares of the first ten natural numbers is, 1^2 + 2^2 + ... + 10^2 = 385 The square of the sum of the first ten natural numbers is, (1 + 2 + ... + 10)^2 = 55^2 = 3025 Hence the difference between the sum of...
mit
awbirdsall/popmodel
src/popmodel/absprofile.py
1
3828
'''popmodel module for AbsProfile class ''' from __future__ import division from . import ohcalcs as oh import logging import numpy as np from scipy.constants import k as kb from scipy.constants import c class AbsProfile(object): '''absorbance line profile, initially defined in __init__ by a center wavenumber...
mit
abzaloid/maps
django-project/lib/python2.7/site-packages/django/contrib/gis/gdal/base.py
654
1179
from ctypes import c_void_p from django.contrib.gis.gdal.error import GDALException from django.utils import six class GDALBase(object): """ Base object for GDAL objects that has a pointer access property that controls access to the underlying C pointer. """ # Initially the pointer is NULL. _...
mit
jcrocholl/nxdom
tests/views.py
1
2372
from datetime import datetime, timedelta from ragendja.template import render_to_response from ragendja.dbutils import get_object_or_404 from tests.models import Comparison def statistics(path): results = {'path': path} missing = [] seconds1 = [] seconds2 = [] total = errors = failures = 0 q...
mit
hehongliang/tensorflow
tensorflow/contrib/ignite/python/tests/igfs_test.py
15
6892
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy of # the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
apache-2.0
omanor/MUSiCC
tests/test_musicc.py
1
5038
#!/usr/bin/env python """ This is the testing unit for MUSiCC """ # to comply with both Py2 and Py3 from __future__ import absolute_import, division, print_function import unittest import os import pandas as pd import musicc from musicc.core import correct_and_normalize class MUSiCCTestCase(unittest.TestCase): ...
bsd-3-clause
vitan/hue
desktop/core/ext-py/ctypes-1.0.2/ctypes/test/test_callbacks.py
14
4580
import unittest from ctypes import * import _ctypes_test class Callbacks(unittest.TestCase): functype = CFUNCTYPE ## def tearDown(self): ## import gc ## gc.collect() def callback(self, *args): self.got_args = args return args[-1] def check_type(self, typ, arg): P...
apache-2.0
aktech/codeplay
playcode/views.py
1
1029
from django.shortcuts import render from django.http import HttpResponse, HttpResponseRedirect from django.http import JsonResponse import requests # Constants RUN_URL = u'https://api.hackerearth.com/v3/code/run/' CLIENT_SECRET = 'cd70993ac2dbee9e7c7b2c533a104a7d621632fa' def home(request): if request.method ==...
mit
krdlab/ansible-modules-core
cloud/openstack/os_client_config.py
75
2295
#!/usr/bin/python # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any late...
gpl-3.0
sebastienc/kubernetes-py
kubernetes_py/models/v1beta1/LabelSelectorRequirement.py
3
2436
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is subject to the terms and conditions defined in # file 'LICENSE.md', which is part of this source code package. # from kubernetes_py.utils import is_valid_string, is_valid_list class LabelSelectorRequirement(object): """ http://kubernetes.io/docs...
apache-2.0
tmhm/scikit-learn
examples/plot_kernel_approximation.py
262
8004
""" ================================================== Explicit feature map approximation for RBF kernels ================================================== An example illustrating the approximation of the feature map of an RBF kernel. .. currentmodule:: sklearn.kernel_approximation It shows how to use :class:`RBFSa...
bsd-3-clause
inveniosoftware/invenio-pages
tests/test_rest.py
1
1969
from invenio_pages import InvenioPagesREST from invenio_pages.rest import blueprint # mock the rest API url prefix blueprint.url_prefix = '/api/{}'.format(blueprint.url_prefix) def test_page_content(pages_fixture): """Test page content.""" app = pages_fixture app.register_blueprint(blueprint) with a...
gpl-2.0
ATenderholt/cclib
doc/sphinx/coverage.py
1
4455
# -*- coding: utf-8 -*- # # Copyright (c) 2019, the cclib development team # # This file is part of cclib (http://cclib.github.io) and is distributed under # the terms of the BSD 3-Clause License. """Generate the coverage.rst and coverage.rst files from test results.""" from __future__ import print_function import o...
bsd-3-clause
BerserkerTroll/root
interpreter/llvm/src/utils/abtest/abtest.py
30
8132
#!/usr/bin/env python # # Given a previous good compile narrow down miscompiles. # Expects two directories named "before" and "after" each containing a set of # assembly or object files where the "after" version is assumed to be broken. # You also have to provide a script called "link_test". It is called with a list # ...
lgpl-2.1
yookoala/ibus-cangjie
tests/test_cangjie.py
1
12361
# Copyright (c) 2013 - The IBus Cangjie authors # # This file is part of ibus-cangjie, the IBus Cangjie input method engine. # # ibus-cangjie is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
gpl-3.0
samuelfd/harpia
harpia/s2idirectory.py
2
4840
# -*- coding: utf-8 -*- # [HARPIA PROJECT] # # # S2i - Intelligent Industrial Systems # DAS - Automation and Systems Department # UFSC - Federal University of Santa Catarina # Copyright: 2006 - 2007 Luis Carlos Dill Junges (lcdjunges@yahoo.com.br), Clovis Peruchi Scotti (scotti@ieee.org), # Guilh...
gpl-2.0
StefanRijnhart/OpenUpgrade
addons/payment_buckaroo/tests/test_buckaroo.py
321
8132
# -*- coding: utf-8 -*- from lxml import objectify import urlparse import openerp from openerp.addons.payment.models.payment_acquirer import ValidationError from openerp.addons.payment.tests.common import PaymentAcquirerCommon from openerp.addons.payment_buckaroo.controllers.main import BuckarooController from opener...
agpl-3.0
shahar-stratoscale/nova
nova/hacking/checks.py
10
7170
# Copyright (c) 2012, Cloudscaling # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
apache-2.0
abhattad4/Digi-Menu
tests/template_tests/syntax_tests/test_filter_syntax.py
221
8844
# coding: utf-8 from __future__ import unicode_literals from django.template import TemplateSyntaxError from django.test import SimpleTestCase from ..utils import SomeClass, SomeOtherException, UTF8Class, setup class FilterSyntaxTests(SimpleTestCase): @setup({'filter-syntax01': '{{ var|upper }}'}) def test...
bsd-3-clause
ruschelp/cortex-vfx
test/IECoreGL/UserAttributesTest.py
12
5167
########################################################################## # # Copyright (c) 2008-2011, 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: # # * Redis...
bsd-3-clause
Wireless-Innovation-Forum/Spectrum-Access-System
src/harness/reference_models/geo/census_tract.py
1
1899
# Copyright 2018 SAS Project 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 requ...
apache-2.0
xiuwang/origin
vendor/github.com/heketi/heketi/tests/functional/TestEnabledTLS/test_tls.py
9
4356
#!/usr/bin/env python # # Copyright (c) 2018 The heketi Authors # # This file is licensed to you under your choice of the GNU Lesser # General Public License, version 3 or any later version (LGPLv3 or # later), or the GNU General Public License, version 2 (GPLv2), in all # cases as published by the Free Software Founda...
apache-2.0
jorsea/odoo-addons
adhoc_base_project/res_config.py
3
3843
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp import models, fields class adhoc_b...
agpl-3.0
Wasper256/locallibrary
catalog/views.py
1
6065
"""Main file that describes all of views.""" # -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime from django.contrib.auth.decorators import permission_required from django.contrib.auth.mixins import (LoginRequiredMixin, PermissionRequiredMixin) from ...
gpl-3.0
maxsocl/django
tests/defer_regress/models.py
104
2530
""" Regression tests for defer() / only() behavior. """ from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Item(models.Model): name = models.CharField(max_length=15) text = models.TextField(default="xyzzy") value = models.IntegerF...
bsd-3-clause
hofschroeer/gnuradio
gr-digital/python/digital/qa_framer_sink.py
6
3058
#!/usr/bin/env python # # Copyright 2012,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your opt...
gpl-3.0
dannyperry571/theapprentice
script.module.unidecode/lib/unidecode/x0bb.py
253
4730
data = ( 'moen', # 0x00 'moenj', # 0x01 'moenh', # 0x02 'moed', # 0x03 'moel', # 0x04 'moelg', # 0x05 'moelm', # 0x06 'moelb', # 0x07 'moels', # 0x08 'moelt', # 0x09 'moelp', # 0x0a 'moelh', # 0x0b 'moem', # 0x0c 'moeb', # 0x0d 'moebs', # 0x0e 'moes', # 0x0f 'moess', #...
gpl-2.0
mixman/djangodev
tests/regressiontests/custom_columns_regress/models.py
34
1030
""" Regression for #9736. Checks some pathological column naming to make sure it doesn't break table creation or queries. """ from django.db import models class Article(models.Model): Article_ID = models.AutoField(primary_key=True, db_column='Article ID') headline = models.CharField(max_length=100) aut...
bsd-3-clause
Omegaphora/external_chromium_org
ppapi/generators/idl_c_proto.py
35
25721
#!/usr/bin/env python # 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. """ Generator for C style prototypes and definitions """ import glob import os import sys from idl_log import ErrOut, InfoOut, Wa...
bsd-3-clause
hafeez3000/zulip
zerver/lib/bugdown/fenced_code.py
114
8170
#!/usr/bin/env python """ 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 ... ~~~...
apache-2.0
bolabola/PTVS
Python/Tests/TestData/VirtualEnv/env/Lib/encodings/iso8859_15.py
93
13775
""" Python Character Mapping Codec iso8859_15 generated from 'MAPPINGS/ISO8859/8859-15.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self...
apache-2.0
saulgray/nemio-flask-old
lib/python2.7/site-packages/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...
mit
lmazuel/azure-sdk-for-python
azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_network_configuration.py
1
2800
# 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
trilan/stencil
stencil/variables.py
1
1115
import os from optparse import make_option class Variable(object): def __init__(self, name, default=None, environ=None, help=None, metavar=None, prompt=None): self.name = name if environ: self.default = os.environ.get(environ, default) else: self.d...
bsd-2-clause
copyninja/apt-offline
apt_offline_gui/QtProgressBar.py
2
3113
class QtProgressBar( object ): def __init__( self, progressbar=None,label =None, minValue=0, maxValue=0, total_items=None): self.min = minValue self.max = maxValue self.span = float( self.max - self.min ) self.fd = fd self....
gpl-3.0
jordanmsn12/volatility
volatility/win32/crashdump.py
58
28101
# Volatility # Copyright (c) 2007-2013 Volatility Foundation # Copyright (c) 2008 Brendan Dolan-Gavitt <bdolangavitt@wesleyan.edu> # # This file is part of Volatility. # # Volatility 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...
gpl-2.0
Varentsov/servo
tests/wpt/web-platform-tests/tools/third_party/pytest/doc/en/example/assertion/failure_demo.py
15
5282
from pytest import raises import _pytest._code import py def otherfunc(a,b): assert a==b def somefunc(x,y): otherfunc(x,y) def otherfunc_multi(a,b): assert (a == b) def test_generative(param1, param2): assert param1 * 2 < param2 def pytest_generate_tests(metafunc): if 'param1' in me...
mpl-2.0
gchiam/gchiam_cc
gchiam_cc/config/settings.py
1
13827
# -*- coding: utf-8 -*- """ Django settings for gchiam_cc project. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/dev/ref/settings/ """ # Build paths inside the project like this: os.p...
bsd-3-clause
washort/zamboni
lib/es/management/commands/fixup_mkt_index.py
21
1143
""" A Marketplace only command that finds apps missing from the search index and adds them. """ import sys import elasticsearch from django.core.management.base import BaseCommand from mkt.webapps.indexers import WebappIndexer from mkt.webapps.models import Webapp class Command(BaseCommand): help = 'Fix up Mar...
bsd-3-clause
hogarthj/ansible
lib/ansible/modules/monitoring/monit.py
102
7631
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Darryl Stoflet <stoflet@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': '1.1', ...
gpl-3.0
jvanz/core
wizards/com/sun/star/wizards/ui/event/EventListenerList.py
11
1070
# # This file is part of the LibreOffice project. # # 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/. # # This file incorporates work covered by the following license noti...
gpl-3.0
ubuntu-core/snapcraft
tests/unit/sources/test_base.py
1
4911
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2015-2018 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in ...
gpl-3.0
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.0/Lib/os2emxpath.py
2
4485
# Module 'os2emxpath' -- common operations on OS/2 pathnames """Common pathname manipulations, OS/2 EMX version. Instead of importing this module directly, import os and refer to this module as os.path. """ import os import stat from genericpath import * from ntpath import (expanduser, expandvars, isabs, islink, spli...
mit
letuananh/visualkopasu
visko/tools.py
1
13876
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Database setup script for VisualKopasu """ # This code is a part of visualkopasu (visko): https://github.com/letuananh/visualkopasu # :copyright: (c) 2012 Le Tuan Anh <tuananh.ke@gmail.com> # :license: GPLv3, see LICENSE for more details. import sys import os import ...
gpl-3.0
odootr/odoo
addons/crm_partner_assign/tests/test_partner_assign.py
17
2489
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from mock import patch from openerp.tests.common import TransactionCase class TestPartnerAssign(TransactionCase): def setUp(self): super(TestPartnerAssign, self).setUp() def geo_find(addr): ...
agpl-3.0
omnirom/android_external_chromium-org
tools/perf/page_sets/tough_video_cases.py
26
14407
# 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. from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module class ToughVideoCasesPage(page_module.Page): def __...
bsd-3-clause
telefonicaid/fiware-IoTAgent-Cplusplus
third_party/mosquitto-1.4.4/test/broker/09-plugin-auth-unpwd-success.py
7
1040
#!/usr/bin/env python # Test whether a connection is successful with correct username and password # when using a simple auth_plugin. import subprocess import socket import time import inspect, os, sys # From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder cmd_subfolder = os.path.realp...
agpl-3.0
segalaj/hammr
tests/unit/utils/test_credentials.py
3
5775
from unittest import TestCase import re from hammr.utils import credentials from hammr.utils.credentials import CredentialsException from mock import patch class TestCredentials(TestCase): @patch("hammr.utils.credentials.Credentials.is_basic_auth_valid") def test_validate_not_throw_when_credential_basic(self...
apache-2.0
pekingduck/googletest
scripts/gen_gtest_pred_impl.py
2538
21986
#!/usr/bin/env python # # Copyright 2006, 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
ahaberlie/MetPy
examples/plots/Hodograph_Inset.py
8
2367
# Copyright (c) 2016 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause """ Hodograph Inset =============== Layout a Skew-T plot with a hodograph inset into the plot. """ import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1.inset_locator import...
bsd-3-clause
shahankhatch/scikit-learn
examples/cluster/plot_agglomerative_clustering.py
343
2931
""" Agglomerative clustering with and without structure =================================================== This example shows the effect of imposing a connectivity graph to capture local structure in the data. The graph is simply the graph of 20 nearest neighbors. Two consequences of imposing a connectivity can be s...
bsd-3-clause
admk/soap
tests/test_discoverer.py
1
2076
import unittest from soap.context import context from soap.datatype import float_type from soap.expression import Variable from soap.parser import parse from soap.semantics.state.box import BoxState from soap.semantics.state.meta import flow_to_meta_state from soap.semantics.functions.arithmetic import arith_eval from...
mit
Pluto-tv/chromium-crosswalk
chrome/test/ispy/server/rebaseline_handler.py
100
1208
# 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. """Request Handler that updates the Expectation version.""" import webapp2 import ispy_api from common import constants import gs_bucket class Rebaselin...
bsd-3-clause
genius1611/Keystone
keystone/backends/models.py
4
1702
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2010-2011 OpenStack, 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 # # Unl...
apache-2.0
pjryan126/solid-start-careers
store/api/zillow/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/langbulgarianmodel.py
2965
12784
######################## 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...
gpl-2.0
shrimpboyho/git.js
emscript/python/2.7.5.1_32bit/Lib/encodings/zlib_codec.py
533
3015
""" Python 'zlib_codec' Codec - zlib compression encoding Unlike most of the other codecs which target Unicode, this codec will return Python string objects for both encode and decode. Written by Marc-Andre Lemburg (mal@lemburg.com). """ import codecs import zlib # this codec needs the optional zlib modu...
gpl-2.0
lehmannro/translate
convert/test_mozfunny2prop.py
7
2201
#!/usr/bin/env python # -*- coding: utf-8 -*- from translate.convert import mozfunny2prop from translate.misc import wStringIO from translate.storage import po class TestInc2PO: def inc2po(self, incsource, inctemplate=None): """helper that converts .inc source to po source without requiring files""" ...
gpl-2.0
nfco/netforce
netforce_mfg/netforce_mfg/models/production_operation.py
4
2366
# Copyright (c) 2012-2015 Netforce Co. Ltd. # # 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, merge, publ...
mit
svanschalkwyk/datafari
cassandra/pylib/cqlshlib/test/ansi_colors.py
192
6073
# 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
valkjsaaa/sl4a
python/src/Lib/_MozillaCookieJar.py
152
5821
"""Mozilla / Netscape cookie loading / saving.""" import re, time from cookielib import (_warn_unhandled_exception, FileCookieJar, LoadError, Cookie, MISSING_FILENAME_TEXT) class MozillaCookieJar(FileCookieJar): """ WARNING: you may want to backup your browser's cookies file if you us...
apache-2.0
dpkp/kafka-python
kafka/metrics/quota.py
11
1128
from __future__ import absolute_import class Quota(object): """An upper or lower bound for metrics""" def __init__(self, bound, is_upper): self._bound = bound self._upper = is_upper @staticmethod def upper_bound(upper_bound): return Quota(upper_bound, True) @staticmethod ...
apache-2.0
megies/numpy
numpy/distutils/command/config.py
6
17135
# Added Fortran compiler support to config. Currently useful only for # try_compile call. try_run works but is untested for most of Fortran # compilers (they must define linker_exe first). # Pearu Peterson from __future__ import division, absolute_import, print_function import os, signal import warnings import sys fr...
bsd-3-clause
zaccoz/odoo
addons/board/__init__.py
439
1144
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you ca...
agpl-3.0
edisonlz/fruit
web_project/base/site-packages/gdata/blogger/__init__.py
140
6426
#!/usr/bin/python # # Copyright (C) 2007, 2008 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
apache-2.0
mojeto/django
tests/backends/test_mysql.py
25
3531
import unittest from contextlib import contextmanager from django.core.exceptions import ImproperlyConfigured from django.db import connection from django.test import TestCase, override_settings @contextmanager def get_connection(): new_connection = connection.copy() yield new_connection new_connection.c...
bsd-3-clause
sathieu/samba
third_party/dnspython/dns/set.py
99
7842
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "...
gpl-3.0
nthall/pip
pip/_vendor/lockfile/pidlockfile.py
536
6090
# -*- coding: utf-8 -*- # pidlockfile.py # # Copyright © 2008–2009 Ben Finney <ben+python@benfinney.id.au> # # This is free software: you may copy, modify, and/or distribute this work # under the terms of the Python Software Foundation License, version 2 or # later as published by the Python Software Foundation. # No ...
mit
AlexandreProenca/django-rest-framework
rest_framework/throttling.py
87
8095
""" Provides various throttling policies. """ from __future__ import unicode_literals import time from django.core.cache import cache as default_cache from django.core.exceptions import ImproperlyConfigured from rest_framework.settings import api_settings class BaseThrottle(object): """ Rate throttling of ...
bsd-2-clause
Becksteinlab/PDB_Ion_Survey
src/pdbionsurvey/tests/test_collection.py
1
1131
import pdbionsurvey.collection as collection def test_get_pdb_ids(): ids = collection.get_pdb_ids('NA') assert(all([i in ids for i in ['2YIG', '4XJH', '2HDS', '3VQZ', '4XCZ', '4ADI', '4LSQ', '3P6Z', '5UQ6', '4IKB', '1B7R', '6CL5', '1QHU', '5II0', '5ORG', '1GFK', '4JT9', '5KAY', '2YC3', '5KVD', '5PSW', '5PTF', ...
gpl-3.0
Ambuj-UF/ConCat-1.0
src/Utils/Bio/SCOP/Hie.py
3
2740
# Copyright 2001 by Gavin E. Crooks. All rights reserved. # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """Handle the SCOP HIErarchy files, which describe the SCOP hierarchy in terms of SCOP uniq...
gpl-2.0
yasoob/PythonRSSReader
venv/lib/python2.7/site-packages/setuptools/site-patch.py
720
2389
def __boot(): import sys import os PYTHONPATH = os.environ.get('PYTHONPATH') if PYTHONPATH is None or (sys.platform=='win32' and not PYTHONPATH): PYTHONPATH = [] else: PYTHONPATH = PYTHONPATH.split(os.pathsep) pic = getattr(sys,'path_importer_cache',{}) stdpath = sys.path[le...
mit
echonesis/mAiLab_Class
mAiLab_0002/RandomNumber.py
1
1753
#!/usr/bin/python def simpleGenRandomNumber(n, llimit=0, ulimit=1): import random result = [random.uniform(llimit, ulimit) for i in xrange(n)] return result if __name__ == '__main__': # For basic questions # Basic #1 # In this part, the built-in Python functions would be used. num_random =...
mit
jdelight/django
django/template/__init__.py
198
2022
""" Django's support for templates. The django.template namespace contains two independent subsystems: 1. Multiple Template Engines: support for pluggable template backends, built-in backends and backend-independent APIs 2. Django Template Language: Django's own template engine, including its built-in loaders, ...
bsd-3-clause
tarballs-are-good/sympy
sympy/thirdparty/pyglet/pyglet/font/freetype.py
5
12476
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # 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
kaffeel/oppia
scripts/deploy.py
16
6737
# 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 required by applicable ...
apache-2.0
primiano/depot_tools
third_party/logilab/astroid/brain/builtin_inference.py
64
8170
"""Astroid hooks for various builtins.""" import sys from functools import partial from textwrap import dedent import six from astroid import (MANAGER, UseInferenceDefault, inference_tip, YES, InferenceError, UnresolvableName) from astroid import nodes from astroid.builder import AstroidBuilder ...
bsd-3-clause
Salat-Cx65/python-for-android
python3-alpha/extra_modules/atom/http_core.py
46
20115
#!/usr/bin/env python # # Copyright (C) 2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
apache-2.0
tareqalayan/ansible
lib/ansible/modules/network/f5/bigip_snmp_community.py
26
24929
#!/usr/bin/python # -*- 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 ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
scotthartbti/android_external_chromium_org
chrome/common/extensions/docs/server2/api_list_data_source.py
25
4239
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from operator import itemgetter import docs_server_utils as utils class APIListDataSource(object): """ This class creates a list of chrome.* APIs and...
bsd-3-clause
kinegratii/minesweeper
minesweeper/helpers.py
1
1874
# coding=utf8 """ This module contains some hard-coding data for level map. """ from __future__ import unicode_literals import random from collections import OrderedDict from core import Map class GameHelpers(object): @staticmethod def create_from_mine_index_list(height, width, mine_index_list): retu...
gpl-2.0
davidvon/pipa-pay-server
site-packages/passlib/_setup/stamp.py
21
2083
"update version string during build" #============================================================================= # imports #============================================================================= from __future__ import with_statement # core import os import re import time from distutils.dist import Distributio...
apache-2.0
tensorflow/benchmarks
scripts/tf_cnn_benchmarks/allreduce_test.py
1
19185
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
ybellavance/python-for-android
python3-alpha/python3-src/Lib/encodings/ptcp154.py
647
8950
""" Python Character Mapping Codec generated from 'PTCP154.txt' with gencodec.py. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. (c) Copyright 2000 Guido van Rossum. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,err...
apache-2.0
MartinSavc/scikit-learn
examples/decomposition/plot_pca_3d.py
354
2432
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Principal components analysis (PCA) ========================================================= These figures aid in illustrating how a point cloud can be very flat in one direction--which is where PCA comes in to ch...
bsd-3-clause
jblackburne/scikit-learn
doc/tutorial/text_analytics/solutions/exercise_02_sentiment.py
104
3139
"""Build a sentiment analysis / polarity model Sentiment analysis can be casted as a binary text classification problem, that is fitting a linear classifier on features extracted from the text of the user messages so as to guess wether the opinion of the author is positive or negative. In this examples we will use a ...
bsd-3-clause