repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
metaml/nupic
src/nupic/regions/ImageSensorFilters/Mirror.py
17
2235
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
fkarb/pika-python3
examples/consume.py
13
1235
import pika def on_message(channel, method_frame, header_frame, body): channel.queue_declare(queue=body, auto_delete=True) if body.startswith("queue:"): queue = body.replace("queue:", "") key = body + "_key" print("Declaring queue %s bound with key %s" %(queue, key)) channel.qu...
mpl-2.0
shepdelacreme/ansible
lib/ansible/module_utils/facts/sysctl.py
135
1093
# 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 in the hope that ...
gpl-3.0
mano3m/CouchPotatoServer
libs/migrate/versioning/util/keyedinstance.py
73
1150
#!/usr/bin/env python # -*- coding: utf-8 -*- class KeyedInstance(object): """A class whose instances have a unique identifier of some sort No two instances with the same unique ID should exist - if we try to create a second instance, the first should be returned. """ _instances = dict() def...
gpl-3.0
olksdr/kafka
tests/kafkatest/tests/copycat_test.py
26
4879
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
apache-2.0
ycaihua/kbengine
kbe/src/lib/python/Lib/sre_parse.py
66
30040
# # Secret Labs' Regular Expression Engine # # convert re-style regular expression to sre pattern # # Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved. # # See the sre.py file for information on usage and redistribution. # """Internal support module for sre""" # XXX: show string offset and offending ch...
lgpl-3.0
ASPLes/libvortex-1.1
py-vortex/test/regtest_common.py
1
6569
# -*- coding: utf-8 -*- # PyVortex: Vortex Library Python bindings # Copyright (C) 2009 Advanced Software Production Line, S.L. # # This program 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; eith...
lgpl-2.1
jrha/aquilon
lib/python2.6/aquilon/worker/commands/update_sandbox.py
2
1799
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor # # 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...
apache-2.0
vlegoff/tsunami
src/secondaires/navigation/equipage/signaux/attendre.py
1
2931
# -*-coding:Utf-8 -* # Copyright (c) 2010-2017 LE GOFF Vincent # 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 # ...
bsd-3-clause
gramps-project/gramps
gramps/gui/editors/displaytabs/eventrefmodel.py
4
7217
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2006 Donald N. Allingham # Copyright (C) 2009 B. 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; eithe...
gpl-2.0
icereval/osf.io
osf_tests/test_oauth_application.py
5
3220
# -*- coding: utf-8 -*- import mock import pytest from django.db import DataError from django.utils import timezone from framework.auth import cas from osf.exceptions import ValidationError from osf_tests.factories import ApiOAuth2ApplicationFactory from tests.base import OsfTestCase pytestmark = pytest.mark.django_...
apache-2.0
sbrunner/QGIS
python/plugins/processing/algs/qgis/TextToFloat.py
4
3145
# -*- coding: utf-8 -*- """ *************************************************************************** TextToFloat.py --------------------- Date : May 2010 Copyright : (C) 2010 by Michael Minn Email : pyqgis at michaelminn dot com *************************...
gpl-2.0
tersmitten/ansible
test/units/modules/remote_management/oneview/test_oneview_network_set.py
68
6324
# Copyright (c) 2016-2017 Hewlett Packard Enterprise Development LP # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from units.compat import unittest, mock from hpe_test_utils import OneViewBaseTestCase from oneview_module_loader import NetworkSetModule FAKE_MSG_ERROR = 'F...
gpl-3.0
novopl/fabutils
fabfile.py
1
4282
# -*- coding: utf-8 -*- """ This is fabrics configuration file. """ from __future__ import absolute_import from os import environ, makedirs from os.path import exists from sys import exit from fabric.api import local, quiet from fabutils.api import ( bump_version_file, lint_files, get_staged_files, get...
mit
Moriadry/tensorflow
tensorflow/contrib/keras/api/keras/activations/__init__.py
11
1882
# 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
douwevandermeij/django-rest-framework
tests/test_relations_generic.py
68
3221
from __future__ import unicode_literals from django.contrib.contenttypes.generic import ( GenericForeignKey, GenericRelation ) from django.contrib.contenttypes.models import ContentType from django.db import models from django.test import TestCase from django.utils.encoding import python_2_unicode_compatible from...
bsd-2-clause
joferkington/mpldatacursor
examples/multi_highlight_example.py
1
1947
""" An example of highlighting "linked" artists. When one is selected, its partner will be highlighted in addition to the original artist. Illustrates subclassing a DataCursor. """ import numpy as np import matplotlib.pyplot as plt import mpldatacursor def main(): fig, axes = plt.subplots(ncols=2) num = 5 ...
mit
ccrouch/tuskar
tuskar/common/context.py
2
8043
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack Foundation # 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 #...
apache-2.0
gnott/elife-bot
tests/activity/test_schedule_cross_ref.py
2
1035
import unittest from activity.activity_ScheduleCrossref import activity_ScheduleCrossref import settings_mock class TestsScheduleCrossRef(unittest.TestCase): def setUp(self): self.schedulecrossref = activity_ScheduleCrossref(settings_mock, None, None, None, None) def test_new_crossref_xml_name(self):...
mit
enram/data-repository
file_transfer/datamover/utils.py
2
4552
import re import csv from collections import Counter class EnramNameParsingError(Exception): """ Exception placeholder for name parse issues """ pass def parse_filename(name): """parse enram bird profile name to individual descriptions dict Parse a BALTRAD hdf5 file name and return releva...
mit
v-legoff/pa-poc3
src/model/relations/many2one.py
1
4896
# Copyright (c) 2013 LE GOFF Vincent # 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 th...
bsd-3-clause
spake/mindstormsy
mindstormsy-robot/waveapi/commandline_robot_runner_test.py
10
2549
#!/usr/bin/python2.4 # # Copyright 2009 Google Inc. All Rights Reserved. """Tests for google3.walkabout.externalagents.api.commandline_robot_runner.""" __author__ = 'douwe@google.com (Douwe Osinga)' import StringIO from google3.pyglib import app from google3.pyglib import flags from google3.testing.pybase import g...
apache-2.0
dagwieers/ansible
lib/ansible/modules/monitoring/pingdom.py
47
3767
#!/usr/bin/python # -*- coding: utf-8 -*- # 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', ...
gpl-3.0
Jmainguy/ansible-modules-core
cloud/openstack/_quantum_floating_ip_associate.py
41
8255
#!/usr/bin/python #coding: utf-8 -*- # (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 version 3 of the License, or # (at your option) any later ...
gpl-3.0
CospanDesign/nysa-verilog
verilog/axi/slave/axi_video_resizer/cocotb/test_dut.py
1
13952
import os import sys import cocotb import logging from cocotb.result import TestFailure from cocotb.clock import Clock import time from array import array as Array from cocotb.triggers import Timer, FallingEdge from cocotb.drivers.amba import AXI4LiteMaster from cocotb.drivers.amba import AXI4StreamMaster from cocotb....
mit
Vishluck/sympy
sympy/categories/tests/test_drawing.py
86
27597
from sympy.categories.diagram_drawing import _GrowableGrid, ArrowStringDescription from sympy.categories import (DiagramGrid, Object, NamedMorphism, Diagram, XypicDiagramDrawer, xypic_draw_diagram) from sympy import FiniteSet def test_GrowableGrid(): grid = _GrowableGrid(1, 2) #...
bsd-3-clause
Nikoala/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/space.py
127
1528
from __future__ import unicode_literals import re from .common import InfoExtractor from .brightcove import BrightcoveIE from ..utils import RegexNotFoundError, ExtractorError class SpaceIE(InfoExtractor): _VALID_URL = r'https?://(?:(?:www|m)\.)?space\.com/\d+-(?P<title>[^/\.\?]*?)-video\.html' _TEST = { ...
gpl-3.0
rmaceissoft/django-photologue
photologue/tests/test_photosize.py
9
1084
from django.core.exceptions import ValidationError from .factories import PhotoSizeFactory from .helpers import PhotologueBaseTest class PhotoSizeNameTest(PhotologueBaseTest): def test_valid_name(self): """We are restricted in what names we can enter.""" photosize = PhotoSizeFactory() p...
bsd-3-clause
blueyed/jedi
test/run.py
8
12845
#!/usr/bin/env python """ |jedi| is mostly being tested by what I would call "Blackbox Tests". These tests are just testing the interface and do input/output testing. This makes a lot of sense for |jedi|. Jedi supports so many different code structures, that it is just stupid to write 200'000 unittests in the manner of...
mit
mdrumond/tensorflow
tensorflow/contrib/tensor_forest/hybrid/python/models/decisions_to_data_then_nn.py
190
1889
# 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
highweb-project/highweb-webcl-html5spec
chrome/common/extensions/docs/server2/owners_data_source_test.py
76
4664
#!/usr/bin/env python # 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. import unittest from owners_data_source import ParseOwnersFile, OwnersDataSource from server_instance import ServerInstance from servl...
bsd-3-clause
astroufsc/chimera
src/chimera/core/eventwrapper.py
5
2448
#! /usr/bin/env python # -*- coding: iso-8859-1 -*- # chimera - observatory automation system # Copyright (C) 2006-2007 P. Henrique Silva <henrique@astro.ufsc.br> # 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 S...
gpl-2.0
sumitsourabh/opencog
scripts/make_benchmark_graphs.py
56
3139
#!/usr/bin/env python # Requires matplotlib for graphing # reads *_benchmark.csv files as output by atomspace_bm and turns them into # graphs. import csv import numpy as np import matplotlib.colors as colors #import matplotlib.finance as finance import matplotlib.dates as mdates import matplotlib.ticker as mticker i...
agpl-3.0
phobson/statsmodels
statsmodels/formula/api.py
32
1392
from statsmodels.regression.linear_model import GLS gls = GLS.from_formula from statsmodels.regression.linear_model import WLS wls = WLS.from_formula from statsmodels.regression.linear_model import OLS ols = OLS.from_formula from statsmodels.regression.linear_model import GLSAR glsar = GLSAR.from_formula from statsmode...
bsd-3-clause
zooba/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/urllib3/util/connection.py
63
4639
from __future__ import absolute_import import socket from .wait import NoWayToWaitForSocketError, wait_for_read from ..contrib import _appengine_environ def is_connection_dropped(conn): # Platform-specific """ Returns True if the connection is dropped and should be closed. :param conn: :class:`h...
apache-2.0
wallix/pylogsparser
logsparser/extras/domain_parser.py
1
49839
# -*- coding: utf-8 -*- # -*- python -*- # pylogsparser - Logs parsers python library # # Copyright (C) 2011 Wallix Inc. # # This library 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; either version...
lgpl-2.1
srinathv/vispy
vispy/ext/glfw.py
23
24199
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # GLFW - An OpenGL framework # API version: 3.0.1 # WWW: http://www.glfw.org/ # ---------------------------------------------------------------------------- # Copyright (c) 2002-2006 Marcus Geelnard # ...
bsd-3-clause
jimlawton/pyagc-googlecode
agcasm/word.py
2
9031
#!/usr/bin/env python # Copyright 2010 Jim Lawton <jim dot lawton at gmail dot com> # # This file is part of pyagc. # # This 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...
gpl-2.0
beiko-lab/gengis
bin/Lib/site-packages/numpy/lib/tests/test_twodim_base.py
1
11993
""" Test functions for matrix module """ from numpy.testing import * from numpy import ( arange, rot90, add, fliplr, flipud, zeros, ones, eye, array, diag, histogram2d, tri, mask_indices, triu_indices, triu_indices_from, tril_indices, tril_indices_from ) import nump...
gpl-3.0
moijes12/oh-mainline
vendor/packages/twisted/twisted/test/test_compat.py
18
6186
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.python.compat}. """ import types, socket from twisted.trial import unittest from twisted.python.compat import set, frozenset, reduce class IterableCounter: def __init__(self, lim=0): self.lim = lim ...
agpl-3.0
kouaw/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/generic.py
6
32410
# encoding: utf-8 from __future__ import unicode_literals import os import re from .common import InfoExtractor from .youtube import YoutubeIE from ..utils import ( compat_urllib_error, compat_urllib_parse, compat_urllib_request, compat_urlparse, compat_xml_parse_error, ExtractorError, H...
gpl-3.0
gqwest-erp/server
openerp/addons/plugin_outlook/plugin_outlook.py
92
2079
# -*- 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
nubark/odoo
addons/mail/models/mail_message.py
4
47941
# -*- coding: utf-8 -*- from email.header import decode_header from email.utils import formataddr import logging from openerp import _, api, fields, models, SUPERUSER_ID from openerp import tools from openerp.exceptions import UserError, AccessError from openerp.osv import expression _logger = logging.getLogger(__n...
gpl-3.0
matrumz/RPi_Custom_Files
Printing/hplip-3.15.2/systray.py
1
4696
#!/usr/bin/env python # -*- coding: utf-8 -*- # # (c) Copyright 2003-2007 Hewlett-Packard Development Company, L.P. # # 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 Lice...
gpl-2.0
mlk/thefuck
tests/rules/test_react_native_command_unrecognized.py
1
1647
import pytest from thefuck.rules.react_native_command_unrecognized import match, \ get_new_command from tests.utils import Command stderr = 'Command `{}` unrecognized'.format stdout = ''' Usage: react-native <command> Commands: - start: starts the webserver - bundle: builds the javascript bundle for offline ...
mit
sauloal/cnidaria
scripts/venv/lib/python2.7/site-packages/ete2/parser/text_arraytable.py
3
5106
# #START_LICENSE########################################################### # # # This file is part of the Environment for Tree Exploration program # (ETE). http://etetoolkit.org # # ETE is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # t...
mit
pilou-/ansible
lib/ansible/modules/network/fortios/fortios_vpn_ipsec_manualkey_interface.py
21
12382
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, 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 3 of the Lic...
gpl-3.0
Amechi101/concepteur-market-app
venv/lib/python2.7/site-packages/django/middleware/cache.py
31
8974
""" Cache middleware. If enabled, each Django-powered page will be cached based on URL. The canonical way to enable cache middleware is to set ``UpdateCacheMiddleware`` as your first piece of middleware, and ``FetchFromCacheMiddleware`` as the last:: MIDDLEWARE_CLASSES = [ 'django.middleware.cache.UpdateCa...
mit
xxsergzzxx/python-for-android
python3-alpha/python3-src/Lib/urllib/error.py
48
2264
"""Exception classes raised by urllib. The base exception class is URLError, which inherits from IOError. It doesn't define any behavior of its own, but is the base class for all exceptions defined in this package. HTTPError is an exception class that is also a valid HTTP response instance. It behaves this way beca...
apache-2.0
zhaodelong/django
tests/indexes/tests.py
321
3037
from unittest import skipUnless from django.db import connection from django.test import TestCase from .models import Article, ArticleTranslation, IndexTogetherSingleList class SchemaIndexesTests(TestCase): """ Test index handling by the db.backends.schema infrastructure. """ def test_index_name_ha...
bsd-3-clause
meelapshah/git-review
git_review/cmd.py
1
54228
#!/usr/bin/env python from __future__ import print_function COPYRIGHT = """\ Copyright (C) 2011-2012 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/license...
mit
caglar10ur/func
func/minion/modules/bridge.py
5
20094
#!/usr/bin/python # # Copyright 2008, Stone-IT # Jasper Capel <capel@stone-it.com> # # 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 la...
gpl-2.0
jamslevy/gsoc
thirdparty/google_appengine/lib/yaml/lib/yaml/dumper.py
131
2718
__all__ = ['BaseDumper', 'SafeDumper', 'Dumper'] from emitter import * from serializer import * from representer import * from resolver import * class BaseDumper(Emitter, Serializer, BaseRepresenter, BaseResolver): def __init__(self, stream, default_style=None, default_flow_style=None, c...
apache-2.0
marty331/jakesclock
flask/lib/python2.7/site-packages/sqlalchemy/engine/util.py
81
2338
# engine/util.py # Copyright (C) 2005-2015 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 from .. import util def connection_memoize(key): """Decorator, memoize a functi...
gpl-2.0
hojel/calibre
src/calibre/ebooks/mobi/writer8/cleanup.py
14
1455
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' from calibre....
gpl-3.0
sugartom/tensorflow-alien
tensorflow/contrib/tfprof/python/tools/tfprof/tfprof_logger_test.py
46
3132
# 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
cecep-edu/edx-platform
common/lib/xmodule/xmodule/lti_2_util.py
44
16145
# pylint: disable=attribute-defined-outside-init """ A mixin class for LTI 2.0 functionality. This is really just done to refactor the code to keep the LTIModule class from getting too big """ import json import re import mock import urllib import hashlib import base64 import logging from webob import Response from x...
agpl-3.0
damiencalloway/djtut
mysite/env/lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/introspection.py
221
2147
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` dict f...
mit
yjmade/odoo
addons/resource/__init__.py
448
1086
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
ta2-1/pootle
pytest_pootle/fixtures/pootle_fs/resources.py
10
1085
# -*- coding: utf-8 -*- # # Copyright (C) Pootle contributors. # # This file is a part of the Pootle project. It is distributed under the GPL3 # or later license. See the LICENSE file for a copy of the license and the # AUTHORS file for copyright and authorship information. import pytest @pytest.fixture def project0...
gpl-3.0
quickresolve/accel.ai
flask-aws/lib/python2.7/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py
762
3532
import hashlib import os from pip._vendor.lockfile import LockFile from pip._vendor.lockfile.mkdirlockfile import MkdirLockFile from ..cache import BaseCache from ..controller import CacheController def _secure_open_write(filename, fmode): # We only want to write to this file, so open it in write only mode ...
mit
mdietrichc2c/OCB
openerp/addons/test_inherit/models.py
15
2104
# -*- coding: utf-8 -*- from openerp import models, fields, api, osv # We just create a new model class mother(models.Model): _name = 'test.inherit.mother' _columns = { # check interoperability of field inheritance with old-style fields 'name': osv.fields.char('Name', required=True), } ...
agpl-3.0
mrphang/xhtml2pdf
test/datauri.py
154
1815
# -*- coding: utf-8 -*- # Copyright 2010 Dirk Holtwick, holtwick.it # # 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
kkampardi/Plinth
plinth/modules/ttrss/urls.py
5
1087
# # This file is part of Plinth. # # 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 later version. # # This program is distribute...
agpl-3.0
dimara/synnefo
snf-pithos-backend/pithos/backends/migrate.py
10
2946
# Copyright (C) 2010-2014 GRNET S.A. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed i...
gpl-3.0
mike-perdide/gitbuster
gitbuster/branch_view.py
1
18174
# branch_view.py # Copyright (C) 2010 Julien Miotte <miotte.julien@gmail.com> # # This module is part of gitbuster and is released under the GPLv3 # License: http://www.gnu.org/licenses/gpl-3.0.txt # from PyQt4.QtGui import QApplication, QCheckBox, QGridLayout, QKeySequence,\ QLabel, QLineEdit, QMenu, QMessageBox...
gpl-3.0
santoshsahoo/personfinder
app/confirm_disable_notes.py
1
3580
#!/usr/bin/python2.5 # Copyright 2010 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 applicable l...
apache-2.0
OptimusGitEtna/RestSymf
Python-3.4.2/Lib/webbrowser.py
81
21421
#! /usr/bin/env python3 """Interfaces for launching and remotely controlling Web browsers.""" # Maintained by Georg Brandl. import os import shlex import shutil import sys import subprocess __all__ = ["Error", "open", "open_new", "open_new_tab", "get", "register"] class Error(Exception): pass _browsers = {} ...
mit
mattclay/ansible
test/units/module_utils/common/text/formatters/test_human_to_bytes.py
68
5456
# -*- coding: utf-8 -*- # Copyright 2019, Andrew Klychkov @Andersson007 <aaklychkov@mail.ru> # Copyright 2019, Sviatoslav Sydorenko <webknjaz@redhat.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 __metac...
gpl-3.0
wangxuan007/flasky
venv/lib/python2.7/site-packages/wheel/test/test_ranking.py
565
1496
import unittest from wheel.pep425tags import get_supported from wheel.install import WheelFile WHEELPAT = "%(name)s-%(ver)s-%(pyver)s-%(abi)s-%(arch)s.whl" def make_wheel(name, ver, pyver, abi, arch): name = WHEELPAT % dict(name=name, ver=ver, pyver=pyver, abi=abi, arch=arch) return WheelFile(name...
gpl-3.0
nwokeo/supysonic
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/_collections.py
666
10553
from __future__ import absolute_import from collections import Mapping, MutableMapping try: from threading import RLock except ImportError: # Platform-specific: No threads available class RLock: def __enter__(self): pass def __exit__(self, exc_type, exc_value, traceback): ...
agpl-3.0
Titulacion-Sistemas/PythonTitulacion-EV
Lib/site-packages/django_extensions/templatetags/highlighting.py
41
3098
""" Similar to syntax_color.py but this is intended more for being able to copy+paste actual code into your Django templates without needing to escape or anything crazy. http://lobstertech.com/2008/aug/30/django_syntax_highlight_template_tag/ Example: {% load highlighting %} <style> @import url("http://lobsterte...
mit
City-of-Helsinki/smbackend
smbackend_turku/importers/units.py
1
19752
from collections import defaultdict, OrderedDict from datetime import date, datetime from functools import lru_cache import pytz from django.conf import settings from django.contrib.gis.gdal import GDAL_VERSION from django.contrib.gis.geos import Point, Polygon from django.utils import formats, translation from django...
agpl-3.0
sanSS/programming-contests
project-euler/problem058.py
2
1810
#!/usr/bin/env python3 ######################################################################## # Solves problem 58 from projectEuler.net. # Determines what is the side length of the square spiral for which # the ratio of primes along both diagonals first falls below 10% # fraction to solve sqrt(2) have the n...
gpl-3.0
jeanmask/opps-feedcrawler
opps/feedcrawler/processors/category_brasil.py
2
1126
CATEGORY_BRASIL = { u'http://agenciabrasil.ebc.com.br/feed/assunto/55/all/feed.xml': u'noticias/brasil', u'http://agenciabrasil.ebc.com.br/feed/assunto/51/all/feed.xml': u'noticias/economia', u'http://agenciabrasil.ebc.com.br/feed/assunto/62/all/feed.xml': u'noticias/comportamento-educacao', u'http://ag...
mit
michalbachowski/pyqp
pyqp/reducers.py
1
2989
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import division from functools import wraps import math # in python there are built in: sum, min and max def last(values): """Returns last value from given list >>> last([1,2,3]) 3 >>> last([]) Traceback (most recent call last): ....
mit
nateprewitt/pipenv
pipenv/patched/pip/_vendor/html5lib/_tokenizer.py
385
76580
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import unichr as chr from collections import deque from .constants import spaceCharacters from .constants import entities from .constants import asciiLetters, asciiUpper2Lower from .constants import digits, hexDigits, EOF from .c...
mit
nrc/servo
tests/wpt/web-platform-tests/tools/py/testing/log/test_log.py
163
6634
import py import sys from py._log.log import default_keywordmapper callcapture = py.io.StdCapture.call def setup_module(mod): mod._oldstate = default_keywordmapper.getstate() def teardown_module(mod): default_keywordmapper.setstate(mod._oldstate) class TestLogProducer: def setup_method(self, meth): ...
mpl-2.0
rahushen/ansible
lib/ansible/modules/network/vyos/vyos_static_route.py
38
8146
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # # This file is part of Ansible by Red Hat # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Li...
gpl-3.0
yarlson/django-jinja2-project
apps/project_name/wsgi.py
1
1589
""" WSGI config for {{ project_name }} project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APP...
bsd-3-clause
Commonists/MediaCollectionDB
setup.py
1
1030
#!/usr/bin/python # -*- coding: latin-1 -*- """Setup script.""" try: from setuptools import setup except ImportError: from distutils.core import setup try: import mediacollectiondb version = mediacollectiondb.__version__ except ImportError: version = 'Undefined' classifiers = [ 'Development...
mit
0x0mar/Empire
lib/modules/situational_awareness/network/netview.py
6
4027
from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Invoke-Netview', 'Author': ['@harmj0y'], 'Description': ('Queries the domain for all hosts, and retrieves open shares, ' 'sessions...
bsd-3-clause
micadeyeye/Blongo
django/dispatch/saferef.py
345
10495
""" "Safe weakrefs", originally from pyDispatcher. Provides a way to safely weakref any function, including bound methods (which aren't handled by the core weakref module). """ import weakref, traceback def safeRef(target, onDelete = None): """Return a *safe* weak reference to a callable target target -- th...
bsd-3-clause
iemejia/beam
sdks/python/apache_beam/runners/portability/flink_runner_test.py
4
17077
# # 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 us...
apache-2.0
general-mobile/kotlin-android-mvp-starter
hooks/post_gen_project.py
1
2394
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import shutil project_dir = os.getcwd() package_dir = '{{ cookiecutter.package_name }}'.replace('.', '/') os.chdir(os.path.join("app","src","androidTest","java")) os.makedirs(package_dir) shutil.move('ApplicationTest.java', package_dir + '/ApplicationTest.java...
mit
InAnimaTe/CouchPotatoServer
libs/tornado/options.py
79
20184
#!/usr/bin/env python # # Copyright 2009 Facebook # # 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...
gpl-3.0
DarioGT/OMS-PluginXML
org.modelsphere.sms/lib/jython-2.2.1/Tools/jythonc/ImportName.py
1
5214
# Copyright (c) Corporation for National Research Initiatives import sys import os from org.python.core import PyModule, PyJavaClass, PyClass, \ PyJavaPackage, PyBeanEventProperty from util import lookup def wrapJava(mod): if isinstance(mod, PyModule): return Module(mod) elif i...
gpl-3.0
akirk/youtube-dl
youtube_dl/extractor/eagleplatform.py
24
4095
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, int_or_none, ) class EaglePlatformIE(InfoExtractor): _VALID_URL = r'''(?x) (?: eagleplatform:(?P<custom_host>[^/]+):| ...
unlicense
Lilykos/invenio
invenio/legacy/bibformat/bibreformat.py
7
18435
# -*- mode: python; coding: utf-8; -*- # # This file is part of Invenio. # Copyright (C) 2007, 2008, 2010, 2011, 2012, 2014, 2015 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 versio...
gpl-2.0
henryfjordan/django
tests/utils_tests/test_archive.py
372
2386
import os import shutil import tempfile import unittest from django.utils._os import upath from django.utils.archive import Archive, extract TEST_DIR = os.path.join(os.path.dirname(upath(__file__)), 'archives') class ArchiveTester(object): archive = None def setUp(self): """ Create temporar...
bsd-3-clause
40223130/2016fallcadp_hw
plugin/liquid_tags/test_generation.py
306
3919
# -*- coding: utf-8 -*- from __future__ import print_function import filecmp import os import unittest from shutil import rmtree from tempfile import mkdtemp import pytest from pelican import Pelican from pelican.settings import read_settings from .notebook import IPYTHON_VERSION PLUGIN_DIR = os.path.dirname(__file...
agpl-3.0
mollstam/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/boto-2.38.0/tests/unit/mws/test_connection.py
100
8457
#!/usr/bin/env python # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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 ...
mit
poo12138/gem5-stable
ext/ply/example/BASIC/basinterp.py
166
17284
# This file provides the runtime support for running a basic program # Assumes the program has been parsed using basparse.py import sys import math import random class BasicInterpreter: # Initialize the interpreter. prog is a dictionary # containing (line,statement) mappings def __init__(self,prog): ...
bsd-3-clause
alexanderlz/redash
redash/query_runner/pg.py
3
18794
import os import logging import select from contextlib import contextmanager from base64 import b64decode from tempfile import NamedTemporaryFile from uuid import uuid4 import psycopg2 from psycopg2.extras import Range from redash.query_runner import * from redash.utils import JSONEncoder, json_dumps, json_loads log...
bsd-2-clause
burnpanck/chaco
chaco/scales/scales_test_case.py
2
9005
from traits.testing.unittest_tools import unittest from numpy import array from formatters import BasicFormatter, OffsetFormatter from scales import Pow10Scale, FixedScale, LogScale, DefaultScale, ScaleSystem, frange class TicksTestCase(unittest.TestCase): """ Base class for scale and scale system unit tests "...
bsd-3-clause
sckasturi/saltlake
scripts/parsedata.py
1
4815
#!/usr/bin/python3 -OO # Copyright (C) 2013-2014 Fox Wilson, Peter Foley, Srijay Kasturi, Samuel Damashek, James Forcier and Reed Koser # # 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 v...
gpl-2.0
mediafactory/tryton_core_daemon
trytond/test/test.py
1
10787
#This file is part of Tryton. The COPYRIGHT file at the top level of #this repository contains the full copyright notices and license terms. import datetime from decimal import Decimal from trytond.model import ModelSQL, fields from trytond.pyson import Eval class Boolean(ModelSQL): 'Boolean' _name = 'test....
gpl-3.0
sopac/pacgeo
geonode/version.py
9
2597
######################################################################### # # Copyright (C) 2012 OpenPlans # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or #...
gpl-3.0
dotsdl/PyTables
examples/table1.py
13
2255
from __future__ import print_function import tables class Particle(tables.IsDescription): name = tables.StringCol(16, pos=1) # 16-character String lati = tables.Int32Col(pos=2) # integer longi = tables.Int32Col(pos=3) # integer pressure = tables.Float32Col(pos=4) # float (...
bsd-3-clause
MVReddy/TMS
adlibre_tms/apps/tms/contrib/saasu/widgets.py
3
4397
from django import forms from django.conf import settings from django.forms.util import flatatt from django.utils.safestring import mark_safe from django.utils.encoding import force_unicode from django.utils.translation import ugettext as _ __all__ = ['AdminSaasuAccountInputWidget', 'AdminSaasuContactInputWidget', 'Ad...
bsd-3-clause