repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
yaybu/touchdown | touchdown/provisioner/fuselage.py | 1 | 4827 | # Copyright 2015 Isotoma Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | apache-2.0 |
fillycheezstake/MissionPlanner | Lib/site-packages/scipy/optimize/info.py | 55 | 2661 | """
Optimization Tools
==================
General-purpose Optimization Routines
-------------------------------------
.. autosummary::
:toctree: generated/
fmin - Nelder-Mead Simplex algorithm
fmin_powell - Powell's (modified) level set method
fmin_cg - Non-linear (Polak-Ribiere) conjugate gradient algor... | gpl-3.0 |
GNOME/mutter | src/backends/native/gen-default-modes.py | 2 | 3605 | #!/usr/bin/env python3
# Copyright (C) 2016 Red Hat Inc.
#
# 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 version.
#
# This pro... | gpl-2.0 |
goldsborough/.emacs | .emacs.d/.python-environments/default/lib/python3.5/sre_parse.py | 7 | 34964 | #
# Secret Labs' Regular Expression Engine
#
# convert re-style regular expression to sre pattern
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support module for sre"""
# XXX: show string offset and offending ch... | mit |
PepperPD/edx-pepper-platform | common/lib/xmodule/xmodule/contentstore/content.py | 5 | 9762 | XASSET_LOCATION_TAG = 'c4x'
XASSET_SRCREF_PREFIX = 'xasset:'
XASSET_THUMBNAIL_TAIL_NAME = '.jpg'
import os
import logging
import StringIO
from xmodule.modulestore import Location
from .django import contentstore
# to install PIL on MacOSX: 'easy_install http://dist.repoze.org/PIL-1.1.6.tar.gz'
from PIL import Image
... | agpl-3.0 |
verdurin/easybuild-easyblocks | easybuild/easyblocks/t/totalview.py | 12 | 2689 | ##
# This file is an EasyBuild reciPY as per https://github.com/hpcugent/easybuild
#
# Copyright:: Copyright 2012-2015 Uni.Lu/LCSB, NTUA
# Authors:: Fotis Georgatos <fotis@cern.ch>
# License:: MIT/GPL
# $Id$
#
# This work implements a part of the HPCBIOS project and is a component of the policy:
# http://hpcbios.re... | gpl-2.0 |
NMGRL/pychron | pychron/hardware/core/communicators/rpc_communicator.py | 2 | 3183 | # ===============================================================================
# Copyright 2012 Jake Ross
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licens... | apache-2.0 |
dparlevliet/zelenka-report-storage | server-db/twisted/web/test/test_script.py | 60 | 2186 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.web.script}.
"""
import os
from twisted.trial.unittest import TestCase
from twisted.web.http import NOT_FOUND
from twisted.web.script import ResourceScriptDirectory, PythonScript
from twisted.web.test._util import _render... | lgpl-3.0 |
igemsoftware/SYSU-Software2013 | project/Python27_32/Lib/site-packages/jinja2/_stringdefs.py | 412 | 404256 | # -*- coding: utf-8 -*-
"""
jinja2._stringdefs
~~~~~~~~~~~~~~~~~~
Strings of all Unicode characters of a certain category.
Used for matching in Unicode-aware languages. Run to regenerate.
Inspired by chartypes_create.py from the MoinMoin project, original
implementation from Pygments.
:co... | mit |
kemalakyol48/python-for-android | python-modules/twisted/twisted/test/test_randbytes.py | 49 | 3790 | # Copyright (c) 2007-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for L{twisted.python.randbytes}.
"""
import os
from twisted.trial import unittest
from twisted.python import randbytes
class SecureRandomTestCaseBase(object):
"""
Base class for secureRandom test cases.
""... | apache-2.0 |
chenleicpp/p970_kernel_3.0.8 | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
lumig242/Hue-Integration-with-CDAP | desktop/core/ext-py/tablib-0.10.0/tablib/packages/openpyxl3/namedrange.py | 116 | 2415 | # file openpyxl/namedrange.py
# Copyright (c) 2010 openpyxl
#
# 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, mod... | apache-2.0 |
rockyzhang/zhangyanhit-python-for-android-mips | python-build/python-libs/gdata/src/gdata/tlslite/TLSRecordLayer.py | 270 | 44020 | """Helper class for TLSConnection."""
from __future__ import generators
from utils.compat import *
from utils.cryptomath import *
from utils.cipherfactory import createAES, createRC4, createTripleDES
from utils.codec import *
from errors import *
from messages import *
from mathtls import *
from constants import *
fro... | apache-2.0 |
overdrive3000/skytools | python/skytools/tnetstrings.py | 64 | 2966 | # Note this implementation is more strict than necessary to demonstrate
# minimum restrictions on types allowed in dictionaries.
def dump(data):
if type(data) is long or type(data) is int:
out = str(data)
return '%d:%s#' % (len(out), out)
elif type(data) is float:
out = '%f' % data
... | isc |
bbci/wyrm | test/test_calculate_signed_r_square.py | 2 | 3117 | from __future__ import division
import unittest
import numpy as np
from wyrm.types import Data
from wyrm.processing import calculate_signed_r_square
from wyrm.processing import swapaxes
class TestSelectClasses(unittest.TestCase):
def setUp(self):
# create noisy data [40 epochs, 100 samples, 64 channel... | mit |
tizianasellitto/servo | tests/wpt/css-tests/tools/lint/lint.py | 159 | 9915 | import os
import subprocess
import re
import sys
import fnmatch
from collections import defaultdict
from .. import localpaths
from manifest.sourcefile import SourceFile
here = os.path.abspath(os.path.split(__file__)[0])
repo_root = localpaths.repo_root
def git(command, *args):
args = list(args)
proc_kwargs... | mpl-2.0 |
tjanez/ansible | lib/ansible/modules/cloud/openstack/_quantum_floating_ip_associate.py | 21 | 8338 | #!/usr/bin/python
#coding: utf-8 -*-
# (c) 2013, Benno Joy <benno@ansible.com>
#
# This module 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 ... | gpl-3.0 |
savi-dev/keystone | keystone/contrib/stats/backends/kvs.py | 3 | 1246 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
yjmade/odoo | addons/lunch/wizard/lunch_order.py | 440 | 1299 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2012 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | agpl-3.0 |
airbnb/airflow | tests/providers/amazon/aws/hooks/test_ec2.py | 7 | 2445 | #
# 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... | apache-2.0 |
damirda/ansible-modules-core | network/dellos6/dellos6_facts.py | 11 | 14243 | #!/usr/bin/python
#
# (c) 2015 Peter Sprygada, <psprygada@ansible.com>
#
# Copyright (c) 2016 Dell 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 versi... | gpl-3.0 |
yukisakurai/hhana | mva/plotting/utils.py | 1 | 4190 | import ROOT
from itertools import izip
from matplotlib import cm
from rootpy.plotting.style.atlas.labels import ATLAS_label
from rootpy.memory.keepalive import keepalive
from .. import ATLAS_LABEL
def set_colors(hists, colors='jet'):
if isinstance(colors, basestring):
colors = cm.get_cmap(colors, len(hist... | gpl-3.0 |
nataddrho/DigiCue-USB | Python3/src/venv/Lib/site-packages/pip/_vendor/chardet/gb2312freq.py | 343 | 20715 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 R... | mit |
GNS3/gns3-server | gns3server/compute/nios/nio_udp.py | 2 | 1780 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 GNS3 Technologies Inc.
#
# 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 later version.
... | gpl-3.0 |
leiferikb/bitpop | build/third_party/twisted_10_2/twisted/enterprise/reflector.py | 61 | 5955 | # -*- test-case-name: twisted.test.test_reflector -*-
# Copyright (c) 2001-2007 Twisted Matrix Laboratories.
# See LICENSE for details.
import weakref, warnings
from twisted.enterprise.util import DBError
class Reflector:
"""
DEPRECATED.
Base class for enterprise reflectors. This implements row caching... | gpl-3.0 |
Jcing95/iop-hd | test/functional/p2p-mempool.py | 2 | 1223 | #!/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.
"""Test p2p mempool message.
Test that nodes are disconnected if they send mempool messages when bloom
fi... | mit |
O-T-L/PyOptimization | parameters/optimizer/epsilon_moea.py | 1 | 4120 | """
Copyright (C) 2014, 申瑞珉 (Ruimin Shen)
This program 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 version.
This program is distributed i... | lgpl-3.0 |
tulsawebdevs/django-multi-gtfs | multigtfs/models/trip.py | 1 | 4025 | #
# Copyright 2012-2014 John Whitlock
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | apache-2.0 |
0xffea/keystone | keystone/policy/core.py | 6 | 3097 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
ar7z1/ansible | lib/ansible/module_utils/api.py | 103 | 4446 | # 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... | gpl-3.0 |
Achuth17/scikit-learn | sklearn/neighbors/tests/test_kd_tree.py | 129 | 7848 | import numpy as np
from numpy.testing import assert_array_almost_equal
from sklearn.neighbors.kd_tree import (KDTree, NeighborsHeap,
simultaneous_sort, kernel_norm,
nodeheap_sort, DTYPE, ITYPE)
from sklearn.neighbors.dist_metrics import Dista... | bsd-3-clause |
napalm-automation/napalm-yang | napalm_yang/models/openconfig/system/ntp/ntp_keys/ntp_key/state/__init__.py | 1 | 14103 | # -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | apache-2.0 |
Since84/AGD-Site | paymentportal/admin/fckeditor/editor/filemanager/connectors/py/fckconnector.py | 93 | 2686 | #!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2008 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http:... | gpl-2.0 |
rhurkes/chasegame | venv/lib/python2.7/site-packages/cryptography/hazmat/backends/openssl/rsa.py | 2 | 23006 | # 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... | mit |
SciTools/iris | lib/iris/tests/unit/fileformats/pp/test_save.py | 3 | 11583 | # Copyright Iris contributors
#
# This file is part of Iris and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
"""Unit tests for the `iris.fileformats.pp.save` function."""
import cftime
import cf_units
# Import iris.tests first so that... | lgpl-3.0 |
ykaneko/neutron | neutron/db/loadbalancer/loadbalancer_db.py | 3 | 29308 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 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.apach... | apache-2.0 |
twidi/satchmo | satchmo/apps/product/migrations/__init__.py | 13 | 1684 | from django.contrib.contenttypes.models import ContentType
from south.logger import get_logger
from south.v2 import DataMigration
# Helper class for (0012|0002)_update_content_types
class UpdateContentTypeMigration(DataMigration):
_app_label = None
def __init__(self, *args, **kwargs):
super(UpdateCont... | bsd-3-clause |
edmond-chhung/linkchecker | linkcheck/__init__.py | 2 | 5995 | # -*- coding: iso-8859-1 -*-
# Copyright (C) 2000-2014 Bastian Kleineidam
#
# 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 versi... | gpl-2.0 |
tianweizhang/nova | nova/tests/virt/disk/mount/test_loop.py | 54 | 3373 | # Copyright 2012 Michael Still
# 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... | apache-2.0 |
Voluntarynet/BitmessageKit | BitmessageKit/Vendor/static-python/Lib/test/test_code.py | 77 | 3204 | """This module includes tests of the code object representation.
>>> def f(x):
... def g(y):
... return x + y
... return g
...
>>> dump(f.func_code)
name: f
argcount: 1
names: ()
varnames: ('x', 'g')
cellvars: ('x',)
freevars: ()
nlocals: 2
flags: 3
consts: ('None', '<code object g>')
>>> dump(f(4).f... | mit |
cyrixhero/bitcoin | qa/rpc-tests/txn_clone.py | 80 | 8079 | #!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test proper accounting with an equivalent malleability clone
#
from test_framework.test_framework import ... | mit |
damdam-s/hr | __unported__/hr_skill/hr_skill.py | 7 | 2391 | # -*- encoding: utf-8 -*-
###############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or modify
# it un... | agpl-3.0 |
taotaocoule/stock | spider/data/bond.py | 1 | 1159 | # 国债指数:id=0000121;http://pdfm2.eastmoney.com/EM_UBG_PDTI_Fast/api/js?id=0000121&TYPE=k&js=(x)&rtntype=5&isCR=false&fsData1518154947301=fsData1518154947301
# 沪市企业: id=0000131;http://pdfm2.eastmoney.com/EM_UBG_PDTI_Fast/api/js?id=0000131&TYPE=k&js=(x)&rtntype=5&isCR=false&fsData1518156740923=fsData1518156740923
# 深圳企业:... | mit |
edubrunaldi/kivy | kivy/tests/test_selection.py | 27 | 21562 | '''
Selection tests
===============
'''
import unittest
from kivy.uix.widget import Widget
from kivy.uix.listview import ListView, ListItemButton
from kivy.properties import NumericProperty, StringProperty
from kivy.adapters.listadapter import ListAdapter
from kivy.adapters.dictadapter import DictAdapter
from kivy.a... | mit |
pmisik/buildbot | master/buildbot/reporters/pushjet.py | 5 | 3627 | # This file is part of Buildbot. Buildbot 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 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
jcftang/ansible | contrib/inventory/vagrant.py | 148 | 3972 | #!/usr/bin/env python
"""
Vagrant external inventory script. Automatically finds the IP of the booted vagrant vm(s), and
returns it under the host group 'vagrant'
Example Vagrant configuration using this script:
config.vm.provision :ansible do |ansible|
ansible.playbook = "./provision/your_playbook.yml"
... | gpl-3.0 |
jounex/hue | desktop/core/ext-py/guppy-0.1.10/guppy/gsl/Html.py | 37 | 15304 | #._cv_part guppy.gsl.Html
class Node2Html:
def __init__(self, mod, node=None, error_report = None, encode_name=None
):
self.mod = mod
self.valid_html40 = False
self.encode = self.mod.encode
if encode_name is None:
encode_name = self.mod.encode_name
self.encode_name = encode_name
... | apache-2.0 |
ptisserand/ansible | test/units/modules/network/dellos9/test_dellos9_command.py | 46 | 4289 | # (c) 2016 Red Hat Inc.
#
# (c) 2017 Dell EMC.
#
# 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 vers... | gpl-3.0 |
iAmMrinal0/CouchPotatoServer | libs/pyutil/nummedobj.py | 106 | 2141 | # Copyright (c) 2002-2009 Zooko Wilcox-O'Hearn
# mailto:zooko@zooko.com
# This file is part of pyutil; see README.rst for licensing terms.
import dictutil
class NummedObj(object):
"""
This is useful for nicer debug printouts. Instead of objects of the same class being
distinguished from one another by t... | gpl-3.0 |
googleapis/googleapis-gen | grafeas/v1/grafeas-v1-py/tests/unit/gapic/grafeas_v1/test_grafeas.py | 1 | 180629 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
emonty/ansible | packaging/release/tests/version_helper_test.py | 125 | 2174 | from __future__ import absolute_import, division, print_function
__metaclass__ = type
import pytest
from packaging.version import InvalidVersion
from versionhelper.version_helper import AnsibleVersionMunger
@pytest.mark.parametrize('version,revision,codename,output_propname,expected', [
('2.5.0.dev1', None, Non... | gpl-3.0 |
maciek263/django2 | myvenv/Lib/site-packages/django/contrib/gis/utils/layermapping.py | 34 | 27264 | # LayerMapping -- A Django Model/OGR Layer Mapping Utility
"""
The LayerMapping class provides a way to map the contents of OGR
vector files (e.g. SHP files) to Geographic-enabled Django models.
For more information, please consult the GeoDjango documentation:
http://geodjango.org/docs/layermapping.html
"""
impo... | mit |
bbbbanjax/CloudBot | plugins/spotify.py | 17 | 3452 | import re
import requests
from cloudbot import hook
from cloudbot.util import web
gateway = 'http://open.spotify.com/{}/{}' # http spotify gw address
spuri = 'spotify:{}:{}'
spotify_re = re.compile(r'(spotify:(track|album|artist|user):([a-zA-Z0-9]+))', re.I)
http_re = re.compile(r'(open\.spotify\.com/(track|album... | gpl-3.0 |
bobisme/odoo | addons/stock_picking_wave/stock_picking_wave.py | 60 | 3460 | # -*- coding: utf-8 -*-
from openerp.osv import fields, osv
from openerp.tools.translate import _
class stock_picking_wave(osv.osv):
_name = "stock.picking.wave"
_order = "name desc"
_columns = {
'name': fields.char('Picking Wave Name', required=True, help='Name of the picking wave', copy=False),
... | agpl-3.0 |
skatsuta/aerospike-training | book/exercise/Key-valueOperations/Python/Program.py | 1 | 8944 | #!/usr/bin/env python
#
# * Copyright 2012-2014 by Aerospike.
# *
# * Permission is hereby granted, free of charge, to any person obtaining a copy
# * of this software and associated documentation files (the "Software"), to
# * deal in the Software without restriction, including without limitation the
# * rights... | mit |
akurtakov/Pydev | plugins/org.python.pydev.parser/src/org/python/pydev/parser/jython/ast/spark.py | 9 | 20941 | # Copyright (c) 1998-2002 John Aycock
#
# 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, modify, merge, publ... | epl-1.0 |
guijomatos/SickRage | lib/html5lib/treewalkers/pulldom.py | 1729 | 2302 | from __future__ import absolute_import, division, unicode_literals
from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, \
COMMENT, IGNORABLE_WHITESPACE, CHARACTERS
from . import _base
from ..constants import voidElements
class TreeWalker(_base.TreeWalker):
def __iter__(self):
ignore_until = None... | gpl-3.0 |
endlessm/chromium-browser | tools/swarming_client/third_party/google/auth/transport/grpc.py | 12 | 5020 | # Copyright 2016 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 agreed to in writing,... | bsd-3-clause |
stinebuu/nest-simulator | pynest/nest/tests/test_getnodes.py | 20 | 2289 | # -*- coding: utf-8 -*-
#
# test_getnodes.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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, ... | gpl-2.0 |
lucywyman/slides-ii | v/lib/python2.7/site-packages/docutils/parsers/rst/directives/parts.py | 136 | 4251 | # $Id: parts.py 7308 2012-01-06 12:08:43Z milde $
# Authors: David Goodger <goodger@python.org>; Dmitry Jemerov
# Copyright: This module has been placed in the public domain.
"""
Directives for document parts.
"""
__docformat__ = 'reStructuredText'
from docutils import nodes, languages
from docutils.transforms impor... | apache-2.0 |
Danielhiversen/home-assistant | homeassistant/components/climate/touchline.py | 5 | 2730 | """
Platform for Roth Touchline heat pump controller.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/climate.touchline/
"""
import logging
import voluptuous as vol
from homeassistant.components.climate import (
ClimateDevice, PLATFORM_SCHEMA, SUPPORT_... | mit |
t3wz/mtasa-blue | vendor/google-breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/message.py | 261 | 9669 | # 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... | gpl-3.0 |
xianian/qt-creator | share/qtcreator/debugger/gdbbridge.py | 1 | 64687 |
try:
import __builtin__
except:
import builtins
try:
import gdb
except:
pass
import os
import os.path
import sys
import struct
import types
def warn(message):
print("XXX: %s\n" % message.encode("latin1"))
from dumper import *
####################################################################... | lgpl-2.1 |
igemsoftware/SYSU-Software2013 | project/Python27/Lib/sqlite3/__init__.py | 239 | 1037 | #-*- coding: ISO-8859-1 -*-
# pysqlite2/__init__.py: the pysqlite2 package.
#
# Copyright (C) 2005 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# 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 f... | mit |
tendant/ansible-modules-core | system/mount.py | 7 | 10824 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Red Hat, inc
# Written by Seth Vidal
# based on the mount modules from salt and puppet
#
# 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 ... | gpl-3.0 |
hwu25/AppPkg | Applications/Python/Python-2.7.2/Lib/dummy_thread.py | 73 | 4563 | """Drop-in replacement for the thread module.
Meant to be used as a brain-dead substitute so that threaded code does
not need to be rewritten for when the thread module is not present.
Suggested usage is::
try:
import thread
except ImportError:
import dummy_thread as thread
"""
... | bsd-2-clause |
incaser/odoo-odoo | openerp/addons/base/ir/ir_filters.py | 237 | 8867 | # -*- 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 |
klahnakoski/jx-sqlite | vendor/jx_base/expressions/reg_exp_op.py | 4 | 1311 | # encoding: utf-8
#
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http:# mozilla.org/MPL/2.0/.
#
# Contact: Kyle Lahnakoski (kyle@lahnakoski.com)
#
"""
# NOTE:
THE self.lang[operator] PATTERN ... | mpl-2.0 |
jhawkesworth/ansible | lib/ansible/modules/system/lvg.py | 17 | 10490 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2013, Alexander Bulimov <lazywolf0@gmail.com>
# Based on lvol module by Jeroen Hoekx <jeroen.hoekx@dsquare.be>
# 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... | gpl-3.0 |
IronManMark20/pyside2 | tests/QtCore/qenum_test.py | 3 | 1235 | #!/usr/bin/python
'''Test cases for QEnum and QFlags'''
import unittest
from PySide2.QtCore import *
class TestEnum(unittest.TestCase):
def testToInt(self):
self.assertEqual(QIODevice.NotOpen, 0)
self.assertEqual(QIODevice.ReadOnly, 1)
self.assertEqual(QIODevice.WriteOnly, 2)
sel... | lgpl-2.1 |
Etxea/gestion_eide_web | clases/views.py | 2 | 6297 | # Create your views here.
from django.shortcuts import render, render_to_response
from django.template import RequestContext
from utils import _getWeekDetails
from django.views.generic import ListView
from django.views.generic.edit import CreateView, UpdateView
from django.shortcuts import get_object_or_404
import date... | mit |
homework/nox | src/nox/lib/packet/eap.py | 6 | 6336 | # Copyright 2008 (C) Nicira, Inc.
#
# This file is part of NOX.
#
# NOX 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.
#
# NOX is d... | gpl-3.0 |
zhangxiaolins/python_base | essential/middleware/base.py | 68 | 1855 | # 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 req... | apache-2.0 |
shyamalschandra/scikit-learn | sklearn/neighbors/nearest_centroid.py | 38 | 7356 | # -*- coding: utf-8 -*-
"""
Nearest Centroid Classification
"""
# Author: Robert Layton <robertlayton@gmail.com>
# Olivier Grisel <olivier.grisel@ensta.org>
#
# License: BSD 3 clause
import warnings
import numpy as np
from scipy import sparse as sp
from ..base import BaseEstimator, ClassifierMixin
from ..met... | bsd-3-clause |
pdellaert/ansible | lib/ansible/module_utils/gcdns.py | 187 | 2531 | # 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... | gpl-3.0 |
adazey/Muzez | libs/youtube_dl/extractor/smotri.py | 7 | 15864 | # coding: utf-8
from __future__ import unicode_literals
import re
import json
import hashlib
import uuid
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
sanitized_Request,
unified_strdate,
urlencode_postdata,
xpath_text,
)
class SmotriIE(InfoExtractor):
... | gpl-3.0 |
oswalpalash/remoteusermgmt | RUM/lib/python2.7/site-packages/wheel/signatures/__init__.py | 565 | 3779 | """
Create and verify jws-js format Ed25519 signatures.
"""
__all__ = [ 'sign', 'verify' ]
import json
from ..util import urlsafe_b64decode, urlsafe_b64encode, native, binary
ed25519ll = None
ALG = "Ed25519"
def get_ed25519ll():
"""Lazy import-and-test of ed25519 module"""
global ed25519ll
if not ... | mit |
vFense/vFenseAgent-nix | agent/deps/rpm-32/Python-2.7.5/lib/python2.7/test/test_contextlib.py | 125 | 9103 | """Unit tests for contextlib.py, and other context managers."""
import sys
import tempfile
import unittest
from contextlib import * # Tests __all__
from test import test_support
try:
import threading
except ImportError:
threading = None
class ContextManagerTestCase(unittest.TestCase):
def test_contextm... | lgpl-3.0 |
hanselke/erpnext-1 | erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py | 46 | 2597 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import flt
from frappe import _
from erpnext.controllers.accounts_controller import AccountsController
class PeriodClos... | agpl-3.0 |
t0mk/ansible | lib/ansible/plugins/callback/logentries.py | 69 | 11249 | """ (c) 2015, Logentries.com, Jimmy Tang <jimmy.tang@logentries.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 o... | gpl-3.0 |
dmitry-sobolev/ansible | lib/ansible/modules/cloud/google/gce_eip.py | 70 | 6857 | #!/usr/bin/python
# Copyright 2017 Google 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 vers... | gpl-3.0 |
boretom/pyload-apkg | source/py-mods-prebuilt-x86-64/site-packages/PIL/FitsStubImagePlugin.py | 40 | 1643 | #
# The Python Imaging Library
# $Id$
#
# FITS stub adapter
#
# Copyright (c) 1998-2003 by Fredrik Lundh
#
# See the README file for information on usage and redistribution.
#
import Image, ImageFile
_handler = None
##
# Install application-specific FITS image handler.
#
# @param handler Handler object.
def registe... | gpl-3.0 |
alexmorozov/django | django/core/files/move.py | 554 | 2794 | """
Move a file in the safest way possible::
>>> from django.core.files.move import file_move_safe
>>> file_move_safe("/tmp/old_file", "/tmp/new_file")
"""
import os
from shutil import copystat
from django.core.files import locks
__all__ = ['file_move_safe']
def _samefile(src, dst):
# Macintosh, Unix.... | bsd-3-clause |
ClearCorp/server-tools | external_file_location/models/task.py | 1 | 8567 | # coding: utf-8
# @ 2015 Valentin CHEMIERE @ Akretion
# © @author Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api
import openerp
from openerp import tools
from base64 import b64encode
import os
imp... | agpl-3.0 |
CTSRD-SOAAP/chromium-42.0.2311.135 | tools/perf/benchmarks/benchmark_unittest.py | 3 | 2440 | # 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.
"""For all the benchmarks that set options, test that the options are valid."""
import logging
import os
import unittest
from collections import defaultdict... | bsd-3-clause |
mancoast/CPythonPyc_test | fail/322_test_codecencodings_kr.py | 57 | 2756 | #!/usr/bin/env python3
#
# test_codecencodings_kr.py
# Codec encoding tests for ROK encodings.
#
from test import support
from test import test_multibytecodec_support
import unittest
class Test_CP949(test_multibytecodec_support.TestBase, unittest.TestCase):
encoding = 'cp949'
tstring = test_multibytecodec_s... | gpl-3.0 |
elkingtonmcb/django | django/core/checks/security/sessions.py | 477 | 2595 | from django.conf import settings
from .. import Tags, Warning, register
def add_session_cookie_message(message):
return message + (
" Using a secure-only session cookie makes it more difficult for "
"network traffic sniffers to hijack user sessions."
)
W010 = Warning(
add_session_cookie_... | bsd-3-clause |
maruina/kanedias | aws/load_config.py | 1 | 2747 | import os
import sys
from boto.pyami.config import Config
from fabric.colors import red
# Load the configuration file
if os.path.exists('config.ini'):
boto_config = Config()
boto_config.load_credential_file('config.ini')
if boto_config.items('Credentials'):
AWS_ID = boto_config.get('Credentials', '... | mit |
chrisxue815/leetcode_python | problems/test_0407.py | 1 | 2180 | import heapq
import unittest
class Solution:
def trapRainWater(self, heightMap):
"""
:type heightMap: List[List[int]]
:rtype: int
"""
if not heightMap:
return 0
res = 0
height = len(heightMap)
width = len(heightMap[0])
visited = ... | unlicense |
eldstal/cardcinogen | card.py | 1 | 2572 | #!/bin/env python3
import unittest
import os
import sys
import util
import log
from PIL import Image
from layout import SimpleLayout, ComplexLayout
class CardTemplate:
""" Parsed version of a JSON card template """
def __init__(self, json, rootdir="."):
self.front_name = util.get_default(json, "front-im... | mit |
dpaiton/OpenPV | pv-core/python/pvtools/writepvpfile.py | 1 | 10534 | import numpy as np
import scipy.sparse as sp
import pdb
from readpvpheader import headerPattern, extendedHeaderPattern
def checkData(data):
#Check if dictionary
if not isinstance(data, dict):
raise ValueError("Input data structure must be a dictionary with the keys \"values\" and \"time\"")
#Check... | epl-1.0 |
Ms2ger/servo | components/script/dom/bindings/codegen/parser/tests/test_promise.py | 74 | 1621 | def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
interface _Promise {};
interface A {
legacycaller Promise<any> foo();
};
""")
results = parser.finish()
except:
threw = True
harness.ok(threw,
... | mpl-2.0 |
fcappdev/OpenAgClassifier | src/model/base/config.py | 2 | 1091 | """
# Copyright 2017 Foundation Center. All Rights Reserved.
#
# Licensed under the Foundation Center Public License, Version 1.1 (the “License”);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://gis.foundationcenter.org/licenses/LICENSE-1.1.htm... | mpl-2.0 |
zerobatu/edx-platform | cms/djangoapps/contentstore/management/commands/populate_creators.py | 182 | 2406 | """
Script for granting existing course instructors course creator privileges.
This script is only intended to be run once on a given environment.
"""
from course_creators.views import add_user_with_status_granted, add_user_with_status_unrequested
from django.core.management.base import BaseCommand
from django.contri... | agpl-3.0 |
vladikoff/fxa-mochitest | tests/config/mozharness/mac_config.py | 2 | 3079 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
config = {
"suite_definitions": {
"cppunittest": {
"options": [
"--symbols-path=... | mpl-2.0 |
mindbender-studio/setup | bin/windows/python36/Lib/distutils/tests/test_install_scripts.py | 118 | 2625 | """Tests for distutils.command.install_scripts."""
import os
import unittest
from distutils.command.install_scripts import install_scripts
from distutils.core import Distribution
from distutils.tests import support
from test.support import run_unittest
class InstallScriptsTestCase(support.TempdirManager,
... | mit |
edisonlz/fruit | web_project/base/site-packages/piston/doc.py | 2 | 5738 | import inspect, handler
from piston.handler import typemapper
from piston.handler import handler_tracker
from django.core.urlresolvers import get_resolver, get_callable, get_script_prefix
from django.shortcuts import render_to_response
from django.template import RequestContext
def generate_doc(handler_cls):
"""... | apache-2.0 |
thinkAmi-sandbox/Bottle-sample | e.g._bbs_app/bbs.py | 1 | 1890 | import datetime
import pickle
from pathlib import Path
from bottle import Bottle, run, get, post, redirect, request, response, jinja2_template
class Message(object):
def __init__(self, title, handle, message):
self.title = title
self.handle = handle
self.message = message
self.crea... | unlicense |
capitalone/cloud-custodian | tools/c7n_azure/c7n_azure/provisioning/deployment_unit.py | 1 | 1645 | import logging
from abc import ABCMeta, abstractmethod
from c7n.utils import local_session
from c7n_azure.session import Session
class DeploymentUnit(metaclass=ABCMeta):
log = logging.getLogger('custodian.azure.deployment_unit.DeploymentUnit')
def __init__(self, client):
self.type = ""
... | apache-2.0 |
yuanagain/seniorthesis | venv/lib/python2.7/site-packages/scipy/stats/mstats.py | 77 | 1946 | """
===================================================================
Statistical functions for masked arrays (:mod:`scipy.stats.mstats`)
===================================================================
.. currentmodule:: scipy.stats.mstats
This module contains a large number of statistical functions that can
be... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.