repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
ntt-sic/glance | refs/heads/master | glance/openstack/common/excutils.py | 5 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation.
# Copyright 2012, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http:/... |
diegoguimaraes/django | refs/heads/master | tests/migrations/test_migrations_run_before/0003_third.py | 427 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
"""
This is a wee bit crazy, but it's just to show that run_before works.
"""
dependencies = [
("migrations", "0001_initial"),
]
run_before... |
cosminbasca/rdftools | refs/heads/master | rdftools/tools/base.py | 1 | #
# author: Cosmin Basca
#
# Copyright 2010 University of Zurich
#
# 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 a... |
UCL-CS35/incdb-poc | refs/heads/master | venv/share/doc/networkx-1.11/examples/drawing/weighted_graph.py | 17 | #!/usr/bin/env python
"""
An example using Graph as a weighted network.
"""
# Author: Aric Hagberg (hagberg@lanl.gov)
try:
import matplotlib.pyplot as plt
except:
raise
import networkx as nx
G=nx.Graph()
G.add_edge('a','b',weight=0.6)
G.add_edge('a','c',weight=0.2)
G.add_edge('c','d',weight=0.1)
G.add_edge('... |
Jay-Jay-D/LeanSTP | refs/heads/master | Algorithm.Python/UncorrelatedUniverseSelectionFrameworkAlgorithm.py | 3 | # QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
#
# 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 Licen... |
doomsterinc/odoo | refs/heads/8.0 | addons/website_forum_doc/controllers/__init__.py | 4497 | # -*- coding: utf-8 -*-
import main
|
nathanaevitas/odoo | refs/heads/master | openerp/addons/association/__openerp__.py | 260 | # -*- 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... |
carvalhomb/tsmells | refs/heads/master | guess/src/Lib/encodings/iso8859_13.py | 2 | """ Python Character Mapping Codec generated from '8859-13.TXT' with gencodec.py.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
(c) Copyright 2000 Guido van Rossum.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode... |
mglukhikh/intellij-community | refs/heads/master | python/testData/quickFixes/PyAddImportQuickFixTest/combineFromImportsForReferencesInTypeComment/main_after.py | 21 | from typing import List, Set
xs = [] # type: List
ys = set() # type: Set
|
evanscottgray/ryu | refs/heads/master | doc/source/quantumclient/v2_0/client.py | 94 | """
dummy module.
"""
|
cattleprod/samsung-kernel-gt-i9100 | refs/heads/GT-I9100 | external/webkit/WebKitTools/pywebsocket/test/mock.py | 3 | # Copyright 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 of conditions and the f... |
tanmaykm/edx-platform | refs/heads/master | lms/djangoapps/courseware/tests/test_favicon.py | 17 | from django.test import TestCase
from django.test.utils import override_settings
from nose.plugins.attrib import attr
from util.testing import UrlResetMixin
@attr(shard=1)
class FaviconTestCase(UrlResetMixin, TestCase):
"""
Tests of the courseware favicon.
"""
def test_favicon_redirect(self):
... |
feilalala/1omooc2py | refs/heads/master | _src/om2pyItem/scaffold/3party/__init__.py | 45382 | |
havencruise/emberjam | refs/heads/master | emberjam/emberjam/settings/log.py | 2 | import os
SITE_NAME = os.environ['DJANGO_SITE_NAME']
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format': '[%(levelname)s] {%(asctime)s %(module)s.%(funcName)s() @%(filename)s:%(lineno)d %(process)d %(thread)d}: %(message)s'
},
... |
h3llrais3r/SickRage | refs/heads/master | lib/pyasn1/debug.py | 185 | import sys
from pyasn1.compat.octets import octs2ints
from pyasn1 import error
from pyasn1 import __version__
flagNone = 0x0000
flagEncoder = 0x0001
flagDecoder = 0x0002
flagAll = 0xffff
flagMap = {
'encoder': flagEncoder,
'decoder': flagDecoder,
'all': flagAll
}
class Debug:
defaultPr... |
rellla/xbmca10 | refs/heads/stage/Frodo | lib/gtest/test/gtest_catch_exceptions_test.py | 403 | #!/usr/bin/env python
#
# Copyright 2010 Google Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list o... |
GoogolplexCoin/GoogolPlexCoin | refs/heads/master | share/qt/extract_strings_qt.py | 2945 | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
they can be picked up by Qt linguist.
'''
from subprocess import Popen, PIPE
import glob
import operator
OUT_CPP="src/qt/bitcoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' format produced by x... |
BaladiDogGames/baladidoggames.github.io | refs/heads/master | mingw/bin/lib/locale.py | 38 | """ Locale support.
The module provides low-level access to the C lib's locale APIs
and adds high level number formatting APIs as well as a locale
aliasing engine to complement these.
The aliasing engine includes support for many commonly used locale
names and maps them to values suitable for pass... |
Anaethelion/django-mapentity | refs/heads/master | mapentity/signals.py | 2 | from django import dispatch
post_register = dispatch.Signal(providing_args=["app_label", "model"])
|
xujun10110/pth-toolkit | refs/heads/master | lib/python2.7/site-packages/samba/getopt.py | 19 | # Samba-specific bits for optparse
# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option... |
interfect/cjdns | refs/heads/master | node_build/dependencies/libuv/build/gyp/tools/pretty_sln.py | 1831 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Prints the information in a sln file in a diffable way.
It first outputs each projects in alphabetical order with their
dependenci... |
supertom/ansible | refs/heads/devel | lib/ansible/plugins/callback/logentries.py | 69 | """ (c) 2015, Logentries.com, Jimmy Tang <jimmy.tang@logentries.com>
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your o... |
syrusakbary/promise | refs/heads/master | tests/utils.py | 2 | def assert_exception(exception, expected_exception_cls, expected_message):
assert isinstance(exception, expected_exception_cls)
assert str(exception) == expected_message
|
Griffon26/scrumboard | refs/heads/master | scrumboardtracker/boardreader/readboard.py | 2 | #!/usr/bin/env python2
# Copyright 2014-2016 Maurice van der Pot <griffon26@kfk4ever.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option... |
neilLasrado/erpnext | refs/heads/develop | erpnext/utilities/__init__.py | 11 | ## temp utility
from __future__ import print_function, unicode_literals
import frappe
from erpnext.utilities.activation import get_level
from frappe.utils import cstr
def update_doctypes():
for d in frappe.db.sql("""select df.parent, df.fieldname
from tabDocField df, tabDocType dt where df.fieldname
like "%descri... |
MypaceEngine/ifttt-line | refs/heads/master | libs/requests/packages/urllib3/util/url.py | 713 | from __future__ import absolute_import
from collections import namedtuple
from ..exceptions import LocationParseError
url_attrs = ['scheme', 'auth', 'host', 'port', 'path', 'query', 'fragment']
class Url(namedtuple('Url', url_attrs)):
"""
Datastructure for representing an HTTP URL. Used as a return value f... |
Azure/azure-sdk-for-python | refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline | sdk/baremetalinfrastructure/azure-mgmt-baremetalinfrastructure/azure/mgmt/baremetalinfrastructure/models/__init__.py | 1 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
bobthekingofegypt/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pytest/testing/test_pytester.py | 203 | import pytest
import os
from _pytest.pytester import HookRecorder
from _pytest.config import PytestPluginManager
from _pytest.main import EXIT_OK, EXIT_TESTSFAILED
def test_make_hook_recorder(testdir):
item = testdir.getitem("def test_func(): pass")
recorder = testdir.make_hook_recorder(item.config.pluginmana... |
KaranToor/MA450 | refs/heads/master | google-cloud-sdk/.install/.backup/platform/gsutil/third_party/pyasn1/pyasn1/codec/cer/decoder.py | 261 | # CER decoder
from pyasn1.type import univ
from pyasn1.codec.ber import decoder
from pyasn1.compat.octets import oct2int
from pyasn1 import error
class BooleanDecoder(decoder.AbstractSimpleDecoder):
protoComponent = univ.Boolean(0)
def valueDecoder(self, fullSubstrate, substrate, asn1Spec, tagSet, length,
... |
agramian/PythonExternalProgramTestFramework | refs/heads/master | reportlab/pdfgen/__init__.py | 37 | #Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/pdfgen/__init__.py
__version__=''' $Id$ '''
__doc__='''Defines a high-level Canvas interface for creating PDF files'''
|
plotly/plotly.py | refs/heads/master | packages/python/plotly/plotly/validators/treemap/marker/colorbar/_bgcolor.py | 1 | import _plotly_utils.basevalidators
class BgcolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="bgcolor", parent_name="treemap.marker.colorbar", **kwargs
):
super(BgcolorValidator, self).__init__(
plotly_name=plotly_name,
parent... |
zulip/django-guardian | refs/heads/master | guardian/tests/conf.py | 43 | from __future__ import unicode_literals
import os
from guardian.utils import abspath
from django.conf import settings
from django.conf import UserSettingsHolder
from django.utils.functional import wraps
THIS = abspath(os.path.dirname(__file__))
TEST_TEMPLATES_DIR = abspath(THIS, 'templates')
TEST_SETTINGS = dict(
... |
yrizk/django-blog | refs/heads/master | blogvenv/lib/python3.4/site-packages/django/conf/locale/zh_Hans/formats.py | 634 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'Y年n月j日' # 2016年9月5... |
Nekroze/librarian | refs/heads/master | librarian/card.py | 1 | """Generic Card Class."""
__author__ = 'Taylor "Nekroze" Lawson'
__email__ = 'nekroze@eturnilnetwork.com'
from six import text_type
class Card(object):
"""
The card stores general information about the card.
* code: the unique identifier for this card.
* name: name of this card to be displayed.
... |
anistark/mozillians | refs/heads/master | vendor-local/lib/python/unidecode/x0b6.py | 253 | data = (
'ddyels', # 0x00
'ddyelt', # 0x01
'ddyelp', # 0x02
'ddyelh', # 0x03
'ddyem', # 0x04
'ddyeb', # 0x05
'ddyebs', # 0x06
'ddyes', # 0x07
'ddyess', # 0x08
'ddyeng', # 0x09
'ddyej', # 0x0a
'ddyec', # 0x0b
'ddyek', # 0x0c
'ddyet', # 0x0d
'ddyep', # 0x0e
'ddyeh', # 0x0f
... |
unreal666/youtube-dl | refs/heads/master | youtube_dl/extractor/streamable.py | 53 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
float_or_none,
int_or_none,
)
class StreamableIE(InfoExtractor):
_VALID_URL = r'https?://streamable\.com/(?:[es]/)?(?P<id>\w+)'
_TESTS = [
{
... |
RedhawkSDR/framework-codegen | refs/heads/master | redhawk/codegen/jinja/python/component/persona/templates/persona_base.py | 1 | #{#
# This file is protected by Copyright. Please refer to the COPYRIGHT file
# distributed with this source distribution.
#
# This file is part of REDHAWK core.
#
# REDHAWK core 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 Fre... |
mm12432/Pyfa_eve_db_cn | refs/heads/master | po2txt.py | 1 | # coding:utf-8
def load_po():
file_po = open('locate/po/pyfa.po', 'r')
lines_po = file_po.readlines()
file_po.close()
return lines_po
def find_first_dataline(lines_po):
for i in range(len(lines_po)):
text_line = lines_po[i]
if 'msgid' in text_line and len(text_line) > 9:
... |
ajdawson/iris | refs/heads/master | lib/iris/analysis/geometry.py | 16 | # (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... |
prehensilecode/fastStructure | refs/heads/master | vars/setup.py | 3 |
from distutils.core import setup
from Cython.Build import cythonize
from distutils.extension import Extension
from Cython.Distutils import build_ext
import numpy
import sys
# setup utility functions
ext_modules = [Extension("utils", ["utils.pyx"])]
setup(
name = 'utility functions',
cmdclass = {'build_ext': ... |
Mozhuowen/brython | refs/heads/master | www/src/Lib/difflib.py | 737 | #! /usr/bin/env python3
"""
Module difflib -- helpers for computing deltas between objects.
Function get_close_matches(word, possibilities, n=3, cutoff=0.6):
Use SequenceMatcher to return list of the best "good enough" matches.
Function context_diff(a, b):
For two lists of strings, return a delta in context ... |
thomasgilgenast/gilgistatus-nonrel | refs/heads/master | django/contrib/gis/gdal/envelope.py | 321 | """
The GDAL/OGR library uses an Envelope structure to hold the bounding
box information for a geometry. The envelope (bounding box) contains
two pairs of coordinates, one for the lower left coordinate and one
for the upper right coordinate:
+----------o Upper right; (max_x, max_y)
... |
niboshi/chainer | refs/heads/master | tests/chainer_tests/links_tests/connection_tests/test_scale.py | 5 | import unittest
import numpy
import chainer
from chainer.backends import cuda
from chainer import gradient_check
from chainer import links
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
@testing.parameterize(
{'learn_W': True, 'bias_term': False, 'bias_shape':... |
foxish/test-infra | refs/heads/master | gubernator/third_party/defusedxml/common.py | 55 | # defusedxml
#
# Copyright (c) 2013 by Christian Heimes <christian@python.org>
# Licensed to PSF under a Contributor Agreement.
# See http://www.python.org/psf/license for licensing details.
"""Common constants, exceptions and helpe functions
"""
import sys
from types import MethodType
PY3 = sys.version_info[0] == 3
P... |
HybridF5/jacket | refs/heads/master | jacket/tests/compute/unit/api/openstack/test_legacy_v2_compatible_wrapper.py | 1 | # Copyright 2015 Intel Corporation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... |
quodlibet/quodlibet | refs/heads/master | quodlibet/qltk/exfalsowindow.py | 1 | # Copyright 2004-2005 Joe Wreschnig, Michael Urman, Iñigo Serna
#
# 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.
impor... |
adazey/Muzez | refs/heads/master | libs/nltk/stem/util.py | 1 | # Natural Language Toolkit: Stemmer Utilities
#
# Copyright (C) 2001-2016 NLTK Project
# Author: Helder <he7d3r@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
def suffix_replace(original, old, new):
"""
Replaces the old suffix of the original string by a new suffix
... |
meetvaruni/GitFiles | refs/heads/master | pywsd/__init__.py | 2 | #!/usr/bin/env python -*- coding: utf-8 -*-
#
# Python Word Sense Disambiguation (pyWSD)
#
# Copyright (C) 2014-2015 alvations
# URL:
# For license information, see LICENSE.md
import lesk
import baseline
import similarity
#import semcor
#import semeval
from allwords_wsd import disambiguate
|
souravsingh/khmer | refs/heads/master | tests/test_assembly.py | 2 | # -*- coding: UTF-8 -*-
#
# This file is part of khmer, https://github.com/dib-lab/khmer/, and is
# Copyright (C) 2010-2015, Michigan State University.
# Copyright (C) 2015-2016, The Regents of the University of California.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permi... |
korepwx/tfsnippet | refs/heads/develop | tests/ops/test_convolution.py | 1 | import numpy as np
import tensorflow as tf
from mock import mock
from tests.layers.convolutional.helper import (input_maybe_to_channels_last,
output_maybe_to_channels_first)
from tfsnippet.ops import space_to_depth, depth_to_space
tf_space_to_depth = tf.space_to_depth
tf... |
welchbj/tt | refs/heads/develop | tt/tests/unit/trees/_helpers.py | 1 | """Helpers for testing expression nodes."""
import unittest
from tt.expressions import BooleanExpression
class ExpressionTreeAndNodeTestCase(unittest.TestCase):
def get_tree_root_from_expr_str(self, expr_str):
"""Get an tree root node from an expression string."""
return BooleanExpression(expr_... |
infobloxopen/neutron | refs/heads/master | neutron/plugins/ml2/drivers/cisco/ucsm/ucsm_model.py | 25 | # Copyright 2015 Cisco Systems, 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 requi... |
flavour/tldrmp | refs/heads/master | modules/geopy/geocoders/wiki_semantic.py | 52 | import xml.dom.minidom
from geopy.geocoders.base import Geocoder
from geopy.point import Point
from geopy.location import Location
from geopy import util
try:
from BeautifulSoup import BeautifulSoup
except ImportError:
util.logger.warn("BeautifulSoup was not found. " \
"The SemanticMediaWiki geocoder... |
tecan/xchat-rt | refs/heads/master | plugins/scripts/Supybot-0.83.4.1-bitcoinotc-bot/build/lib/supybot/plugins/Time/local/dateutil/tz.py | 270 | """
Copyright (c) 2003-2007 Gustavo Niemeyer <gustavo@niemeyer.net>
This module offers extensions to the standard python 2.3+
datetime module.
"""
__author__ = "Gustavo Niemeyer <gustavo@niemeyer.net>"
__license__ = "PSF License"
import datetime
import struct
import time
import sys
import os
relativedelta = None
pa... |
sdoran35/hate-to-hugs | refs/heads/master | venv/lib/python3.6/site-packages/pip/_vendor/pyparsing.py | 417 | # module pyparsing.py
#
# Copyright (c) 2003-2016 Paul T. McGuire
#
# 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, cop... |
Peetz0r/micropython-esp32 | refs/heads/dev-bluetooth-plus-deepsleep | tests/basics/async_for2.py | 49 | # test waiting within "async for" aiter/anext functions
import sys
if sys.implementation.name == 'micropython':
# uPy allows normal generators to be awaitables
coroutine = lambda f: f
else:
import types
coroutine = types.coroutine
@coroutine
def f(x):
print('f start:', x)
yield x + 1
yield... |
eadgarchen/tensorflow | refs/heads/master | tensorflow/python/keras/_impl/keras/layers/serialization.py | 37 | # 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... |
g19-hs/personfinder | refs/heads/master | app/pytz/zoneinfo/Canada/Mountain.py | 9 | '''tzinfo timezone information for Canada/Mountain.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Mountain(DstTzInfo):
'''Canada/Mountain timezone definition. See datetime.tzinfo for details'''
zone = 'Canada/Mountain'
... |
davidnmurray/iris | refs/heads/master | docs/iris/example_tests/test_projections_and_annotations.py | 6 | # (C) British Crown Copyright 2014 - 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... |
gonicus/gosa | refs/heads/master | backend/src/gosa/backend/plugins/samba/hash.py | 1 | # This file is part of the GOsa framework.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de
#
# See the LICENSE file in the project's top-level directory for details.
from passlib.hash import lmhash, nthash
from gosa.backend.objects.filter import ElementFilter
from g... |
68foxboris/enigma2-openpli-vuplus | refs/heads/master | lib/python/Components/Sources/EventInfo.py | 21 | from Components.PerServiceDisplay import PerServiceBase
from Components.Element import cached
from enigma import iPlayableService, iServiceInformation, eServiceReference, eEPGCache
from Source import Source
class EventInfo(PerServiceBase, Source, object):
NOW = 0
NEXT = 1
def __init__(self, navcore, now_or_next):
... |
Rav3nPL/PLNcoin | refs/heads/plnc | qa/rpc-tests/invalidateblock.py | 104 | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test InvalidateBlock code
#
from test_framework.test_framework import BitcoinTestFramework
from test... |
rgommers/scipy | refs/heads/master | scipy/_build_utils/_fortran.py | 16 | import re
import os
import sys
from distutils.util import get_platform
import numpy as np
from .system_info import combine_dict
__all__ = ['needs_g77_abi_wrapper', 'get_g77_abi_wrappers',
'gfortran_legacy_flag_hook', 'blas_ilp64_pre_build_hook',
'get_f2py_int64_options', 'generic_pre_build_hoo... |
MalloyPower/parsing-python | refs/heads/master | front-end/testsuite-python-lib/Python-3.2/Lib/encodings/iso8859_15.py | 272 | """ Python Character Mapping Codec iso8859_15 generated from 'MAPPINGS/ISO8859/8859-15.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors... |
nzavagli/UnrealPy | refs/heads/master | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/py2exe-0.6.8/py2exe/samples/singlefile/comserver/test.py | 3 | import sys
from win32com.client import Dispatch
d = Dispatch("Python.Interpreter")
print "2 + 5 =", d.Eval("2 + 5")
d.Exec("print 'hi via COM'")
d.Exec("import sys")
print "COM server sys.version", d.Eval("sys.version")
print "Client sys.version", sys.version
print "COM server sys.path", d.Eval("sys.path")
print "C... |
x3rj/watransport | refs/heads/master | Database.py | 2 |
import sqlite3
import random
import string
import threading
import os
def randomword(length):
return ''.join(random.choice(string.ascii_letters) for i in range(length))
class Database:
database = None
lock = None
def __init__(self, database):
# is check_same_thread needed?
self.datab... |
sebastic/QGIS | refs/heads/master | python/__init__.py | 12 | # -*- coding: utf-8 -*-
"""
***************************************************************************
__init__.py
---------------------
Date : January 2007
Copyright : (C) 2007 by Martin Dobias
Email : wonder dot sk at gmail dot com
**********************... |
madflow/weblate | refs/heads/master | weblate/trans/machine/glosbe.py | 11 | # -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# 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, eithe... |
Dark-Hacker/horizon | refs/heads/master | openstack_dashboard/dashboards/admin/routers/tables.py | 59 | # Copyright 2012, Nachi Ueno, NTT MCL, 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 applic... |
krieger-od/nwjs_chromium.src | refs/heads/master | gpu/gles2_conform_support/generate_gles2_conform_tests.py | 139 | #!/usr/bin/env python
# Copyright (c) 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.
"""code generator for OpenGL ES 2.0 conformance tests."""
import os
import re
import sys
def ReadFileAsLines(filename):
"""Read... |
ivan73/smarthome | refs/heads/develop | tools/owsensors2items.py | 14 | #!/usr/bin/env python
# vim: set encoding=utf-8 tabstop=4 softtabstop=4 shiftwidth=4 expandtab
#########################################################################
# Copyright 2012-2013 KNX-User-Forum e.V. http://knx-user-forum.de/
#########################################################################
# ... |
Skyrpex/animata | refs/heads/master | scripts/macos/osxbundle.py | 6 | #!/usr/bin/env python
"""Provides tools for building Mac application bundles."""
# Based on code by Gary Oberbrunner and Mitch Chapman
from os.path import *
import os
import re
import shutil
from SCons.Builder import *
from SCons.Defaults import SharedCheck, ProgScan
from SCons.Script.SConscript import SConsEnvironme... |
noemis-fr/custom | refs/heads/7.0 | product_filter_for_orders/__openerp__.py | 1 | # -*- coding: utf-8 -*-
# © <YEAR(S)> <AUTHOR(S)>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Add filter on produt ref",
"summary": "Filter on sale_order product ref",
"version": "7.0.1.0.0",
"category": "Uncategorized",
"website": "https://odoo-community.org/",
"a... |
EuropecoinEUORG/Europecoin-V3 | refs/heads/master | qa/rpc-tests/test_framework/comptool.py | 18 | #!/usr/bin/env python2
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from mininode import *
from blockstore import BlockStore, TxStore
from util import p2p_port
'''
This is a tool for comparing two or more bitcoinds to ... |
nishantjr/pjproject | refs/heads/master | tests/pjsua/scripts-call/150_srtp_3_2.py | 40 | # $Id$
#
from inc_cfg import *
test_param = TestParam(
"Callee=optional (with duplicated offer) SRTP, caller=mandatory SRTP",
[
InstanceParam("callee", "--null-audio --use-srtp=3 --srtp-secure=0 --max-calls=1"),
InstanceParam("caller", "--null-audio --use-srtp=2 --srtp-secure=0 --max-calls=1")
]
)
|
sertac/django | refs/heads/master | django/utils/termcolors.py | 260 | """
termcolors.py
"""
from django.utils import six
color_names = ('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white')
foreground = {color_names[x]: '3%s' % x for x in range(8)}
background = {color_names[x]: '4%s' % x for x in range(8)}
RESET = '0'
opt_dict = {'bold': '1', 'underscore': '4', 'blink... |
zlsun/ProjectEuler | refs/heads/master | 083.py | 1 | #-*- encoding: utf-8 -*-
"""
Path sum: four ways
NOTE: This problem is a significantly more challenging version of Problem 81.
In the 5 by 5 matrix below, the minimal path sum from the top left to the bottom right, by moving left, right, up, and down, is indicated in bold red and is equal to 2297.
$$
\begin... |
lmorchard/django | refs/heads/master | tests/proxy_models/admin.py | 482 | from django.contrib import admin
from .models import ProxyTrackerUser, TrackerUser
site = admin.AdminSite(name='admin_proxy')
site.register(TrackerUser)
site.register(ProxyTrackerUser)
|
formalin14/titanium_mobile | refs/heads/master | android/runtime/v8/tools/js2c.py | 44 | #!/usr/bin/env python
#
# Copyright 2006-2008 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# ... |
Grirrane/odoo | refs/heads/master | addons/sale_mrp/tests/test_move_explode.py | 149 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... |
117111302/cui | refs/heads/master | run_urls.py | 3 | '''
Copyright (C) 2014 Codility Limited. <https://codility.com>
This file is part of Candidate User Interface (CUI).
CUI 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... |
painless-software/painless-continuous-delivery | refs/heads/renovate/doctrine-orm-2.x | tests/acceptance/steps/given.py | 1 | """
'Given' step implementations for acceptance tests. Powered by behave.
"""
from os import system
from cookiecutter.main import cookiecutter
@given('I have just created a {framework} {database} project checking {checks} and testing {tests}') # noqa
def step_impl(context, framework, database, checks, tests):
... |
googleads/google-ads-python | refs/heads/master | google/ads/googleads/v6/resources/types/carrier_constant.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... |
kirbyfan64/shedskin | refs/heads/master | tests/38.py | 6 |
def hu(n, s=-1): # s: [int], n: [int]
return [1] # [list(int)]
a = [i for i in hu(10)] # []
|
puuu/micropython | refs/heads/master | tests/basics/parser.py | 62 | # parser tests
try:
compile
except NameError:
print("SKIP")
import sys
sys.exit()
# completely empty string
# uPy and CPy differ for this case
#try:
# compile("", "stdin", "single")
#except SyntaxError:
# print("SyntaxError")
try:
compile("", "stdin", "eval")
except SyntaxError:
print("S... |
libcrosswind/libcrosswind | refs/heads/master | platform/windows/compilers/x64/TDM-GCC-64/gdb64/bin/lib/logging/config.py | 61 | # Copyright 2001-2014 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... |
logston/plog-work | refs/heads/master | wsgi.py | 1 | from blog import app
if __name__ == '__main__':
app.run() |
hanvo/MusicCloud | refs/heads/master | Crawler/Install Files/pygame/test/font_test.py | 5 | import sys
import os
if __name__ == '__main__':
pkg_dir = os.path.split(os.path.abspath(__file__))[0]
parent_dir, pkg_name = os.path.split(pkg_dir)
is_pygame_pkg = (pkg_name == 'tests' and
os.path.split(parent_dir)[1] == 'pygame')
if not is_pygame_pkg:
sys.path.insert(0, par... |
ftomassetti/intellij-community | refs/heads/master | python/testData/inspections/PyMissingConstructorInspection/deepInheritance.py | 83 | class A(object):
def __init__(self):
print ("Constructor A was called")
class B(A):
pass
class C(B):
def <warning descr="Call to __init__ of super class is missed">__init__</warning>(self):
print ("Constructor C was called")
|
nave91/modeller | refs/heads/master | model.py | 1 | from _model import *
import sys
class Model:
def __init__(self,name):
self.name = name
if name == 'pom3':
self.model = Pom()
elif name == 'xomo':
self.model = Xomo(model = 'flight')
elif name == 'xomoflight':
self.model = Xomo(model='flight')
... |
neumerance/deploy | refs/heads/master | .venv/lib/python2.7/site-packages/django/contrib/flatpages/admin.py | 316 | from django.contrib import admin
from django.contrib.flatpages.models import FlatPage
from django.utils.translation import ugettext_lazy as _
from django.contrib.flatpages.forms import FlatpageForm
class FlatPageAdmin(admin.ModelAdmin):
form = FlatpageForm
fieldsets = (
(None, {'fields': ('url', 'title... |
anryko/ansible | refs/heads/devel | lib/ansible/plugins/terminal/nos.py | 177 | #
# (c) 2018 Extreme Networks 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.
#
# Ans... |
thienluong/SAFplus-Availability-Scalability-Platform | refs/heads/s7 | src/ide/genshi/build/lib.linux-x86_64-2.7/genshi/tests/core.py | 7 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2009 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... |
amyvmiwei/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/turtledemo/clock.py | 65 | #!/usr/bin/env python3
# -*- coding: cp1252 -*-
""" turtle-example-suite:
tdemo_clock.py
Enhanced clock-program, showing date
and time
------------------------------------
Press STOP to exit the program!
------------------------------------
"""
from turtle import *
from datetime import datet... |
chandolia/python-social-auth | refs/heads/master | social/backends/wunderlist.py | 72 | from social.backends.oauth import BaseOAuth2
class WunderlistOAuth2(BaseOAuth2):
"""Wunderlist OAuth2 authentication backend"""
name = 'wunderlist'
AUTHORIZATION_URL = 'https://www.wunderlist.com/oauth/authorize'
ACCESS_TOKEN_URL = 'https://www.wunderlist.com/oauth/access_token'
ACCESS_TOKEN_METHO... |
LLNL/spack | refs/heads/develop | var/spack/repos/builtin/packages/perl-file-listing/package.py | 5 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PerlFileListing(PerlPackage):
"""Parse directory listing"""
homepage = "http://search... |
chand3040/sree_odoo | refs/heads/master | openerp/addons/auth_ldap/users_ldap.py | 35 | ##############################################################################
#
# 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 GNU Affero General Publ... |
brasilcomvc/brasilcomvc | refs/heads/master | brasilcomvc/common/tests/templatetags/test_form_utils.py | 1 | from django import forms
from django.test import TestCase
from ...templatetags.form_utils import (
form_field,
form_fieldset,
type_,
)
class TestForm(forms.Form):
test_field = forms.CharField(max_length=40)
class TypeTestCase(TestCase):
def test_type_filter_should_return_correct_class_name(sel... |
hellotomfan/v8-coroutine | refs/heads/master | build/gyp/test/configurations/x64/gyptest-x86.py | 340 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies build of an executable in three different configurations.
"""
import TestGyp
import sys
formats = ['msvs']
if sys.platform =... |
tirumalavan/ArduinoJson | refs/heads/master | third-party/gtest-1.7.0/test/gtest_help_test.py | 2968 | #!/usr/bin/env python
#
# Copyright 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.