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
gsobczyk/hamster
waflib/extras/bjam.py
60
3893
#! /usr/bin/env python # per rosengren 2011 from os import sep, readlink from waflib import Logs from waflib.TaskGen import feature, after_method from waflib.Task import Task, always_run def options(opt): grp = opt.add_option_group('Bjam Options') grp.add_option('--bjam_src', default=None, help='You can find it in ...
gpl-3.0
bofm/emmet-sublime
emmet/semver.py
19
2471
# -*- coding: utf-8 -*- import re _REGEX = re.compile('^(?P<major>[0-9]+)' '\.(?P<minor>[0-9]+)' '(\.(?P<patch>[0-9]+))?' '(\-(?P<prerelease>[0-9A-Za-z]+(\.[0-9A-Za-z]+)*))?' '(\+(?P<build>[0-9A-Za-z]+(\.[0-9A-Za-z]+)*))?$') if 'cmp' not...
mit
cemc/cscircles-wp-content
lesson_files/graders/pendulum-grader.py
1
1075
# based on real-per-line.py from _UTILITIES import _code def f(): for i in range(0, len(ExpectedLines)): if len(OutputLines)<=i: return "N"+_("Not enough lines of output: {0} expected, {1} found").format(str(len(ExpectedLines)), ...
gpl-3.0
xpansa/server-tools
qweb_usertime/__openerp__.py
23
1508
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2015 Savoir-faire Linux # (<http://www.savoirfairelinux.com>). # # This program is free software: you can redistribute it and/or m...
agpl-3.0
justinpotts/mozillians
vendor-local/lib/python/kombu/log.py
13
4164
from __future__ import absolute_import import os import logging import sys from .utils import cached_property from .utils.compat import WatchedFileHandler from .utils.encoding import safe_repr, safe_str from .utils.functional import maybe_promise __all__ = ["LogMixin", "LOG_LEVELS", "get_loglevel", "setup_logging"] ...
bsd-3-clause
aam-at/tensorflow
tensorflow/python/saved_model/model_utils/export_test.py
14
13084
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
BadgerMaps/django-allauth
allauth/socialaccount/providers/weibo/tests.py
71
1182
from allauth.socialaccount.tests import create_oauth2_tests from allauth.tests import MockedResponse from allauth.socialaccount.providers import registry from .provider import WeiboProvider class WeiboTests(create_oauth2_tests(registry.by_id(WeiboProvider.id))): def get_mocked_response(self): return Mocke...
mit
c72578/poedit
deps/boost/tools/build/src/build/property.py
7
23372
# Status: ported, except for tests. # Base revision: 64070 # # Copyright 2001, 2002, 2003 Dave Abrahams # Copyright 2006 Rene Rivera # Copyright 2002, 2003, 2004, 2005, 2006 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENS...
mit
caiostringari/swantools
test.py
1
2740
import swantools.io import swantools.utils import swantools.plot import datetime import matplotlib.pyplot as plt import numpy as np def readtable(): R = swantools.io.SwanIO() P = swantools.plot.SwanPlot() # Reading TABLE dada with headers: df = R.read_swantable('data/table.txt') y = df["Hsig...
gpl-2.0
uw-it-cte/uw-restclients
restclients/test/kws/key.py
2
1974
from django.test import TestCase from django.conf import settings from restclients.kws import KWS from restclients.exceptions import DataFailureException class KWSTestKeyData(TestCase): def test_key_by_id(self): with self.settings( RESTCLIENTS_KWS_DAO_CLASS='restclients.dao_implementation....
apache-2.0
mou4e/zirconium
third_party/protobuf/python/google/protobuf/descriptor.py
228
26625
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
bsd-3-clause
SuperDARNCanada/placeholderOS
tools/testing_utils/experiments/experiment_unittests.py
2
7629
""" Test module for the experiment_handler/experiment_prototype code. It is run simply via 'python3 experiment_unittests.py' and will go through all tests in the experiment_tests.csv file as well as the hardcoded tests here that don't fit nicely into a csv file. The csv file format is: [#][experiment file module impor...
gpl-3.0
sargas/scipy
scipy/sparse/linalg/eigen/lobpcg/lobpcg.py
4
18421
""" Pure SciPy implementation of Locally Optimal Block Preconditioned Conjugate Gradient Method (LOBPCG), see http://www-math.cudenver.edu/~aknyazev/software/BLOPEX/ License: BSD Authors: Robert Cimrman, Andrew Knyazev Examples in tests directory contributed by Nils Wagner. """ from __future__ import division, prin...
bsd-3-clause
DCSaunders/tensorflow
tensorflow/contrib/framework/python/ops/ops.py
74
2164
# Copyright 2015 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
rcalsaverini/dictUtils
__init__.py
1
1573
def keyset(d): return set(d.keys()) def union(d1, d2): return keyset(d1).union(keyset(d2)) def zip(d1, d2, std = None): """ Return a dictionary of tuples by putting together values with the same keys. Ex.: > zip({'name': "John", 'age': 20, 'favoriteMovie': "Godfather"}, {'name': "Mary", 'age': 26}, ...
mit
numenta/nupic.research
projects/dynamic_sparse/experiments/test_customresnet.py
2
1950
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2019, 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
stackforge/monasca-notification
monasca_notification/conf/keystone.py
2
2004
# Copyright 2017 FUJITSU LIMITED # # 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 writ...
apache-2.0
tpsatish95/OCR-on-Indus-Seals
code/Test/TextROI.py
1
16306
# -*- coding: utf-8 -*- import skimage.io import matplotlib.pyplot as plt import matplotlib.patches as mpatches import selectivesearch import numpy as np import skimage.transform import os import shutil import caffe from PIL import Image candidates = set() merged_candidates = set() refined = set() final = set() final_...
apache-2.0
canaltinova/servo
tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/executors/executorselenium.py
5
12945
import json import os import socket import sys import threading import time import traceback import urlparse import uuid from .base import (CallbackHandler, RefTestExecutor, RefTestImplementation, TestharnessExecutor, extra_timeout, ...
mpl-2.0
LukeM12/samba
lib/testtools/testtools/tags.py
14
1070
# Copyright (c) 2012 testtools developers. See LICENSE for details. """Tag support.""" class TagContext(object): """A tag context.""" def __init__(self, parent=None): """Create a new TagContext. :param parent: If provided, uses this as the parent context. Any tags that are curr...
gpl-3.0
tersmitten/ansible
lib/ansible/modules/network/aci/mso_site.py
19
6225
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Dag Wieers (@dagwieers) <dag@wieers.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_ve...
gpl-3.0
mcardacci/tools_of_the_dark_arts
droopescan/dscan/common/plugins_util.py
6
4208
from cement.core import handler from dscan.common import file_len, VersionsFile from dscan.plugins.internal.base_plugin import BasePlugin import dscan import dscan.plugins import pkgutil import subprocess _base_plugins = None _rfu = None _vf = None def plugins_get(): plugins = plugins_base_get() return_plugi...
gpl-3.0
MIPS/external-chromium_org
chrome/test/functional/youtube.py
68
8918
#!/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. import re import time import pyauto_functional import pyauto import pyauto_errors import test_utils class YoutubeTestHelper(): ...
bsd-3-clause
juhans/ardupilot
mk/PX4/Tools/genmsg/test/test_genmsg_command_line.py
216
1937
# Software License Agreement (BSD License) # # Copyright (c) 2011, 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 the above...
gpl-3.0
smunaut/gnuradio
grc/base/ParseXML.py
4
4000
""" Copyright 2008 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion 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-3.0
garg10may/youtube-dl
youtube_dl/extractor/slideshare.py
126
2003
from __future__ import unicode_literals import re import json from .common import InfoExtractor from ..compat import ( compat_urlparse, ) from ..utils import ( ExtractorError, ) class SlideshareIE(InfoExtractor): _VALID_URL = r'https?://www\.slideshare\.net/[^/]+?/(?P<title>.+?)($|\?)' _TEST = { ...
unlicense
MattsFleaMarket/python-for-android
python-modules/twisted/twisted/internet/test/test_base.py
56
8160
# Copyright (c) 2009 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.internet.base}. """ import socket from Queue import Queue from zope.interface import implements from twisted.python.threadpool import ThreadPool from twisted.python.util import setIDFunction from twisted.internet.in...
apache-2.0
wolfgangz2013/rt-thread
tools/mkdist.py
1
14164
# # File : mkdir.py # This file is part of RT-Thread RTOS # COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team # # 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 th...
apache-2.0
flyher/pymo
android/pgs4a-0.9.6/python-install/lib/python2.7/sqlite3/dbapi2.py
161
2615
#-*- coding: ISO-8859-1 -*- # pysqlite2/dbapi2.py: the DB-API 2.0 interface # # Copyright (C) 2004-2005 Gerhard Häring <gh@ghaering.de> # # This file is part of pysqlite. # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # aris...
mit
GeoCat/QGIS
scripts/parse_dash_results.py
8
14485
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ ****************************3*********************************************** parse_dash_results.py --------------------- Date : October 2016 Copyright : (C) 2016 by Nyall Dawson Email : nyall dot dawson at ...
gpl-2.0
dischinator/pyload
module/plugins/crypter/HoerbuchIn.py
2
2738
# -*- coding: utf-8 -*- import re import BeautifulSoup from module.plugins.internal.Crypter import Crypter class HoerbuchIn(Crypter): __name__ = "HoerbuchIn" __type__ = "crypter" __version__ = "0.66" __status__ = "testing" __pattern__ = r'http://(?:www\.)?hoerbuch\.us/(wp/horbucher/\d+/|tp...
gpl-3.0
silklabs/silk
node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py
2710
5094
# 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. """Visual Studio user preferences file writer.""" import os import re import socket # for gethostname import gyp.common import gyp.easy_xml as easy_xml #------...
mit
krishnab-datakind/mining-data-acquisition
data_gather/HandlerAssignEEEngineToRequest.py
1
1833
#!/usr/bin/python """ Handler to assign Earth Engine Engine to request. """ ## MIT License ## ## Copyright (c) 2017, krishna bhogaonker ## 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 wi...
mit
hasteur/g13bot_tools
families/wiktionary_family.py
3
31177
# -*- coding: utf-8 -*- import family __version__ = '$Id$' # The Wikimedia family that is known as Wiktionary class Family(family.WikimediaFamily): def __init__(self): super(Family, self).__init__() self.name = 'wiktionary' self.languages_by_size = [ 'en', 'mg', 'fr', 'zh', ...
gpl-2.0
mfraezz/osf.io
admin_tests/utilities.py
30
1197
""" Utilities to help run Django tests * setup_view - replaces as_view """ from osf_tests.factories import UserFactory def setup_view(view, request, *args, **kwargs): """Mimic as_view() returned callable, but returns view instance http://tech.novapost.fr/django-unit-test-your-views-en.html """ view.r...
apache-2.0
liuzzfnst/tp-libvirt
libvirt/tests/src/virsh_cmd/host/virsh_nodesuspend.py
7
5329
import time import logging from virttest import virsh from virttest import libvirt_vm from virttest.remote import LoginTimeoutError, LoginProcessTerminatedError from autotest.client.shared import error from autotest.client import utils class TimeoutError(Exception): """ Simple custom exception raised when ho...
gpl-2.0
fujunwei/chromium-crosswalk
third_party/tlslite/tlslite/utils/openssl_aes.py
202
1944
# Author: Trevor Perrin # See the LICENSE file for legal information regarding use of this file. """OpenSSL/M2Crypto AES implementation.""" from .cryptomath import * from .aes import * if m2cryptoLoaded: def new(key, mode, IV): return OpenSSL_AES(key, mode, IV) class OpenSSL_AES(AES): def ...
bsd-3-clause
jclakkis/discus-inferno
flaskenv/lib/python2.7/site-packages/setuptools/package_index.py
258
38941
"""PyPI and direct package downloading""" import sys import os import re import shutil import socket import base64 import hashlib from functools import wraps from pkg_resources import ( CHECKOUT_DIST, Distribution, BINARY_DIST, normalize_path, SOURCE_DIST, require, Environment, find_distributions, safe_name, s...
mit
drulang/nnw
nnw.py
1
1854
import sys import os mappings = { "a": [4, "@"], "b": ["13"], "c": ["("], "d": ["[)"], "e": [3], #"f": ["|="], "g": [6], #"h": ["|-|"], "i": [1, '!', "|"], #"j": [".]"], "k": ["|<"], "l": [1], "m": ['|Y|'], #"n": ["/\\/"], "o": [0], #"p": ["|>"], "q":...
gpl-2.0
Pikecillo/genna
external/4Suite-XML-1.0.2/test/Xml/XPath/Core/test_predicate_list.py
1
1939
from Ft.Xml import Domlette from xml.dom import Node source_1 = """<?xml version="1.0"?> <elementList> <element> <x> <y>a</y> </x> </element> <element> <x> <y>z</y> </x> </element> </elementList>""" def Test(tester): tester.startGroup('Predi...
gpl-2.0
jondo/shogun
examples/undocumented/python_modular/structure_graphcuts.py
14
8660
#!/usr/bin/env python import numpy as np import itertools from modshogun import Factor, TableFactorType, FactorGraph from modshogun import FactorGraphObservation, FactorGraphLabels, FactorGraphFeatures from modshogun import FactorGraphModel, GRAPH_CUT from modshogun import GraphCut from modshogun import StochasticSOS...
gpl-3.0
lindamar/ecclesi
env/lib/python2.7/site-packages/flask/app.py
47
83370
# -*- coding: utf-8 -*- """ flask.app ~~~~~~~~~ This module implements the central WSGI application object. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os import sys from threading import Lock from datetime import timedelta from itertools import ...
mit
apache/airflow
tests/models/test_pool.py
2
4794
# # 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
BlueBrain/NeuroM
examples/soma_radius_fit.py
2
3139
#!/usr/bin/env python # Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project # All rights reserved. # # This file is part of NeuroM <https://github.com/BlueBrain/NeuroM> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fo...
bsd-3-clause
chand3040/cloud_that
common/djangoapps/lang_pref/middleware.py
80
1121
""" Middleware for Language Preferences """ from openedx.core.djangoapps.user_api.preferences.api import get_user_preference from lang_pref import LANGUAGE_KEY # TODO PLAT-671 Import from Django 1.8 # from django.utils.translation import LANGUAGE_SESSION_KEY from django_locale.trans_real import LANGUAGE_SESSION_KEY ...
agpl-3.0
kevalds51/sympy
sympy/physics/vector/frame.py
47
27251
from sympy import (diff, trigsimp, expand, sin, cos, solve, Symbol, sympify, eye, ImmutableMatrix as Matrix) from sympy.core.compatibility import string_types, u, range from sympy.physics.vector.vector import Vector, _check_vector __all__ = ['CoordinateSym', 'ReferenceFrame'] class CoordinateSym(S...
bsd-3-clause
Centre-Alt-Rendiment-Esportiu/att
old_project/Python/win_libs/scipy/weave/common_info.py
100
4254
""" Generic support code for: error handling code found in every weave module local/global dictionary access code for inline() modules swig pointer (old style) conversion support """ from __future__ import absolute_import, print_function from . import base_info module_support_code = \ """ //...
gpl-3.0
mateor/pants
tests/python/pants_test/subsystem/subsystem_util.py
3
5795
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from contextlib impo...
apache-2.0
CalvinNeo/PyGeo
countpca_segmentation_2.py
1
7423
#coding:utf8 import numpy as np, scipy import pylab as pl import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import math from matplotlib import cm from matplotlib import mlab from matplotlib.ticker import LinearLocator, FormatStrFormatter from itertools import * import collections from multiproces...
apache-2.0
Gabriel0402/zulip
zerver/lib/unminify.py
115
1661
from __future__ import absolute_import import re import os.path import sourcemap class SourceMap(object): '''Map (line, column) pairs from generated to source file.''' def __init__(self, sourcemap_dir): self._dir = sourcemap_dir self._indices = {} def _index_for(self, minified_src): ...
apache-2.0
thomasem/nova
nova/tests/unit/scheduler/ironic_fakes.py
45
4222
# Copyright 2014 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
abhattad4/Digi-Menu
digimenu2/django/conf/locale/zh_CN/formats.py
634
1810
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'Y年n月j日' # 2016年9月5...
bsd-3-clause
thaim/ansible
test/units/modules/network/nxos/test_nxos_bgp.py
68
5391
# (c) 2016 Red Hat 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 # (at your option) any later version. # # Ansible is dis...
mit
SimVascular/VTK
ThirdParty/Twisted/twisted/spread/banana.py
60
11010
# -*- test-case-name: twisted.test.test_banana -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Banana -- s-exp based protocol. Future Plans: This module is almost entirely stable. The same caveat applies to it as applies to L{twisted.spread.jelly}, however. Read its future plans for ...
bsd-3-clause
wpoely86/easybuild-easyblocks
test/easyblocks/suite.py
1
3217
#!/usr/bin/python ## # Copyright 2012-2016 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # Flemish Re...
gpl-2.0
ocadotechnology/boto
tests/integration/s3/test_cert_verification.py
126
1532
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # 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 withou...
mit
seanfarley/pygit2
test/__init__.py
2
1719
# -*- coding: UTF-8 -*- # # Copyright 2010 Google, Inc. # # This file 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. # # In addition to the permissions in the GNU General Public License, # the aut...
gpl-2.0
lucasdavila/web2py-appreport
modules/plugin_appreport/libs/appreport/libs/pisa/libs/reportlab/src/reportlab/platypus/doctemplate.py
10
45792
#Copyright ReportLab Europe Ltd. 2000-2004 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/platypus/doctemplate.py __version__=''' $Id: doctemplate.py 3791 2010-09-29 19:37:05Z andy $ ''' __doc__=""" This module contains the core structure ...
lgpl-3.0
veger/ansible
lib/ansible/plugins/lookup/keyring.py
59
1901
# (c) 2016, Samuel Boucher <boucher.samuel.c@gmail.com> # (c) 2017 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 DOCUMENTATION = """ lookup: keyring author: ...
gpl-3.0
elit3ge/SickRage
sickbeard/providers/womble.py
7
2411
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage 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,...
gpl-3.0
robhudson/django
tests/select_related_onetoone/models.py
274
2483
from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class User(models.Model): username = models.CharField(max_length=100) email = models.EmailField() def __str__(self): return self.username @python_2_unicode_compatible class Us...
bsd-3-clause
KaiSzuttor/espresso
testsuite/python/rotational-diffusion-aniso.py
2
16657
# Copyright (C) 2019 The ESPResSo project # # This file is part of ESPResSo. # # ESPResSo 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 versio...
gpl-3.0
datalogics/scons
src/engine/SCons/JobTests.py
2
18800
# # __COPYRIGHT__ # # 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, # distribute, sublicen...
mit
suutari/shoop
shuup/importer/utils/importer.py
1
1117
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2016, Shoop Commerce Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. import os from django.conf import settings from django.utils.trans...
agpl-3.0
khchine5/atelier
atelier/sphinxconf/sigal_image.py
1
8318
# -*- coding: utf-8 -*- # Copyright 2014-2018 Rumma & Ko Ltd # License: BSD, see LICENSE for more details. """ Defines the :rst:dir:`sigal_image` directive. .. rst:directive:: sigal_image .. _picsel: https://github.com/lsaffre/picsel .. _Shotwell: https://en.wikipedia.org/wiki/Shotwell_%28software%29 .. _digiKam: ht...
bsd-2-clause
shhui/nova
nova/tests/api/openstack/compute/plugins/v3/test_lock_server.py
28
2235
# Copyright 2011 OpenStack Foundation # Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
chauhanhardik/populo
common/lib/xmodule/xmodule/tests/test_self_assessment.py
92
6785
from datetime import datetime import json import unittest from mock import Mock, MagicMock from webob.multidict import MultiDict from pytz import UTC from xblock.fields import ScopeIds from xmodule.open_ended_grading_classes.self_assessment_module import SelfAssessmentModule from opaque_keys.edx.locations import Locati...
agpl-3.0
amsehili/auditok
tests/test_AudioReader.py
1
30622
""" @author: Amine Sehili <amine.sehili@gmail.com> September 2015 """ import unittest from functools import partial import sys import wave from genty import genty, genty_dataset from auditok import ( dataset, ADSFactory, AudioDataSource, AudioReader, Recorder, BufferAudioSource, WaveAudioS...
mit
rnikiforova/GuruTubeProject
GuruTube/libraries/django/template/loaders/eggs.py
111
1205
# Wrapper for loading templates from eggs via pkg_resources.resource_string. from __future__ import unicode_literals try: from pkg_resources import resource_string except ImportError: resource_string = None from django.conf import settings from django.template.base import TemplateDoesNotExist from django.temp...
bsd-3-clause
cfei18/incubator-airflow
airflow/migrations/versions/338e90f54d61_more_logging_into_task_isntance.py
9
1613
# -*- 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, Version 2.0 (the #...
apache-2.0
mandeepdhami/nova
nova/api/openstack/compute/contrib/instance_actions.py
78
3879
# Copyright 2013 Rackspace Hosting # 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 require...
apache-2.0
alebcay/android_kernel_oneplus_msm8974
tools/perf/scripts/python/net_dropmonitor.py
1258
1562
# Monitor the system for dropped packets and proudce a report of drop locations and counts import os import sys sys.path.append(os.environ['PERF_EXEC_PATH'] + \ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') from perf_trace_context import * from Core import * from Util import * drop_log = {} kallsyms = [] def...
gpl-2.0
nicoboss/Floatmotion
pygame/tests/display_test.py
26
21778
if __name__ == '__main__': import sys import os pkg_dir = os.path.split(os.path.abspath(__file__))[0] parent_dir, pkg_name = os.path.split(pkg_dir) is_pygame_pkg = (pkg_name == 'tests' and os.path.split(parent_dir)[1] == 'pygame') if not is_pygame_pkg: sys.path.inser...
agpl-3.0
badloop/SickRage
lib/sqlalchemy/testing/config.py
76
2116
# testing/config.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 import collections requirements = None db = None db_url = None db_opts = None file_...
gpl-3.0
knabar/openmicroscopy
components/tools/OmeroWeb/omeroweb/feedback/templatetags/feedback_tags.py
15
1455
#!/usr/bin/env python # -*- coding: utf-8 -*- # # # # Copyright (c) 2008 University of Dundee. # # 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 ...
gpl-2.0
perlygatekeeper/glowing-robot
Little_Alchemy_2/Scraper_python/env/lib/python3.7/site-packages/requests/utils.py
28
30176
# -*- coding: utf-8 -*- """ requests.utils ~~~~~~~~~~~~~~ This module provides utility functions that are used within Requests that are also useful for external consumption. """ import codecs import contextlib import io import os import re import socket import struct import sys import tempfile import warnings import...
artistic-2.0
getredash/redash
redash/authentication/remote_user_auth.py
3
1814
import logging from flask import redirect, url_for, Blueprint, request from redash.authentication import ( create_and_login_user, logout_and_redirect_to_index, get_next_path, ) from redash.authentication.org_resolving import current_org from redash.handlers.base import org_scoped_rule from redash import set...
bsd-2-clause
yurac/python-docx
docx/image/image.py
12
8029
# encoding: utf-8 """ Provides objects that can characterize image streams as to content type and size, as a required step in including them in a document. """ from __future__ import absolute_import, division, print_function import hashlib import os from ..compat import BytesIO, is_string from .exceptions import Un...
mit
myarjunar/inasafe
safe/definitions/keyword_properties.py
1
9961
# coding=utf-8 """Definitions relating to layer keywords.""" from safe.utilities.i18n import tr __copyright__ = "Copyright 2016, The InaSAFE Project" __license__ = "GPL version 3" __email__ = "info@inasafe.org" __revision__ = '$Format:%H$' # Base Metadata Property property_organisation = { 'key': 'property_org...
gpl-3.0
syllog1sm/TextBlob
text/nltk/tokenize/__init__.py
2
3537
# -*- coding: utf-8 -*- # Natural Language Toolkit: Tokenizers # # Copyright (C) 2001-2013 NLTK Project # Author: Edward Loper <edloper@gradient.cis.upenn.edu> # Steven Bird <stevenbird1@gmail.com> (minor additions) # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT r""" NLTK Tokenizer Pa...
mit
olapaola/olapaola-android-scripting
python/src/Lib/multiprocessing/managers.py
52
34804
# # Module providing the `SyncManager` class for dealing # with shared objects # # multiprocessing/managers.py # # Copyright (c) 2006-2008, R Oudkerk --- see COPYING.txt # __all__ = [ 'BaseManager', 'SyncManager', 'BaseProxy', 'Token' ] # # Imports # import os import sys import weakref import threading import array ...
apache-2.0
suhe/odoo
addons/hr_payroll/wizard/hr_payroll_contribution_register_report.py
47
1128
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import time from datetime import datetime from dateutil import relativedelta from openerp.osv import fields, osv class payslip_lines_contribution_register(osv.osv_memory): _name = 'payslip.lines.contribution.regist...
gpl-3.0
naibaf7/PyGreentea
examples/2D_usk_malis_softmax/test.py
2
1619
from __future__ import print_function import sys, os, math import numpy as np import h5py from numpy import float32, int32, uint8, dtype from PIL import Image import glob # Load PyGreentea # Relative path to where PyGreentea resides pygt_path = '../..' sys.path.append(pygt_path) import pygreentea.pygreentea as pygt fr...
bsd-2-clause
dineshappavoo/ctgi
src/com/ctgi/google/problems/questions/Apple_interview_questions.gl.py
1
1710
ALGORITHMS: 1. Write code to sum 2 integer but u cant use a+b method, you have to use either ++ or --. How you will handle negative numbers [com.ctgi.google.problems.SumIntegersUsingSpecialOperator] 2. There are several words in a file. Get the occurrence of every word and sort it based on the occurrence, if more than...
mit
urbansearchTUD/UrbanSearch
tests/utils/test_db_utils.py
1
10060
import time import pytest import config from urbansearch.utils import db_utils OCCURS_IN = config.get('neo4j', 'occurs_in_name') RELATES_TO = config.get('neo4j', 'relates_to_name') if not ('TEST' in OCCURS_IN and 'TEST' in RELATES_TO): raise ValueError('Not adjusting production DB! {} {}'.format(RELATES_TO, ...
gpl-3.0
dabercro/CrombieTools
python/CrombieTools/AnalysisTools/LimitTreeMaker.py
1
1169
""" @todo Clean up the LimitTreeMaker python file to not depend on these extra variables in cuts.py """ import os from .. import Load, DirFromEnv newLimitTreeMaker = Load('LimitTreeMaker') def SetupFromEnv(ltm): """A function that sets up the LimitTreeMaker after sourcing a config file @param ltm The Limit...
mit
amenonsen/ansible
lib/ansible/module_utils/network/vyos/argspec/l3_interfaces/l3_interfaces.py
23
2969
# # -*- coding: utf-8 -*- # Copyright 2019 Red Hat # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ############################################# # WARNING # ############################################# # # This file is auto generated by ...
gpl-3.0
fmacias64/deap
examples/es/cma_plotting.py
12
4326
# This file is part of DEAP. # # DEAP 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 3 of # the License, or (at your option) any later version. # # DEAP is distributed ...
lgpl-3.0
qPCR4vir/orange
Orange/OrangeCanvas/application/tutorials/__init__.py
6
3434
""" Orange Canvas Tutorial schemes """ import os import io import logging import types import collections from itertools import chain import pkg_resources log = logging.getLogger(__name__) def list_schemes(package): """Return a list of scheme tutorials. """ resources = pkg_resources.resource_listdir(pa...
gpl-3.0
kamotos/django-storages
storages/backends/database.py
10
5252
# DatabaseStorage for django. # 2009 (c) GameKeeper Gambling Ltd, Ivanov E. from django.conf import settings from django.core.files import File from django.core.exceptions import ImproperlyConfigured from storages.compat import urlparse, BytesIO, Storage try: import pyodbc except ImportError: raise Improperl...
bsd-3-clause
chauhanhardik/populo
common/lib/xmodule/xmodule/modulestore/store_utilities.py
124
4490
import re import logging from collections import namedtuple import uuid def _prefix_only_url_replace_regex(pattern): """ Match urls in quotes pulling out the fields from pattern """ return re.compile(ur""" (?x) # flags=re.VERBOSE (?P<quote>\\?['"]) # the op...
agpl-3.0
maartenq/ansible
lib/ansible/parsing/utils/yaml.py
96
2809
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # Copyright: (c) 2017, Ansible Project # Copyright: (c) 2018, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_f...
gpl-3.0
andela-ooladayo/django
tests/sitemaps_tests/test_http.py
205
10731
from __future__ import unicode_literals import os from datetime import date from unittest import skipUnless from django.apps import apps from django.conf import settings from django.contrib.sitemaps import GenericSitemap, Sitemap from django.contrib.sites.models import Site from django.core.exceptions import Improper...
bsd-3-clause
nburn42/tensorflow
tensorflow/contrib/learn/python/learn/estimators/regression_test.py
137
1879
# 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
shovalsa/shecodes_website
scsite/forms.py
1
1664
from django import forms from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.models import User from django.forms import ModelForm from .models import Profile from django.utils.translation import ugettext_lazy as _ class SignUpForm(UserCreationForm): first_name = forms.CharField(max_len...
apache-2.0
Peerapps/Peerapps
bitcoin/bloom.py
18
6091
# Copyright (C) 2013-2014 The python-bitcoinlib developers # # This file is part of python-bitcoinlib. # # It is subject to the license terms in the LICENSE file found in the top-level # directory of this distribution. # # No part of python-bitcoinlib, including this file, may be copied, modified, # propagated, or dist...
mit
binarydud/django-oscar
src/oscar/apps/dashboard/app.py
34
2262
from django.conf.urls import url, include from oscar.core.application import Application from oscar.core.loading import get_class class DashboardApplication(Application): name = 'dashboard' permissions_map = { 'index': (['is_staff'], ['partner.dashboard_access']), } index_view = get_class('d...
bsd-3-clause
csm0042/rpihome_v3
rpihome_v3/helpers/log_support.py
1
2439
#!/usr/bin/python3 """ logging.py: Log file setup helper functions """ # Import Required Libraries (Standard, Third Party, Local) ******************** import logging import logging.handlers import os import sys # Authorship Info ************************************************************* __author__ = "Christopher ...
gpl-3.0
kamalx/edx-platform
cms/djangoapps/contentstore/features/course-export.py
62
2771
# pylint: disable=missing-docstring # pylint: disable=redefined-outer-name # pylint: disable=unused-argument from lettuce import world, step from component_settings_editor_helpers import enter_xml_in_advanced_problem from nose.tools import assert_true, assert_equal from contentstore.utils import reverse_usage_url @s...
agpl-3.0
sungmaster/teajudge
sandbox/pysandbox/packages/sandbox/__init__.py
2
9491
################################################################################ # The Sandbox Libraries (Python) Package Initializer # # # # Copyright (C) 2004-2009, 2011-2013 LIU Yu, pineapple.liu@gmail.com ...
mit