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 |
|---|---|---|---|---|---|
pblottiere/QGIS | tests/src/python/qgis_local_server.py | 38 | 29386 | # -*- coding: utf-8 -*-
"""Convenience interface to a locally spawned QGIS Server, e.g. for unit tests
.. note:: 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
(a... | gpl-2.0 |
bkirui/odoo | addons/product/__openerp__.py | 262 | 2504 | # -*- 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 |
arista-eosplus/ansible | contrib/inventory/fleet.py | 62 | 3063 | #!/usr/bin/env python
"""
fleetctl base external inventory script. Automatically finds the IPs of the booted coreos instances and
returns it under the host group 'coreos'
"""
# Copyright (C) 2014 Andrew Rothstein <andrew.rothstein at gmail.com>
#
# This program is free software: you can redistribute it and/or modify
... | gpl-3.0 |
cahdudul/akh8960_cm | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
rplevka/robottelo | tests/foreman/api/test_hostcollection.py | 1 | 14852 | """Unit tests for host collections.
:Requirement: Hostcollection
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: HostCollections
:Assignee: swadeley
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from random import choice
from random import randint
import pytest
from broker imp... | gpl-3.0 |
pimanttr/nixysa | nixysa/by_value_binding.py | 9 | 31742 | #!/usr/bin/python2.4
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 |
cpennington/edx-platform | openedx/core/djangoapps/user_api/tests/test_models.py | 4 | 7591 | """
Test UserPreferenceModel and UserPreference events
"""
from django.db import IntegrityError
from django.test import TestCase
from student.tests.factories import UserFactory
from student.tests.tests import UserSettingsEventTestMixin
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodu... | agpl-3.0 |
yvess/cmsplugin-filer | cmsplugin_filer_utils/migration.py | 4 | 1039 | # -*- coding: utf-8 -*-
def rename_tables(db, table_mapping, reverse=False):
"""
renames tables from source to destination name, if the source exists and the destination does
not exist yet.
"""
from django.db import connection
if reverse:
table_mapping = [(dst, src) for src, dst in tab... | bsd-3-clause |
leeon/annotated-django | tests/validation/models.py | 27 | 4489 | from __future__ import unicode_literals
from datetime import datetime
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
def validate_answer_to_universe(value):
if value != 42:
raise ValidationError('This is not t... | bsd-3-clause |
schlueter/ansible | lib/ansible/plugins/terminal/junos.py | 57 | 1817 | #
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | gpl-3.0 |
detiber/ansible | lib/ansible/modules/cloud/ovirt/ovirt_groups_facts.py | 26 | 3376 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... | gpl-3.0 |
michhar/flask-webapp-aml | env1/Lib/site-packages/pkg_resources/_vendor/packaging/_structures.py | 1152 | 1416 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
class Infinity(object):
def __repr__(self):
return "Infinity... | mit |
kdwink/intellij-community | python/helpers/pydev/pydevd_plugin_utils.py | 52 | 2644 | import types
import pydev_log
import pydevd_trace_api
from _pydev_imps._pydev_pluginbase import PluginBase
from pydevd_constants import * # @UnusedWildImport
def load_plugins(package):
plugin_base = PluginBase(package=package)
plugin_source = plugin_base.make_plugin_source(searchpath=[os.path.dirname(os.path... | apache-2.0 |
jmartiuk5/python-mode | pymode/libs3/rope/base/stdmods.py | 32 | 1296 | import os
import sys
from rope.base import utils
def _stdlib_path():
import inspect
return os.path.dirname(inspect.getsourcefile(inspect))
@utils.cached(1)
def standard_modules():
return python_modules() | dynload_modules()
@utils.cached(1)
def python_modules():
result = set()
lib_path = _stdli... | lgpl-3.0 |
boundarydevices/android_external_chromium_org | tools/telemetry/telemetry/page/page_filter.py | 42 | 2667 | # Copyright 2013 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 optparse
import re
from telemetry.core import command_line
def HasLabelIn(obj, labels):
for label in labels:
if hasattr(obj, label) and getat... | bsd-3-clause |
qris/dynamo-demo | deploy/fablib.py | 1 | 14547 | import os, sys
import getpass
import time
import shutil
from fabric.api import *
from fabric.contrib import files, console
from fabric.contrib.files import exists
from fabric import utils
def _setup_path():
# TODO: something like
# if not defined env.project_subdir:
# env.project_subdir = env.project
... | gpl-3.0 |
hzlf/openbroadcast | website/apps/actstream/managers.py | 5 | 4764 | from collections import defaultdict
from django.db.models import get_model
from django.db.models import Q
from django.contrib.contenttypes.models import ContentType
from actstream.gfk import GFKManager
from actstream.decorators import stream
class ActionManager(GFKManager):
"""
Default manager for Actions, ... | gpl-3.0 |
loretoparisi/nupic | scripts/run_experiment_classifier_diff.py | 35 | 1977 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | agpl-3.0 |
dfang/odoo | odoo/tools/appdirs.py | 79 | 19979 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2005-2010 ActiveState Software Inc.
# Copyright (c) 2013 Eddy Petrișor
"""Utilities for determining application-specific dirs.
See <http://github.com/ActiveState/appdirs> for details and usage.
"""
# Dev Notes:
# - MSDN on where to store app data files:
# ... | agpl-3.0 |
suiyuan2009/tensorflow | tensorflow/contrib/slim/python/slim/nets/overfeat.py | 164 | 5562 | # 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 |
brianjgeiger/osf.io | osf/migrations/0147_blacklistedemaildomain.py | 11 | 1679 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-12-13 16:02
from __future__ import unicode_literals
from django.db import migrations, models
import django_extensions.db.fields
import osf.utils.fields
from website import settings
def populate_blacklisted_domains(state, *args, **kwargs):
BlacklistedEm... | apache-2.0 |
soellman/copernicus | cpc/util/cmd_line_utils.py | 2 | 5176 | # This file is part of Copernicus
# http://www.copernicus-computing.org/
#
# Copyright (C) 2011, Sander Pronk, Iman Pouya, Erik Lindahl, and others.
#
# 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 Soft... | gpl-2.0 |
ghchinoy/tensorflow | tensorflow/contrib/nn/python/ops/alpha_dropout.py | 2 | 3436 | # 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 |
SLACKHA/pyJac | pyjac/performance_tester/__main__.py | 2 | 1239 | import sys
import os
from . import performance_tester as pt
from argparse import ArgumentParser
def main(args=None):
if args is None:
# command line arguments
parser = ArgumentParser(description='performance_tester.py: '
'tests pyJac performance'
... | mit |
RockySteveJobs/python-for-android | python-modules/twisted/twisted/news/test/test_news.py | 57 | 3221 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
import sys, types
from pprint import pformat
from twisted.trial import unittest
from twisted.news import database
from twisted.internet import reactor
MESSAGE_ID = "f83ba57450ed0fd8ac9a472b847e830e"
POST_STRING = """Path: not-for-mail... | apache-2.0 |
koditraquinas/koditraquinas.repository | addons_xml_generator.py | 133 | 4259 | # *
# * Copyright (C) 2012-2013 Garrett Brown
# * Copyright (C) 2010 j48antialias
# *
# * 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, or (at your option)
# * a... | gpl-2.0 |
ihatevim/spotbot | disabled_plugins/namegen.py | 4 | 2880 | # Plugin by Lukeroge
from util import hook
from util.text import get_text_list
import json, random, re, os
TEMPLATE_RE = re.compile(r"\{(.+?)\}")
GEN_DIR = "./plugins/data/name_files/"
def get_generator(_json):
data = json.loads(_json)
return NameGenerator(data["name"], data["templates"],
data["defau... | gpl-3.0 |
aviksil/xbmc-eden-flattened-linaro | addons/script.module.simplejson/lib/simplejson/__init__.py | 448 | 12463 | r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
:mod:`simplejson` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules. It is the externally maintained
version of ... | gpl-2.0 |
Keats/gutenberg | components/site/benches/gen.py | 1 | 5070 | """
Generates test sites for use in benchmark.
Tested with python3 and probably does not work on Windows.
"""
import datetime
import os
import random
import shutil
TAGS = ["a", "b", "c", "d", "e", "f", "g"]
CATEGORIES = ["c1", "c2", "c3", "c4"]
PAGE = """
+++
title = "Hello"
date = REPLACE_DATE
[taxonomies]
tags = ... | mit |
salcho/antares | ui/loggerWidget.py | 1 | 1137 | #!/usr/bin/env python
import gtk
import logging
import time
from ui.IWidget import IWidget
from core.data import logger
from core.log import addStreamHandler
#TODO: Implement file-like thread to show logging!
class loggerWidget(IWidget):
def __init__(self):
IWidget.__init__(self)
self.frame = gtk.Frame('Logger... | mit |
ondra-novak/chromium.src | third_party/google_appengine_cloudstorage/cloudstorage/rest_api.py | 106 | 8012 | # Copyright 2012 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... | bsd-3-clause |
docprofsky/sdr-examples | atsc-blade-usb2.py | 5 | 2766 | #!/usr/bin/env /usr/bin/python
# Copyright 2013-2014 Clayton Smith (argilo@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 Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
atreyv/sympy | sympy/functions/__init__.py | 26 | 2838 | """A functions module, includes all the standard functions.
Combinatorial - factorial, fibonacci, harmonic, bernoulli...
Elementary - hyperbolic, trigonometric, exponential, floor and ceiling, sqrt...
Special - gamma, zeta,spherical harmonics...
"""
from sympy.functions.combinatorial.factorials import (factorial, fac... | bsd-3-clause |
lightbase/WSCacicNeo | wscacicneo/test/blacklist/test_unit_blacklist.py | 1 | 3125 | #!/usr/env python
# -*- coding: utf-8 -*-
__author__ = 'adley'
import unittest
import os
from .. import settings
here = os.path.abspath(os.path.dirname(__file__))
data_path = os.path.join(here, "../fixtures/")
data_file = os.path.join(data_path, 'users/admin.json')
class TestAttributesBlacklist(unittest.TestCase):
... | gpl-2.0 |
PennartLoettring/Poettrix | rootfs/usr/lib/python3.4/base64.py | 88 | 20167 | #! /usr/bin/env python3
"""Base16, Base32, Base64 (RFC 3548), Base85 and Ascii85 data encodings"""
# Modified 04-Oct-1995 by Jack Jansen to use binascii module
# Modified 30-Dec-2003 by Barry Warsaw to add full RFC 3548 support
# Modified 22-May-2007 by Guido van Rossum to use bytes everywhere
import re
import struc... | gpl-2.0 |
Universal-Model-Converter/UMC3.0a | data/Python/x86/Lib/site-packages/scipy/misc/common.py | 2 | 14711 | """
Functions which are common and require SciPy Base and Level 1 SciPy
(special, linalg)
"""
from __future__ import division, print_function, absolute_import
from scipy.lib.six.moves import xrange
from numpy import exp, log, asarray, arange, newaxis, hstack, product, array, \
where, zeros, extract... | mit |
dyn888/youtube-dl | youtube_dl/extractor/daum.py | 7 | 4165 | # encoding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_urllib_parse
from ..utils import (
int_or_none,
str_to_int,
xpath_text,
)
class DaumIE(InfoExtractor):
_VALID_URL = r'https?://(?:m\.)?tvpot\.daum\.net/v/(?P<id>[^?#&]+)'
IE_NA... | unlicense |
twobob/buildroot-kindle | output/build/host-python-2.7.2/Lib/encodings/iso8859_4.py | 593 | 13632 | """ Python Character Mapping Codec iso8859_4 generated from 'MAPPINGS/ISO8859/8859-4.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors='... | gpl-2.0 |
direvus/ansible | lib/ansible/modules/cloud/scaleway/scaleway_user_data.py | 76 | 5055 | #!/usr/bin/python
#
# Scaleway user data management module
#
# Copyright (C) 2018 Online SAS.
# https://www.scaleway.com
#
# 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_METADAT... | gpl-3.0 |
jbzdak/edx-platform | lms/djangoapps/django_comment_client/tests/test_middleware.py | 134 | 1878 | import django.http
from django.test import TestCase
from nose.plugins.attrib import attr
import json
import lms.lib.comment_client
import django_comment_client.middleware as middleware
@attr('shard_1')
class AjaxExceptionTestCase(TestCase):
def setUp(self):
super(AjaxExceptionTestCase, self).setUp()
... | agpl-3.0 |
jolyonb/edx-platform | openedx/core/djangoapps/user_authn/views/deprecated.py | 2 | 6175 | """ User Authn code for deprecated views. """
from __future__ import absolute_import
import warnings
from django.conf import settings
from django.contrib import messages
from django.core.validators import ValidationError
from django.db import transaction
from django.http import HttpResponseForbidden
from django.short... | agpl-3.0 |
zestyr/lbry | lbrynet/dht/msgtypes.py | 1 | 1593 | #!/usr/bin/env python
#
# This library is free software, distributed under the terms of
# the GNU Lesser General Public License Version 3, or any later version.
# See the COPYING file included in this archive
#
# The docstrings in this module contain epytext markup; API documentation
# may be created by processing this... | mit |
diorcety/intellij-community | python/lib/Lib/site-packages/django/contrib/messages/api.py | 307 | 3570 | from django.contrib.messages import constants
from django.contrib.messages.storage import default_storage
from django.utils.functional import lazy, memoize
__all__ = (
'add_message', 'get_messages',
'get_level', 'set_level',
'debug', 'info', 'success', 'warning', 'error',
)
class MessageFailure(Exception... | apache-2.0 |
shalzuth/BraveHaxvius | IDAScripts/GetNetworkKeys.py | 1 | 2891 | from idautils import *
from idaapi import *
def get_string(addr):
out = ""
while True:
if Byte(addr) != 0:
out += chr(Byte(addr))
else:
break
addr += 1
return out
def get_string_from_head(head):
refs = DataRefsFrom(head)
for ref in refs:
refs2 = DataRefsFrom(ref)
for ref2 in refs2:
stringval... | mit |
sursum/buckanjaren | buckanjaren/lib/python3.5/site-packages/django/db/models/fields/related_lookups.py | 36 | 7019 | from django.db.models.lookups import (
Exact, GreaterThan, GreaterThanOrEqual, In, IsNull, LessThan,
LessThanOrEqual,
)
class MultiColSource(object):
contains_aggregate = False
def __init__(self, alias, targets, sources, field):
self.targets, self.sources, self.field, self.alias = targets, so... | mit |
myarjunar/QGIS | tests/src/python/test_qgsatlascomposition.py | 1 | 12477 | # -*- coding: utf-8 -*-
'''
test_qgsatlascomposition.py
--------------------------------------
Date : Oct 2012
Copyright : (C) 2012 by Dr. Hugo Mercier
email : hugo dot mercier at oslandia dot com
**************... | gpl-2.0 |
weimingtom/python-for-android | python3-alpha/python3-src/Lib/idlelib/ScriptBinding.py | 45 | 8161 | """Extension to execute code outside the Python shell window.
This adds the following commands:
- Check module does a full syntax check of the current module.
It also runs the tabnanny to catch any inconsistent tabs.
- Run module executes the module's code in the __main__ namespace. The window
must have been sa... | apache-2.0 |
XKNX/xknx | test/remote_value_tests/remote_value_dpt_value_1_ucount_test.py | 1 | 3237 | """Unit test for RemoteValueDptValue1Ucount objects."""
import pytest
from xknx import XKNX
from xknx.dpt import DPTArray, DPTBinary
from xknx.exceptions import ConversionError, CouldNotParseTelegram
from xknx.remote_value import RemoteValueDptValue1Ucount
from xknx.telegram import GroupAddress, Telegram
from xknx.tele... | mit |
MakerReduxCorp/mongoengine | tests/test_connection.py | 3 | 15595 | import datetime
from pymongo.errors import OperationFailure
try:
import unittest2 as unittest
except ImportError:
import unittest
from nose.plugins.skip import SkipTest
import pymongo
from bson.tz_util import utc
from mongoengine import (
connect, register_connection,
Document, DateTimeField
)
from m... | mit |
eRestin/MezzGIS | mezzanine/conf/forms.py | 1 | 3040 | from __future__ import unicode_literals
from future.builtins import int
from collections import defaultdict
from django import forms
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
from django.template.defaultfilters import urlize
from mezzanine.conf import setti... | bsd-2-clause |
krieger-od/nwjs_chromium.src | tools/profile_chrome/chrome_controller.py | 9 | 3985 | # 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 json
import os
import re
import time
from profile_chrome import controllers
from pylib import pexpect
from pylib.device import intent
_HEAP_PROFIL... | bsd-3-clause |
wnoc-drexel/gem5-stable | src/arch/x86/isa/insts/system/invlpg.py | 84 | 2383 | # Copyright (c) 2007-2008 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware imp... | bsd-3-clause |
qma/pants | tests/python/pants_test/tasks/test_jar_create.py | 4 | 7367 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from conte... | apache-2.0 |
MrNuggles/HeyBoet-Telegram-Bot | temboo/Library/Genability/TariffData/GetTariffs.py | 5 | 8977 | # -*- coding: utf-8 -*-
###############################################################################
#
# GetTariffs
# Returns a list of Tariff objects based a specified search criteria.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License... | gpl-3.0 |
ppcoin/ppcoin | test/functional/test_framework/comptool.py | 10 | 18149 | #!/usr/bin/env python3
# Copyright (c) 2015-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Compare two or more bitcoinds to each other.
To use, create a class that implements get_tests(), and p... | mit |
chifflier/suricata | python/suricata/sc/specs.py | 2 | 3521 | argsd = {
"pcap-file": [
{
"name": "filename",
"required": 1,
},
{
"name": "output-dir",
"required": 1,
},
{
"name": "tenant",
"type": int,
"required": 0,
},
{
"nam... | gpl-2.0 |
openshift/openshift-tools | ansible/roles/lib_oa_utils/src/class/repoquery.py | 23 | 6322 | # pylint: skip-file
# flake8: noqa
class Repoquery(RepoqueryCLI):
''' Class to wrap the repoquery
'''
# pylint: disable=too-many-arguments,too-many-instance-attributes
def __init__(self, name, query_type, show_duplicates,
match_version, ignore_excluders, verbose):
''' Construc... | apache-2.0 |
sdague/home-assistant | tests/components/homekit_controller/specific_devices/test_lg_tv.py | 8 | 2372 | """Make sure that handling real world LG HomeKit characteristics isn't broken."""
from homeassistant.components.media_player.const import (
SUPPORT_PAUSE,
SUPPORT_PLAY,
SUPPORT_SELECT_SOURCE,
)
from tests.common import async_get_device_automations
from tests.components.homekit_controller.common import (
... | apache-2.0 |
jhoos/django | django/template/utils.py | 34 | 4733 | import os
import warnings
from collections import Counter, OrderedDict
from django.apps import apps
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils import lru_cache
from django.utils._os import upath
from django.utils.deprecation import RemovedInDjango20Warnin... | bsd-3-clause |
ulrich3110/mfc | deb-binarys/builds/mfc1_1.0-1_UNRELEASED/mfc1-1.0/mfc1/unitest.py | 16 | 3857 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# With the MindfulClock you turn your device into a Bell of Mindfulness.
# Concept, Design: Marcurs Möller
# <marcus.moeller@outlook.com>
# <http://apps.microsoft.com/windows/de-de/app/
# mindfulclock/58063160-9cc6-4dee-9d92-... | gpl-3.0 |
lukeburden/django-allauth | allauth/socialaccount/providers/untappd/views.py | 10 | 1682 | import requests
from allauth.socialaccount.providers.oauth2.views import (
OAuth2Adapter,
OAuth2CallbackView,
OAuth2LoginView,
)
from .client import UntappdOAuth2Client
from .provider import UntappdProvider
class UntappdOAuth2Adapter(OAuth2Adapter):
provider_id = UntappdProvider.id
access_token_... | mit |
uncled1023/pygments | Pygments/pygments-lib/pygments/lexers/smalltalk.py | 47 | 7215 | # -*- coding: utf-8 -*-
"""
pygments.lexers.smalltalk
~~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for Smalltalk and related languages.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, include, bygroups, defa... | bsd-2-clause |
aequitas/home-assistant | homeassistant/components/googlehome/device_tracker.py | 7 | 2974 | """Support for Google Home Bluetooth tacker."""
from datetime import timedelta
import logging
from homeassistant.components.device_tracker import DeviceScanner
from homeassistant.helpers.event import async_track_time_interval
from homeassistant.util import slugify
from . import CLIENT, DOMAIN as GOOGLEHOME_DOMAIN, NA... | apache-2.0 |
libscie/liberator | liberator/lib/python3.6/site-packages/setuptools/command/egg_info.py | 19 | 24807 | """setuptools.command.egg_info
Create a distribution's .egg-info directory and contents"""
from distutils.filelist import FileList as _FileList
from distutils.errors import DistutilsInternalError
from distutils.util import convert_path
from distutils import log
import distutils.errors
import distutils.filelist
import... | cc0-1.0 |
volab/pyvorcv | setup.py | 1 | 3971 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# VoR-CV
# The MIT License
#
# Copyright (c) 2010,2015 Jeremie DECOCK (http://www.jdhp.org)
#
# 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 ... | mit |
AlexBoogaard/Sick-Beard-Torrent-Edition | lib/requests/packages/chardet/jpcntx.py | 1777 | 19348 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | gpl-3.0 |
nnethercote/servo | tests/wpt/web-platform-tests/common/security-features/subresource/svg.py | 16 | 1360 | import os, sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import subresource
def generate_payload(request, server_data):
data = ('{"headers": %(headers)s}') % server_data
if "id" in request.GET:
with request.server.stash.lock:
request.server.stash.take(request.GET["id"])... | mpl-2.0 |
hastexo/edx-platform | lms/djangoapps/instructor_task/migrations/0001_initial.py | 20 | 1439 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(setti... | agpl-3.0 |
robertnishihara/ray | python/ray/dashboard/node_stats.py | 1 | 13362 | from collections import defaultdict
from ray.dashboard.util import to_unix_time, format_reply_id
from base64 import b64decode
import ray
import threading
import json
import traceback
import copy
import logging
from datetime import datetime
import time
from typing import Dict
import re
from operator import itemgetter
... | apache-2.0 |
litchfield/django | django/contrib/gis/maps/google/gmap.py | 526 | 9223 | from __future__ import unicode_literals
from django.conf import settings
from django.contrib.gis.maps.google.overlays import (
GMarker, GPolygon, GPolyline,
)
from django.template.loader import render_to_string
from django.utils.html import format_html
from django.utils.safestring import mark_safe
from django.util... | bsd-3-clause |
pilou-/ansible | lib/ansible/modules/system/open_iscsi.py | 22 | 11413 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2013, Serge van Ginderachter <serge@vanginderachter.be>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'me... | gpl-3.0 |
rdio/sentry | src/sentry/web/frontend/projects/plugins.py | 1 | 5548 | """
sentry.web.frontend.projects.plugins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from django.contrib import messages
from django.core.context_processors import csrf
from django.core.urlresolvers import ... | bsd-3-clause |
fayf/pyload | module/web/utils.py | 33 | 3878 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License,
or (at your option) any later version.
This prog... | gpl-3.0 |
pombredanne/MOG | nova/virt/baremetal/db/sqlalchemy/session.py | 26 | 2068 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 NTT DOCOMO, INC.
# 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
#... | apache-2.0 |
2015fallproject/2015fallcase1 | static/Brython3.2.0-20150701-214155/Lib/test/unittests/test_lzma.py | 29 | 69792 | from io import BytesIO, UnsupportedOperation
import os
import random
import unittest
from test.support import (
_4G, TESTFN, import_module, bigmemtest, run_unittest, unlink
)
lzma = import_module("lzma")
from lzma import LZMACompressor, LZMADecompressor, LZMAError, LZMAFile
class CompressorDecompressorTestCase(... | agpl-3.0 |
evensonbryan/yocto-autobuilder | lib/python2.7/site-packages/SQLAlchemy-0.8.0b2-py2.7-linux-x86_64.egg/sqlalchemy/orm/loading.py | 6 | 21761 | # orm/loading.py
# Copyright (C) 2005-2012 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
"""private module containing functions used to convert database
rows into object instan... | gpl-2.0 |
midma101/m0du1ar | .venv/lib/python2.7/site-packages/migrate/tests/versioning/test_runchangeset.py | 41 | 1717 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os,shutil
from migrate.tests import fixture
from migrate.versioning.schema import *
from migrate.versioning import script
class TestRunChangeset(fixture.Pathed,fixture.DB):
level=fixture.DB.CONNECT
def _setup(self, url):
super(TestRunChangeset, se... | mit |
rrrrrr8/vnpy | vnpy/api/ctp/py3/pyscript/ctp_data_type.py | 75 | 263961 | # encoding: UTF-8
defineDict = {}
typedefDict = {}
#//////////////////////////////////////////////////////////////////////
#@system 新一代交易所系统
#@company 上海期货信息技术有限公司
#@file ThostFtdcUserApiDataType.h
#@brief 定义了客户端接口使用的业务数据类型
#@history
#20060106 赵鸿昊 创建该文件
#/////////////////////////////////////////////////////////////... | mit |
django-crispy-forms/django-crispy-forms | crispy_forms/tests/utils.py | 2 | 1311 | import os
from pathlib import Path
from django.test.html import Element, parse_html
from crispy_forms.utils import render_crispy_form
TEST_DIR = os.path.dirname(os.path.abspath(__file__))
def contains_partial(haystack, needle, ignore_needle_children=False):
"""Search for a html element with at least the corres... | mit |
0/realtimepork | realtimepork/gpu.py | 1 | 1605 | """
GPU utilities.
"""
from functools import wraps
from math import ceil
# Load everything we need in this module from PyCUDA (but don't autoinit until
# requested).
try:
from pycuda.tools import DeviceData
except ImportError:
_pycuda_available = False
else:
_pycuda_available = True
# Is this thing on?
... | mit |
miguelgrinberg/heat | contrib/rackspace/rackspace/tests/test_rackspace_dns.py | 5 | 11862 | #
# 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 |
cpyou/odoo | openerp/addons/base/ir/ir_rule.py | 312 | 8048 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 |
archen/django | tests/i18n/test_compilation.py | 13 | 4924 | import os
import stat
import unittest
from django.core.management import call_command, CommandError
from django.core.management.utils import find_command
from django.test import SimpleTestCase
from django.test import override_settings
from django.utils import translation
from django.utils._os import upath
from django.... | bsd-3-clause |
mbrukman/mapnik | scons/scons-local-2.3.6/SCons/Tool/javac.py | 4 | 8631 | """SCons.Tool.javac
Tool-specific initialization for javac.
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 (c) 2001 - 2015 The SCons Foundation
#
# Permission is hereby granted, free of charge... | lgpl-2.1 |
vianuevm/Webparser | ENV/Lib/site-packages/whoosh/lang/snowball/dutch.py | 96 | 6194 | from .bases import _StandardStemmer
from whoosh.compat import u
class DutchStemmer(_StandardStemmer):
"""
The Dutch Snowball stemmer.
:cvar __vowels: The Dutch vowels.
:type __vowels: unicode
:cvar __step1_suffixes: Suffixes to be deleted in step 1 of the algorithm.
:type __step1_suffixes: t... | gpl-2.0 |
ronniel1/Voodoo-Mock | voodoo/unittests/test_c_parsing.py | 1 | 16651 | import unittest
import savingiterator
import pprint
import tools
class TestCParsing( unittest.TestCase ):
def setUp( self ):
self.maxDiff = None
def _simpleTest( self, contents, expected ):
tested = savingiterator.SavingIterator()
with tools.temporaryFile( contents ) as contentsFile:
... | gpl-2.0 |
flwh/KK_mt6589_iq451 | prebuilts/python/darwin-x86/2.7.5/lib/python2.7/plat-mac/lib-scriptpackages/Finder/Containers_and_folders.py | 82 | 9578 | """Suite Containers and folders: Classes that can contain other file system items
Level 1, version 1
Generated from /System/Library/CoreServices/Finder.app
AETE/AEUT resource version 0/144, language 0, script 0
"""
import aetools
import MacOS
_code = 'fndr'
class Containers_and_folders_Events:
pass
class dis... | gpl-2.0 |
Belxjander/Kirito | Python-3.5.0-main/Lib/tabnanny.py | 101 | 11399 | #! /usr/bin/env python3
"""The Tab Nanny despises ambiguous indentation. She knows no mercy.
tabnanny -- Detection of ambiguous indentation
For the time being this module is intended to be called as a script.
However it is possible to import it into an IDE and use the function
check() described below.
Warning: The... | gpl-3.0 |
louis-mclaughlin/platformer | external/GamePlay-deps/freetype-2.4.5/src/tools/cordic.py | 401 | 1588 | # compute arctangent table for CORDIC computations in fttrigon.c
import sys, math
#units = 64*65536.0 # don't change !!
units = 256
scale = units/math.pi
shrink = 1.0
comma = ""
def calc_val( x ):
global units, shrink
angle = math.atan(x)
shrink = shrink * math.cos(angle)
return angle/math.pi *... | apache-2.0 |
unicri/edx-platform | pavelib/utils/test/suites/python_suite.py | 16 | 1271 | """
Classes used for defining and running python test suites
"""
from pavelib.utils.test import utils as test_utils
from pavelib.utils.test.suites import TestSuite, LibTestSuite, SystemTestSuite
from pavelib.utils.envs import Env
__test__ = False # do not collect
class PythonTestSuite(TestSuite):
"""
A subc... | agpl-3.0 |
PurrfectDream/notepad-plus-plus | scintilla/test/XiteWin.py | 54 | 13979 | # -*- coding: utf-8 -*-
# Requires Python 2.7 or later
from __future__ import with_statement
from __future__ import unicode_literals
import os, sys, unittest
import ctypes
from ctypes import wintypes
from ctypes import c_int, c_ulong, c_char_p, c_wchar_p, c_ushort, c_uint, c_long
from ctypes.wintypes impo... | gpl-2.0 |
tudennis/LeetCode---kamyu104-11-24-2015 | Python/backspace-string-compare.py | 2 | 1345 | # Time: O(m + n)
# Space: O(1)
# Given two strings S and T, return if they are equal
# when both are typed into empty text editors. # means a backspace character.
#
# Example 1:
#
# Input: S = "ab#c", T = "ad#c"
# Output: true
# Explanation: Both S and T become "ac".
# Example 2:
#
# Input: S = "ab##", T = "c#d#"
# O... | mit |
hfercc/mese2014 | lib/rest_framework/mixins.py | 1 | 7228 | """
Basic building blocks for generic class based views.
We don't bind behaviour to http method handlers yet,
which allows mixin classes to be composed in interesting ways.
"""
from __future__ import unicode_literals
from django.core.exceptions import ValidationError
from django.http import Http404
from res... | apache-2.0 |
OpenPymeMx/OCB | openerp/tools/pdf_utils.py | 456 | 3659 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 |
bak1an/django | tests/template_tests/filter_tests/test_stringformat.py | 73 | 1191 | from django.template.defaultfilters import stringformat
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class StringformatTests(SimpleTestCase):
"""
Notice that escaping is applied *after* any filters, so the string
formatting here only needs... | bsd-3-clause |
tomhenderson/ns-3-dev-testing | src/csma-layout/bindings/modulegen__gcc_ILP32.py | 28 | 486509 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
gangadhar-kadam/sapphire_app | utilities/doctype/address/address.py | 2 | 2030 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes import msgprint
from webnotes.utils import cstr, cint
class DocType:
def __init__(self, doc, doclist=[]):
self.doc = doc
self.doc... | agpl-3.0 |
calpeyser/google-cloud-python | runtimeconfig/google/cloud/runtimeconfig/variable.py | 2 | 8308 | # Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
okeefem2/rhodesiderelics | frontend/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py | 1835 | 12124 | # 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.
"""New implementation of Visual Studio project generation."""
import os
import random
import gyp.common
# hashlib is supplied as of Python 2.5 as the replacemen... | mit |
aerostitch/nagios_checks | hdfs_datanode_balancing_status.py | 1 | 4396 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Joseph Herlant <herlantj@gmail.com>
# File name: hdfs_datanode_balancing_status.py
# Creation date: 2014-10-08
#
# Distributed under terms of the GNU GPLv3 license.
"""
This nagios active check parses the Hadoop HDFS web interface url:
http://<namenode>:<port>... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.