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
ivar1234/babu.repo
lib/ansible/plugins/action/include_vars.py
49
2027
# (c) 2013-2014, Benno Joy <benno@ansible.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 later vers...
gpl-3.0
Linutronix/linux
tools/testing/kunit/kunit_parser.py
239
10790
# SPDX-License-Identifier: GPL-2.0 # # Parses test results from a kernel dmesg log. # # Copyright (C) 2019, Google LLC. # Author: Felix Guo <felixguoxiuping@gmail.com> # Author: Brendan Higgins <brendanhiggins@google.com> import re from collections import namedtuple from datetime import datetime from enum import Enum...
gpl-2.0
mogoweb/chromium-crosswalk
tools/valgrind/valgrind_test.py
1
46063
# 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. """Runs an exe through Valgrind and puts the intermediate files in a directory. """ import datetime import glob import logging import optparse import os...
bsd-3-clause
bancek/egradebook
src/lib/django/forms/models.py
152
42947
""" Helper functions for creating Form classes from Django models and database field objects. """ from django.utils.encoding import smart_unicode, force_unicode from django.utils.datastructures import SortedDict from django.utils.text import get_text_list, capfirst from django.utils.translation import ugettext_lazy as...
gpl-3.0
ActiveState/code
recipes/Python/456361_Paypal_IPN/recipe-456361.py
1
3423
#!/usr/bin/python24 import cgi import time import MySQLdb from traceback import format_exception from sys import exc_info from string import split from string import strip from sys import exit from urllib import urlencode import urllib2 DATADIR = "/home/user/data/" PP_URL = "https://www.sandbox.paypal.com/cgi-bin/we...
mit
timmytim/cm_kernel_jflteatt
tools/perf/scripts/python/sctop.py
11180
1924
# 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
kmatzen/ansible
test/units/parsing/test_data_loader.py
58
3231
# (c) 2012-2014, 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) an...
gpl-3.0
rotula/pdfminer
pdfminer/glyphlist.py
2
121489
""" Mappings from Adobe glyph names to Unicode characters. In some CMap tables, Adobe glyph names are used for specifying Unicode characters instead of using decimal/hex character code. The following data was taken by $ wget https://partners.adobe.com/public/developer/en/opentype/glyphlist.txt $ python tools/c...
mit
xguse/blacktie
src/blacktie/scripts/blacktie_pipeline.py
1
9732
#***************************************************************************** # blacktie_pipeline.py (part of the blacktie package) # # (c) 2013 - Augustine Dunn # James Laboratory # Department of Biochemistry and Molecular Biology # University of California Irvine # wadunn83@gmail.com # # Licenced under the GN...
gpl-3.0
shawnsi/limbo
test/test_plugins/test_gif.py
11
2185
# -*- coding: UTF-8 -*- import os import sys from nose.tools import eq_ import vcr DIR = os.path.dirname(os.path.realpath(__file__)) sys.path.insert(0, os.path.join(DIR, '../../limbo/plugins')) from gif import on_message # The set of valid gifs given the bananas fixture bananas_gifs = [u'http://fc05.deviantart.net/...
mit
jwhui/openthread
tests/scripts/thread-cert/Cert_9_2_15_PendingPartition.py
3
8095
#!/usr/bin/env python3 # # Copyright (c) 2016, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # ...
bsd-3-clause
PriceChild/ansible
lib/ansible/modules/cloud/univention/udm_user.py
69
21748
#!/usr/bin/python # -*- coding: UTF-8 -*- # Copyright (c) 2016, Adfinis SyGroup AG # Tobias Rueetschi <tobias.ruetschi@adfinis-sygroup.ch> # # 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 Fr...
gpl-3.0
davicustodio/geonode
geonode/services/management/commands/importservice.py
35
4156
from django.core.management.base import BaseCommand from optparse import make_option from geonode.services.models import Service from geonode.services.views import _register_cascaded_service, _register_indexed_service, \ _register_harvested_service, _register_cascaded_layers, _register_indexed_layers import json fr...
gpl-3.0
modulexcite/catapult
third_party/mapreduce/mapreduce/kv_pb.py
35
10910
#!/usr/bin/env python # Generated by the protocol buffer compiler. DO NOT EDIT! # source: third_party/py/appengine_mapreduce/src/kv.proto from google.net.proto import ProtocolBuffer import array import base64 import thread try: from google.net.proto import _net_proto___parse__python except ImportError: _net_proto...
bsd-3-clause
Stavitsky/nova
nova/objects/dns_domain.py
17
2588
# Copyright (C) 2014, Red Hat, 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...
apache-2.0
m4h7/juriscraper
juriscraper/opinions/united_states/federal_appellate/ca7.py
2
4151
# Scraper for the United States Court of Appeals for the Seventh Circuit # CourtID: ca7 # Court Short Name: 7th Cir. import time from datetime import date, timedelta import urllib from dateutil.rrule import rrule, DAILY from lxml import html from juriscraper.OpinionSite import OpinionSite class Site(OpinionSite): ...
bsd-2-clause
glewarne/S6-UniKernel
scripts/exynos_checkpatch_helper.py
169
2237
""" exynos_checkpatch_helper.py - a helper script for exynos_checkpatch.sh Dept : S/W Solution Dev Team Author : Solution3 Power Part Update : 2014.12.08 """ import subprocess as sp import sys def print_log(color, log): colored_log = '' if color == 'r': colored_log = "\033[31m" + log + "\033...
gpl-2.0
ckoch786/PrayerTimes
src/prayertimes.py
1
4151
#!/usr/bin/python # Copyright 2012 Cory Koch # # This file is part of PrayerTimes. # # PrayerTimes 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 la...
gpl-3.0
Benrflanders/Pytris
pyglet/media/drivers/directsound/lib_dsound.py
78
12874
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
mit
drayanaindra/shoop
shoop_tests/utils/__init__.py
6
3979
# -*- coding: utf-8 -*- # This file is part of Shoop. # # Copyright (c) 2012-2015, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. import contextlib import logging import sys import string import uuid import...
agpl-3.0
DBrianKimmel/PyHouse
Project/src/Modules/House/rooms.py
1
12194
""" @name: Modules/House/rooms.py @author: D. Brian Kimmel @contact: D.BrianKimmel@gmail.com @copyright: (c) 2013-2020 by D. Brian Kimmel @license: MIT License @note: Created on Apr 10, 2013 @summary: Handle the rooms information for a house. """ __updated__ = '2020-02-17' __version_info__ = (19, 1...
mit
onitake/ansible
lib/ansible/utils/module_docs_fragments/proxysql.py
29
1293
# Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt class ModuleDocFragment(object): # Documentation fragment for ProxySQL connectivity CONNECTIVITY = ''' options: login_user: description: - The username used to authen...
gpl-3.0
Kriechi/mitmproxy
docs/scripts/api-events.py
1
4042
#!/usr/bin/env python3 import contextlib import inspect import textwrap from pathlib import Path from typing import List, Type import mitmproxy.addons.next_layer # noqa from mitmproxy import hooks, log, addonmanager from mitmproxy.proxy import server_hooks, layer from mitmproxy.proxy.layers import http, tcp, tls, web...
mit
bottompawn/kbengine
kbe/res/scripts/common/Lib/site-packages/pip/_vendor/distlib/markers.py
1261
6282
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2013 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # """Parser for the environment markers micro-language defined in PEP 345.""" import ast import os import sys import platform from .compa...
lgpl-3.0
medspx/QGIS
python/plugins/processing/algs/qgis/TextToFloat.py
3
3143
# -*- coding: utf-8 -*- """ *************************************************************************** TextToFloat.py --------------------- Date : May 2010 Copyright : (C) 2010 by Michael Minn Email : pyqgis at michaelminn dot com *************************...
gpl-2.0
lukeiwanski/tensorflow
tensorflow/python/kernel_tests/variable_scope_test.py
4
64569
# Copyright 2015 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
saimn/astropy
astropy/io/votable/tests/util_test.py
7
1648
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ A set of tests for the util.py module """ # LOCAL from astropy.io.votable import util from astropy.tests.helper import raises def test_range_list(): assert util.coerce_range_list_param((5,)) == ("5.0", 1) def test_range_list2(): assert ut...
bsd-3-clause
apark263/tensorflow
tensorflow/contrib/feature_column/__init__.py
42
1502
# 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
Alwnikrotikz/volatility
volatility/plugins/crashinfo.py
44
5868
# Volatility # Copyright (C) 2009-2013 Volatility Foundation # # This file is part of Volatility. # # Volatility 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 o...
gpl-2.0
juanyaw/PTVS
Python/Tests/TestData/Grammar/DedentErrorLargeFile.py
18
3050
# On the Insert tab, the galleries include items that are designed to coordinate with the overall look of your document. You can use these galleries to insert tables, headers, footers, lists, cover pages, and other document building blocks. When you create pictures, charts, or diagrams, they also coordinate with your ...
apache-2.0
ellipsis14/dolfin
demo/documented/tensor-weighted-poisson/python/demo_tensor-weighted-poisson.py
3
3252
"""This demo program solves Poisson's equation - div C grad u(x, y) = f(x, y) on the unit square with source f given by f(x, y) = 10*exp(-((x - 0.5)^2 + (y - 0.5)^2) / 0.02) and boundary conditions given by u(x, y) = 0 for x = 0 or x = 1 du/dn(x, y) = 0 for y = 0 or y = 1 The conductivity C is a sym...
gpl-3.0
soylentdeen/Graffity
src/SQLTools/CIAO_Browser.py
1
3413
import scipy import numpy import sys from astropy import time as aptime sys.path.append('../') import CIAO_DatabaseTools import Graffity import tkinter def getGRAVITY_OBS(GRAVITY_values, frame): tkinter.Label(frame, text="GRAVITY Observations", width = 3, borderwidth="1", relief="solid").grid(row=0, ...
mit
Immortalin/python-for-android
python3-alpha/python3-src/Lib/test/test_datetime.py
49
1656
import unittest import sys from test.support import import_fresh_module, run_unittest TESTS = 'test.datetimetester' # XXX: import_fresh_module() is supposed to leave sys.module cache untouched, # XXX: but it does not, so we have to save and restore it ourselves. save_sys_modules = sys.modules.copy() try: pure_tests...
apache-2.0
grumpycoders/googletest
xcode/Scripts/versiongenerate.py
3088
4536
#!/usr/bin/env python # # Copyright 2008, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
bsd-3-clause
alexston/calibre-webserver
src/calibre/utils/fonts/win_fonts.py
8
6186
#!/usr/bin/env python # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>' __docformat__ = 'restructuredtext en' ...
gpl-3.0
proversity-org/edx-platform
lms/djangoapps/badges/events/tests/test_course_complete.py
10
2548
""" Tests for the course completion helper functions. """ from datetime import datetime from badges.events import course_complete from student.tests.factories import UserFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory class ...
agpl-3.0
mikel-egana-aranguren/SADI-Galaxy-Docker
galaxy-dist/eggs/bx_python-0.7.2-py2.7-linux-x86_64-ucs4.egg/bx/intervals/intersection_tests.py
7
6579
import sys, os import unittest try: sys.path.insert(0, os.path.dirname(os.path.dirname(__file__))) except: sys.path.insert(0, os.path.dirname(os.path.abspath("."))) from bx.intervals.intersection import Interval from bx.intervals.intersection import IntervalNode from bx.intervals.intersection import IntervalTr...
gpl-3.0
coursemdetw/2014c2
exts/wsgi/static/Brython2.1.0-20140419-113919/Lib/sre_parse.py
111
29657
# # Secret Labs' Regular Expression Engine # # convert re-style regular expression to sre pattern # # Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved. # # See the sre.py file for information on usage and redistribution. # """Internal support module for sre""" # XXX: show string offset and offending ch...
gpl-2.0
bdfoster/blumate
blumate/components/scsgate.py
1
5023
""" Support for SCSGate components. For more details about this component, please refer to the documentation at https://home-assistant.io/components/scsgate/ """ import logging from threading import Lock from blumate.core import EVENT_BLUMATE_STOP REQUIREMENTS = ['scsgate==0.1.0'] DOMAIN = "scsgate" SCSGATE = None _...
mit
anusornc/vitess
test/queryservice_test.py
8
2628
#!/usr/bin/env python import logging import optparse import traceback import unittest import sys import os import utils import framework from queryservice_tests import cache_tests from queryservice_tests import nocache_tests from queryservice_tests import stream_tests from queryservice_tests import status_tests from...
bsd-3-clause
samtx/whatsmyrankine
venv/lib/python2.7/site-packages/werkzeug/datastructures.py
122
87447
# -*- coding: utf-8 -*- """ werkzeug.datastructures ~~~~~~~~~~~~~~~~~~~~~~~ This module provides mixins and classes with an immutable interface. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import re import codecs import ...
mit
ThirdProject/android_external_chromium_org
tools/perf/benchmarks/indexeddb_perf.py
23
1654
# 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. """Runs Chromium's IndexedDB performance test. These test: Databases: create/delete Keys: create/delete Indexes: create/delete Data access: Random r...
bsd-3-clause
vipul-sharma20/oh-mainline
vendor/packages/django-inplaceedit/inplaceeditform/perms.py
19
1387
# Copyright (c) 2010-2013 by Yaco Sistemas <goinnn@gmail.com> or <pmartin@yaco.es> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option)...
agpl-3.0
pk-sam/crosswalk-test-suite
webapi/tct-datasync-tizen-tests/inst.apk.py
903
3180
#!/usr/bin/env python import os import shutil import glob import time import sys import subprocess from optparse import OptionParser, make_option SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PARAMETERS = None ADB_CMD = "adb" def doCMD(cmd): # Do not need handle timeout in this short script, let tool...
bsd-3-clause
sursum/buckanjaren
buckanjaren/lib/python3.5/site-packages/django/contrib/admin/templatetags/admin_modify.py
129
3006
import json from django import template from django.template.context import Context register = template.Library() @register.inclusion_tag('admin/prepopulated_fields_js.html', takes_context=True) def prepopulated_fields_js(context): """ Creates a list of prepopulated_fields that should render Javascript for ...
mit
1st/django
tests/db_typecasts/tests.py
206
2412
# Unit tests for typecast functions in django.db.backends.util import datetime import unittest from django.db.backends import utils as typecasts from django.utils import six TEST_CASES = { 'typecast_date': ( ('', None), (None, None), ('2005-08-11', datetime.date(2005, 8, 11)), ('1...
bsd-3-clause
stroykova/luigi
test/fib_test.py
21
2262
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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
emonty/ansible
lib/ansible/playbook/play.py
19
13265
# (c) 2012-2014, 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) an...
gpl-3.0
JJediny/python-social-auth
examples/pyramid_example/example/settings.py
51
2415
SOCIAL_AUTH_SETTINGS = { 'SOCIAL_AUTH_LOGIN_URL': '/', 'SOCIAL_AUTH_LOGIN_REDIRECT_URL': '/done', 'SOCIAL_AUTH_USER_MODEL': 'example.models.User', 'SOCIAL_AUTH_LOGIN_FUNCTION': 'example.auth.login_user', 'SOCIAL_AUTH_LOGGEDIN_FUNCTION': 'example.auth.login_required', 'SOCIAL_AUTH_AUTHENTICATION_...
bsd-3-clause
Suninus/NewsBlur
vendor/paypal/standard/ipn/signals.py
23
1129
""" Note that sometimes you will get duplicate signals emitted, depending on configuration of your systems. If you do encounter this, you will need to add the "dispatch_uid" to your connect handlers: http://code.djangoproject.com/wiki/Signals#Helppost_saveseemstobeemittedtwiceforeachsave """ from django.dispatch impor...
mit
ac0x/googletest
scripts/release_docs.py
1167
6132
#!/usr/bin/env python # # Copyright 2013 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...
bsd-3-clause
andreparrish/python-for-android
python3-alpha/python3-src/Lib/multiprocessing/synchronize.py
51
10685
# # Module implementing synchronization primitives # # multiprocessing/synchronize.py # # Copyright (c) 2006-2008, R Oudkerk # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistribution...
apache-2.0
agepoly/mezzanine
mezzanine/conf/admin.py
9
1866
from __future__ import unicode_literals from django.contrib import admin from django.contrib.messages import info from django.http import HttpResponseRedirect from django.utils.translation import ugettext_lazy as _ try: from django.utils.encoding import force_text except ImportError: # Backward compatibility f...
bsd-2-clause
iDTLabssl/kitsune
kitsune/flagit/migrations/0001_initial.py
19
1986
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import datetime from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('contenttypes', '0001_init...
bsd-3-clause
pquentin/django
django/db/models/fields/subclassing.py
111
2015
""" Convenience routines for creating non-trivial Field subclasses, as well as backwards compatibility utilities. Add SubfieldBase as the metaclass for your Field subclass, implement to_python() and the other necessary methods and everything will work seamlessly. """ import warnings from django.utils.deprecation imp...
bsd-3-clause
kalahbrown/HueBigSQL
desktop/core/ext-py/pysaml2-2.4.0/example/attributemaps/adfs_v20.py
40
3595
# See http://technet.microsoft.com/en-us/library/ee913589(v=ws.10).aspx # for information regarding the default claim types supported by # Microsoft ADFS v2.0. MAP = { "identifier": "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified", "fro": { 'http://schemas.xmlsoap.org/ws/2005/05/identity/claim...
apache-2.0
zadgroup/edx-platform
common/djangoapps/util/model_utils.py
45
7133
""" Utilities for django models. """ import unicodedata import re from eventtracking import tracker from django.conf import settings from django.utils.encoding import force_unicode from django.utils.safestring import mark_safe from django_countries.fields import Country # The setting name used for events when "sett...
agpl-3.0
LumPenPacK/NetworkExtractionFromImages
osx_build/nefi2_osx_amd64_xcode_2015/site-packages/numpy/core/fromnumeric.py
12
95796
"""Module containing non-deprecated functions borrowed from Numeric. """ from __future__ import division, absolute_import, print_function import types import warnings import numpy as np from .. import VisibleDeprecationWarning from . import multiarray as mu from . import umath as um from . import numerictypes as nt ...
bsd-2-clause
PrincetonUniversity/AdvNet-OF_Scripts
evaluation/switch/flowmod_test/pox/pox/samples/old/l2_modification_proactive_total.py
1
6001
# Copyright 2011 James McCauley # # This file is part of POX. # # POX 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. # # POX is distri...
apache-2.0
qateam123/eq
tests/app/validation/test_textarea_type_check.py
1
1095
import unittest from app.validation.abstract_validator import AbstractValidator from app.validation.textarea_type_check import TextAreaTypeCheck class TextAreaTest(unittest.TestCase): def test_textarea_validator(self): textarea = TextAreaTypeCheck() # validate integer result = textarea....
mit
pbrunet/pythran
pythran/tests/test_import_all.py
2
1424
from test_env import TestEnv from textwrap import dedent import pythran class TestImportAll(TestEnv): def test_import_all(self): self.run_test("from math import *\ndef import_all(l): return cos(l)", 3.3, import_all=[float]) def test_import_cmath_all(self): self.run_test("from cmath import *\n...
bsd-3-clause
sudkannan/xen-hv
tools/python/xen/remus/vm.py
43
4590
#!/usr/bin/env python import xmlrpclib from xen.xend.XendClient import server from xen.xend import sxp, osdep from xen.lowlevel.xc import xc import vif import blkdev # need a nicer way to load disk drivers import vbd class VMException(Exception): pass class VM(object): "Representation of a virtual machine" ...
gpl-2.0
AIML/scikit-learn
sklearn/utils/tests/test_validation.py
133
18339
"""Tests for input validation functions""" import warnings from tempfile import NamedTemporaryFile from itertools import product import numpy as np from numpy.testing import assert_array_equal import scipy.sparse as sp from nose.tools import assert_raises, assert_true, assert_false, assert_equal from sklearn.utils....
bsd-3-clause
andante20/volatility
volatility/plugins/overlays/windows/win2003_sp1_x64_vtypes.py
58
326930
ntkrnlmp_types = { 'LIST_ENTRY64' : [ 0x10, { 'Flink' : [ 0x0, ['unsigned long long']], 'Blink' : [ 0x8, ['unsigned long long']], } ], 'LIST_ENTRY32' : [ 0x8, { 'Flink' : [ 0x0, ['unsigned long']], 'Blink' : [ 0x4, ['unsigned long']], } ], '__unnamed_1015' : [ 0x8, { 'LowPart' : [ 0x0, ['unsig...
gpl-2.0
seanballais/sage-aes
botos/modules/voting/views.py
1
12161
# botos/modules/voting/views.py # Copyright (C) 2016 Sean Francis N. Ballais # # This module is part of Botos and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ Views for voting. """ import json import collections from flask import render_template from flask import flas...
gpl-3.0
bitcommoditiz/Cocoaz-CCz
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
psolstice/zcoin
qa/rpc-tests/wallet-dump.py
81
4788
#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import BitcoinTestFramework from test_framework.util import (start_nodes, s...
mit
danlurie/C-PAC
CPAC/utils/datasource.py
3
9911
import nipype.pipeline.engine as pe import nipype.interfaces.utility as util def create_func_datasource(rest_dict, wf_name='func_datasource'): import nipype.pipeline.engine as pe import nipype.interfaces.utility as util wf = pe.Workflow(name=wf_name) inputnode = pe.Node(util.IdentityInterface( ...
bsd-3-clause
olivierdalang/QGIS
tests/src/python/test_qgsnullsymbolrenderer.py
45
3186
# -*- coding: utf-8 -*- """ *************************************************************************** test_qgsnullsymbolrenderer.py ----------------------------- Date : April 2016 Copyright : (C) 2016 by Nyall Dawson Email : nyall dot dawson at gmail dot ...
gpl-2.0
mhils/mitmproxy
test/pathod/language/test_http.py
11
10165
import io import pytest from pathod import language from pathod.language import http, base from .. import tservers def parse_request(s): return next(language.parse_pathoc(s)) def test_make_error_response(): d = io.BytesIO() s = http.make_error_response("foo") language.serve(s, d, {}) class TestR...
mit
willthames/ansible
lib/ansible/plugins/lookup/nested.py
46
2098
# (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
OpenCobolIDE/OpenCobolIDE
open_cobol_ide/extlibs/qdarkstyle/pyqt_style_rc.py
3
92074
# -*- coding: utf-8 -*- # Resource object code # # Created by: The Resource Compiler for PyQt4 (Qt v4.8.7) # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore qt_resource_data = b"\ \x00\x00\x11\x43\ \x00\ \x00\x5f\xaa\x78\x9c\xc5\x1c\xdb\x72\xdb\xb6\xf2\x5d\x5f\x81\x3a\ \x2f\x49\x8e\x9...
gpl-3.0
lokirius/python-for-android
python3-alpha/python3-src/Lib/test/test_socket.py
47
73373
#!/usr/bin/env python3 import unittest from test import support import errno import io import socket import select import time import traceback import queue import sys import os import array import platform import contextlib from weakref import proxy import signal import math try: import fcntl except ImportError:...
apache-2.0
NetDBNCKU/GAE-Conference-Web-App
django/contrib/gis/sitemaps/views.py
84
4413
from django.http import HttpResponse, Http404 from django.template import loader from django.contrib.sites.models import get_current_site from django.core import urlresolvers from django.core.paginator import EmptyPage, PageNotAnInteger from django.contrib.gis.db.models.fields import GeometryField from django.db import...
bsd-3-clause
civisanalytics/ansible
lib/ansible/modules/monitoring/pingdom.py
19
4360
#!/usr/bin/python # -*- coding: utf-8 -*- # # 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
DrMeers/django
django/contrib/formtools/tests/wizard/namedwizardtests/forms.py
95
1760
import os import tempfile from django import forms from django.core.files.storage import FileSystemStorage from django.forms.formsets import formset_factory from django.http import HttpResponse from django.template import Template, Context from django.contrib.auth.models import User from django.contrib.formtools.wiz...
bsd-3-clause
jcoady9/python-for-android
python-build/python-libs/gdata/src/gdata/tlslite/X509CertChain.py
238
6861
"""Class representing an X.509 certificate chain.""" from utils import cryptomath class X509CertChain: """This class represents a chain of X.509 certificates. @type x509List: list @ivar x509List: A list of L{tlslite.X509.X509} instances, starting with the end-entity certificate and with ever...
apache-2.0
edfungus/Crouton-Python-Example
env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/__init__.py
482
2055
""" urllib3 - Thread-safe connection pooling and re-using. """ __author__ = 'Andrey Petrov (andrey.petrov@shazow.net)' __license__ = 'MIT' __version__ = '1.10.4' from .connectionpool import ( HTTPConnectionPool, HTTPSConnectionPool, connection_from_url ) from . import exceptions from .filepost import en...
mit
valkjsaaa/sl4a
python/src/Lib/json/tests/test_fail.py
51
2884
from unittest import TestCase import json # Fri Dec 30 18:57:26 2005 JSONDOCS = [ # http://json.org/JSON_checker/test/fail1.json '"A JSON payload should be an object or array, not a string."', # http://json.org/JSON_checker/test/fail2.json '["Unclosed array"', # http://json.org/JSON_checker/test/f...
apache-2.0
JackPrice/ansible-modules-extras
monitoring/airbrake_deployment.py
51
3918
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2013 Bruce Pennypacker <bruce@pennypacker.org> # # 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
bradh/openchange
mapiproxy/services/web/rpcproxy/rpcproxy/RPCProxyApplication.py
12
4107
# RPCProxyApplication.py -- OpenChange RPC-over-HTTP implementation # # Copyright (C) 2012 Wolfgang Sourdeau <wsourdeau@inverse.ca> # # 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 vers...
gpl-3.0
jiachenning/odoo
doc/_themes/odoodoc/sphinx_monkeypatch.py
22
3300
# -*- coding: utf-8 -*- import sphinx.roles import sphinx.environment from sphinx.writers.html import HTMLTranslator from docutils.writers.html4css1 import HTMLTranslator as DocutilsTranslator def patch(): # navify toctree (oh god) @monkey(sphinx.environment.BuildEnvironment) def resolve_toctree(old_resolv...
agpl-3.0
SmartXiaoMing/clean_openwrt_sdk
staging_dir/host/lib/scons-2.1.0/SCons/Tool/PharLapCommon.py
21
5236
"""SCons.Tool.PharLapCommon This module contains common code used by all Tools for the Phar Lap ETS tool chain. Right now, this is linkloc and 386asm. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foundation # # Permission is hereby granted, free of charge, to any ...
gpl-2.0
open-craft/XBlock
xblock/test/test_json_conversion.py
1
1905
""" Tests asserting that ModelTypes convert to and from json when working with ModelDatas """ # Allow inspection of private class members # pylint: disable=W0212 from mock import Mock from xblock.core import XBlock from xblock.fields import Field, Scope from xblock.field_data import DictFieldData from xblock.test.too...
apache-2.0
mudbungie/NetExplorer
env/lib/python3.4/site-packages/bulbs/tests/model_tests.py
3
2922
import unittest from .testcase import BulbsTestCase from bulbs.model import Node, NodeProxy, Relationship, RelationshipProxy from bulbs.property import Integer, String, DateTime, Bool from bulbs.utils import current_datetime class Knows(Relationship): label = "knows" timestamp = DateTime(default=current_datet...
mit
servalproject/nikola
tests/test_rst_extensions.py
1
8282
# coding: utf8 # Author: Rodrigo Bistolfi # Date: 03/2013 """ Test cases for Nikola ReST extensions. A base class ReSTExtensionTestCase provides the tests basic behaivor. Subclasses must override the "sample" class attribute with the ReST markup. The sample will be rendered as HTML using publish_parts() by setUp(). O...
mit
Zenfone2-Dev/kernel-FlareM
Documentation/networking/cxacru-cf.py
14668
1626
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # 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 i...
gpl-2.0
diegocortassa/TACTIC
src/context/client/pyasm/application/xsi/xsi_builder.py
2
1975
########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
epl-1.0
synopat/pyload
module/network/HTTPRequest.py
5
11514
#!/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
ran5515/DeepDecision
tensorflow/contrib/framework/python/framework/tensor_util.py
48
10771
# Copyright 2015 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
datapythonista/pandas
pandas/core/window/indexers.py
2
12001
"""Indexer objects for computing start/end window bounds for rolling operations""" from datetime import timedelta from typing import ( Dict, Optional, Tuple, Type, ) import numpy as np from pandas._libs.window.indexers import calculate_variable_window_bounds from pandas.util._decorators import Appende...
bsd-3-clause
jotes/pontoon
pontoon/base/management/commands/calculate_stats.py
1
1652
import logging from django.core.management.base import BaseCommand from django.db.models import Count from pontoon.base.models import ( Project, TranslatedResource, ) log = logging.getLogger(__name__) class Command(BaseCommand): help = """ Re-calculate statistics for all translated resources a...
bsd-3-clause
PetePriority/home-assistant
homeassistant/components/cover/group.py
7
10162
""" This platform allows several cover to be grouped into one cover. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/cover.group/ """ import logging import voluptuous as vol from homeassistant.core import callback from homeassistant.components.cover imp...
apache-2.0
pirata-cat/mieli
identity/registration/backend/urls.py
1
3742
from identity.registration.backend.views import ActivationView from identity.registration.backend.views import RegistrationView from identity.registration.backend.views import ApproveView from identity.registration.backend.forms import LoginForm from django.contrib.auth import views as auth_views from django.views.gene...
agpl-3.0
sanmiguel/home-assistant
homeassistant/helpers/state.py
4
1685
""" homeassistant.helpers.state ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Helpers that help with state related things. """ import logging from homeassistant import State import homeassistant.util.dt as dt_util from homeassistant.const import ( STATE_ON, STATE_OFF, SERVICE_TURN_ON, SERVICE_TURN_OFF, ATTR_ENTITY_ID) _LOGGER = l...
mit
jallohm/django
django/contrib/admin/actions.py
395
3316
""" Built-in, globally-available admin actions. """ from django.contrib import messages from django.contrib.admin import helpers from django.contrib.admin.utils import get_deleted_objects, model_ngettext from django.core.exceptions import PermissionDenied from django.db import router from django.template.response impo...
bsd-3-clause
2014c2g1/c2g1
w2/static/Brython2.0.0-20140209-164925/Lib/posix.py
96
20839
"""This module provides access to operating system functionality that is standardized by the C Standard and the POSIX standard (a thinly disguised Unix interface). Refer to the library manual and corresponding Unix manual entries for more information on calls.""" import datetime F_OK = 0 O_APPEND = 8 O_BINARY = 32...
gpl-2.0
mistio/libcloud
libcloud/common/gogrid.py
28
6395
# 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 use ...
apache-2.0
zbigniewz/jenkins-build-failure-analyzer
analyzer.py
2
3862
#!/usr/bin/python import pprint import re import argparse from datetime import datetime from statsd import StatsClient from utils import failureReasons, JenkinsClient def is_build_failed(job): if 'lastBuild' in job and job['lastBuild'] is not None and 'result' in job['lastBuild']: if job['lastBuild']...
apache-2.0
vikas-parashar/zulip
zerver/context_processors.py
13
2865
from __future__ import absolute_import from typing import Dict, Any from django.http import HttpRequest from django.conf import settings from zerver.models import UserProfile, get_realm_by_string_id from zproject.backends import (password_auth_enabled, dev_auth_enabled, google_auth_enab...
apache-2.0