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/module_utils/network/iosxr/argspec/l3_interfaces/__init__.py
12133432
luhn/tern
refs/heads/master
tern/adapters/adapterbase.py
1
from abc import ABCMeta, abstractmethod class AdapterBase(object): __metaclass__ = ABCMeta # A list of attributes to be defined in config. # (var name, display name, default) config = [ ('host', 'Host', ''), ('port', 'Port', ''), ('dbname', 'Database name', ''), ('user...
350dotorg/Django
refs/heads/master
django/utils/daemonize.py
452
import os import sys if os.name == 'posix': def become_daemon(our_home_dir='.', out_log='/dev/null', err_log='/dev/null', umask=022): "Robustly turn into a UNIX daemon, running in our_home_dir." # First fork try: if os.fork() > 0: sys.exit(0...
myang321/django
refs/heads/master
tests/migrations/test_migrations_backwards_deps_1/0001_initial.py
416
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): operations = []
sloth4413/crate
refs/heads/master
docs/bootstrap.py
95
############################################################################## # # Copyright (c) 2006 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
hurricup/intellij-community
refs/heads/master
plugins/hg4idea/testData/bin/mercurial/repo.py
88
# repo.py - repository base classes for mercurial # # Copyright 2005, 2006 Matt Mackall <mpm@selenic.com> # Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from i18n import _ im...
siosio/intellij-community
refs/heads/master
python/testData/formatter/continuationIndentForCollectionsAndComprehensions_after.py
15
l = [ 1, 2, 3 ] lc = [ x for x in range(42) if x ] s = { 1, 2, 3 } sc = { x for x in range(42) if x } t = ( 1, 2, 3 ) g = ( x for x in range(42) if...
mitya57/django
refs/heads/master
tests/model_forms/test_uuid.py
90
from django import forms from django.core.exceptions import ValidationError from django.test import TestCase from .models import UUIDPK class UUIDPKForm(forms.ModelForm): class Meta: model = UUIDPK fields = '__all__' class ModelFormBaseTest(TestCase): def test_create_save_error(self): ...
okolisny/integration_tests
refs/heads/master
cfme/utils/blockers.py
1
# -*- coding: utf-8 -*- import re import six import xmlrpclib from github import Github from urlparse import urlparse from fixtures.pytest_store import store from cfme.utils import classproperty, conf, version from cfme.utils.bz import Bugzilla from cfme.utils.log import logger class Blocker(object): """Base cla...
yongshengwang/hue
refs/heads/master
build/env/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/core/management/validation.py
107
import collections import sys from django.conf import settings from django.core.management.color import color_style from django.utils.encoding import force_str from django.utils.itercompat import is_iterable from django.utils import six class ModelErrorCollection: def __init__(self, outfile=sys.stdout): ...
milchakov/omim
refs/heads/master
tools/python/transit/transit_color_palette.py
10
import math def to_rgb(color_str): if len(color_str) != 6: return (0, 0, 0) r = int(color_str[0:2], 16) g = int(color_str[2:4], 16) b = int(color_str[4:], 16) return (r, g, b) def blend_colors(rgb_array1, rgb_array2, k): return (rgb_array1[0] * (1.0 - k) + rgb_array2[0] * k, ...
coberger/DIRAC
refs/heads/integration
ResourceStatusSystem/Policy/JobRunningMatchedRatioPolicy.py
10
# $HeadURL: $ """ JobRunningMatchedRatioPolicy Policy that calculates the efficiency following the formula: ( running ) / ( running + matched + received + checking ) if the denominator is smaller than 10, it does not take any decision. """ from DIRAC import S_...
sudovijay/youtube-dl
refs/heads/master
youtube_dl/extractor/xminus.py
118
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_chr, compat_ord, ) from ..utils import ( int_or_none, parse_filesize, ) class XMinusIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?x-minus\.org/track/(?P<id>[0-...
wilywampa/python-mode
refs/heads/develop
pymode/libs/pylama/config.py
1
"""Parse arguments from command line and configuration files.""" import fnmatch import os import sys import re import logging from argparse import ArgumentParser from . import __version__ from .libs.inirama import Namespace from .lint.extensions import LINTERS #: A default checkers DEFAULT_LINTERS = 'pycodestyle', '...
rcarrillocruz/ansible
refs/heads/devel
lib/ansible/modules/network/cloudengine/ce_vxlan_gateway.py
46
#!/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...
darmaa/odoo
refs/heads/master
addons/gamification_sale_crm/__init__.py
396
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 OpenERP SA (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
emedinaa/contentbox
refs/heads/master
third_party/django/core/management/commands/check.py
119
from __future__ import unicode_literals import warnings from django.core.checks.compatibility.base import check_compatibility from django.core.management.base import NoArgsCommand class Command(NoArgsCommand): help = "Checks your configuration's compatibility with this version " + \ "of Django." ...
has2k1/numpy
refs/heads/master
numpy/lib/tests/test_format.py
78
from __future__ import division, absolute_import, print_function r''' Test the .npy file format. Set up: >>> import sys >>> from io import BytesIO >>> from numpy.lib import format >>> >>> scalars = [ ... np.uint8, ... np.int8, ... np.uint16, ... np.int16, ... ...
mboehn/ffc
refs/heads/master
base/tests.py
24123
from django.test import TestCase # Create your tests here.
CityManager/start_flask
refs/heads/master
a01_quickstart/learn_flask_script.py
1
#!/usr/bin/env python3 # _*_ coding:utf-8 _*_ from flask import Flask from flask_script import Manager, Command, Option app = Flask(__name__) # configure your app manager = Manager(app) class Hello(Command): # 默认方式添加命令 """prints hello world""" def run(self): print("hello world") manager.add_comman...
longmen21/edx-platform
refs/heads/master
openedx/core/djangoapps/profile_images/tests/test_views.py
14
""" Test cases for the HTTP endpoints of the profile image api. """ from contextlib import closing import datetime from nose.plugins.attrib import attr from pytz import UTC import unittest from django.conf import settings from django.core.urlresolvers import reverse from django.http import HttpResponse import ddt imp...
iDTLabssl/hr
refs/heads/8.0
__unported__/hr_schedule/__init__.py
28
# -*- coding:utf-8 -*- # # # Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com>. # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, eit...
twolfson/FindPlusPlus
refs/heads/master
DirectoryPanel.py
1
""" Shamlessly copied/modified from SublimeQuickFileCreator https://github.com/noklesta/SublimeQuickFileCreator """ import os import re import sublime import sublime_plugin SETTINGS_KEY = 'FindPlusPlus' class DirectoryPanel(sublime_plugin.WindowCommand): relative_paths = [] full_torelative_paths = {} rel_...
NeCTAR-RC/murano
refs/heads/master
murano/tests/unit/api/middleware/test_ssl.py
4
# 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...
a-d-j-i/yowsup
refs/heads/master
yowsup/layers/protocol_groups/protocolentities/notification_groups.py
32
from yowsup.structs import ProtocolEntity, ProtocolTreeNode from yowsup.layers.protocol_notifications.protocolentities import NotificationProtocolEntity class GroupsNotificationProtocolEntity(NotificationProtocolEntity): ''' <notification notify="WhatsApp" id="{{id}}" t="1420402514" participant="{{participant...
felixonmars/braintree_python
refs/heads/master
braintree/risk_data.py
5
from braintree.attribute_getter import AttributeGetter class RiskData(AttributeGetter): pass
venkey-ariv/fullerite
refs/heads/master
src/diamond/collectors/amavis/amavis.py
20
# coding=utf-8 """ Collector that reports amavis metrics as reported by amavisd-agent #### Dependencies * amavisd-agent must be present in PATH """ import os import subprocess import re import diamond.collector import diamond.convertor class AmavisCollector(diamond.collector.Collector): # From the source of...
TomasTomecek/trello-reporter
refs/heads/master
trello_reporter/harvesting/apps.py
2
from __future__ import unicode_literals from django.apps import AppConfig class HarvestingConfig(AppConfig): name = 'harvesting'
sergiocazzolato/snapd
refs/heads/master
tests/lib/snaps/store/test-snapd-autopilot-consumer/provider.py
8
#!/usr/bin/env python3 from gi.repository import GLib import dbus import dbus.service from dbus.mainloop.glib import DBusGMainLoop DBusGMainLoop(set_as_default=True) class DBusProvider(dbus.service.Object): def __init__(self): bus = dbus.SessionBus() bus_name = dbus.service.BusName( ...
ZazieTheBeast/oscar
refs/heads/master
src/oscar/apps/basket/forms.py
6
from django import forms from django.conf import settings from django.db.models import Sum from django.forms.models import BaseModelFormSet, modelformset_factory from django.utils.translation import ugettext_lazy as _ from oscar.core.loading import get_model from oscar.forms import widgets Line = get_model('basket', ...
scorphus/django
refs/heads/master
tests/gis_tests/geoadmin/models.py
300
from django.contrib.gis.gdal import HAS_GDAL from django.utils.encoding import python_2_unicode_compatible from ..admin import admin from ..models import models @python_2_unicode_compatible class City(models.Model): name = models.CharField(max_length=30) point = models.PointField() objects = models.GeoM...
zzicewind/nova
refs/heads/master
nova/tests/functional/v3/test_pci.py
3
# Copyright 2013 Intel. # # 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...
lukeiwanski/tensorflow-opencl
refs/heads/master
tensorflow/python/kernel_tests/dynamic_partition_op_test.py
97
# 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...
haiiiiiyun/scrapy
refs/heads/master
scrapy/utils/multipart.py
211
""" Transitional module for moving to the w3lib library. For new code, always import from w3lib.form instead of this module """ from w3lib.form import *
chrismeyersfsu/ansible
refs/heads/devel
lib/ansible/modules/packaging/os/package.py
47
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Ansible, inc # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your o...
romain-li/edx-platform
refs/heads/master
lms/djangoapps/courseware/management/__init__.py
12133432
mlperf/training_results_v0.7
refs/heads/master
DellEMC/benchmarks/transformer/implementation/pytorch/fairseq/data/token_block_dataset.py
6
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import math import numpy as np im...
MounirMesselmeni/django
refs/heads/master
tests/middleware_exceptions/tests.py
119
import sys from django.conf import settings from django.core.exceptions import MiddlewareNotUsed from django.core.signals import got_request_exception from django.http import HttpResponse from django.template import engines from django.template.response import TemplateResponse from django.test import RequestFactory, S...
zanderle/django
refs/heads/master
django/middleware/cache.py
372
""" Cache middleware. If enabled, each Django-powered page will be cached based on URL. The canonical way to enable cache middleware is to set ``UpdateCacheMiddleware`` as your first piece of middleware, and ``FetchFromCacheMiddleware`` as the last:: MIDDLEWARE_CLASSES = [ 'django.middleware.cache.UpdateCa...
jneves/django-storages
refs/heads/master
docs/conf.py
32
# -*- coding: utf-8 -*- # # django-storages documentation build configuration file, created by # sphinx-quickstart on Sun Aug 28 13:44:45 2011. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file....
jordanemedlock/psychtruths
refs/heads/master
temboo/core/Library/RunKeeper/Nutrition/DeleteEntry.py
4
# -*- coding: utf-8 -*- ############################################################################### # # DeleteEntry # Removes an individual nutrition entry from a user’s feed. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you...
tltuan/coala
refs/heads/master
coalib/bearlib/abstractions/SectionCreatable.py
25
from coalib.settings.FunctionMetadata import FunctionMetadata class SectionCreatable: """ A SectionCreatable is an object that is creatable out of a section object. Thus this is the class for many helper objects provided by the bearlib. If you want to use an object that inherits from this class the f...
w1ll1am23/home-assistant
refs/heads/dev
homeassistant/components/syslog/__init__.py
36
"""The syslog component."""
graingert/pip
refs/heads/develop
tests/lib/scripttest.py
62
from __future__ import absolute_import from . import PipTestEnvironment # noqa
yjmade/odoo
refs/heads/8.0
addons/website_event_track/controllers/event.py
332
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
baloo/shinken
refs/heads/debian/master
shinken/modules/livestatus_broker/livestatus_stack.py
1
# -*- coding: utf-8 -*- # # Copyright (C) 2009-2012: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # Gregory Starck, g.starck@gmail.com # Hartmut Goebel, h.goebel@goebel-consult.de # # This file is part of Shinken. # # Shinken is free software: you can redistribute it and...
vikas1885/test1
refs/heads/master
common/lib/xmodule/xmodule/annotator_token.py
211
""" This file contains a function used to retrieve the token for the annotation backend without having to create a view, but just returning a string instead. It can be called from other files by using the following: from xmodule.annotator_token import retrieve_token """ import datetime from firebase_token_generator im...
zubair-arbi/edx-platform
refs/heads/master
lms/djangoapps/verify_student/migrations/0013_auto__add_field_softwaresecurephotoverification_copy_id_photo_from.py
11
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'SoftwareSecurePhotoVerification.copy_id_photo_from' db.ad...
JoeriHermans/tensorflow-scripts
refs/heads/master
scripts/adverserial-variational-optimization/avo-gp.py
2
# Adverserial Variational Optimization import math import numpy as np import random import sys import torch import torch.nn.functional as F from sklearn.utils import check_random_state from torch.autograd import Variable def main(): # Assume there exists some true parameterization. # Beam Energy = 45 Gev, ...
fighterCui/L4ReFiascoOC
refs/heads/master
l4/pkg/python/contrib/Tools/framer/framer/__init__.py
48
"""A tool to generate basic framework for C extension types. The basic ideas is the same as modulator, but the code generates code using many of the new features introduced in Python 2.2. It also takes a more declarative approach to generating code. """
fernandezcuesta/ansible
refs/heads/devel
lib/ansible/modules/cloud/dimensiondata/__init__.py
12133432
indashnet/InDashNet.Open.UN2000
refs/heads/master
android/external/markdown/markdown/inlinepatterns.py
107
""" INLINE PATTERNS ============================================================================= Inline patterns such as *emphasis* are handled by means of auxiliary objects, one per pattern. Pattern objects must be instances of classes that extend markdown.Pattern. Each pattern object uses a single regular express...
henriquegemignani/image2tiled
refs/heads/master
tests/test_tiled_generator.py
1
import json import os import pytest import image2tiled.tiled_generator _path = os.path.dirname(os.path.abspath(__file__)) def test_json(image_exporter, tile_extractor, reader_4x4, tiled_4x4): rotation_results = tile_extractor.extract(reader_4x4) new_image = image_exporter.create(rotation_results.unique_ima...
ThiagoGarciaAlves/intellij-community
refs/heads/master
python/testData/quickdoc/DirectClass.py
83
# direct class doc class Foo(object): "<the_doc>Doc of Foo." pass <the_ref>Foo
ojengwa/oh-mainline
refs/heads/master
vendor/packages/django-voting/voting/templatetags/voting_tags.py
32
from django import template from django.utils.html import escape from voting.models import Vote register = template.Library() # Tags class ScoreForObjectNode(template.Node): def __init__(self, object, context_var): self.object = object self.context_var = context_var def render(self, context...
tanderegg/django-cmsplugin-twitter
refs/heads/master
cmsplugin_twitter/cms_plugins.py
1
import twitter from dateutil.parser import parse from django.utils.translation import ugettext_lazy as _ from django.conf import settings from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from .models import TwitterConfig class TwitterCredentialsNotSupplied(Exception): pass c...
jesseengel/magenta
refs/heads/master
magenta/models/image_stylization/image_stylization_evaluate.py
2
# Copyright 2019 The Magenta 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 ...
CiscoSystems/os-sqe
refs/heads/master
lab/nodes/xrvr.py
1
from lab.nodes.virtual_server import VirtualServer # use telnet 0 5087 from xrnc to see the bootstrap process just after spinning up XRNC VM # configuration is kept in sudo cat /etc/vpe/vsocsr/dl_server.ini on cisco@xrnc # error loging in /var/log/sr/dl_registration_errors.log class Xrvr(VirtualServer): def __in...
dsajkl/reqiop
refs/heads/master
pavelib/quality.py
2
""" Check code quality using pep8, pylint, and diff_quality. """ from paver.easy import sh, task, cmdopts, needs, BuildFailure import os import re from .utils.envs import Env @task @needs('pavelib.prereqs.install_python_prereqs') @cmdopts([ ("system=", "s", "System to act on"), ("errors", "e", "Check for err...
aerophile/django
refs/heads/master
tests/sessions_tests/tests.py
8
import base64 import os import shutil import string import tempfile import unittest from datetime import timedelta from django.conf import settings from django.contrib.sessions.backends.cache import SessionStore as CacheSession from django.contrib.sessions.backends.cached_db import \ SessionStore as CacheDBSession...
Aloomaio/googleads-python-lib
refs/heads/master
examples/adwords/authentication/create_adwords_client_with_refresh_token.py
1
#!/usr/bin/env python # # Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
eXistenZNL/SickRage
refs/heads/master
lib/unidecode/x072.py
252
data = ( 'He ', # 0x00 'Lan ', # 0x01 'Biao ', # 0x02 'Rong ', # 0x03 'Li ', # 0x04 'Mo ', # 0x05 'Bao ', # 0x06 'Ruo ', # 0x07 'Lu ', # 0x08 'La ', # 0x09 'Ao ', # 0x0a 'Xun ', # 0x0b 'Kuang ', # 0x0c 'Shuo ', # 0x0d '[?] ', # 0x0e 'Li ', # 0x0f 'Lu ', # 0x10 'Jue ', ...
prefetchnta/questlab
refs/heads/master
bin/x64bin/python/36/Lib/email/headerregistry.py
1
"""Representing and manipulating email headers via custom objects. This module provides an implementation of the HeaderRegistry API. The implementation is designed to flexibly follow RFC5322 rules. Eventually HeaderRegistry will be a public API, but it isn't yet, and will probably change some before that happen...
1013553207/django
refs/heads/master
django/contrib/admin/templatetags/admin_urls.py
553
from django import template from django.contrib.admin.utils import quote from django.core.urlresolvers import Resolver404, get_script_prefix, resolve from django.utils.http import urlencode from django.utils.six.moves.urllib.parse import parse_qsl, urlparse, urlunparse register = template.Library() @register.filter ...
xianjunzhengbackup/Cloud-Native-Python
refs/heads/master
env/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/contrib/__init__.py
12133432
hinrek/Suvepraktika
refs/heads/Django-working
mysite/formats/et/__init__.py
12133432
david415/tahoe-lafs
refs/heads/master
src/allmydata/immutable/downloader/__init__.py
12133432
klahnakoski/ActiveData-ETL
refs/heads/dev
vendor/mo_math/vendor/__init__.py
12133432
liavkoren/djangoDev
refs/heads/master
django/conf/locale/es/__init__.py
12133432
niteoweb/libcloud
refs/heads/niteoweb_internal_release
docs/examples/dns/list_zone_records.py
64
from libcloud.dns.providers import get_driver from libcloud.dns.types import Provider CREDENTIALS_ZERIGO = ('email', 'api key') ZONE_ID = 'example.myzone.com' Cls = get_driver(Provider.ZERIGO) driver = Cls(*CREDENTIALS_ZERIGO) zone = driver.get_zone(zone_id=ZONE_ID) records = driver.list_records(zone=zone)
zachwick/linux
refs/heads/master
Documentation/target/tcm_mod_builder.py
215
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
MillerDix/NEChromeX
refs/heads/master
flaskTest/venv/lib/python2.7/site-packages/werkzeug/routing.py
87
# -*- coding: utf-8 -*- """ werkzeug.routing ~~~~~~~~~~~~~~~~ When it comes to combining multiple controller or view functions (however you want to call them) you need a dispatcher. A simple way would be applying regular expression tests on the ``PATH_INFO`` and calling registered callback fun...
tornadozou/tensorflow
refs/heads/master
tensorflow/contrib/rnn/__init__.py
34
# 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...
MyAOSP/external_chromium_org
refs/heads/kk-4.4
tools/generate_stubs/generate_stubs_unittest.py
69
#!/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. """Unittest for the generate_stubs.py. Since generate_stubs.py is a code generator, it is hard to do a very good test. Instead of...
silizium/ardupilot
refs/heads/master
mk/PX4/Tools/genmsg/test/test_genmsg_command_line.py
216
# Software License Agreement (BSD License) # # Copyright (c) 2011, Willow Garage, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above...
da1z/intellij-community
refs/heads/master
python/lib/Lib/encodings/zlib_codec.py
533
""" Python 'zlib_codec' Codec - zlib compression encoding Unlike most of the other codecs which target Unicode, this codec will return Python string objects for both encode and decode. Written by Marc-Andre Lemburg (mal@lemburg.com). """ import codecs import zlib # this codec needs the optional zlib modu...
kevclarx/ansible
refs/heads/devel
test/units/module_utils/basic/test_heuristic_log_sanitize.py
99
# -*- coding: utf-8 -*- # (c) 2015, Toshio Kuratomi <tkuratomi@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 # (a...
dezynetechnologies/odoo
refs/heads/8.0
addons/account/tests/test_search.py
225
from openerp.tests.common import TransactionCase class TestSearch(TransactionCase): """Tests for search on name_search (account.account) The name search on account.account is quite complexe, make sure we have all the correct results """ def setUp(self): super(TestSearch, self).setUp() ...
anryko/ansible
refs/heads/devel
lib/ansible/modules/network/aci/aci_bd.py
8
#!/usr/bin/python # -*- coding: utf-8 -*- # 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'], ...
LingxiaoJIA/gem5
refs/heads/master
src/arch/x86/isa/insts/simd64/floating_point/arithmetic/addition.py
91
# 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...
bhargav2408/kivy
refs/heads/master
kivy/core/clipboard/clipboard_xsel.py
36
''' Clipboard xsel: an implementation of the Clipboard using xsel command line tool. ''' __all__ = ('ClipboardXsel', ) from kivy.utils import platform from kivy.core.clipboard._clipboard_ext import ClipboardExternalBase if platform != 'linux': raise SystemError('unsupported platform for xsel clipboard') try: ...
dna2github/dna2sevord
refs/heads/main
computer/algorithm/py/disjointset.py
1
class DisjointSet(object): array = None parent = {} rank = {} def __init__(self, array=None): if array: self.build(array) def build(self, array): self.array = array[:] for i, v in enumerate(array): self.parent[v] = i self.rank[v] = 0 def find(self, val): ...
rychipman/mongo-python-driver
refs/heads/master
test/test_client.py
8
# Copyright 2013-2015 MongoDB, 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 writin...
takeshineshiro/django-cms
refs/heads/develop
cms/models/apphooks_reload.py
38
# -*- coding: utf-8 -*- from __future__ import unicode_literals import uuid from django.db import models class UrlconfRevision(models.Model): revision = models.CharField(max_length=255) class Meta: app_label = 'cms' def save(self, *args, **kwargs): """ Simply forces this model...
jazkarta/edx-platform
refs/heads/master
lms/djangoapps/survey/utils.py
182
""" Helper methods for Surveys """ from survey.models import SurveyForm, SurveyAnswer from courseware.access import has_access def is_survey_required_for_course(course_descriptor): """ Returns whether a Survey is required for this course """ # check to see that the Survey name has been defined in th...
lcpt/xc
refs/heads/master
verif/tests/materials/uniaxial/test_cable_material01.py
1
# -*- coding: utf-8 -*- # Test from Ansys manual # Reference: Strength of Material, Part I, Elementary Theory and Problems, pg. 26, problem 10 import xc_base import geom import xc from solution import predefined_solutions from model import predefined_spaces from materials import typical_materials __author__= "Luis C....
tersmitten/ansible
refs/heads/devel
test/integration/targets/get_url/files/testserver.py
251
import sys if __name__ == '__main__': if sys.version_info[0] >= 3: import http.server import socketserver PORT = int(sys.argv[1]) class Handler(http.server.SimpleHTTPRequestHandler): pass Handler.extensions_map['.json'] = 'application/json' httpd = sock...
centrumholdings/buildbot
refs/heads/master
buildbot/process/subunitlogobserver.py
1
# -*- test-case-name: buildbot.test.test_buildstep -*- from unittest import TestResult from buildbot.process import buildstep class DiscardStream: """A trivial thunk used to discard passthrough content.""" def write(self, bytes): pass class SubunitLogObserver(buildstep.LogLineObserver, TestResult):...
geekaia/edx-platform
refs/heads/master
common/djangoapps/cache_toolbox/__init__.py
261
""" :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 caching within Django projects. The tools are deliberately ...
schoolie/bokeh
refs/heads/master
sphinx/source/docs/user_guide/examples/charts_histogram_color.py
8
from bokeh.charts import Histogram, output_file, show from bokeh.sampledata.autompg import autompg as df p = Histogram(df, values='hp', color='navy', title="HP Distribution") output_file("histogram_color.html") show(p)
Zhongqilong/kbengine
refs/heads/master
kbe/src/lib/python/Lib/test/test_urllibnet.py
75
import unittest from test import support import contextlib import socket import urllib.request import sys import os import email.message import time support.requires('network') class URLTimeoutTest(unittest.TestCase): # XXX this test doesn't seem to test anything useful. TIMEOUT = 30.0 def setUp(self)...
bcornwellmott/erpnext
refs/heads/develop
erpnext/accounts/report/general_ledger/__init__.py
12133432
shenson/cobbler
refs/heads/master
cobbler/web/__init__.py
12133432
irudayarajisawa/django-cms
refs/heads/develop
cms/test_utils/fixtures/__init__.py
12133432
ahmadshahwan/cohorte-runtime
refs/heads/master
python/src/lib/python/unidecode/x073.py
252
data = ( 'Sha ', # 0x00 'Li ', # 0x01 'Han ', # 0x02 'Xian ', # 0x03 'Jing ', # 0x04 'Pai ', # 0x05 'Fei ', # 0x06 'Yao ', # 0x07 'Ba ', # 0x08 'Qi ', # 0x09 'Ni ', # 0x0a 'Biao ', # 0x0b 'Yin ', # 0x0c 'Lai ', # 0x0d 'Xi ', # 0x0e 'Jian ', # 0x0f 'Qiang ', # 0x10 'Kun...
sorl/django-mockups
refs/heads/master
mockups/tests/urls.py
2
# -*- coding: utf-8 -*- from django.conf.urls.defaults import * from django.contrib import admin from django.conf import settings from django.http import HttpResponse admin.autodiscover() def handle404(request): return HttpResponse('404') def handle500(request): return HttpResponse('500') handler404 = 'mock...
shuggiefisher/django-on-google-app-engine-base
refs/heads/master
django/contrib/gis/tests/relatedapp/models.py
274
from django.contrib.gis.db import models from django.contrib.localflavor.us.models import USStateField class Location(models.Model): point = models.PointField() objects = models.GeoManager() def __unicode__(self): return self.point.wkt class City(models.Model): name = models.CharField(max_length=50) ...
JingZhou0404/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/QueueStatusServer/config/logging.py
122
# Copyright (C) 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 conditions and the ...
GoogleCloudPlatform/mlops-on-gcp
refs/heads/master
workshops/guided-projects/solution_2/models/keras/model_test.py
1
# Lint as: python2, python3 # Copyright 2020 Google LLC. 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 req...
saurabh6790/omnit-app
refs/heads/master
patches/may_2013/repost_stock_for_no_posting_time.py
30
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals def execute(): import webnotes from stock.stock_ledger import update_entries_after res = webnotes.conn.sql("""select distinct item_code, warehou...