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 |
|---|---|---|---|---|---|
gkarlin/django-jenkins | build/pylint/test/input/func_noerror_new_style_class_py_30.py | 4 | 1118 | """check builtin data descriptors such as mode and name attributes
on a file are correctly handled
bug notified by Pierre Rouleau on 2005-04-24
"""
__revision__ = None
class File(file):
""" Testing new-style class inheritance from file"""
#
def __init__(self, name, mode="r", buffering=-1, verbose=False)... | lgpl-3.0 |
40223119/2015cd_0505 | static/Brython3.1.1-20150328-091302/Lib/unittest/__init__.py | 900 | 2718 | """
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 tests and reporting the resu... | agpl-3.0 |
proxysh/Safejumper-for-Desktop | buildmac/Resources/env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/timeout.py | 713 | 9596 | from __future__ import absolute_import
# The default socket timeout, used by httplib to indicate that no timeout was
# specified by the user
from socket import _GLOBAL_DEFAULT_TIMEOUT
import time
from ..exceptions import TimeoutStateError
# A sentinel value to indicate that no timeout was specified by the user in
# u... | gpl-2.0 |
google/tmppy | _py2tmp/ir0_optimization/_expression_simplification.py | 1 | 17752 | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
JioEducation/edx-platform | cms/lib/xblock/tagging/migrations/0001_initial.py | 39 | 1187 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='TagAvailableValues',
fields=[
('id', models.Aut... | agpl-3.0 |
cppformat/cppformat | doc/conf.py | 16 | 8122 | # -*- coding: utf-8 -*-
#
# format documentation build configuration file, created by
# sphinx-quickstart on Tue Dec 18 06:46:16 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All ... | bsd-2-clause |
40023247/2015cd_0505 | static/Brython3.1.1-20150328-091302/Lib/collections/__init__.py | 625 | 25849 | #__all__ = ['deque', 'defaultdict', 'Counter']
from _collections import deque, defaultdict
#from itertools import repeat as _repeat, chain as _chain, starmap as _starmap
__all__ = ['deque', 'defaultdict', 'namedtuple', 'UserDict', 'UserList',
'UserString', 'Counter', 'OrderedDict']
# For bootstrapping re... | agpl-3.0 |
auduny/home-assistant | tests/components/tplink/test_init.py | 8 | 6404 | """Tests for the TP-Link component."""
from unittest.mock import patch
import pytest
from homeassistant import config_entries, data_entry_flow
from homeassistant.components import tplink
from homeassistant.setup import async_setup_component
from pyHS100 import SmartPlug, SmartBulb
from tests.common import MockDepende... | apache-2.0 |
kikusu/chainer | cupy/creation/matrix.py | 6 | 1675 | import numpy
import cupy
def diag(v, k=0):
"""Returns a diagonal or a diagonal array.
Args:
v (array-like): Array or array-like object.
k (int): Index of diagonals. Zero indicates the main diagonal, a
positive value an upper diagonal, and a negative value a lower
diag... | mit |
markeTIC/OCB | addons/google_drive/google_drive.py | 26 | 15793 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2012 OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General... | agpl-3.0 |
Eigenstate/dabble | convert_step5_to_dabble.py | 2 | 1142 | #!/usr/bin/env python
"""
Converts a step5_assembly.{psf,pdb} to a mae file appropriate
for membrane input to dabble
"""
from __future__ import print_function
import os
from vmd import atomsel, molecule
thedir = os.path.abspath(input("Which directory contains step5_assembly.{psf,crd}? > "))
if not os.path.isdir(thedi... | gpl-2.0 |
Deepakkothandan/ansible | lib/ansible/plugins/cliconf/iosxr.py | 58 | 2900 | #
# (c) 2017 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | gpl-3.0 |
melmothx/jsonbot | jsb/plugs/wave/gadget.py | 1 | 4625 | # jsb.plugs.wave/gadget.py
#
#
## jsb imports
from jsb.lib.commands import cmnds
from jsb.lib.examples import examples
from jsb.lib.persist import PlugPersist
gadgeturls = PlugPersist('gadgeturls')
gadgeturls.data['gadget'] = 'https://jsonbot.appspot.com/gadget.xml'
gadgeturls.data['poll'] = 'https://jsonbot.appspo... | mit |
tillahoffmann/tensorflow | tensorflow/python/kernel_tests/self_adjoint_eig_op_test.py | 6 | 7314 | # 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 |
Metaswitch/horizon | openstack_dashboard/dashboards/project/loadbalancers/forms.py | 45 | 12071 | # Copyright 2013, Mirantis 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 agre... | apache-2.0 |
zhouzhenghui/python-for-android | python-build/python-libs/gdata/src/gdata/tlslite/utils/xmltools.py | 259 | 7358 | """Helper functions for XML.
This module has misc. helper functions for working with XML DOM nodes."""
import re
from compat import *
import os
if os.name != "java":
from xml.dom import minidom
from xml.sax import saxutils
def parseDocument(s):
return minidom.parseString(s)
else:
from javax.... | apache-2.0 |
chhao91/QGIS | python/plugins/processing/algs/gdal/information.py | 11 | 3028 | # -*- coding: utf-8 -*-
"""
***************************************************************************
information.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***************************... | gpl-2.0 |
ShineFan/odoo | addons/purchase/__init__.py | 439 | 1185 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
mmbtba/odoo | addons/account/project/wizard/account_analytic_inverted_balance_report.py | 378 | 2045 | # -*- 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 |
ryangallen/django | tests/pagination/tests.py | 266 | 13459 | from __future__ import unicode_literals
import unittest
from datetime import datetime
from django.core.paginator import (
EmptyPage, InvalidPage, PageNotAnInteger, Paginator,
)
from django.test import TestCase
from django.utils import six
from .custom import ValidAdjacentNumsPaginator
from .models import Article... | bsd-3-clause |
mellowizz/ocny_tax_info | qgis_show_ocny_tax_info.py | 1 | 1143 | from qgis.core import *
from qgis.gui import *
import mechanize
import cookielib
@qgsfunction(args='auto', group='Custom')
def show_tax_info(pin, feature, parent):
br = mechanize.Browser()
# Cookie Jar
cj = cookielib.LWPCookieJar()
br.set_cookiejar(cj)
br.set_handle_equiv(True)
br.set_handle... | gpl-3.0 |
zzzeek/alembic | alembic/util/compat.py | 2 | 3714 | import collections
import inspect
import io
import os
is_posix = os.name == "posix"
ArgSpec = collections.namedtuple(
"ArgSpec", ["args", "varargs", "keywords", "defaults"]
)
def inspect_getargspec(func):
"""getargspec based on fully vendored getfullargspec from Python 3.3."""
if inspect.ismethod(func)... | mit |
mspark93/VTK | ThirdParty/Twisted/twisted/web/test/test_stan.py | 41 | 4762 |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.web._stan} portion of the L{twisted.web.template}
implementation.
"""
from twisted.web.template import Comment, CDATA, CharRef, Tag
from twisted.trial.unittest import TestCase
def proto(*a, **kw):
"""
Produce a n... | bsd-3-clause |
ccastell/Transfer-System | Website/env/lib/python3.5/site-packages/django/core/management/commands/sendtestemail.py | 126 | 1518 | import socket
from django.core.mail import mail_admins, mail_managers, send_mail
from django.core.management.base import BaseCommand
from django.utils import timezone
class Command(BaseCommand):
help = "Sends a test email to the email addresses specified as arguments."
missing_args_message = "You must specif... | apache-2.0 |
eduNEXT/edx-sga | edx_sga/tests/test_sga.py | 2 | 31225 | """
Tests for SGA
"""
# pylint: disable=imported-auth-user
import builtins
import datetime
import json
import mimetypes
import os
import uuid
from unittest import mock
import pytest
import pytz
from ddt import data, ddt, unpack
from django.conf import settings
from django.contrib.auth.models import User
from django.ut... | agpl-3.0 |
AlexWoo/pyed | pysys/pycmdserver.py | 1 | 1693 | from pyevent.event import event
from pyevent.tcpserver import tcpserver
from pyevent.tcpconnection import tcpconnection
class cmdserver(tcpserver):
def __init__(self, pesys):
self.evs = pesys.evs
self.tms = pesys.tms
self.log = pesys.log
self.proc = pesys.proc
self.proc.set... | bsd-2-clause |
odyaka341/pyglet | experimental/input/usage.py | 28 | 1240 | #!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import input
# (usage_page, usage): Device class
'''
device_usage_map = {
(0x01, 0x01): input.PointerDevice,
(0x01, 0x01): input.MouseDevice,
(0x01, 0x04): input.JoystickDevice,
(0x01, 0x05): input.GamePadDevice,... | bsd-3-clause |
ecreall/dace | dace/processinstance/tests/test_signal.py | 1 | 7346 | # Copyright (c) 2014 by Ecreall under licence AGPL terms
# available on http://www.gnu.org/licenses/agpl.html
# licence: AGPL
# author: Amen Souissi
import transaction
from pyramid.threadlocal import get_current_registry
from dace.interfaces import IProcessDefinition
import dace.processinstance.tests.example.process... | agpl-3.0 |
jriegel/FreeCAD | src/Mod/TemplatePyMod/PythonQt.py | 56 | 2708 | """
Examples for customizing the FreeCAD application with PySide facilities.
(c) 2007 Werner Mayer LGPL
"""
__author__ = "Werner Mayer <werner.wm.mayer@gmx.de>"
from PySide import QtCore,QtGui
import FreeCAD,FreeCADGui, __main__
class MainWindow:
def __init__(self):
self.app = QtGui.qApp
self.mw = FreeCADGui.ge... | lgpl-2.1 |
NCI-Cloud/cloud-tools | check-defunct-instances.py | 1 | 1214 | #!/usr/bin/env python
#
# Take a list of instance UUIDs and check their status. If the last activity
# recorded for them is more than six months ago mark them as defunct.
from util import get_nova_client, get_keystone_client
from util import get_instance, is_instance_to_be_expired
from util import output_report
from u... | gpl-3.0 |
Azure/azure-sdk-for-python | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/operations/_usages_operations.py | 1 | 5335 | # 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 may ... | mit |
helldorado/ansible | lib/ansible/modules/network/cloudengine/ce_vrf_af.py | 25 | 30329 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
vmindru/ansible | lib/ansible/plugins/doc_fragments/infinibox.py | 210 | 1564 | #
# (c) 2016, Gregory Shulov <gregory.shulov@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | gpl-3.0 |
fusionbox/django-extensions | django_extensions/management/commands/find_template.py | 18 | 1114 | from django.core.management.base import LabelCommand
from django.template import loader
from django.template import TemplateDoesNotExist
import sys
def get_template_path(path):
try:
template = loader.find_template(path)
if template[1]:
return template[1].name
# work arround htt... | mit |
andfoy/margffoy-tuay-server | env/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/schema.py | 187 | 4850 | from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
class PostGISSchemaEditor(DatabaseSchemaEditor):
geom_index_type = 'GIST'
geom_index_ops = 'GIST_GEOMETRY_OPS'
geom_index_ops_nd = 'GIST_GEOMETRY_OPS_ND'
sql_add_geometry_column = "SELECT AddGeometryColumn(%(table)s, %(col... | gpl-2.0 |
unix1986/scons | engine/SCons/Tool/GettextCommon.py | 9 | 18115 | """SCons.Tool.GettextCommon module
Used by several tools of `gettext` toolset.
"""
# Copyright (c) 2001 - 2014 The SCons Foundation
#
# 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 withou... | mit |
maeltac/hazanet | sense.py | 1 | 1881 |
import pdb
"""
Each sensor that uses this will follow these rules:
calling sensor.startup() function will initialize and calibrate the sensor. It will return 'Green' on success, 'Red' on failure
calling sensor.read() will return a float for that tick
calling sensor.reset() will attempt to reset the sensor, returning 0... | apache-2.0 |
flavio-fernandes/networking-odl | networking_odl/db/migration/alembic_migrations/env.py | 2 | 2841 | # Copyright 2015 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 |
daisymax/nvda | source/appModules/totalcmd.py | 2 | 1422 | #appModules/totalcmd.py
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2006-2012 NVDA Contributors
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
import appModuleHandler
from NVDAObjects.IAccessible import IAccessible
import speech
import controlTypes
oldAc... | gpl-2.0 |
athulkrishnan/google-python-class | basic/solution/wordcount.py | 211 | 3529 | #!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
"""Wordcount exercise
Google's Python class
The main() below is already defined and comp... | apache-2.0 |
hlzz/dotfiles | graphics/VTK-7.0.0/ThirdParty/ZopeInterface/zope/interface/tests/test_element.py | 2 | 1361 | ##############################################################################
#
# Copyright (c) 2003 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# T... | bsd-3-clause |
flaithbheartaigh/appuifw2 | python/appuifw2.py | 3 | 42271 | #
# appuifw2.py - enhanced appuifw
#
import e32
from appuifw import * # we want to enhance this
# import the C++ module
if e32.s60_version_info >= (3, 0):
import imp
_appuifw2 = imp.load_dynamic('_appuifw2', 'c:\\sys\\bin\\_appuifw2.pyd')
del imp
else:
import _appuifw2
# version
version = '1.00... | apache-2.0 |
bosstb/HaberPush | youtube_dl/extractor/fourtube.py | 27 | 4585 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
parse_duration,
parse_iso8601,
sanitized_Request,
str_to_int,
)
class FourTubeIE(InfoExtractor):
IE_NAME = '4tube'
_VALID_URL = r'https?://(?:www\.)?4tube\.com/videos/(?P<id>\d+)'
_... | mit |
ev3-ota/hrp2 | modules/btstack/platforms/arduino/docs/update_listings.py | 3 | 11638 | #!/usr/bin/env python
import getopt
import re
import sys
# Defines the names of example groups. Preserves the order in which the example groups will be parsed.
list_of_groups = ["iBeacon", "ANCS", "LE Central", "LE Peripheral"]
# Defines which examples belong to a group. Example is defined as [example file, example t... | gpl-2.0 |
tony/kivy | kivy/storage/redisstore.py | 8 | 2845 | '''
Redis Store
===========
Store implementation using Redis. You must have redis-py installed.
Usage example::
from kivy.storage.redisstore import RedisStore
params = dict(host='localhost', port=6379, db=14)
store = RedisStore(params)
All the key-value pairs will be stored with a prefix 'store' by def... | mit |
cubledesarrollo/cubledotes | cuble/suit/config.py | 1 | 2073 | from django.contrib.admin import ModelAdmin
from django.conf import settings
from . import VERSION
def default_config():
return {
'VERSION': VERSION,
# configurable
'ADMIN_NAME': 'Django Suit',
'HEADER_DATE_FORMAT': 'l, jS F Y',
'HEADER_TIME_FORMAT': 'H:i',
# form... | mit |
towerjoo/mindsbook | django/contrib/sessions/tests.py | 16 | 11096 | import base64
from datetime import datetime, timedelta
import pickle
import shutil
import tempfile
from django.conf import settings
from django.contrib.sessions.backends.db import SessionStore as DatabaseSession
from django.contrib.sessions.backends.cache import SessionStore as CacheSession
from django.contrib.session... | bsd-3-clause |
xindaya/bazel | tools/build_defs/docker/sha256.py | 20 | 1050 | # 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 by applicable law or ag... | apache-2.0 |
openbaoz/titanium_mobile | support/common/simplejson/encoder.py | 343 | 16033 | """Implementation of JSONEncoder
"""
import re
try:
from simplejson._speedups import encode_basestring_ascii as c_encode_basestring_ascii
except ImportError:
c_encode_basestring_ascii = None
try:
from simplejson._speedups import make_encoder as c_make_encoder
except ImportError:
c_make_encoder = None
... | apache-2.0 |
thurt/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/lib2to3/pgen2/driver.py | 49 | 4809 | # Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
# Modifications:
# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Parser driver.
This provides a high-level interface to parse a file into a synta... | apache-2.0 |
anksp21/Community-Zenpacks | ZenPacks.jschroeder.GangliaMonitor/ZenPacks/jschroeder/GangliaMonitor/datasources/GangliaMonitorDataSource.py | 3 | 3746 | ###########################################################################
#
# Copyright (C) 2010, Zenoss Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 as published by
# the Free Software Foundation.
#
# For complete infor... | gpl-2.0 |
s40223154/2017springvcp_hw | plugin/liquid_tags/test_notebook.py | 311 | 3042 | import re
from pelican.tests.support import unittest
from . import notebook
class TestNotebookTagRegex(unittest.TestCase):
def get_argdict(self, markup):
match = notebook.FORMAT.search(markup)
if match:
argdict = match.groupdict()
src = argdict['src']
star... | agpl-3.0 |
jabesq/home-assistant | homeassistant/components/bmw_connected_drive/binary_sensor.py | 7 | 8099 | """Reads vehicle status from BMW connected drive portal."""
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.const import LENGTH_KILOMETERS
from . import DOMAIN as BMW_DOMAIN
_LOGGER = logging.getLogger(__name__)
SENSOR_TYPES = {
'lids': ['Doors', 'opening'... | apache-2.0 |
mglukhikh/intellij-community | python/lib/Lib/site-packages/django/contrib/formtools/tests.py | 89 | 6613 | import unittest
from django import forms
from django.contrib.formtools import preview, wizard, utils
from django import http
from django.test import TestCase
success_string = "Done was called!"
class TestFormPreview(preview.FormPreview):
def done(self, request, cleaned_data):
return http.HttpResponse(suc... | apache-2.0 |
elainexmas/boto | tests/unit/ec2/test_instancetype.py | 114 | 5221 | #!/usr/bin/env python
from tests.unit import unittest
from tests.unit import AWSMockServiceTestCase
import boto.ec2
from boto.ec2.connection import EC2Connection
class TestEC2ConnectionBase(AWSMockServiceTestCase):
connection_class = EC2Connection
def setUp(self):
super(TestEC2ConnectionBase, self)... | mit |
lucafavatella/intellij-community | python/lib/Lib/site-packages/django/contrib/gis/geos/polygon.py | 321 | 6506 | from ctypes import c_uint, byref
from django.contrib.gis.geos.error import GEOSIndexError
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.contrib.gis.geos.libgeos import get_pointer_arr, GEOM_PTR
from django.contrib.gis.geos.linestring import LinearRing
from django.contrib.gis.geos import prototyp... | apache-2.0 |
Hossein-Noroozpour/PyHDM | hml/classification/HNearestNeighborsClassifier.py | 1 | 2014 | #!/usr/bin/python3.3
# coding=utf-8
"""
Module for K nearest neighbours.
"""
__author__ = 'Hossein Noroozpour Thany Abady'
#from math3d import sqrt
import numpy
class HNearestNeighboursClassifier():
"""
Class for K nearest neighbors algorithm.
"""
def __init__(self, n_neighbors=5, weight_function=l... | mit |
TridevGuha/pywikibot-core | tests/weblinkchecker_tests.py | 4 | 2724 | # -*- coding: utf-8 -*-
"""weblinkchecker test module."""
#
# (C) Pywikibot team, 2015
#
# Distributed under the terms of the MIT license.
#
from __future__ import unicode_literals
__version__ = '$Id$'
import datetime
from pywikibot.tools import PY2
if not PY2:
from urllib.parse import urlparse
else:
from u... | mit |
birdonwheels5/p2pool-myrScrypt | SOAPpy/NS.py | 289 | 3724 | from __future__ import nested_scopes
"""
################################################################################
#
# SOAPpy - Cayce Ullman (cayce@actzero.com)
# Brian Matthews (blm@actzero.com)
# Gregory Warnes (Gregory.R.Warnes@Pfizer.com)
# Christopher Blunck (blunck... | gpl-3.0 |
ndexbio/ndex-enrich | Persistence_Unit_Tests.py | 1 | 5444 | __author__ = 'aarongary'
import unittest
from persistence import EnrichmentPersistence
class Dev_Uint_Tests(unittest.TestCase):
def test_persistence(self):
try:
my_json = {
'termClassification': [{
'status': 'unknown',
'geneSymbol... | bsd-2-clause |
40223139/39g7test | static/Brython3.1.0-20150301-090019/Lib/xml/etree/__init__.py | 1200 | 1604 | # $Id: __init__.py 3375 2008-02-13 08:05:08Z fredrik $
# elementtree package
# --------------------------------------------------------------------
# The ElementTree toolkit is
#
# Copyright (c) 1999-2008 by Fredrik Lundh
#
# By obtaining, using, and/or copying this software and/or its
# associated documentation, you ... | gpl-3.0 |
coldmind/django | django/template/loaders/base.py | 4 | 3864 | import warnings
from django.template import Origin, Template, TemplateDoesNotExist
from django.utils.deprecation import RemovedInDjango21Warning
from django.utils.inspect import func_supports_parameter
class Loader(object):
# Only used to raise a deprecation warning. Remove in Django 2.0.
_accepts_engine_in_... | bsd-3-clause |
minhphung171093/GreenERP | openerp/addons/point_of_sale/wizard/pos_discount.py | 44 | 1320 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp.osv import osv, fields
class pos_discount(osv.osv_memory):
_name = 'pos.discount'
_description = 'Add a Global Discount'
_columns = {
'discount': fields.float('Discount (%)', required=T... | gpl-3.0 |
ybonjour/nuus | services/indexing/Indexer.py | 1 | 3702 | __author__ = 'Yves Bonjour'
from Tokenizer import create_tokenizer
import redis
import uuid
def create_indexer(redis_host, redis_port):
tokenizer = create_tokenizer()
redis_db = redis.Redis(redis_host, redis_port)
store = RedisIndexStore(redis_db)
return Indexer(store, tokenizer)
class Indexer:
... | mit |
yati-sagade/pip | pip/_vendor/lockfile/pidlockfile.py | 488 | 6221 | # -*- coding: utf-8 -*-
# pidlockfile.py
#
# Copyright © 2008–2009 Ben Finney <ben+python@benfinney.id.au>
#
# This is free software: you may copy, modify, and/or distribute this work
# under the terms of the Python Software Foundation License, version 2 or
# later as published by the Python Software Foundation.
# No ... | mit |
joomel1/phantomjs | src/breakpad/src/tools/gyp/pylib/gyp/generator/gypsh.py | 151 | 1660 | #!/usr/bin/python
# Copyright (c) 2009 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.
"""gypsh output module
gypsh is a GYP shell. It's not really a generator per se. All it does is
fire up an interactive Python session with a ... | bsd-3-clause |
coderbone/SickRage | lib/unidecode/x0b7.py | 253 | 4833 | data = (
'ddwim', # 0x00
'ddwib', # 0x01
'ddwibs', # 0x02
'ddwis', # 0x03
'ddwiss', # 0x04
'ddwing', # 0x05
'ddwij', # 0x06
'ddwic', # 0x07
'ddwik', # 0x08
'ddwit', # 0x09
'ddwip', # 0x0a
'ddwih', # 0x0b
'ddyu', # 0x0c
'ddyug', # 0x0d
'ddyugg', # 0x0e
'ddyugs', # 0x0f
'dd... | gpl-3.0 |
dleicht/PSB | pydrive/files.py | 4 | 9589 | import io
import mimetypes
from apiclient import errors
from apiclient.http import MediaIoBaseUpload
from functools import wraps
from .apiattr import ApiAttribute
from .apiattr import ApiAttributeMixin
from .apiattr import ApiResource
from .apiattr import ApiResourceList
from .auth import LoadAuth
class FileNotUplo... | mit |
kingvuplus/nn-gui | lib/python/Components/Scanner.py | 5 | 4791 | from Plugins.Plugin import PluginDescriptor
from Components.PluginComponent import plugins
from os import path as os_path, walk as os_walk, system
from mimetypes import guess_type, add_type
add_type("application/x-debian-package", ".ipk")
add_type("application/ogg", ".ogg")
add_type("audio/x-flac", ".flac")
add_type(... | gpl-2.0 |
MounirMesselmeni/django | django/conf/locale/id/formats.py | 504 | 2135 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j N Y'
DATETIME_FORMAT = "j N Y, ... | bsd-3-clause |
ycaihua/nimbus | scripts/ios/pbxproj.py | 41 | 41211 | #!/usr/bin/env python
# encoding: utf-8
"""
pbxproj.py
Working with the pbxproj file format is a pain in the ass.
This script provides a couple basic features for parsing pbxproj files:
* Getting a dependency list
* Adding one pbxproj to another pbxproj as a dependency
Version 1.2.
History:
1.0 - October 20, 2010:... | apache-2.0 |
andyzsf/edx | lms/djangoapps/courseware/features/change_enrollment.py | 25 | 1827 | """ Provides lettuce acceptance methods for course enrollment changes """
from __future__ import absolute_import
from lettuce import world, step
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from logging import getLogger
logger = getLogger(__name__)
import time
@step(u'the course "([^"]*)" has all e... | agpl-3.0 |
cria/microSICol | import_db.py | 1 | 7329 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Script to import XML data to current SICol database
# Obs: This script must be executed on root directory
# Author:Renato Arnellas Coelho renatoac at gmail dot com
import sys
import os
from xml.dom.minidom import Document,parse
def importSQLite(xml,sqlite_path='./db/sql... | gpl-2.0 |
grhawk/ASE | ase/calculators/elk.py | 2 | 14256 | import os
import numpy as np
from ase.units import Bohr, Hartree
from ase.io.elk import read_elk
from ase.calculators.calculator import FileIOCalculator, Parameters, kpts2mp, \
ReadError
elk_parameters = {
'swidth': Hartree,
}
class ELK(FileIOCalculator):
command = 'elk > elk.out'
implemented_pr... | gpl-2.0 |
Bobjoy/iOSBlogCN | Export.py | 65 | 1482 | __author__ = 'wwxiang'
#coding=utf-8
import os
import re
work = os.getcwd()
resxml = work + os.path.sep + 'blogcn.opml'
workmd = work + os.path.sep + 'README.md'
def handler():
isblock = True
handlerData = []
lineNo = 0
try:
with open(workmd,'rb') as linefs:
lineCout = len(linefs... | gpl-2.0 |
Sazzadmasud/Keystone_hash_token | keystone/common/sql/core.py | 5 | 13694 | # Copyright 2012 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 or agreed to in... | apache-2.0 |
longde123/MultiversePlatform | server/config/friendworld/extensions_proxy.py | 1 | 50308 | #
# The Multiverse Platform is made available under the MIT License.
#
# Copyright (c) 2012 The Multiverse Foundation
#
# 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 restrict... | mit |
resba/gnuradio | grc/base/FlowGraph.py | 28 | 7583 | """
Copyright 2008-2011 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion 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 l... | gpl-3.0 |
cwilkes/event_store_meta | tests/test_models.py | 1 | 1689 | # -*- coding: utf-8 -*-
"""Model unit tests."""
import datetime as dt
import pytest
from event_store_meta.user.models import User, Role
from .factories import UserFactory
@pytest.mark.usefixtures('db')
class TestUser:
def test_get_by_id(self):
user = User('foo', 'foo@bar.com')
user.save()
... | bsd-3-clause |
pv/scikit-learn | examples/neighbors/plot_nearest_centroid.py | 264 | 1804 | """
===============================
Nearest Centroid Classification
===============================
Sample usage of Nearest Centroid classification.
It will plot the decision boundaries for each class.
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
f... | bsd-3-clause |
xrmx/django | django/conf/locale/nb/formats.py | 504 | 1766 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i'
DATET... | bsd-3-clause |
hazrpg/calibre | src/calibre/devices/mtp/filesystem_cache.py | 14 | 8300 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
... | gpl-3.0 |
Shrhawk/edx-platform | common/lib/capa/capa/capa_problem.py | 10 | 36556 | #
# File: capa/capa_problem.py
#
# Nomenclature:
#
# A capa Problem is a collection of text and capa Response questions.
# Each Response may have one or more Input entry fields.
# The capa problem may include a solution.
#
"""
Main module which shows problems (of "capa" type).
This is used by capa_module.
"""
from ... | agpl-3.0 |
lumig242/Hue-Integration-with-CDAP | desktop/core/ext-py/tablib-0.10.0/tablib/packages/yaml/tokens.py | 985 | 2573 |
class Token(object):
def __init__(self, start_mark, end_mark):
self.start_mark = start_mark
self.end_mark = end_mark
def __repr__(self):
attributes = [key for key in self.__dict__
if not key.endswith('_mark')]
attributes.sort()
arguments = ', '.join(['%s=... | apache-2.0 |
heeraj123/oh-mainline | vendor/packages/scrapy/scrapyd/tests/test_poller.py | 30 | 1416 | import os
from twisted.trial import unittest
from twisted.internet.defer import Deferred
from zope.interface.verify import verifyObject
from scrapyd.interfaces import IPoller
from scrapyd.config import Config
from scrapyd.poller import QueuePoller
from scrapyd.utils import get_spider_queues
class QueuePollerTest(un... | agpl-3.0 |
cloud9UG/odoo | openerp/report/render/rml2pdf/utils.py | 381 | 7143 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2003, Fabien Pinckaers, UCL, FSA
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesse... | agpl-3.0 |
LinuxChristian/home-assistant | homeassistant/components/sensor/netdata.py | 2 | 5062 | """
Support gathering system information of hosts which are running netdata.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.netdata/
"""
import logging
from datetime import timedelta
from urllib.parse import urlsplit
import requests
import volupt... | apache-2.0 |
lctseng/NCTU-SDN-Project | openvswitch-2.3.0/tests/test-reconnect.py | 4 | 5682 | # Copyright (c) 2009, 2010, 2012 Nicira, 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 agre... | apache-2.0 |
reddraggone9/youtube-dl | youtube_dl/extractor/chaturbate.py | 13 | 1635 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import ExtractorError
class ChaturbateIE(InfoExtractor):
_VALID_URL = r'https?://(?:[^/]+\.)?chaturbate\.com/(?P<id>[^/?#]+)'
_TESTS = [{
'url': 'https://www.chaturbate.com/siswet19/',
'info_dict': {
... | unlicense |
fracting/depot_tools | third_party/gsutil/gslib/commands/getlogging.py | 51 | 5500 | # Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | bsd-3-clause |
Universal-Model-Converter/UMC3.0a | data/Python/x86/Lib/site-packages/OpenGL/GL/ARB/ES2_compatibility.py | 2 | 1257 | '''OpenGL extension ARB.ES2_compatibility
This module customises the behaviour of the
OpenGL.raw.GL.ARB.ES2_compatibility to provide a more
Python-friendly API
Overview (from the spec)
This extension adds support for features of OpenGL ES 2.0 that are
missing from OpenGL 3.x. Enabling these features will ease t... | mit |
sureshthalamati/spark | examples/src/main/python/ml/decision_tree_classification_example.py | 123 | 3003 | #
# 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 |
MG-group-tools/MGFunc | mgfunc_v2/cluster2fasta.py | 1 | 15574 | #!/usr/bin/env python2.7
import sys
import os
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 29 13:13:45 2013
CLASS-VERSION
@author: Kosai
"""
import cPickle as pickle
from datetime import datetime as dt
import time
import argparse
import gzip
class main:
'''
Class version of the cluster2fasta program
... | gpl-3.0 |
KontorConsulting/odoo | addons/l10n_be/wizard/l10n_be_partner_vat_listing.py | 302 | 14738 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# Corrections & modifications by Noviat nv/sa, (http://www.noviat.be):
# - VAT listing based upon year... | agpl-3.0 |
dgzurita/odoo | addons/association/__openerp__.py | 260 | 1700 | # -*- 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 |
cloudera/hue | desktop/core/ext-py/djangorestframework-3.9.4/rest_framework/schemas/generators.py | 3 | 14992 | """
generators.py # Top-down schema generation
See schemas.__init__.py for package overview.
"""
import re
from collections import Counter, OrderedDict
from importlib import import_module
from django.conf import settings
from django.contrib.admindocs.views import simplify_regex
from django.core.exceptions import Pe... | apache-2.0 |
tloredo/batse5bp | doc/sphinxext/numpydoc.py | 64 | 4058 | """
========
numpydoc
========
Sphinx extension that handles docstrings in the Numpy standard format. [1]
It will:
- Convert Parameters etc. sections to field lists.
- Convert See Also section to a See also entry.
- Renumber references.
- Extract the signature from the docstring, if it can't be determined otherwise.... | bsd-2-clause |
solome/jyp | misc/virtenv/lib/python2.7/site-packages/setuptools/extension.py | 165 | 1731 | import sys
import re
import functools
import distutils.core
import distutils.extension
from setuptools.dist import _get_unpatched
_Extension = _get_unpatched(distutils.core.Extension)
def have_pyrex():
"""
Return True if Cython or Pyrex can be imported.
"""
pyrex_impls = 'Cython.Distutils.build_ext',... | mpl-2.0 |
Curso-OpenShift/Formulario | OverFlow/ProjectFormulario/env/lib/python2.7/site-packages/django/contrib/flatpages/migrations/0001_initial.py | 308 | 1775 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sites', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='FlatPage',
fields=[
... | gpl-3.0 |
GoogleCloudPlatform/professional-services | examples/bq-email-exports/export_query_results_function/main.py | 1 | 2698 | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.