code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
# 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 distri... | dims/suds-jurko | tests/test_plugin.py | Python | lgpl-3.0 | 4,173 |
# coding: utf-8
#
# commands.py
# Part of SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Ryan Hileman and Aparajita Fishman
#
# Project: https://github.com/SublimeLinter/SublimeLinter3
# License: MIT
#
"""This module implements the Sublime Text commands provided by SublimeLinter."""
impor... | michael-ball/sublime-text | sublime-text-3/Packages/SublimeLinter/commands.py | Python | unlicense | 39,327 |
# 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... | kamcpp/tensorflow | tensorflow/contrib/rnn/python/ops/lstm_ops.py | Python | apache-2.0 | 23,693 |
"""This component provides HA sensor support for Ring Door Bell/Chimes."""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.components.binary_sensor import (
PLATFORM_SCHEMA, BinarySensorDevice)
from homeassistant.const import (
ATTR_ATTRIBUTION, CONF_ENTITY_NAMESPACE,... | jnewland/home-assistant | homeassistant/components/ring/binary_sensor.py | Python | apache-2.0 | 3,663 |
# Copyright 2020 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | ejona86/grpc | src/python/grpcio_tests/tests_aio/unit/_constants.py | Python | apache-2.0 | 816 |
#: E211
spam(1)
#: E211 E211
dict['key'] = list[index]
#: E211
dict['key']['subkey'] = list[index]
#: Okay
spam(1)
dict['key'] = list[index]
# This is not prohibited by PEP8, but avoid it.
class Foo (Bar, Baz):
pass
| ruchee/vimrc | vimfiles/bundle/vim-python/submodules/autopep8/test/suite/out/E21.py | Python | mit | 222 |
# -*- 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
def config(settings):
"""
Template settings for a hosted environment... | gallifrey17/eden | modules/templates/Magnu/config.py | Python | mit | 14,481 |
# jhbuild - a tool to ease building collections of source packages
# Copyright (C) 2001-2004 James Henstridge
# Copyright (C) 2008 Andy Wingo
#
# snapshot.py: output a moduleset corresponding to the exact versions
# that are checked out
#
# This program is free software; you can redistribute it and/o... | ahmeier/jhbuild | jhbuild/commands/snapshot.py | Python | gpl-2.0 | 2,259 |
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
def register_types(module):
root_module = module.get_root()
## udp-echo-client.h: ns3::UdpEchoClient [class]
module.add_class('UdpEchoClient', parent=root_module['ns3::Application'])
## udp-echo-server.h: ns3::UdpEch... | annegabrielle/secure_adhoc_network_ns-3 | ns3_source_code/ns-3.10/bindings/python/apidefs/gcc-LP64/ns3_module_udp_echo.py | Python | gpl-2.0 | 8,335 |
"""
Common base classes for filter rule protocols
"""
from six import StringIO
from virttest import xml_utils
from virttest.libvirt_xml import base, xcepts, accessors
class UntypedDeviceBase(base.LibvirtXMLBase):
"""
Base class implementing common functions for all rule protocol XML w/o a
type attr.
... | balamuruhans/avocado-vt | virttest/libvirt_xml/nwfilter_protocols/base.py | Python | gpl-2.0 | 3,970 |
"""Core implementation of path-based import.
This module is NOT meant to be directly imported! It has been designed such
that it can be bootstrapped into Python as the implementation of import. As
such it requires the injection of specific modules and attributes in order to
work. One should use importlib as the public... | Microvellum/Fluid-Designer | win64-vc/2.78/python/lib/importlib/_bootstrap_external.py | Python | gpl-3.0 | 53,437 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Module: l10n_hr
# Author: Goran Kliska
# mail: goran.kliska(AT)slobodni-programi.hr
# Copyright (C) 2011- Slobodni programi d.o.o., Zagreb
# Contrib... | odoousers2014/odoo | addons/l10n_hr/__init__.py | Python | agpl-3.0 | 1,096 |
# Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory
# 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/... | Metaswitch/calico-nova | nova/keymgr/single_key_mgr.py | Python | apache-2.0 | 2,552 |
"""
Test the printing of anonymous and named namespace variables.
"""
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class NamespaceBreakpointTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@expectedFailureAll(bug... | google/llvm-propeller | lldb/test/API/lang/cpp/namespace/TestNamespace.py | Python | apache-2.0 | 9,174 |
###############################################################################
# _*_ coding: utf-8
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from __future__ import unicode_literals
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook... | jvrsantacruz/XlsxWriter | xlsxwriter/test/comparison/test_utf8_03.py | Python | bsd-2-clause | 1,089 |
"""
This encapsulates the logic for displaying filters in the Django admin.
Filters are specified in models with the "list_filter" option.
Each filter subclass knows how to display a filter for a field that passes a
certain test -- e.g. being a DateField or ForeignKey.
"""
import datetime
from django.db import models... | Sonicbids/django | django/contrib/admin/filters.py | Python | bsd-3-clause | 17,360 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Eric D Helms <ericdhelms@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.0',
... | Tatsh-ansible/ansible | lib/ansible/modules/remote_management/foreman/katello.py | Python | gpl-3.0 | 16,607 |
# 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... | laosiaudi/tensorflow | tensorflow/contrib/learn/python/learn/utils/export.py | Python | apache-2.0 | 13,610 |
# Copyright 2020 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | stanley-cheung/grpc | src/python/grpcio_tests/tests_aio/unit/_common.py | Python | apache-2.0 | 3,617 |
from __future__ import unicode_literals
import os
import re
from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geos import HAS_GEOS
from django.test import TestCase, ignore_warnings, skipUnlessDBFeature
from django.utils._os import upath
from django.utils.deprecation ... | wetneb/django | tests/gis_tests/geo3d/tests.py | Python | bsd-3-clause | 12,923 |
"""Move files to local Galaxy upload directory and add to Galaxy Data Libraries.
Required configurable variables in upload:
dir
"""
import collections
import os
import shutil
import time
from bcbio import utils
from bcbio.log import logger
from bcbio.upload import filesystem
from bcbio.pipeline import qcsummary
# ... | Cyberbio-Lab/bcbio-nextgen | bcbio/upload/galaxy.py | Python | mit | 8,109 |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_urllib_parse_unquote
from ..utils import (
clean_html,
ExtractorError,
determine_ext,
)
class XVideosIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?xvideos\.com/video(?P<id>[0-9]+)(?... | daineseh/kodi-plugin.video.ted-talks-chinese | youtube_dl/extractor/xvideos.py | Python | gpl-2.0 | 2,444 |
# This file is a part of MediaDrop (http://www.mediadrop.net),
# Copyright 2009-2015 MediaDrop contributors
# For the exact contribution history, see the git revision log.
# The source code contained in this file is licensed under the GPLv3 or
# (at your option) any later version.
# See LICENSE.txt in the main project ... | jobsafran/mediadrop | mediadrop/model/tests/group_example_test.py | Python | gpl-3.0 | 1,298 |
# -*- coding: utf-8 -*-
"""
**********************
Minimum Dominating Set
**********************
A dominating set for a graph G = (V, E) is a subset D of V such that every
vertex not in D is joined to at least one member of D by some edge. The
domination number gamma(G) is the number of vertices in a smallest dominat... | devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/networkx/algorithms/approximation/dominating_set.py | Python | agpl-3.0 | 2,985 |
# Copyright 2020 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | ctiller/grpc | tools/run_tests/xds_k8s_test_driver/framework/rpc/grpc.py | Python | apache-2.0 | 3,227 |
#
# Copyright (C) 2003-2006 Greg Landrum and Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
"""unit testing code for fin... | greglandrum/rdkit | rdkit/Chem/Fingerprints/UnitTestFingerprints.py | Python | bsd-3-clause | 2,918 |
from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Get-AntiVirusProduct',
'Author': ['@mh4x0f', 'Jan Egil Ring'],
'Description': ('Get antivirus product information.'),
'Background' : True,
... | adaptivethreat/Empire | lib/modules/powershell/situational_awareness/host/antivirusproduct.py | Python | bsd-3-clause | 4,095 |
"""
Use this plugin to activate coverage report.
To install this plugin, you need to activate ``coverage-plugin``
with extra requirements :
::
$ pip install nose2[coverage-plugin]
Next, you can enable coverage reporting with :
::
$ nose2 --with-coverage
Or with this lines in ``unittest.cfg`` :
::
... | drnextgis/QGIS | python/ext-libs/nose2/plugins/coverage.py | Python | gpl-2.0 | 2,893 |
#!/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',
... | Jorge-Rodriguez/ansible | lib/ansible/modules/network/iosxr/iosxr_user.py | Python | gpl-3.0 | 29,071 |
# A test suite for pdb; at the moment, this only validates skipping of
# specified test modules (RFE #5142).
import imp
import sys
import os
import unittest
import subprocess
import textwrap
from test import test_support
# This little helper class is essential for testing pdb under doctest.
from test_doctest import _... | svanschalkwyk/datafari | windows/python/Lib/test/test_pdb.py | Python | apache-2.0 | 11,281 |
#!/usr/bin/env python
#
# Copyright (c) 2016 ARM Limited
# All rights reserved
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementatio... | yohanko88/gem5-DC | util/style/repo.py | Python | bsd-3-clause | 9,560 |
from django import template
from django.template.loader import render_to_string
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.contrib import comments
from django.utils.encoding import smart_unicode
register = template.Library()
class BaseCommentNode(t... | hunch/hunch-gift-app | django/contrib/comments/templatetags/comments.py | Python | mit | 12,178 |
import sys
from inspect import CO_VARARGS, CO_VARKEYWORDS
import re
from weakref import ref
import py
builtin_repr = repr
reprlib = py.builtin._tryimport('repr', 'reprlib')
if sys.version_info[0] >= 3:
from traceback import format_exception_only
else:
from ._py2traceback import format_exception_only
class ... | razvanc-r/godot-python | tests/bindings/lib/_pytest/_code/code.py | Python | mit | 30,105 |
import json
import os
import sys
import unittest
import uuid
import pytest
from urllib.error import HTTPError
wptserve = pytest.importorskip("wptserve")
from .base import TestUsingServer, TestUsingH2Server, doc_root
from .base import TestWrapperHandlerUsingServer
from serve import serve
class TestFileHandler(TestU... | KiChjang/servo | tests/wpt/web-platform-tests/tools/wptserve/tests/functional/test_handlers.py | Python | mpl-2.0 | 16,970 |
# Copyright (c) 2020, NVIDIA CORPORATION. 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 ... | mlperf/inference_results_v0.7 | open/Inspur/code/rnnt/tensorrt/preprocessing/convert_rnnt_data.py | Python | apache-2.0 | 11,154 |
#!/usr/bin/env python
# encoding: utf-8
"""Verify that all OSF Storage files have Glacier backups and parity files,
creating any missing backups.
TODO: Add check against Glacier inventory
Note: Must have par2 installed to run
"""
from __future__ import division
import gc
import os
import math
import hashlib
import ... | jnayak1/osf.io | scripts/osfstorage/files_audit.py | Python | apache-2.0 | 7,198 |
import numpy as np
import theano
from theano import function
from theano.sandbox.rng_mrg import MRG_RandomStreams
import theano.tensor as T
def energy(W, V, H):
"""
W : A theano matrix of RBM weights
num visible x num hidden
V : A theano matrix of assignments to visible units
Each row is a... | yepengxj/theano_exercises | 02_advanced/01_symbolic/03_energy_soln.py | Python | bsd-3-clause | 2,327 |
import os
import unittest
from node import data_uri
TEST_TXT_FILE = "data_uri_test.txt"
TEST_CONTENTS = "foo\n"
class TestDataURI(unittest.TestCase):
def setUp(self):
with open(TEST_TXT_FILE, 'w') as textfile:
textfile.write(TEST_CONTENTS)
def tearDown(self):
os.remove(TEST_TXT_... | atsuyim/OpenBazaar | tests/test_data_uri.py | Python | mit | 1,044 |
# Copyright 2009-2012 10gen, 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,... | 0111001101111010/open-health-inspection-api | venv/lib/python2.7/site-packages/bson/son.py | Python | gpl-2.0 | 8,313 |
# This file is part of Invenio.
# Copyright (C) 2014 CERN.
#
# Invenio 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.
#
# Invenio is d... | zenodo/invenio | invenio/modules/formatter/format_elements/bfe_arxiv_link.py | Python | gpl-2.0 | 1,776 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2011-2014 Acysos S.L. (http://acysos.com)
# Ignacio Ibeas Izquierdo <ignacio@acysos.com>
#
# This program is free software: y... | RamonGuiuGou/l10n-spain | l10n_es_aeat_mod340_type0/models/mod340.py | Python | agpl-3.0 | 2,829 |
# Copyright 2014 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... | afaheem88/tempest_neutron | tempest/tests/fake_credentials.py | Python | apache-2.0 | 1,922 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/globocom/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
from tornado.options import options, define
from thumbor.detectors.... | food52/thumbor | thumbor/detectors/glasses_detector/__init__.py | Python | mit | 691 |
""" Defines a KernelClient that provides signals and slots.
"""
from IPython.external.qt import QtCore
# Local imports
from IPython.utils.traitlets import Bool, DottedObjectName
from IPython.kernel import KernelManager
from IPython.kernel.restarter import KernelRestarter
from .kernel_mixins import QtKernelManagerMi... | wolfram74/numerical_methods_iserles_notes | venv/lib/python2.7/site-packages/IPython/qt/manager.py | Python | mit | 1,594 |
"""Support for tracking a Volvo."""
import logging
from homeassistant.components.device_tracker import SOURCE_TYPE_GPS
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.util import slugify
from . import DATA_KEY, SIGNAL_STATE_UPDATED
_LOGGER = logging.getLogger(__name__)
asyn... | fbradyirl/home-assistant | homeassistant/components/volvooncall/device_tracker.py | Python | apache-2.0 | 1,079 |
#!/bin/bash
#Copyright (c) 2015 Intel Corporation.
#
#Redistribution and use in source and binary forms, with or without modification,
#are permitted provided that the following conditions are met:
#
#* Redistributions of works must retain the original copyright notice, this list
# of conditions and the following disc... | ibelem/crosswalk-test-suite | wrt/wrt-packagemgt-windows-tests/pmwindows/Crosswalk_WebApp_UnInstall.py | Python | bsd-3-clause | 1,932 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Feedback'
db.create_table(u'auxiliary_feedback', (
(u'id', self.gf('django.db.mo... | OriHoch/Open-Knesset | auxiliary/migrations/0007_auto__add_feedback.py | Python | bsd-3-clause | 5,930 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Automated tests for checking transformation algorithms (the models package).
"""
import logging
import unittest
import os
import os... | duyet-website/api.duyet.net | lib/gensim/test/test_coherencemodel.py | Python | mit | 9,464 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
from odoo.tools.translate import html_translate
class DigestTip(models.Model):
_name = 'digest.tip'
_description = 'Digest Tips'
_order = 'sequence'
sequence = fields.Int... | t3dev/odoo | addons/digest/models/digest_tip.py | Python | gpl-3.0 | 784 |
from coalib.parsing.StringProcessing import position_is_escaped
from tests.parsing.StringProcessing.StringProcessingTestBase import (
StringProcessingTestBase)
class PositionIsEscapedTest(StringProcessingTestBase):
# Test the position_is_escaped() function.
def test_basic(self):
expected_results... | yland/coala | tests/parsing/StringProcessing/PositionIsEscapedTest.py | Python | agpl-3.0 | 2,282 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class StockRulesReport(models.TransientModel):
_inherit = 'stock.rules.report'
so_route_ids = fields.Many2many('stock.location.route', string='Apply specific routes',
... | rven/odoo | addons/sale_stock/wizard/stock_rules_report.py | Python | agpl-3.0 | 594 |
#!/usr/bin/env python
#
# 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
# "... | kgiusti/qpid-proton | python/examples/recurring_timer_tornado.py | Python | apache-2.0 | 1,383 |
# 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... | nburn42/tensorflow | tensorflow/python/kernel_tests/identity_op_py_test.py | Python | apache-2.0 | 2,642 |
"""
Created on Mar 26, 2010
@author: Barthelemy Dagenais
"""
from __future__ import unicode_literals, absolute_import
import unittest
from py4j.java_gateway import JavaGateway, GatewayParameters
from py4j.tests.java_gateway_test import (
start_example_app_process, safe_shutdown, sleep)
class AutoConvertTest(un... | fouzelddin/py4j | py4j-python/src/py4j/tests/java_set_test.py | Python | bsd-3-clause | 3,061 |
# Copyright (c) 2008 Princeton University
# Copyright (c) 2009 Advanced Micro Devices, 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 c... | aferr/LatticeMemCtl | src/mem/ruby/network/garnet/fixed-pipeline/GarnetRouter_d.py | Python | bsd-3-clause | 2,044 |
#!/usr/bin/env python
#
# 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
# notic... | openthread/openthread | tools/harness-automation/cases_R140/router_5_5_2.py | Python | bsd-3-clause | 1,876 |
# -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
import unittest
import pytest
aiohttp = pytest.importorskip("aiohttp")
from aiohttp.wsgi import WSGIServerHttpProtocol
import asyncio
from gunicorn.workers import gaiohttp
from gunicorn.wor... | gtrdotmcs/gunicorn | tests/test_gaiohttp.py | Python | mit | 6,628 |
#
# (c) 2015, Peter Sprygada <psprygada@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 late... | benjixx/ansible | lib/ansible/utils/module_docs_fragments/eos.py | Python | gpl-3.0 | 4,227 |
from sqlalchemy.testing import eq_, assert_raises, \
assert_raises_message, is_
from sqlalchemy.ext import declarative as decl
import sqlalchemy as sa
from sqlalchemy import testing
from sqlalchemy import Integer, String, ForeignKey
from sqlalchemy.testing.schema import Table, Column
from sqlalchemy.orm import rel... | sandan/sqlalchemy | test/ext/declarative/test_inheritance.py | Python | mit | 54,549 |
import sys
import os
if len(sys.argv) != 3:
print "Useage: %s path size"
path = sys.argv[1]
size = int(sys.argv[2])
if not os.path.isdir(os.path.dirname(path)):
os.mkdir(os.path.dirname(path))
writefile = open(path, 'w')
writefile.seek(1024 * 1024 * size)
writefile.write('\x00')
writefile.close()
| autotest/virt-test | shared/scripts/dd.py | Python | gpl-2.0 | 310 |
# This file is part of Androguard.
#
# Copyright (c) 2012 Geoffroy Gueguen <geoffroy.gueguen@gmail.com>
# 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://... | CZ-NIC/thug | src/Analysis/androguard/decompiler/dad/writer.py | Python | gpl-2.0 | 25,574 |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.build_gra... | cevaris/pants | contrib/cpp/src/python/pants/contrib/cpp/register.py | Python | apache-2.0 | 1,198 |
# -*- coding: utf-8 -*-
# vim: set fileencoding=utf-8 :
# Copyright (C) 2008 Neogeo Technologies
#
# This file is part of Opencarto project
#
# Opencarto 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 Foundati... | vdeluca/tfi | geonode/contrib/dynamic/postgis.py | Python | gpl-3.0 | 10,137 |
#!/bin/env python
"""
Spacewalk external inventory script
=================================
Ansible has a feature where instead of reading from /etc/ansible/hosts
as a text file, it can query external programs to obtain the list
of hosts, groups the hosts are in, and even variables to assign to each host.
To use thi... | xiaoshaozi52/ansible | contrib/inventory/spacewalk.py | Python | gpl-3.0 | 8,569 |
from functools import update_wrapper
from django.apps import apps
from django.conf import settings
from django.contrib.admin import ModelAdmin, actions
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
from django.core.urlresolvers import NoRe... | MounirMesselmeni/django | django/contrib/admin/sites.py | Python | bsd-3-clause | 21,392 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, Brian Coca <bcoca@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 Licen... | camradal/ansible | lib/ansible/modules/system/runit.py | Python | gpl-3.0 | 9,034 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
=========================================================================
Program: Visualization Toolkit
Module: TestNamedColorsIntegration.py
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.... | HopeFOAM/HopeFOAM | ThirdParty-0.1/ParaView-5.0.1/VTK/Imaging/Core/Testing/Python/TestAllMaskBits.py | Python | gpl-3.0 | 3,568 |
#!/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... | camradal/ansible | lib/ansible/modules/cloud/amazon/lambda_alias.py | Python | gpl-3.0 | 12,318 |
from airflow.models import BaseOperator
from airflow.utils import send_email
from airflow.utils import apply_defaults
class EmailOperator(BaseOperator):
"""
Sends an email.
:param to: list of emails to send the email to
:type to: list or string (comma or semicolon delimited)
:param subject: subje... | mtustin-handy/airflow | airflow/operators/email_operator.py | Python | apache-2.0 | 1,158 |
#!/usr/bin/python2.4
#
# Copyright 2010 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... | wonderful4228/qualitybots | src/appengine/handlers/base.py | Python | apache-2.0 | 5,928 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_is_vcs_installed
---------------------
"""
from cookiecutter import vcs
def test_existing_repo_type():
assert vcs.is_vcs_installed("git")
def test_non_existing_repo_type():
assert not vcs.is_vcs_installed("stringthatisntashellcommand")
| tylerdave/cookiecutter | tests/test_is_vcs_installed.py | Python | bsd-3-clause | 305 |
#!/usr/bin/env python
""" This is a stress test for the fastevents module.
*Fast events does not appear faster!*
So far it looks like normal pygame.event is faster by up to two times.
So maybe fastevent isn't fast at all.
Tested on windowsXP sp2 athlon, and freebsd.
However... on my debian duron 850 machine fastev... | JulienMcJay/eclock | windows/Python27/Lib/site-packages/pygame/examples/fastevents.py | Python | gpl-2.0 | 2,890 |
# coding: utf-8
"""
Exposes a main() function that runs all tests in the project.
This module is for our test console script.
"""
import os
import sys
import unittest
from unittest import TestCase, TestProgram
import pystache
from pystache.tests.common import PACKAGE_DIR, PROJECT_DIR, UNITTEST_FILE_PREFIX
from pys... | zzeleznick/zDjango | venv/lib/python2.7/site-packages/pystache/tests/main.py | Python | mit | 5,854 |
# (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... | e-gob/plataforma-kioscos-autoatencion | scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/executor/playbook_executor.py | Python | bsd-3-clause | 12,824 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (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... | amandolo/ansible-modules-core | system/setup.py | Python | gpl-3.0 | 5,256 |
# -*- 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... | torypages/luigi | test/contrib/pig_test.py | Python | apache-2.0 | 5,241 |
# -*- coding: utf-8 -*-
from openerp import models, api, _
class account_journal(models.Model):
_inherit = "account.journal"
@api.multi
def get_journal_dashboard_datas(self):
domain_checks_to_print = [
('journal_id', '=', self.id),
('payment_method_id.code', '=', 'check_pr... | vileopratama/vitech | src/addons/account_check_printing/account_journal_dashboard.py | Python | mit | 1,200 |
"""
A series of tests to establish that the command-line managment tools work as
advertised - especially with regards to the handling of the DJANGO_SETTINGS_MODULE
and default settings.py files.
"""
import os
import shutil
import sys
import re
from django import conf, bin, get_version
from django.conf import settings
... | mzdaniel/oh-mainline | vendor/packages/Django/tests/regressiontests/admin_scripts/tests.py | Python | agpl-3.0 | 61,095 |
# coding: utf-8
from django.conf import settings
from django.contrib.contenttypes.generic import generic_inlineformset_factory
from django.test import TestCase
# local test models
from models import Episode, EpisodeExtra, EpisodeMaxNum, EpisodeExclude, \
Media, EpisodePermanent, MediaPermanentInlin... | mzdaniel/oh-mainline | vendor/packages/Django/tests/regressiontests/generic_inline_admin/tests.py | Python | agpl-3.0 | 13,477 |
from .alias import *
__all__ = [ 'ALIAS_KIND_FILE', 'ALIAS_KIND_FOLDER',
'ALIAS_HFS_VOLUME_SIGNATURE',
'ALIAS_FIXED_DISK', 'ALIAS_NETWORK_DISK', 'ALIAS_400KB_FLOPPY_DISK',
'ALIAS_800KB_FLOPPY_DISK', 'ALIAS_1_44MB_FLOPPY_DISK',
'ALIAS_EJECTABLE_DISK',
'ALIAS_N... | KSanthanam/rethinkdb | packaging/osx/mac_alias/__init__.py | Python | agpl-3.0 | 435 |
class M1(type):
def __iter__(self):
pass
class M2(type):
pass
class C1(object):
__metaclass__ = M1
class C2(object):
__metaclass__ = M2
class B1(C1):
pass
for x in C1:
pass
for y in <warning descr="Expected 'collections.Iterable', got 'C2' instead">C2</warning>:
pass
fo... | caot/intellij-community | python/testData/inspections/PyTypeCheckerInspection/MetaClassIteration.py | Python | apache-2.0 | 340 |
# 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
# d... | nikesh-mahalka/nova | nova/tests/unit/virt/libvirt/fake_os_brick_connector.py | Python | apache-2.0 | 1,443 |
import os
import re
# Generate an HTML file for each .test file in the current directory
#
TEST_LIST_FILE = '00_test_list.txt';
TEMPLATE = 'template.html';
def genHTML(template, test):
contents = re.sub('___TEST_NAME___', "'" + test + "'", template);
filename = test + '.html';
print "Generating " + filename;
wit... | guorendong/iridium-browser-ubuntu | third_party/webgl/src/sdk/tests/deqp/genHTMLfromTest.py | Python | bsd-3-clause | 1,016 |
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
clean_html,
determine_ext,
int_or_none,
qualities,
urlencode_postdata,
xpath_text,
)
class NFBIE(InfoExtractor):
IE_NAME = 'nfb'
IE_DESC = 'National Film Board of Canada'
_VALID_URL = r... | mxamin/youtube-dl | youtube_dl/extractor/nfb.py | Python | unlicense | 4,486 |
from abc import ABCMeta, abstractmethod
class Parent(object):
__metaclass__ = ABCMeta
@abstractmethod
def my_method2(self):
pass
@abstractmethod
def my_method(self, foo):
pass | akosyakov/intellij-community | python/testData/refactoring/pullup/abstractMethodHasMeta/SuperClass.after.py | Python | apache-2.0 | 215 |
# Copyright (C) 2001-2006 Python Software Foundation
# Author: Ben Gertzfield
# Contact: email-sig@python.org
"""Quoted-printable content transfer encoding per RFCs 2045-2047.
This module handles the content transfer encoding method defined in RFC 2045
to encode US ASCII-like 8-bit data called `quoted-printable'. It... | hughperkins/kgsgo-dataset-preprocessor | thirdparty/future/src/future/backports/email/quoprimime.py | Python | mpl-2.0 | 10,923 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sites', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='FlatPage',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=Fals... | sametmax/Django--an-app-at-a-time | ignore_this_directory/django/contrib/flatpages/migrations/0001_initial.py | Python | mit | 1,710 |
# Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | samueldotj/TeeRISC-Simulator | src/arch/x86/isa/insts/simd64/integer/compare/compare_and_write_minimum_or_maximum.py | Python | bsd-3-clause | 3,427 |
from ansible.compat.tests.mock import MagicMock
from ansible.utils.path import unfrackpath
mock_unfrackpath_noop = MagicMock(spec_set=unfrackpath, side_effect=lambda x, *args, **kwargs: x)
| tsdmgz/ansible | test/units/mock/path.py | Python | gpl-3.0 | 191 |
import random
import string
from django.db import models
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class MyWrapper(object):
def __init__(self, value):
self.value = value
def __repr__(self):
return "<%s: %s>" % (sel... | moreati/django | tests/custom_pk/fields.py | Python | bsd-3-clause | 1,731 |
import sys
import cherrypy
from cherrypy._cpcompat import ntob
def get_xmlrpclib():
try:
import xmlrpc.client as x
except ImportError:
import xmlrpclib as x
return x
def process_body():
"""Return (params, method) from request body."""
try:
return get_xmlrpclib().loads(cher... | ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/lib/cherrypy/cherrypy/lib/xmlrpcutil.py | Python | bsd-3-clause | 1,606 |
"""Monkey patch os._exit when running under coverage so we don't lose coverage data in forks, such as with `pytest --boxed`."""
import gc
import os
try:
import coverage
except ImportError:
coverage = None
try:
test = coverage.Coverage
except AttributeError:
coverage = None
def pytest_configure():
... | hryamzik/ansible | test/units/conftest.py | Python | gpl-3.0 | 783 |
import collections
import itertools
import json
import os
import os.path
import re
import shutil
import string
import subprocess
import sys
import cgi
class BuildDesc:
def __init__(self, prepend_envs=None, variables=None, build_type=None, generator=None):
self.prepend_envs = prepend_envs or [] # [ { "var":... | wendysuly/TeamTalk | win-client/3rdParty/src/json/devtools/batchbuild.py | Python | apache-2.0 | 11,585 |
# Copyright (C) 2010 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 th... | mogoweb/webkit_for_android5.1 | webkit/Tools/Scripts/webkitpy/tool/steps/postdiffforcommit.py | Python | apache-2.0 | 1,879 |
# Copyright (C) 2011 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 writ... | RKD314/yumstat | yumstat/oauth2client/clientsecrets.py | Python | mit | 4,405 |
#!/usr/bin/env python
# Copyright (c) 2010 Stanford University
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND ... | ongardie/ramcloudfs | common_ancestor.py | Python | isc | 3,207 |
import os
import re
from collections import Callable
missing = object()
class cached_property(object):
def __init__(self, func):
self.func = func
self.__name__ = func.__name__
self.__doc__ = func.__doc__
self.__module__ = func.__module__
def __get__(self, obj, type=None):
... | gears/gears | gears/utils.py | Python | isc | 1,323 |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys, getopt, re, os
try:
from splinter import Browser
except:
print "Please install Splinter: http://splinter.readthedocs.org/en/latest/install.html"
sys.exit();
import getpass
from splinter.request_handler.status_code import HttpResponseError
def main(argv):
em... | skladsec/facebookFriendSaver | facebookFriendSaver.py | Python | isc | 3,504 |
import json
import re
from SBaaS_LIMS.lims_calibratorsAndMixes_query import lims_calibratorsAndMixes_query
from SBaaS_LIMS.lims_sample_query import lims_sample_query
from .lims_quantitationMethod_query import lims_quantitationMethod_query
from .stage01_quantification_MQResultsTable_query import stage01_quantification_... | dmccloskey/SBaaS_quantification | SBaaS_quantification/lims_quantitationMethod_io.py | Python | mit | 26,562 |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.login, name='login'),
] | TrivialBox/HackatonUPS2016 | helpfriends/login/urls.py | Python | mit | 114 |