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
mattias-ohlsson/anaconda
tests/pyanaconda_test/vnc_test.py
2
4102
#!/usr/bin/python import mock import os class VncTest(mock.TestCase): def setUp(self): self.setupModules(["_isys", "block", "logging", "ConfigParser"]) self.fs = mock.DiskIO() import pyanaconda pyanaconda.anaconda_log = mock.Mock() self.OK = 22 import pyanaconda...
gpl-2.0
SNeuhausen/training_management
models/education_plan/education_plan.py
1
7704
# -*- coding: utf-8 -*- # /############################################################################# # # Stephan Neuhausen. # Copyright (C) 20014-TODAY Stephan Neuhausen iad.de. # # /############################################################################# from datetime import date from openerp import m...
gpl-3.0
jezdez/kuma
vendor/packages/translate/convert/po2wordfast.py
25
4112
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2005-2007 Zuza Software Foundation # # This file is part of translate. # # translate 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...
mpl-2.0
dongjoon-hyun/spark
python/pyspark/ml/__init__.py
25
1530
# # 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
waidyanatha/sambro-eden
private/templates/EUROSHA/config.py
2
19304
# -*- 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 from s3.s3forms import S3SQLCustomForm, S3SQLInlineComponent, S3SQLInlineCompone...
mit
TaintTrap/platform_external_chromium
net/tools/testserver/xmppserver.py
67
16907
#!/usr/bin/python2.4 # Copyright (c) 2010 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. """A bare-bones and non-compliant XMPP server. Just enough of the protocol is implemented to get it to work with Chrome's sync noti...
bsd-3-clause
iandees/all-the-places
locations/spiders/lifetime.py
1
1351
# -*- coding: utf-8 -*- import scrapy import json from locations.items import GeojsonPointItem class LifetimeFitnessSpider(scrapy.Spider): name = "lifetimefitness" allowed_domains = ['lifetime.life'] start_urls = ( 'https://www.lifetime.life/view-all-locations.html', ) def parse(self, res...
mit
GuillaumeGomez/servo
tests/wpt/web-platform-tests/webdriver/support/asserts.py
23
2715
# WebDriver specification ID: dfn-error-response-data errors = { "element click intercepted": 400, "element not selectable": 400, "element not interactable": 400, "insecure certificate": 400, "invalid argument": 400, "invalid cookie domain": 400, "invalid coordinates": 400, "invalid elem...
mpl-2.0
eduNEXT/edx-platform
openedx/core/djangoapps/schedules/migrations/0001_initial.py
3
1385
import django.utils.timezone import model_utils.fields from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('student', '0001_squashed_0031_auto_20200317_1122'), ] operations = [ migrations.CreateModel( name='Schedule', ...
agpl-3.0
TheWardoctor/Wardoctors-repo
script.module.exodus/lib/resources/lib/sources/en/watchfree.py
5
8377
# -*- coding: utf-8 -*- ''' Exodus Add-on 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 progra...
apache-2.0
dudepare/django
tests/m2m_regress/tests.py
273
4695
from __future__ import unicode_literals from django.core.exceptions import FieldError from django.test import TestCase from django.utils import six from .models import ( Entry, Line, Post, RegressionModelSplit, SelfRefer, SelfReferChild, SelfReferChildSibling, Tag, TagCollection, Worksheet, ) class M2MRegre...
bsd-3-clause
jordanemedlock/psychtruths
temboo/Library/Google/Plus/Domains/Media/Insert.py
5
6021
# -*- coding: utf-8 -*- ############################################################################### # # Insert # Adds a new media item to an album. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file exce...
apache-2.0
kris-singh/pgmpy
pgmpy/base/DirectedGraph.py
3
9379
#!/usr/bin/env python3 import itertools import networkx as nx from pgmpy.base import UndirectedGraph class DirectedGraph(nx.DiGraph): """ Base class for all Directed Graphical Models. Each node in the graph can represent either a random variable, `Factor`, or a cluster of random variables. Edges i...
mit
MinFu/youtube-dl
youtube_dl/extractor/hypem.py
128
2101
from __future__ import unicode_literals import json import time from .common import InfoExtractor from ..compat import ( compat_urllib_parse, compat_urllib_request, ) from ..utils import ( ExtractorError, ) class HypemIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?hypem\.com/track/(?P<id>[^/]+)/...
unlicense
mcrowson/django
tests/check_framework/test_model_field_deprecation.py
322
2584
from django.core import checks from django.db import models from django.test import SimpleTestCase from .tests import IsolateModelsMixin class TestDeprecatedField(IsolateModelsMixin, SimpleTestCase): def test_default_details(self): class MyField(models.Field): system_check_deprecated_details ...
bsd-3-clause
hyz1011088/StarCluster
utils/s3mount.py
21
1151
#!/usr/bin/env python import os import sys from starcluster.config import StarClusterConfig print 'Simple wrapper script for s3fs (http://s3fs.googlecode.com/)' cfg = StarClusterConfig().load() ec2 = cfg.get_easy_ec2() buckets = ec2.s3.get_buckets() counter = 0 for bucket in buckets: print "[%d] %s" % (counter,b...
gpl-3.0
MechanisM/musicdb
contrib/django/core/serializers/base.py
2
5366
""" Module for abstract serializer/unserializer base classes. """ from StringIO import StringIO from django.db import models from django.utils.encoding import smart_unicode class SerializerDoesNotExist(KeyError): """The requested serializer was not found.""" pass class SerializationError(Exception): """...
agpl-3.0
RevelSystems/django
django/conf/locale/hu/formats.py
504
1117
# -*- 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 = 'Y. F j.' TIME_FORMAT = 'G.i' DATE...
bsd-3-clause
emrecamasuvi/appengineTmp
lib/flask/helpers.py
776
33793
# -*- coding: utf-8 -*- """ flask.helpers ~~~~~~~~~~~~~ Implements various helpers. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os import sys import pkgutil import posixpath import mimetypes from time import time from zlib import adler32 from th...
apache-2.0
kjschiroo/WikiChatter
test/test_indentblock.py
1
5369
import unittest import wikichatter.indentblock as indentblock import wikichatter.mwparsermod as mwpm EMPTY = "\n" LEVEL0 = "Level 0\n" LEVEL1 = ":Level 1\n" LEVEL2 = "::Level 2\n" LEVEL3 = ":::Level 3\n" LEVEL4 = "::::Level 4\n" LIST1 = "*Level 1\n" LIST2 = "**Level 2\n" LIST3 = "***Level 3\n" LIST4 = "****Level 4\n...
mit
sauloal/pycluster
pypy-1.9_64/lib-python/2.7/distutils/tests/test_check.py
14
3546
"""Tests for distutils.command.check.""" import unittest from test.test_support import run_unittest from distutils.command.check import check, HAS_DOCUTILS from distutils.tests import support from distutils.errors import DistutilsSetupError class CheckTestCase(support.LoggingSilencer, support.Temp...
mit
aferr/TimingCompartments
src/mem/slicc/symbols/State.py
60
1754
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood # Copyright (c) 2009 The Hewlett-Packard Development Company # 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 co...
bsd-3-clause
htzy/bigfour
lms/djangoapps/courseware/management/commands/export_course.py
62
3095
""" A Django command that exports a course to a tar.gz file. If <filename> is '-', it pipes the file to stdout """ import os import re import shutil import tarfile from tempfile import mktemp, mkdtemp from textwrap import dedent from path import path from django.core.management.base import BaseCommand, CommandErro...
agpl-3.0
stephanekirsch/e-colle
accueil/views.py
1
8473
#-*- coding: utf-8 -*- from django.http import HttpResponseForbidden, Http404, HttpResponse from django.shortcuts import render, redirect, get_object_or_404 from django.contrib.auth import logout from django.contrib.auth.decorators import login_required from accueil.models import Classe, Matiere, Colleur, Message, Dest...
agpl-3.0
erdincay/pyload
module/plugins/hoster/EuroshareEu.py
6
2197
# -*- coding: utf-8 -*- import re from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class EuroshareEu(SimpleHoster): __name__ = "EuroshareEu" __type__ = "hoster" __version__ = "0.30" __status__ = "testing" __pattern__ = r'http://(?:www\.)?euroshare\.(eu|sk|cz|...
gpl-3.0
sysalexis/kbengine
kbe/res/scripts/common/Lib/test/test_importlib/source/test_source_encoding.py
81
5396
from .. import util from . import util as source_util machinery = util.import_importlib('importlib.machinery') import codecs import importlib.util import re import sys import types # Because sys.path gets essentially blanked, need to have unicodedata already # imported for the parser to use. import unicodedata import...
lgpl-3.0
Datera/cinder
cinder/tests/unit/volume/drivers/dell_emc/sc/test_fc.py
3
48496
# Copyright (c) 2014 Dell 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 a...
apache-2.0
nayomal/bloom
bloom/generators/__init__.py
5
2000
# Software License Agreement (BSD License) # # Copyright (c) 2013, Willow Garage, 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...
bsd-3-clause
MikkelSchubert/paleomix
paleomix/nodes/fastqc.py
1
1586
#!/usr/bin/env python3 """ FastQC - A quality control analysis tool for high throughput sequencing data https://github.com/s-andrews/FastQC """ import os import re from paleomix.common.command import AtomicCmd, InputFile, OutputFile from paleomix.common.versions import Requirement from paleomix.node import CommandNod...
mit
lbartoletti/QGIS
python/plugins/processing/algs/grass7/ext/r_statistics.py
36
2298
# -*- coding: utf-8 -*- """ *************************************************************************** r_statistics.py --------------- Date : September 2017 Copyright : (C) 2017 by Médéric Ribreux Email : medspx at medspx dot fr ***************************...
gpl-2.0
kevint2u/audio-collector
server/node_modules/binaryjs/node_modules/binarypack/node_modules/buffercursor/node_modules/verror/node_modules/extsprintf/deps/javascriptlint/javascriptlint/util.py
28
4517
# vim: ts=4 sw=4 expandtab import cgi import os.path import re import unittest _identifier = re.compile('^[A-Za-z_$][A-Za-z0-9_$]*$') _contenttypes = ( 'text/javascript', 'text/ecmascript', 'application/javascript', 'application/ecmascript', 'application/x-javascript', ) class JSVersion: def ...
mit
yfdyh000/kuma
kuma/core/managers.py
2
6153
"""Extras for django-taggit Includes: - Handle tag namespaces (eg. tech:javascript, profile:interest:homebrewing) TODO: - Permissions for tag namespaces (eg. system:* is superuser-only) - Machine tag assists """ from datetime import date, timedelta from django.db import models from django.db.models.fields import BLA...
mpl-2.0
erilyth/sugar
src/jarabe/testrunner.py
13
1674
# Copyright (C) 2013, Daniel Narvaez # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed i...
gpl-2.0
BTCDDev/bitcoin
contrib/devtools/optimize-pngs.py
51
3392
#!/usr/bin/env python # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Run this script every time you change one of the png files. Using pngcrush, it will optimize the png fi...
mit
psychopy/versions
psychopy/experiment/components/envelopegrating/__init__.py
1
15422
#!/usr/bin/env python # -*- coding: utf-8 -*- # Part of the PsychoPy library # Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2020 Open Science Tools Ltd. # Distributed under the terms of the GNU General Public License (GPL). from __future__ import absolute_import, print_function from builtins import super # provi...
gpl-3.0
alown/chromium
crserverlib/server_dispatch_header.py
4
1079
# Copyright (c) 2001, Stanford University # All rights reserved. # # See the file LICENSE.txt for information on redistributing this software. import sys sys.path.append( "../glapi_parser" ) import apiutil apiutil.CopyrightC() print """ /* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED BY server_dispatch_header.p...
bsd-3-clause
UnionEvoRobo/evofab
src/ann_runner.py
1
2802
from printer import Printer from camera import Camera from grid import Grid from vector import Vector from gridworld import GridWorld from ann import Network class AnnRunner(object): """Wraps up the gross reality of running a ``print'' using the printer simulation (controlled by a neural network)""" camera_si...
gpl-2.0
globaltoken/globaltoken
test/functional/mempool_limit.py
1
3174
#!/usr/bin/env python3 # Copyright (c) 2014-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. """Test mempool limiting together/eviction with the wallet.""" from test_framework.test_framework import ...
mit
enthought/traitsgui
examples/file_node_tree.py
1
2630
#------------------------------------------------------------------------------ # Copyright (c) 2005, Enthought, Inc. # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in enthought/LICENSE.txt and may be redistributed only # under the conditions describe...
bsd-3-clause
vinchoi/fishplay
flask/lib/python2.7/site-packages/setuptools/ssl_support.py
100
8119
import os import socket import atexit import re from setuptools.extern.six.moves import urllib, http_client, map import pkg_resources from pkg_resources import ResolutionError, ExtractionError try: import ssl except ImportError: ssl = None __all__ = [ 'VerifyingHTTPSHandler', 'find_ca_bundle', 'is_avail...
gpl-3.0
with-git/tensorflow
tensorflow/contrib/keras/api/keras/activations/__init__.py
11
1882
# 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
pdellaert/ansible
lib/ansible/modules/cloud/hcloud/hcloud_server_type_info.py
21
5682
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2019, Hetzner Cloud GmbH <info@hetzner-cloud.de> # 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 = { "met...
gpl-3.0
thulasi-ram/django-feature-toggle
docs/conf.py
1
5358
# -*- coding: utf-8 -*- # # Feature Toggle documentation build configuration file, created by # sphinx-quickstart on Thu Sep 7 17:35:12 2017. # # 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...
gpl-3.0
marvinpinto/charlesbot-rundeck
charlesbot_rundeck/http.py
1
1032
import asyncio import aiohttp import logging log = logging.getLogger(__name__) @asyncio.coroutine def http_post_request(url, headers): # pragma: no cover response = yield from aiohttp.post(url, headers=headers) if not response.status == 200: text = yield from response.text() log.error("URL: %...
mit
68foxboris/enigma2-openpli-vuplus
lib/python/Screens/Menu.py
6
13944
from Screen import Screen from Screens.MessageBox import MessageBox from Screens.ParentalControlSetup import ProtectedScreen from Components.Sources.List import List from Components.ActionMap import NumberActionMap, ActionMap from Components.Sources.StaticText import StaticText from Components.config import configfile ...
gpl-2.0
elingg/tensorflow
tensorflow/contrib/tensor_forest/client/__init__.py
164
1043
# 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
azunite/chrome_build
tests/gclient_utils_test.py
44
7351
#!/usr/bin/env python # Copyright (c) 2012 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 StringIO import sys sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from testing...
bsd-3-clause
anryko/ansible
lib/ansible/modules/cloud/azure/azure_rm_mariadbfirewallrule.py
40
9856
#!/usr/bin/python # # Copyright (c) 2018 Zim Kalinowski, <zikalino@microsoft.com> # Copyright (c) 2019 Matti Ranta, (@techknowlogick) # # 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 AN...
gpl-3.0
jramos/p2pool
SOAPpy/GSIServer.py
289
5238
from __future__ import nested_scopes """ GSIServer - Contributed by Ivan R. Judson <judson@mcs.anl.gov> ################################################################################ # # SOAPpy - Cayce Ullman (cayce@actzero.com) # Brian Matthews (blm@actzero.com) # Gregory Warnes (G...
gpl-3.0
atmark-techno/atmark-dist
user/python/Lib/knee.py
4
3522
"""An Python re-implementation of hierarchical module import. This code is intended to be read, not executed. However, it does work -- all you need to do to enable it is "import knee". (The name is a pun on the klunkier predecessor of this module, "ni".) """ import sys, imp, __builtin__, string # Replacement for...
gpl-2.0
orangeduck/PyAutoC
Python27/Lib/xml/sax/xmlreader.py
113
12632
"""An XML Reader is the SAX 2 name for an XML parser. XML Parsers should be based on this code. """ import handler from _exceptions import SAXNotSupportedException, SAXNotRecognizedException # ===== XMLREADER ===== class XMLReader: """Interface for reading an XML document using callbacks. XMLReader is the...
bsd-2-clause
dosiecki/NewsBlur
apps/newsletters/views.py
3
111728
from pprint import pprint from django.http import HttpResponse, Http404 from django.conf import settings from utils import log as logging from apps.newsletters.models import EmailNewsletter from apps.rss_feeds.models import Feed, MStory def newsletter_receive(request): # params = { # 'stripped-signature':'...
mit
Sorsly/subtle
google-cloud-sdk/lib/third_party/grpc/framework/interfaces/base/__init__.py
901
1528
# Copyright 2015, 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 of conditions and the f...
mit
google/telluride_decoding
test/scaled_lda_test.py
1
6747
# Copyright 2020 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
mrbandrews/bitcoin
qa/rpc-tests/receivedby.py
8
7385
#!/usr/bin/env python # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Exercise the listreceivedbyaddress API from test_framework import BitcoinTestFramework from bitcoinrpc.authp...
mit
ATIX-AG/ansible
lib/ansible/modules/network/interface/net_interface.py
58
3658
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
palmerjh/iEBE
PlayGround/job-2/iSS/for_paraview/lib152/DataSetAttr.py
9
1758
#!/usr/bin/env python """ Copyright 2001 Pearu Peterson all rights reserved, Pearu Peterson <pearu@ioc.ee> Permission to use, modify, and distribute this software is given under the terms of the LGPL. See http://www.fsf.org NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. $Revision: 1.1 $ $Date:...
gpl-3.0
PierreBizouard/pizco-utils
pizcoutils/helpers/BuildExeStartup.py
1
2974
#------------------------------------------------------------------------------ # BuildExeStartup.py # Initialization script for cx_Freeze which manipulates the path so that the # directory in which the executable is found is searched for extensions but # no other directory is searched. It also sets the attribute...
bsd-3-clause
pajlada/pajbot
pajbot/apiwrappers/base.py
1
3753
import logging from urllib.parse import quote, urlparse, urlunparse import datetime from requests import Session from pajbot import constants from pajbot.apiwrappers.response_cache import APIResponseCache log = logging.getLogger(__name__) class BaseAPI: def __init__(self, base_url, redis=None): self.b...
mit
pcabido/socorro
alembic/versions/235c80dc2e12_fixes_bug_1047079_remove_processors_.py
13
2071
"""Fixes bug 1047079 - remove processors, jobs tables Revision ID: 235c80dc2e12 Revises: 556e11f2d00f Create Date: 2014-12-30 13:29:15.108296 """ # revision identifiers, used by Alembic. revision = '235c80dc2e12' down_revision = '556e11f2d00f' from alembic import op from socorro.lib import citexttype, jsontype, bui...
mpl-2.0
GaetanCambier/CouchPotatoServer
libs/requests/api.py
361
4344
# -*- coding: utf-8 -*- """ requests.api ~~~~~~~~~~~~ This module implements the Requests API. :copyright: (c) 2012 by Kenneth Reitz. :license: Apache2, see LICENSE for more details. """ from . import sessions def request(method, url, **kwargs): """Constructs and sends a :class:`Request <Request>`. Retur...
gpl-3.0
ASCIT/donut
donut/modules/feedback/helpers.py
2
9848
from donut import email_utils from donut.modules.feedback import email_templates import flask import pymysql.cursors from donut.modules.feedback.groups import groupInt, groupName import donut.modules.groups.helpers as groups import donut.modules.newsgroups.helpers as newsgroups def send_update_email(group, email, com...
mit
Microsoft/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/urllib3/packages/ordered_dict.py
2040
8935
# Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy. # Passes Python2.7's test suite and incorporates all the latest updates. # Copyright 2009 Raymond Hettinger, released under the MIT License. # http://code.activestate.com/recipes/576693/ try: from thread import get_ident as _get_iden...
apache-2.0
marc-sensenich/ansible
test/units/plugins/httpapi/test_ftd.py
22
14894
# Copyright (c) 2018 Cisco and/or its affiliates. # # 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 v...
gpl-3.0
mferenca/HMS-ecommerce
ecommerce/extensions/api/v2/tests/views/test_products.py
1
7818
from __future__ import unicode_literals import datetime import json import pytz from django.core.urlresolvers import reverse from django.test import RequestFactory from oscar.core.loading import get_model from ecommerce.coupons.tests.mixins import CouponMixin from ecommerce.courses.models import Course from ecommerc...
agpl-3.0
wenottingham/ansible
lib/ansible/plugins/cache/memory.py
275
1466
# (c) 2014, Brian Coca, Josh Drake, et al # # 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. ...
gpl-3.0
Maximilian-Reuter/SickRage
lib/hachoir_core/i18n.py
86
6241
# -*- coding: UTF-8 -*- """ Functions to manage internationalisation (i18n): - initLocale(): setup locales and install Unicode compatible stdout and stderr ; - getTerminalCharset(): guess terminal charset ; - gettext(text) translate a string to current language. The function always returns Unicode string. You can a...
gpl-3.0
bestvibes/neo4j-social-network
env/lib/python2.7/encodings/cp875.py
593
13110
""" Python Character Mapping Codec cp875 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP875.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...
mit
imsplitbit/nova
nova/exception.py
1
42268
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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 compli...
apache-2.0
qedi-r/home-assistant
homeassistant/components/knx/light.py
3
12148
"""Support for KNX/IP lights.""" from enum import Enum import voluptuous as vol from xknx.devices import Light as XknxLight from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_HS_COLOR, ATTR_WHITE_VALUE, PLATFORM_SCHEMA, SUPPORT_BRIGHTNESS, SUPPORT_COLOR, ...
apache-2.0
swgillespie/coreclr
src/scripts/genXplatEventing.py
8
31274
# ## Licensed to the .NET Foundation under one or more agreements. ## The .NET Foundation licenses this file to you under the MIT license. ## See the LICENSE file in the project root for more information. # # #USAGE: #Add Events: modify <root>src/vm/ClrEtwAll.man #Look at the Code in <root>/src/inc/genXplatLttng.py fo...
mit
firebitsbr/pwn_plug_sources
src/metagoofil/pdfminer/pdffont.py
32
26471
#!/usr/bin/env python2 import sys import struct try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from cmapdb import CMapDB, CMapParser, FileUnicodeMap, CMap from encodingdb import EncodingDB, name2unicode from psparser import PSStackParser from psparser import PSSyntaxError,...
gpl-3.0
liorvh/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/style/checkers/watchlist_unittest.py
124
2754
# Copyright (C) 2010 Apple Inc. All rights reserved. # Copyright (C) 2011 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 ...
bsd-3-clause
ArtemTeleshev/raspberrypi-linux
tools/perf/scripts/python/sctop.py
1996
2102
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
Conjuror/fxos-certsuite
mcts/web-platform-tests/tests/tools/pywebsocket/src/mod_pywebsocket/handshake/hybi.py
139
17070
# Copyright 2012, 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 of conditions and the f...
mpl-2.0
openstack/nova
nova/virt/storage_users.py
9
3738
# Copyright 2012 Michael Still and Canonical 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 appl...
apache-2.0
google-code/android-scripting
python/src/Demo/pysvr/pysvr.py
51
3430
#! /usr/bin/env python """A multi-threaded telnet-like server that gives a Python prompt. This is really a prototype for the same thing in C. Usage: pysvr.py [port] For security reasons, it only accepts requests from the current host. This can still be insecure, but restricts violations from people who can log in o...
apache-2.0
aparrish/cashclones
generate.py
1
10326
import rdflib from rdflib import URIRef from rdflib.namespace import RDFS from jinja2 import Template import random import urllib import json import time import re from altuniverse import alternate_universe def get_random_class(g): return random.choice(list(g.subjects(RDFS.subClassOf, None))) def get_label_str...
mit
PerilousApricot/bigcouch
couchjs/scons/scons-local-2.0.1/SCons/Tool/wix.py
61
3563
"""SCons.Tool.wix Tool-specific initialization for wix, the Windows Installer XML Tool. 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, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, ...
apache-2.0
lizardsystem/lizard-wbconfiguration
lizard_wbconfiguration/migrations/0003_auto__del_field_dbfconfiguration_filepath__add_field_dbfconfiguration_.py
1
35057
# encoding: 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 'DBFConfiguration.filepath' db.delete_column('lizard_wbconfiguration_dbfconfiguration', '...
gpl-3.0
boomsbloom/dtm-fmri
DTM/for_gensim/lib/python2.7/site-packages/boto/gs/cors.py
153
7717
# Copyright 2012 Google Inc. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, dis- # trib...
mit
kapilrastogi/Impala
tests/comparison/discrepancy_searcher.py
2
33095
#!/usr/bin/env impala-python # Copyright (c) 2014 Cloudera, 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 # # Unles...
apache-2.0
arun6582/django
django/db/models/sql/compiler.py
2
56499
import re from itertools import chain from django.core.exceptions import EmptyResultSet, FieldError from django.db.models.constants import LOOKUP_SEP from django.db.models.expressions import OrderBy, Random, RawSQL, Ref from django.db.models.query_utils import QueryWrapper, select_related_descend from django.db.models...
bsd-3-clause
arthurfurlan/django-shortim
src/shortim/migrations/0004_auto__add_field_shorturl_collect_tries.py
1
2388
# encoding: 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): # Adding field 'ShortURL.collect_tries' db.add_column('shortim_shorturl', 'collect_tries', self.gf('django...
gpl-3.0
kbidarkar/robottelo
tests/foreman/rhai/test_rhai.py
2
6626
"""Tests for Red Hat Access Insights :Requirement: Rhai :CaseAutomation: Automated :CaseLevel: Acceptance :CaseComponent: UI :TestType: Functional :CaseImportance: High :Upstream: No """ import time from fauxfactory import gen_string from nailgun import entities from robottelo import manifests from robottelo.ap...
gpl-3.0
mancoast/CPythonPyc_test
cpython/221_test_cl.py
21
3925
#! /usr/bin/env python """Whimpy test script for the cl module Roger E. Masse """ import cl from test_support import verbose clattrs = ['ADDED_ALGORITHM_ERROR', 'ALAW', 'ALGORITHM_ID', 'ALGORITHM_VERSION', 'AUDIO', 'AWARE_ERROR', 'AWARE_MPEG_AUDIO', 'AWARE_MULTIRATE', 'AWCMP_CONST_QUAL', 'AWCMP_FIXED_RATE', 'AWCMP_...
gpl-3.0
mancoast/CPythonPyc_test
cpython/272_test_slice.py
113
4413
# tests for slice objects; in particular the indices method. import unittest from test import test_support from cPickle import loads, dumps import sys class SliceTest(unittest.TestCase): def test_constructor(self): self.assertRaises(TypeError, slice) self.assertRaises(TypeError, slice, 1, 2, 3, ...
gpl-3.0
RCHG/blog_backup
_vendor/bundle/ruby/2.1.0/gems/pygments.rb-0.6.0/vendor/pygments-main/scripts/get_vimkw.py
38
1478
from __future__ import print_function import re r_line = re.compile(r"^(syn keyword vimCommand contained|syn keyword vimOption " r"contained|syn keyword vimAutoEvent contained)\s+(.*)") r_item = re.compile(r"(\w+)(?:\[(\w+)\])?") def getkw(input, output): out = file(output, 'w') output_in...
mit
cernops/nova
nova/db/sqlalchemy/migrate_repo/versions/273_sqlite_foreign_keys.py
79
4690
# Copyright 2014 Rackspace Hosting # # 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
engdan77/edoAutoHomeMobile
twisted/runner/procmontap.py
65
2298
# -*- test-case-name: twisted.runner.test.test_procmontap -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Support for creating a service which runs a process monitor. """ from twisted.python import usage from twisted.runner.procmon import ProcessMonitor class Options(usage.Options): ...
mit
mandeepdhami/neutron
neutron/db/migration/alembic_migrations/firewall_init_ops.py
61
3536
# Copyright 2014 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
0x7678/youtube-dl
youtube_dl/extractor/slideshare.py
16
2025
from __future__ import unicode_literals import re import json from .common import InfoExtractor from ..compat import ( compat_urlparse, ) from ..utils import ( ExtractorError, ) class SlideshareIE(InfoExtractor): _VALID_URL = r'https?://www\.slideshare\.net/[^/]+?/(?P<title>.+?)($|\?)' _TEST = { ...
unlicense
foreni-packages/golismero
misc/old_tests/plugin_tests/ui/test.py
8
4271
#!/usr/bin/env python # -*- coding: utf-8 -*- __license__ = """ GoLismero 2.0 - The web knife - Copyright (C) 2011-2014 Golismero project site: https://github.com/golismero Golismero project mail: contact@golismero-project.com This program is free software; you can redistribute it and/or modify it under the terms of...
gpl-2.0
micropython/micropython
examples/asmled.py
15
1679
# flash LED #1 using inline assembler # this version is overly verbose and uses word stores @micropython.asm_thumb def flash_led(r0): movw(r1, (stm.GPIOA + stm.GPIO_BSRRL) & 0xFFFF) movt(r1, ((stm.GPIOA + stm.GPIO_BSRRL) >> 16) & 0x7FFF) movw(r2, 1 << 13) movt(r2, 0) movw(r3, 0) movt(r3, 1 << 13...
mit
saadqc/Sub-Merge
VideoPlayer.py
1
7603
#! /usr/bin/python # # Qt example for VLC Python bindings # Copyright (C) 2009-2010 the VideoLAN team # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at...
gpl-3.0
bluedynamics/node.ext.python
src/node/ext/python/parser.py
1
23088
import os import _ast import ast import types import copy import exceptions from odict import odict from zope.component import provideHandler from node.ext.directory.interfaces import IFileAddedEvent from utils import get_dotted_name_from_astnode from node.ext.python.interfaces import ( CODESECTION_STARTTOKEN, ...
bsd-3-clause
kouaw/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/ndr.py
9
3029
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, int_or_none, qualities, ) class NDRIE(InfoExtractor): IE_NAME = 'ndr' IE_DESC = 'NDR.de - Mediathek' _VALID_URL = r'https?://www\.ndr\.de/.+?(?P<id>\d+)...
gpl-3.0
solashirai/edx-platform
common/djangoapps/student/tests/test_roles.py
147
7798
""" Tests of student.roles """ import ddt from django.test import TestCase from courseware.tests.factories import UserFactory, StaffFactory, InstructorFactory from student.tests.factories import AnonymousUserFactory from student.roles import ( GlobalStaff, CourseRole, CourseStaffRole, CourseInstructorRole, Or...
agpl-3.0
tadeo/xhtml2pdf
xhtml2pdf/w3c/cssParser.py
53
39118
#!/usr/bin/env python ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ##~ Copyright (C) 2002-2004 TechGame Networks, LLC. ##~ ##~ This library is free software; you can redistribute it and/or ##~ modify it under the terms of the BSD style License as found in the ##~ LICENSE file included with this distribution....
apache-2.0
bilderbuchi/GCode_Z_Splice
splicer_GUI.py
1
3376
import splicer_GUI_FB from templatesGCodePanel import GCodePanel from templatesTransitionPanel import TransitionPanel import wx import wx.xrc import logging import splicer logger = logging.getLogger(__name__) # Logic implementation file for the GUI class MyFrame( splicer_GUI_FB.mainFrameGUI ): def __init__( self, p...
agpl-3.0