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
ChangYeoun/10.1
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # import os import sys import getopt import sh...
gpl-2.0
yamila-moreno/django
tests/m2m_intermediary/models.py
128
1260
""" Many-to-many relationships via an intermediary table For many-to-many relationships that need extra fields on the intermediary table, use an intermediary model. In this example, an ``Article`` can have multiple ``Reporter`` objects, and each ``Article``-``Reporter`` combination (a ``Writer``) has a ``position`` f...
bsd-3-clause
OpenPymeMx/account-financial-reporting
__unported__/account_move_line_report_xls/__openerp__.py
8
2575
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under...
agpl-3.0
TEDICpy/write-it
nuntium/tests/writeitinstance_newform_tests.py
2
6104
# coding=utf-8 from global_test_case import GlobalTestCase as TestCase, popit_load_data from ..user_section.forms import WriteItInstanceCreateFormPopitUrl, SimpleInstanceCreateFormPopitUrl from django.contrib.auth.models import User from django.conf import settings from mock import patch class InstanceCreateFormTestC...
gpl-3.0
sushramesh/lwc
lib/python2.7/site-packages/wheel/signatures/keys.py
471
3320
"""Store and retrieve wheel signing / verifying keys. Given a scope (a package name, + meaning "all packages", or - meaning "no packages"), return a list of verifying keys that are trusted for that scope. Given a package name, return a list of (scope, key) suggested keys to sign that package (only the verifying key...
mit
sanketh95/BenDcode
bendcode/tests.py
1
4147
import unittest from .bendcode import match_string, match_int, match_dict, match_list, decode, encode from .exceptions import MalformedBencodeError class TestDecoder(unittest.TestCase): # Test normal int def test_int(self): self.assertEqual(match_int('i200e')[0], 200) # Test empty integer # It is the same as ze...
gpl-2.0
MrSurly/micropython-esp32
tests/basics/async_for2.py
49
1024
# test waiting within "async for" aiter/anext functions import sys if sys.implementation.name == 'micropython': # uPy allows normal generators to be awaitables coroutine = lambda f: f else: import types coroutine = types.coroutine @coroutine def f(x): print('f start:', x) yield x + 1 yield...
mit
Rajeshkumar90/ansible-modules-extras
files/archive.py
27
14920
#!/usr/bin/python # -*- coding: utf-8 -*- # import module snippets from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.pycompat24 import get_exception """ (c) 2016, Ben Doherty <bendohmv@gmail.com> Sponsored by Oomph, Inc. http://www.oomphinc.com This file is part of Ansible Ansible is fr...
gpl-3.0
h3biomed/ansible-modules-core
utilities/logic/fail.py
38
1597
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2012 Dag Wieers <dag@wieers.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lice...
gpl-3.0
gptech/ansible
lib/ansible/modules/packaging/language/composer.py
28
8300
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Dimitrios Tydeas Mengidis <tydeas.dr@gmail.com> # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version...
gpl-3.0
vlinhd11/vlinhd11-android-scripting
python-build/python-libs/gdata/src/gdata/Crypto/Util/test.py
228
18297
# # test.py : Functions used for testing the modules # # Part of the Python Cryptography Toolkit # # Distribute and use freely; there are no restrictions on further # dissemination and usage except those imposed by the laws of your # country of residence. This software is provided "as is" without # warranty of fitn...
apache-2.0
Silmathoron/nest-simulator
pynest/examples/Potjans_2014/network_params.py
19
6136
# -*- coding: utf-8 -*- # # network_params.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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,...
gpl-2.0
uniphil/heroku-buildpack-pythonsass
vendor/pip-1.5.2/pip/commands/search.py
344
4736
import sys import textwrap import pip.download from pip.basecommand import Command, SUCCESS from pip.util import get_terminal_size from pip.log import logger from pip.backwardcompat import xmlrpclib, reduce, cmp from pip.exceptions import CommandError from pip.status_codes import NO_MATCHES_FOUND from pip._vendor imp...
mit
ahmadiga/min_edx
lms/djangoapps/instructor/paidcourse_enrollment_report.py
11
8911
""" Defines concrete class for cybersource Enrollment Report. """ from courseware.access import has_access import collections from django.conf import settings from django.utils.translation import ugettext as _ from courseware.courses import get_course_by_id from instructor.enrollment_report import BaseAbstractEnrollm...
agpl-3.0
DenisCarriere/geocoder
geocoder/arcgis.py
1
3118
#!/usr/bin/python # coding: utf8 from __future__ import absolute_import import logging import json from geocoder.base import OneResult, MultipleResultsQuery class ArcgisResult(OneResult): def __init__(self, json_content): # create safe shortcuts self._feature = json_content.get('feature', {}) ...
mit
Ayub-Khan/edx-platform
common/djangoapps/xblock_django/migrations/0001_initial.py
62
1207
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operati...
agpl-3.0
kennedyshead/home-assistant
tests/components/eafm/test_sensor.py
2
14989
"""Tests for polling measures.""" import datetime import aiohttp import pytest from homeassistant import config_entries from homeassistant.const import ATTR_UNIT_OF_MEASUREMENT, STATE_UNAVAILABLE from homeassistant.setup import async_setup_component import homeassistant.util.dt as dt_util from tests.common import Mo...
apache-2.0
agconti/njode
env/lib/python2.7/site-packages/requests/packages/chardet/jisfreq.py
3131
47315
######################## 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...
bsd-3-clause
patrickcurl/ztruck
dj/lib/python2.7/site-packages/django/core/serializers/__init__.py
121
8167
""" Interfaces for serializing Django objects. Usage:: from django.core import serializers json = serializers.serialize("json", some_queryset) objects = list(serializers.deserialize("json", json)) To add your own serializers, use the SERIALIZATION_MODULES setting:: SERIALIZATION_MODULES = { ...
apache-2.0
Srisai85/numpy
numpy/core/machar.py
141
10790
""" Machine arithmetics - determine the parameters of the floating-point arithmetic system Author: Pearu Peterson, September 2003 """ from __future__ import division, absolute_import, print_function __all__ = ['MachAr'] from numpy.core.fromnumeric import any from numpy.core.numeric import errstate # Need to speed ...
bsd-3-clause
dynius/gamecoin
share/qt/extract_strings_qt.py
2945
1844
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt4 stringdefs so that they can be picked up by Qt linguist. ''' from subprocess import Popen, PIPE import glob import operator OUT_CPP="src/qt/bitcoinstrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' format produced by x...
mit
fernandezcuesta/ansible
lib/ansible/modules/cloud/amazon/sts_session_token.py
71
5483
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
gpl-3.0
dymkowsk/mantid
Framework/PythonInterface/test/python/mantid/kernel/ArrayPropertyTest.py
3
6949
"""Test the exposed ArrayProperty """ from __future__ import (absolute_import, division, print_function) import unittest from mantid.kernel import (FloatArrayProperty, StringArrayProperty, IntArrayProperty, Direction, NullValidator) from mantid.api import PythonAlgorithm import numpy as np i...
gpl-3.0
jcmarks/jcmarks-mobile
lib/httplib2/iri2uri.py
706
3828
""" iri2uri Converts an IRI to a URI. """ __author__ = "Joe Gregorio (joe@bitworking.org)" __copyright__ = "Copyright 2006, Joe Gregorio" __contributors__ = [] __version__ = "1.0.0" __license__ = "MIT" __history__ = """ """ import urlparse # Convert an IRI to a URI following the rules in RFC 3987 # # The character...
apache-2.0
maartenq/ansible
lib/ansible/modules/cloud/ovirt/ovirt_network_facts.py
55
3447
#!/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
VIVEKLUCKY1848/gedit-plugins-1
plugins/commander/modules/format.py
4
4224
# -*- coding: utf-8 -*- # # format.py - format commander module # # Copyright (C) 2010 - Jesse van den Kieboom # # 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 Lice...
gpl-2.0
qnub/django-cms
cms/test_utils/project/mti_pluginapp/migrations/0001_initial.py
57
1277
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('cms', '0003_auto_20140926_2347'), ] operations = [ migrations.CreateModel( name='TestPluginAlphaModel', ...
bsd-3-clause
raziel057/FrameworkBenchmarks
frameworks/Python/api_hour/yocto_http/hello/utils/yocto_http/application.py
77
2896
import asyncio import logging from collections import OrderedDict from .request import Request from .utils import generate_http_response log = logging.getLogger(__name__) class Application(dict): def __init__(self, default_encoding='utf-8', decode_headers=False, loop=None): super(Application, self).__in...
bsd-3-clause
alistairlow/tensorflow
tensorflow/python/eager/benchmarks_test.py
13
12324
# 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
40223202/test2-1
static/Brython3.1.1-20150328-091302/Lib/collections/abc.py
739
16026
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Abstract Base Classes (ABCs) for collections, according to PEP 3119. Unit tests are in test_collections. """ from abc import ABCMeta, abstractmethod import sys __all__ = ["Hashable", "Iterable", "Iterator", ...
gpl-3.0
IT-Department-Projects/OOAD-Project
Flask_App/oakcrest/lib/python2.7/site-packages/jinja2/parser.py
130
35465
# -*- coding: utf-8 -*- """ jinja2.parser ~~~~~~~~~~~~~ Implements the template parser. :copyright: (c) 2017 by the Jinja Team. :license: BSD, see LICENSE for more details. """ from jinja2 import nodes from jinja2.exceptions import TemplateSyntaxError, TemplateAssertionError from jinja2.lexer impo...
mit
tpeek/bike_safety
imagersite/imager_images/forms.py
1
1080
from .models import * from django.forms import ModelForm from django.contrib.gis import forms as geoforms # import floppyforms as geoforms class AlbumForm(ModelForm): class Meta: model = Album fields = ['title', 'description', 'privacy', 'cover', 'photos'] class PhotoForm(ModelForm): class Me...
mit
vilorious/pyload
module/plugins/internal/UnRar.py
6
7118
# -*- coding: utf-8 -*- import os import re import subprocess from glob import glob from string import digits from module.plugins.internal.Extractor import Extractor, ArchiveError, CRCError, PasswordError from module.utils import fs_decode, fs_encode, save_join as fs_join def renice(pid, value): if value and o...
gpl-3.0
ddurst/tagz
tagz.py
2
9935
#!/usr/bin/env python """ This is a script to automatically tag repos on GitHub. Sample usage: * To create a tag: $ python tagz.py -r mozilla/fireplace -c create -t 2014.02.11 NOTE: annotated tags are used by default (-a). If you want lightweight tags, you can pass -l: $ python tagz.py -l -r mozilla/...
mit
gem/oq-engine
openquake/hazardlib/scalerel/germany2018.py
1
1423
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2012-2021 GEM Foundation # # OpenQuake is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the Licen...
agpl-3.0
seanwestfall/django
django/contrib/auth/backends.py
468
6114
from __future__ import unicode_literals from django.contrib.auth import get_user_model from django.contrib.auth.models import Permission class ModelBackend(object): """ Authenticates against settings.AUTH_USER_MODEL. """ def authenticate(self, username=None, password=None, **kwargs): UserMod...
bsd-3-clause
Officium/SomeTest
pystdlib/logger.py
2
1622
import logging import logging.handlers import os class Singleton(type): _instances = dict() def __call__(cls, *args, **kwargs): if cls not in cls._instances: cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs) return cls._instances[cls] class _Logger(object): ...
apache-2.0
ininex/geofire-python
resource/lib/python2.7/site-packages/werkzeug/wsgi.py
97
39573
# -*- coding: utf-8 -*- """ werkzeug.wsgi ~~~~~~~~~~~~~ This module implements WSGI related helpers. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import re import os import posixpath import mimetypes from itertools import...
mit
maciekcc/tensorflow
tensorflow/contrib/learn/python/learn/estimators/linear.py
33
38403
# 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
w1ll1am23/home-assistant
homeassistant/components/transport_nsw/sensor.py
5
4460
"""Support for Transport NSW (AU) to query next leave event.""" from datetime import timedelta from TransportNSW import TransportNSW import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity from homeassistant.const import ( ATTR_ATTRIBUTION, ATTR_MODE, CONF_API_KE...
apache-2.0
kogotko/carburetor
openstack_dashboard/dashboards/admin/instances/panel.py
1
1078
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
apache-2.0
coxmediagroup/googleads-python-lib
examples/dfa/authentication/create_dfa_client_without_yaml.py
4
2199
#!/usr/bin/python # # Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
apache-2.0
alexoneill/py3status
py3status/modules/i3block.py
2
12882
# -*- coding: utf-8 -*- """ Support i3blocks blocklets in py3status. [i3blocks](https://github.com/vivien/i3blocks) is a project to allow simple scripts to provide output to the i3bar. This module allows these blocklets to run under py3status. The configuration of the blocklets is similar to how they are configured ...
bsd-3-clause
amikey/chromium
tools/check_style.py
15
4211
# Copyright (c) 2012 The Chromium Embedded Framework Authors. # Portions copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os, re, string, sys from file_util import * import git_util as git import s...
bsd-3-clause
manasi24/tempest
tempest/api/identity/admin/v3/test_services.py
8
3990
# Copyright 2013 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
jschueller/numpy
numpy/doc/constants.py
172
8954
""" ========= Constants ========= Numpy includes several constants: %(constant_list)s """ # # Note: the docstring is autogenerated. # from __future__ import division, absolute_import, print_function import textwrap, re # Maintain same format as in numpy.add_newdocs constants = [] def add_newdoc(module, name, doc): ...
bsd-3-clause
mikel-egana-aranguren/SADI-Galaxy-Docker
galaxy-dist/tools/next_gen_conversion/fastq_gen_conv.py
2
7331
""" Converts any type of FASTQ file to Sanger type and makes small adjustments if necessary. usage: %prog [options] -i, --input=i: Input FASTQ candidate file -r, --origType=r: Original type -a, --allOrNot=a: Whether or not to check all blocks -b, --blocks=b: Number of blocks to check -o, --output=o: Ou...
gpl-3.0
jackey-qiu/genx_pc_qiu
geometry_modules/temp_test.py
1
2637
import numpy as np #f2 calculate the distance b/ p1 and p2 f2=lambda p1,p2:np.sqrt(np.sum((p1-p2)**2)) #anonymous function f3 is to calculate the coordinates of basis with magnitude of 1.,p1 and p2 are coordinates for two known points, the #direction of the basis is pointing from p1 to p2 f3=lambda p1,p2:(1./f2...
gpl-3.0
chouseknecht/ansible
test/units/modules/network/netvisor/test_pn_admin_service.py
23
2394
# Copyright: (c) 2018, Pluribus Networks # 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 from units.compat.mock import patch from ansible.modules.network.netvisor import pn_admin_servic...
gpl-3.0
dstiert/Wox
PythonHome/Lib/site-packages/pip/_vendor/html5lib/ihatexml.py
1727
16581
from __future__ import absolute_import, division, unicode_literals import re import warnings from .constants import DataLossWarning baseChar = """ [#x0041-#x005A] | [#x0061-#x007A] | [#x00C0-#x00D6] | [#x00D8-#x00F6] | [#x00F8-#x00FF] | [#x0100-#x0131] | [#x0134-#x013E] | [#x0141-#x0148] | [#x014A-#x017E] | [#x0180-...
mit
Stiivi/bubbles
tests/test_core.py
4
11050
import unittest from bubbles import * # import bubbles.iterator # FIXME: clean this up import inspect def default(ctx, left): pass def unary(ctx, left): pass def binary(ctx, left, right): pass class DummyDataObject(DataObject): def __init__(self, reps=None, data=None): """Creates a dummy da...
mit
mpasternak/pesel2pbn
src/pesel2pbn/main.py
1
9347
# -*- encoding: utf-8 -*- import json from hashlib import sha1 from datetime import datetime from PyQt5.QtCore import QSettings from PyQt5.QtCore import QUrl, Qt, QLocale, QLibraryInfo, QTranslator from PyQt5.QtGui import QClipboard from PyQt5.QtNetwork import QNetworkAccessManager, QNetworkRequest, QNetworkReply from...
mit
HydrelioxGitHub/home-assistant
tests/components/switch/test_litejet.py
9
4993
"""The tests for the litejet component.""" import logging import unittest from unittest import mock from homeassistant import setup from homeassistant.components import litejet import homeassistant.components.switch as switch from tests.common import get_test_home_assistant from tests.components.switch import common ...
apache-2.0
peterholc/avro
lang/c/jansson/doc/ext/refcounting.py
4
1706
""" refcounting ~~~~~~~~~~~ Reference count annotations for C API functions. Has the same result as the sphinx.ext.refcounting extension but works for all functions regardless of the signature, and the reference counting information is written inline with the documentation instead of a sepa...
apache-2.0
wooga/airflow
tests/providers/google/cloud/hooks/test_cloud_storage_transfer_service.py
1
38544
# # 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...
apache-2.0
sjlehtin/django
django/core/validators.py
3
18352
import ipaddress import os import re from contextlib import suppress from urllib.parse import urlsplit, urlunsplit from django.core.exceptions import ValidationError from django.utils.deconstruct import deconstructible from django.utils.functional import SimpleLazyObject from django.utils.ipv6 import is_valid_ipv6_add...
bsd-3-clause
gstarnberger/paasta
paasta_tools/cli/cmds/local_run.py
1
28328
#!/usr/bin/env python # Copyright 2015-2016 Yelp 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 ...
apache-2.0
NikNitro/Python-iBeacon-Scan
sympy/polys/agca/homomorphisms.py
12
21708
""" Computations with homomorphisms of modules and rings. This module implements classes for representing homomorphisms of rings and their modules. Instead of instantiating the classes directly, you should use the function ``homomorphism(from, to, matrix)`` to create homomorphism objects. """ from __future__ import p...
gpl-3.0
sciCloud/OLiMS
lims/browser/worksheetfolder.py
2
23104
from dependencies.dependency import DateTime from dependencies.dependency import REFERENCE_CATALOG from dependencies.dependency import DisplayList from dependencies.dependency import getToolByName from dependencies.dependency import _createObjectByType from lims.browser import BrowserView from dependencies.dependency i...
agpl-3.0
janebeckman/gpdb
src/test/tinc/ext/suds/sax/text.py
202
3567
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will ...
apache-2.0
PokeHunterProject/pogom-updated
pogom/pgoapi/protos/POGOProtos/Networking/Requests/Messages/GetPlayerMessage_pb2.py
1
4742
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: POGOProtos/Networking/Requests/Messages/GetPlayerMessage.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message...
mit
trupa/p2pool-Extended
wstools/c14n.py
290
16401
#! /usr/bin/env python '''XML Canonicalization Patches Applied to xml.dom.ext.c14n: http://sourceforge.net/projects/pyxml/ [ 1444526 ] c14n.py: http://www.w3.org/TR/xml-exc-c14n/ fix -- includes [ 829905 ] c14n.py fix for bug #825115, Date Submitted: 2003-10-24 23:43 -- include dep...
gpl-3.0
rodrigocaldas/trabalho_programacao_web
modules/requests/adapters.py
205
16799
# -*- coding: utf-8 -*- """ requests.adapters ~~~~~~~~~~~~~~~~~ This module contains the transport adapters that Requests uses to define and maintain connections. """ import socket from .models import Response from .packages.urllib3 import Retry from .packages.urllib3.poolmanager import PoolManager, proxy_from_url ...
mit
getlantern/lantern-java
install/linux_x86_64/pt/fteproxy/Crypto/Protocol/__init__.py
125
1573
# -*- coding: utf-8 -*- # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone is granted a worldwide, perpetual, royalty-free, # non-exclusive license to e...
apache-2.0
adamchainz/ansible
lib/ansible/plugins/action/normal.py
62
2115
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any lat...
gpl-3.0
kindly/ocds-merge
ocdsmerge/merge.py
1
5890
import collections NOT_FLATTEN_KEYS = ['additionalIdentifiers', 'additionalClassifications', 'suppliers', 'changes', 'tenderers' ] class IdValue(str): '''This is basically a string but is used to differentiate itse...
bsd-3-clause
egor-tensin/sorting_algorithms
algorithms/impl/quicksort.py
2
2494
# Copyright (c) 2015 Egor Tensin <Egor.Tensin@gmail.com> # This file is part of the "Sorting algorithms" project. # For details, see https://github.com/egor-tensin/sorting-algorithms. # Distributed under the MIT License. from random import randrange, seed import sys from ..algorithm import SortingAlgorithm seed() ...
mit
titasakgm/brc-stock
openerp/addons/membership/report/report_membership.py
52
6137
# -*- 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
kawasaki2013/python-for-android-x86
python-modules/twisted/twisted/names/test/test_names.py
49
31329
# -*- test-case-name: twisted.names.test.test_names -*- # Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Test cases for twisted.names. """ import socket, operator, copy from twisted.trial import unittest from twisted.internet import reactor, defer, error from twisted.internet.de...
apache-2.0
nanjj/softlayer-python
tests/managers/file_tests.py
1
30252
""" SoftLayer.tests.managers.file_tests ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :license: MIT, see LICENSE for more details. """ import copy import SoftLayer from SoftLayer import exceptions from SoftLayer import fixtures from SoftLayer import testing class FileTests(testing.TestCase): def set_up(self): ...
mit
objmagic/heron
heron/tools/tracker/src/python/handlers/metricsqueryhandler.py
10
3381
# Copyright 2016 Twitter. 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 agree...
apache-2.0
gojira/tensorflow
tensorflow/contrib/distribute/python/combinations.py
8
14139
# 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
JianfengXu/crosswalk-test-suite
webapi/tct-csp-w3c-tests/csp-py/csp_sandbox_empty_int-manual.py
30
2669
def main(request, response): import simplejson as json f = file('config.json') source = f.read() s = json.JSONDecoder().decode(source) url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1]) url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0]) _CSP = "sandbox " respons...
bsd-3-clause
anyaevostinar/ProbDecomp
support/utils/AvidaUtils/PythonTool.py
2
4565
############################################################################## ## Copyright (C) 1999-2005 Michigan State University ## ## Based on work Copyright (C) 1993-2003 California Institute of Technology ## ## ## ## R...
gpl-3.0
Grirrane/odoo
addons/l10n_be_invoice_bba/__openerp__.py
8
2554
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it u...
agpl-3.0
michaelcmartin/bumbershoot
zxspectrum/spectralink.py
1
2097
#!/usr/bin/python import sys def encode(n): return bytearray([n & 0xff, (n >> 8) & 0xff]) def encode_basic_number(n): return str(n).encode("iso8859-1") + b"\x0e\x00\x00" + encode(n) + b"\x00" def create_basic_line(line, text): ls = encode(line) return bytearray([ls[1], ls[0]])+encode(len(text)+1)+tex...
mit
tuxfux-hlp-notes/python-batches
archieves/batch-64/15-files/myenv/lib/python2.7/site-packages/pip/commands/download.py
340
7810
from __future__ import absolute_import import logging import os from pip.exceptions import CommandError from pip.index import FormatControl from pip.req import RequirementSet from pip.basecommand import RequirementCommand from pip import cmdoptions from pip.utils import ensure_dir, normalize_path from pip.utils.build...
gpl-3.0
TimYi/django
tests/template_tests/filter_tests/test_length.py
521
1900
from django.template.defaultfilters import length from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class LengthTests(SimpleTestCase): @setup({'length01': '{{ list|length }}'}) def test_length01(self): output = self.engine.render_to_string...
bsd-3-clause
ashemedai/ansible
lib/ansible/modules/network/iosxr/iosxr_system.py
50
8452
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
wimleers/DistributedManyInARow
src/DistributedGame/VectorClock_test.py
1
7318
from VectorClock import * import unittest class TestVectorClock(unittest.TestCase): def testBasicUsage(self): """Test basic usage of VectorClock.""" v = VectorClock() v.add('foo') self.assertEqual(v.dict(), {'foo' : 0}) v.increment('foo') v.increment('foo') ...
unlicense
sudosurootdev/external_chromium_org
build/android/pylib/device_settings.py
28
5934
# 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 logging from pylib import content_settings _LOCK_SCREEN_SETTINGS_PATH = '/data/system/locksettings.db' PASSWORD_QUALITY_UNSPECIFIED = '0' def Conf...
bsd-3-clause
soarpenguin/ansible
lib/ansible/modules/cloud/amazon/ec2_lc_find.py
3
7265
#!/usr/bin/python # encoding: utf-8 # (c) 2015, Jose Armesto <jose@armesto.net> # # This file is part of Ansible # # This module 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...
gpl-3.0
hp-networking/baremetal-network-provisioning
doc/source/conf.py
4
2592
<<<<<<< HEAD # Copyright (c) 2015 OpenStack Foundation # ======= # -*- coding: utf-8 -*- >>>>>>> 7bea44e26ee8a400564a6a746d26293bb4bbf9cd # 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
Steffeng5/ansible-modules-extras
packaging/os/pkgin.py
69
6737
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2013 Shaun Zinck <shaun.zinck at gmail.com> # Copyright (c) 2015 Lawrence Leonard Gilbert <larry@L2G.to> # # Written by Shaun Zinck # Based on pacman module written by Afterburn <http://github.com/afterburn> # that was based on apt module written by Matthew Wi...
gpl-3.0
albertomurillo/ansible
test/units/modules/network/fortimanager/test_fmgr_secprof_appctrl.py
38
3118
# Copyright 2018 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 License, or # (at your option) any later version. # # This program is distributed in the...
gpl-3.0
resmo/ansible
lib/ansible/modules/cloud/google/gcp_compute_target_pool.py
5
18078
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
muffl0n/ansible-modules-core
files/synchronize.py
39
13863
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012-2013, Timothy Appnel <tim@appnel.com> # # 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) an...
gpl-3.0
pdellaert/ansible
lib/ansible/modules/network/fortimanager/fmgr_secprof_profile_group.py
39
8605
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
Danielhiversen/home-assistant
homeassistant/components/binary_sensor/hikvision.py
4
8577
""" Support for Hikvision event stream events represented as binary sensors. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/binary_sensor.hikvision/ """ import logging from datetime import timedelta import voluptuous as vol from homeassistant.helpers.ev...
mit
walterbender/colordeducto
utils.py
4
1629
#Copyright (c) 2011 Walter Bender # 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. # # You should have received a copy o...
gpl-3.0
tcalmant/ipopo
samples/run_eventhook.py
1
2051
#!/usr/bin/env python # -- Content-Encoding: UTF-8 -- """ Runs the framework corresponding to the event listener hook provider. Use the ``gen_event`` shell command to generate a new service event. Use ``gen_filtered_event`` to generate an event that will be handled differently by the hook: after the 3rd occurrence of...
apache-2.0
gaotongfei/shadowsocks
shadowsocks/crypto/table.py
1044
8108
# !/usr/bin/env python # # Copyright 2015 clowwindy # # 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
thaim/ansible
lib/ansible/modules/cloud/amazon/rds.py
5
56646
#!/usr/bin/python # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['stableinterf...
mit
XiaodunServerGroup/ddyedx
lms/djangoapps/analytics/tests/test_distributions.py
33
3739
""" Tests for analytics.distributions """ from django.test import TestCase from nose.tools import raises from student.models import CourseEnrollment from student.tests.factories import UserFactory from analytics.distributions import profile_distribution, AVAILABLE_PROFILE_FEATURES class TestAnalyticsDistributions(T...
agpl-3.0
kirca/OpenUpgrade
addons/website_report/controllers/main.py
9
1397
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
saratang/servo
components/script/dom/bindings/codegen/parser/tests/test_interface_identifier_conflicts_across_members.py
276
1371
def WebIDLTest(parser, harness): threw = False try: parser.parse(""" interface IdentifierConflictAcrossMembers1 { const byte thing1 = 1; readonly attribute long thing1; }; """) results = parser.finish() except: threw = True...
mpl-2.0
esikachev/sahara-backup
sahara/utils/hacking/import_checks.py
12
23055
# 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 u...
apache-2.0
michelts/lettuce
tests/integration/lib/Django-1.2.5/django/conf/locale/ru/formats.py
80
1052
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # DATE_FORMAT = 'j F Y г.' TIME_FORMAT = 'G:i:s' DATETIME_FORMAT = 'j F Y г. G:i:s' YEAR_MONTH_FORMAT = 'F Y г.' MONTH_DAY_FORMAT = 'j F' SHORT_DATE_FORMAT = 'd.m.Y' SHORT_DATETIME_FORMAT = 'd.m.Y H:i' FIRST_DAY_O...
gpl-3.0
bruunio/private
node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py
542
45270
# 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. # Notes: # # This generates makefiles suitable for inclusion into the Android build system # via an Android.mk file. It is based on make.py, the standard makefile ...
mit
Distrotech/mozjs
js/src/python/mozbuild/mozbuild/compilation/warnings.py
7
11569
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # This modules provides functionality for dealing with compiler warnings. from __future__ import unicode_literals impo...
mpl-2.0