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
kennethreitz/its.py
its.py
1
1616
# -*- coding: utf-8 -*- """ its.py ~~~~~ System environment flags. """ import sys import struct # ------- # Pythons # ------- # Syntax sugar. _ver = sys.version_info #: Python 2.x? py2 = (_ver[0] == 2) #: Python 3.x? py3 = (_ver[0] == 3) #: Python 3.0.x py30 = (py3 and _ver[1] == 0) #: Python 3.1.x py31 = (py...
bsd-2-clause
schambers/civmarket
civmarket/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/escprober.py
2936
3187
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
apache-2.0
olduvaihand/ProjectEuler
src/python/problem426.py
1
1784
# -*- coding: utf-8 -*- # ProjectEuler/src/python/problem426.py # # Box-ball system # =============== # Published on Saturday, 4th May 2013, 07:00 pm # # Consider an infinite row of boxes. Some of the boxes contain a ball. For # example, an initial configuration of 2 consecutive occupied boxes followed by # 2 empty bo...
mit
nvoron23/hue
desktop/core/ext-py/Django-1.6.10/django/templatetags/future.py
130
1640
from django.template import Library from django.template import defaulttags register = Library() @register.tag def ssi(parser, token): # Used for deprecation path during 1.3/1.4, will be removed in 2.0 return defaulttags.ssi(parser, token) @register.tag def url(parser, token): # Used for deprecation pa...
apache-2.0
Dineshs91/youtube-dl
youtube_dl/jsinterp.py
105
8846
from __future__ import unicode_literals import json import operator import re from .utils import ( ExtractorError, ) _OPERATORS = [ ('|', operator.or_), ('^', operator.xor), ('&', operator.and_), ('>>', operator.rshift), ('<<', operator.lshift), ('-', operator.sub), ('+', operator.add...
unlicense
liamgh/liamgreenhughes-sl4a-tf101
python/gdata/samples/base/baseItemTypesQueryExample.py
89
1279
#!/usr/bin/python # # Copyright (C) 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
zchking/odoo
openerp/addons/base/res/res_users.py
40
46628
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you ca...
agpl-3.0
ArnossArnossi/django
tests/template_tests/filter_tests/test_dictsort.py
342
1477
from django.template.defaultfilters import dictsort from django.test import SimpleTestCase class FunctionTests(SimpleTestCase): def test_sort(self): sorted_dicts = dictsort( [{'age': 23, 'name': 'Barbara-Ann'}, {'age': 63, 'name': 'Ra Ra Rasputin'}, {'name': 'Jonny B...
bsd-3-clause
sauloal/cnidaria
scripts/venv/lib/python2.7/site-packages/ete2/tools/phylobuild_lib/configobj.py
3
89622
# #START_LICENSE########################################################### # # # This file is part of the Environment for Tree Exploration program # (ETE). http://etetoolkit.org # # ETE is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # t...
mit
saurvs/servo
tests/wpt/css-tests/tools/pywebsocket/src/test/test_memorizingfile.py
496
4252
#!/usr/bin/env python # # Copyright 2011, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
mpl-2.0
ryfeus/lambda-packs
HDF4_H5_NETCDF/source2.7/numpy/doc/misc.py
8
6190
""" ============= Miscellaneous ============= IEEE 754 Floating Point Special Values -------------------------------------- Special values defined in numpy: nan, inf, NaNs can be used as a poor-man's mask (if you don't care what the original value was) Note: cannot use equality to test NaNs. E.g.: :: >>> myarr = ...
mit
GearsAD/semisorted_arnerve
sandbox/Dans_TestBed/Testbed/MenuItem.py
1
8202
''' Created on Nov 11, 2014 @author: alucard ''' import vtk from SceneObject import SceneObject class MenuItem(SceneObject): def __init__(self, renderer, screenDistance, width, height, parent, name, image, callbackObject = None, callbackFunction = None): #renderer.AddObserver("LeftButtonPr...
mit
lbjay/cds-invenio
modules/websubmit/lib/functions/Ask_For_Record_Details_Confirmation.py
4
5992
## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN. ## ## CDS Invenio 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 (...
gpl-2.0
huyqta/bootstrap
test-infra/s3_cache.py
2166
5734
#!/usr/bin/env python2.7 # pylint: disable=C0301 from __future__ import absolute_import, unicode_literals, print_function, division from sys import argv from os import environ, stat, chdir, remove as _delete_file from os.path import dirname, basename, abspath, realpath, expandvars from hashlib import sha256 from subpr...
mit
samsu/neutron
tests/unit/vmware/vshield/fake_vcns.py
9
22230
# Copyright 2013 VMware, 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...
apache-2.0
MechCoder/scikit-learn
benchmarks/bench_plot_omp_lars.py
72
4514
"""Benchmarks of orthogonal matching pursuit (:ref:`OMP`) versus least angle regression (:ref:`least_angle_regression`) The input data is mostly low rank but is a fat infinite tail. """ from __future__ import print_function import gc import sys from time import time import six import numpy as np from sklearn.linea...
bsd-3-clause
datapythonista/pandas
pandas/tests/arrays/boolean/test_logical.py
7
8486
import operator import numpy as np import pytest import pandas as pd import pandas._testing as tm from pandas.arrays import BooleanArray from pandas.tests.extension.base import BaseOpsUtil class TestLogicalOps(BaseOpsUtil): def test_numpy_scalars_ok(self, all_logical_operators): a = pd.array([True, Fals...
bsd-3-clause
mrrrgn/AutobahnPython
examples/twisted/wamp/basic/rpc/timeservice/frontend.py
8
1365
############################################################################### ## ## Copyright (C) 2014 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:/...
apache-2.0
flavour/tldrmp
private/templates/SandyRelief/config.py
2
40113
# -*- coding: utf-8 -*- try: # Python 2.7 from collections import OrderedDict except: # Python 2.6 from gluon.contrib.simplejson.ordered_dict import OrderedDict from gluon import current, TR, TD, DIV from gluon.storage import Storage T = current.T settings = current.deployment_settings """ Templ...
mit
mbrubeck/servo
tests/wpt/web-platform-tests/webdriver/tests/execute_script/user_prompts.py
1
3693
import pytest from webdriver import error from tests.support.asserts import assert_success def execute_script(session, script, args=None): if args is None: args = [] body = {"script": script, "args": args} return session.transport.send( "POST", "/session/{session_id}/execute/sync".forma...
mpl-2.0
3D-e-Chem/python-modified-tanimoto
kripodb/script/similarities.py
2
14181
import argparse import csv from tables import parameters from .. import pairs from ..db import FragmentsDb from ..frozen import FrozenSimilarityMatrix from ..hdf5 import SimilarityMatrix def make_similarities_parser(subparsers): """Creates a parser for similarities sub commands Args: subparsers (arg...
apache-2.0
orange-tv-blagnac/selenium
py/test/selenium/webdriver/common/utils.py
52
1991
# Copyright 2008-2009 WebDriver committers # Copyright 2008-2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
MadeInHaus/haus-start
setup.py
1
1376
#!/usr/bin/env python from distutils.core import setup import glob import os import subprocess base_path = os.path.abspath(os.path.join(os.path.dirname(__file__), 'haus_start')) data_files = [] for dirpath, dirnames, filenames in os.walk(os.path.join(base_path, 'templates')): # Ignore dirnames that start with '....
mit
Rav3nPL/PLNcoin
qa/rpc-tests/maxuploadtarget.py
44
9176
#!/usr/bin/env python3 # Copyright (c) 2015-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.mininode import * from test_framework.test_framework import BitcoinTestFramework from...
mit
jagguli/intellij-community
python/helpers/docutils/utils.py
40
24558
# $Id: utils.py 6394 2010-08-20 11:26:58Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Miscellaneous utilities for the documentation utilities. """ __docformat__ = 'reStructuredText' import sys import os import os.path import warnings import ...
apache-2.0
eemirtekin/edx-platform
common/djangoapps/util/file.py
57
6960
""" Utility methods related to file handling. """ from datetime import datetime import os from pytz import UTC from django.core.exceptions import PermissionDenied from django.core.files.storage import DefaultStorage, get_valid_filename from django.utils.translation import ugettext as _ from django.utils.translation i...
agpl-3.0
gskachkov/phantomjs
src/qt/qtbase/src/3rdparty/freetype/src/tools/docmaker/sources.py
367
10766
# Sources (c) 2002, 2003, 2004, 2006, 2007, 2008, 2009 # David Turner <david@freetype.org> # # # this file contains definitions of classes needed to decompose # C sources files into a series of multi-line "blocks". There are # two kinds of blocks: # # - normal blocks, which contain source code or ordinary comment...
bsd-3-clause
abstract-open-solutions/OCB
addons/mail/tests/test_mail_message.py
116
27451
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
Fierydemise/ShadowCraft-Engine
shadowcraft/calcs/rogue/Aldriana/__init__.py
1
144984
from __future__ import division #import copy from future import standard_library standard_library.install_aliases() from builtins import map from builtins import range import gettext import builtins import math from operator import add from copy import copy _ = gettext.gettext from shadowcraft.calcs.rogue import Rogu...
lgpl-3.0
robobrobro/ballin-octo-shame
lib/Python-3.4.3/Lib/concurrent/futures/process.py
93
17574
# Copyright 2009 Brian Quinlan. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Implements ProcessPoolExecutor. The follow diagram and text describe the data-flow through the system: |======================= In-process =====================|== Out-of-process ==| +----------+ +----------...
mit
JsNoNo/scikit-learn
sklearn/datasets/olivetti_faces.py
198
4688
"""Modified Olivetti faces dataset. The original database was available from (now defunct) http://www.uk.research.att.com/facedatabase.html The version retrieved here comes in MATLAB format from the personal web page of Sam Roweis: http://www.cs.nyu.edu/~roweis/ There are ten different images of each of 40...
bsd-3-clause
akash1808/nova_test_latest
nova/api/openstack/compute/plugins/v3/quota_sets.py
18
8032
# Copyright 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
davidzheng/chippy
chippy/cpu.py
1
17660
import os import random class CPU(object): """ The Chip-8 has 4KB of RAM from 0x000 to 0xFFF. The original interpreter is stored in memory from 0x000 to 0x1FF so most programs will start at 0x200. The Chip-8 has 16 8-bit registers and a 16-bit register that stores memory addresses. There are also 2 8-...
gpl-3.0
twobraids/socorro
alembic/versions/477e1c6e6df3_fixes_bug_933963_spl.py
14
2425
"""Fixes bug 933963 Split up Signature Summary jobs Revision ID: 477e1c6e6df3 Revises: 317e15fbf13a Create Date: 2013-11-01 15:45:34.884331 """ # revision identifiers, used by Alembic. revision = '477e1c6e6df3' down_revision = '18b22de09433' from alembic import op from socorro.lib import citexttype, jsontype from s...
mpl-2.0
Qalthos/ansible
lib/ansible/modules/net_tools/ipify_facts.py
40
2944
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2015, René Moser <mail@renemoser.net> # 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':...
gpl-3.0
mangadul/WhatsAppy
yowsup/demos/sendclient/layer.py
20
2017
from yowsup.layers.interface import YowInterfaceLayer, ProtocolEntityCallback from yowsup.layers.protocol_messages.protocolentities import TextMessageProtocolEntity from yowsup.common.tools import Jid import threading import logging logger = logging.getLogger(__name__) class SendLayer(YowInt...
gpl-3.0
droidlabour/git_intgrtn_aws_s3
CreateSSHKey/Crypto/SelfTest/Cipher/__init__.py
117
2401
# -*- coding: utf-8 -*- # # SelfTest/Cipher/__init__.py: Self-test for cipher modules # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication ...
mit
ayust/pluss
pluss/util/ratelimit.py
1
1111
import functools from pluss.app import app from pluss.util.cache import Cache RATE_LIMIT_CACHE_KEY_TEMPLATE = 'pluss--remoteip--ratelimit--1--%s' def ratelimited(func): """Includes the wrapped handler in the global rate limiter (60 calls/min).""" @functools.wraps(func) def wrapper(*args, **kwargs): ...
mit
imsplitbit/nova
nova/db/sqlalchemy/migrate_repo/versions/208_expand_compute_node.py
11
1943
# Copyright 2013 OpenStack Foundation # # 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
navgurukul/python-examples
general-exercise-4.py
2
1106
# Yeh exercise hai # Har line of code se pehle aapko ek line mei comment mei daal kar likhna hai, ki uss line of code ka matlab kya hai # Aap jyada comments bhi likh sakte hai, jitne jyada comments likhenge, utna aapkya fayda hoga # Question 1 # Palindromes woh shabd hote hain jo aage se likho ya piche se likho same...
gpl-3.0
timbooo/traktforalfred
dateutil/easter.py
202
2611
# -*- coding: utf-8 -*- """ This module offers a generic easter computing method for any given year, using Western, Orthodox or Julian algorithms. """ import datetime __all__ = ["easter", "EASTER_JULIAN", "EASTER_ORTHODOX", "EASTER_WESTERN"] EASTER_JULIAN = 1 EASTER_ORTHODOX = 2 EASTER_WESTERN = 3 def easter(year,...
mit
leonardomaccari/communityNetworkMonitor
src/plugins/FFGraz.py
1
10303
# @copyright Leonardo Maccari: leonardo.maccari@unitn.it # released under GPLv3 license from mechanize import Browser from threading import Thread from ConfigParser import Error import time from BeautifulSoup import BeautifulSoup from sqlalchemy import desc import gzip import pygraphviz as pg import networkx as nx im...
gpl-3.0
thumbimigwe/golber
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexer.py
95
26928
# -*- coding: utf-8 -*- """ pygments.lexer ~~~~~~~~~~~~~~ Base lexer classes. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re, itertools from pygments.filter import apply_filters, Filter from pygments.filters import get_filt...
mit
marinho/geraldo
site/newsite/site-geraldo/appengine_django/db/base.py
58
5010
#!/usr/bin/python2.4 # # Copyright 2008 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
lgpl-3.0
zrhans/pythonanywhere
.virtualenvs/django19/lib/python3.4/site-packages/django/db/models/fields/related_descriptors.py
34
47078
""" Accessors for related objects. When a field defines a relation between two models, each model class provides an attribute to access related instances of the other model class (unless the reverse accessor has been disabled with related_name='+'). Accessors are implemented as descriptors in order to customize acces...
apache-2.0
TusharAgey/seventhsem
IS/Assignment5/pyAES.py
1
28835
#!/usr/bin/python # # aes.py: implements AES - Advanced Encryption Standard # from the SlowAES project, http://code.google.com/p/slowaes/ # # Copyright (c) 2008 Josh Davis ( http://www.josh-davis.org ), # Alex Martelli ( http://www.aleax.it ) # # Ported from C code written by Laurent Haan ( http://www.prog...
gpl-3.0
qt-labs/qbs
src/3rdparty/python/lib/python2.7/site-packages/biplist/__init__.py
7
37313
"""biplist -- a library for reading and writing binary property list files. Binary Property List (plist) files provide a faster and smaller serialization format for property lists on OS X. This is a library for generating binary plists which can be read by OS X, iOS, or other clients. The API models the plistlib API,...
lgpl-2.1
thaim/ansible
lib/ansible/module_utils/network/eos/providers/cli/config/bgp/process.py
26
5977
# # (c) 2019, Ansible by Red Hat, inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # import re from ansible.module_utils.six import iteritems from ansible.module_utils.network.common.utils import to_list from ansible.module_utils.network.eos.providers.providers import re...
mit
pducks32/intergrala
python/sympy/sympy/physics/unitsystems/simplifiers.py
57
2864
# -*- coding: utf-8 -*- """ Several methods to simplify expressions involving unit objects. """ from __future__ import division from sympy import Add, Mul, Pow from sympy.core.compatibility import reduce from sympy.physics.unitsystems import Dimension, Unit, Quantity def dim_simplify(expr): """ Simplify ex...
mit
amitsela/incubator-beam
sdks/python/apache_beam/utils/value_provider_test.py
4
6800
# # 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
Alberto-Beralix/Beralix
i386-squashfs-root/usr/share/pyshared/oneconf/dbusconnect.py
1
7299
# Copyright (C) 2010 Canonical # # Authors: # 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 as published by the Free Software # Foundation; version 3. # # This program is distributed in the hope that it...
gpl-3.0
lmazuel/autorest
src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDateTimeRfc1123/auto_rest_rfc1123_date_time_test_service/operations/datetimerfc1123_operations.py
2
16699
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
bancor/bancorcoin
contrib/bitrpc/bitrpc.py
20
7835
from jsonrpc import ServiceProxy import sys import string # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:9335") else: access = Ser...
mit
funtoo/portage-funtoo
pym/_emerge/EbuildMetadataPhase.py
1
6706
# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from _emerge.SubProcess import SubProcess import sys from portage.cache.mappings import slot_dict_class import portage portage.proxy.lazyimport.lazyimport(globals(), 'portage.package.ebuild._metadata_invalid:eap...
gpl-2.0
erikr/django
django/db/backends/sqlite3/base.py
7
19686
""" SQLite3 backend for django. Works with either the pysqlite2 module or the sqlite3 module in the standard library. """ from __future__ import unicode_literals import datetime import decimal import re import warnings import pytz from django.conf import settings from django.db import utils from django.db.backends ...
bsd-3-clause
reinaH/osf.io
website/addons/dataverse/tests/test_provider.py
29
1545
import httplib as http from nose.tools import * # noqa import mock from framework.exceptions import HTTPError from website.addons.dataverse.tests.utils import ( create_mock_connection, DataverseAddonTestCase, create_external_account, ) from website.addons.dataverse.provider import DataverseProvider class TestD...
apache-2.0
zasdfgbnm/tensorflow
tensorflow/contrib/learn/python/learn/estimators/__init__.py
34
12484
# 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
xkcd1253/SocialNetworkforTwo
flask/lib/python2.7/site-packages/wtforms/fields/html5.py
13
1820
""" Fields to support various HTML5 input types. """ from ..widgets import html5 as widgets from . import core __all__ = ( 'DateField', 'DateTimeField', 'DateTimeLocalField', 'DecimalField', 'DecimalRangeField', 'EmailField', 'IntegerField', 'IntegerRangeField', 'SearchField', 'TelField', 'URLField', ) c...
gpl-2.0
andyliuliming/azure-linux-extensions
TestHandlerLinux/installer/install.py
16
2902
#!/usr/bin/env python """ Example Azure Handler script for Linux IaaS Install example Reads port from Public Config if present. Creates service_port.txt in resources dir. """ import os import imp import time waagent=imp.load_source('waagent','/usr/sbin/waagent') from waagent import LoggerInit hutil=imp.load_source('...
apache-2.0
lonetwin/pydown
pygments/lexers/_asybuiltins.py
26
27319
# -*- coding: utf-8 -*- """ pygments.lexers._asybuiltins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This file contains the asy-function names and asy-variable names of Asymptote. Do not edit the ASYFUNCNAME and ASYVARNAME sets by hand. TODO: perl/python script in Asymptote SVN similar to asy-list.pl but onl...
mit
cnelsonsic/Liquor-Cabinet
sqlalchemy/sql/functions.py
19
3067
from sqlalchemy import types as sqltypes from sqlalchemy.sql.expression import ( ClauseList, Function, _literal_as_binds, text, _type_from_args ) from sqlalchemy.sql import operators from sqlalchemy.sql.visitors import VisitableType class _GenericMeta(VisitableType): def __call__(self, *args, **kwargs): ...
gpl-3.0
spcui/tp-qemu
qemu/tests/live_snapshot_chain.py
7
6271
from virttest import storage from virttest import qemu_storage from virttest import data_dir from autotest.client.shared import error import re import logging import time @error.context_aware def run(test, params, env): """ live_snapshot chain test: Will test snapshot as following steps: 1. Boot up g...
gpl-2.0
mzizzi/ansible
lib/ansible/modules/cloud/amazon/s3.py
27
31575
#!/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 distributed...
gpl-3.0
thaihungle/deepexp
drl/qdl.py
1
7102
import gym import numpy as np import random import tensorflow as tf import matplotlib.pyplot as plt # Create model def multilayer_perceptron(x, weights, biases): #somehow drl performs worse with complex layers # Hidden layer with RELU activation layer_1 = tf.matmul(x, weights['h1']) layer_1 = tf.nn.rel...
mit
boyuegame/kbengine
kbe/res/scripts/common/Lib/test/test_decorators.py
182
9828
import unittest from test import support def funcattrs(**kwds): def decorate(func): func.__dict__.update(kwds) return func return decorate class MiscDecorators (object): @staticmethod def author(name): def decorate(func): func.__dict__['author'] = name r...
lgpl-3.0
coto/beecoss
bp_includes/lib/facebook.py
48
21573
#!/usr/bin/env python # # Copyright 2010 Facebook # # 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...
lgpl-3.0
DJMIN/zaproxy
python/api/src/zapv2/script.py
15
2258
# Zed Attack Proxy (ZAP) and its related class files. # # ZAP is an HTTP/HTTPS proxy for assessing web application security. # # Copyright 2015 the ZAP development team # # 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...
apache-2.0
sebastic/QGIS
python/plugins/processing/algs/qgis/SumLines.py
1
5011
# -*- coding: utf-8 -*- """ *************************************************************************** SumLines.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ******************************...
gpl-2.0
Magnetic/HuntingWabbits
setup.py
1
1248
import os from setuptools import find_packages, setup with open(os.path.join(os.path.dirname(__file__), "README.rst")) as readme: long_description = readme.read() classifiers = [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "P...
mit
Rajeshkumar90/ansible-modules-extras
cloud/ovirt/ovirt_users.py
9
4811
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat, Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or #...
gpl-3.0
TathagataChakraborti/resource-conflicts
PLANROB-2015/py2.5/lib/python2.5/test/test_macpath.py
43
2190
import macpath from test import test_support import unittest class MacPathTestCase(unittest.TestCase): def test_abspath(self): self.assert_(macpath.abspath("xx:yy") == "xx:yy") def test_isabs(self): isabs = macpath.isabs self.assert_(isabs("xx:yy")) self.assert_(isabs("xx:yy:...
mit
j4/horizon
openstack_dashboard/dashboards/project/instances/workflows/update_instance.py
39
5731
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
apache-2.0
insidenothing/3D-Printing-Software
skein_engines/skeinforge-35/fabmetheus_utilities/fabmetheus_tools/wikifier.py
6
8218
""" Wikifier is a script to add spaces to the pydoc files and move them to the documentation folder. """ from __future__ import absolute_import #Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module. import __init__ ...
gpl-2.0
Tiotao/morpherpy
env/Lib/encodings/unicode_escape.py
852
1184
""" Python 'unicode-escape' Codec Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ import codecs ### Codec APIs class Codec(codecs.Codec): # Note: Binding these as C functions will result in the class not # converting them to methods. This is inte...
mit
PyPSA/PyPSA
setup.py
1
1531
from __future__ import absolute_import from setuptools import setup, find_packages from codecs import open with open('README.rst', encoding='utf-8') as f: long_description = f.read() setup( name='pypsa', version='0.17.1', author='Tom Brown (FIAS, KIT), Jonas Hoersch (FIAS, KIT), Fabian Hofmann (FI...
gpl-3.0
amitbend/Django-CMS-tutorial-project-django-1.8-
faq/migrations/0001_initial.py
2
2015
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import app_data.fields import aldryn_apphooks_config.fields class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Entry', ...
gpl-2.0
ericfc/django
tests/auth_tests/test_hashers.py
185
15899
# -*- coding: utf-8 -*- from __future__ import unicode_literals from unittest import skipUnless from django.conf.global_settings import PASSWORD_HASHERS from django.contrib.auth.hashers import ( UNUSABLE_PASSWORD_PREFIX, UNUSABLE_PASSWORD_SUFFIX_LENGTH, BasePasswordHasher, PBKDF2PasswordHasher, PBKDF2SHA1Pass...
bsd-3-clause
westinedu/similarinterest
django/contrib/flatpages/tests/middleware.py
10
6649
import os from django.conf import settings from django.contrib.auth.models import User from django.contrib.flatpages.models import FlatPage from django.test import TestCase from django.test.utils import override_settings @override_settings( LOGIN_URL='/accounts/login/', MIDDLEWARE_CLASSES=( 'django.mi...
bsd-3-clause
sahiljain/catapult
third_party/gsutil/third_party/boto/tests/integration/s3/test_multipart.py
110
8408
# -*- coding: utf-8 -*- # Copyright (c) 2011 Mitch Garnaat http://garnaat.org/ # All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # witho...
bsd-3-clause
Nicop06/ansible
lib/ansible/plugins/connection/lxc.py
44
8156
# (c) 2015, Joerg Thalheim <joerg@higgsboson.tk> # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ author: Joerg Thalheim <joe...
gpl-3.0
makokal/funzo
examples/gridworld/gridworld_planning.py
1
1745
from __future__ import division import argparse import matplotlib matplotlib.use('Qt4Agg') from matplotlib import pyplot as plt plt.style.use('fivethirtyeight') import numpy as np from funzo.domains.gridworld import GridWorld, GridWorldMDP from funzo.domains.gridworld import GReward, GRewardLFA, GTransition from f...
mit
HM2MC/Webfront
reportlab-2.5/src/reportlab/pdfbase/cidfonts.py
10
18903
#Copyright ReportLab Europe Ltd. 2000-2004 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/pdfbase/cidfonts.py #$Header $ __version__=''' $Id: cidfonts.py 3710 2010-05-14 16:00:58Z rgbecker $ ''' __doc__="""CID (Asian multi-byte) font support...
mit
LukeM12/samba
lib/dnspython/dns/rdtypes/dsbase.py
100
3460
# Copyright (C) 2010, 2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND...
gpl-3.0
ltilve/chromium
third_party/typ/typ/fakes/host_fake.py
36
8276
# Copyright 2014 Dirk Pranke. 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...
bsd-3-clause
pmaunz/pyqtgraph
pyqtgraph/opengl/items/GLSurfacePlotItem.py
52
5204
from OpenGL.GL import * from .GLMeshItem import GLMeshItem from .. MeshData import MeshData from ...Qt import QtGui import numpy as np __all__ = ['GLSurfacePlotItem'] class GLSurfacePlotItem(GLMeshItem): """ **Bases:** :class:`GLMeshItem <pyqtgraph.opengl.GLMeshItem>` Displays a surface plot on a r...
mit
simonw/bugle_project
bugle_project/registration/views.py
2
1257
from django.conf import settings from django.contrib import auth from django.contrib.auth.models import User from django.http import HttpResponseRedirect from django.shortcuts import render_to_response from django.template import RequestContext from registration.forms import RegistrationForm def register(request, nex...
bsd-2-clause
SBillion/aegroupware
account/views.py
1
1678
# -*-coding:utf-8 -* from django.shortcuts import render_to_response from django.template import RequestContext from django.http import HttpResponse from django.http import HttpResponseRedirect from django import forms from django.contrib import auth from django.contrib.auth.decorators import login_required from django...
mit
yvaucher/hr
__unported__/hr_report_turnover/report/employee_turnover.py
2
4949
#-*- coding:utf-8 -*- # # # Copyrigth (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.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 Free Software Foundation, either version 3 of the License...
agpl-3.0
Casimir666/libforensics
code/lf/fs/fat/consts.py
13
1953
# Copyright 2009 Michael Murr # # This file is part of LibForensics. # # LibForensics is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ver...
lgpl-3.0
vikhyat/dask
dask/hdfs_utils.py
2
1079
from __future__ import absolute_import, division, print_function from fnmatch import fnmatch def filenames(hdfs, path): """ Filenames in Hadoop File System under specific path Parameters ---------- hdfs: pywebhdfs.webhdfs.PyWebHdfsClient instance path: string Directory on HDFS ...
bsd-3-clause
gangadhar-kadam/powapp
selling/doctype/device_group/device_group.py
2
1071
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt # For license information, please see license.txt from __future__ import unicode_literals import webnotes from webnotes import msgprint, _ from webnotes.utils import cint,cstr class DocType: def __init__(self, d, ...
agpl-3.0
nju520/django
tests/migrations/test_operations.py
83
93332
from __future__ import unicode_literals import unittest from django.db import connection, migrations, models, transaction from django.db.migrations.migration import Migration from django.db.migrations.state import ProjectState from django.db.models.fields import NOT_PROVIDED from django.db.transaction import atomic f...
bsd-3-clause
dmoliveira/networkx
networkx/classes/tests/test_special.py
48
3728
#!/usr/bin/env python from nose.tools import * import networkx as nx from test_graph import TestGraph from test_digraph import TestDiGraph from test_multigraph import TestMultiGraph from test_multidigraph import TestMultiDiGraph try: # python 2.7+ from collections import OrderedDict except ImportError: # python 2...
bsd-3-clause
kemalakyol48/python-for-android
python3-alpha/python3-src/Tools/demo/rpythond.py
107
1286
#!/usr/bin/env python3 """ Remote python server. Execute Python commands remotely and send output back. WARNING: This version has a gaping security hole -- it accepts requests from any host on the Internet! """ import sys from socket import socket, AF_INET, SOCK_STREAM import io import traceback PORT = 4127 BUFSIZE...
apache-2.0
wimnat/ansible
test/units/module_utils/facts/network/test_iscsi_get_initiator.py
68
2396
# -*- coding: utf-8 -*- # Copyright (c) 2019 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type from ansible.module_utils.facts.network import iscsi from units.compat.mock im...
gpl-3.0
jeedom/plugin-openzwave
resources/openzwaved/ozwave/manager_utils.py
1
1639
import logging import globals from openzwave.option import ZWaveOption from utilities.FilesManager import FilesManager def init_manager(): globals.options = ZWaveOption(globals.device, config_path=globals.config_folder, user_path=globals.data_folder, cmd_line="") globals.options.set_log_file("../../../log/openzwaved...
gpl-2.0
andrewcbennett/iris
lib/iris/tests/test_analysis.py
3
50729
# (C) British Crown Copyright 2010 - 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...
gpl-3.0
eebssk1/CAF_MSM_Kernel_msm8916_64
tools/perf/scripts/python/syscall-counts-by-pid.py
11180
1927
# system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os, sys sys.path.append(os.env...
gpl-2.0
nagyistoce/netzob
src/netzob/Common/MMSTD/Dictionary/Variables/_HexVariable.py
1
12864
# -*- coding: utf-8 -*- #+---------------------------------------------------------------------------+ #| 01001110 01100101 01110100 01111010 01101111 01100010 | #| | #| Netzob : Inferring communication protocol...
gpl-3.0
kedaio/tushare
test/ref_test.py
36
1507
# -*- coding:utf-8 -*- ''' Created on 2015/3/14 @author: Jimmy Liu ''' import unittest from tushare.stock import reference as fd class Test(unittest.TestCase): def set_data(self): self.code = '600848' self.start = '2015-01-03' self.end = '2015-04-07' self.year = 2014...
bsd-3-clause