repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
pedro2d10/SickRage-FR | lib/sqlalchemy/orm/util.py | 78 | 35759 | # orm/util.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from .. import sql, util, event, exc as sa_exc, inspection
from ..sql import expression, ... | gpl-3.0 |
jlombacher/pyqtgraph | pyqtgraph/pixmaps/pixmapData_3.py | 56 | 53111 | import numpy as np; pixmapData={'lock.png': b'\x80\x03cnumpy.core.multiarray\n_reconstruct\nq\x00cnumpy\nndarray\nq\x01K\x00\x85q\x02C\x01bq\x03\x87q\x04Rq\x05(K\x01K K K\x04\x87q\x06cnumpy\ndtype\nq\x07X\x02\x00\x00\x00u1q\x08K\x00K\x01\x87q\tRq\n(K\x03X\x01\x00\x00\x00|q\x0bNNNJ\xff\xff\xff\xffJ\xff\xff\xff\xffK\x00t... | mit |
agconti/Shopify-Django | venv/lib/python2.7/site-packages/django/contrib/localflavor/au/forms.py | 100 | 1826 | """
Australian-specific Form helpers
"""
from __future__ import absolute_import, unicode_literals
import re
from django.contrib.localflavor.au.au_states import STATE_CHOICES
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Sel... | mit |
aer0s/encode-od | local/lib/python/yaml/resolver.py | 474 | 8972 |
__all__ = ['BaseResolver', 'Resolver']
from error import *
from nodes import *
import re
class ResolverError(YAMLError):
pass
class BaseResolver(object):
DEFAULT_SCALAR_TAG = u'tag:yaml.org,2002:str'
DEFAULT_SEQUENCE_TAG = u'tag:yaml.org,2002:seq'
DEFAULT_MAPPING_TAG = u'tag:yaml.org,2002:map'
... | mit |
gopal1cloud/neutron | neutron/tests/unit/plumgrid/test_plumgrid_plugin.py | 2 | 6771 | # Copyright 2013 PLUMgrid, 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 ... | apache-2.0 |
marcoantoniooliveira/labweb | oscar/lib/python2.7/site-packages/pip/vcs/subversion.py | 473 | 10640 | import os
import re
from pip.backwardcompat import urlparse
from pip.index import Link
from pip.util import rmtree, display_path, call_subprocess
from pip.log import logger
from pip.vcs import vcs, VersionControl
_svn_xml_url_re = re.compile('url="([^"]+)"')
_svn_rev_re = re.compile('committed-rev="(\d+)"')
_svn_url_r... | bsd-3-clause |
alvarolopez/nova | nova/virt/hyperv/vhdutils.py | 67 | 7804 | # Copyright 2013 Cloudbase Solutions Srl
# 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 r... | apache-2.0 |
mheap/ansible | lib/ansible/plugins/lookup/flattened.py | 101 | 2821 | # (c) 2013, Serge van Ginderachter <serge@vanginderachter.be>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
lookup: flattened
aut... | gpl-3.0 |
kbaseapps/kb_uploadmethods | lib/kb_uploadmethods/kb_uploadmethodsServer.py | 2 | 29439 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
import json
import os
import random as _random
import sys
import traceback
from getopt import getopt, GetoptError
from multiprocessing import Process
from os import environ
from wsgiref.simple_server import make_server
import requests as _requests
from json... | mit |
darkrho/scrapy-scrapy | tests/test_downloadermiddleware.py | 35 | 4328 | from twisted.trial.unittest import TestCase
from twisted.python.failure import Failure
from scrapy.http import Request, Response
from scrapy.spiders import Spider
from scrapy.core.downloader.middleware import DownloaderMiddlewareManager
from scrapy.utils.test import get_crawler
from scrapy.utils.python import to_bytes... | bsd-3-clause |
jart/tensorflow | tensorflow/python/util/tf_contextlib_test.py | 141 | 3075 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
stormi/tsunami | src/primaires/interpreteur/masque/masque.py | 1 | 6994 | # -*-coding:Utf-8 -*
# Copyright (c) 2010 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# lis... | bsd-3-clause |
nikste/tensorflow | tensorflow/python/kernel_tests/sparse_tensor_dense_matmul_grad_test.py | 37 | 3154 | # 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 |
alvin319/CarnotKE | jyhton/lib-python/2.7/plat-irix6/cddb.py | 66 | 7218 | # This file implements a class which forms an interface to the .cddb
# directory that is maintained by SGI's cdman program.
#
# Usage is as follows:
#
# import readcd
# r = readcd.Readcd()
# c = Cddb(r.gettrackinfo())
#
# Now you can use c.artist, c.title and c.track[trackno] (where trackno
# starts at 1). When the CD... | apache-2.0 |
bregman-arie/ansible | lib/ansible/modules/network/panos/panos_query_rules.py | 13 | 18392 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage PaloAltoNetworks Firewall
# (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish... | gpl-3.0 |
drphilmarshall/emcee | emcee/interruptible_pool.py | 21 | 3313 | # -*- coding: utf-8 -*-
"""
Python's multiprocessing.Pool class doesn't interact well with
``KeyboardInterrupt`` signals, as documented in places such as:
* `<http://stackoverflow.com/questions/1408356/>`_
* `<http://stackoverflow.com/questions/11312525/>`_
* `<http://noswap.com/blog/python-multiprocessing-keyboardin... | mit |
agiledata/python-gpiozero | gpiozero/devices.py | 2 | 1108 | from threading import Thread, Event
from RPi import GPIO
class GPIODeviceError(Exception):
pass
class GPIODevice(object):
def __init__(self, pin=None):
if pin is None:
raise GPIODeviceError('No GPIO pin number given')
self._pin = pin
self._active_state = 1
self._... | bsd-3-clause |
maelnor/cinder | cinder/backup/rpcapi.py | 2 | 2526 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
# 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
#
#... | apache-2.0 |
slevenhagen/odoo | addons/purchase_double_validation/__init__.py | 441 | 1090 | # -*- 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 |
DeMille/emailhooks | django_nonrel/django/contrib/gis/gdal/tests/test_geom.py | 104 | 20864 | import json
from binascii import b2a_hex
try:
from django.utils.six.moves import cPickle as pickle
except ImportError:
import pickle
from django.contrib.gis.gdal import (OGRGeometry, OGRGeomType, OGRException,
OGRIndexError, SpatialReference, CoordTransform, GDAL_VERSION)
from django.contrib.gis.geometry.t... | mit |
peiwei/zulip | zerver/lib/rate_limiter.py | 3 | 7912 | from __future__ import absolute_import
from typing import Any, Iterator, Tuple
from django.conf import settings
from zerver.lib.redis_utils import get_redis_client
from six.moves import zip
from zerver.models import UserProfile
import redis
import time
import logging
# Implement a rate-limiting scheme inspired by ... | apache-2.0 |
tensorflow/agents | tf_agents/bandits/agents/greedy_multi_objective_neural_agent_test.py | 1 | 23905 | # coding=utf-8
# Copyright 2020 The TF-Agents Authors.
#
# 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 la... | apache-2.0 |
Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/_network_management_client.py | 1 | 17639 | # 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 |
rrivera1849/fann | lib/googletest/test/gtest_env_var_test.py | 2408 | 3487 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | lgpl-2.1 |
cpatrick/comic-django | django/comicmodels/migrations/0027_auto__del_field_comicsite_offers_data_download.py | 1 | 10103 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'ComicSite.offers_data_download'
db.delete_column(u'comicmodels_comicsite', 'offers_data_do... | apache-2.0 |
PennartLoettring/Poettrix | rootfs/usr/lib/python3.4/email/policy.py | 88 | 9290 | """This will be the home for the policy that hooks in the new
code that adds all the email6 features.
"""
from email._policybase import Policy, Compat32, compat32, _extend_docstrings
from email.utils import _has_surrogates
from email.headerregistry import HeaderRegistry as HeaderRegistry
from email.contentmanager impo... | gpl-2.0 |
akheron/raven-python | raven/transport/gevent.py | 20 | 1660 | """
raven.transport.gevent
~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from raven.transport.base import AsyncTransport
from raven.transport.http import HTTPTransport
try:
... | bsd-3-clause |
collinprice/titanium_mobile | support/common/mako/runtime.py | 40 | 15571 | # runtime.py
# Copyright (C) 2006, 2007, 2008 Michael Bayer mike_mp@zzzcomputing.com
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""provides runtime services for templates, including Context, Namespace, and various helper functions."""
fr... | apache-2.0 |
antb/TPT----My-old-mod | src/python/stdlib/test/test_dict.py | 35 | 20218 | import unittest
from test import test_support
import UserDict, random, string
import gc, weakref
class DictTest(unittest.TestCase):
def test_constructor(self):
# calling built-in types without argument must return empty
self.assertEqual(dict(), {})
self.assertIsNot(dict(), {})
def te... | gpl-2.0 |
jaruba/chromium.src | tools/telemetry/telemetry/core/platform/power_monitor/android_dumpsys_power_monitor_unittest.py | 43 | 1409 | # 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.
import os
import unittest
from telemetry.core.platform.power_monitor import android_dumpsys_power_monitor
from telemetry.core.util import GetUnittestDataDir... | bsd-3-clause |
Dennovin/kegmeter | kegmeter-app/kegmeter/app/Status.py | 1 | 1857 | import logging
import threading
import time
from kegmeter.common import DBClient
class TapStatus(object):
def __init__(self, tap_id):
self.tap_id = tap_id
self.pulses = 0
self.clear()
def update(self, pulses):
self.pulses += pulses
self.last_update = time.time()
d... | mit |
elit3ge/SickRage | SickBeard.py | 9 | 21478 | #!/usr/bin/env python2.7
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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 ... | gpl-3.0 |
charlescearl/VirtualMesos | third_party/gmock-1.6.0/gtest/test/gtest_throw_on_failure_test.py | 2917 | 5766 | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | apache-2.0 |
david30907d/feedback_django | spirit/core/utils/markdown/utils/emoji.py | 11 | 11800 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
emojis = {
"+1", "-1", "100", "1234", "8ball", "a", "ab", "abc", "abcd", "accept", "aerial_tramway", "airplane",
"alarm_clock", "alien", "ambulance", "anchor", "angel", "anger", "angry", "anguished", "ant", "apple",
"aquarius", "aries", "arr... | mit |
atsuyim/OpenBazaar | db/migrations/migration1.py | 13 | 1362 | #!/usr/bin/env python
from sqlite3 import dbapi2
from db.migrations import migrations_util
from node import constants
def upgrade(db_path):
with dbapi2.connect(db_path) as con:
cur = con.cursor()
# Use PRAGMA key to encrypt / decrypt database.
cur.execute("PRAGMA key = '%s';" % constant... | mit |
shawnadelic/shuup | shuup/core/models/_taxes.py | 1 | 4737 | # -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from django.core.exceptions import ... | agpl-3.0 |
Antelox/mhn | server/mhn/static/hpfeeds.py | 5 | 14065 | # ********************************************************************************
# * Dionaea
# * - catches bugs -
# *
# *
# *
# * Copyright (C) 2010 Mark Schloesser
# *
# * This program is free software; you can redistribute it and/or
# * modify it under the te... | lgpl-2.1 |
hnakamur/django | tests/serializers_regress/models.py | 169 | 8611 | """
A test spanning all the capabilities of all the serializers.
This class sets up a model for each model field type
(except for image types, because of the Pillow dependency).
"""
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import... | bsd-3-clause |
hybrid-storage-dev/cinder-fs-111t-hybrid-cherry | quota.py | 6 | 37954 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | apache-2.0 |
betrisey/home-assistant | homeassistant/components/sensor/mold_indicator.py | 6 | 8855 | """
Calculates mold growth indication from temperature and humidity.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.mold_indicator/
"""
import logging
import math
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHE... | mit |
monetate/sqlalchemy | test/dialect/mssql/test_types.py | 3 | 45622 | # -*- encoding: utf-8
import codecs
import datetime
import decimal
import os
import sqlalchemy as sa
from sqlalchemy import Boolean
from sqlalchemy import Column
from sqlalchemy import column
from sqlalchemy import Date
from sqlalchemy import DateTime
from sqlalchemy import DefaultClause
from sqlalchemy import Float
f... | mit |
g-weatherill/hmtk | hmtk/seismicity/declusterer/dec_gardner_knopoff.py | 2 | 6187 | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# LICENSE
#
# Copyright (c) 2010-2013, GEM Foundation, G. Weatherill, M. Pagani,
# D. Monelli.
#
# The Hazard Modeller's Toolkit is free software: you can redistribute
# it and/or modify it under the terms of the GNU Affero General Public
# License ... | agpl-3.0 |
bbgw/Klampt | Python/demos/robotiq.py | 1 | 13876 | """Modules for emulating the RobotiQ 3-finger Adaptive Gripper in a simulation.
The gripper is underactuated, with one motor per finger, so the individual
links cannot be addressed directly. Instead there is a complex, nonlinear
relationship between motor command and link positions, which also depends on
object colli... | bsd-3-clause |
mloesch/tablib | tablib/packages/openpyxl3/__init__.py | 116 | 2008 | # file openpyxl/__init__.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, modif... | mit |
sissaschool/elementpath | elementpath/namespaces.py | 1 | 4605 | #
# Copyright (c), 2018-2020, SISSA (International School for Advanced Studies).
# All rights reserved.
# This file is distributed under the terms of the MIT License.
# See the file 'LICENSE' in the root directory of the present
# distribution, or http://opensource.org/licenses/MIT.
#
# @author Davide Brunato <brunato@... | mit |
lispc/Paddle | python/paddle/trainer_config_helpers/evaluators.py | 4 | 24940 | # Copyright (c) 2016 PaddlePaddle 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 applic... | apache-2.0 |
openstack/os-collect-config | os_collect_config/config_drive.py | 1 | 5467 | #
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 |
mithro/openocd-old | contrib/xsvf_tools/svf2xsvf.py | 101 | 26710 | #!/usr/bin/python3.0
# Copyright 2008, SoftPLC Corporation http://softplc.com
# Dick Hollenbeck dick@softplc.com
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the Lic... | gpl-2.0 |
AlexGrig/GPy | GPy/models/gradient_checker.py | 8 | 17212 | # ## Copyright (c) 2012, GPy authors (see AUTHORS.txt).
# Licensed under the BSD 3-clause license (see LICENSE.txt)
from ..core.model import Model
import itertools
import numpy
from ..core.parameterization import Param
np = numpy
from ..util.block_matrices import get_blocks, get_block_shapes, unblock, get_blocks_3d, g... | bsd-3-clause |
Curso-OpenShift/Formulario | OverFlow/ProjectFormulario/env/lib/python2.7/site-packages/pip/_vendor/progress/helpers.py | 521 | 2854 | # Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE A... | gpl-3.0 |
txemagon/1984 | modules/Telegram-bot-python/telegram/callbackquery.py | 3 | 4698 | #!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2017
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
#... | gpl-3.0 |
betterlife/psi | psi/migrations/versions/40_e1f806a716b9_.py | 2 | 2397 | """ Add create date field to supplier model, make role.is_system and shipping.type_id not null.
Revision ID: e1f806a716b9
Revises: 052340beb7b5
Create Date: 2017-05-25 08:12:35.839903
"""
# revision identifiers, used by Alembic.
revision = 'e1f806a716b9'
down_revision = '052340beb7b5'
from alembic import op
import ... | mit |
biocore/qiime | scripts/split_sequence_file_on_sample_ids.py | 15 | 2634 | #!/usr/bin/env python
# File created on 20 Oct 2011
from __future__ import division
__author__ = "Greg Caporaso"
__copyright__ = "Copyright 2011, The QIIME project"
__credits__ = ["Greg Caporaso"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Greg Caporaso"
__email__ = "gregcaporaso@gmail.com"
from... | gpl-2.0 |
stonebig/numba | numba/core/typeconv/rules.py | 7 | 1775 | import itertools
from .typeconv import TypeManager, TypeCastingRules
from numba.core import types
default_type_manager = TypeManager()
def dump_number_rules():
tm = default_type_manager
for a, b in itertools.product(types.number_domain, types.number_domain):
print(a, '->', b, tm.check_compatible(a, ... | bsd-2-clause |
komsas/OpenUpgrade | addons/multi_company/__init__.py | 886 | 1054 | # -*- 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 |
NoahFlowa/glowing-spoon | venv/lib/python2.7/site-packages/pip/utils/outdated.py | 513 | 5455 | from __future__ import absolute_import
import datetime
import json
import logging
import os.path
import sys
from pip._vendor import lockfile
from pip._vendor.packaging import version as packaging_version
from pip.compat import total_seconds, WINDOWS
from pip.models import PyPI
from pip.locations import USER_CACHE_DI... | apache-2.0 |
uni-peter-zheng/autotest | server/subcommand.py | 4 | 8558 | __author__ = """Copyright Andy Whitcroft, Martin J. Bligh - 2006, 2007"""
import sys
import os
import time
import signal
import cPickle
import logging
from autotest.client.shared import error, utils
# entry points that use subcommand must set this to their logging manager
# to get log redirection for subcommands
lo... | gpl-2.0 |
Nosferatul/coala | tests/results/result_actions/DoNothingActionTest.py | 14 | 1350 | import unittest
from coala_utils.ContextManagers import retrieve_stdout
from coalib.results.Diff import Diff
from coalib.results.Result import Result
from coalib.results.result_actions.DoNothingAction import DoNothingAction
from coalib.settings.Section import Section, Setting
class DoNothingActionTest(unittest.TestC... | agpl-3.0 |
ojake/django | tests/basic/tests.py | 117 | 29910 | from __future__ import unicode_literals
import threading
import warnings
from datetime import datetime, timedelta
from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist
from django.db import DEFAULT_DB_ALIAS, DatabaseError, connections
from django.db.models.fields import Field
from django.db.m... | bsd-3-clause |
af1rst/bite-project | deps/gdata-python-client/samples/apps/marketplace_sample/gdata/apps/__init__.py | 285 | 21144 | #!/usr/bin/python
#
# Copyright (C) 2007 SIOS Technology, 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 appli... | apache-2.0 |
nthiep/global-ssh-server | lib/python2.7/site-packages/django/utils/html_parser.py | 231 | 4546 | from django.utils.six.moves import html_parser as _html_parser
import re
import sys
current_version = sys.version_info
use_workaround = (
(current_version < (2, 7, 3)) or
(current_version >= (3, 0) and current_version < (3, 2, 3))
)
HTMLParseError = _html_parser.HTMLParseError
if not use_workaround:
HTM... | agpl-3.0 |
swkyer/jieba | test/jieba_test.py | 64 | 9085 | #-*-coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import sys
sys.path.append("../")
import unittest
import types
import jieba
if sys.version_info[0] > 2:
from imp import reload
jieba.initialize()
test_contents = [
"这是一个伸手不见五指的黑夜。我叫孙悟空,我爱北京,我爱Python和C++。",
"我不喜欢日本和服。",
"雷猴回... | mit |
scrapy-plugins/scrapy-dotpersistence | scrapy_dotpersistence.py | 1 | 3030 | import os
import logging
import subprocess
from scrapy.exceptions import NotConfigured
from scrapy import signals
logger = logging.getLogger(__name__)
class DotScrapyPersistence(object):
@classmethod
def from_crawler(cls, crawler):
settings = crawler.settings
enabled = (settings.getbool('DO... | bsd-3-clause |
abdoosh00/edx-rtl-final | common/djangoapps/student/migrations/0019_create_approved_demographic_fields_fall_2012.py | 188 | 12985 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'UserProfile.occupation'
db.delete_column('auth_userprofile', 'occupation')
# Dele... | agpl-3.0 |
valaxy/robotframework-selenium2library | src/Selenium2Library/keywords/_element.py | 2 | 34673 | from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.remote.webelement import WebElement
from Selenium2Library import utils
from Selenium2Library.locators import ElementFinder
from Selenium2Library.locators import CustomLocator
from key... | apache-2.0 |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.7.2/Lib/test/test_pprint.py | 71 | 24693 | import pprint
import test.test_support
import unittest
import test.test_set
try:
uni = unicode
except NameError:
def uni(x):
return x
# list, tuple and dict subclasses that do or don't overwrite __repr__
class list2(list):
pass
class list3(list):
def __repr__(self):
return list.__repr... | mit |
endlessm/chromium-browser | third_party/llvm/llvm/utils/lit/lit/Test.py | 1 | 12362 | import os
from xml.sax.saxutils import quoteattr
from json import JSONEncoder
from lit.BooleanExpression import BooleanExpression
# Test result codes.
class ResultCode(object):
"""Test result codes."""
# We override __new__ and __getnewargs__ to ensure that pickling still
# provides unique ResultCode ob... | bsd-3-clause |
ChristineLaMuse/mozillians | vendor-local/lib/python/celery/utils/threads.py | 12 | 1982 | from __future__ import absolute_import
import os
import sys
import threading
import traceback
_Thread = threading.Thread
_Event = threading._Event
class Event(_Event):
if not hasattr(_Event, "is_set"): # pragma: no cover
is_set = _Event.isSet
class Thread(_Thread):
if not hasattr(_Thread, "i... | bsd-3-clause |
bernardkaminski/gini | backend/src/gloader/xml/sax/drivers2/drv_javasax.py | 11 | 5920 | """
SAX driver for the Java SAX parsers. Can only be used in Jython.
$Id: drv_javasax.py,v 1.5 2003/01/26 09:08:51 loewis Exp $
"""
# --- Initialization
version = "0.10"
revision = "$Revision: 1.5 $"
import string
from xml.sax import xmlreader, saxutils
from xml.sax.handler import feature_namespaces
from xml.sax im... | mit |
lukeiwanski/tensorflow | tensorflow/contrib/eager/python/examples/revnet/ops_test.py | 31 | 3160 | # Copyright 2018 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 |
rockyzhang/zhangyanhit-python-for-android-mips | python-modules/twisted/twisted/test/test_protocols.py | 49 | 32070 | # Copyright (c) 2001-2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for twisted.protocols package.
"""
import struct
from twisted.trial import unittest
from twisted.protocols import basic, wire, portforward
from twisted.internet import reactor, protocol, defer, task, error
from twisted.t... | apache-2.0 |
miptliot/edx-platform | lms/djangoapps/experiments/views.py | 2 | 4444 | from django.contrib.auth import get_user_model
from django.db import transaction
from edx_rest_framework_extensions.authentication import JwtAuthentication
from rest_framework import permissions, viewsets
from rest_framework.decorators import list_route
from rest_framework.filters import DjangoFilterBackend
from rest_f... | agpl-3.0 |
pabigot/pyxb | tests/trac/test-trac-0117.py | 2 | 2151 | # -*- coding: utf-8 -*-
import logging
if __name__ == '__main__':
logging.basicConfig()
_log = logging.getLogger(__name__)
import pyxb.binding.generate
import pyxb.utils.domutils
from xml.dom import Node
import os.path
xsd='''<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSch... | apache-2.0 |
postvakje/sympy | sympy/combinatorics/tests/test_partitions.py | 36 | 3377 | from sympy.core.compatibility import range
from sympy.combinatorics.partitions import (Partition, IntegerPartition,
RGS_enum, RGS_unrank, RGS_rank,
random_integer_partition)
from sympy.utilities.pytest import raises
from sympy.utili... | bsd-3-clause |
vilos/django-filer | filer/admin/tools.py | 12 | 1521 | #-*- coding: utf-8 -*-
from django.core.exceptions import PermissionDenied
def popup_status(request):
return '_popup' in request.REQUEST or 'pop' in request.REQUEST
def selectfolder_status(request):
return 'select_folder' in request.REQUEST
def popup_param(request):
if popup_status(request):
r... | mit |
davidemms/OrthoFinder | scripts_of/matrices.py | 1 | 2863 | # -*- coding: utf-8 -*-
#
# Copyright 2014 David Emms
#
# This program (OrthoFinder) is distributed under the terms of the GNU General Public License v3
#
# 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 Sof... | gpl-3.0 |
bdevloed/kubernetes | examples/cluster-dns/images/frontend/client.py | 468 | 1227 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... | apache-2.0 |
gundalow/ansible-modules-extras | cloud/amazon/ec2_vpc_net_facts.py | 23 | 3693 | #!/usr/bin/python
#
# This is a 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.
#
# This Ansible library is distributed in the hope that i... | gpl-3.0 |
xuru/pyvisdk | pyvisdk/do/answer_file_status_error.py | 1 | 1122 |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def AnswerFileStatusError(vim, *args, **kwargs):
'''The AnswerFileStatusError data object... | mit |
bluevoda/BloggyBlog | lib/python3.4/site-packages/setuptools/command/test.py | 25 | 7136 | import sys
import contextlib
from distutils.errors import DistutilsOptionError
from unittest import TestLoader
from setuptools.extern import six
from setuptools.extern.six.moves import map
from pkg_resources import (resource_listdir, resource_exists, normalize_path,
working_set, _namespace_... | gpl-3.0 |
jacknjzhou/neutron | neutron/tests/unit/extensions/test_l3.py | 6 | 137744 | # Copyright 2012 VMware, 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 ... | apache-2.0 |
invisiblek/python-for-android | python-modules/twisted/twisted/test/test_dirdbm.py | 61 | 6016 | # Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for dirdbm module.
"""
import os, shutil, glob
from twisted.trial import unittest
from twisted.persisted import dirdbm
class DirDbmTestCase(unittest.TestCase):
def setUp(self):
self.path = self.mktemp()
... | apache-2.0 |
40223110/2015CDAFinal_test2 | static/Brython3.1.1-20150328-091302/Lib/xml/sax/expatreader.py | 870 | 14659 | """
SAX driver for the pyexpat C module. This driver works with
pyexpat.__version__ == '2.22'.
"""
version = "0.20"
from xml.sax._exceptions import *
from xml.sax.handler import feature_validation, feature_namespaces
from xml.sax.handler import feature_namespace_prefixes
from xml.sax.handler import feature_external_... | gpl-3.0 |
datalogics/scons | src/engine/SCons/Tool/jar.py | 2 | 3542 | """SCons.Tool.jar
Tool-specific initialization for jar.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of... | mit |
emmuchira/kps_erp | erpnext/accounts/doctype/asset/test_asset.py | 8 | 10846 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from frappe.utils import cstr, nowdate, getdate, flt
from erpnext.accounts.doctype.asset.depreciation import post_depreciation_entries, sc... | gpl-3.0 |
mapr/sahara | sahara/plugins/mapr/services/hue/hue.py | 1 | 7505 | # Copyright (c) 2015, MapR Technologies
#
# 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... | apache-2.0 |
maxming2333/v2ex | mapreduce/input_readers.py | 20 | 31679 | #!/usr/bin/env python
#
# Copyright 2010 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 o... | bsd-3-clause |
nck0405/ChennaiEden | modules/templates/Climate/config.py | 4 | 3368 | # -*- coding: utf-8 -*-
try:
# Python 2.7
from collections import OrderedDict
except:
# Python 2.6
from gluon.contrib.simplejson.ordered_dict import OrderedDict
from gluon import current
from gluon.storage import Storage
T = current.T
settings = current.deployment_settings
"""
Climate Data Porta... | mit |
Vauxoo/stoqdrivers | stoqdrivers/printers/bematech/DP20C.py | 2 | 3922 | # -*- Mode: Python; coding: iso-8859-1 -*-
# vi:si:et:sw=4:sts=4:ts=4
##
## Stoqdrivers
## Copyright (C) 2006 Async Open Source <http://www.async.com.br>
## All rights reserved
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as publishe... | lgpl-2.1 |
mlperf/training_results_v0.7 | Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/3rdparty/tvm/tests/python/relay/test_pass_to_cps.py | 1 | 3642 | # 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 |
Rfam/rfam-production | scripts/support/update_go_terms.py | 1 | 9385 | """
Copyright [2009-2017] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | apache-2.0 |
mihailignatenko/erp | addons/l10n_eu_service/__openerp__.py | 254 | 3277 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Odoo, Open Source Business Applications
# Copyright (C) 2015 Odoo S.A. <http://www.odoo.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU A... | agpl-3.0 |
SNoiraud/gramps | gramps/gen/plug/menu/_family.py | 11 | 1787 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2007-2008 Brian G. Matherly
# Copyright (C) 2008 Gary Burton
#
# 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 v... | gpl-2.0 |
thaim/ansible | lib/ansible/modules/network/fortios/fortios_vpn_ipsec_concentrator.py | 13 | 11192 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, 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 Lic... | mit |
svsn2117/coala | coalib/output/Interactions.py | 15 | 1191 | def fail_acquire_settings(log_printer, settings_names_dict):
"""
This method throws an exception if any setting needs to be acquired.
:param log_printer: Printer responsible for logging the messages.
:param settings: A dictionary with the settings name as key and
... | agpl-3.0 |
TsarFox/chandere | tests/test_cli.py | 2 | 1182 | # Copyright (C) 2017 Jakob Kreuze, All Rights Reserved.
#
# This file is part of Chandere.
#
# Chandere is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) an... | gpl-3.0 |
sarantapichos/faircoop-market | addons/account/wizard/account_report_aged_partner_balance.py | 378 | 4012 | # -*- 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 |
biln/airflow | airflow/migrations/versions/40e67319e3a9_dagrun_config.py | 54 | 1056 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | apache-2.0 |
ak2703/edx-platform | lms/djangoapps/courseware/tests/test_views.py | 6 | 51322 | # coding=UTF-8
"""
Tests courseware views.py
"""
import cgi
import ddt
import json
import unittest
from datetime import datetime
from nose.plugins.attrib import attr
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.core.urlresolvers import reverse
from django.http impor... | agpl-3.0 |
Laurawly/tvm-1 | python/tvm/topi/hls/injective.py | 5 | 2055 | # 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.