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 |
|---|---|---|---|---|---|
zhangg/trove | trove/tests/scenario/runners/guest_log_runners.py | 2 | 34388 | # Copyright 2015 Tesora 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 |
igemsoftware/SYSU-Software2013 | project/Python27_32/Lib/htmlentitydefs.py | 390 | 18054 | """HTML character entity references."""
# maps the HTML entity name to the Unicode codepoint
name2codepoint = {
'AElig': 0x00c6, # latin capital letter AE = latin capital ligature AE, U+00C6 ISOlat1
'Aacute': 0x00c1, # latin capital letter A with acute, U+00C1 ISOlat1
'Acirc': 0x00c2, # latin capit... | mit |
matsumoto-r/synciga | src/tools/gyp/pylib/gyp/ninja_syntax.py | 217 | 5286 | # This file comes from
# https://github.com/martine/ninja/blob/master/misc/ninja_syntax.py
# Do not edit! Edit the upstream one instead.
"""Python module for generating .ninja files.
Note that this is emphatically not a required piece of Ninja; it's
just a helpful utility for build-file-generation systems that alr... | bsd-3-clause |
Jon-ICS/upm | examples/python/ads1115.py | 7 | 3049 | # Author: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
# Copyright (c) 2016 Intel Corporation.
#
# 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 limi... | mit |
drufat/vispy | vispy/app/_default_app.py | 21 | 2422 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
from .application import Application
# Initialize default app
# Only for use within *this* module.
# One should always call use_app() to obtain the default app.
default_app =... | bsd-3-clause |
ihsanudin/odoo | openerp/addons/test_access_rights/tests/test_ir_rules.py | 299 | 1220 | import openerp.exceptions
from openerp.tests.common import TransactionCase
class TestRules(TransactionCase):
def setUp(self):
super(TestRules, self).setUp()
self.id1 = self.env['test_access_right.some_obj']\
.create({'val': 1}).id
self.id2 = self.env['test_access_right.some_obj... | agpl-3.0 |
reeshupatel/demo | keystone/openstack/common/lockutils.py | 1 | 12121 | # 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 |
shubhdev/edxOnBaadal | common/djangoapps/third_party_auth/settings.py | 76 | 3717 | """Settings for the third-party auth module.
The flow for settings registration is:
The base settings file contains a boolean, ENABLE_THIRD_PARTY_AUTH, indicating
whether this module is enabled. startup.py probes the ENABLE_THIRD_PARTY_AUTH.
If true, it:
a) loads this module.
b) calls apply_settings(), passi... | agpl-3.0 |
madscatt/zazmol | src/python/extensions/dcdio/test_dcdio.py | 3 | 2739 | '''
SASSIE Copyright (C) 2011 Joseph E. Curtis
This program comes with ABSOLUTELY NO WARRANTY;
This is free software, and you are welcome to redistribute it under certain
conditions; see http://www.gnu.org/licenses/gpl-3.0.html for details.
'''
import sys,numpy,time
sys.path.append('./')
import dcdio
... | gpl-3.0 |
SurfasJones/djcmsrc3 | venv/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.py | 164 | 36356 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""Implementation of the Metadata for Python packages PEPs.
Supports all metadata formats (1.0, 1.1, 1.2, and 2.0 experimental).
"""
from __future__ import unicode_literals
import codecs
from email... | mit |
codeaudit/beast-mcmc | plugins_SDK/generate_stub.py | 13 | 4995 | #!/usr/bin/env python
import sys, os, shutil, re
from optparse import OptionParser
PROG_NAME = os.path.basename(os.path.abspath(sys.argv[0]))
VERBOSE = False
def debug(msg):
if VERBOSE:
sys.stderr.write('%s: %s\n' % (PROG_NAME, msg))
parser = OptionParser()
parser.add_option('-p', '--package', dest='package... | lgpl-2.1 |
FlaPer87/django-nonrel | django/db/models/sql/compiler.py | 3 | 42993 | from django.core.exceptions import FieldError
from django.db import connections
from django.db.backends.util import truncate_name
from django.db.models.sql.constants import *
from django.db.models.sql.datastructures import EmptyResultSet
from django.db.models.sql.expressions import SQLEvaluator
from django.db.models.sq... | bsd-3-clause |
skurochkin/selenium | py/selenium/webdriver/firefox/firefox_binary.py | 32 | 8169 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
lexus24/w16b_test | static/Brython3.1.3-20150514-095342/Lib/textwrap.py | 745 | 16488 | """Text wrapping and filling.
"""
# Copyright (C) 1999-2001 Gregory P. Ward.
# Copyright (C) 2002, 2003 Python Software Foundation.
# Written by Greg Ward <gward@python.net>
import re
__all__ = ['TextWrapper', 'wrap', 'fill', 'dedent', 'indent']
# Hardcode the recognized whitespace characters to the US-ASCII
# whit... | agpl-3.0 |
foodszhang/kbengine | kbe/src/lib/python/Lib/ctypes/test/test_internals.py | 113 | 2631 | # This tests the internal _objects attribute
import unittest
from ctypes import *
from sys import getrefcount as grc
# XXX This test must be reviewed for correctness!!!
# ctypes' types are container types.
#
# They have an internal memory block, which only consists of some bytes,
# but it has to keep references to ot... | lgpl-3.0 |
ericlink/adms-server | playframework-dist/play-1.1/python/Lib/unittest.py | 2 | 30209 | #!/usr/bin/env python
'''
Python unit testing framework, based on Erich Gamma's JUnit and Kent Beck's
Smalltalk testing framework.
This module contains the core framework classes that form the basis of
specific test cases and suites (TestCase, TestSuite etc.), and also a
text-based utility class for running the... | mit |
magsilva/scriptLattes | scriptLattes/internacionalizacao/depuradorDOIhtml.py | 3 | 2090 | #!/usr/bin/python
# encoding: utf-8
# filename: depuradorDOIhtml.py
#
# scriptLattes V8
# Copyright 2005-2013: Jesús P. Mena-Chalco e Roberto M. Cesar-Jr.
# http://scriptlattes.sourceforge.net/
#
#
# Este programa é um software livre; você pode redistribui-lo e/ou
# modifica-lo dentro dos termos da Licença Públic... | gpl-2.0 |
hojel/youtube-dl | youtube_dl/extractor/stitcher.py | 30 | 2934 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
determine_ext,
int_or_none,
js_to_json,
unescapeHTML,
)
class StitcherIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?stitcher\.com/podcast/(?:[^/]+/)+e/(?:(?P<display_id>[^/#?&]+?)-)?(... | unlicense |
firebitsbr/raspberry_pwn | src/pexpect-2.3/setup.py | 11 | 1452 | '''
$Revision: 485 $
$Date: 2007-07-12 15:23:15 -0700 (Thu, 12 Jul 2007) $
'''
from distutils.core import setup
setup (name='pexpect',
version='2.3',
py_modules=['pexpect', 'pxssh', 'fdpexpect', 'FSM', 'screen', 'ANSI'],
description='Pexpect is a pure Python Expect. It allows easy control of other applicati... | gpl-3.0 |
kenshay/ImageScripter | Script_Runner/PYTHON/Lib/site-packages/asn1crypto/csr.py | 14 | 2142 | # coding: utf-8
"""
ASN.1 type classes for certificate signing requests (CSR). Exports the
following items:
- CertificatationRequest()
Other type classes are defined that help compose the types listed above.
"""
from __future__ import unicode_literals, division, absolute_import, print_function
from .algos import ... | gpl-3.0 |
litchfield/django | tests/datatypes/tests.py | 305 | 4210 | from __future__ import unicode_literals
import datetime
from django.test import TestCase, skipIfDBFeature
from django.utils import six
from django.utils.timezone import utc
from .models import Donut, RumBaba
class DataTypesTestCase(TestCase):
def test_boolean_type(self):
d = Donut(name='Apple Fritter'... | bsd-3-clause |
vpelletier/neoppod | neo/tests/testHandler.py | 1 | 2979 | #
# Copyright (C) 2009-2016 Nexedi SA
#
# 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 program is distributed... | gpl-2.0 |
morgenst/PyAnalysisTools | tests/unit/TestUtilities.py | 1 | 2542 | import os
import unittest
from PyAnalysisTools.base import Utilities, InvalidInputError
# from pyfakefs.fake_filesystem_unittest import TestCase
cwd = os.path.dirname(__file__)
class TestUtilities(unittest.TestCase):
def setUp(self):
pass
# self.setUpPyfakefs()
def tearDown(self):
pa... | mit |
dledford/linux | scripts/gdb/linux/lists.py | 509 | 3631 | #
# gdb helper commands and functions for Linux kernel debugging
#
# list tools
#
# Copyright (c) Thiebaud Weksteen, 2015
#
# Authors:
# Thiebaud Weksteen <thiebaud@weksteen.fr>
#
# This work is licensed under the terms of the GNU GPL version 2.
#
import gdb
from linux import utils
list_head = utils.CachedType("st... | gpl-2.0 |
semonte/intellij-community | python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_apply.py | 315 | 1904 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for apply().
This converts apply(func, v, k) into (func)(*v, **k)."""
# Local imports
from .. import pytree
from ..pgen2 import token
from .. import fixer_base
from ..fixer_util import Call, Comma, parenthesi... | apache-2.0 |
mmaruska/pybluez | setup.py | 3 | 4200 | #!/usr/bin/env python
from setuptools import setup, Extension
import sys
import platform
import os
mods = list()
def find_MS_SDK():
candidate_roots = (os.getenv('ProgramFiles'), os.getenv('ProgramW6432'),
os.getenv('ProgramFiles(x86)'))
if sys.version < '3.3':
MS_SDK = r'Micro... | gpl-2.0 |
jetskijoe/SickGear | lib/subliminal/tasks.py | 170 | 2328 | # -*- coding: utf-8 -*-
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
#
# This file is part of subliminal.
#
# subliminal 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... | gpl-3.0 |
srajag/nova | nova/tests/api/openstack/compute/contrib/test_extended_volumes.py | 12 | 4779 | # 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.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
nexiles/odoo | addons/product_email_template/models/invoice.py | 321 | 1969 | # -*- coding: utf-8 -*-
from openerp.osv import osv
class account_invoice(osv.Model):
_inherit = 'account.invoice'
def invoice_validate_send_email(self, cr, uid, ids, context=None):
Composer = self.pool['mail.compose.message']
for invoice in self.browse(cr, uid, ids, context=context):
... | agpl-3.0 |
mavenlin/tensorflow | tensorflow/contrib/keras/api/keras/wrappers/scikit_learn/__init__.py | 57 | 1066 | # 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 |
andreparames/odoo | addons/account/wizard/account_report_common_partner.py | 385 | 1999 | # -*- 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 |
gam-phon/taiga-back | taiga/feedback/serializers.py | 3 | 1088 | # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or mo... | agpl-3.0 |
bow/bioconda-recipes | recipes/phylip/phylip.py | 48 | 8900 | #!/usr/bin/env python
#
# Wrapper script for phylip program when installed from
# bioconda. Adapted from shell scripts provided in the biolbuilds
# conda recipe by Cheng H. Lee.
import sys
import os
import subprocess
def main():
print("running main")
print(sys.argv)
bindir = get_script_path(sys.argv[0])
... | mit |
zedoude/wfrog | wfcommon/generic/include.py | 5 | 2511 | ## Copyright 2009 Laurent Bovet <laurent.bovet@windmaster.ch>
## Jordi Puigsegur <jordi.puigsegur@gmail.com>
##
## This file is part of wfrog
##
## wfrog 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 Softwar... | gpl-3.0 |
402231466/cda-0512 | static/Brython3.1.1-20150328-091302/Lib/browser/local_storage.py | 617 | 2786 | # local storage in browser
import sys
from javascript import JSObject
class __UnProvided():
pass
class LocalStorage():
storage_type = "local_storage"
def __init__(self):
if not sys.has_local_storage:
raise EnvironmentError("LocalStorage not available")
self.store = JSObject(__... | agpl-3.0 |
jeshaitan/Scicademy | node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py | 1558 | 4945 | # Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import re
import os
def XmlToString(content, encoding='utf-8', pretty=False):
""" Writes the XML content to disk, touching the file only if it has changed.
... | gpl-3.0 |
sanctuaryaddon/sanctuary | script.module.liveresolver/lib/liveresolver/resolvers/youtube.py | 2 | 2372 | # -*- coding: utf-8 -*-
'''
Genesis 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 opt... | gpl-2.0 |
berrange/nova | nova/objects/virtual_interface.py | 18 | 3724 | # Copyright (C) 2014, Red Hat, 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... | apache-2.0 |
junmin-zhu/chromium-rivertrail | tools/python/google/platform_utils_mac.py | 183 | 5676 | # Copyright (c) 2011 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.
"""Platform-specific utility methods shared by several scripts."""
import os
import subprocess
import google.path_utils
class PlatformUtility(object)... | bsd-3-clause |
Namax0r/resistor-calculator | resistor_calculator.py | 1 | 9566 | #!/usr/bin/env python
# Basic version handling
try:
# Python2
import Tkinter as tk
except ImportError:
# Python3
import tkinter as tk
from tkinter.ttk import Combobox
from tkinter import messagebox
# Small utility that adds dot notation access to dictionary attributes
class dotdict(dict):
__getat... | mit |
richardfergie/googleads-python-lib | examples/dfp/v201508/placement_service/deactivate_placements.py | 4 | 2090 | #!/usr/bin/python
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
svn2github/libtorrent-1_0_x | tools/parse_memory_log.py | 59 | 3492 | #! /usr/bin/env python
import os, sys, time
# usage: memory.log memory_index.log
lines = open(sys.argv[1], 'rb').readlines()
index = open(sys.argv[2], 'rb').readlines()
# logfile format:
# #<allocation-point> <time(ms)> <key ('A' | 'F')> <address> <size> <total-size> <total-space-time> <peak-total-size>
# example:
#... | bsd-3-clause |
Greennut/ostproject | django/contrib/localflavor/es/forms.py | 87 | 7721 | # -*- coding: utf-8 -*-
"""
Spanish-specific Form helpers
"""
from __future__ import absolute_import
import re
from django.contrib.localflavor.es.es_provinces import PROVINCE_CHOICES
from django.contrib.localflavor.es.es_regions import REGION_CHOICES
from django.core.validators import EMPTY_VALUES
from django.forms ... | bsd-3-clause |
GraemeFulton/ghost-mdl-theme | node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py | 1825 | 17014 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""GYP backend that generates Eclipse CDT settings files.
This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML
files that can be importe... | mit |
zimmermatt/flink | flink-libraries/flink-python/src/test/python/org/apache/flink/python/api/args/no_arg.py | 6 | 1273 | # ###############################################################################
# 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 fi... | apache-2.0 |
leonsio/YAHM | share/tools/ubi_reader/ubifs/walk.py | 3 | 2731 | #!/usr/bin/env python
#############################################################
# ubi_reader/ubifs
# (c) 2013 Jason Pruitt (jrspruitt@gmail.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 Foundat... | cc0-1.0 |
bliz937/kivy | examples/demo/multistroke/settings.py | 43 | 3078 | __all__ = ('MultistrokeSettingsContainer', 'MultistrokeSettingItem',
'MultistrokeSettingBoolean', 'MultistrokeSettingSlider',
'MultistrokeSettingString', 'MultistrokeSettingTitle')
from kivy.factory import Factory
from kivy.lang import Builder
from kivy.uix.gridlayout import GridLayout
from kivy.... | mit |
jnerin/ansible | lib/ansible/modules/cloud/amazon/dynamodb_ttl.py | 74 | 5579 | #!/usr/bin/python
# Copyright: 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
mvo5/snapcraft | snapcraft/sources.py | 4 | 1347 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015-2016 Canonical Ltd
#
# 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 is distributed in ... | gpl-3.0 |
dlintott/gns3-ppa | src/GNS3/Ui/Form_StartupConfig.py | 3 | 4537 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'Form_StartupConfig.ui'
#
# Created: Mon Sep 9 21:29:21 2013
# by: PyQt4 UI code generator 4.8.6
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
exc... | gpl-2.0 |
mammadori/pyglet | experimental/ninepatch.py | 29 | 8273 | # Copyright 2009 Joe Wreschnig and others.
#
# 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
# notice, this list of conditions and the following di... | bsd-3-clause |
igemsoftware/SYSU-Software2013 | project/Python27/Lib/shelve.py | 225 | 8078 | """Manage shelves of pickled objects.
A "shelf" is a persistent, dictionary-like object. The difference
with dbm databases is that the values (not the keys!) in a shelf can
be essentially arbitrary Python objects -- anything that the "pickle"
module can handle. This includes most class instances, recursive data
type... | mit |
janebeckman/gpdb | src/test/tinc/tincrepo/mpp/gpdb/tests/storage/walrepl/walreceiver/__init__.py | 12 | 2660 | """
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the 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.... | apache-2.0 |
mjasher/gac | GAC/flopy/modflow/mfdrn.py | 1 | 7133 | """
mfdrn module. Contains the ModflowDrn class. Note that the user can access
the ModflowDrn class as `flopy.modflow.ModflowDrn`.
Additional information for this MODFLOW package can be found at the `Online
MODFLOW Guide
<http://water.usgs.gov/ogw/modflow/MODFLOW-2005-Guide/index.html?drn.htm>`_.
"""
import... | gpl-2.0 |
ceibal-tatu/software-center | softwarecenter/ui/gtk3/aptd_gtk3.py | 3 | 2642 | # Copyright (C) 2011 Canonical
#
# Authors:
# Michael Vogt
#
# 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 will be useful, but W... | lgpl-3.0 |
xhava/hippyvm | hippy/rpath.py | 2 | 3264 | # This contains an RPython version of functions from the UNIX file
# posixpath.py. It would give nonsense on other platforms like Windows.
import os
from os.path import isabs, islink, abspath, normpath
from rpython.rlib.rpath import rabspath
from rpython.rlib.objectmodel import enforceargs
@enforceargs(str)
def di... | mit |
emidln/django_roa | env/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/errcheck.py | 623 | 3522 | """
Error checking functions for GEOS ctypes prototype functions.
"""
import os
from ctypes import c_void_p, string_at, CDLL
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.libgeos import GEOS_VERSION
from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc
# Getting the... | bsd-3-clause |
ukanga/SickRage | lib/unidecode/x098.py | 252 | 4645 | data = (
'Hu ', # 0x00
'Ye ', # 0x01
'Ding ', # 0x02
'Qing ', # 0x03
'Pan ', # 0x04
'Xiang ', # 0x05
'Shun ', # 0x06
'Han ', # 0x07
'Xu ', # 0x08
'Yi ', # 0x09
'Xu ', # 0x0a
'Gu ', # 0x0b
'Song ', # 0x0c
'Kui ', # 0x0d
'Qi ', # 0x0e
'Hang ', # 0x0f
'Yu ', # 0x10
'Wan '... | gpl-3.0 |
jzoldak/edx-platform | lms/djangoapps/grades/tests/utils.py | 9 | 2464 | """
Utilities for grades related tests
"""
from contextlib import contextmanager
from mock import patch
from courseware.module_render import get_module
from courseware.model_data import FieldDataCache
from xmodule.graders import ProblemScore
@contextmanager
def mock_passing_grade(grade_pass='Pass', percent=0.75, ):
... | agpl-3.0 |
mosen/salt-osx | _modules/deprecated/mac_shadow.py | 1 | 10388 | # -*- coding: utf-8 -*-
'''
Manage Mac OSX local directory passwords and policies.
Note that it is usually better to apply password policies through the creation of a configuration profile.
Tech Notes:
Usually when a password is changed by the system, there's a responsibility to check the hash list and generate hashe... | mit |
anryko/ansible | lib/ansible/modules/cloud/cloudstack/cs_region.py | 13 | 4901 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2016, 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': '1.1',
... | gpl-3.0 |
axelspringer/ansible-modules-core | system/mount.py | 3 | 12181 | #!/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 |
rodrigosurita/GDAd | sdaps/model/questionnaire.py | 1 | 9008 | # -*- coding: utf8 -*-
# SDAPS - Scripts for data acquisition with paper based surveys
# Copyright(C) 2008, Christoph Simon <post@christoph-simon.eu>
# Copyright(C) 2008, Benjamin Berg <benjamin@sipsolutions.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Ge... | gpl-3.0 |
gauribhoite/personfinder | env/google_appengine/lib/django-1.3/django/contrib/localflavor/fr/fr_department.py | 314 | 3326 | # -*- coding: utf-8 -*-
DEPARTMENT_ASCII_CHOICES = (
('01', '01 - Ain'),
('02', '02 - Aisne'),
('03', '03 - Allier'),
('04', '04 - Alpes-de-Haute-Provence'),
('05', '05 - Hautes-Alpes'),
('06', '06 - Alpes-Maritimes'),
('07', '07 - Ardeche'),
('08', '08 - Ardennes'),
('09', '09 - Ar... | apache-2.0 |
mornsun/javascratch | src/topcoder.py/LC_330_Patching_Array.py | 1 | 1807 | #!/usr/bin/env python
#coding=utf8
'''
Given a sorted positive integer array nums and an integer n, add/patch elements to the array such that any number in range [1, n] inclusive can be formed by the sum of some elements in the array. Return the minimum number of patches required.
Example 1:
nums = [1, 3], n = 6
Retu... | gpl-2.0 |
cloud9UG/odoo | addons/hr_holidays/wizard/__init__.py | 442 | 1122 | # -*- 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 |
timotheosh/python_koans | python3/libs/mock.py | 249 | 8036 | # mock.py
# Test tools for mocking and patching.
# Copyright (C) 2007-2009 Michael Foord
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# mock 0.6.0
# http://www.voidspace.org.uk/python/mock/
# Released subject to the BSD License
# Please see http://www.voidspace.org.uk/python/license.shtml
# Scripts maintained at h... | mit |
ratschlab/oqtans_tools | EasySVM/0.3.3/build/lib/esvm/experiment.py | 3 | 32654 | #############################################################################################
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU Gen... | mit |
SaltusVita/ReoGrab | Spiders.py | 1 | 6942 | '''
Created on 2 сент. 2016 г.
@author: garet
'''
import urllib.request
import queue
import sqlite3
import re
import json
from urllib.parse import urlparse
from Parser import HtmlPage
import lxml
class BaseSpider:
def __init__(self):
self.urls = QueueUrls()
self.cache = Sqlite... | bsd-3-clause |
hip-odoo/odoo | addons/payment_adyen/tests/test_adyen.py | 24 | 2956 | # -*- coding: utf-8 -*-
from lxml import objectify
import urlparse
from odoo.addons.payment.tests.common import PaymentAcquirerCommon
from odoo.addons.payment_adyen.controllers.main import AdyenController
class AdyenCommon(PaymentAcquirerCommon):
def setUp(self):
super(AdyenCommon, self).setUp()
... | agpl-3.0 |
JonathanStein/odoo | addons/hr_holidays/wizard/__init__.py | 442 | 1122 | # -*- 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 |
mojmir-svoboda/BlackBoxTT | 3rd_party/yaml-cpp/test/gmock-1.7.0/scripts/generator/cpp/ast.py | 268 | 62296 | #!/usr/bin/env python
#
# Copyright 2007 Neal Norwitz
# Portions Copyright 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... | mit |
dcroc16/skunk_works | google_appengine/lib/django-0.96/django/core/cache/backends/base.py | 32 | 1675 | "Base Cache class."
from django.core.exceptions import ImproperlyConfigured
class InvalidCacheBackendError(ImproperlyConfigured):
pass
class BaseCache(object):
def __init__(self, params):
timeout = params.get('timeout', 300)
try:
timeout = int(timeout)
except (ValueError, ... | mit |
andrewleech/SickRage | lib/requests/packages/urllib3/response.py | 150 | 22662 | from __future__ import absolute_import
from contextlib import contextmanager
import zlib
import io
import logging
from socket import timeout as SocketTimeout
from socket import error as SocketError
from ._collections import HTTPHeaderDict
from .exceptions import (
BodyNotHttplibCompatible, ProtocolError, DecodeErr... | gpl-3.0 |
rven/odoo | addons/l10n_ch/models/res_bank.py | 1 | 16379 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import re
from odoo import api, fields, models, _
from odoo.exceptions import ValidationError
from odoo.tools.misc import mod10r
from odoo.exceptions import UserError
import werkzeug.urls
ISR_SUBSCRIPTION_CODE = {'CHF... | agpl-3.0 |
kenshay/ImageScript | ProgramData/Android/ADB/platform-tools/systrace/catapult/telemetry/third_party/web-page-replay/third_party/dns/rdtypes/ANY/ISDN.py | 248 | 3233 | # Copyright (C) 2003-2007, 2009, 2010 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 ... | gpl-3.0 |
matiasdecarli/ansible-modules-core | files/template.py | 105 | 3323 | # this is a virtual module that is entirely implemented server side
# 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 op... | gpl-3.0 |
googleapis/googleapis-gen | google/cloud/talent/v4beta1/talent-v4beta1-py/google/cloud/talent_v4beta1/services/completion/transports/grpc.py | 1 | 11561 | # -*- 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 |
morbozoo/sonyHeadphones | tools/scripts/upgradevc11.py | 14 | 1271 | import os
import fileinput
import sys
import shutil
import xml.dom.minidom
import codecs
from os.path import join, getsize
for root, dirs, files in os.walk(sys.argv[1]):
for name in dirs:
if name == 'vc10':
print join( root, name )
shutil.copytree( join( root, name ), join( root, "... | bsd-2-clause |
rldleblanc/ceph-tools | osd_hunter.py | 1 | 6255 | #!/usr/bin/python
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
import argparse
import re
import datetime
import operator
import pprint
import glob
import gzip
slow_threshold = 10 #seconds
# Nothing to change past here
verbose = None
re_slow = re.compile(r'^(\d+-\d+-\d+\s+\d+:\d+:\d+\.\d+)\s+\w+\s+0.*slow.... | lgpl-3.0 |
henaras/horizon | openstack_dashboard/dashboards/project/loadbalancers/workflows.py | 20 | 30064 | # Copyright 2013, Big Switch Networks, 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 applic... | apache-2.0 |
razvanphp/arangodb | 3rdParty/V8-3.31.74.1/third_party/python_26/Lib/lib2to3/fixes/fix_except.py | 52 | 3243 | """Fixer for except statements with named exceptions.
The following cases will be converted:
- "except E, T:" where T is a name:
except E as T:
- "except E, T:" where T is not a name, tuple or list:
except E as t:
T = t
This is done because the target of an "except" clause must be a
... | apache-2.0 |
Andygmb/python-social-auth | social/exceptions.py | 65 | 3143 | class SocialAuthBaseException(ValueError):
"""Base class for pipeline exceptions."""
pass
class WrongBackend(SocialAuthBaseException):
def __init__(self, backend_name):
self.backend_name = backend_name
def __str__(self):
return 'Incorrect authentication service "{0}"'.format(
... | bsd-3-clause |
wolfram74/numerical_methods_iserles_notes | venv/lib/python2.7/site-packages/sympy/mpmath/tests/test_bitwise.py | 35 | 7152 | """
Test bit-level integer and mpf operations
"""
from sympy.mpmath import *
from sympy.mpmath.libmp import *
def test_bitcount():
assert bitcount(0) == 0
assert bitcount(1) == 1
assert bitcount(7) == 3
assert bitcount(8) == 4
assert bitcount(2**100) == 101
assert bitcount(2**100-1) == 100
de... | mit |
manipopopo/tensorflow | tensorflow/python/training/device_util_test.py | 23 | 3343 | # 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 |
michaelhkw/incubator-impala | tests/comparison/db_types.py | 3 | 6058 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
santisiri/popego | envs/ALPHA-POPEGO/lib/python2.5/site-packages/numpy-1.0.4-py2.5-linux-x86_64.egg/numpy/distutils/cpuinfo.py | 1 | 22466 | #!/usr/bin/env python
"""
cpuinfo
Copyright 2002 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@cens.ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy (BSD style) license. See LICENSE.txt that came with
this distribution for specifics.
NO WARRANTY IS EXP... | bsd-3-clause |
PyYoshi/android_kernel_kyocera_l03 | tools/perf/util/setup.py | 4998 | 1330 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... | gpl-2.0 |
prescottprue/PiOpenLighting | tools/rdm/TestDefinitions.py | 2 | 223170 | # !/usr/bin/python
# 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 program is distributed in the hope that it w... | lgpl-2.1 |
antepsis/anteplahmacun | sympy/matrices/expressions/tests/test_indexing.py | 85 | 2177 | from sympy import (symbols, MatrixSymbol, MatPow, BlockMatrix,
Identity, ZeroMatrix, ImmutableMatrix, eye, Sum)
from sympy.utilities.pytest import raises
k, l, m, n = symbols('k l m n', integer=True)
i, j = symbols('i j', integer=True)
W = MatrixSymbol('W', k, l)
X = MatrixSymbol('X', l, m)
Y = MatrixSymbol('... | bsd-3-clause |
skim1420/spinnaker | spinbot/event/release_branch_pull_request_handler.py | 1 | 2049 | from .handler import Handler
from .pull_request_event import GetBaseBranch, GetPullRequest, GetTitle, GetRepo
from gh import ReleaseBranchFor, ParseCommitMessage
format_message = ('Features cannot be merged into release branches. The following commits ' +
'are not tagged as one of "{}":\n\n{}\n\n' +
'Read more... | apache-2.0 |
wjwwood/open-robotics-platform | template.py | 1 | 1949 | #!/usr/bin/env python -OO
# encoding: utf-8
###########
# ORP - Open Robotics Platform
#
# Copyright (c) 2010 John Harrison, William Woodall
#
# 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 Softwa... | mit |
tiagofrepereira2012/tensorflow | tensorflow/contrib/learn/python/learn/ops/seq2seq_ops_test.py | 79 | 4314 | # 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 |
voidz777/android_kernel_samsung_tuna | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
rodrigc/buildbot | master/buildbot/mq/wamp.py | 3 | 4065 | # 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 |
Ebag333/Pyfa | eos/effects/subsystembonusgallentedefensivearmoredwarfare.py | 1 | 1528 | # subSystemBonusGallenteDefensiveArmoredWarfare
#
# Used by:
# Subsystem: Proteus Defensive - Warfare Processor
type = "passive"
def handler(fit, src, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Armored Command"), "buffDuration",
src.getModifiedIte... | gpl-3.0 |
mancoast/CPythonPyc_test | cpython/270_test_pep247.py | 3 | 2042 | """
Test suite to check compilance with PEP 247, the standard API
for hashing algorithms
"""
import warnings
warnings.filterwarnings('ignore', 'the md5 module is deprecated.*',
DeprecationWarning)
warnings.filterwarnings('ignore', 'the sha module is deprecated.*',
Deprec... | gpl-3.0 |
xgwubin/vitess | py/vtproto/queryservice_pb2.py | 8 | 17493 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: queryservice.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google... | bsd-3-clause |
dakcarto/QGIS | python/plugins/processing/algs/qgis/LinesToPolygons.py | 10 | 3214 | # -*- coding: utf-8 -*-
"""
***************************************************************************
LinesToPolygons.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***********************... | gpl-2.0 |
vinhlh/bite-project | deps/mrtaskman/server/mapreduce/lib/pipeline/simplejson/scanner.py | 43 | 2596 | #!/usr/bin/env python
"""JSON token scanner
"""
import re
def _import_c_make_scanner():
try:
from mapreduce.lib.simplejson._speedups import make_scanner
return make_scanner
except ImportError:
return None
c_make_scanner = _import_c_make_scanner()
__all__ = ['make_scanner']
NUMBER_RE = ... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.