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
adityacs/ansible
lib/ansible/modules/network/f5/bigip_gtm_facts.py
16
16074
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2016 F5 Networks Inc. # # 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 # ...
gpl-3.0
jmacmahon/invenio
modules/miscutil/lib/upgrades/invenio_2012_11_21_aiduserinputlog_userid_check.py
3
1721
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2012 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) any later...
gpl-2.0
rosswhitfield/mantid
qt/applications/workbench/workbench/plugins/memorywidget.py
3
1571
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright © 2017 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + # T...
gpl-3.0
chrisspen/django-feeds
djangofeeds/conf.py
1
5159
from datetime import timedelta from django.conf import settings try: from celery import conf as celeryconf DEFAULT_ROUTING_KEY = celeryconf.DEFAULT_ROUTING_KEY except ImportError: DEFAULT_ROUTING_KEY = "celery" DEFAULT_DEFAULT_POST_LIMIT = 20 DEFAULT_NUM_POSTS = -1 DEFAULT_CACHE_MIN = 30 DEFAULT_ENTRY_WO...
bsd-2-clause
RAPD/RAPD
src/plugins/subcontractors/xdsme/new/xdsme-0.4.9/XDS/XIO/plugins/mosflm_export.py
7
1465
import time from math import pi, cos, sin TEMPLATE = """# File Automaticaly generated by XIO # date: %s # Beamline SOLEIL-Proxima1 # Detector type: ADSC 315r """ % (time.ctime()) TEMPLATE += """ # Basic definitions gain 1.15 adcoff 39 synchrotron polar 0.99 dispersion 0.0004 divergence 0.0...
agpl-3.0
davido/buck
third-party/py/unittest2/unittest2/__init__.py
155
2406
""" unittest2 unittest2 is a backport of the new features added to the unittest testing framework in Python 2.7. It is tested to run on Python 2.4 - 2.6. To use unittest2 instead of unittest simply replace ``import unittest`` with ``import unittest2``. Copyright (c) 1999-2003 Steve Purcell Copyright (c) 2003-2010 P...
apache-2.0
nightjean/Deep-Learning
tensorflow/contrib/learn/python/learn/__init__.py
80
2585
# 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
mkrupcale/ansible
lib/ansible/plugins/callback/jabber.py
15
3410
# Ansible CallBack module for Jabber (XMPP) # Copyright (C) 2016 maxn nikolaev.makc@gmail.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 opti...
gpl-3.0
roxyboy/bokeh
examples/plotting/file/color_sliders.py
24
5444
from bokeh.plotting import figure, hplot, output_file, show from bokeh.models import ColumnDataSource, LinearColorMapper, HoverTool from bokeh.models.actions import Callback from bokeh.models.widgets import Slider from bokeh.io import vform import colorsys # for plot 2: create colour spectrum of resolution N and brig...
bsd-3-clause
arokem/pyAFQ
AFQ/tests/test_bundles.py
2
2759
import numpy as np import numpy.testing as npt import os.path as op import nibabel as nib import nibabel.tmpdirs as nbtmp import dipy.data.fetcher as fetcher import AFQ.bundles as bdl hardi_dir = op.join(fetcher.dipy_home, "stanford_hardi") hardi_fdata = op.join(hardi_dir, "HARDI150.nii.gz") def test_bundles_class...
bsd-2-clause
alex/boto
boto/elastictranscoder/layer1.py
148
44082
# Copyright (c) 2013 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 limitation the rights ...
mit
michaelhuang/QuantSoftwareToolkit
Examples/Basic/tutorial3.py
4
3612
''' (c) 2011, 2012 Georgia Tech Research Corporation This source code is released under the New BSD license. Please see http://wiki.quantsoftware.org/index.php?title=QSTK_License for license details. Created on January, 24, 2013 @author: Sourabh Bajaj @contact: sourabhbajaj@gatech.edu @summary: Example tut...
bsd-3-clause
ChristineLaMuse/mozillians
vendor-local/lib/python/tablib/formats/_yaml.py
6
1252
# -*- coding: utf-8 -*- """ Tablib - YAML Support. """ import sys try: import yaml except ImportError: if sys.version_info[0] > 2: import tablib.packages.yaml3 as yaml else: import tablib.packages.yaml as yaml import tablib title = 'yaml' extentions = ('yaml', 'yml') def export_se...
bsd-3-clause
crr0004/taiga-back
taiga/projects/migrations/0011_auto_20141028_2057.py
27
1109
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django_pgjson.fields class Migration(migrations.Migration): dependencies = [ ('projects', '0010_project_modules_config'), ] operations = [ migrations.CreateModel( ...
agpl-3.0
hongliang5623/sentry
src/sentry/interfaces/base.py
10
2990
from __future__ import absolute_import from django.conf import settings from django.utils.html import escape from django.utils.translation import ugettext as _ from sentry.utils.imports import import_string def get_interface(name): try: import_path = settings.SENTRY_INTERFACES[name] except KeyError:...
bsd-3-clause
fredkingham/blog-of-fred
djangotoolbox/fields.py
52
16716
# All fields except for BlobField written by Jonas Haag <jonas@lophus.org> from django.core.exceptions import ValidationError from django.utils.importlib import import_module from django.db import models from django.db.models.fields.subclassing import Creator from django.db.utils import IntegrityError from django.db.m...
bsd-3-clause
bwrsandman/OpenUpgrade
addons/mrp_operations/report/mrp_code_barcode.py
381
1511
# -*- 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...
agpl-3.0
i-maravic/ns-3
examples/wireless/mixed-wireless.py
48
16203
# /* # * This program is free software; you can redistribute it and/or modify # * it under the terms of the GNU General Public License version 2 as # * published by the Free Software Foundation; # * # * This program is distributed in the hope that it will be useful, # * but WITHOUT ANY WARRANTY; without even the ...
gpl-2.0
wangyum/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/bernoulli_test.py
1
10847
# 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
mjtamlyn/django
tests/sitemaps_tests/urls/http.py
59
5637
from collections import OrderedDict from datetime import date, datetime from django.conf.urls import url from django.conf.urls.i18n import i18n_patterns from django.contrib.sitemaps import GenericSitemap, Sitemap, views from django.http import HttpResponse from django.utils import timezone from django.views.decorators...
bsd-3-clause
samvarankashyap/linch-pin
linchpin/provision/roles/azure/library/rundb.py
6
6157
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import absolute_import import os import json import ast from ansible.module_utils.basic import AnsibleModule try: from ..module_utils.rundb.basedb import BaseDB from ..module_utils.rundb.tinydb import TinyRunDB from ..module_utils.rundb.mongodb imp...
gpl-3.0
quartzmo/gcloud-ruby
google-cloud-dialogflow/synth.py
1
2614
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
apache-2.0
4eek/edx-platform
lms/djangoapps/django_comment_client/tests/test_middleware.py
134
1878
import django.http from django.test import TestCase from nose.plugins.attrib import attr import json import lms.lib.comment_client import django_comment_client.middleware as middleware @attr('shard_1') class AjaxExceptionTestCase(TestCase): def setUp(self): super(AjaxExceptionTestCase, self).setUp() ...
agpl-3.0
ngokevin/cyder
.virtualenv/lib/python2.6/site-packages/pip-1.0.2-py2.6.egg/pip/commands/zip.py
94
14517
import sys import re import fnmatch import os import shutil import zipfile from pip.util import display_path, backup_dir, rmtree from pip.log import logger from pip.exceptions import InstallationError from pip.basecommand import Command class ZipCommand(Command): name = 'zip' usage = '%prog [OPTIONS] PACKAGE_...
bsd-3-clause
Orav/kbengine
kbe/src/lib/python/Lib/test/test_bigmem.py
2
46498
"""Bigmem tests - tests for the 32-bit boundary in containers. These tests try to exercise the 32-bit boundary that is sometimes, if rarely, exceeded in practice, but almost never tested. They are really only meaningful on 64-bit builds on machines with a *lot* of memory, but the tests are always run, usually wi...
lgpl-3.0
LSSTDESC/ReprocessingTaskForce
scripts/run_mergeCoaddMeasurements.py
2
1557
#!/usr/bin/env python from __future__ import print_function import os import glob import libRun as LR def build_cmd(patch, configFile, input, output) : if not os.path.isdir("scripts"): os.makedirs("scripts") cmd = "mv "+ patch + " scripts" os.system(cmd) cmd = "mergeCoaddMeasurements.py %...
gpl-2.0
jeenalee/servo
tests/wpt/web-platform-tests/tools/pytest/_pytest/assertion/util.py
175
11730
"""Utilities for assertion debugging""" import pprint import _pytest._code import py try: from collections import Sequence except ImportError: Sequence = list BuiltinAssertionError = py.builtin.builtins.AssertionError u = py.builtin._totext # The _reprcompare attribute on the util module is used by the new a...
mpl-2.0
georgewhewell/django-celery
pavement.py
8
3936
import os import sys from paver.easy import path, sh, needs, task, options, Bunch, cmdopts PYCOMPILE_CACHES = ['*.pyc', '*$py.class'] options( sphinx=Bunch(builddir='.build'), ) def sphinx_builddir(options): return path('docs') / options.sphinx.builddir / 'html' @task def clean_docs(options): sphinx_...
bsd-3-clause
gannetson/sportschooldeopenlucht
env/lib/python2.7/site-packages/setuptools/_backport/hashlib/_sha256.py
77
11559
import struct SHA_BLOCKSIZE = 64 SHA_DIGESTSIZE = 32 def new_shaobject(): return { 'digest': [0]*8, 'count_lo': 0, 'count_hi': 0, 'data': [0]* SHA_BLOCKSIZE, 'local': 0, 'digestsize': 0 } ROR = lambda x, y: (((x & 0xffffffff) >> (y & 31)) | (x << (32 - (y & 31...
bsd-3-clause
brandond/ansible
lib/ansible/modules/network/netvisor/pn_vflow_table_profile.py
47
3814
#!/usr/bin/python # Copyright: (c) 2018, Pluribus Networks # 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': ['...
gpl-3.0
maxlikely/scikit-learn
sklearn/manifold/tests/test_spectral_embedding.py
6
8149
import warnings from nose.tools import assert_true from nose.tools import assert_equal from scipy.sparse import csr_matrix from scipy.sparse import csc_matrix import numpy as np from numpy.testing import assert_array_almost_equal from nose.tools import assert_raises from nose.plugins.skip import SkipTest from sklea...
bsd-3-clause
PeterWangPo/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/common.py
139
10217
# Copyright 2012, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
Krozark/Harpe-Website
Harpe-website/Harpe/wsgi.py
2
1132
""" WSGI config for Harpe 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_APPLICATION`` se...
bsd-2-clause
sameerparekh/pants
tests/python/pants_test/invalidation/test_build_invalidator.py
18
1820
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import hashlib impor...
apache-2.0
j0nathan33/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/mit.py
20
6434
from __future__ import unicode_literals import re import json from .common import InfoExtractor from .youtube import YoutubeIE from ..utils import ( compat_urlparse, clean_html, ExtractorError, get_element_by_id, ) class TechTVMITIE(InfoExtractor): IE_NAME = 'techtv.mit.edu' _VALID_URL = r'h...
gpl-3.0
piem/aubio
python/tests/test_zero_crossing_rate.py
2
1576
#! /usr/bin/env python from numpy.testing import TestCase from aubio import fvec, zero_crossing_rate buf_size = 2048 class zero_crossing_rate_test_case(TestCase): def setUp(self): self.vector = fvec(buf_size) def test_zeroes(self): """ check zero crossing rate on a buffer of 0. """ ...
gpl-3.0
pombredanne/PyGithub
github/RepositoryKey.py
1
5564
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
gpl-3.0
kalev/anaconda
tests/tsort_test.py
2
2115
import unittest import pyanaconda.tsort class TopologicalSortTestCase(unittest.TestCase): def runTest(self): items = [1, 2, 3, 4, 5] edges = [(5, 4), (4, 3), (3, 2), (2, 1)] graph = pyanaconda.tsort.create_graph(items, edges) self._tsortTest(graph) edges = [(5, 4), (2, 3),...
gpl-2.0
kholidfu/django
django/db/models/manager.py
301
10722
import copy import inspect from importlib import import_module from django.db import router from django.db.models.query import QuerySet from django.utils import six from django.utils.encoding import python_2_unicode_compatible def ensure_default_manager(cls): """ Ensures that a Model subclass contains a defa...
bsd-3-clause
WorldBank-Transport/open-transit-indicators
python/django/transit_indicators/models.py
2
21985
# coding=UTF-8 import csv from datetime import datetime import uuid from django.conf import settings from django.contrib.gis.db import models from django.db import transaction from django.utils.translation import ugettext_lazy as _ from transit_indicators.gtfs import GTFSRouteTypes from datasources.models import Boun...
gpl-3.0
alberthxf/custodian
custodian/utils.py
2
1163
# coding: utf-8 from __future__ import unicode_literals, division """ Utility function and classes. """ __author__ = "Shyue Ping Ong" __copyright__ = "Copyright 2012, The Materials Project" __version__ = "0.1" __maintainer__ = "Shyue Ping Ong" __email__ = "shyuep@gmail.com" __date__ = "1/12/14" from glob import gl...
mit
LeSam/avoplot
src/avoplot/gui/analysis_tools.py
3
4491
#Copyright (C) Nial Peters 2013 # #This file is part of AvoPlot. # #AvoPlot 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. # #AvoPlot is ...
gpl-3.0
mit-crpg/openmc
openmc/surface.py
8
78686
from abc import ABC, abstractmethod from collections import OrderedDict from collections.abc import Iterable from copy import deepcopy import math from numbers import Real from xml.etree import ElementTree as ET from warnings import warn, catch_warnings, simplefilter import numpy as np from .checkvalue import check_t...
mit
imtapps/django-imt-fork
tests/regressiontests/swappable_models/tests.py
44
2526
from __future__ import absolute_import, unicode_literals from django.utils.six import StringIO from django.contrib.auth.models import Permission from django.contrib.contenttypes.models import ContentType from django.core import management from django.db.models.loading import cache from django.test import TestCase fro...
bsd-3-clause
leiferikb/bitpop
build/third_party/buildbot_8_4p1/buildbot/config.py
2
4429
# 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-3.0
updownlife/multipleK
src/select_sub.py
1
3215
import random def sequentialy(qset): rset = [] for i in range(0, len(qset)): rset.append(qset[i]) return rset def randomly(_qset): qset = list(_qset) rset = [] while qset: sel = random.choice(qset) rset.append(sel) qset.remove(sel) return rset def fullBFS(qset): if l...
gpl-2.0
jerli/sympy
sympy/ntheory/tests/test_modular.py
47
1499
from sympy.core.singleton import S from sympy.core.symbol import Symbol from sympy.ntheory.modular import crt, crt1, crt2, solve_congruence from sympy.utilities.pytest import raises def test_crt(): def mcrt(m, v, r, symmetric=False): assert crt(m, v, symmetric)[0] == r mm, e, s = crt1(m) a...
bsd-3-clause
BeagleInc/PyReadableDiff
setup.py
1
1652
import setuptools import pydiff NAME = 'PyReadableDiff' DESCRIPTION = 'Intuitive human-readable diff for text' # Use .rst markup for the long description in order to provide # the link to the repository, since PyPI doesn't support .md markup, # so we can't use the content of README.md for this purpose. LONG_DESCRI...
apache-2.0
arista-eosplus/ansible
lib/ansible/module_utils/gcp.py
46
34965
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
gpl-3.0
Pluto-tv/chromium-crosswalk
tools/telemetry/third_party/modulegraph/modulegraph_tests/test_import_from_init.py
23
4336
import sys if sys.version_info[:2] <= (2,6): import unittest2 as unittest else: import unittest import textwrap import subprocess import os from modulegraph import modulegraph class TestNativeImport (unittest.TestCase): # The tests check that Python's import statement # works as these tests expect. ...
bsd-3-clause
JamesClough/networkx
examples/pygraphviz/write_dotfile.py
15
1258
#!/usr/bin/env python """ Write a dot file from a networkx graph for further processing with graphviz. You need to have either pygraphviz or pydotplus for this example. See http://networkx.github.io/documentation/latest/reference/drawing.html for more info. """ # Author: Aric Hagberg (hagberg@lanl.gov) # Copyrig...
bsd-3-clause
Jgarcia-IAS/SAT
openerp/addons-extra/odoo-pruebas/odoo-server/addons-extra/account_paybill/wizard/cash_statement_populate.py
10
4892
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 Cubic ERP - Teradata SAC (<http://cubicerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the ...
agpl-3.0
openprocurement/restkit
doc/sitemap_gen.py
9
67145
#!/usr/bin/env python # # Copyright (c) 2004, 2005 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, th...
apache-2.0
habeanf/Open-Knesset
video/management/commands/sub_commands/tests/DownloadCommitteesVideos.py
14
6184
#encoding: utf-8 from django.test import TestCase from video.management.commands.sub_commands.DownloadCommitteesVideos import DownloadCommitteesVideos class Mms_test: def __init__(self,parent): self._parent=parent def get_size(self,url): return self._parent.mmsGetSize(url) def resume_do...
bsd-3-clause
ryancoleman/autodock-vina
boost_1_54_0/tools/build/v2/test/library_order.py
44
2111
#!/usr/bin/python # Copyright 2004 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) # Test that on compilers sensitive to library order on linker's command line, # we generate the correct order. import BoostBu...
apache-2.0
libscie/liberator
liberator/lib/python3.6/site-packages/pip/_vendor/requests/packages/urllib3/contrib/pyopenssl.py
501
11778
'''SSL with SNI_-support for Python 2. Follow these instructions if you would like to verify SSL certificates in Python 2. Note, the default libraries do *not* do certificate checking; you need to do additional work to validate certificates yourself. This needs the following packages installed: * pyOpenSSL (tested wi...
cc0-1.0
upcFrost/SDR2_translate
rpErrorHandler.py
1
26686
#------------------------------------------------------------------------------# # # # Run-time error handler for Rapyd projects # # ...
gpl-3.0
sbinet-staging/pyrame
chkpyr/chkpyr.py
1
1163
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # # Copyright 2012-2015 Frédéric Magniette, Miguel Rubio-Roy # This file is part of Pyrame. # # Pyrame 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, ei...
lgpl-3.0
ArcherSys/ArcherSys
Lib/site-packages/setuptools/depends.py
114
6418
import sys import imp import marshal from imp import PKG_DIRECTORY, PY_COMPILED, PY_SOURCE, PY_FROZEN from distutils.version import StrictVersion from setuptools.extern import six __all__ = [ 'Require', 'find_module', 'get_module_constant', 'extract_constant' ] class Require: """A prerequisite to building or...
mit
lbouma/Cyclopath
pyserver/util_/strutil.py
1
4807
# Copyright (c) 2006-2013 Regents of the University of Minnesota. # For licensing terms, see the file LICENSE. # MAC_RE = re.compile(r'^(mc|mac|de|van)(.)(.*)') # # def capitalize_surname(name): # '''Return a semi-intelligently capitalized version of name.''' # name = name.lower() # # capitalize letter after...
apache-2.0
victorzhao/miniblink49
third_party/WebKit/Tools/Scripts/webkitpy/common/net/buildbot/buildbot.py
35
18382
# Copyright (c) 2009, Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the...
gpl-3.0
jbeluch/xbmcswift2-xbmc-dist
lib/xbmcswift2/__init__.py
32
2423
''' xbmcswift2 ---------- A micro framework to enable rapid development of XBMC plugins. :copyright: (c) 2012 by Jonathan Beluch :license: GPLv3, see LICENSE for more details. ''' from types import ModuleType class module(ModuleType): '''A wrapper class for a module used to override __getatt...
gpl-3.0
linked67/p2pool-vc
p2pool/data.py
15
38933
from __future__ import division import hashlib import os import random import sys import time from twisted.python import log import p2pool from p2pool.bitcoin import data as bitcoin_data, script, sha256 from p2pool.util import math, forest, pack # hashlink hash_link_type = pack.ComposedType([ ('state', pack.Fi...
gpl-3.0
Arundhatii/erpnext
erpnext/buying/doctype/request_for_quotation/request_for_quotation.py
1
12193
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe, json from frappe import _ from frappe.model.mapper import get_mapped_doc from frappe.utils import get_url, cint from frap...
gpl-3.0
i5on9i/echoserver
lib/flask/testsuite/basic.py
149
42765
# -*- coding: utf-8 -*- """ flask.testsuite.basic ~~~~~~~~~~~~~~~~~~~~~ The basic functionality. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import re import uuid import flask import pickle import unittest from datetime import datetime from threading i...
apache-2.0
paulproteus/django
tests/regressiontests/signed_cookies_tests/tests.py
123
2465
from __future__ import unicode_literals import time from django.core import signing from django.http import HttpRequest, HttpResponse from django.test import TestCase class SignedCookieTest(TestCase): def test_can_set_and_read_signed_cookies(self): response = HttpResponse() response.set_signed_...
bsd-3-clause
osrg/zookeeper
src/contrib/zkpython/src/test/close_deadlock_test.py
164
1574
#!/usr/bin/python # # 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 # "Lic...
apache-2.0
stylianos-kampakis/scikit-learn
sklearn/mixture/gmm.py
68
31091
""" Gaussian Mixture Models. This implementation corresponds to frequentist (non-Bayesian) formulation of Gaussian Mixture Models. """ # Author: Ron Weiss <ronweiss@gmail.com> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Bertrand Thirion <bertrand.thirion@inria.fr> import warnings import numpy as...
bsd-3-clause
aperigault/ansible
lib/ansible/modules/network/f5/bigiq_application_fasthttp.py
38
23724
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2018, 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
borosnborea/SwordGO_app
example/kivymap/.buildozer/applibs/requests/models.py
360
30532
# -*- coding: utf-8 -*- """ requests.models ~~~~~~~~~~~~~~~ This module contains the primary objects that power Requests. """ import collections import datetime from io import BytesIO, UnsupportedOperation from .hooks import default_hooks from .structures import CaseInsensitiveDict from .auth import HTTPBasicAuth ...
gpl-3.0
klnprj/testapp
django/contrib/localflavor/es/es_provinces.py
436
1482
# -*- coding: utf-8 -*- from django.utils.translation import ugettext_lazy as _ PROVINCE_CHOICES = ( ('01', _('Arava')), ('02', _('Albacete')), ('03', _('Alacant')), ('04', _('Almeria')), ('05', _('Avila')), ('06', _('Badajoz')), ('07', _('Illes Balears')), ('08', _('Barcelona')), (...
bsd-3-clause
sarthakmeh03/django
tests/messages_tests/test_session.py
7
1759
from django.contrib.messages import constants from django.contrib.messages.storage.base import Message from django.contrib.messages.storage.session import SessionStorage from django.test import TestCase from django.utils.safestring import SafeData, mark_safe from .base import BaseTests def set_session_data(storage, ...
bsd-3-clause
becomejapan/yahooads-python-lib
examples/RetargetingListService/RetargetingListService_mutate_SET.py
1
11527
# Copyright 2017 Become Corp. 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...
apache-2.0
drawcode/yaml-cpp.new-api
test/gmock-1.7.0/gtest/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...
mit
Jumpscale/core9
setup.py
1
2646
from setuptools import setup, find_packages from distutils.sysconfig import get_python_lib from setuptools.command.install import install as _install from setuptools.command.develop import develop as _develop import os def _post_install(libname, libpath): from JumpScale9 import j # here its still the boostrap Ju...
apache-2.0
yqm/sl4a
python/src/Demo/cgi/wiki.py
48
4037
"""Wiki main program. Imported and run by cgi3.py.""" import os, re, cgi, sys, tempfile escape = cgi.escape def main(): form = cgi.FieldStorage() print "Content-type: text/html" print cmd = form.getvalue("cmd", "view") page = form.getvalue("page", "FrontPage") wiki = WikiPage(page) method...
apache-2.0
skirsdeda/djangocms-blog
djangocms_blog/cms_toolbars.py
1
3587
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals from cms.toolbar_base import CMSToolbar from cms.toolbar_pool import toolbar_pool from cms.utils.urlutils import admin_reverse from django.core.urlresolvers import reverse from django.utils.translation import override, uge...
bsd-3-clause
Guts/DicoGIS
dicogis/georeaders/Infos_DXF.py
1
8858
#! python3 # noqa: E265 # ---------------------------------------------------------------------------- # Name: Infos DXF # Purpose: Use GDAL/OGR and dxfgrabber to read AutoCAD exchanges file format. # # Author: Julien Moura (https://github.com/Guts/) # # -------------------------------------------...
gpl-3.0
Ex-sabagostar/atom-shell
script/lib/util.py
1
2645
#!/usr/bin/env python import atexit import contextlib import errno import shutil import subprocess import sys import tarfile import tempfile import urllib2 import os import zipfile def tempdir(prefix=''): directory = tempfile.mkdtemp(prefix=prefix) atexit.register(shutil.rmtree, directory) return directory @...
mit
davidgbe/scikit-learn
sklearn/ensemble/voting_classifier.py
178
8006
""" Soft Voting/Majority Rule classifier. This module contains a Soft Voting/Majority Rule classifier for classification estimators. """ # Authors: Sebastian Raschka <se.raschka@gmail.com>, # Gilles Louppe <g.louppe@gmail.com> # # Licence: BSD 3 clause import numpy as np from ..base import BaseEstimator f...
bsd-3-clause
phenomx4/android_kernel_zte_nex
scripts/gcc-wrapper.py
2
3423
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2011-2012, The Linux Foundation. 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 th...
gpl-2.0
Omegaphora/external_chromium_org
tools/clang/scripts/update.py
25
9363
#!/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. """Windows can't run .sh files, so this is a Python implementation of update.sh. This script should replace update.sh on all platfo...
bsd-3-clause
jasonz93/python-tordatahub
tordatahub/tests/blob/blob_topic_sub.py
1
3267
#!/usr/bin/env python # -*- coding: utf-8 -*- # 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...
apache-2.0
Jgarcia-IAS/SAT
openerp/addons-extra/odoo-pruebas/odoo-server/addons/pad/py_etherpad/__init__.py
505
7804
"""Module to talk to EtherpadLite API.""" import json import urllib import urllib2 class EtherpadLiteClient: """Client to talk to EtherpadLite API.""" API_VERSION = 1 # TODO probably 1.1 sometime soon CODE_OK = 0 CODE_INVALID_PARAMETERS = 1 CODE_INTERNAL_ERROR = 2 CODE_INVALID_FUNCTION = 3 ...
agpl-3.0
Jichao/skia
tools/skp/page_sets/skia_unicodetable_desktop.py
32
1321
# Copyright 2015 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. # pylint: disable=W0401,W0614 from telemetry import story from telemetry.page import page as page_module from telemetry.page import shared_page_state clas...
bsd-3-clause
elbeardmorez/quodlibet
quodlibet/tests/test_qltk_info.py
1
1263
# -*- coding: utf-8 -*- # 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. import os from quodlibet import app from tests...
gpl-2.0
vincent-tr/rpi-js-os
ext/v8-6.3.166/v8/tools/release/test_backport_node.py
2
2263
#!/usr/bin/env python # Copyright 2017 the V8 project 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 os import shutil import subprocess import sys import tempfile import unittest from common_includes import FileToText import b...
gpl-3.0
fkakuma/ryu
ryu/tests/unit/packet/test_bpdu.py
56
19773
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation. # # 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 appli...
apache-2.0
intgr/django-cms
cms/migrations/0014_sites_removed.py
525
20033
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models try: from django.contrib.auth import get_user_model except ImportError: # django < 1.5 from django.contrib.auth.models import User else: User = get_user_model() user_orm_label...
bsd-3-clause
MarcosCommunity/odoo
comunity_modules/product_no_translation/__init__.py
3
1062
# -*- encoding: utf-8 -*- ############################################################################## # # Product No Translation module for Odoo # Copyright (C) 2014 Akretion (http://www.akretion.com) # @author Alexis de Lattre <alexis.delattre@akretion.com> # # This program is free software: you can red...
agpl-3.0
kyrias/cjdns
contrib/python/cjdnsadmin/publicToIp6.py
18
2228
#!/usr/bin/env python2 # You may redistribute this program 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 in the hope that it will be useful, # bu...
gpl-3.0
FateAce/godot
misc/scripts/make_bmfhdr.py
62
1440
import sys if (len(sys.argv) != 2): print("Pass me a .fnt argument!") f = open(sys.argv[1], "rb") name = sys.argv[1].lower().replace(".fnt", "") l = f.readline() font_height = 0 font_ascent = 0 font_charcount = 0 font_chars = [] font_cc = 0 while(l != ""): fs = l.strip().find(" ") if (fs == -1): ...
mit
kuba1/qtcreator
tests/system/shared/hook_utils.py
6
21244
############################################################################# ## ## Copyright (C) 2015 The Qt Company Ltd. ## Contact: http://www.qt.io/licensing ## ## This file is part of Qt Creator. ## ## Commercial License Usage ## Licensees holding valid commercial Qt licenses may use this file in ## accordance wit...
lgpl-2.1
peterm-itr/edx-platform
common/djangoapps/user_api/tests/test_profile_api.py
2
8141
# -*- coding: utf-8 -*- """ Tests for the profile API. """ from django.contrib.auth.models import User from django.test import TestCase import ddt from django.test.utils import override_settings from nose.tools import raises from dateutil.parser import parse as parse_datetime from xmodule.modulestore.tests.factories i...
agpl-3.0
mclarkelauer/AndroidAnalyzer
log.py
1
1320
__author__ = 'Matt Clarke-Lauer' __email__ = 'matt@clarkelauer.com' __credits__ = ['Matt Clarke-Lauer'] __date__ = 7 / 1 / 13 __version__ = '0.1' __status__ = 'Development' from datetime import datetime import os,sys,profile,traceback import pickle import inspect logString = "[DexScope:" logLevel = { 0:{"Type":...
bsd-3-clause
amrdraz/kodr
app/brython/www/src/Lib/jqueryui/__init__.py
18
3679
"""Wrapper around the jQuery UI library Exposes a single object, jq, to manipulate the widgets designed in the library This object supports : - subscription : js[elt_id] returns an object matching the element with the specified id - a method get(**kw). The only keyword currently supported is "selector". The metho...
mit
31415us/trajectory
py/env/lib/python2.7/site-packages/pip/vendor/distlib/_backport/tarfile.py
1005
92627
#------------------------------------------------------------------- # tarfile.py #------------------------------------------------------------------- # Copyright (C) 2002 Lars Gustaebel <lars@gustaebel.de> # All rights reserved. # # Permission is hereby granted, free of charge, to any person # obtaining a copy ...
mit
openhatch/oh-mainline
vendor/packages/Django/django/views/generic/list.py
99
6695
from __future__ import unicode_literals from django.core.paginator import Paginator, InvalidPage from django.core.exceptions import ImproperlyConfigured from django.http import Http404 from django.utils.translation import ugettext as _ from django.views.generic.base import TemplateResponseMixin, ContextMixin, View c...
agpl-3.0
aerialist/scikit-rf
skrf/network2.py
4
31537
from six.moves import xrange # for Python3 compatibility from .frequency import Frequency from .mathFunctions import * from .plotting import plot_complex_rectangular,plot_rectangular, smith from .util import get_fid, get_extn, find_nearest_index,slice_domain from scipy import signal import numpy as npy from numpy i...
bsd-3-clause
pexip/os-python-suds-jurko
suds/serviceproxy.py
3
2895
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will b...
lgpl-3.0