repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
jdahlin/pygobject
tests/test_overrides.py
1
79982
# -*- Mode: Python; py-indent-offset: 4 -*- # vim: tabstop=4 shiftwidth=4 expandtab import unittest import sys sys.path.insert(0, "../") from compathelper import _long, _unicode, _bytes from gi.repository import GLib from gi.repository import GObject from gi.repository import Gdk from gi.repository import Gtk from ...
lgpl-2.1
Ant-OS/android_packages_apps_OTAUpdates
jni/boost_1_57_0/libs/mpi/test/python/scan_test.py
64
1125
# Copyright (C) 2006 Douglas Gregor <doug.gregor -at- gmail.com>. # Use, modification and distribution is subject to the Boost Software # License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) # Test scan() collective. import boost.parallel.mpi as mpi from gen...
apache-2.0
myerpengine/odoo
openerp/addons/base/res/res_company.py
37
21361
# -*- 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
MortalViews/incubator-airflow
airflow/operators/mysql_operator.py
16
2061
# -*- coding: utf-8 -*- # # 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 ...
apache-2.0
jsgreenwell/teaching-python
classnotes/Knapsack/make_change.alpha.py
1
1842
from collections import OrderedDict import pprint '''Basic change making program using 100 base (American Currency): will create full knapsack version in later example. This example will also be expanded, in steps, until it becomes a simple OO-based (ie. we'll add classes) POS system with database tie-in.''' d...
mit
tbeadle/django
tests/template_tests/syntax_tests/test_firstof.py
177
3215
from django.template import TemplateSyntaxError from django.test import SimpleTestCase from ..utils import setup class FirstOfTagTests(SimpleTestCase): @setup({'firstof01': '{% firstof a b c %}'}) def test_firstof01(self): output = self.engine.render_to_string('firstof01', {'a': 0, 'c': 0, 'b': 0}) ...
bsd-3-clause
rhattersley/iris
lib/iris/tests/unit/analysis/test_RMS.py
17
3959
# (C) British Crown Copyright 2013 - 2015, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option) any l...
lgpl-3.0
goodwinnk/intellij-community
plugins/hg4idea/testData/bin/mercurial/help.py
91
18018
# help.py - help data for mercurial # # Copyright 2006 Matt Mackall <mpm@selenic.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from i18n import gettext, _ import itertools, sys, os, error import extensions, revset, fileset,...
apache-2.0
joshrule/LOTlib
LOTlib/Examples/Number/Adapt.py
2
1558
# -*- coding: utf-8 -*- """ Use optimal adaptation code to adapt show possible adpatations to the Number grammar. """ import pickle import LOTlib from LOTlib.Examples.Number.Model import * from LOTlib.Miscellaneous import Infinity from LOTlib.sandbox.OptimalGrammarAdaptation import print_subtree_adaptations ## WHAT ...
gpl-3.0
timlinux/QGIS
python/pyplugin_installer/unzip.py
53
2524
# -*- coding:utf-8 -*- """ /*************************************************************************** Plugin Installer module unzip function ------------------- Date : May 2013 Copyright : (C) 2013 ...
gpl-2.0
adngdb/socorro
minidump-stackwalk/jsoncpp-src-0.5.0/test/rununittests.py
249
2507
import sys import os import os.path import subprocess from glob import glob import optparse VALGRIND_CMD = 'valgrind --tool=memcheck --leak-check=yes --undef-value-errors=yes' class TestProxy(object): def __init__( self, test_exe_path, use_valgrind=False ): self.test_exe_path = os.path.normpath( os.path.a...
mpl-2.0
appsecyogi/Mobile-Security-Framework-MobSF
install/windows/rpc_client.py
4
5192
"""MobSF rpc_client for static windows app analysis.""" # pylint: disable=C0325,W0603,C0103 import os from os.path import expanduser import re import subprocess import configparser # pylint: disable-msg=E0401 import hashlib import random import string import base64 from xmlrpc.server import SimpleXMLRPCServer # pylint...
gpl-3.0
manmeetsaini/etools
etools-module/backup/find_callid.py
1
1271
# Python Regex module to find Call ID in SIP Trace #function will search first for SIP event "INVITE sip:" and Start Loggin Information #Logging will be continued till string "Content-Length:" which indicates end of SIP Message #A sub-function will search for sting "CallID:" and print that entire line import re ...
gpl-3.0
robgolding63/tasklib
setup.py
2
1199
from setuptools import setup, find_packages install_requirements = ['pytz', 'tzlocal'] version = '2.3.0' try: import importlib except ImportError: install_requirements.append('importlib') setup( name='tasklib', version=version, description='Python Task Warrior library', long_description=open...
bsd-3-clause
inessadl/kinect-2-libras
Kinect2Libras/KinectFingerTracking/Lib/htmllib.py
312
12869
"""HTML 2.0 parser. See the HTML 2.0 specification: http://www.w3.org/hypertext/WWW/MarkUp/html-spec/html-spec_toc.html """ from warnings import warnpy3k warnpy3k("the htmllib module has been removed in Python 3.0", stacklevel=2) del warnpy3k import sgmllib from formatter import AS_IS __all__ = ["HTMLPars...
apache-2.0
djmonta/iTerm2
tests/esctest/tests/decset_tite_inhibit.py
31
2003
from tests.save_restore_cursor import SaveRestoreCursorTests import esccmd from escutil import knownBug class DECSETTiteInhibitTests(SaveRestoreCursorTests): def __init__(self): SaveRestoreCursorTests.__init__(self) def saveCursor(self): esccmd.DECSET(esccmd.SaveRestoreCursor) def restoreCursor(self): ...
gpl-2.0
jamiefolsom/edx-platform
lms/djangoapps/class_dashboard/tests/test_dashboard_data.py
88
13672
""" Tests for class dashboard (Metrics tab in instructor dashboard) """ import json from django.core.urlresolvers import reverse from django.test.client import RequestFactory from mock import patch from nose.plugins.attrib import attr from capa.tests.response_xml_factory import StringResponseXMLFactory from coursewa...
agpl-3.0
photoninger/ansible
test/units/plugins/test_plugins.py
51
5435
# (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, or # (at your option) an...
gpl-3.0
pcm17/tensorflow
tensorflow/contrib/rnn/python/kernel_tests/rnn_test.py
34
19680
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
icereval/raven-python
raven/contrib/pylons/__init__.py
8
1113
""" raven.contrib.pylons ~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from raven.middleware import Sentry as Middleware from raven.base import Client def list_from_setting(conf...
bsd-3-clause
vganapath/rally
doc/ext/cli_reference.py
5
8151
# Copyright 2016: Mirantis 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
toshywoshy/ansible
lib/ansible/modules/remote_management/ucs/ucs_vhba_template.py
5
11061
#!/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
thaim/ansible
lib/ansible/module_utils/mysql.py
8
4390
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
mit
campbe13/openhatch
vendor/packages/twisted/twisted/conch/test/test_knownhosts.py
18
34421
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.conch.client.knownhosts}. """ import os from binascii import Error as BinasciiError, b2a_base64, a2b_base64 try: import Crypto import pyasn1 except ImportError: skip = "PyCrypto and PyASN1 required for twisted...
agpl-3.0
sabi0/intellij-community
python/testData/highlighting/builtins.py
21
1169
# bg is always black. # effect is white # func decl: red bold # class decl: blue bold # predefined decl: green bold # predefined usage: yellow bold <info descr="PY.BUILTIN_NAME" type="INFORMATION" foreground="0x00ff00" background="0x000000" effectcolor="0xffffff" effecttype="BOXED" fonttype="1">len</info>("") len = []...
apache-2.0
pkscout/script.argustv-helper
resources/common/fileops.py
1
2425
# v.0.3.0 import ntpath, xbmcvfs def checkDir( path ): log_lines = [] log_lines.append( 'checking for directory ' + path ) if not xbmcvfs.exists( path ): log_lines.append( 'directory does not exist, creating it' ) xbmcvfs.mkdirs( path ) return False, log_lines else: lo...
gpl-2.0
joshloyal/scikit-learn
sklearn/cross_decomposition/cca_.py
151
3192
from .pls_ import _PLS __all__ = ['CCA'] class CCA(_PLS): """CCA Canonical Correlation Analysis. CCA inherits from PLS with mode="B" and deflation_mode="canonical". Read more in the :ref:`User Guide <cross_decomposition>`. Parameters ---------- n_components : int, (default 2). numb...
bsd-3-clause
AIML/scikit-learn
sklearn/svm/bounds.py
280
2911
"""Determination of parameter bounds""" # Author: Paolo Losi # License: BSD 3 clause from warnings import warn import numpy as np from ..preprocessing import LabelBinarizer from ..utils.validation import check_consistent_length, check_array from ..utils.extmath import safe_sparse_dot def l1_min_c(X, y, loss='squar...
bsd-3-clause
simone/django-gb
tests/view_tests/tests/test_csrf.py
20
2641
from django.test import TestCase, override_settings, Client from django.utils.translation import override class CsrfViewTests(TestCase): urls = "view_tests.urls" def setUp(self): super(CsrfViewTests, self).setUp() self.client = Client(enforce_csrf_checks=True) @override_settings( ...
bsd-3-clause
sarvex/tensorflow
tensorflow/python/ops/linalg/linear_operator_tridiag.py
6
15035
# 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
woobe/h2o
py/testdir_single_jvm/test_players_NA_fvec.py
1
1180
import unittest, random, sys, time sys.path.extend(['.','..','py']) import h2o_hosts import h2o, h2o_cmd, h2o_import as h2i class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox_for_errors() @classmethod def setUpClass(cls): localhost = h2o.decide_if_localhost() if ...
apache-2.0
minixalpha/SourceLearning
webpy/src/web/net.py
14
6188
""" Network Utilities (from web.py) """ __all__ = [ "validipaddr", "validip6addr", "validipport", "validip", "validaddr", "urlquote", "httpdate", "parsehttpdate", "htmlquote", "htmlunquote", "websafe", ] import urllib, time try: import datetime except ImportError: pass import re import socket def validip6ad...
apache-2.0
gangadharkadam/saloon_erp_install
erpnext/patches/v5_4/notify_system_managers_regarding_wrong_tax_calculation.py
17
1431
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.email import sendmail_to_system_managers from frappe.utils import get_url_to_form def execute(): wrong_records = [] for ...
agpl-3.0
MKaptein/streamingbandit
app/app.py
2
4233
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Imports of external stuff that is needed import tornado.escape import tornado.ioloop import tornado.web import logging import os,yaml import logging.handlers # import scheduling ingredients from apscheduler.schedulers.tornado import TornadoScheduler from core.jobs impor...
mit
makiftasova/hangoutsbot
hangupsbot/plugins/monitoradds.py
4
3384
""" Plugin for monitoring new adds to HOs and alerting if users were not added by an admin or mod. Add mods to the config.json file either globally or on an individual HO basis. Add a "watch_new_adds": true parameter to individual HOs in the config.json file. Author: @Riptides """ import logging import hangups impo...
agpl-3.0
pulilab/rapidpro
temba/orgs/tests.py
1
148553
from __future__ import unicode_literals import json import nexmo import pytz import six from bs4 import BeautifulSoup from context_processors import GroupPermWrapper from datetime import timedelta from dateutil.relativedelta import relativedelta from decimal import Decimal from django.conf import settings from djang...
agpl-3.0
ormnv/os_final_project
django/contrib/formtools/wizard/storage/base.py
216
3949
from django.core.files.uploadedfile import UploadedFile from django.utils.datastructures import MultiValueDict from django.utils.functional import lazy_property from django.utils import six from django.contrib.formtools.wizard.storage.exceptions import NoFileStorageConfigured class BaseStorage(object): step_key ...
bsd-3-clause
blowmage/gcloud-python
gcloud/datastore/test_helpers.py
1
21896
# Copyright 2014 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
yuuki0xff/conoha-cli
conoha/api.py
1
4205
# -*- coding: utf8 -*- from urllib.request import Request, urlopen import json __all__ = 'API'.split() class DictWrapper(dict): """ dictインスタンスへインスタンス変数を追加するために使用する """ pass class BytesWrapper(bytes): """ bytesインスタンスへインスタンス変数を追加するために使用する """ pass class API: """全てのConoHa APIを呼び出すクラスのスーパークラス""" def __init__(self...
mit
lewischeng-ms/pox
tools/gui/communication.py
5
6464
''' This module implements the communication between - the topology view and the monitoring backend that feeds it - the log view and NOX's logger - the json command prompt and NOX's json messenger @author Kyriakos Zarifis ''' from PyQt4 import QtGui, QtCore import SocketServer import socket ...
gpl-3.0
andremiller/beets
test/test_info.py
1
2980
# This file is part of beets. # Copyright 2015, Thomas Scholtes. # # 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
erja-gp/openthread
tools/harness-automation/cases/leader_9_2_19.py
1
1877
#!/usr/bin/env python # # Copyright (c) 2018, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # notic...
bsd-3-clause
whitehorse-io/encarnia
pyenv/lib/python2.7/site-packages/pip/_vendor/distlib/markers.py
1261
6282
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2013 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # """Parser for the environment markers micro-language defined in PEP 345.""" import ast import os import sys import platform from .compa...
mit
zbassett/curling-robot
RaspberryPi/DjangoSite/mysite/curling/migrations/0011_auto_20170212_1701.py
1
1906
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-02-12 17:01 from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('curling', '0010_auto_20170212_0059'), ] operations = [...
apache-2.0
bestvibes/neo4j-social-network
env/lib/python2.7/encodings/utf_8_sig.py
412
3685
""" Python 'utf-8-sig' Codec This work similar to UTF-8 with the following changes: * On encoding/writing a UTF-8 encoded BOM will be prepended/written as the first three bytes. * On decoding/reading if the first three bytes are a UTF-8 encoded BOM, these bytes will be skipped. """ import codecs ### Codec APIs ...
mit
lyarwood/sosreport
sos/plugins/tuned.py
12
1405
# Copyright (C) 2014 Red Hat, Inc., Peter Portante <peter.portante@redhat.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 the License, or # (at your option) any later v...
gpl-2.0
gustavla/dotfiles
ipython_config.py
1
19767
# Configuration file for ipython. c = get_config() #------------------------------------------------------------------------------ # InteractiveShellApp configuration #------------------------------------------------------------------------------ # A Mixin for applications that start InteractiveShell instances. # #...
bsd-3-clause
aptana/Pydev
bundles/org.python.pydev.jython/Lib/keyword.py
11
2065
#! /usr/bin/env python """Keywords (from "graminit.c") This file is automatically generated; please don't muck it up! To update the symbols in this file, 'cd' to the top directory of the python source tree after building the interpreter and run: python Lib/keyword.py """ __all__ = ["iskeyword", "kwlist"] kwli...
epl-1.0
renfufei/shadowsocks
setup.py
16
1321
import codecs from setuptools import setup with codecs.open('README.rst', encoding='utf-8') as f: long_description = f.read() setup( name="shadowsocks", version="2.6.9", license='http://www.apache.org/licenses/LICENSE-2.0', description="A fast tunnel proxy that help you get through firewalls", ...
apache-2.0
didrocks/notifythis
setup.py
1
3960
#!/usr/bin/env python # -*- coding: utf-8 -*- ### BEGIN LICENSE # Copyright (C) 2009 Didier Roche <didrocks@ubuntu.com> #This program is free software: you can redistribute it and/or modify it #under the terms of the GNU General Public License version 3, as published #by the Free Software Foundation. # #This program ...
gpl-3.0
nacc/autotest
tko/parsers/base.py
6
2468
import traceback from autotest.tko import status_lib, utils as tko_utils class parser(object): """ Abstract parser base class. Provides a generic implementation of the standard parser interfaction functions. The derived classes must implement a state_iterator method for this class to be useful. "...
gpl-2.0
Mercy-Nekesa/sokoapp
sokoapp/coupons/tests/runtests.py
1
1632
#!/usr/bin/env python """ Inspired by https://github.com/mbrochh/tdd-with-django-reusable-app Thanks a lot! """ import os import sys from django.conf import settings EXTERNAL_APPS = [ 'django.contrib.admin', 'django.contrib.admindocs', 'django.contrib.auth', 'django.contrib.contenttypes', 'django...
mit
jasonzio/azure-linux-extensions
TestHandlerLinux/bin/update.py
16
1941
#!/usr/bin/env python """ Example Azure Handler script for Linux IaaS Update example Reads port from Public Config if present. Creates service_port.txt in resources dir. Copies the service to /usr/bin and updates it with the resource path. """ import os import sys import imp import time waagent=imp.load_source('waage...
apache-2.0
ofekd/servo
tests/wpt/web-platform-tests/tools/pytest/testing/test_config.py
166
19617
import py, pytest import _pytest._code from _pytest.config import getcfg, get_common_ancestor, determine_setup from _pytest.main import EXIT_NOTESTSCOLLECTED class TestParseIni: def test_getcfg_and_config(self, testdir, tmpdir): sub = tmpdir.mkdir("sub") sub.chdir() tmpdir.join("setup.cfg"...
mpl-2.0
danigonza/phantomjs
src/breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/internal/encoder.py
484
25695
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
bsd-3-clause
aml-development/ozp-backend
ozpcenter/api/listing/elasticsearch_util.py
1
31164
""" Elasticsearch Utils -------------------------- Contains Elasticsearch common functions ===== Code was developed to work with Elasticsearch 2.4.* Reference number_of_shards number_of_replicas https://www.elastic.co/guide/en/elasticsearch/guide/current/_how_primary_and_replica_shards_interact.html ...
apache-2.0
luxnovalabs/enjigo_door
web_interface/djangoappengine/tests/test_order.py
28
2128
from django.test import TestCase from .models import OrderedModel class OrderTest(TestCase): def create_ordered_model_items(self): pks = [] priorities = [5, 2, 9, 1] for pk, priority in enumerate(priorities): pk += 1 model = OrderedModel(pk=pk, priority=priority) ...
unlicense
sookasa/heroku-buildpack-python-pipeline
vendor/pip-1.2.1/tests/test_pip.py
9
21936
#!/usr/bin/env python import os import sys import tempfile import shutil import glob import atexit import textwrap import site from scripttest import TestFileEnvironment, FoundDir from tests.path import Path, curdir, u from pip.util import rmtree pyversion = sys.version[:3] # the directory containing all the tests h...
mit
aaossa/Dear-Notebooks
Web scraping/Download big files/download_big_files_asynchronous.py
1
1220
# https://community.nitrous.io/tutorials/asynchronous-programming-with-python-3 import aiohttp import asyncio import itertools async def download(url, parts=16): print("URL: {}".format(url)) async def get_partial_content(_url, _part, start, end): print("Part {}/{} (Bytes {} to {})".format(_part, pa...
gpl-3.0
yawnosnorous/python-for-android
python-modules/twisted/twisted/words/xish/xpathparser.py
54
19140
# Copyright (c) 2001-2007 Twisted Matrix Laboratories. # See LICENSE for details. # DO NOT EDIT xpathparser.py! # # It is generated from xpathparser.g using Yapps. Make needed changes there. # This also means that the generated Python may not conform to Twisted's coding # standards. # HOWTO Generate me: # # 1.) Grab ...
apache-2.0
att-comdev/armada
armada/common/policies/service.py
1
1640
# 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
adelina-t/nova
nova/tests/functional/v3/test_hypervisors.py
15
2770
# Copyright 2012 Nebula, Inc. # Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
apache-2.0
priomsrb/fixthecode
wsgi/fixthecode/wsgi.py
1
1431
""" WSGI config for fixthecode project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION...
gpl-2.0
kingfisher1337/tns
tnslib/tebd.py
1
14341
import numpy as np from numpy import dot, einsum from numpy import tensordot as tdot from scipy.optimize import minimize import ctm import gates def _make_double_layer_tensor(a, D): return einsum(a, [8,0,2,4,6], a.conj(), [8,1,3,5,7]).reshape([D**2]*4) def _itebd_square_fu_singlebond(a, b, abg, env): tdot(b, ...
gpl-3.0
indictranstech/fbd_erpnext
erpnext/accounts/report/gst_sales_details/gst_sales_details.py
1
1362
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.utils import flt, getdate, cstr from frappe import _ from datetime import date, timedelta def execute(filters=None): columns, res = ...
agpl-3.0
guorendong/iridium-browser-ubuntu
third_party/mojo/src/mojo/public/tools/bindings/pylib/mojom/parse/parser.py
32
13000
# 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. """Generates a syntax tree from a Mojo IDL file.""" import imp import os.path import sys def _GetDirAbove(dirname): """Returns the directory "above" this...
bsd-3-clause
niboshi/chainer
tests/chainer_tests/functions_tests/array_tests/test_concat.py
8
3200
import unittest import numpy from chainer import functions from chainer import testing from chainer.testing import backend @backend.inject_backend_tests( None, # CPU tests testing.product({ 'use_cuda': [False], 'use_ideep': ['never', 'always'], }) # GPU tests + [{'use_cuda': ...
mit
crmccreary/openerp_server
openerp/addons/l10n_ch/account_wizard.py
8
1854
# -*- encoding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi. Copyright Camptocamp SA # Donors: Hasa Sàrl, Open Net Sàrl and Prisme Solutions Informatique SA # # This program is free software: you can redistribute it and/or modify # it un...
agpl-3.0
ryfeus/lambda-packs
Tensorflow_Pandas_Numpy/source3.6/tensorflow/contrib/bayesflow/python/ops/custom_grad.py
44
1222
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
mit
40123210/w17b_exam
static/Brython3.1.1-20150328-091302/Lib/test/test_int.py
765
12587
import sys import unittest from test.support import run_unittest L = [ ('0', 0), ('1', 1), ('9', 9), ('10', 10), ('99', 99), ('100', 100), ('314', 314), (' 314', 314), ('314 ', 314), (' \t\t 314 \t\t ', 314), (repr(sys.maxsize...
agpl-3.0
hashemd/Advanced-Virtual-Digest
libs/bs4/tests/test_html5lib.py
20
2299
"""Tests to ensure that the html5lib tree builder generates good trees.""" import warnings try: from bs4.builder import HTML5TreeBuilder HTML5LIB_PRESENT = True except ImportError, e: HTML5LIB_PRESENT = False from bs4.element import SoupStrainer from bs4.testing import ( HTML5TreeBuilderSmokeTest, ...
mit
wyom/sympy
sympy/functions/combinatorial/tests/test_comb_factorials.py
16
12552
from sympy import (S, Symbol, symbols, factorial, factorial2, binomial, rf, ff, gamma, polygamma, EulerGamma, O, pi, nan, oo, zoo, simplify, expand_func, Product) from sympy.functions.combinatorial.factorials import subfactorial from sympy.functions.special.gamma_functions import u...
bsd-3-clause
cadeef/murano-app-incubator
io.murano.apps.openstack.MuranoDashboard/Resources/scripts/settings.py
5
5035
import logging import os import sys import tempfile from openstack_dashboard import exceptions ROOT_PATH = os.path.dirname(os.path.abspath(__file__)) BIN_DIR = os.path.abspath(os.path.join(ROOT_PATH, '..', 'bin')) if ROOT_PATH not in sys.path: sys.path.append(ROOT_PATH) DEBUG = False TEMPLATE_DEBUG = DEBUG MET...
apache-2.0
jasonzzz/ansible
lib/ansible/plugins/callback/syslog_json.py
54
2725
# Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import logging import logging.handlers import socket from ansible.plugins.callback import CallbackBase class CallbackModule(CallbackBase): """ logs ansible-playbook a...
gpl-3.0
viniciusgama/blog_gae
djangoappengine/settings_base.py
13
1463
# Initialize App Engine SDK if necessary try: from google.appengine.api import api_proxy_stub_map except ImportError: from .boot import setup_env setup_env() from djangoappengine.utils import on_production_server, have_appserver DEBUG = not on_production_server TEMPLATE_DEBUG = DEBUG ROOT_URLCONF = 'urls...
bsd-3-clause
mhnatiuk/phd_sociology_of_religion
scrapper/build/cryptography/src/cryptography/exceptions.py
2
1131
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function class _Reasons(object): BACKEND_MISSING_INTERFACE = object() UNS...
gpl-2.0
alejob/mdanalysis
package/MDAnalysis/lib/formats/__init__.py
1
1067
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 # # MDAnalysis --- http://www.mdanalysis.org # Copyright (c) 2006-2016 The MDAnalysis Development Team and contributors # (see the file AUTHORS for the full list of names) # # Released under th...
gpl-2.0
liminspace/dju-common
dju_common/db.py
1
2044
# coding=utf-8 import gc from django.shortcuts import _get_queryset def get_object_or_None(klass, *args, **kwargs): """ Uses get() to return an object or None if the object does not exist. klass may be a Model, Manager, or QuerySet object. All other passed arguments and keyword arguments are used in t...
mit
mcollins12321/anita
venv/lib/python2.7/site-packages/setuptools/compat.py
456
2094
import sys import itertools PY3 = sys.version_info >= (3,) PY2 = not PY3 if PY2: basestring = basestring import __builtin__ as builtins import ConfigParser from StringIO import StringIO BytesIO = StringIO func_code = lambda o: o.func_code func_globals = lambda o: o.func_globals im_func...
mit
undoware/neutron-drive
google_appengine/lib/django_1_3/django/contrib/gis/utils/geoip.py
316
14811
""" This module houses the GeoIP object, a ctypes wrapper for the MaxMind GeoIP(R) C API (http://www.maxmind.com/app/c). This is an alternative to the GPL licensed Python GeoIP interface provided by MaxMind. GeoIP(R) is a registered trademark of MaxMind, LLC of Boston, Massachusetts. For IP-based geolocation, t...
bsd-3-clause
kkopachev/thumbor
thumbor/detectors/face_detector/__init__.py
2
1450
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/thumbor/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com thumbor@googlegroups.com from thumbor.detectors.local_detector import CascadeLoaderDetector f...
mit
mano3m/CouchPotatoServer
libs/migrate/versioning/schema.py
53
7595
""" Database schema version management. """ import sys import logging from sqlalchemy import (Table, Column, MetaData, String, Text, Integer, create_engine) from sqlalchemy.sql import and_ from sqlalchemy import exceptions as sa_exceptions from sqlalchemy.sql import bindparam from migrate import exceptions fro...
gpl-3.0
btoconnor/ddby
ddby/serializer.py
1
1436
# -*- coding: utf-8 -*- from .money import Money class Serializer: """Serialize a Money object for sending over the wire. It is not recommended to use the utility of this class to store in the database. This would prevent you from doing anything with aggregate functions in SQL, such as SUM, MAX,...
mit
lordmuffin/aws-cfn-plex
functions/credstash/cryptography/utils.py
13
3919
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import abc import binascii import inspect import sys import warnings # ...
mit
Sup3Roque/Pancas
plugin.video.loganaddon/resources/lib/libraries/playcount_cp.py
9
4289
# -*- coding: utf-8 -*- ''' Specto Add-on Copyright (C) 2015 lambda 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 l...
gpl-2.0
kurdd/Oauth
social_auth/backends/contrib/yandex.py
3
4660
""" Yandex OpenID and OAuth2 support. This contribution adds support for Yandex.ru OpenID service in the form openid.yandex.ru/user. Username is retrieved from the identity url. If username is not specified, OpenID 2.0 url used for authentication. """ from django.utils import simplejson from urllib import urlencode ...
apache-2.0
adamewing/tebreak
scripts/misc/genotype_ref.py
1
4350
#!/usr/bin/env python import argparse import csv import os import pysam def break_count(bam, chrom, poslist, minpad=5, flex=1, minmapq=10): ''' ref = number of reads spanning TSD, alt = number of reads clipped at breakpoint in poslist ''' altcount = 0 refcount = 0 discards = 0 poslist = list(po...
mit
ericlink/adms-server
playframework-dist/1.1-src/python/Lib/idlelib/ParenMatch.py
2
6783
"""ParenMatch -- An IDLE extension for parenthesis matching. When you hit a right paren, the cursor should move briefly to the left paren. Paren here is used generically; the matching applies to parentheses, square brackets, and curly braces. """ from HyperParser import HyperParser from configHandler import ...
mit
surligas/cs436-gnuradio
gr-digital/examples/example_costas.py
49
5316
#!/usr/bin/env python # # Copyright 2011-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 optio...
gpl-3.0
xpac1985/ansible
test/units/module_utils/basic/test_heuristic_log_sanitize.py
48
3908
# -*- coding: utf-8 -*- # (c) 2015, 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 # (a...
gpl-3.0
jMyles/AutobahnPython
autobahn/autobahn/compress_base.py
46
1628
############################################################################### ## ## Copyright 2013 Tavendo GmbH ## ## 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-2.0
dchabot/ophyd
ophyd/scaler.py
2
1571
import logging from collections import OrderedDict from .signal import (EpicsSignal, EpicsSignalRO) from .device import Device from .device import (Component as C, DynamicDeviceComponent as DDC) logger = logging.getLogger(__name__) def _scaler_fields(attr_base, field_base, range_, **kwargs): defn = OrderedDic...
bsd-3-clause
rcaelers/workrave
testconf.py
9
1287
#!/usr/bin/python import os; import sys; options = [ "gconf", "xml", "gnome3", "indicator", "distribution", "gstreamer", "dbus", "exercises", "pulse", "debug", "x11-monitoring-fallback", ...
gpl-3.0
moyogo/robofab
Lib/robofab/pens/filterPen.py
9
12103
"""A couple of point pens to filter contours in various ways.""" from fontTools.pens.basePen import AbstractPen, BasePen from robofab.pens.pointPen import AbstractPointPen from robofab.objects.objectsRF import RGlyph as _RGlyph from robofab.objects.objectsBase import _interpolatePt import math # # threshold filter...
bsd-3-clause
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/pip/_vendor/colorama/ansi.py
640
2524
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. ''' This module generates ANSI character codes to printing colors to terminals. See: http://en.wikipedia.org/wiki/ANSI_escape_code ''' CSI = '\033[' OSC = '\033]' BEL = '\007' def code_to_chars(code): return CSI + str(code) + 'm' def set...
gpl-3.0
ennoborg/gramps
gramps/plugins/tool/verify.py
1
66904
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2008 Brian G. Matherly # Copyright (C) 2010 Jakim Friant # Copyright (C) 2011 Paul Franklin # # This program is free software; you can redistribute it and/or modify # it under the terms o...
gpl-2.0
mdpiper/dakota-experiments
experiments/beaver-creek-lsq/long_profile.py
1
8531
#! /usr/bin/env python from __future__ import print_function import argparse import re import numpy as np import matplotlib.pyplot as plt import seaborn as sns def str2num(s): try: return int(s) except ValueError: return float(s) class Dakota(object): FLOAT_REGEX = '[-+]?[0-9]*\.?[0-9]...
mit
jorgb/airs
gui/images/icon_visit_site.py
1
3226
#---------------------------------------------------------------------- # This file was generated by D:\src\cvl_repository\wxpython\framework\images\make_images.py # from wx import ImageFromStream, BitmapFromImage, EmptyIcon import cStringIO, zlib def getData(): return zlib.decompress( 'x\xda\x01\x98\x03...
gpl-2.0
richpolis/siveinpy
env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/poolmanager.py
550
8977
# urllib3/poolmanager.py # Copyright 2008-2014 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 import logging try: # Python 3 from urllib.parse import urljoin except ImportError: ...
mit
ssssam/ansible-modules-core
utilities/logic/fail.py
86
1443
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2012 Dag Wieers <dag@wieers.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 Lice...
gpl-3.0