repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
mmorenobarm/mbed-os
refs/heads/master
tools/test/config_test/test01/test_data.py
38
# Test for configuration data defined in targets # A base target (B1) defines 3 configuration parameters (base1_1, base1_2 and base1_3) # A derived target (D1) inherits drom B1 and defines one configuration parameters (derived1 and derived2) and overrides base1_1 and base1_2 # Another base target (B2) defines its own c...
YzPaul3/h2o-3
refs/heads/master
h2o-py/tests/testdir_algos/rf/pyunit_fiftycatRF.py
8
from __future__ import print_function import sys sys.path.insert(1,"../../../") import h2o from tests import pyunit_utils from h2o.estimators.random_forest import H2ORandomForestEstimator def fiftycatRF(): # Training set has only 45 categories cat1 through cat45 #Log.info("Importing 50_cattest_train.csv data...\...
yencarnacion/jaikuengine
refs/heads/master
.google_appengine/lib/django-1.2/django/utils/translation/trans_null.py
65
# These are versions of the functions in django.utils.translation.trans_real # that don't actually do anything. This is purely for performance, so that # settings.USE_I18N = False can use this module rather than trans_real.py. import warnings from django.conf import settings from django.utils.encoding import force_uni...
messense/teambition-api
refs/heads/master
teambition/api/stages.py
3
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from optionaldict import optionaldict from teambition.api.base import TeambitionAPI class Stages(TeambitionAPI): def get(self, tasklist_id): """ 获取任务分组的阶段列表 详情请参考 http://docs.teambition.com/wiki/sta...
ptemplier/ansible
refs/heads/devel
lib/ansible/vars/reserved.py
51
# (c) 2017 Ansible By Red Hat # # 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 ...
huguesv/PTVS
refs/heads/master
Python/Product/Miniconda/Miniconda3-x64/Tools/scripts/diff.py
19
#!/usr/bin/env python3 """ Command line interface to difflib.py providing diffs in four formats: * ndiff: lists every line and highlights interline changes. * context: highlights clusters of changes in a before/after format. * unified: highlights clusters of changes in an inline format. * html: generates side...
obi-two/Rebelion
refs/heads/master
data/scripts/templates/object/draft_schematic/item/quest_item/shared_fs_medic_puzzle_heal_pack.py
2
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Intangible() result.template = "object/draft_schematic/item/quest_item/shared_fs_medic_puzzle_heal_pack.iff" resu...
wolfgang520/mongrel2
refs/heads/master
examples/python/mongrel2/tnetstrings.py
64
# Note this implementation is more strict than necessary to demonstrate # minimum restrictions on types allowed in dictionaries. def dump(data): if type(data) is long or type(data) is int: out = str(data) return '%d:%s#' % (len(out), out) elif type(data) is float: out = '%f' % data ...
xclxxl414/rqalpha
refs/heads/master
rqalpha/mod/rqalpha_mod_sys_analyser/mod.py
1
# -*- coding: utf-8 -*- # # Copyright 2017 Ricequant, 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 ...
mancoast/CPythonPyc_test
refs/heads/master
cpython/261_test_urllib.py
49
"""Regresssion tests for urllib""" import urllib import httplib import unittest from test import test_support import os import mimetools import tempfile import StringIO def hexescape(char): """Escape char as RFC 2396 specifies""" hex_repr = hex(ord(char))[2:].upper() if len(hex_repr) == 1: hex_rep...
larsks/cloud-init
refs/heads/master
tests/cloud_tests/testcases/modules/keys_to_console.py
3
# This file is part of cloud-init. See LICENSE file for license information. """cloud-init Integration Test Verify Script.""" from tests.cloud_tests.testcases import base class TestKeysToConsole(base.CloudTestCase): """Test proper keys are included and excluded to console.""" def test_excluded_keys(self): ...
AkihikoITOH/capybara
refs/heads/master
capybara/virtualenv/lib/python2.7/site-packages/wheel/decorator.py
627
# from Pyramid class reify(object): """Put the result of a method which uses this (non-data) descriptor decorator in the instance dict after the first call, effectively replacing the decorator with an instance variable. """ def __init__(self, wrapped): self.wrapped = wrapped self....
Beyond-Imagination/BlubBlub
refs/heads/master
RaspberryPI/django-env/lib/python3.4/site-packages/pip/_vendor/appdirs.py
327
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2005-2010 ActiveState Software Inc. # Copyright (c) 2013 Eddy Petrișor """Utilities for determining application-specific dirs. See <http://github.com/ActiveState/appdirs> for details and usage. """ # Dev Notes: # - MSDN on where to store app data files: # ...
nathanaevitas/odoo
refs/heads/master
openerp/addons/report_webkit/header.py
342
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com) # All Right Reserved # # Author : Nicolas Bessi (Camptocamp) # # WARNING: This program as such is intended to be used by professional # programmers who...
grundprinzip/Impala
refs/heads/cdh5-trunk
thirdparty/thrift-0.9.0/contrib/zeromq/test-client.py
108
#!/usr/bin/env python import sys import time import zmq import TZmqClient import thrift.protocol.TBinaryProtocol import storage.ttypes import storage.Storage def main(args): endpoint = "tcp://127.0.0.1:9090" socktype = zmq.REQ incr = 0 if len(args) > 1: incr = int(args[1]) if incr: socktype = zm...
weleen/mxnet
refs/heads/master
tests/python/common/models.py
54
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
ltilve/chromium
refs/heads/igalia-sidebar
net/tools/testserver/backoff_server.py
189
#!/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. """This is a simple HTTP server for manually testing exponential back-off functionality in Chrome. """ import BaseHTTPServer impo...
mahmutf/dupeguru
refs/heads/master
qtlib/about_box.py
2
# Created By: Virgil Dupras # Created On: 2009-05-09 # Copyright 2015 Hardcoded Software (http://www.hardcoded.net) # # This software is licensed under the "GPLv3" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.gnu.org/licenses/gpl-...
tempbottle/kbengine
refs/heads/master
kbe/src/lib/python/Lib/test/test_grp.py
88
"""Test script for the grp module.""" import unittest from test import support grp = support.import_module('grp') class GroupDatabaseTestCase(unittest.TestCase): def check_value(self, value): # check that a grp tuple has the entries and # attributes promised by the docs self.assertEqual(...
mpetyx/palmdrop
refs/heads/master
venv/lib/python2.7/site-packages/cms/plugins/teaser/migrations/0001_initial.py
11
# -*- 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 'Teaser' db.create_table('cmsplugin_teaser', ( ('cmsplugin_ptr', self.gf('django....
reinout/django
refs/heads/master
django/conf/locale/vi/formats.py
65
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = r'\N\gà\y d \t\há\n\g n \nă\m Y' TIME_FORMAT = 'H:i' DATETIME_FORMAT = r'H:i \N\gà\y d \t\há\n\g n \n...
dwadler/QGIS
refs/heads/master
tests/src/python/test_qgsprojectbadlayers.py
8
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsProject bad layers handling. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later...
CUCWD/edx-platform
refs/heads/master
openedx/core/djangoapps/theming/middleware.py
22
""" Middleware for theming app Note: This middleware depends on "django_sites_extensions" app So it must be added to INSTALLED_APPS in django settings files. """ from django.conf import settings from .models import SiteTheme from .views import get_user_preview_site_theme class CurrentSiteThemeMiddleware(obj...
fhaoquan/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/multiprocessing/connection.py
69
# # A higher level module for using sockets (or Windows named pipes) # # multiprocessing/connection.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # __all__ = [ 'Client', 'Listener', 'Pipe', 'wait' ] import io import os import sys import socket import struct import time imp...
talipovm/terse
refs/heads/master
terse/ReportGenerator/IRC.py
1
from ReportGenerator.Geom import Geom from ReportGenerator.Top_ReportGenerator import Top_ReportGenerator from ReportComponents.WebFile import WebFile from ReportGenerator.Charges import Charges from ReportComponents.Plot import Plot import logging log = logging.getLogger(__name__) class IRC(Top_ReportGenerator): ...
jaap-karssenberg/zim-desktop-wiki
refs/heads/master
zim/inc/arithmetic.py
1
# Copyright (c) 2010, 2011 Patricio Paez <pp@pp.com.mx> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # ...
Lujeni/ansible
refs/heads/devel
lib/ansible/modules/network/fortios/fortios_system_ips_urlfilter_dns.py
13
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lic...
tbenthompson/tectosaur
refs/heads/master
tectosaur/qd/__init__.py
1
siay = 60 * 60 * 24 * 365.25 from .plot_config import configure, configure_meade03 from .model_helpers import print_length_scales, init_creep from .full_model import FullspaceModel from .topo_model import TopoModel from .tde_model import TDEModel from .integrator import Integrator from .data import MonolithicDataSaver...
jkadlec/knot-dns-zoneapi
refs/heads/master
tests-extra/tests/zone/timers/test.py
1
#!/usr/bin/env python3 '''Test for SOA events and planning thereof''' from dnstest.test import Test import random EXPIRE_SLEEP = 17 RETRY_SLEEP = 10 START_SLEEP = 5 def restart_server(s): s.stop() s.start() def set_master(t, master, slave, zone): t.link(zone, master) def set_slave(t, master, slave, zo...
jrick/bitcoin
refs/heads/master
qa/rpc-tests/walletbackup.py
7
#!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ Exercise the wallet backup code. Ported from walletbackup.sh. Test case is: 4 nodes. 1 2 and 3 send tran...
altendky/canmatrix
refs/heads/master
src/canmatrix/join.py
2
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import typing from builtins import * import canmatrix import canmatrix.formats def list_pgn(db): # type: (canmatrix.CanMatrix) -> typing.Tuple[typing.List[int], typing.List[canmatrix.ArbitrationId]] """ Get all PGN ...
imaculate/scikit-learn
refs/heads/master
sklearn/covariance/__init__.py
389
""" The :mod:`sklearn.covariance` module includes methods and algorithms to robustly estimate the covariance of features given a set of points. The precision matrix defined as the inverse of the covariance is also estimated. Covariance estimation is closely related to the theory of Gaussian Graphical Models. """ from ...
kaiserroll14/301finalproject
refs/heads/master
main/osx/main/requests/packages/urllib3/util/__init__.py
1011
# For backwards compatibility, provide imports that used to be here. from .connection import is_connection_dropped from .request import make_headers from .response import is_fp_closed from .ssl_ import ( SSLContext, HAS_SNI, assert_fingerprint, resolve_cert_reqs, resolve_ssl_version, ssl_wrap_so...
raysguy/HTPC-Manager
refs/heads/rg-master
libs/pySMART/__init__.py
5
#Copyright (C) 2014 Marc Herndon # #This program is free software; you can redistribute it and/or #modify it under the terms of the GNU General Public License, #version 2, as published by the Free Software Foundation. # #This program is distributed in the hope that it will be useful, #but WITHOUT ANY WARRANTY; without ...
TheWylieStCoyote/gnuradio
refs/heads/master
gr-digital/python/digital/qa_diff_phasor_cc.py
4
#!/usr/bin/env python # # Copyright 2004,2007,2010,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # from gnuradio import gr, gr_unittest, digital, blocks class test_diff_phasor(gr_unittest.TestCase): def setUp(self): self.tb = gr.to...
biocore/qiime
refs/heads/master
scripts/truncate_reverse_primer.py
15
#!/usr/bin/env python # File created February 29, 2012 from __future__ import division __author__ = "William Walters" __copyright__ = "Copyright 2011, The QIIME Project" __credits__ = ["William Walters", "Jose Antonio Navas Molina"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "William Walters" __ema...
inovtec-solutions/OpenERP
refs/heads/branch_openerp
openerp/report/misc.py
458
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
yfsoftcom/crawler
refs/heads/master
strategy/strategy.py
1
class Strategy(object): def __init__(self): pass def get_parser(self, url): return None def _filter(self, input): return input def validate(self, dataset): return filter(self._filter ,dataset)
Menooker/gem5_pcm
refs/heads/master
src/cpu/o3/FUPool.py
69
# Copyright (c) 2006-2007 The Regents of The University of Michigan # 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 ...
yjmade/odoo
refs/heads/8.0
addons/hr_payroll_account/__init__.py
433
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # ...
usmschuck/canvas
refs/heads/custom
vendor/bundle/ruby/1.9.1/gems/pygments.rb-0.5.2/vendor/pygments-main/tests/test_clexer.py
26
# -*- coding: utf-8 -*- """ Basic CLexer Test ~~~~~~~~~~~~~~~~~ :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import unittest import os from pygments.token import Text, Number from pygments.lexers import CLexer class CLexerTest(unitte...
rhdedgar/openshift-tools
refs/heads/stg
openshift/installer/vendored/openshift-ansible-3.4.12-1/roles/openshift_facts/library/openshift_facts.py
9
#!/usr/bin/python # pylint: disable=too-many-lines # -*- coding: utf-8 -*- # vim: expandtab:tabstop=4:shiftwidth=4 # Reason: Disable pylint too-many-lines because we don't want to split up this file. # Status: Permanently disabled to keep this module as self-contained as possible. """Ansible module for retrieving and ...
cchurch/ansible
refs/heads/devel
lib/ansible/modules/cloud/google/gcp_spanner_database.py
3
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
diegoguimaraes/django
refs/heads/master
tests/commands_sql/tests.py
10
from __future__ import unicode_literals import re import unittest from django.apps import apps from django.core.management.color import no_style from django.core.management.sql import (sql_create, sql_delete, sql_indexes, sql_destroy_indexes, sql_all) from django.db import connections, DEFAULT_DB_ALIAS, router fr...
dsprenkels/servo
refs/heads/master
components/script/dom/bindings/codegen/parser/tests/test_dictionary.py
121
def WebIDLTest(parser, harness): parser.parse(""" dictionary Dict2 : Dict1 { long child = 5; Dict1 aaandAnother; }; dictionary Dict1 { long parent; double otherParent; }; """) results = parser.finish() dict1 = results[1]; dict2 = results[0]; ...
RemoteConnectionManager/RCM_spack_deploy
refs/heads/dev
lib/utils/external/PyYAML-3.13/lib3/yaml/__init__.py
4
from .error import * from .tokens import * from .events import * from .nodes import * from .loader import * from .dumper import * __version__ = '3.13' try: from .cyaml import * __with_libyaml__ = True except ImportError: __with_libyaml__ = False import io def scan(stream, Loader=Loader): """ S...
vipul-sharma20/oh-mainline
refs/heads/master
vendor/packages/gdata/src/atom/auth.py
297
#!/usr/bin/env python # # Copyright (C) 2009 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...
whitehorse-io/encarnia
refs/heads/master
pyenv/lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/base.py
442
from django.db.backends.oracle.base import \ DatabaseWrapper as OracleDatabaseWrapper from .features import DatabaseFeatures from .introspection import OracleIntrospection from .operations import OracleOperations from .schema import OracleGISSchemaEditor class DatabaseWrapper(OracleDatabaseWrapper): SchemaEd...
b-daniels/apitools
refs/heads/master
apitools/base/protorpclite/message_types.py
38
#!/usr/bin/env python # # Copyright 2010 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...
ekkleesia3/jaikuengine
refs/heads/master
common/management/commands/__init__.py
1073
# Copyright 2009 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 writing, ...
uberamd/NGECore2
refs/heads/master
scripts/object/tangible/event_perk/nboo_imprv_flagpole_s01.py
85615
import sys def setup(core, object): return
agry/NGECore2
refs/heads/master
scripts/object/static/item/item_hoth_camo_net_03.py
85615
import sys def setup(core, object): return
dwaynebailey/poedit
refs/heads/master
deps/boost/libs/mpl/doc/src/docutils/tools/rst2htmlrefdoc.py
59
#!/usr/bin/env python # Copyright Aleksey Gurtovoy 2004-2009 # # Distributed under 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) import locale try: locale.setlocale(locale.LC_ALL, '') except: pass from docutils.parsers....
ptoraskar/django
refs/heads/master
tests/template_tests/syntax_tests/test_for.py
154
from django.template import TemplateSyntaxError from django.test import SimpleTestCase, ignore_warnings from django.utils.deprecation import RemovedInDjango110Warning from ..utils import setup class ForTagTests(SimpleTestCase): libraries = {'custom': 'template_tests.templatetags.custom'} @setup({'for-tag01'...
akornatskyy/sample-blog-api
refs/heads/master
src/posts/__init__.py
11
""" """ __version_info__ = (0, 1, 0, 0) __version__ = '.'.join(map(str, __version_info__))
armenzg/build-mozharness
refs/heads/master
configs/builds/releng_sub_mac_configs/64_debug.py
2
import os MOZ_OBJDIR = 'obj-firefox' config = { 'default_actions': [ 'clobber', 'clone-tools', 'checkout-sources', # 'setup-mock', 'build', 'upload-files', 'sendchange', 'check-test', # 'generate-build-stats', 'update', # decided by ...
noam09/deluge-telegramer
refs/heads/master
telegramer/include/future/types/newlist.py
82
""" A list subclass for Python 2 that behaves like Python 3's list. The primary difference is that lists have a .copy() method in Py3. Example use: >>> from builtins import list >>> l1 = list() # instead of {} for an empty list >>> l1.append('hello') >>> l2 = l1.copy() """ import sys import copy from future.ut...
Warbo/bugseverywhere
refs/heads/master
libbe/util/id.py
5
# Copyright (C) 2008-2012 Chris Ball <cjb@laptop.org> # Gianluca Montecchi <gian@grys.it> # W. Trevor King <wking@tremily.us> # # This file is part of Bugs Everywhere. # # Bugs Everywhere is free software: you can redistribute it and/or modify it # under the terms of the ...
shaoweizhang/mysite
refs/heads/master
demo/forms.py
3
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django import forms from django.forms.formsets import BaseFormSet, formset_factory from bootstrap3.tests import TestForm RADIO_CHOICES = ( ('1', 'Radio 1'), ('2', 'Radio 2'), ) MEDIA_CHOICES = ( ('Audio', ( ('vinyl', 'Vinyl'),...
MichaelNedzelsky/intellij-community
refs/heads/master
python/testData/codeInsight/controlflow/try.py
83
import sys try: f = open('myfile.txt') s = f.readline() i = int(s.strip()) except IOError as (errno, strerror): print "I/O error({0}): {1}".format(errno, strerror) except ValueError: print "Could not convert data to an integer." except: print "Unexpected error:", sys.exc_info()[0] raise
poojavade/Genomics_Docker
refs/heads/master
Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/ipython-2.2.0-py2.7.egg/IPython/html/auth/logout.py
14
"""Tornado handlers for logging out of the notebook. Authors: * Brian Granger """ #----------------------------------------------------------------------------- # Copyright (C) 2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distri...
codesparkle/youtube-dl
refs/heads/master
youtube_dl/extractor/awaan.py
68
# coding: utf-8 from __future__ import unicode_literals import re import base64 from .common import InfoExtractor from ..compat import ( compat_urllib_parse_urlencode, compat_str, ) from ..utils import ( int_or_none, parse_iso8601, smuggle_url, unsmuggle_url, urlencode_postdata, ) class ...
basicthinker/Quatrain-MapReduce
refs/heads/master
src/contrib/hod/hodlib/Schedulers/__init__.py
1638
#Licensed to the Apache Software Foundation (ASF) under one #or more contributor license agreements. See the NOTICE file #distributed with this work for additional information #regarding copyright ownership. The ASF licenses this file #to you under the Apache License, Version 2.0 (the #"License"); you may not use thi...
sankhesh/VTK
refs/heads/master
ThirdParty/Twisted/twisted/test/test_rebuild.py
41
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. import sys, os import types from twisted.trial import unittest from twisted.python import rebuild import crash_test_dummy f = crash_test_dummy.foo class Foo: pass class Bar(Foo): pass class Baz(object): pass class Buz(Bar, Baz): pass class Ha...
radix/fxhttp
refs/heads/master
fxhttp/treq_perf.py
1
"""Performer for fxhttp requests using ``treq``.""" from functools import partial from effect import TypeDispatcher import treq from txeffect import deferred_performer from fxhttp._intent import Request, Response @deferred_performer def perform_with_treq(reactor, dispatcher, intent): """Perform an fxhttp Req...
angvp/gord
refs/heads/master
gord/mockwin32.py
3
#!/usr/bin/python2.4 # # Copyright 2010 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 ...
dagwieers/ansible
refs/heads/devel
lib/ansible/modules/notification/jabber.py
10
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, Brian Coca <bcoca@ansible.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.1', ...
337529542/dsf-utils
refs/heads/master
dsf_armature.py
2
import operator, math, logging log = logging.getLogger ('dsf-arm') def get_channel_value (channel): """retrieve the initial value from a channel. """ return float (channel['value']) def get_vchannel_value (channels, names, default = None): """get the value tuple from a list of channels with the given names. ...
johannesgiorgis/deep_learning
refs/heads/master
language-translation/problem_unittests.py
98
import numpy as np import tensorflow as tf import itertools import collections import helper def _print_success_message(): print('Tests Passed') def test_text_to_ids(text_to_ids): test_source_text = 'new jersey is sometimes quiet during autumn , and it is snowy in april .\nthe united states is usually chill...
t794104/ansible
refs/heads/devel
test/units/modules/network/dellos6/test_dellos6_command.py
68
# (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is dis...
frnhr/django-cms
refs/heads/develop
cms/south_migrations/0063_auto__chg_field_staticplaceholder_site.py
63
# -*- 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): # Changing field 'StaticPlaceholder.site' db.alter_column(u'cms_staticpl...
4rr4y/arytoolkit
refs/heads/master
arytoolkit/algorithm/sort/quicksort.py
1
from .sortutil import sort_compare_pass import random def get_pivot_index(lower_bound, upper_bound): return random.randint(lower_bound, upper_bound) def qs(lst, left_index, right_index, cmp, debug): if right_index - left_index <= 0: return pivot = lst[get_pivot_index(left_index, right_index)] ...
balanced/PyXB
refs/heads/master
pyxb/utils/unicode.py
3
# -*- coding: utf-8 -*- # Copyright 2009-2013, Peter A. Bigot # # 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...
certik/hermes2d
refs/heads/master
doc/src/img/tutorial-10/plot_graph_cpu.py
51
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_h1.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1)") data = numpy.loadtxt("c...
MartynShaw/audacity
refs/heads/master
lib-src/lv2/sord/waflib/TaskGen.py
177
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import copy,re,os from waflib import Task,Utils,Logs,Errors,ConfigSet,Node feats=Utils.defaultdict(set) class task_gen(object): mappings={} prec=Utils.defaultdict(list) def...
jigarmistry/sofi
refs/heads/master
test/div_test.py
2
from sofi.ui import Div def test_basic(): assert(str(Div()) == "<div></div>") def test_text(): assert(str(Div("text")) == "<div>text</div>") def test_custom_class_ident_style_and_attrs(): assert(str(Div("text", cl='abclass', ident='123', style="font-size:0.9em;", attrs={"data-test": 'abc'})) =...
webgeodatavore/django
refs/heads/master
tests/template_tests/syntax_tests/test_with.py
391
from django.template import TemplateSyntaxError from django.test import SimpleTestCase from ..utils import setup class WithTagTests(SimpleTestCase): @setup({'with01': '{% with key=dict.key %}{{ key }}{% endwith %}'}) def test_with01(self): output = self.engine.render_to_string('with01', {'dict': {'k...
kalahbrown/HueBigSQL
refs/heads/master
desktop/core/ext-py/Django-1.6.10/tests/urlpatterns_reverse/urlconf_outer.py
150
from __future__ import absolute_import from django.conf.urls import patterns, url, include from . import urlconf_inner urlpatterns = patterns('', url(r'^test/me/$', urlconf_inner.inner_view, name='outer'), url(r'^inner_urlconf/', include(urlconf_inner.__name__)) )
akhilari7/pa-dude
refs/heads/master
lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/_collections.py
201
from __future__ import absolute_import from collections import Mapping, MutableMapping try: from threading import RLock except ImportError: # Platform-specific: No threads available class RLock: def __enter__(self): pass def __exit__(self, exc_type, exc_value, traceback): ...
51reboot/actual_09_homework
refs/heads/master
11/jcui/cmdb/users/modules/modules.py
1
#encoding:utf-8 import json import string from random import choice from functools import wraps import time import datetime import paramiko from dbutils import MySQLConnection as SQL from dbutils import md5_str from flask import session,redirect class User(object): def __init__(self,username,password,age,telph...
willfurnass/pyhyd
refs/heads/master
doc/source/conf.py
1
# -*- coding: utf-8 -*- # # pyhyd documentation build configuration file, created by # sphinx-quickstart on Mon Apr 13 15:56:28 2015. # # 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. # # All...
hanul93/kicomav
refs/heads/master
Engine/plugins/xz.py
1
# -*- coding:utf-8 -*- # Author: Kei Choi(hanul93@gmail.com) import kernel try: from backports import lzma module_ready = True except ImportError: module_ready = False # ------------------------------------------------------------------------- # KavMain 클래스 # ------------------------------------------...
SchwarzM/ocfs2-simple-provisioner
refs/heads/master
vendor/k8s.io/kubernetes/cluster/juju/layers/kubernetes-master/lib/charms/kubernetes/flagmanager.py
182
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 appli...
cloudify-cosmo/cloudify-host-pool-service
refs/heads/master
examples/scripts/configure.py
1
# ####### # Copyright (c) 2016 GigaSpaces Technologies Ltd. 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 # # Unles...
kaedroho/django
refs/heads/master
django/core/management/base.py
1
""" Base classes for writing management commands (named commands which can be executed through ``django-admin`` or ``manage.py``). """ import os import sys from argparse import ArgumentParser, HelpFormatter from io import TextIOBase import django from django.core import checks from django.core.exceptions import Improp...
Big-B702/python-for-android
refs/heads/master
python-modules/twisted/twisted/test/test_iutils.py
61
# Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. """ Test running processes with the APIs in L{twisted.internet.utils}. """ import warnings, os, stat, sys, signal from twisted.python.runtime import platform from twisted.trial import unittest from twisted.internet import error, reacto...
stankovski/AutoRest
refs/heads/master
AutoRest/Generators/Python/Python.Tests/AcceptanceTests/complex_tests.py
2
# -------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All rights reserved. # # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the ""Software""),...
wdv4758h/ZipPy
refs/heads/master
lib-python/3/test/test_ioctl.py
87
import array import unittest from test.support import run_unittest, import_module, get_attribute import os, struct fcntl = import_module('fcntl') termios = import_module('termios') get_attribute(termios, 'TIOCGPGRP') #Can't run tests without this feature try: tty = open("/dev/tty", "rb") except IOError: raise ...
odooindia/odoo
refs/heads/master
addons/mrp_byproduct/mrp_byproduct.py
53
# -*- 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...
CentreForCorpusResearch/clic
refs/heads/develop
clic/web/migrations/env.py
185
from __future__ import with_statement from alembic import context from sqlalchemy import engine_from_config, pool from logging.config import fileConfig # this is the Alembic Config object, which provides # access to the values within the .ini file in use. config = context.config # Interpret the config file for Python...
kawamon/hue
refs/heads/master
desktop/core/ext-py/dnspython-1.15.0/dns/opcode.py
9
# 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 "...
ChenJunor/hue
refs/heads/master
desktop/core/ext-py/tablib-0.10.0/tablib/packages/odf/xforms.py
96
# -*- coding: utf-8 -*- # Copyright (C) 2006-2007 Søren Roug, European Environment Agency # # This library 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 2.1 of the License, or (at you...
varshadyavaiah/RED-with-In-and-Out-RIO-queue-discipline
refs/heads/master
src/aodv/bindings/modulegen__gcc_LP64.py
14
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
BT-rmartin/odoo
refs/heads/BT_2900
addons/product_extended/__openerp__.py
295
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2011 OpenERP S.A. (<http://www.openerp.com>). # # This program is free software: you can redistribute i...
cyenyxe/opencga
refs/heads/master
opencga-cloud/opencga-daemon.py
2
#!/usr/bin/python -u import sys, time, os, commands, datetime, xml.dom.minidom as xml from pymongo import MongoClient from seth import Daemon INTERVAL = 3 OPENCGA_ACCOUNTS = "/httpd/bioinfo/opencga/accounts" #Mongo configuration mongoHost = "webmaster" mongoPort = 27017 mongoDatabase = "opencga" mongoCollection = "a...
nacc/autotest
refs/heads/master
client/tests/libvirt/tests/virsh_migrate.py
2
import logging, time from autotest.client.shared import error def run_virsh_migrate(test, params, env): """ Test virsh migrate command. """ def check_vm_state(vm, state): """ Return True if vm is in the correct state. """ actual_state = vm.state() if cmp(actual_...
MartinHjelmare/home-assistant
refs/heads/dev
homeassistant/components/homekit/type_fans.py
10
"""Class to hold all light accessories.""" import logging from pyhap.const import CATEGORY_FAN from homeassistant.components.fan import ( ATTR_DIRECTION, ATTR_OSCILLATING, ATTR_SPEED, ATTR_SPEED_LIST, DIRECTION_FORWARD, DIRECTION_REVERSE, DOMAIN, SERVICE_OSCILLATE, SERVICE_SET_DIRECTION, SERVICE_SET_SPEED...
minlexx/pyevemon
refs/heads/master
esi_client/models/get_characters_character_id_bookmarks_item.py
1
# coding: utf-8 """ EVE Swagger Interface An OpenAPI for EVE Online OpenAPI spec version: 0.4.6 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class GetCharactersCharacterIdBookmarksItem(object): """ ...
Kmayankkr/robocomp
refs/heads/highlyunstable
tools/rcdns/src/rcdns.py
2
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2015 by YOUR NAME HERE # # This file is part of RoboComp # # RoboComp 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...
neutrons/FastGR
refs/heads/master
addie/initialization/widgets/main_tab.py
1
from qtpy.QtWidgets import QVBoxLayout import os from addie.utilities.general import get_ucams from mantidqt.widgets.jupyterconsole import InProcessJupyterConsole IPYTHON_STARTUP_CODE = '''import numpy as np from mantid.simpleapi import * ''' def run(main_window=None): # frame_dockWidget_ipython temp_layo...