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
ClearCorp-dev/odoo
addons/project/company.py
381
1529
# -*- 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
JohnOrlando/gnuradio-bitshark
gr-atsc/src/python/atsc_utils.py
16
2354
# # Copyright 2006 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) # any later version. #...
gpl-3.0
saltstar/spark
python/pyspark/sql/streaming.py
1
40553
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
demon-ru/iml-crm
addons/crm/report/crm_phonecall_report.py
12
3947
# -*- 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
wakatime/wakatime-unity
Editor/WakaTime/client/wakatime/packages/pygments_py2/pygments/lexers/igor.py
72
16870
# -*- coding: utf-8 -*- """ pygments.lexers.igor ~~~~~~~~~~~~~~~~~~~~ Lexers for Igor Pro. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, words from pygments.token import Text, Commen...
cc0-1.0
multikatt/CouchPotatoServer
libs/html5lib/trie/datrie.py
785
1166
from __future__ import absolute_import, division, unicode_literals from datrie import Trie as DATrie from six import text_type from ._base import Trie as ABCTrie class Trie(ABCTrie): def __init__(self, data): chars = set() for key in data.keys(): if not isinstance(key, text_type): ...
gpl-3.0
Jorge-Rodriguez/ansible
lib/ansible/modules/system/osx_defaults.py
9
13852
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, GeekChimp - Franck Nijhof <franck@geekchimp.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_vers...
gpl-3.0
jaredly/codetalker
tests/tokenize/ctokens.py
1
2966
#!/usr/bin/env python from util import just_tokenize, make_tests, make_fails, TSTRING, STRING, SSTRING, ID, WHITE, NUMBER, INT, HEX, CCOMMENT, CMCOMMENT, PYCOMMENT, NEWLINE, ANY def make_single(tok, *tests): fn = just_tokenize(tok, WHITE) return make_tests(globals(), tok.__name__, fn, tests) def fail_single(...
mit
benrudolph/commcare-hq
corehq/apps/telerivet/tasks.py
2
1692
from corehq.apps.telerivet.models import TelerivetBackend, IncomingRequest from corehq.apps.sms.api import incoming as incoming_sms from corehq.apps.sms.util import strip_plus from corehq.apps.ivr.api import incoming as incoming_ivr from celery.task import task from dimagi.utils.logging import notify_exception from dja...
bsd-3-clause
tipsybear/actors-simulation
tests/test_viz.py
1
1179
# test_viz # Vizualization tests # # Author: Benjamin Bengfort <bengfort@cs.umd.edu> # Created: Sun Dec 06 20:45:32 2015 -0500 # # Copyright (C) 2015 University of Maryland # For license information, see LICENSE.txt # # ID: test_viz.py [] benjamin@bengfort.com $ """ Vizualization tests """ ########################...
mit
Zhaoyanzhang/-myflasky
venv/lib/python2.7/site-packages/sqlalchemy/sql/util.py
31
24707
# sql/util.py # Copyright (C) 2005-2017 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 """High level utilities which build upon other modules here. """ from .. import exc, u...
mit
mskrzypkows/servo
tests/wpt/web-platform-tests/mixed-content/generic/expect.py
92
4155
import json, os, urllib, urlparse def redirect(url, response): response.add_required_headers = False response.writer.write_status(301) response.writer.write_header("access-control-allow-origin", "*") response.writer.write_header("location", url) response.writer.end_headers() response.writer.wri...
mpl-2.0
tapanagupta/mi-instrument
mi/instrument/star_asimet/bulkmet/metbk_a/driver.py
7
42844
""" @package mi.instrument.star_asimet.bulkmet.metbk_a.driver @file marine-integrations/mi/instrument/star_aismet/bulkmet/metbk_a/driver.py @author Bill Bollenbacher @brief Driver for the metbk_a Release notes: initial version """ import re import time from mi.core.log import get_logger from mi.core.common import B...
bsd-2-clause
ABaldwinHunter/django-clone-classic
django/test/html.py
220
7928
""" Comparing two html documents. """ from __future__ import unicode_literals import re from django.utils import six from django.utils.encoding import force_text, python_2_unicode_compatible from django.utils.html_parser import HTMLParseError, HTMLParser WHITESPACE = re.compile('\s+') def normalize_whitespace(str...
bsd-3-clause
michael-dev2rights/ansible
lib/ansible/modules/network/nxos/nxos_bgp_af.py
22
29498
#!/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
piffey/ansible
test/units/modules/cloud/amazon/test_s3_bucket.py
137
5360
# (c) 2017 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
lcpt/xc
python_modules/rough_calculations/ng_min_dim_of_abutment_support.py
1
3626
# -*- coding: utf-8 -*- __author__= "Luis C. Pérez Tato (LCPT)" __copyright__= "Copyright 2016, LCPT" __license__= "GPL" __version__= "3.0" __email__= "l.pereztato@gmail.com" import sys def getLg(soilClass): ''' From a length greater than de distance "lg" the soil mouvement can bi consideread as completely unc...
gpl-3.0
satra/prov
prov/model/test/testModel.py
1
5770
''' Created on Jan 25, 2012 @author: Trung Dong Huynh ''' import unittest from prov.model import ProvBundle, ProvRecord, ProvExceptionCannotUnifyAttribute import logging import json import examples import os logger = logging.getLogger(__name__) class Test(unittest.TestCase): def setUp(self): ...
mit
ky822/scikit-learn
examples/decomposition/plot_kernel_pca.py
353
2011
""" ========== Kernel PCA ========== This example shows that Kernel PCA is able to find a projection of the data that makes data linearly separable. """ print(__doc__) # Authors: Mathieu Blondel # Andreas Mueller # License: BSD 3 clause import numpy as np import matplotlib.pyplot as plt from sklearn.decomp...
bsd-3-clause
kickstandproject/ripcord
ripcord/cmd/manage.py
1
2080
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (C) 2013 PolyBeacon, 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...
apache-2.0
jazcollins/models
im2txt/im2txt/inference_utils/caption_generator_test.py
33
5787
# 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
hsiegel/postsai-commitstop
permissions/configDb.py
1
3248
# The MIT License (MIT) # Copyright (c) 2016-2017 HIS e. G. # # 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, modi...
mit
Jionglun/-w16b_test
static/Brython3.1.3-20150514-095342/Lib/test/test_re.py
718
56009
# FIXME: brython: implement test.support #from test.support import verbose, run_unittest, gc_collect, bigmemtest, _2G, \ # cpython_only verbose = True # FIXME: brython: Not used in this module ? #import io import re # FIXME: brython: implement re.Scanner #from re import Scanner import sre_constants import sys...
agpl-3.0
NetDBNCKU/GAE-Conference-Web-App
django/contrib/auth/tests/management.py
83
2529
from StringIO import StringIO from django.contrib.auth import models, management from django.contrib.auth.management.commands import changepassword from django.test import TestCase class GetDefaultUsernameTestCase(TestCase): def setUp(self): self._getpass_getuser = management.get_system_username de...
bsd-3-clause
rsmoorthy/docker
tally/typekeys.py
1
2917
# Type keys and specify shift key up/down import subprocess import sys import argparse import time import os class TypeKeys: def __init__(self, *args, **kwargs): self.shift = False self.name = 'Tally.ERP 9' self.window = 0 if 'WID' in os.environ: self.window = os.enviro...
mit
yangdw/repo.python
src/annotation/Firefly/firefly/dbentrust/util.py
8
6754
#coding:utf8 ''' Created on 2013-5-8 @author: lan (www.9miao.com) ''' from dbpool import dbpool from MySQLdb.cursors import DictCursor from numbers import Number from twisted.python import log def forEachPlusInsertProps(tablename,props): assert type(props) == dict pkeysstr = str(tuple(props.keys())).replace...
mit
LinuxChristian/home-assistant
homeassistant/components/climate/eq3btsmart.py
10
4870
""" Support for eQ-3 Bluetooth Smart thermostats. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/climate.eq3btsmart/ """ import logging import voluptuous as vol from homeassistant.components.climate import ( ClimateDevice, PLATFORM_SCHEMA, PRECISIO...
apache-2.0
dronly/python
shiyanlou/markup/markup.py
1
2132
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys,re from handlers import * from util import * from rules import * import logging logging.basicConfig(level=logging.INFO) class Parser: """ 解析器父类 """ def __init__(self, handler): self.handler = handler # 处理程序对象 self.rules = [] # 判...
apache-2.0
xouillet/sigal
tests/test_zip.py
1
1645
# -*- coding:utf-8 -*- import os import glob import zipfile from sigal.gallery import Gallery from sigal.settings import read_settings CURRENT_DIR = os.path.dirname(__file__) SAMPLE_DIR = os.path.join(CURRENT_DIR, 'sample') SAMPLE_SOURCE = os.path.join(SAMPLE_DIR, 'pictures', 'dir1') def make_gallery(**kwargs): ...
mit
dulems/hue
desktop/core/ext-py/Django-1.6.10/tests/utils_tests/test_checksums.py
246
1098
import unittest from django.utils import checksums class TestUtilsChecksums(unittest.TestCase): def check_output(self, function, value, output=None): """ Check that function(value) equals output. If output is None, check that function(value) equals value. """ if output is...
apache-2.0
mbiciunas/nix
test/cli_config/tag/test_tag_delete.py
1
1334
import pytest from cli_config.tag import tag from utility.nix_error import NixError def test_tag_delete_no_tag(capsys): with pytest.raises(SystemExit) as _excinfo: tag.tag("nixconfig", ["delete"]) _out, _err = capsys.readouterr() assert "2" in str(_excinfo.value), "Exception doesn't contain exp...
gpl-3.0
40223101/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/pprint.py
634
12757
# Author: Fred L. Drake, Jr. # fdrake@acm.org # # This is a simple little module I wrote to make life easier. I didn't # see anything quite like it in the library, though I may have overlooked # something. I wrote this when I was trying to read some heavily nested # tuples with fairly non-desc...
gpl-3.0
blacktear23/django
django/contrib/humanize/templatetags/humanize.py
274
3396
from django.utils.translation import ungettext, ugettext as _ from django.utils.encoding import force_unicode from django import template from django.template import defaultfilters from datetime import date import re register = template.Library() def ordinal(value): """ Converts an integer to its ordinal as a...
bsd-3-clause
prospwro/odoo
addons/l10n_in_hr_payroll/wizard/hr_salary_employee_bymonth.py
374
2830
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
agpl-3.0
OpenCMISS-Bindings/ZincPythonTools
setup.py
1
1174
""" Zinc Python Tools A collection of Qt widgets and utilities building on the Python bindings for the OpenCMISS-Zinc Visualisation Library. """ classifiers = """\ Development Status :: 5 - Production/Stable Intended Audience :: Developers Intended Audience :: Education Intended Audience :: Science/Research License :...
mpl-2.0
Sorsly/subtle
google-cloud-sdk/lib/googlecloudsdk/calliope/exceptions.py
3
14638
# 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 ag...
mit
gnip/support
Data Collector/Rules API/Python/AddRule.py
3
1489
#!/usr/bin/env python import urllib2 import base64 import json import xml import sys def post(): # Ensure that your stream format matches the rule format you intend to use (e.g. '.xml' or '.json') # See below to edit the rule format used when adding and deleting rules (xml or json) # Expected Enterprise Data Col...
mit
shsingh/ansible
lib/ansible/modules/monitoring/zabbix/zabbix_screen.py
9
18673
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013-2014, Epic Games, Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
huahang/typhoon-blade
src/blade/load_build_files.py
3
9983
# Copyright (c) 2011 Tencent Inc. # All rights reserved. # # Author: Huan Yu <huanyu@tencent.com> # Feng Chen <phongchen@tencent.com> # Yi Wang <yiwang@tencent.com> # Chong Peng <michaelpeng@tencent.com> # Date: October 20, 2011 """ This is the CmdOptions module which parses the users' inp...
bsd-3-clause
AdrianGaudebert/socorro
webapp-django/crashstats/crashstats/utils.py
4
12843
import csv import codecs import cStringIO import datetime import isodate import functools import json import re from collections import OrderedDict from django import http from django.conf import settings from . import models class DateTimeEncoder(json.JSONEncoder): def default(self, obj): if isinstance...
mpl-2.0
damdam-s/OpenUpgrade
addons/account_check_writing/account.py
379
2032
# -*- 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
JensGrabner/mpmath
mpmath/function_docs.py
1
280518
""" Extended docstrings for functions.py """ pi = r""" `\pi`, roughly equal to 3.141592654, represents the area of the unit circle, the half-period of trigonometric functions, and many other things in mathematics. Mpmath can evaluate `\pi` to arbitrary precision:: >>> from mpmath import * >>> mp.dps = 50; m...
bsd-3-clause
unnikrishnankgs/va
venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/filepost.py
713
2320
from __future__ import absolute_import import codecs from uuid import uuid4 from io import BytesIO from .packages import six from .packages.six import b from .fields import RequestField writer = codecs.lookup('utf-8')[3] def choose_boundary(): """ Our embarassingly-simple replacement for mimetools.choose_b...
bsd-2-clause
BenKeyFSI/poedit
deps/boost/tools/build/test/library_property.py
44
1126
#!/usr/bin/python # Copyright 2004 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) # Test that the <library> property has no effect on "obj" targets. Previously, # it affected all targets, so # # project : ...
mit
jaggu303619/asylum-v2.0
openerp/addons/project_issue/__init__.py
433
1131
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
snowch/bluemix-spark-examples
examples/DashDB/importfromdashdb.py
2
1389
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
lmgichin/formations
python/npyscr.py
1
1948
# -*- coding: utf-8 -*- import npyscreen class MyAutoComplete(npyscreen.Autocomplete): colors = ["Jaune","Bleu","Rouge","Vert", "Vert foncé"] def auto_complete(self, input): choices = [] for word in MyAutoComplete.colors: if word.startswith(self.value): choices....
gpl-2.0
zhoulingjun/django
tests/servers/test_basehttp.py
213
3129
from io import BytesIO from django.core.handlers.wsgi import WSGIRequest from django.core.servers.basehttp import WSGIRequestHandler from django.test import SimpleTestCase from django.test.client import RequestFactory from django.test.utils import captured_stderr class Stub(object): def __init__(self, **kwargs):...
bsd-3-clause
pexip/meson
mesonbuild/modules/__init__.py
5
2345
import os from .. import build class ExtensionModule: def __init__(self, interpreter): self.interpreter = interpreter self.snippets = set() # List of methods that operate only on the interpreter. def is_snippet(self, funcname): return funcname in self.snippets def get_include_args(...
apache-2.0
pim89/youtube-dl
youtube_dl/extractor/noz.py
26
3664
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import ( compat_urllib_parse_unquote, compat_xpath, ) from ..utils import ( int_or_none, find_xpath_attr, xpath_text, update_url_query, ) class NozIE(InfoExtractor): _VALID_URL = r'http...
unlicense
akaihola/django
django/core/cache/backends/filebased.py
11
4711
"File-based cache backend" import hashlib import os import shutil import time try: import cPickle as pickle except ImportError: import pickle from django.core.cache.backends.base import BaseCache class FileBasedCache(BaseCache): def __init__(self, dir, params): BaseCache.__init__(self, params) ...
bsd-3-clause
rimbalinux/MSISDNArea
django/utils/simplejson/decoder.py
13
12297
"""Implementation of JSONDecoder """ import re import sys import struct from django.utils.simplejson.scanner import make_scanner c_scanstring = None __all__ = ['JSONDecoder'] FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL def _floatconstants(): _BYTES = '7FF80000000000007FF0000000000000'.decode('he...
bsd-3-clause
DSLituiev/scikit-learn
examples/plot_johnson_lindenstrauss_bound.py
8
7473
r""" ===================================================================== The Johnson-Lindenstrauss bound for embedding with random projections ===================================================================== The `Johnson-Lindenstrauss lemma`_ states that any high dimensional dataset can be randomly projected i...
bsd-3-clause
40023154/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/unittest/result.py
727
6397
"""Test result object""" import io import sys import traceback from . import util from functools import wraps __unittest = True def failfast(method): @wraps(method) def inner(self, *args, **kw): if getattr(self, 'failfast', False): self.stop() return method(self, *args, **kw) ...
gpl-2.0
tnkteja/myhelp
virtualEnvironment/lib/python2.7/site-packages/pkginfo/installed.py
3
1987
import glob import os import sys import warnings from pkginfo.distribution import Distribution from pkginfo._compat import STRING_TYPES class Installed(Distribution): def __init__(self, package, metadata_version=None): if isinstance(package, STRING_TYPES): self.package_name = package ...
mit
nathanielherman/silo
benchmarks/results/ben-4-10-13.py
2
2393
RESULTS = [({'par_load': False, 'bench_opts': '', 'retry': False, 'scale_factor': 1, 'name': 'scale_tpcc', 'numa_memory': '2G', 'threads': 1, 'db': 'ndb-proto2', 'bench': 'tpcc'}, [(35595.2, 0.0), (35134.1, 0.0), (35668.9, 0.0)]), ({'par_load': False, 'bench_opts': '', 'retry': False, 'scale_factor': 10, 'name': 'scale...
mit
JGarcia-Panach/odoo
addons/procurement_jit/__init__.py
374
1078
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
seanchen/taiga-back
taiga/export_import/serializers.py
4
22718
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # 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 F...
agpl-3.0
openstack/ironic-inspector
ironic_inspector/test/unit/test_pxe_filter.py
1
19461
# 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 the...
apache-2.0
djmuhlestein/fx2lib
examples/eeprom/client.py
9
2964
# Copyright (C) 2009 Ubixum, Inc. # # This library is free software; you can redistribute it and/or # # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is dis...
gpl-3.0
brianmay/karaage
karaage/tests/projects/test_forms.py
2
2372
# Copyright 2010-2017, The University of Melbourne # Copyright 2010-2017, Brian May # # This file is part of Karaage. # # Karaage 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
fredyangliu/linux-2.6-imx
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # 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. # import os import sys import getopt import sh...
gpl-2.0
gpiotti/tsflask
server/lib/werkzeug/debug/__init__.py
310
7800
# -*- coding: utf-8 -*- """ werkzeug.debug ~~~~~~~~~~~~~~ WSGI application traceback debugger. :copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import json import mimetypes from os.path import join, dirname, basename, isfile ...
apache-2.0
ArcherSys/ArcherSys
Lib/tkinter/ttk.py
1
167711
<<<<<<< HEAD <<<<<<< HEAD """Ttk wrapper. This module provides classes to allow using Tk themed widget set. Ttk is based on a revised and enhanced version of TIP #48 (http://tip.tcl.tk/48) specified style engine. Its basic idea is to separate, to the extent possible, the code implementing a widget's behavior from th...
mit
cetic/ansible
test/units/test_constants.py
187
3203
# -*- coding: utf-8 -*- # (c) 2017 Toshio Kuratomi <tkuratomi@ansible.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, or # (at...
gpl-3.0
dstockwell/pachi
tools/sgflib/typelib.py
11
14710
#!/usr/local/bin/python # typelib.py (Type Class Library) # Copyright (c) 2000 David John Goodger # # This software is provided "as-is", without any express or implied warranty. # In no event will the authors be held liable for any damages arising from the # use of this software. # # Permission is granted to anyone...
gpl-2.0
tizianasellitto/servo
tests/wpt/web-platform-tests/tools/html5lib/html5lib/utils.py
982
2545
from __future__ import absolute_import, division, unicode_literals from types import ModuleType try: import xml.etree.cElementTree as default_etree except ImportError: import xml.etree.ElementTree as default_etree __all__ = ["default_etree", "MethodDispatcher", "isSurrogatePair", "surrogatePairTo...
mpl-2.0
jamielennox/tempest
tempest/api/compute/admin/test_quotas_negative.py
1
7093
# Copyright 2014 NEC Corporation. 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 ...
apache-2.0
cafecivet/django_girls_tutorial
Lib/site-packages/django/db/models/sql/subqueries.py
66
10450
""" Query subclasses which provide extra functionality beyond simple data retrieval. """ from django.conf import settings from django.core.exceptions import FieldError from django.db import connections from django.db.models.query_utils import Q from django.db.models.constants import LOOKUP_SEP from django.db.models.fi...
gpl-2.0
eino-makitalo/odoo
addons/edi/models/res_currency.py
437
2892
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011-2012 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
AuyaJackie/odoo
addons/resource/resource.py
81
42822
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-TODAY OpenERP SA (http://www.openerp.com) # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
SCSSG/Odoo-SCS
openerp/addons/base/res/res_request.py
342
1677
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
cvegaj/ElectriCERT
venv3/lib/python3.6/site-packages/bitcoin/rpc.py
1
24025
# Copyright (C) 2007 Jan-Klaas Kollhof # Copyright (C) 2011-2015 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 ...
gpl-3.0
rlewis1988/lean
script/check_md_links.py
17
2586
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Sebastian Ullrich. All rights reserved. # Released under Apache 2.0 license as described in the file LICENSE. # # Author: Sebastian Ullrich # # Python 2/3 compatibility from __future__ import print_function import argparse import collections import o...
apache-2.0
alexmojaki/blaze
docs/source/conf.py
8
9883
# -*- coding: utf-8 -*- # # Blaze documentation build configuration file, created by # sphinx-quickstart on Mon Oct 8 12:29:11 2012. # # 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 c...
bsd-3-clause
danmergens/mi-instrument
mi/dataset/dataset_driver.py
7
2920
import os from mi.logging import config from mi.core.log import get_logger from mi.core.exceptions import NotImplementedException __author__ = 'wordenm' log = get_logger() class ParticleDataHandler(object): def __init__(self): self._samples = {} self._failure = False def addParticleSample(...
bsd-2-clause
UniMOOC/gcb-new-module
modules/dashboard/unit_lesson_editor.py
3
30735
# 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
Apelsin/trello-tools
trello_tools/burndown.py
1
6529
import re from pprint import pprint from StringIO import StringIO ProgISO8601Date = re.compile('(\d{4})-([01]\d)-([0-3]\d)') def _get_next_row(d): def _get_next_element(_list): for element in _list: yield element return row = {} while True: for key, column in d.iteritem...
lgpl-2.1
shownomercy/django
django/contrib/auth/backends.py
468
6114
from __future__ import unicode_literals from django.contrib.auth import get_user_model from django.contrib.auth.models import Permission class ModelBackend(object): """ Authenticates against settings.AUTH_USER_MODEL. """ def authenticate(self, username=None, password=None, **kwargs): UserMod...
bsd-3-clause
titansgroup/python-phonenumbers
python/phonenumbers/data/region_BH.py
1
1860
"""Auto-generated file, do not edit by hand. BH metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_BH = PhoneMetadata(id='BH', country_code=973, international_prefix='00', general_desc=PhoneNumberDesc(national_number_pattern='[136-9]\\d{7}', possible_number_pattern=...
apache-2.0
prospwro/odoo
openerp/report/printscreen/ps_list.py
381
11955
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
jimb0616/namebench
nb_third_party/jinja2/filters.py
199
22056
# -*- coding: utf-8 -*- """ jinja2.filters ~~~~~~~~~~~~~~ Bundled jinja filters. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import re import math from random import choice from operator import itemgetter from itertools import imap, groupby from jinja2....
apache-2.0
butala/pyrsss
pyrsss/emtf/grdio/grd_io.py
1
5556
""" Read/write tools for nonuniform electric field .grd format. Matthew Grawe, grawe2 (at) illinois.edu January 2017 """ import numpy as np def next_line(grd_file): """ next_line Function returns the next line in the file that is not a blank line, unless the line is '', which is a typical EOF marker...
mit
openqt/algorithms
leetcode/python/lc945-minimum-increment-to-make-array-unique.py
1
1062
# coding=utf-8 import unittest """945. Minimum Increment to Make Array Unique https://leetcode.com/problems/minimum-increment-to-make-array-unique/description/ Given an array of integers A, a _move_ consists of choosing any `A[i]`, and incrementing it by `1`. Return the least number of moves to make every value in `...
gpl-3.0
esiivola/GPYgradients
GPy/models/gp_grid_regression.py
6
1195
# Copyright (c) 2012-2014, GPy authors (see AUTHORS.txt). # Licensed under the BSD 3-clause license (see LICENSE.txt) # Kurt Cutajar from ..core import GpGrid from .. import likelihoods from .. import kern class GPRegressionGrid(GpGrid): """ Gaussian Process model for grid inputs using Kronecker products ...
bsd-3-clause
flyfei/python-for-android
python3-alpha/python3-src/Lib/ctypes/test/test_frombuffer.py
52
2485
from ctypes import * import array import gc import unittest class X(Structure): _fields_ = [("c_int", c_int)] init_called = False def __init__(self): self._init_called = True class Test(unittest.TestCase): def test_fom_buffer(self): a = array.array("i", range(16)) x = (c_int * ...
apache-2.0
FEniCS/uflacs
test/unit/xtest_ufl_shapes_and_indexing.py
1
3320
#!/usr/bin/env python """ Tests of utilities for dealing with ufl indexing and components vs flattened index spaces. """ from ufl import * from ufl import product from ufl.permutation import compute_indices from uflacs.analysis.indexing import (map_indexed_arg_components, map_c...
gpl-3.0
nttcom/eclcli
eclcli/rca/v2/user.py
2
4491
# -*- coding: utf-8 -*- from eclcli.common import command from eclcli.common import exceptions from eclcli.common import utils from ..rcaclient.common.utils import objectify class ListUser(command.Lister): def get_parser(self, prog_name): parser = super(ListUser, self).get_parser(prog_name) ret...
apache-2.0
anderson-81/djangoproject
crud/migrations/0001_initial.py
1
2095
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-06-27 00:23 from __future__ import unicode_literals from decimal import Decimal from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations...
mit
bigdataelephants/scikit-learn
sklearn/datasets/tests/test_lfw.py
50
6849
"""This test for the LFW require medium-size data dowloading and processing If the data has not been already downloaded by running the examples, the tests won't run (skipped). If the test are run, the first execution will be long (typically a bit more than a couple of minutes) but as the dataset loader is leveraging ...
bsd-3-clause
saghul/aiohttp
aiohttp/helpers.py
1
10084
"""Various helper functions""" __all__ = ['BasicAuth', 'FormData', 'parse_mimetype'] import base64 import binascii import io import os import uuid import urllib.parse from collections import namedtuple from wsgiref.handlers import format_date_time from . import hdrs, multidict class BasicAuth(namedtuple('BasicAuth'...
apache-2.0
tthtlc/volatility
volatility/plugins/gui/gahti.py
44
2226
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # Copyright (C) 2010,2011,2012 Michael Hale Ligh <michael.ligh@mnin.org> # # This file is part of Volatility. # # Volatility is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the F...
gpl-2.0
DhiruPranav/data-science-from-scratch
code/simple_linear_regression.py
60
3982
from __future__ import division from collections import Counter, defaultdict from linear_algebra import vector_subtract from statistics import mean, correlation, standard_deviation, de_mean from gradient_descent import minimize_stochastic import math, random def predict(alpha, beta, x_i): return beta * x_i + alpha...
unlicense
moto-timo/ironpython3
Src/StdLib/Lib/getpass.py
86
6069
"""Utilities to get a password and/or the current user name. getpass(prompt[, stream]) - Prompt for a password, with echo turned off. getuser() - Get the user name from the environment or password database. GetPassWarning - This UserWarning is issued when getpass() cannot prevent echoing of the passw...
apache-2.0
vanpact/scipy
scipy/signal/cont2discrete.py
68
5033
""" Continuous to discrete transformations for state-space and transfer function. """ from __future__ import division, print_function, absolute_import # Author: Jeffrey Armstrong <jeff@approximatrix.com> # March 29, 2011 import numpy as np from scipy import linalg from .ltisys import tf2ss, ss2tf, zpk2ss, ss2zpk __...
bsd-3-clause
ClaudiaSaxer/PlasoScaffolder
src/plasoscaffolder/bll/mappings/formatter_init_mapping.py
1
1250
# -*- coding: utf-8 -*- """Class representing the mapper for the formatter init files.""" from plasoscaffolder.bll.mappings import base_mapping_helper from plasoscaffolder.bll.mappings import base_sqliteplugin_mapping from plasoscaffolder.model import init_data_model class FormatterInitMapping( base_sqliteplugin_...
apache-2.0
nwhidden/ND101-Deep-Learning
transfer-learning/tensorflow_vgg/utils.py
145
1972
import skimage import skimage.io import skimage.transform import numpy as np # synset = [l.strip() for l in open('synset.txt').readlines()] # returns image of shape [224, 224, 3] # [height, width, depth] def load_image(path): # load image img = skimage.io.imread(path) img = img / 255.0 assert (0 <= ...
mit
cs243iitg/vehicle-webapp
webapp/vms/admin_views.py
1
18451
from django.shortcuts import render, render_to_response from django.http import HttpResponse, HttpResponseRedirect from django.views import generic from django.core.context_processors import csrf from django.views.decorators.csrf import csrf_protect, csrf_exempt from django.contrib import auth from django.contrib.auth....
mit
knifeyspoony/pyswf
swf/movie.py
1
5645
""" SWF """ from tag import SWFTimelineContainer from stream import SWFStream from export import SVGExporter try: import cStringIO as StringIO except ImportError: import StringIO class SWFHeaderException(Exception): """ Exception raised in case of an invalid SWFHeader """ def __init__(self, message): ...
mit
foss-transportationmodeling/rettina-server
.env/local/lib/python2.7/encodings/cp1257.py
593
13630
""" Python Character Mapping Codec cp1257 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1257.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,in...
apache-2.0