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
kingmotley/SickRage
lib/github/GitBlob.py
74
3840
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
gpl-3.0
alebcay/namebench
nb_third_party/dns/rdtypes/keybase.py
248
5017
# Copyright (C) 2004-2007, 2009, 2010 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 ...
apache-2.0
bbc/kamaelia
Sketches/CL/Topology/src/RelationTopology/Util/GenericTopologyViewer.py
3
6010
# -*- coding: utf-8 -*- # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License, Version 2.0 (the "Lic...
apache-2.0
meabsence/python-for-android
python3-alpha/python3-src/Tools/i18n/makelocalealias.py
48
1992
#!/usr/bin/env python3 """ Convert the X11 locale.alias file into a mapping dictionary suitable for locale.py. Written by Marc-Andre Lemburg <mal@genix.com>, 2004-12-10. """ import locale # Location of the alias file LOCALE_ALIAS = '/usr/share/X11/locale/locale.alias' def parse(filename): f = open(...
apache-2.0
peterjoel/servo
etc/ci/performance/test_submit_to_perfherder.py
15
4678
#!/usr/bin/env python3 # 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 https://mozilla.org/MPL/2.0/. import submit_to_perfherder def test_format_testcase_name(): assert('about:blank' == subm...
mpl-2.0
4Quant/tensorflow
tensorflow/python/training/queue_runner.py
6
13256
# Copyright 2015 Google 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 applicable law or a...
apache-2.0
malept/youtube-dl
youtube_dl/extractor/franceculture.py
4
2069
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( determine_ext, unified_strdate, ) class FranceCultureIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?franceculture\.fr/emissions/(?:[^/]+/)*(?P<id>[^/?#&]+)' _TEST = { 'url': '...
unlicense
neuroidss/nupic
src/nupic/data/stream_reader.py
10
18330
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013-15, 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 pro...
agpl-3.0
thanatoskira/AndroGuard
androguard/core/bytecodes/libdvm/test_dvm.py
10
2531
#!/usr/bin/env python # This file is part of Androguard. # # Copyright (C) 2011, Anthony Desnos <desnos at t0t0.fr> # All rights reserved. # # Androguard is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation,...
lgpl-3.0
ovnicraft/odoo
addons/portal_sale/__openerp__.py
380
2183
# -*- 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
JGarcia-Panach/odoo
addons/l10n_pl/__init__.py
340
1155
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # l10n_pl module improved for Poland # by Grzegorz Grzelak grzegorz.g...
agpl-3.0
gemmellr/qpid-proton
tools/python/mllib/dom.py
5
7614
# # 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...
apache-2.0
Faiz7412/or-tools
data/nonogram_regular/nonogram_p200.py
74
1810
# Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.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 applica...
apache-2.0
Thraxis/SickRage
lib/sqlalchemy/ext/hybrid.py
80
27994
# ext/hybrid.py # Copyright (C) 2005-2014 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 """Define attributes on ORM-mapped classes that have "hybrid" behavior. "hybrid" means ...
gpl-3.0
pshen/ansible
lib/ansible/modules/source_control/github_key.py
70
7765
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
gpl-3.0
conductor-tutti/space_for_us
lib/jinja2/testsuite/security.py
415
6204
# -*- coding: utf-8 -*- """ jinja2.testsuite.security ~~~~~~~~~~~~~~~~~~~~~~~~~ Checks the sandbox and other security features. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest from jinja2.testsuite import JinjaTestCase from jinja2 import E...
apache-2.0
cstipkovic/spidermonkey-research
python/pyasn1-modules/pyasn1_modules/rfc2459.py
59
44745
# # X.509 message syntax # # ASN.1 source from: # http://www.trl.ibm.com/projects/xml/xss4j/data/asn1/grammars/x509.asn # http://www.ietf.org/rfc/rfc2459.txt # # Sample captures from: # http://wiki.wireshark.org/SampleCaptures/ # from pyasn1.type import tag,namedtype,namedval,univ,constraint,char,useful MAX = 64 # XX...
mpl-2.0
modeswitch/protobuf-rpc
python/protobufrpc/common.py
1
1888
# Copyright (c) 2008 Alan Kligman # # 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, publish, distri...
mit
jaymell/photo_mapper
photo_mapper/schema.py
1
1709
from flask_marshmallow import Marshmallow import photo_mapper as pm from photo_mapper import app marsh = Marshmallow(app) #### serialization schema #### class RoleSchema(marsh.Schema): role_id = marsh.Int() role_name = marsh.String() class UserSchema(marsh.Schema): uri = marsh.UrlFor('user', user_id='<user_id...
gpl-3.0
TathagataChakraborti/resource-conflicts
PLANROB-2015/seq-sat-lama/Python-2.5.2/Demo/parser/example.py
54
5722
"""Simple code to extract class & function docstrings from a module. This code is used as an example in the library reference manual in the section on using the parser module. Refer to the manual for a thorough discussion of the operation of this code. """ import os import parser import symbol import token import ty...
mit
spasovski/zamboni
apps/addons/tests/test_forms.py
6
10278
# -*- coding: utf-8 -*- import os import tempfile from mock import patch from nose.tools import eq_ from django.conf import settings from django.core.files.storage import default_storage as storage import amo import amo.tests from amo.tests.test_helpers import get_image_path from amo.utils import rm_local_tmp_dir fr...
bsd-3-clause
tlatzko/spmcluster
.tox/docs/lib/python2.7/site-packages/docutils/parsers/rst/languages/de.py
121
3465
# -*- coding: utf-8 -*- # $Id: de.py 7223 2011-11-21 16:43:06Z milde $ # Authors: Engelbert Gruber <grubert@users.sourceforge.net>; # Lea Wiemann <LeWiemann@gmail.com> # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # ...
bsd-2-clause
ondrokrc/gramps
gramps/plugins/lib/libmapservice.py
2
3419
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2009 Benny Malengier # # 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 op...
gpl-2.0
dmacvicar/spacewalk
client/rhel/yum-rhn-plugin/test/alltests.py
19
1323
# yum-rhn-plugin - RHN support for yum # # Copyright (c) 2006--2011 Red Hat, Inc. # # 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 optio...
gpl-2.0
opensourcechipspark/platform_external_chromium_org
tools/telemetry/telemetry/core/platform/profiler/trace_profiler.py
23
1077
# Copyright 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 codecs from telemetry.core.platform import profiler class TraceProfiler(profiler.Profiler): def __init__(self, browser_backend, platform_backend...
bsd-3-clause
schieb/angr
tests/test_jumptables.py
2
25130
# Test cases for jump table resolver import os import logging import nose.tools import angr test_location = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'binaries', 'tests') l = logging.getLogger("angr.tests.test_jumptables") class J: def __init__(self, baddr, taddr, ents): ...
bsd-2-clause
t11e/django
tests/regressiontests/views/urls.py
1
4443
# coding: utf-8 from os import path from django.conf.urls.defaults import * from models import * import views base_dir = path.dirname(path.abspath(__file__)) media_dir = path.join(base_dir, 'media') locale_dir = path.join(base_dir, 'locale') js_info_dict = { 'domain': 'djangojs', 'packages': ('regressionte...
bsd-3-clause
raildo/nova
nova/db/base.py
64
1342
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # 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 ...
apache-2.0
revolunet/pyfilesystem
fs/expose/fuse/fuse_ctypes.py
10
22408
# Copyright (c) 2008 Giorgos Verigakis <verigak@gmail.com> # # Permission to use, copy, modify, and distribute this software 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 "AS IS" AND THE...
bsd-3-clause
spthaolt/VTK
Examples/VisualizationAlgorithms/Python/ExtractUGrid.py
15
3366
#!/usr/bin/env python # This example shows how to extract portions of an unstructured grid # using vtkExtractUnstructuredGrid. vtkConnectivityFilter is also used # to extract connected components. # # The data found here represents a blow molding process. Blow molding # requires a mold and parison (hot, viscous plasti...
bsd-3-clause
jmartinm/invenio
modules/webauthorprofile/lib/webauthorprofile_dbapi.py
13
4409
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 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 2 of the ## License, or (at your option) a...
gpl-2.0
determinedcheetahs/cheetah_juniper
hadoop/contrib/hod/testing/testHodCleanup.py
182
4063
#Licensed to the Apache Software Foundation (ASF) under one #or more contributor license agreements. See the NOTICE file #distributed with this work for additional information #regarding copyright ownership. The ASF licenses this file #to you under the Apache License, Version 2.0 (the #"License"); you may not use thi...
apache-2.0
cntnboys/410Lab6
v1/lib/python2.7/site-packages/django/contrib/gis/db/backends/mysql/introspection.py
700
1771
from MySQLdb.constants import FIELD_TYPE from django.contrib.gis.gdal import OGRGeomType from django.db.backends.mysql.introspection import DatabaseIntrospection class MySQLIntrospection(DatabaseIntrospection): # Updating the data_types_reverse dictionary with the appropriate # type for Geometry fields. ...
apache-2.0
radlws/AWS-ElasticBeanstalk-CLI
eb/linux/python3/lib/rds/exception.py
4
1579
#!/usr/bin/env python # ============================================================================== # Copyright 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Amazon Software License (the "License"). You may not use # this file except in compliance with the License. A copy of th...
apache-2.0
mwveliz/sitio
vendor/doctrine/orm/docs/en/conf.py
2448
6497
# -*- coding: utf-8 -*- # # Doctrine 2 ORM documentation build configuration file, created by # sphinx-quickstart on Fri Dec 3 18:10:24 2010. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. ...
mit
caioserra/apiAdwords
examples/adspygoogle/dfp/v201211/get_suggested_ad_units_by_statement.py
4
2097
#!/usr/bin/python # # Copyright 2012 Google 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 b...
apache-2.0
fsherratt/custom_pixhawk
mk/VRBRAIN/Tools/genmsg/test/test_genmsg_msg_loader.py
51
29909
# Software License Agreement (BSD License) # # Copyright (c) 2009, Willow Garage, 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 ...
gpl-3.0
rnixx/kivy
examples/widgets/rstexample.py
2
2151
''' QuickReference for Rst ====================== This is a markup example: [b]Hello[/b] [i]world[/i] And if i really want to write my code: &amp;bl; Hello world &amp;br; And video widget ---------------- .. video:: cityCC0.mpg Inline Markup ------------- - *emphasis* - **strong emphasis** - `interpreted text` - ...
mit
zrhans/pythonanywhere
.virtualenvs/django19/lib/python3.4/site-packages/django/contrib/gis/db/backends/spatialite/introspection.py
391
3131
from django.contrib.gis.gdal import OGRGeomType from django.db.backends.sqlite3.introspection import ( DatabaseIntrospection, FlexibleFieldLookupDict, ) from django.utils import six class GeoFlexibleFieldLookupDict(FlexibleFieldLookupDict): """ Sublcass that includes updates the `base_data_types_reverse` ...
apache-2.0
livingbio/libsaas
setup.py
3
2704
#!/usr/bin/python """libsaas ========== A library to take the pain out of using SaaS APIs. It provides an abstraction layer on top of various APIs, taking care of constructing the URLs, serializing parameters and authentication. You just call Python methods and receive Python objects. It's like an ORM for SaaS! Li...
mit
holtgrewe/seqan
util/py_lib/seqan/pyclangcheck/simple_checks.py
26
4137
#!/usr/bin/env python """Simple source code checks, e.g. trailing whitespace.""" from __future__ import with_statement import bisect import re import sys import violations RULE_TRAILING_WHITESPACE = 'whitespace.trailing' RULE_TEXT_TRAILING_WHITESPACE = 'Trailing whitespace is not allowed.' RULE_TODO_ONE_SPACE = '...
bsd-3-clause
shawnadelic/shuup
shuup/core/migrations/0006_logmodels.py
7
26143
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import jsonfield.fields from django.conf import settings import enumfields.fields import shuup.utils.analog class Migration(migrations.Migration): dependencies = [ mi...
agpl-3.0
scripnichenko/glance
glance/tests/functional/test_logging.py
11
3004
# 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.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
wd5/jangr
south/migration/utils.py
37
2192
import sys from collections import deque from django.utils.datastructures import SortedDict from django.db import models from south import exceptions class SortedSet(SortedDict): def __init__(self, data=tuple()): self.extend(data) def __str__(self): return "SortedSet(%s)" % list(self) ...
bsd-3-clause
sarantapichos/faircoop-market
addons/website_mail/models/mail_message.py
264
4705
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
cgarrard/osgeopy-code
Chapter13/listing13_9.py
1
2444
# Script demonstrating how to use multiple rules in a mapnik style. ##################### The first part is from listing 13.8. import mapnik # Create the map object. srs = "+proj=longlat +ellps=GRS80 +datum=NAD83 +no_defs" m = mapnik.Map(800, 600, srs) m.zoom_to_box(mapnik.Box2d(-90.3, 29.7, -89.5, 30.3)) # Create...
mit
AlekSi/benchmarking-py
benchmarking/reporters/reporter.py
1
3458
from __future__ import division, print_function, absolute_import class Reporter(object): """ Interface for other reporters; also contains common methods for them. """ @classmethod def name(cls): return cls.__name__.replace('Reporter', '') @staticmethod def min_max_time_per_call(r...
mit
okfn/json-table-schema-py
tests/test_field.py
2
5611
# -*- coding: utf-8 -*- from __future__ import division from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals import io import json import pytest import requests from functools import partial from tableschema import Field, exceptions # Constants DESCRIP...
mit
aimas/TuniErp-8.0
addons/stock_dropshipping/__openerp__.py
1
2040
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2014 OpenERP S.A. (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
LEXmono/q
bs4/builder/__init__.py
12
11552
# Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from collections import defaultdict import itertools import sys from bs4.element import ( CharsetMetaAttributeValue, ContentMetaAttributeValue, HTMLAwareEntitySubstitution, whitespace_re ) __all__...
apache-2.0
Serag8/Bachelor
google_appengine/lib/django-1.4/django/contrib/gis/gdal/prototypes/srs.py
97
3372
from ctypes import c_char_p, c_int, c_void_p, POINTER from django.contrib.gis.gdal.libgdal import lgdal, std_call from django.contrib.gis.gdal.prototypes.generation import (const_string_output, double_output, int_output, srs_output, string_output, void_output) ## Shortcut generation for routines with known paramet...
mit
avanov/django
tests/fixtures/tests.py
11
34320
from __future__ import unicode_literals import os import tempfile import warnings from django.apps import apps from django.contrib.sites.models import Site from django.core import management from django.db import IntegrityError, connection from django.test import ( TestCase, TransactionTestCase, ignore_warnings, ...
bsd-3-clause
lidaobing/itcc
itcc/ccs2/kentsis2004.py
1
2200
# $Id$ from itcc.ccs2.pyramid import pyramid as _pyramid from itcc.ccs2.config import config from itcc.core import tools threshold = config.get('Mezei_p24_threshold', -0.1*0.1) def pyramid(a, b, c, rax, rbx, rcx): if a is None or b is None or c is None: return (None, None) res1, res2 = _pyramid(a, b,...
gpl-3.0
xiangel/hue
desktop/core/ext-py/tablib-0.10.0/tablib/packages/xlrd3/xfconst.py
54
1657
# Author: mozman <mozman@gmx.at> # Purpose: xfconst -- xf constants # Created: 05.12.2010 # Copyright (C) 2010, Manfred Moitzi # License: BSD-style licence # excelfileformat section 5.115.1 pg. 219 HOR_ALIGN_GENERAL = 0 HOR_ALIGN_LEFT = 1 HOR_ALIGN_CENTRED = 2 HOR_ALIGN_RIGHT = 3 HOR_ALIGN_FILLED = 4 HOR_...
apache-2.0
jstammers/EDMSuite
NavPython/IronPython/Lib/robotparser.py
169
7202
""" robotparser.py Copyright (C) 2000 Bastian Kleineidam You can choose between two licenses when using this package: 1) GNU GPLv2 2) PSF license for Python 2.2 The robots.txt Exclusion Protocol is implemented as specified in http://info.webcrawler.com/mak/projects/robots/norobots-rfc.html "...
mit
TimeWz667/Kamanian
complexism/equationbased/statespace/eqbehaviour.py
1
11385
from abc import ABCMeta, abstractmethod, abstractstaticmethod __author__ = 'TimeWz667' class Behaviour(metaclass=ABCMeta): def __init__(self, name, target=None): self.Name = name self.Target = target @abstractmethod def initialise(self, model, core, ti): pass def modify(sel...
mit
Duke-NSOE/GeoHAT
GeoHat_V10/Scripts/networkx/algorithms/tests/test_mst.py
44
4871
#!/usr/bin/env python from nose.tools import * import networkx as nx class TestMST: def setUp(self): # example from Wikipedia: http://en.wikipedia.org/wiki/Kruskal's_algorithm G=nx.Graph() edgelist = [(0,3,[('weight',5)]), (0,1,[('weight',7)]), (1,3,[('...
cc0-1.0
ncdesouza/bookworm
env/lib/python2.7/site-packages/pbr/packaging.py
11
31119
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack LLC. # Copyright 2012-2013 Hewlett-Packard Development Company, L.P. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain ...
gpl-3.0
pasqualguerrero/django
django/core/cache/backends/dummy.py
629
1213
"Dummy cache backend" from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache class DummyCache(BaseCache): def __init__(self, host, *args, **kwargs): BaseCache.__init__(self, *args, **kwargs) def add(self, key, value, timeout=DEFAULT_TIMEOUT, version=None): key = self.make_key...
bsd-3-clause
vdmann/cse-360-image-hosting-website
lib/python2.7/site-packages/django/contrib/flatpages/views.py
115
2843
from django.conf import settings from django.contrib.flatpages.models import FlatPage from django.contrib.sites.models import get_current_site from django.http import Http404, HttpResponse, HttpResponsePermanentRedirect from django.shortcuts import get_object_or_404 from django.template import loader, RequestContext fr...
mit
quickresolve/accel.ai
flask-aws/lib/python2.7/site-packages/pip/commands/hash.py
514
1597
from __future__ import absolute_import import hashlib import logging import sys from pip.basecommand import Command from pip.status_codes import ERROR from pip.utils import read_chunks from pip.utils.hashes import FAVORITE_HASH, STRONG_HASHES logger = logging.getLogger(__name__) class HashCommand(Command): ""...
mit
heli522/scikit-learn
sklearn/tests/test_qda.py
155
3481
import numpy as np from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_greater from sklearn.utils.testing import assert_raises from sklearn.utils.testing import ignore_war...
bsd-3-clause
ericpre/hyperspy
hyperspy/tests/samfire/test_histogram_segmenter.py
2
3106
# Copyright 2007-2021 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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 ve...
gpl-3.0
NedYork/viper
tests/parser/globals/test_getters.py
1
1444
import pytest from tests.setup_transaction_tests import chain as s, tester as t, ethereum_utils as u, check_gas, \ get_contract_with_gas_estimation, get_contract def test_state_accessor(): state_accessor = """ y: num[num] def oo(): self.y[3] = 5 def foo() -> num: return self.y[3] """ c = g...
mit
Eksmo/calibre
src/calibre/customize/ui.py
1
21149
from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>' import os, shutil, traceback, functools, sys from calibre.customize import (CatalogPlugin, FileTypePlugin, PluginNotFound, MetadataReaderPlugin, MetadataWriterPlug...
gpl-3.0
omtinez/micropython
tests/basics/syntaxerror.py
8
2556
# test syntax errors def test_syntax(code): try: exec(code) print("no SyntaxError") except IndentationError: print("IndentationError") except SyntaxError: print("SyntaxError") # non-newline after line-continuation character (lexer error) test_syntax("a \\a\n") # dedent mis...
mit
marcoantoniooliveira/labweb
oscar/lib/python2.7/site-packages/django_extensions/tests/testapp/models.py
1
1920
from django.db import models from django_extensions.db.models import ActivatorModel from django_extensions.db.fields import AutoSlugField from django_extensions.db.fields import UUIDField from django_extensions.db.fields import ShortUUIDField from django_extensions.db.fields.json import JSONField class Secret(models...
bsd-3-clause
cybernet14/scikit-learn
sklearn/utils/tests/test_extmath.py
70
16531
# Authors: Olivier Grisel <olivier.grisel@ensta.org> # Mathieu Blondel <mathieu@mblondel.org> # Denis Engemann <d.engemann@fz-juelich.de> # # License: BSD 3 clause import numpy as np from scipy import sparse from scipy import linalg from scipy import stats from sklearn.utils.testing import assert_eq...
bsd-3-clause
molobrakos/home-assistant
homeassistant/components/apple_tv/remote.py
7
2241
"""Remote control support for Apple TV.""" from homeassistant.components import remote from homeassistant.const import CONF_HOST, CONF_NAME from . import ATTR_ATV, ATTR_POWER, DATA_APPLE_TV async def async_setup_platform( hass, config, async_add_entities, discovery_info=None): """Set up the Apple TV remo...
apache-2.0
watonyweng/nova
nova/tests/unit/virt/xenapi/test_xenapi.py
11
177052
# Copyright (c) 2010 Citrix Systems, 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 applicab...
apache-2.0
georgemarshall/django
django/contrib/staticfiles/storage.py
13
17633
import hashlib import json import os import posixpath import re from urllib.parse import unquote, urldefrag, urlsplit, urlunsplit from django.conf import settings from django.contrib.staticfiles.utils import check_settings, matches_patterns from django.core.exceptions import ImproperlyConfigured from django.core.files...
bsd-3-clause
linjoahow/lego_Automatic-assembly
static/Brython3.1.3-20150514-095342/Lib/copyreg.py
749
6611
"""Helper to provide extensibility for pickle. This is only useful to add pickle support for extension types defined in C, not for instances of user-defined classes. """ __all__ = ["pickle", "constructor", "add_extension", "remove_extension", "clear_extension_cache"] dispatch_table = {} def pickle(ob_typ...
gpl-3.0
hill-a/stable-baselines
tests/test_lstm_policy.py
1
5243
import os from gym.envs.classic_control import CartPoleEnv from gym.wrappers.time_limit import TimeLimit from gym import spaces import numpy as np import pytest from stable_baselines import A2C, ACER, ACKTR, PPO2, bench from stable_baselines.common.policies import MlpLstmPolicy, LstmPolicy from stable_baselines.commo...
mit
emilio/servo
tests/wpt/web-platform-tests/webdriver/tests/new_window/user_prompts.py
38
4001
# META: timeout=long import pytest from tests.support.asserts import assert_dialog_handled, assert_error, assert_success def new_window(session, type_hint=None): return session.transport.send( "POST", "session/{session_id}/window/new".format(**vars(session)), {"type": type_hint}) @pytest.fixtu...
mpl-2.0
marymhayes/wats4000-final-project
node_modules/node-gyp/gyp/pylib/gyp/common.py
1292
20063
# 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. from __future__ import with_statement import collections import errno import filecmp import os.path import re import tempfile import sys # A minimal memoizing d...
apache-2.0
mysql/mysql-utilities
mysql/utilities/common/grants_info.py
1
20861
# # Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. # # 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; version 2 of the License. # # This program is distributed in th...
gpl-2.0
2013Commons/HUE-SHARK
build/env/lib/python2.7/site-packages/pip-0.6.3-py2.7.egg/pip/req.py
1
67602
import sys import os import shutil import re import zipfile import tarfile import pkg_resources import tempfile import mimetypes import urlparse import urllib2 import urllib import ConfigParser from email.FeedParser import FeedParser from pip.locations import bin_py, site_packages from pip.exceptions import Installatio...
apache-2.0
ZhukovGreen/UMLND
Lectures/accuracy_evaluation.py
1
1778
# # In this and the following exercises, you'll be adding train test splits to the data # to see how it changes the performance of each classifier # # The code provided will load the Titanic dataset like you did in project 0, then train # a decision tree (the method you used in your project) and a Bayesian classifier (...
gpl-3.0
pmisik/buildbot
master/buildbot/data/sourcestamps.py
6
2722
# 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
meteorcloudy/tensorflow
tensorflow/contrib/training/python/training/device_setter.py
77
4938
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
travitch/whole-program-llvm
wllvm/extraction.py
2
22769
from __future__ import print_function import os import sys import subprocess as sp import re import pprint import tempfile import shutil import argparse import codecs from .popenwrapper import Popen from .compilers import llvmCompilerPathEnv from .compilers import elfSectionName from .compilers import darwinSegmentN...
mit
wakatime/wakatime
wakatime/packages/py26/pygments/styles/lovelace.py
31
3173
# -*- coding: utf-8 -*- """ pygments.styles.lovelace ~~~~~~~~~~~~~~~~~~~~~~~~ Lovelace by Miikka Salminen Pygments style by Miikka Salminen (https://github.com/miikkas) A desaturated, somewhat subdued style created for the Lovelace interactive learning environment. :copyright: Copyright 2...
bsd-3-clause
Endika/django
tests/gis_tests/geoapp/test_functions.py
9
22189
from __future__ import unicode_literals import re from decimal import Decimal from django.contrib.gis.db.models import functions from django.contrib.gis.geos import LineString, Point, Polygon, fromstr from django.contrib.gis.measure import Area from django.db import connection from django.db.models import Sum from dj...
bsd-3-clause
SlimRoms/kernel_motorola_msm8992
Documentation/target/tcm_mod_builder.py
2358
40707
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
aashish24/VTK-old
Examples/Infovis/Python/tree1.py
9
1529
""" This file demonstrates the creation of a tree using the Python interface to VTK. """ from vtk import * #------------------------------------------------------------------------------ # Script Entry Point #------------------------------------------------------------------------------ if __name__ == "__main__": ...
bsd-3-clause
xingwu1/autorest
AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Lro/autorestlongrunningoperationtestservice/models/resource.py
16
1507
# 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
Johnetordoff/osf.io
scripts/remove_qa_test_items_from_elastic_and_share.py
6
1309
""" Script for removing nodes with 'qatest' tags from elastic search index """ import logging import sys import django django.setup() from website.app import init_app from django.db.models import Q from osf.models import AbstractNode from api.share.utils import update_share from website.search.elastic_search import u...
apache-2.0
BT-jmichaud/partner-contact
base_location/models/partner.py
29
1406
# -*- coding: utf-8 -*- # # # Author: Nicolas Bessi. Copyright Camptocamp SA # Contributor: Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com> # Ignacio Ibeas <ignacio@acysos.com> # Alejandro Santana <alejandrosantana@anubia.es> # # This program is free software: you can redist...
agpl-3.0
cnsoft/kbengine-cocos2dx
kbe/res/scripts/common/Lib/dummy_threading.py
210
2815
"""Faux ``threading`` version using ``dummy_thread`` instead of ``thread``. The module ``_dummy_threading`` is added to ``sys.modules`` in order to not have ``threading`` considered imported. Had ``threading`` been directly imported it would have made all subsequent imports succeed regardless of whether ``_thread`` w...
lgpl-3.0
GiladE/birde
venv/lib/python2.7/site-packages/django/contrib/gis/maps/google/__init__.py
61
2755
""" This module houses the GoogleMap object, used for generating the needed javascript to embed Google Maps in a Web page. Google(R) is a registered trademark of Google, Inc. of Mountain View, California. Example: * In the view: return render_to_response('template.html', {'google' : GoogleMap(key="...
mit
clairetang6/bokeh
bokeh/core/compat/mplexporter/renderers/fake_renderer.py
64
2561
from .base import Renderer class FakeRenderer(Renderer): """ Fake Renderer This is a fake renderer which simply outputs a text tree representing the elements found in the plot(s). This is used in the unit tests for the package. Below are the methods your renderer must implement. You are fre...
bsd-3-clause
IgneelDxD/Discord-SelfBot
cogs/msg.py
1
4082
import discord import logging import re from datetime import datetime from discord_webhooks import Webhook log = logging.getLogger('LOG') class OnMessage: def __init__(self, bot): self.bot = bot self.webhook_class = Webhook(self.bot) self.request_webhook = self.webhook_class.request_web...
mit
XiaosongWei/chromium-crosswalk
third_party/pexpect/pxssh.py
171
16276
"""This class extends pexpect.spawn to specialize setting up SSH connections. This adds methods for login, logout, and expecting the shell prompt. PEXPECT LICENSE This license is approved by the OSI and FSF as GPL-compatible. http://opensource.org/licenses/isc-license.txt Copyright (c) 2012, Noah Spu...
bsd-3-clause
ekse/DIE
DIE/Plugins/DataParsers/STDBasicStringParser/BasicStringParser.py
9
3028
from DIE.Lib.DataPluginBase import DataPluginBase import idc import idaapi class BasicStringParser(DataPluginBase): """ A parser for std::basic_string """ def __init__(self): super(BasicStringParser, self).__init__() self.setPluginType("basicstring") def registerSupportedTypes(sel...
mit
mattaw/SoCFoundationFlow
admin/waf/waf-1.8.19/waflib/extras/slow_qt4.py
9
2810
#! /usr/bin/env python # Thomas Nagy, 2011 (ita) """ Create _moc.cpp files The builds are 30-40% faster when .moc files are included, you should NOT use this tool. If you really really want it: def configure(conf): conf.load('compiler_cxx qt4') conf.load('slow_qt4') See playground/slow_qt/wscript for a complete e...
apache-2.0
normanmaurer/AutobahnTestSuite
autobahntestsuite/autobahntestsuite/case/case2_3.py
14
1347
############################################################################### ## ## Copyright 2011 Tavendo GmbH ## ## 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 ## ## ht...
apache-2.0
jhawkesworth/ansible
test/units/modules/utils.py
47
1079
import json from units.compat import unittest from units.compat.mock import patch from ansible.module_utils import basic from ansible.module_utils._text import to_bytes def set_module_args(args): if '_ansible_remote_tmp' not in args: args['_ansible_remote_tmp'] = '/tmp' if '_ansible_keep_remote_files...
gpl-3.0
mmbtba/odoo
openerp/addons/base/tests/test_mail.py
322
24683
#!/usr/bin/env python # -*- coding: utf-8 -*- # This test can be run stand-alone with something like: # > PYTHONPATH=. python2 openerp/tests/test_misc.py ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP...
agpl-3.0
t794104/ansible
lib/ansible/modules/network/aci/aci_contract_subject_to_filter.py
26
9088
#!/usr/bin/python # -*- coding: utf-8 -*- # 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
IGITUGraz/spore-nest-module
examples/pattern_matching_showcase/python/snn_utils/plotter/backends/tk.py
3
4031
from __future__ import absolute_import try: from tkinter import * from tkinter.ttk import * except ImportError: from TKinter import * from ttk import * from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg from matplotlib.figure import Figure import snn_utils.plotter as plotter class Form...
gpl-2.0