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
grap/OCB
addons/event/res_partner.py
7
1499
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
xq262144/hue
desktop/core/ext-py/Django-1.6.10/django/core/cache/backends/dummy.py
116
1282
"Dummy cache backend" from django.core.cache.backends.base import BaseCache, DEFAULT_TIMEOUT class DummyCache(BaseCache): def __init__(self, host, *args, **kwargs): BaseCache.__init__(self, *args, **kwargs) def add(self, key, value, timeout=DEFAULT_TIMEOUT, version=None): key = self.make_key(...
apache-2.0
leedm777/ansible
lib/ansible/plugins/cache/memory.py
275
1466
# (c) 2014, Brian Coca, Josh Drake, et al # # 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. ...
gpl-3.0
Captain-Coder/tribler
TriblerGUI/single_application.py
3
3940
# Copied and modified from http://stackoverflow.com/a/12712362/605356 import logging, sys from PyQt5.QtCore import pyqtSignal, QTextStream, Qt from PyQt5.QtNetwork import QLocalSocket, QLocalServer from PyQt5.QtWidgets import QApplication LOGVARSTR = "%25s = '%s'" class QtSingleApplication(QApplication): """ ...
lgpl-3.0
MountainWei/nova
nova/tests/unit/image/test_s3.py
69
11230
# Copyright 2011 Isaku Yamahata # 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
TusharAgey/seventhsem
AI/search_algos/home/steepest.py
1
1213
import json def getSmallestNeighbours(nextElem, arrOfArr, visited, heuristic): elems = [] i = ord(nextElem) - ord('A') x = 0 p = 0 smallest = max(heuristic) for j in arrOfArr[i]: if j > 0: if smallest > heuristic[x]: smallest = heuristic[x] p = x x += 1 data = chr(p + ord('A')) if data not in vis...
gpl-3.0
yanlend/scikit-learn
sklearn/neighbors/tests/test_nearest_centroid.py
305
4121
""" Testing for the nearest centroid module. """ import numpy as np from scipy import sparse as sp from numpy.testing import assert_array_equal from numpy.testing import assert_equal from sklearn.neighbors import NearestCentroid from sklearn import datasets from sklearn.metrics.pairwise import pairwise_distances # t...
bsd-3-clause
gtko/Sick-Beard
sickbeard/clients/requests/packages/urllib3/exceptions.py
245
2258
# urllib3/exceptions.py # Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php ## Base Exceptions class HTTPError(Exception): "Base exception used by this module." ...
gpl-3.0
sorashadow/autokey
src/lib/service.py
47
17056
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2011 Chris Dekter # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any late...
gpl-3.0
googleads/google-ads-python
google/ads/googleads/v7/services/services/customer_client_link_service/transports/base.py
1
4203
# -*- coding: utf-8 -*- # Copyright 2020 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...
apache-2.0
johankaito/fufuka
microblog/venv/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.py
895
2517
# -*- coding: utf-8 -*- """ requests.exceptions ~~~~~~~~~~~~~~~~~~~ This module contains the set of Requests' exceptions. """ from .packages.urllib3.exceptions import HTTPError as BaseHTTPError class RequestException(IOError): """There was an ambiguous exception that occurred while handling your request.""...
apache-2.0
odubno/microblog
venv/lib/python2.7/site-packages/sqlalchemy/dialects/firebird/fdb.py
80
4325
# firebird/fdb.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ .. dialect:: firebird+fdb :name: fdb :dbapi: pyodbc :connectstring: ...
bsd-3-clause
freedesktop-unofficial-mirror/telepathy__telepathy-logger
tools/libtpcodegen.py
17
7565
"""Library code for language-independent D-Bus-related code generation. The master copy of this library is in the telepathy-glib repository - please make any changes there. """ # Copyright (C) 2006-2008 Collabora Limited # # This library is free software; you can redistribute it and/or # modify it under the terms of ...
lgpl-2.1
mrquim/repository.mrquim
script.module.xbmcswift2/lib/xbmcswift2/logger.py
34
2979
''' xbmcswift2.log -------------- This module contains the xbmcswift2 logger as well as a convenience method for creating new loggers. :copyright: (c) 2012 by Jonathan Beluch :license: GPLv3, see LICENSE for more details. ''' import logging from xbmcswift2 import CLI_MODE # TODO: Add logging...
gpl-2.0
bzennn/blog_flask
python/lib/python3.5/site-packages/setuptools/command/build_py.py
231
9596
from glob import glob from distutils.util import convert_path import distutils.command.build_py as orig import os import fnmatch import textwrap import io import distutils.errors import itertools from setuptools.extern import six from setuptools.extern.six.moves import map, filter, filterfalse try: from setuptool...
gpl-3.0
chrisfranklin/dinnertime
accounts/urls.py
1
2447
from django.conf.urls import patterns, url from accounts.views.userprofile_views import * urlpatterns = patterns('', url( regex=r'^userprofile/(?P<pk>\d+)/$', view=UserProfileDetailView.as_view(), name='accounts_userprofile_de...
gpl-3.0
hef/samba
buildtools/wafadmin/Tools/compiler_cxx.py
16
1926
#!/usr/bin/env python # encoding: utf-8 # Matthias Jahn jahn dôt matthias ât freenet dôt de 2007 (pmarat) import os, sys, imp, types, ccroot import optparse import Utils, Configure, Options from Logs import debug cxx_compiler = { 'win32': ['msvc', 'g++'], 'cygwin': ['g++'], 'darwin': ['g++'], 'aix': ['xlc++', 'g+...
gpl-3.0
daafgo/CourseBuilder-Xapi
tests/functional/upload_module.py
3
5948
# Copyright 2013 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 ...
apache-2.0
mozilla/inferno
setup.py
4
1116
import os import re import sys from setuptools import setup, find_packages if sys.version_info[:2] < (2, 6): raise RuntimeError('Requires Python 2.6 or better') here = os.path.abspath(os.path.dirname(__file__)) info = open(os.path.join(here, 'inferno', 'lib', '__init__.py')).read() VERSION = re.compile(r".*__ve...
mit
houzhenggang/hiwifi-openwrt-HC5661-HC5761
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/hashlib.py
110
5013
# $Id$ # # Copyright (C) 2005 Gregory P. Smith (greg@krypto.org) # Licensed to PSF under a Contributor Agreement. # __doc__ = """hashlib module - A common interface to many hash functions. new(name, string='') - returns a new hash object implementing the given hash function; initializing th...
gpl-2.0
genouest/biomaj
biomaj/bank.py
1
59134
from builtins import str from builtins import object import os import logging import time import shutil import json from datetime import datetime import redis from biomaj.mongo_connector import MongoConnector from biomaj.session import Session from biomaj.workflow import UpdateWorkflow from biomaj.workflow import Rem...
agpl-3.0
XiaosongWei/chromium-crosswalk
third_party/tlslite/tlslite/integration/tlsasyncdispatchermixin.py
113
4874
# Authors: # Trevor Perrin # Martin von Loewis - python 3 port # # See the LICENSE file for legal information regarding use of this file. """TLS Lite + asyncore.""" import asyncore from tlslite.tlsconnection import TLSConnection from .asyncstatemachine import AsyncStateMachine class TLSAsyncDispatcherMixIn(As...
bsd-3-clause
dstftw/youtube-dl
youtube_dl/extractor/egghead.py
19
4648
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_str from ..utils import ( determine_ext, int_or_none, try_get, unified_timestamp, url_or_none, ) class EggheadCourseIE(InfoExtractor): IE_DESC = 'egghead.io course' IE_NAM...
unlicense
valentinmk/asynccmd
tests/test_asynccmd_sync_nix.py
1
1918
# Copyright (c) 2016-present Valentin Kazakov # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import pytest from unittest import mock from asynccmd import Cmd @pytest.mark.parametrize(("platform", "expected"), [ ("linux", "<_UnixSelect...
apache-2.0
ptisserand/ansible
lib/ansible/modules/network/aci/aci_filter_entry.py
14
12506
#!/usr/bin/python # -*- coding: utf-8 -*- # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
magnusosbeck/rManager
node_modules/protractor/node_modules/jasmine/node_modules/jasmine-core/setup.py
191
1983
from setuptools import setup, find_packages, os import json with open('package.json') as packageFile: version = json.load(packageFile)['version'] setup( name="jasmine-core", version=version, url="http://pivotal.github.io/jasmine/", author="Pivotal Labs", author_email="jasmine-js@googlegroups.com...
mit
firstblade/zulip
zerver/lib/bulk_create.py
121
5432
from __future__ import absolute_import from zerver.lib.initial_password import initial_password from zerver.models import Realm, Stream, UserProfile, Huddle, \ Subscription, Recipient, Client, get_huddle_hash, resolve_email_to_domain from zerver.lib.create_user import create_user_profile def bulk_create_realms(re...
apache-2.0
vashstorm/thrift
test/py/TestSyntax.py
99
1318
#!/usr/bin/env 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 # "L...
apache-2.0
rherrick/XNATImageViewer
src/main/scripts/viewer/closure-library/closure/bin/build/source.py
166
3325
# Copyright 2009 The Closure Library 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 a...
bsd-3-clause
Alexx-G/tastypie-example
src/cars/migrations/0001_initial.py
1
1118
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('manufacturers', '0001_initial'), ] operations = [ migrations.CreateModel( name='Car', fields=[ ...
mit
christophlsa/odoo
addons/website_blog/wizard/__init__.py
373
1077
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
terencehonles/mailman
src/mailman/interfaces/action.py
3
1030
# Copyright (C) 2007-2012 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 you...
gpl-3.0
aESeguridad/GERE
venv/lib/python2.7/site-packages/pip/utils/hashes.py
517
2866
from __future__ import absolute_import import hashlib from pip.exceptions import HashMismatch, HashMissing, InstallationError from pip.utils import read_chunks from pip._vendor.six import iteritems, iterkeys, itervalues # The recommended hash algo of the moment. Change this whenever the state of # the art changes; ...
gpl-3.0
niteoweb/libcloud
libcloud/common/linode.py
41
6300
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
apache-2.0
NunoEdgarGub1/nupic
nupic/regions/ImageSensorFilters/HistogramShift.py
15
3035
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
gpl-3.0
powerjg/gem5-ci-test
tests/quick/se/60.rubytest/test.py
90
1564
# Copyright (c) 2010 Advanced Micro Devices, 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...
bsd-3-clause
repotvsupertuga/tvsupertuga.repository
plugin.video.SportsDevil/service/oscrypto/_win/_cng_cffi.py
7
4557
# coding: utf-8 from __future__ import unicode_literals, division, absolute_import, print_function from .._ffi import FFIEngineError, register_ffi from .._types import str_cls from ..errors import LibraryNotFoundError try: from cffi import FFI except (ImportError): raise FFIEngineError('Error importing cffi'...
gpl-2.0
vladnicoara/SDLive-Blog
documentor/libraries/docutils-0.9.1-py3.2/docutils/parsers/rst/languages/sk.py
52
3917
# $Id: sk.py 7119 2011-09-02 13:00:23Z milde $ # Author: Miroslav Vasko <zemiak@zoznam.sk> # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be # translated fo...
agpl-3.0
rahul003/mxnet
tools/coreml/converter/_layers.py
20
16973
# 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
pattyvader/athena
web/athena_web/settings.py
1
3258
""" Django settings for athena_web project. Generated by 'django-admin startproject' using Django 1.9.5. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os...
mit
brunousml/inbox
inbox/users/tests/test_admin.py
264
1308
from test_plus.test import TestCase from ..admin import MyUserCreationForm class TestMyUserCreationForm(TestCase): def setUp(self): self.user = self.make_user() def test_clean_username_success(self): # Instantiate the form with a new username form = MyUserCreationForm({ ...
bsd-2-clause
jerbob92/CouchPotatoServer
couchpotato/core/plugins/score/main.py
5
2413
from couchpotato.core.event import addEvent from couchpotato.core.helpers.encoding import toUnicode from couchpotato.core.helpers.variable import getTitle, splitString from couchpotato.core.logger import CPLog from couchpotato.core.plugins.base import Plugin from couchpotato.core.plugins.score.scores import nameScore, ...
gpl-3.0
xzh86/scikit-learn
sklearn/feature_extraction/stop_words.py
290
3252
# This list of English stop words is taken from the "Glasgow Information # Retrieval Group". The original list can be found at # http://ir.dcs.gla.ac.uk/resources/linguistic_utils/stop_words ENGLISH_STOP_WORDS = frozenset([ "a", "about", "above", "across", "after", "afterwards", "again", "against", "all", "almo...
bsd-3-clause
jmcarbo/openerp7
openerp/tools/lru.py
204
2946
# -*- coding: utf-8 -*- # taken from http://code.activestate.com/recipes/252524-length-limited-o1-lru-cache-implementation/ import threading from func import synchronized __all__ = ['LRU'] class LRUNode(object): __slots__ = ['prev', 'next', 'me'] def __init__(self, prev, me): self.prev = prev ...
agpl-3.0
luistorresm/odoo
addons/hr_payroll/report/report_payslip_details.py
322
5027
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # it ...
agpl-3.0
javierwilson/cacaomovilcom
cacaomovilcom/users/tests/test_views.py
367
1840
from django.test import RequestFactory from test_plus.test import TestCase from ..views import ( UserRedirectView, UserUpdateView ) class BaseUserTestCase(TestCase): def setUp(self): self.user = self.make_user() self.factory = RequestFactory() class TestUserRedirectView(BaseUserTestCa...
bsd-3-clause
bop/rango
lib/python2.7/site-packages/django/views/csrf.py
235
3802
from django.http import HttpResponseForbidden from django.template import Context, Template from django.conf import settings # We include the template inline since we need to be able to reliably display # this error message, especially for the sake of developers, and there isn't any # other way of making it available ...
gpl-2.0
aerickson/ansible
lib/ansible/playbook/play_context.py
2
26512
# -*- coding: utf-8 -*- # (c) 2012-2014, Michael DeHaan <michael.dehaan@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 the License,...
gpl-3.0
faun/django_test
build/lib/django/core/cache/backends/locmem.py
15
3666
"Thread-safe in-memory cache backend." import time try: import cPickle as pickle except ImportError: import pickle from django.core.cache.backends.base import BaseCache from django.utils.synch import RWLock class CacheClass(BaseCache): def __init__(self, _, params): BaseCache.__init__(self, param...
bsd-3-clause
Microvellum/Fluid-Designer
win64-vc/2.78/Python/lib/site-packages/wheel/bdist_wheel.py
232
17441
""" Create a wheel (.whl) distribution. A wheel is a built archive format. """ import csv import hashlib import os import subprocess import warnings import shutil import json import wheel try: import sysconfig except ImportError: # pragma nocover # Python < 2.7 import distutils.sysconfig as sysconfig i...
gpl-3.0
wiget/beets
test/test_mediafile_edge.py
7
10091
# This file is part of beets. # Copyright 2013, Adrian Sampson. # # 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, ...
mit
clibc/shorten
shorten/memcache_store.py
1
4758
from .base import BaseStore, Pair from .lock import Lock from .key import BaseKeyGenerator from .formatter import FormatterMixin from .errors import KeyInsertError, TokenInsertError class MemcacheKeygen(BaseKeyGenerator): """\ Creates keys in-memory. Keys are always generated in increasing order. """ de...
mit
pombredanne/pyelftools
elftools/construct/macros.py
3
21392
from .lib.py3compat import int2byte from .lib import (BitStreamReader, BitStreamWriter, encode_bin, decode_bin) from .core import (Struct, MetaField, StaticField, FormatField, OnDemand, Pointer, Switch, Value, RepeatUntil, MetaArray, Sequence, Range, Select, Pass, SizeofError, Buffered, Restream, Reconfig) ...
unlicense
guoci/autokey-py3
lib/autokey/qtui/dialogs/abbrsettings.py
4
8888
# Copyright (C) 2011 Chris Dekter # Copyright (C) 2018 Thomas Hess <thomas.hess@udo.edu> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) a...
gpl-3.0
LecomteEmerick/Essentia-build
.waf-1.7.9-16e1644c17ba46b94844133bac6e2a8c/waflib/Tools/flex.py
314
1057
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import waflib.TaskGen,os,re def decide_ext(self,node): if'cxx'in self.features: return['.lex.cc'] return['.lex.c'] def flexfun(tsk): env=tsk.env bld=tsk.generator.bld w...
agpl-3.0
houlixin/BBB-TISDK
linux-devkit/sysroots/cortexa8t2hf-vfp-neon-linux-gnueabi/usr/lib/python2.7/__future__.py
257
4380
"""Record of phased-in incompatible language changes. Each line is of the form: FeatureName = "_Feature(" OptionalRelease "," MandatoryRelease "," CompilerFlag ")" where, normally, OptionalRelease < MandatoryRelease, and both are 5-tuples of the same form as sys.version_info: (...
gpl-2.0
hryamzik/ansible
lib/ansible/modules/cloud/google/gcp_compute_firewall.py
8
19291
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
h2oai/h2o-3
h2o-py/tests/testdir_algos/gam/pyunit_PUBDEV_7366_gam_cv_all_params_binomial.py
2
2997
from __future__ import division from __future__ import print_function import sys sys.path.insert(1, "../../../") import h2o from tests import pyunit_utils from h2o.estimators.gam import H2OGeneralizedAdditiveEstimator from h2o.estimators.glm import H2OGeneralizedLinearEstimator from h2o.estimators.gbm import H2OGradien...
apache-2.0
Viktor-Evst/fixed-luigi
luigi/parameter.py
1
38944
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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
ivanortegaalba/DAI_2014-2015
Practica-1/src/persistencia-dbm-9.py
1
10854
# -*- encoding: utf-8 -*- import web from web import form from web.contrib.template import render_mako import anydbm from warnings import catch_warnings web.config.debug = True render = web.template.render('templates/') urls = ('/', 'index', '/pagina1', 'pagina1', '/pagina2', 'pagina2', '/pagina3', 'pagina3', ...
gpl-2.0
RachitKansal/scikit-learn
examples/cluster/plot_ward_structured_vs_unstructured.py
320
3369
""" =========================================================== Hierarchical clustering: structured vs unstructured ward =========================================================== Example builds a swiss roll dataset and runs hierarchical clustering on their position. For more information, see :ref:`hierarchical_clus...
bsd-3-clause
sebadiaz/rethinkdb
test/rql_test/connections/http_support/werkzeug/testsuite/routing.py
145
29435
# -*- coding: utf-8 -*- """ werkzeug.testsuite.routing ~~~~~~~~~~~~~~~~~~~~~~~~~~ Routing tests. :copyright: (c) 2014 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import unittest from werkzeug.testsuite import WerkzeugTestCase from werkzeug import routing as r from werkzeu...
agpl-3.0
rbaindourov/v8-inspector
Source/chrome/tools/telemetry/telemetry/results/html_output_formatter.py
5
6072
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import datetime import json import logging import os import re from telemetry import value as value_module from telemetry.core import util from telemetry.re...
bsd-3-clause
muntasirsyed/intellij-community
python/helpers/pydev/tests_runfiles/test_pydevd_property.py
56
4121
''' Created on Aug 22, 2011 @author: hussain.bohra @author: fabioz ''' import os import sys import unittest #======================================================================================================================= # Test #================================================================================...
apache-2.0
UManPychron/pychron
pychron/pyscripts/tasks/git_actions.py
2
1188
# =============================================================================== # Copyright 2014 Jake Ross # # 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...
apache-2.0
martin-hunt/hublib
hublib/ui/submit.py
1
18066
# -*- coding: utf-8 -*- from __future__ import print_function import ipywidgets as w import sys import re import os import fcntl import collections import signal import threading import subprocess import select import time import shutil from queue import Queue from joblib import Memory import uuid import glob color_re...
mit
raychorn/knowu
django/djangononrelsample2/django/contrib/gis/geos/prototypes/predicates.py
623
1777
""" This module houses the GEOS ctypes prototype functions for the unary and binary predicate operations on geometries. """ from ctypes import c_char, c_char_p, c_double from django.contrib.gis.geos.libgeos import GEOM_PTR from django.contrib.gis.geos.prototypes.errcheck import check_predicate from django.contrib.gis...
lgpl-3.0
pombredanne/pants
src/python/pants/backend/python/tasks2/select_interpreter.py
3
4585
# coding=utf-8 # Copyright 2016 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
hlt-mt/tensorflow
tensorflow/python/training/tensorboard_logging_test.py
4
4354
# 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
ChanduERP/odoo
openerp/addons/test_access_rights/tests/test_ir_rules.py
299
1220
import openerp.exceptions from openerp.tests.common import TransactionCase class TestRules(TransactionCase): def setUp(self): super(TestRules, self).setUp() self.id1 = self.env['test_access_right.some_obj']\ .create({'val': 1}).id self.id2 = self.env['test_access_right.some_obj...
agpl-3.0
anaviltripathi/pgmpy
pgmpy/inference/base.py
2
3767
#!/usr/bin/env python3 from collections import defaultdict from itertools import chain from pgmpy.models import BayesianModel from pgmpy.models import MarkovModel from pgmpy.models import FactorGraph from pgmpy.models import JunctionTree from pgmpy.models import DynamicBayesianNetwork class Inference(object): "...
mit
LordDamionDevil/Lony
lib/pip/_vendor/distlib/database.py
334
49672
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2016 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """PEP 376 implementation.""" from __future__ import unicode_literals import base64 import codecs import contextlib import hashlib import logging import os import posixpath import sys import z...
gpl-3.0
radiasoft/pykern
pykern/pkio.py
1
8073
# -*- coding: utf-8 -*- u"""Useful I/O operations :copyright: Copyright (c) 2015 RadiaSoft LLC. All Rights Reserved. :license: http://www.apache.org/licenses/LICENSE-2.0.html """ from __future__ import absolute_import, division, print_function from pykern import pkconst import contextlib import copy import errno impo...
apache-2.0
nerdvegas/rez
src/rez/rex_bindings.py
1
8870
""" Provides wrappers for various types for binding to Rex. We do not want to bind object instances directly in Rex, because this would create an indirect dependency between rex code in package.py files, and versions of Rez. The classes in this file are intended to have simple interfaces that hide unnecessary data fro...
lgpl-3.0
simonwydooghe/ansible
lib/ansible/modules/network/check_point/checkpoint_task_facts.py
18
2601
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
YangChihWei/2015cd_midterm2
static/Brython3.1.1-20150328-091302/Lib/xml/sax/__init__.py
637
3505
"""Simple API for XML (SAX) implementation for Python. This module provides an implementation of the SAX 2 interface; information about the Java version of the interface can be found at http://www.megginson.com/SAX/. The Python version of the interface is documented at <...>. This package contains the following modu...
agpl-3.0
rogerq/ltp-ddt
testcases/kernel/power_management/ilb_test.py
8
1826
#!/usr/bin/python ''' This Python script interprets interrupt values. Validates Ideal load balancer runs in same package where workload is running ''' import os import sys LIB_DIR = "%s/lib" % os.path.dirname(__file__) sys.path.append(LIB_DIR) from optparse import OptionParser from sched_mc import * __author__ = ...
gpl-2.0
fujita/ryu
ryu/services/protocols/bgp/info_base/evpn.py
10
1810
# Copyright (C) 2016 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
devdattakulkarni/test-solum
solum/tests/objects/test_assembly.py
1
4252
# Copyright 2014 - Rackspace US, 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
Cinntax/home-assistant
homeassistant/components/elkm1/sensor.py
2
7883
"""Support for control of ElkM1 sensors.""" from . import DOMAIN as ELK_DOMAIN, ElkEntity, create_elk_entities async def async_setup_platform(hass, config, async_add_entities, discovery_info=None): """Create the Elk-M1 sensor platform.""" if discovery_info is None: return elk_datas = hass.data[EL...
apache-2.0
CZ-NIC/thug
src/DOM/Navigator.py
4
11676
#!/usr/bin/env python # # Navigator.py # # 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;...
gpl-2.0
dheerajgopi/google-python
babynames/babynames.py
1
2682
#!/usr/bin/python # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ import sys import re """Baby Names exercise Define the extract_names() function below and c...
apache-2.0
mattgiguere/scikit-learn
sklearn/cross_validation.py
3
57208
""" The :mod:`sklearn.cross_validation` module includes utilities for cross- validation and performance evaluation. """ # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>, # Gael Varoquaux <gael.varoquaux@normalesup.org>, # Olivier Grisel <olivier.grisel@ensta.org> # License: BSD 3 clause from...
bsd-3-clause
baslr/ArangoDB
3rdParty/V8/V8-5.0.71.39/tools/swarming_client/third_party/requests/auth.py
46
5665
# -*- coding: utf-8 -*- """ requests.auth ~~~~~~~~~~~~~ This module contains the authentication handlers for Requests. """ import os import re import time import hashlib import logging from base64 import b64encode from .compat import urlparse, str from .utils import parse_dict_header log = logging.getLogger(__nam...
apache-2.0
austgl/shadowsocks
shadowsocks/crypto/rc4_md5.py
1042
1339
#!/usr/bin/env python # # Copyright 2015 clowwindy # # 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
vaygr/ansible
lib/ansible/plugins/callback/mail.py
10
8406
# -*- coding: utf-8 -*- # Copyright: (c) 2012, Dag Wieers <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 DOCUMENTATION = ''' callback: mail type: notification short_d...
gpl-3.0
xahgmah/edx-proctoring
edx_proctoring/backends/backend.py
2
1733
""" Defines the abstract base class that all backends should derive from """ import abc class ProctoringBackendProvider(object): """ The base abstract class for all proctoring service providers """ # don't allow instantiation of this class, it must be subclassed __metaclass__ = abc.ABCMeta ...
agpl-3.0
patricklodder/dogepartyd
docs/conf.py
7
7806
# -*- coding: utf-8 -*- # # counterpartyd documentation build configuration file, created by # sphinx-quickstart on Mon Jan 20 15:45:40 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. #...
mit
shipEZ/flaskApp
lib/python2.7/site-packages/setuptools/ssl_support.py
100
8119
import os import socket import atexit import re from setuptools.extern.six.moves import urllib, http_client, map import pkg_resources from pkg_resources import ResolutionError, ExtractionError try: import ssl except ImportError: ssl = None __all__ = [ 'VerifyingHTTPSHandler', 'find_ca_bundle', 'is_avail...
mit
flyfei/python-for-android
python3-alpha/python3-src/Lib/test/test_smtplib.py
46
28778
import asyncore import email.mime.text import email.utils import socket import smtpd import smtplib import io import re import sys import time import select import unittest from test import support, mock_socket try: import threading except ImportError: threading = None HOST = support.HOST if sys.platform ==...
apache-2.0
hoihu/micropython
tests/perf_bench/misc_pystone.py
15
5799
""" "PYSTONE" Benchmark Program Version: Python/1.2 (corresponds to C/1.1 plus 3 Pystone fixes) Author: Reinhold P. Weicker, CACM Vol 27, No 10, 10/84 pg. 1013. Translated from ADA to C by Rick Richardson. Every method to preserve ADA-likeness has been used, ...
mit
manics/openmicroscopy
components/tools/OmeroPy/test/integration/clitest/test_duplicate.py
4
9201
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2016 University of Dundee & Open Microscopy Environment. # All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation;...
gpl-2.0
lude-ma/python-ivi
ivi/agilent/agilentDSOX3032A.py
7
1694
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2012-2014 Alex Forencich 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...
mit
cloudbase/neutron-virtualbox
neutron/common/repos.py
2
2943
# Copyright (c) 2015, A10 Networks # # 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
MarekIgnaszak/econ-project-templates
src/documentation/conf.py
3
7031
# -*- coding: utf-8 -*- # # Documentation build configuration file, created by sphinx-quickstart # # 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 configuration values have a default; v...
bsd-3-clause
Zord13appdesa/python-for-android
python-modules/twisted/twisted/web/_auth/digest.py
53
1700
# -*- test-case-name: twisted.web.test.test_httpauth -*- # Copyright (c) 2009 Twisted Matrix Laboratories. # See LICENSE for details. """ Implementation of RFC2617: HTTP Digest Authentication @see: U{http://www.faqs.org/rfcs/rfc2617.html} """ from zope.interface import implements from twisted.cred import credentials...
apache-2.0
nexiles/odoo
addons/payment_adyen/models/adyen.py
136
7759
# -*- coding: utf-'8' "-*-" import base64 try: import simplejson as json except ImportError: import json from hashlib import sha1 import hmac import logging import urlparse from openerp.addons.payment.models.payment_acquirer import ValidationError from openerp.addons.payment_adyen.controllers.main import Adye...
agpl-3.0
dkasak/notify-osd-customizable
debian/source_notify-osd.py
2
2857
#!/usr/bin/python '''Notify-OSD Apport interface Copyright (C) 2009 Canonical Ltd. Author: Ara Pulido <ara.pulido@canonical.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of ...
gpl-3.0
jayvdb/coala
tests/output/printers/LogPrinterTest.py
33
2679
import unittest from unittest import mock import logging from pyprint.NullPrinter import NullPrinter from pyprint.Printer import Printer from coalib.misc import Constants from coalib.output.printers.LogPrinter import LogPrinter, LogPrinterMixin from coalib.processes.communication.LogMessage import LOG_LEVEL, LogMessa...
agpl-3.0
heeraj123/oh-mainline
vendor/packages/sqlparse/sqlparse/utils.py
31
2766
''' Created on 17/05/2012 @author: piranna ''' try: from collections import OrderedDict except ImportError: OrderedDict = None if OrderedDict: class Cache(OrderedDict): """Cache with LRU algorithm using an OrderedDict as basis """ def __init__(self, maxsize=100): Orde...
agpl-3.0