repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
thnee/ansible
refs/heads/devel
lib/ansible/modules/database/mongodb/mongodb_parameter.py
45
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Loic Blot <loic.blot@unix-experience.fr> # Sponsored by Infopro Digital. http://www.infopro-digital.com/ # Sponsored by E.T.A.I. http://www.etai.fr/ # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ impo...
xxd3vin/spp-sdk
refs/heads/master
opt/Python27/Lib/site-packages/numpy/distutils/fcompiler/nag.py
94
import sys from numpy.distutils.fcompiler import FCompiler compilers = ['NAGFCompiler'] class NAGFCompiler(FCompiler): compiler_type = 'nag' description = 'NAGWare Fortran 95 Compiler' version_pattern = r'NAGWare Fortran 95 compiler Release (?P<version>[^\s]*)' executables = { 'version_cmd'...
jswanljung/iris
refs/heads/master
docs/iris/src/sphinxext/generate_package_rst.py
14
# (C) British Crown Copyright 2010 - 2015, Met Office # # This file is part of Iris. # # Iris 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) any l...
wang1986one/omaha
refs/heads/master
third_party/gmock/scripts/generator/cpp/tokenize.py
679
#!/usr/bin/env python # # Copyright 2007 Neal Norwitz # Portions Copyright 2007 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...
lmyrefelt/CouchPotatoServer
refs/heads/develop
libs/requests/packages/chardet2/escprober.py
52
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org 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 Reserved. # # Con...
joelddiaz/openshift-tools
refs/heads/prod
openshift/installer/vendored/openshift-ansible-3.6.173.0.59/roles/lib_openshift/src/class/oc_obj.py
6
# pylint: skip-file # flake8: noqa # pylint: disable=too-many-instance-attributes class OCObject(OpenShiftCLI): ''' Class to wrap the oc command line tools ''' # pylint allows 5. we need 6 # pylint: disable=too-many-arguments def __init__(self, kind, namespace, ...
Antiun/odoo
refs/heads/8.0
addons/account/account_bank_statement.py
5
# -*- 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...
nvoron23/scikit-learn
refs/heads/master
sklearn/tree/setup.py
150
import os import numpy from numpy.distutils.misc_util import Configuration def configuration(parent_package="", top_path=None): config = Configuration("tree", parent_package, top_path) libraries = [] if os.name == 'posix': libraries.append('m') config.add_extension("_tree", ...
waheedahmed/edx-platform
refs/heads/master
lms/djangoapps/discussion_api/tests/test_permissions.py
11
""" Tests for discussion API permission logic """ import itertools import ddt from nose.plugins.attrib import attr from discussion_api.permissions import ( can_delete, get_editable_fields, get_initializable_comment_fields, get_initializable_thread_fields, ) from lms.lib.comment_client.comment import C...
simpeg/simpegmt
refs/heads/master
simpegMT/ProblemMT1D/__init__.py
1
from Problems import eForm_TotalField, eForm_psField
wenjoy/homePage
refs/heads/master
node_modules/node-captcha/node_modules/canvas/node_modules/mocha/node_modules/jade/node_modules/stylus/node_modules/mkdirp/node_modules/minimist/node_modules/tap/node_modules/yamlish/yamlish-py/yamlish.py
132
# -*- coding: utf-8 -*- #Copyright (C) 2012 Red Hat, Inc. # #Permission is hereby granted, free of charge, to any person obtaining #a copy of this software and associated documentation files (the #"Software"), to deal in the Software without restriction, including #without limitation the rights to use, copy, modify, me...
snicoper/snicoper.com
refs/heads/master
src/apps/authentication/migrations/0001_initial.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-06-20 09:32 from __future__ import unicode_literals from django.conf import settings import django.core.validators from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration):...
palerdot/calibre
refs/heads/master
src/calibre/gui2/__init__.py
1
__license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>' """ The GUI """ import os, sys, Queue, threading, glob from threading import RLock from urllib import unquote from PyQt4.Qt import (QVariant, QFileInfo, QObject, QBuffer, Qt, QByteArray, QTranslator, QCoreApplicat...
ArielSaldana/sunset
refs/heads/master
yaml/test/gtest-1.8.0/googletest/scripts/upload.py
2511
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
ceph/samba
refs/heads/ceph
third_party/dnspython/dns/renderer.py
58
# Copyright (C) 2001-2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation 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 "...
idovear/odoo
refs/heads/master
addons/hr_applicant_document/__init__.py
389
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
puckipedia/youtube-dl
refs/heads/master
youtube_dl/extractor/myspace.py
147
# encoding: utf-8 from __future__ import unicode_literals import re import json from .common import InfoExtractor from ..compat import ( compat_str, ) from ..utils import ExtractorError class MySpaceIE(InfoExtractor): _VALID_URL = r'https?://myspace\.com/([^/]+)/(?P<mediatype>video/[^/]+/|music/song/.*?)(?P...
codepantry/django
refs/heads/master
tests/timezones/forms.py
581
from django import forms from .models import Event class EventForm(forms.Form): dt = forms.DateTimeField() class EventSplitForm(forms.Form): dt = forms.SplitDateTimeField() class EventLocalizedForm(forms.Form): dt = forms.DateTimeField(localize=True) class EventModelForm(forms.ModelForm): class...
GustavoHennig/ansible
refs/heads/devel
lib/ansible/modules/network/nxos/nxos_system.py
59
#!/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...
aruizramon/alec_erpnext
refs/heads/master
erpnext/hr/doctype/offer_letter_term/offer_letter_term.py
96
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document class OfferLetterTerm(Document): pass
Comunitea/CMNT_004_15
refs/heads/11.0
project-addons/product_stock_unsafety/models/product.py
1
# © 2019 Comunitea # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).ç from odoo import models, fields, api from datetime import date from dateutil.relativedelta import relativedelta class ProductProduct(models.Model): _inherit = 'product.product' def get_daily_sales(self): self.ensure_o...
zmike/servo
refs/heads/master
tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-found-not-executed.py
154
def main(request, response): headers = [("Content-Type", "text/javascript")] body = "test1_token = \"script executed\";" return 404, headers, body
nkgilley/home-assistant
refs/heads/dev
tests/testing_config/custom_components/test_embedded/__init__.py
28
"""Component with embedded platforms.""" DOMAIN = "test_embedded" async def async_setup(hass, config): """Mock config.""" return True
un33k/CouchPotatoServer
refs/heads/master
libs/requests/packages/urllib3/response.py
478
try: import http.client as httplib except ImportError: import httplib import zlib import io from socket import timeout as SocketTimeout from ._collections import HTTPHeaderDict from .exceptions import ( ProtocolError, DecodeError, ReadTimeoutError, ResponseNotChunked ) from .packages.six import string_type...
dh4nav/lammps
refs/heads/master
tools/moltemplate/examples/coarse_grained_examples/vesicle_Brannigan2005+Bellesia2010/moltemplate_files/calc_table/calc_CGLipidTableINTvsINT.py
69
#!/usr/bin/env python # Calculate a table of pairwise energies and forces between "INT" atoms # in the lipid membrane model described in # Brannigan et al, Phys Rev E, 72, 011915 (2005) # The energy of this interaction U(r) = eps*(0.4*(sigma/r)^12 - 3.0*(sigma/r)^2) # However it is truncated at rc2 = 22.5 (shifted ...
trevor/mailman3
refs/heads/master
src/mailman/database/schema/mm_20130406000000.py
1
# Copyright (C) 2013-2014 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 you...
stvstnfrd/edx-platform
refs/heads/master
openedx/core/djangoapps/cache_toolbox/__init__.py
1
""" # lint-amnesty, pylint: disable=django-not-configured :mod:`cache_toolbox` --- Non-magical object caching tools for Django ==================================================================== Introduction ------------ ``cache_toolbox`` is intended to be a lightweight series of independent tools to leverage cachi...
nextgis/NextGIS_QGIS_open
refs/heads/ngq-15_0
python/plugins/db_manager/dlg_create_index.py
5
# -*- coding: utf-8 -*- """ /*************************************************************************** Name : DB Manager Description : Database manager plugin for QGIS Date : Oct 13, 2011 copyright : (C) 2011 by Giuseppe Sucameli email : brush.tyler@...
adriennea/OpenMAMA
refs/heads/master
site_scons/site_tools/csharp/csharp.py
19
# -*- coding:utf-8; -*- # Copyright (c) 2009-10 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, ...
Reagankm/KnockKnock
refs/heads/master
venv/lib/python3.4/site-packages/numpy/core/tests/test_memmap.py
65
from __future__ import division, absolute_import, print_function import sys from tempfile import NamedTemporaryFile, TemporaryFile, mktemp, mkdtemp import os import shutil from numpy import memmap from numpy import arange, allclose, asarray from numpy.testing import * class TestMemmap(TestCase): def setUp(self):...
alon/servo
refs/heads/master
tests/wpt/css-tests/tools/wptserve/tests/functional/test_handlers.py
77
import json import os import pytest import unittest import urllib2 import uuid import wptserve from .base import TestUsingServer, doc_root class TestFileHandler(TestUsingServer): def test_GET(self): resp = self.request("/document.txt") self.assertEqual(200, resp.getcode()) self.assertEqual...
ravindrapanda/tensorflow
refs/heads/master
tensorflow/contrib/boosted_trees/examples/boston.py
28
# 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...
veltzer/demos-python
refs/heads/master
src/examples/short/object_oriented/internals/no_overloaded_methods.py
1
#!/usr/bin/env python """ This example plainly shows that you cannot have two methods in a class by the same name. This is true for constructors as well as for regular methods. """ from pyfakeuse import pyfakeuse class A: def __init__(self, val): self.__privar = val # noinspection PyRedeclaration ...
IKholopov/HackUPC2017
refs/heads/master
hackupc/env/lib/python3.5/site-packages/django/db/models/fields/related_lookups.py
33
from django.db.models.lookups import ( Exact, GreaterThan, GreaterThanOrEqual, In, IsNull, LessThan, LessThanOrEqual, ) class MultiColSource(object): contains_aggregate = False def __init__(self, alias, targets, sources, field): self.targets, self.sources, self.field, self.alias = targets, so...
jwomeara/mapnik
refs/heads/master
scons/scons-local-2.3.4/SCons/Tool/mingw.py
9
"""SCons.Tool.gcc Tool-specific initialization for MinGW (http://www.mingw.org/) There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2014 The SCons Foundation # # Permission is hereby gr...
costapt/vess2ret
refs/heads/master
test.py
1
"""Script to test a trained model.""" import os import sys import getopt import numpy as np import models as m import matplotlib.pyplot as plt import util.util as u from util.data import TwoImageIterator from util.util import MyDict, load_params, load_weights_of, compose_imgs, convert_to_rgb, mkdir, get_log_dir def...
Mozta/pagina-diagnostijuego
refs/heads/master
venv/lib/python2.7/site-packages/django/template/base.py
49
""" This is the Django template system. How it works: The Lexer.tokenize() function converts a template string (i.e., a string containing markup with custom template tags) to tokens, which can be either plain text (TOKEN_TEXT), variables (TOKEN_VAR) or block statements (TOKEN_BLOCK). The Parser() class takes a list ...
Nordlxnder/Wetterstation
refs/heads/master
messdaten.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Funktion clientprogramm - sendet Schlüsselwörter wie DATEN um Daten anzufordern oder AB um die Verbindung zubeenden ''' import socket class messdaten_abfragen(): def __init__(self): HOST = '192.168.2.135' # Zielrechner PORT = 55252 ...
twitchyliquid64/misc-scripts
refs/heads/master
s3tool/boto-develop/boto/cloudsearch2/search.py
135
# Copyright (c) 2014 Amazon.com, Inc. or its affiliates. # All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights...
geekboxzone/lollipop_external_chromium_org_tools_grit
refs/heads/geekbox
grit/tool/postprocess_interface.py
62
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. ''' Base class for postprocessing of RC files. ''' class PostProcessor(object): ''' Base class for postprocessing of the RC fil...
d40223223/40223223w0511
refs/heads/master
static/Brython3.1.0-20150301-090019/Lib/xml/dom/pulldom.py
850
import xml.sax import xml.sax.handler START_ELEMENT = "START_ELEMENT" END_ELEMENT = "END_ELEMENT" COMMENT = "COMMENT" START_DOCUMENT = "START_DOCUMENT" END_DOCUMENT = "END_DOCUMENT" PROCESSING_INSTRUCTION = "PROCESSING_INSTRUCTION" IGNORABLE_WHITESPACE = "IGNORABLE_WHITESPACE" CHARACTERS = "CHARACTERS" class PullDOM(...
dmazzella/micropython
refs/heads/master
tests/cpydiff/types_list_store_noniter.py
45
""" categories: Types,list description: List slice-store with non-iterable on RHS is not implemented cause: RHS is restricted to be a tuple or list workaround: Use ``list(<iter>)`` on RHS to convert the iterable to a list """ l = [10, 20] l[0:1] = range(4) print(l)
Kagami/kisa
refs/heads/master
lib/twisted/conch/scripts/tkconch.py
3
# -*- test-case-name: twisted.conch.test.test_scripts -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. # # $Id: tkconch.py,v 1.6 2003/02/22 08:10:15 z3p Exp $ """ Implementation module for the `tkconch` command. """ from __future__ import nested_scopes import Tkinter, tkFileDialog, tkFont...
crazcalm/AngelHack_python34
refs/heads/master
myenv/Lib/site-packages/pip/_vendor/requests/packages/chardet/mbcssm.py
982
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org 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 Reserved. # # Con...
marissazhou/django
refs/heads/master
tests/admin_views/tests.py
3
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime import os import re import unittest from django.contrib.admin import AdminSite, ModelAdmin from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME from django.contrib.admin.models import ADDITION, DELETION, LogEntry from django.cont...
srajag/nova
refs/heads/master
nova/tests/virt/libvirt/test_vif.py
4
# Copyright 2012 Nicira, 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 agr...
skycucumber/xuemc
refs/heads/master
python/venv/lib/python2.7/site-packages/psycopg2/tests/testutils.py
25
# testutils.py - utility module for psycopg2 testing. # # Copyright (C) 2010-2011 Daniele Varrazzo <daniele.varrazzo@gmail.com> # # psycopg2 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 vers...
geodynamics/gale
refs/heads/master
boost/libs/mpi/test/python/all_gather_test.py
64
# Copyright (C) 2006 Douglas Gregor <doug.gregor -at- gmail.com>. # Use, modification and distribution is subject to the Boost Software # License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) # Test all_gather() collective. import boost.parallel.mpi as mpi fr...
ojengwa/oh-mainline
refs/heads/master
vendor/packages/python-social-auth/social/apps/django_app/tests.py
83
from social.tests.test_exceptions import * from social.tests.test_pipeline import * from social.tests.test_storage import * from social.tests.test_utils import * from social.tests.actions.test_associate import * from social.tests.actions.test_disconnect import * from social.tests.actions.test_login import * from social...
Petraea/jsonbot
refs/heads/master
jsb/contrib/sleekxmpp/xmlstream/stanzabase.py
2
# -*- coding: utf-8 -*- """ sleekxmpp.xmlstream.stanzabase ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This module implements a wrapper layer for XML objects that allows them to be treated like dictionaries. Part of SleekXMPP: The Sleek XMPP Library :copyright: (c) 2011 Nathanael C. Fritz :license: MI...
JakeWimberley/Weathredds
refs/heads/master
tracker/migrations/0006_auto_20160714_1331.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-07-14 13:31 from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('tracker', '0005_discussion_createddate'), ] operations ...
apixandru/intellij-community
refs/heads/master
python/lib/Lib/compiler/ast.py
93
"""Python abstract syntax node definitions This file is automatically generated by Tools/compiler/astgen.py """ from compiler.consts import CO_VARARGS, CO_VARKEYWORDS def flatten(seq): l = [] for elt in seq: t = type(elt) if t is tuple or t is list: for elt2 in flatten(elt): ...
mrmiywj/zhihu-python
refs/heads/master
zhihu.py
1
# -*- coding: utf-8 -*- import os import re import time import json import platform import requests import html2text import ConfigParser from bs4 import BeautifulSoup session = None def create_session(): global session cf = ConfigParser.ConfigParser() cf.read("config.ini") email = cf.get("info", "e...
jonnary/keystone
refs/heads/master
keystone/identity/generator.py
14
# Copyright 2014 IBM Corp. # # 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, s...
jlegendary/youtube-dl
refs/heads/master
youtube_dl/extractor/twentyfourvideo.py
105
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( parse_iso8601, int_or_none, ) class TwentyFourVideoIE(InfoExtractor): IE_NAME = '24video' _VALID_URL = r'https?://(?:www\.)?24video\.net/(?:video/(?:view|xml)/|player/new24_play\.swf\?id=)(...
kawamon/hue
refs/heads/master
desktop/core/src/desktop/lib/scheduler/__init__.py
929
# Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file ex...
onaio/rapidpro
refs/heads/master
temba/assets/models.py
3
from __future__ import absolute_import, unicode_literals import os import six from django.conf import settings from django.core.files.storage import default_storage from django.core.urlresolvers import reverse ASSET_STORES_BY_KEY = {} ASSET_STORES_BY_MODEL = {} def register_asset_store(store_class): store = s...
acogdev/ansible
refs/heads/devel
contrib/inventory/jail.py
138
#!/usr/bin/env python # (c) 2013, Michael Scherer <misc@zarb.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 3 of the License, or # (at your o...
LindaTNguyen/RAPID
refs/heads/master
monitors/models.py
2
from django.db import models from django.conf import settings from django.contrib.postgres.fields import ArrayField from django_pgjson.fields import JsonField class IndicatorLookupBase(models.Model): """ Base model for indicator lookups """ owner = models.ForeignKey(settings.AUTH_USER_MODEL) creat...
zshimanchik/iron-unconditioned-reflexes
refs/heads/master
iron-unconditioned-reflexes/world_constants.py
1
class WorldConstants(object): EATING_DISTANCE = 20 EATING_VALUE = 0.03 FOOD_SMELL_SIZE_RATIO = 13.0 DEFAULT_TIMER = 60 APPEAR_FOOD_COUNT = 3 APPEAR_FOOD_SIZE_MIN = 6 APPEAR_FOOD_SIZE_MAX = 10 SEX_DISTANCE = 20 # Animal ANIMAL_MAX_ENERGY = 30 ENERGY_FOR_EXIST = 0.007 ...
keedio/hue
refs/heads/master
desktop/core/ext-py/South-1.0.2/south/management/commands/__init__.py
153
# Common framework for syncdb actions import copy from django.core import management from django.conf import settings # Make sure the template loader cache is fixed _now_ (#448) import django.template.loaders.app_directories from south.hacks import hacks from south.management.commands.syncdb import Command as Sync...
40223231/2015cd_midterm2
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/unittest/suite.py
748
"""TestSuite""" import sys from . import case from . import util __unittest = True def _call_if_exists(parent, attr): func = getattr(parent, attr, lambda: None) func() class BaseTestSuite(object): """A simple test suite that doesn't provide class or module shared fixtures. """ def __init__(se...
Qalthos/ansible
refs/heads/devel
lib/ansible/modules/system/dconf.py
28
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Branko Majic <branko@majic.rs> # 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', ...
ojengwa/reportr
refs/heads/master
core/e2e/test_client.py
2
from django.test import TestCase # class ClienTest(TestCase): # """docstring for ClienTest""" # def setUp(self): # pass
antoniodemora/python-telegram-bot
refs/heads/master
setup.py
1
#!/usr/bin/env python '''The setup and build script for the python-telegram-bot library.''' import os from setuptools import setup, find_packages def read(*paths): """Build a file path from *paths* and return the contents.""" with open(os.path.join(*paths), 'r') as f: return f.read() setup( n...
caot/intellij-community
refs/heads/master
python/testData/refactoring/pullup/abstractMethodPy3AddMeta/SuperClass.after.py
58
from abc import object, abstractmethod, ABCMeta class Parent(object, metaclass=ABCMeta): @abstractmethod def my_method(self, foo): """ Eats eggs :param foo: eggs """ pass @classmethod @abstractmethod def my_class_method(): pass
p0cisk/Quantum-GIS
refs/heads/master
python/ext-libs/requests/packages/urllib3/connectionpool.py
147
from __future__ import absolute_import import errno import logging import sys import warnings from socket import error as SocketError, timeout as SocketTimeout import socket try: # Python 3 from queue import LifoQueue, Empty, Full except ImportError: from Queue import LifoQueue, Empty, Full # Queue is im...
dan1/horizon-x509
refs/heads/master
openstack_dashboard/test/integration_tests/regions/tables.py
6
# 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...
shenhequnying/ceph-deploy
refs/heads/master
ceph_deploy/tests/test_install.py
8
from mock import Mock from ceph_deploy import install class TestSanitizeArgs(object): def setup(self): self.args = Mock() # set the default behavior we set in cli.py self.args.default_release = False self.args.stable = None def test_args_release_not_specified(self): ...
Semprini/cbe
refs/heads/master
cbe/cbe/human_resources/urls.py
2
"""cbe hr URL Configuration """ from django.conf.urls import include, url from drf_nest.routers import AppRouter from . import views import cbe.human_resources.views as HRViews router = AppRouter(root_view_name='app-human_resources') router.register(r'staff', HRViews.StaffViewSet) router.register(r'identification',...
TimeDelta/dotfiles
refs/heads/master
bin/depends.py
1
#!/usr/bin/env python import sys, re from subprocess import * from pprint import pprint def depends(target_name): try: output = check_output([r'ant -p -debug | grep -v "env\." | egrep -A 1 -B 0 "^\s*' \ + target_name \ + r'(\s|$)" | sed -n 2p | grep "^\s*depends on"'], shell=True, universal_newlines=True) ex...
ancafarcas/superdesk-core
refs/heads/superdesk-master
apps/vidible/vidible_test.py
1
import unittest from .vidible import get_vidible_metadata class VidibleTestCase(unittest.TestCase): def test_get_vidible_metadata(self): meta = get_vidible_metadata(bcid='538612f0e4b00fbb8e898655', pid='56bb474de4b0568f54a23ed7') assert(type(meta) is dict) assert(type(meta['height']) is ...
TEAM-Gummy/platform_external_chromium_org
refs/heads/kk4.4
tools/telemetry/telemetry/core/backends/webdriver/webdriver_ie_backend.py
38
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import re import urllib2 from telemetry.core.backends.webdriver import webdriver_browser_backend class WebDriverIEBackend(webdriver_browser_backend.WebDrive...
evernym/zeno
refs/heads/master
plenum/test/consensus/message_req/message_req_view_change_service/test_message_req_new_view.py
2
from unittest.mock import Mock import pytest from plenum.common.constants import COMMIT, NEW_VIEW from plenum.common.messages.internal_messages import MissingMessage, ViewChangeStarted from plenum.common.messages.node_messages import MessageReq, MessageRep, Commit, ViewChange, ViewChangeAck, NewView from plenum.commo...
mauroalberti/gsf
refs/heads/master
pygsf/profiles/profilers.py
1
from typing import List, Iterable from operator import attrgetter from ..georeferenced.geoshapes2d import * from ..georeferenced.rasters import * from ..geology.base import * from .sets import * from ..orientations.orientations import Axis from ..geometries.shapes.space2d import PointSegmentCollection2D def georef...
gencer/python-phonenumbers
refs/heads/dev
python/phonenumbers/data/region_BQ.py
2
"""Auto-generated file, do not edit by hand. BQ metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_BQ = PhoneMetadata(id='BQ', country_code=599, international_prefix='00', general_desc=PhoneNumberDesc(national_number_pattern='[347]\\d{6}', possible_length=(7,)), ...
jlspyaozhongkai/Uter
refs/heads/master
third_party_build/Python-2.7.9/lib/python2.7/lib2to3/fixes/__init__.py
2547
# Dummy file to make this directory a package.
taschik/ramcloud
refs/heads/master
bindings/python/test_retries.py
20
# 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 THE AUTHOR(S) DISCLAIM ...
mancoast/CPythonPyc_test
refs/heads/master
cpython/244_test_shelve.py
15
import os import unittest import shelve import glob from test import test_support class TestCase(unittest.TestCase): fn = "shelftemp" + os.extsep + "db" def test_ascii_file_shelf(self): try: s = shelve.open(self.fn, binary=False) s['key1'] = (1,2,3,4) self.assertEq...
Bitl/RBXLegacy-src
refs/heads/stable
Cut/RBXLegacyDiscordBot/lib/youtube_dl/extractor/cda.py
13
# coding: utf-8 from __future__ import unicode_literals import codecs import re from .common import InfoExtractor from ..utils import ( ExtractorError, float_or_none, int_or_none, multipart_encode, parse_duration, random_birthday, urljoin, ) class CDAIE(InfoExtractor): _VALID_URL = r...
Timmenem/micropython
refs/heads/master
tests/basics/bytearray_add.py
93
# test bytearray + bytearray b = bytearray(2) b[0] = 1 b[1] = 2 print(b + bytearray(2)) # inplace add b += bytearray(3) print(b) # extend b.extend(bytearray(4)) print(b) # this inplace add tests the code when the buffer doesn't need to be increased b = bytearray() b += b''
bfrog/whizzer
refs/heads/master
whizzer/test/test_rpc_msgpack.py
1
# -*- coding: utf-8 -*- # Copyright (c) 2010 Tom Burdick <thomas.burdick@gmail.com> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rig...
mkenne11/nogotofail
refs/heads/dev
nogotofail/mitm/util/tls/types/__init__.py
4
r''' 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 by applicable law or agreed to i...
s20121035/rk3288_android5.1_repo
refs/heads/master
packages/apps/Launcher3/fill_screens.py
17
#!/usr/bin/env python2.5 import cgi import os import shutil import sys import sqlite3 SCREENS = 5 COLUMNS = 4 ROWS = 4 CELL_SIZE = 110 DIR = "db_files" AUTO_FILE = "launcher.db" APPLICATION_COMPONENTS = [ "com.android.calculator2/com.android.calculator2.Calculator", "com.android.providers.downloads.ui/com.andro...
DavidLP/home-assistant
refs/heads/dev
homeassistant/components/tfiac/__init__.py
36
"""The tfiac component."""
SummerLW/Perf-Insight-Report
refs/heads/test
telemetry/telemetry/web_perf/metrics/indexeddb_timeline.py
16
# Copyright 2015 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. from telemetry.web_perf.metrics import timeline_based_metric from telemetry.web_perf.metrics.trace_event_stats import TraceEventStats from telemetry.web_per...
owatte/thecaribfos
refs/heads/master
apps/thedirectory/forms.py
1
import uuid from django import forms from django.utils.text import slugify from django.utils.translation import ugettext as _ from crispy_forms.helper import FormHelper from crispy_forms.layout import Div, Layout, Field, Fieldset, HTML from crispy_forms.bootstrap import PrependedText import autocomplete_light #~ from...
Azulinho/ansible
refs/heads/devel
lib/ansible/modules/packaging/os/rhn_register.py
38
#!/usr/bin/python # (c) James Laska # # 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': ['preview'], ...
ianyh/heroku-buildpack-python-opencv
refs/heads/master
vendor/.heroku/lib/python2.7/ctypes/_endian.py
124
###################################################################### # This file should be kept compatible with Python 2.3, see PEP 291. # ###################################################################### import sys from ctypes import * _array_type = type(Array) def _other_endian(typ): """Return the type ...
srwareham/CampaignAdvisor
refs/heads/master
campaignadvisor/dataframe_holder.py
1
""" Module for accessing relevant data tables. Contains logic for storing locally serialized caches to *greatly* speed up all accesses after the initial one """ import os try: import cPickle as pickle except ImportError: import pickle import numpy as np import pandas as pd import resources import data_cleanu...
Venturi/oldcms
refs/heads/master
env/lib/python2.7/site-packages/cms/south_migrations/0064_staticplaceholder_site_change.py
63
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): for sp in orm['cms.StaticPlaceholder'].objects.all(): sp.site = None ...
htc-mirror/runnymede-ics-crc-3.0.16-c297c99
refs/heads/master
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
fleg/nan
refs/heads/master
cpplint.py
163
#!/usr/bin/env python # # Copyright (c) 2009 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...
paol/powerline-shell
refs/heads/master
segments/git.py
11
import re import subprocess def get_git_status(): has_pending_commits = True has_untracked_files = False origin_position = "" output = subprocess.Popen(['git', 'status', '--ignore-submodules'], env={"LANG": "C", "HOME": os.getenv("HOME")}, stdout=subprocess.PIPE).communicate()[0] for li...
stshine/servo
refs/heads/master
tests/wpt/web-platform-tests/XMLHttpRequest/resources/inspect-headers.py
25
def get_response(raw_headers, filter_value, filter_name): result = "" for line in raw_headers.headers: if line[-2:] != '\r\n': return "Syntax error: missing CRLF: " + line line = line[:-2] if ': ' not in line: return "Syntax error: no colon and space: " + line ...
chuckbutler/kubernetes
refs/heads/master
Godeps/_workspace/src/github.com/hashicorp/go-msgpack/codec/msgpack_test.py
1233
#!/usr/bin/env python # This will create golden files in a directory passed to it. # A Test calls this internally to create the golden files # So it can process them (so we don't have to checkin the files). import msgpack, msgpackrpc, sys, os, threading def get_test_data_list(): # get list with all primitive typ...
adhoc-dev/account-financial-tools
refs/heads/8.0
account_partner_account_summary/report/__init__.py
129
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ##############################################################################
jitendriya/linux-2.6
refs/heads/master
arch/ia64/scripts/unwcheck.py
13143
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
hsluo/youtube-dl
refs/heads/master
youtube_dl/extractor/steam.py
157
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, unescapeHTML, ) class SteamIE(InfoExtractor): _VALID_URL = r"""(?x) https?://store\.steampowered\.com/ (agecheck/)? (?P<urltype>video|app)/ #If the pa...
llvmpy/llvmpy
refs/heads/master
llvm/ee.py
1
# # Copyright (c) 2008-10, Mahadevan R 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 ...