repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
FlashGordon95/Financial-Portfolio-Flask
venv/lib/python2.7/site-packages/werkzeug/contrib/testtools.py
365
2453
# -*- coding: utf-8 -*- """ werkzeug.contrib.testtools ~~~~~~~~~~~~~~~~~~~~~~~~~~ This module implements extended wrappers for simplified testing. `TestResponse` A response wrapper which adds various cached attributes for simplified assertions on various content types. :copyright:...
mit
devonjones/docopt
examples/options_example.py
18
1597
"""Example of program with many options using docopt. Usage: options_example.py [-hvqrf NAME] [--exclude=PATTERNS] [--select=ERRORS | --ignore=ERRORS] [--show-source] [--statistics] [--count] [--benchmark] PATH... options_example.py (--doctest | --testsuite=DIR) options_...
mit
IllusionRom-deprecated/android_platform_external_chromium_org
ppapi/generators/idl_lexer.py
62
9292
#!/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. """ Lexer for PPAPI IDL """ # # IDL Lexer # # The lexer is uses the PLY lex library to build a tokenizer which understands # WebID...
bsd-3-clause
AMechler/AliPhysics
PWGJE/EMCALJetTasks/Tracks/analysis/util/Interpolator.py
41
5082
#************************************************************************** #* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. * #* * #* Author: The ALICE Off-line Project. * #* Contributors ...
bsd-3-clause
jfchevrette/ansible-modules-core
packaging/language/easy_install.py
198
6956
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Matt Wright <matt@nobien.net> # # 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...
gpl-3.0
paulpc/nyx
nyx.py
1
7109
#!/usr/bin/python import ConfigParser import syslog import json import requests import time from common_methods import * import crits import qradar from bro import * from web_proxy import * import palo_alto if __name__ == "__main__": # reading the settings - upon successful read, the functionality will be ...
mit
andoma/movian
ext/libyuv/tools/valgrind-libyuv/tsan/PRESUBMIT.py
199
1418
#!/usr/bin/env python # Copyright (c) 2012 The LibYuv 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 in the root of the source # tree. An additional intellectual property rights grant can be found # in the file PATENTS. All c...
gpl-3.0
asimshankar/tensorflow
tensorflow/python/ops/parallel_for/pfor.py
6
106518
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
prasanna08/oppia
core/domain/role_services.py
1
12784
# coding: utf-8 # # Copyright 2017 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
apache-2.0
2coding/Codec
thirdparty/gtest-1.6.0/test/gtest_catch_exceptions_test.py
5
9532
#!/usr/bin/env python # # Copyright 2010 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...
bsd-3-clause
bitmonk/rdiff-backup
testing/fs_abilitiestest.py
4
3206
import unittest, os, time from commontest import * from rdiff_backup import Globals, rpath, fs_abilities class FSAbilitiesTest(unittest.TestCase): """Test testing of file system abilities Some of these tests assume that the actual file system tested has the given abilities. If the file system this is run on diffe...
gpl-2.0
twobob/buildroot-kindle
output/build/host-python-2.7.2/Tools/pybench/Imports.py
45
2947
from pybench import Test # First imports: import os import package.submodule class SecondImport(Test): version = 2.0 operations = 5 * 5 rounds = 40000 def test(self): for i in xrange(self.rounds): import os import os import os import os ...
gpl-2.0
CloudByteStorages/openstack
liberty/cloudbyte/cloudbyte130.py
2
11683
# Copyright 2015 CloudByte Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
apache-2.0
hoosteeno/fjord
vendor/src/html5lib-python/html5lib/inputstream.py
4
31641
from __future__ import absolute_import, division, unicode_literals from six import text_type from six.moves import http_client import codecs import re from .constants import EOF, spaceCharacters, asciiLetters, asciiUppercase from .constants import encodings, ReparseException from . import utils from io import String...
bsd-3-clause
seadas/beam
beam-python/src/main/resources/beampy-examples/beampy_flh.py
2
1866
import sys import numpy from beampy import String from beampy import Product from beampy import ProductData from beampy import ProductIO from beampy import ProductUtils if len(sys.argv) != 2: print("usage: %s <file>" % sys.argv[0]); sys.exit(1) # Uncomment if you receive errors of type com.sun.media.jai.uti...
gpl-3.0
MQQiang/kbengine
kbe/src/lib/python/Lib/test/test_threaded_import.py
72
8337
# This is a variant of the very old (early 90's) file # Demo/threads/bug.py. It simply provokes a number of threads into # trying to import the same module "at the same time". # There are no pleasant failure modes -- most likely is that Python # complains several times about module random having no attribute # randran...
lgpl-3.0
matham/vet_cond
vet_cond/stages.py
1
15991
# -*- coding: utf-8 -*- '''Stages =========== The stages of the experiment. ''' from time import strftime from os.path import isfile from functools import partial from moa.utils import ObjectStateTracker from kivy.properties import ( ObjectProperty, ListProperty, ConfigParserProperty, NumericPrope...
mit
coolsvap/kolla
docker/kolla-toolbox/kolla_keystone_service.py
5
3811
#!/usr/bin/python # Copyright 2015 Sam Yaple # # 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 agree...
apache-2.0
konefalg/whylog
whylog/assistant/regex_assistant/guessing.py
5
1441
import re import six from whylog.assistant.pattern_match import ParamGroup, PatternMatch from whylog.assistant.regex_assistant.regex import ( create_obvious_regex, regex_from_group_spans, verify_regex ) from whylog.assistant.spans_finding import find_date_spans def guess_pattern_match(text): pattern_match_w...
bsd-3-clause
mtougeron/python-openstacksdk
examples/object_store.py
2
3627
# 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, software # distributed under t...
apache-2.0
nemesisdesign/django
django/utils/translation/template.py
58
10193
from __future__ import unicode_literals import re import warnings from django.template.base import ( TOKEN_BLOCK, TOKEN_COMMENT, TOKEN_TEXT, TOKEN_VAR, TRANSLATOR_COMMENT_MARK, Lexer, ) from django.utils import six from django.utils.encoding import force_text from django.utils.six import StringIO from . impo...
bsd-3-clause
fantastic4ever/project2
project_main/gateway/routes.py
1
16754
from flask import Flask, render_template, request, flash, session, redirect, url_for, jsonify, Response import urllib import logging import json import boto3 import sys import os.path from pymongo import MongoClient import hashlib import time import simplejson as json sys.path.append(os.path.abspath(__file__ + '../../...
apache-2.0
2014cdag9/2014cdag9
wsgi/static/Brython2.1.0-20140419-113919/Lib/xml/dom/domreg.py
841
3402
"""Registration facilities for DOM. This module should not be used directly. Instead, the functions getDOMImplementation and registerDOMImplementation should be imported from xml.dom.""" # This is a list of well-known implementations. Well-known names # should be published by posting to xml-sig@python.org, and are # ...
gpl-2.0
fkorotkov/pants
src/python/pants/engine/round_engine.py
5
9667
# 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 os from colle...
apache-2.0
molobrakos/home-assistant
tests/components/mqtt/test_subscription.py
3
5713
"""The tests for the MQTT subscription component.""" from unittest import mock from homeassistant.components.mqtt.subscription import ( async_subscribe_topics, async_unsubscribe_topics) from homeassistant.core import callback from tests.common import async_fire_mqtt_message, async_mock_mqtt_component async def ...
apache-2.0
yoyokko/syncless
syncless/reactor.py
5
7798
#! /usr/local/bin/python2.4 """A Syncless-based implementation of the Twisted main loop. This Python module was written by reusing the source code of libevent.reactor v0.3, available from http://launchpad.net/python-libevent (simple BSD license). To install the event loop (and you should do this before any connectio...
apache-2.0
caphrim007/ansible
lib/ansible/modules/cloud/misc/rhevm.py
4
51120
#!/usr/bin/python # (c) 2016, Timothy Vandenbrande <timothy.vandenbrande@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
woggle/mesos-old
frameworks/hadoop-0.20.2/src/contrib/hod/testing/testModule.py
182
2187
#Licensed to the Apache Software Foundation (ASF) under one #or more contributor license agreements. See the NOTICE file #distributed with this work for additional information #regarding copyright ownership. The ASF licenses this file #to you under the Apache License, Version 2.0 (the #"License"); you may not use thi...
apache-2.0
brandonrobertz/namecoin-core
test/functional/wallet.py
1
21617
#!/usr/bin/env python3 # Copyright (c) 2014-2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the wallet.""" from test_framework.test_framework import BitcoinTestFramework from test_framework....
mit
OpenUpgrade-dev/OpenUpgrade
addons/purchase/migrations/8.0.1.1/pre-migration.py
13
1181
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2014 Therp BV # # 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 Fo...
agpl-3.0
apostolosSotiropoulos/interQuepy
quepy/quepyapp.py
1
5679
# coding: utf-8 # Copyright (c) 2012, Machinalis S.R.L. # This file is part of quepy and is distributed under the Modified BSD License. # You should have received a copy of license in the LICENSE file. # # Authors: Rafael Carrascosa <rcarrascosa@machinalis.com> # Gonzalo Garcia Berrotaran <ggarcia@machinalis....
bsd-3-clause
Code0x58/python-jsonstore
test_jsonstore.py
1
11119
#!/usr/bin/env python # -*- encoding: utf-8 -*- from __future__ import absolute_import import json import os import unittest from tempfile import mktemp from jsonstore import JsonStore class TransactionBreaker(Exception): pass class Tests(unittest.TestCase): TEST_DATA = ( ("string", "hello"), ...
mit
sauhaardac/training
nets/eric/nonsqueeze/TimeLSTM.py
1
5681
"""SqueezeNet 1.1 modified for LSTM regression.""" import logging import torch import torch.nn as nn import torch.nn.init as init from torch.autograd import Variable logging.basicConfig(filename='training.log', level=logging.DEBUG) # from Parameters import ARGS class Fire(nn.Module): # pylint: disable=too-few-pu...
mit
eginer/quantum_package
scripts/ezfio_interface/qp_convert_output_to_ezfio.py
3
12989
#!/usr/bin/env python2 """ convert output of gamess/GAU$$IAN to ezfio Usage: qp_convert_output_to_ezfio.py <file.out> [-o <ezfio_directory>] Option: file.out is the file to check (like gamess.out) folder.ezfio is the name you whant for the ezfio (by default is file.out.ezfio) """ import sys impo...
gpl-2.0
zhangjl/python-learn-notes
src/constant.py
2
1553
""" Constant types in Python. """ __doc__ = """ This is a variation on "Constants in Python" by Alex Martelli, from which the solution idea was borrowed, and enhanced according suggestions of Zoran Isailovski. In Python, any variable can be re-bound at will -- and modules don't let you define special methods such as a...
gpl-2.0
bcarroll/authmgr
python-3.6.2-Win64/Lib/site-packages/alembic/operations/ops.py
5
73828
from .. import util from ..util import sqla_compat from . import schemaobj from sqlalchemy.types import NULLTYPE from .base import Operations, BatchOperations import re class MigrateOperation(object): """base class for migration command and organization objects. This system is part of the operation extensibi...
bsd-3-clause
lonetwin/pydown
setup.py
2
2243
import sys import subprocess try: from setuptools import setup, find_packages except ImportError: from distutils.core import setup from distutils.util import convert_path def _find_packages(where='.', exclude=()): """Return a list all Python packages found within directory 'where' 'wh...
mit
cpennington/edx-platform
common/lib/xmodule/xmodule/capa_base.py
1
72416
"""Implements basics of Capa, including class CapaModule.""" import copy import datetime import hashlib import json import logging import os import re import struct import sys import traceback import six from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.encodi...
agpl-3.0
stannynuytkens/youtube-dl
youtube_dl/extractor/restudy.py
28
1351
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor class RestudyIE(InfoExtractor): _VALID_URL = r'https?://(?:(?:www|portal)\.)?restudy\.dk/video/[^/]+/id/(?P<id>[0-9]+)' _TESTS = [{ 'url': 'https://www.restudy.dk/video/play/id/1637', 'info_dict': { ...
unlicense
yokose-ks/edx-platform
lms/envs/bok_choy.py
13
2574
""" Settings for bok choy tests """ import os from path import path CONFIG_ROOT = path(__file__).abspath().dirname() # pylint: disable=E1120 TEST_ROOT = CONFIG_ROOT.dirname().dirname() / "test_root" ########################## Prod-like settings ################################### # These should be as close as poss...
agpl-3.0
ClearCorp-dev/management-system
__unported__/mgmtsystem_audit/mgmtsystem_audit.py
4
6352
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>). # # This program is free software: you can redistribute it and/or modify # it und...
agpl-3.0
163gal/Time-Line
libs_arm/wx/lib/mixins/imagelist.py
3
2560
#---------------------------------------------------------------------------- # Name: wx.lib.mixins.imagelist # Purpose: Helpful mix-in classes for using a wxImageList # # Author: Robin Dunn # # Created: 15-May-2001 # RCS-ID: $Id$ # Copyright: (c) 2001 by Total Control Software # Licence: ...
gpl-3.0
thewtex/ITK
Modules/ThirdParty/pygccxml/src/pygccxml/declarations/scopedef.py
7
39841
# Copyright 2014-2017 Insight Software Consortium. # Copyright 2004-2009 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. # See http://www.boost.org/LICENSE_1_0.txt """Defines :class:`scopedef_t` class""" import timeit try: from collections.abc import Callable except ImportError: ...
apache-2.0
Technocaveman/There-is-no-Third-Step
node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/scanner.py
365
3114
# -*- coding: utf-8 -*- """ pygments.scanner ~~~~~~~~~~~~~~~~ This library implements a regex based scanner. Some languages like Pascal are easy to parse but have some keywords that depend on the context. Because of this it's impossible to lex that just by using a regular expression lexer like ...
mit
zorroz/microblog
flask/lib/python2.7/site-packages/whoosh/lang/snowball/dutch.py
96
6194
from .bases import _StandardStemmer from whoosh.compat import u class DutchStemmer(_StandardStemmer): """ The Dutch Snowball stemmer. :cvar __vowels: The Dutch vowels. :type __vowels: unicode :cvar __step1_suffixes: Suffixes to be deleted in step 1 of the algorithm. :type __step1_suffixes: t...
bsd-3-clause
ar7z1/ansible
test/units/modules/network/dellos6/test_dellos6_facts.py
56
4457
# (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...
gpl-3.0
zakuro9715/lettuce
tests/integration/lib/Django-1.3/django/contrib/localflavor/us/us_states.py
355
7655
""" A mapping of state misspellings/abbreviations to normalized abbreviations, and alphabetical lists of US states, territories, military mail regions and non-US states to which the US provides postal service. This exists in this standalone file so that it's only imported into memory when explicitly needed. """ # The...
gpl-3.0
embeddedarm/android_external_chromium_org
chrome/common/extensions/docs/server2/instance_servlet_test.py
81
2111
#!/usr/bin/env python # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest from github_file_system_provider import GithubFileSystemProvider from instance_servlet import InstanceServlet from ser...
bsd-3-clause
probablytom/tomwallis.net
venv/lib/python2.7/site-packages/django/contrib/gis/tests/geoadmin/tests.py
61
2485
from __future__ import unicode_literals from unittest import skipUnless from django.contrib.gis.geos import HAS_GEOS from django.contrib.gis.tests.utils import HAS_SPATIAL_DB from django.test import TestCase if HAS_GEOS and HAS_SPATIAL_DB: from django.contrib.gis import admin from django.contrib.gis.geos imp...
artistic-2.0
onepercentclub/onepercentclub-site
apps/fund/urls/api.py
1
2697
from apps.core.views import LatestDonationsList from apps.fund.views import RecurringOrderList, RecurringOrderDetail, RecurringDonationList, RecurringDonationDetail, \ ProjectDonationList, ProjectSupporterList from django.conf.urls import patterns, include, url from surlex.dj import surl from ..views import OrderLi...
bsd-3-clause
dyermd/legos
bio/transposon/transposonSite.py
1
6076
## @package TransposonSite # # This class is responsible for managing data for a transposon site import unittest __author__ = 'mattdyer' class TransposonSite: __codingCoverage = {} __reverseCoverage = {} __samples = {} __distance = 0 ## The constructor # @param self The object pointer # ...
gpl-2.0
dednal/chromium.src
third_party/pycoverage/coverage/backward.py
211
5187
"""Add things to old Pythons so I can pretend they are newer.""" # This file does lots of tricky stuff, so disable a bunch of lintisms. # pylint: disable=F0401,W0611,W0622 # F0401: Unable to import blah # W0611: Unused import blah # W0622: Redefining built-in blah import os, re, sys # Python 2.3 doesn't have `set` t...
bsd-3-clause
supriyantomaftuh/syzygy
syzygy/build/get_syzygy_binaries.py
1
18112
#!/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. """A utility script for downloading versioned Syzygy binaries.""" import hashlib import errno import json import logging import optpar...
apache-2.0
technologiescollege/s2a_fr
s2a/Python/Lib/wsgiref/handlers.py
137
15982
"""Base classes for server/gateway implementations""" from types import StringType from util import FileWrapper, guess_scheme, is_hop_by_hop from headers import Headers import sys, os, time __all__ = ['BaseHandler', 'SimpleHandler', 'BaseCGIHandler', 'CGIHandler'] try: dict except NameError: def dict(items)...
gpl-3.0
JosephViolago/lineup
lineup.py
1
3293
from bs4 import BeautifulSoup import requests from time import * from datetime import datetime, date, time, timedelta from collections import defaultdict import re import sys import json import pprint base = 'http://www.mysteryland.us' path = '/en/line-up/detailed-lineup/schedule' r = requests.get(base + path) ...
mit
HybridF5/jacket
jacket/tests/compute/unit/virt/hyperv/test_snapshotops.py
1
6776
# Copyright 2014 Cloudbase Solutions Srl # 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 r...
apache-2.0
marcusmueller/gnuradio
gr-digital/python/digital/qa_ofdm_txrx.py
6
7060
#!/usr/bin/env python # # Copyright 2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) ...
gpl-3.0
BrotherPhil/django
django/contrib/postgres/validators.py
458
2718
import copy from django.core.exceptions import ValidationError from django.core.validators import ( MaxLengthValidator, MaxValueValidator, MinLengthValidator, MinValueValidator, ) from django.utils.deconstruct import deconstructible from django.utils.translation import ugettext_lazy as _, ungettext_lazy clas...
bsd-3-clause
akaihola/django
django/contrib/localflavor/ca/ca_provinces.py
237
1603
""" An alphabetical list of provinces and territories for use as `choices` in a formfield., and a mapping of province misspellings/abbreviations to normalized abbreviations Source: http://www.canada.gc.ca/othergov/prov_e.html This exists in this standalone file so that it's only imported into memory when explici...
bsd-3-clause
adaxi/couchpotato
libs/html5lib/filters/optionaltags.py
1727
10500
from __future__ import absolute_import, division, unicode_literals from . import _base class Filter(_base.Filter): def slider(self): previous1 = previous2 = None for token in self.source: if previous1 is not None: yield previous2, previous1, token previous2...
gpl-3.0
doismellburning/edx-platform
common/djangoapps/track/backends/django.py
55
2327
""" Event tracker backend that saves events to a Django database. """ # TODO: this module is very specific to the event schema, and is only # brought here for legacy support. It should be updated when the # schema changes or eventually deprecated. from __future__ import absolute_import import logging from django.d...
agpl-3.0
mfherbst/spack
var/spack/repos/builtin/packages/font-bitstream-speedo/package.py
5
2114
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
CDVU/plateforme-de-vote-budgetaire
plateforme_budgetaire/pages/migrations/0001_initial.py
2
1187
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2016-04-06 18:32 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations....
gpl-3.0
treeio/treeio
treeio/core/search/dbsearch.py
3
1158
# encoding: utf-8 # Copyright 2011 Tree.io Limited # This file is part of Treeio. # License www.tree.io/license from django.db.models import Q, get_models, CharField, TextField from treeio.core.models import Object params = [] for model in get_models(): if issubclass(model, Object) and getattr(model, 'searcheabl...
mit
erikriver/eduIntelligent-cynin
src/eduintelligent.courses/eduintelligent/courses/__init__.py
1
2188
"""Main product initializer """ from zope.i18nmessageid import MessageFactory from eduintelligent.courses import config from Products.Archetypes import atapi from Products.CMFCore import utils from Products.CMFCore.permissions import setDefaultRoles # Define a message factory for when this product is internationalis...
gpl-3.0
gujiawen/flask_web
venv/lib/python2.7/site-packages/setuptools/command/test.py
363
6471
from distutils.errors import DistutilsOptionError from unittest import TestLoader import unittest import sys from pkg_resources import (resource_listdir, resource_exists, normalize_path, working_set, _namespace_packages, add_activation_listener, require, EntryPoint...
mit
cyberdb/micROS-cloud
app/supervise.py
3
2269
# coding:utf-8 # !/usr/bin/python # Software License Agreement (BSD License) # # Copyright (c) 2016, micROS Team # 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 cod...
bsd-3-clause
alash3al/rethinkdb
test/rql_test/connections/http_support/werkzeug/urls.py
146
33150
# -*- coding: utf-8 -*- """ werkzeug.urls ~~~~~~~~~~~~~ This module implements various URL related functions. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import re from werkzeug._compat import text_type, PY2, to_unicode,...
agpl-3.0
cliftonmcintosh/openstates
openstates/vt/people.py
1
3290
import json from pupa.scrape import Person, Scraper from openstates.utils import LXMLMixin class VTPersonScraper(Scraper, LXMLMixin): CHAMBERS = {'Senator': 'upper', 'Representative': 'lower'} def scrape(self, session=None): if session is None: session = self.latest_session() yea...
gpl-3.0
Intel-tensorflow/tensorflow
tensorflow/lite/testing/op_tests/space_to_depth.py
17
2220
# Copyright 2019 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
hackday-profilers/flocker
flocker/testtools/test/test_cluster_utils.py
11
2391
# Copyright ClusterHQ Inc. See LICENSE file for details. """ Tests for ``flocker.testtools.cluster_utils``. """ from uuid import UUID from twisted.trial.unittest import SynchronousTestCase from ..cluster_utils import ( VERSION, get_version, make_cluster_id, get_cluster_id_information, TestTypes, Providers,...
apache-2.0
SrNetoChan/QGIS
tests/code_layout/acceptable_missing_doc.py
18
114466
# -*- coding: utf-8 -*- """ *************************************************************************** acceptable_missing_doc.py --------------------- Date : March 2016 Copyright : (C) 2016 by Stéphane Brunner Email : stephane dot brunner at camptocamp dot...
gpl-2.0
jayofdoom/ipa-example-hardware-managers
example_hardware_managers/example_business_logic.py
1
4405
# Copyright 2015 Rackspace, 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 law or agreed to in writing...
apache-2.0
Viktor-Evst/fixed-luigi
luigi/contrib/bigquery_avro.py
8
4947
"""Specialized tasks for handling Avro data in BigQuery from GCS. """ import logging from luigi.contrib.bigquery import BigQueryLoadTask, SourceFormat from luigi.contrib.gcs import GCSClient from luigi.task import flatten logger = logging.getLogger('luigi-interface') try: import avro import avro.datafile exc...
apache-2.0
firerszd/kbengine
kbe/src/lib/python/Lib/distutils/log.py
163
1908
"""A simple log mechanism styled after PEP 282.""" # The class here is styled after PEP 282 so that it could later be # replaced with a standard Python logging implementation. DEBUG = 1 INFO = 2 WARN = 3 ERROR = 4 FATAL = 5 import sys class Log: def __init__(self, threshold=WARN): self.threshold = thre...
lgpl-3.0
Aalto-LeTech/a-plus
lib/remote_page.py
1
8013
import logging import posixpath import re import requests import time from bs4 import BeautifulSoup from django.conf import settings from django.utils.http import parse_http_date_safe from django.utils.text import format_lazy from django.utils.translation import ugettext_lazy as _ from urllib.parse import urlparse, url...
gpl-3.0
wengyanqing/incubator-hawq
src/bin/gpupgrade/has33mods.py
12
1482
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
sunjerry019/photonLauncher
oceanoptics/get/intervalSpec.py
1
4573
#!/usr/bin/env python3 """ Script to get spectrum from OceanOptics Spectroscope over time Things to modify before use: - gid and uid of current user """ from __future__ import print_function from builtins import str from builtins import range import sys, os base_dir = os.path.dirname(os.path.realpath(__file__)) root...
apache-2.0
pmorissette/ffn
docs/source/conf.py
1
8539
# -*- coding: utf-8 -*- # # ffn documentation build configuration file, created by # sphinx-quickstart on Fri Jun 20 14:35:17 2014. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All co...
mit
40223234/w16b_test
static/Brython3.1.3-20150514-095342/Lib/sre_parse.py
630
29657
# # 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...
agpl-3.0
popazerty/obh-sh4
lib/python/Screens/Satconfig.py
12
36944
from enigma import eDVBDB from Screen import Screen from Components.SystemInfo import SystemInfo from Components.ActionMap import ActionMap from Components.ConfigList import ConfigListScreen from Components.MenuList import MenuList from Components.NimManager import nimmanager from Components.Button import Button from C...
gpl-2.0
Distrotech/intellij-community
python/lib/Lib/site-packages/django/db/models/sql/datastructures.py
396
1157
""" Useful auxilliary data structures for query construction. Not useful outside the SQL domain. """ class EmptyResultSet(Exception): pass class FullResultSet(Exception): pass class MultiJoin(Exception): """ Used by join construction code to indicate the point at which a multi-valued join was att...
apache-2.0
YanTangZhai/tf
tensorflow/python/kernel_tests/variable_ops_test.py
9
9282
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
jfmartinez64/test
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/veehd.py
16
2385
from __future__ import unicode_literals import re import json from .common import InfoExtractor from ..compat import ( compat_urlparse, ) from ..utils import ( clean_html, get_element_by_id, ) class VeeHDIE(InfoExtractor): _VALID_URL = r'https?://veehd\.com/video/(?P<id>\d+)' _TEST = { ...
gpl-3.0
kouk/boto
boto/cloudsearch2/domain.py
153
21247
# Copyright (c) 2014 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
AltSchool/django
tests/null_queries/tests.py
36
2939
from __future__ import unicode_literals from django.core.exceptions import FieldError from django.test import TestCase from .models import Choice, Inner, OuterA, OuterB, Poll class NullQueriesTests(TestCase): def test_none_as_null(self): """ Regression test for the use of None as a query value....
bsd-3-clause
Srisai85/numpy
numpy/distutils/command/build_src.py
141
32258
""" Build swig, f2py, pyrex sources. """ from __future__ import division, absolute_import, print_function import os import re import sys import shlex import copy from distutils.command import build_ext from distutils.dep_util import newer_group, newer from distutils.util import get_platform from distutils.errors impo...
bsd-3-clause
ganilova/2016gan
catch_then_ball/ball.py
2
7460
from tkinter import* from random import choice, randint import time from tkinter import messagebox ball_min = 15 ball_max = 40 ball_color = '0123456789ABCDEF' balls_coord = []#список координат шариков balls_num = []#список номеров шариков time_limit = 20# время игры def click_ball(event): """ удаление шарика по кл...
gpl-3.0
mahak/nova
nova/console/rfb/auth.py
3
1786
# Copyright (c) 2014-2017 Red Hat, 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 law or agreed to in...
apache-2.0
betobaz/django_docker
actio_control/users/views.py
95
1459
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.core.urlresolvers import reverse from django.views.generic import DetailView, ListView, RedirectView, UpdateView from django.contrib.auth.mixins import LoginRequiredMixin from .models import User class UserDetailView(Login...
mit
tinloaf/home-assistant
homeassistant/components/script.py
1
6571
""" Support for scripts. Scripts are a sequence of actions that can be triggered manually by the user or automatically based upon automation events, etc. For more details about this component, please refer to the documentation at https://home-assistant.io/components/script/ """ import asyncio import logging import v...
apache-2.0
puzan/ansible
lib/ansible/modules/system/aix_inittab.py
3
7978
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Joris Weijters <joris.weijters@gmail.com> # # 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...
gpl-3.0
dya2/python-for-android
python3-alpha/extra_modules/gdata/webmastertools/data.py
126
5504
#!/usr/bin/python # # Copyright (C) 2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
niranjan94/open-event-orga-server
app/settings/__init__.py
7
3475
import stripe from flask import current_app from sqlalchemy import desc from app.models.fees import TicketFees from app.models.setting import Setting, Environment def get_settings(): """ Use this to get latest system settings """ if 'custom_settings' in current_app.config: return current_app....
gpl-3.0
devanlai/pyOCD
pyOCD/gdbserver/gdbserver.py
4
32201
""" mbed CMSIS-DAP debugger Copyright (c) 2006-2015 ARM 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 ...
apache-2.0
loulich/Couchpotato
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/thvideo.py
151
3033
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( unified_strdate ) class THVideoIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?thvideo\.tv/(?:v/th|mobile\.php\?cid=)(?P<id>[0-9]+)' _TEST = { 'url': 'http://thvideo.tv/v/...
gpl-3.0
sauloal/cufflinksviewer
venvlin/lib/python2.7/site-packages/Werkzeug-0.8.3-py2.7.egg/werkzeug/formparser.py
84
19273
# -*- coding: utf-8 -*- """ werkzeug.formparser ~~~~~~~~~~~~~~~~~~~ This module implements the form parsing. It supports url-encoded forms as well as non-nested multipart uploads. :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more deta...
mit
lunafeng/django
django/template/context.py
105
9348
import warnings from contextlib import contextmanager from copy import copy from django.utils.deprecation import RemovedInDjango110Warning # Hard-coded processor for easier use of CSRF protection. _builtin_context_processors = ('django.template.context_processors.csrf',) _current_app_undefined = object() class Con...
bsd-3-clause
thjashin/tensorflow
tensorflow/contrib/learn/python/learn/tests/dataframe/unary_transform_test.py
62
2527
# 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
vng/omim
3party/protobuf/gtest/test/gtest_env_var_test.py
2408
3487
#!/usr/bin/env python # # Copyright 2008, 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...
apache-2.0