From 9031552f27c0313326df063cef5455a5b9d7dab0 Mon Sep 17 00:00:00 2001 From: Andrey Vlasovskikh Date: Tue, 12 Feb 2013 20:59:07 +0400 Subject: [PATCH] Updated Python mock SDK from 2.5 to 2.7 The __namedtuple stub is now in __builtins__. --- python/testData/MockSdk2.7/Lib/__future__.py | 128 + python/testData/MockSdk2.7/Lib/_abcoll.py | 601 ++ python/testData/MockSdk2.7/Lib/collections.py | 668 +++ python/testData/MockSdk2.7/Lib/re.py | 326 ++ python/testData/MockSdk2.7/bin/python2.7 | 1 + .../MockSdk2.7/python_stubs/__builtin__.py | 5028 +++++++++++++++++ .../MockSdk2.7/python_stubs/datetime.py | 588 ++ .../MockSdk2.7/python_stubs/exceptions.py | 670 +++ .../testData/MockSdk2.7/python_stubs/sys.py | 494 ++ python/testData/override/qualified.py | 2 +- python/testData/override/qualified_after.py | 6 +- python/testData/stubs/ImportInExcept.py | 2 +- .../com/jetbrains/python/PyIntentionTest.java | 17 +- .../com/jetbrains/python/PyOverrideTest.java | 2 +- .../com/jetbrains/python/PyStubsTest.java | 2 +- .../jetbrains/python/fixtures/PyTestCase.java | 2 +- 16 files changed, 8523 insertions(+), 14 deletions(-) create mode 100644 python/testData/MockSdk2.7/Lib/__future__.py create mode 100644 python/testData/MockSdk2.7/Lib/_abcoll.py create mode 100644 python/testData/MockSdk2.7/Lib/collections.py create mode 100644 python/testData/MockSdk2.7/Lib/re.py create mode 100644 python/testData/MockSdk2.7/bin/python2.7 create mode 100644 python/testData/MockSdk2.7/python_stubs/__builtin__.py create mode 100644 python/testData/MockSdk2.7/python_stubs/datetime.py create mode 100644 python/testData/MockSdk2.7/python_stubs/exceptions.py create mode 100644 python/testData/MockSdk2.7/python_stubs/sys.py diff --git a/python/testData/MockSdk2.7/Lib/__future__.py b/python/testData/MockSdk2.7/Lib/__future__.py new file mode 100644 index 000000000000..915645933c03 --- /dev/null +++ b/python/testData/MockSdk2.7/Lib/__future__.py @@ -0,0 +1,128 @@ +"""Record of phased-in incompatible language changes. + +Each line is of the form: + + FeatureName = "_Feature(" OptionalRelease "," MandatoryRelease "," + CompilerFlag ")" + +where, normally, OptionalRelease < MandatoryRelease, and both are 5-tuples +of the same form as sys.version_info: + + (PY_MAJOR_VERSION, # the 2 in 2.1.0a3; an int + PY_MINOR_VERSION, # the 1; an int + PY_MICRO_VERSION, # the 0; an int + PY_RELEASE_LEVEL, # "alpha", "beta", "candidate" or "final"; string + PY_RELEASE_SERIAL # the 3; an int + ) + +OptionalRelease records the first release in which + + from __future__ import FeatureName + +was accepted. + +In the case of MandatoryReleases that have not yet occurred, +MandatoryRelease predicts the release in which the feature will become part +of the language. + +Else MandatoryRelease records when the feature became part of the language; +in releases at or after that, modules no longer need + + from __future__ import FeatureName + +to use the feature in question, but may continue to use such imports. + +MandatoryRelease may also be None, meaning that a planned feature got +dropped. + +Instances of class _Feature have two corresponding methods, +.getOptionalRelease() and .getMandatoryRelease(). + +CompilerFlag is the (bitfield) flag that should be passed in the fourth +argument to the builtin function compile() to enable the feature in +dynamically compiled code. This flag is stored in the .compiler_flag +attribute on _Future instances. These values must match the appropriate +#defines of CO_xxx flags in Include/compile.h. + +No feature line is ever to be deleted from this file. +""" + +all_feature_names = [ + "nested_scopes", + "generators", + "division", + "absolute_import", + "with_statement", + "print_function", + "unicode_literals", +] + +__all__ = ["all_feature_names"] + all_feature_names + +# The CO_xxx symbols are defined here under the same names used by +# compile.h, so that an editor search will find them here. However, +# they're not exported in __all__, because they don't really belong to +# this module. +CO_NESTED = 0x0010 # nested_scopes +CO_GENERATOR_ALLOWED = 0 # generators (obsolete, was 0x1000) +CO_FUTURE_DIVISION = 0x2000 # division +CO_FUTURE_ABSOLUTE_IMPORT = 0x4000 # perform absolute imports by default +CO_FUTURE_WITH_STATEMENT = 0x8000 # with statement +CO_FUTURE_PRINT_FUNCTION = 0x10000 # print function +CO_FUTURE_UNICODE_LITERALS = 0x20000 # unicode string literals + +class _Feature: + def __init__(self, optionalRelease, mandatoryRelease, compiler_flag): + self.optional = optionalRelease + self.mandatory = mandatoryRelease + self.compiler_flag = compiler_flag + + def getOptionalRelease(self): + """Return first release in which this feature was recognized. + + This is a 5-tuple, of the same form as sys.version_info. + """ + + return self.optional + + def getMandatoryRelease(self): + """Return release in which this feature will become mandatory. + + This is a 5-tuple, of the same form as sys.version_info, or, if + the feature was dropped, is None. + """ + + return self.mandatory + + def __repr__(self): + return "_Feature" + repr((self.optional, + self.mandatory, + self.compiler_flag)) + +nested_scopes = _Feature((2, 1, 0, "beta", 1), + (2, 2, 0, "alpha", 0), + CO_NESTED) + +generators = _Feature((2, 2, 0, "alpha", 1), + (2, 3, 0, "final", 0), + CO_GENERATOR_ALLOWED) + +division = _Feature((2, 2, 0, "alpha", 2), + (3, 0, 0, "alpha", 0), + CO_FUTURE_DIVISION) + +absolute_import = _Feature((2, 5, 0, "alpha", 1), + (2, 7, 0, "alpha", 0), + CO_FUTURE_ABSOLUTE_IMPORT) + +with_statement = _Feature((2, 5, 0, "alpha", 1), + (2, 6, 0, "alpha", 0), + CO_FUTURE_WITH_STATEMENT) + +print_function = _Feature((2, 6, 0, "alpha", 2), + (3, 0, 0, "alpha", 0), + CO_FUTURE_PRINT_FUNCTION) + +unicode_literals = _Feature((2, 6, 0, "alpha", 2), + (3, 0, 0, "alpha", 0), + CO_FUTURE_UNICODE_LITERALS) diff --git a/python/testData/MockSdk2.7/Lib/_abcoll.py b/python/testData/MockSdk2.7/Lib/_abcoll.py new file mode 100644 index 000000000000..e7376e4a56af --- /dev/null +++ b/python/testData/MockSdk2.7/Lib/_abcoll.py @@ -0,0 +1,601 @@ +# Copyright 2007 Google, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +"""Abstract Base Classes (ABCs) for collections, according to PEP 3119. + +DON'T USE THIS MODULE DIRECTLY! The classes here should be imported +via collections; they are defined here only to alleviate certain +bootstrapping issues. Unit tests are in test_collections. +""" + +from abc import ABCMeta, abstractmethod +import sys + +__all__ = ["Hashable", "Iterable", "Iterator", + "Sized", "Container", "Callable", + "Set", "MutableSet", + "Mapping", "MutableMapping", + "MappingView", "KeysView", "ItemsView", "ValuesView", + "Sequence", "MutableSequence", + ] + +### ONE-TRICK PONIES ### + +def _hasattr(C, attr): + try: + return any(attr in B.__dict__ for B in C.__mro__) + except AttributeError: + # Old-style class + return hasattr(C, attr) + + +class Hashable: + __metaclass__ = ABCMeta + + @abstractmethod + def __hash__(self): + return 0 + + @classmethod + def __subclasshook__(cls, C): + if cls is Hashable: + try: + for B in C.__mro__: + if "__hash__" in B.__dict__: + if B.__dict__["__hash__"]: + return True + break + except AttributeError: + # Old-style class + if getattr(C, "__hash__", None): + return True + return NotImplemented + + +class Iterable: + __metaclass__ = ABCMeta + + @abstractmethod + def __iter__(self): + while False: + yield None + + @classmethod + def __subclasshook__(cls, C): + if cls is Iterable: + if _hasattr(C, "__iter__"): + return True + return NotImplemented + +Iterable.register(str) + + +class Iterator(Iterable): + + @abstractmethod + def next(self): + raise StopIteration + + def __iter__(self): + return self + + @classmethod + def __subclasshook__(cls, C): + if cls is Iterator: + if _hasattr(C, "next") and _hasattr(C, "__iter__"): + return True + return NotImplemented + + +class Sized: + __metaclass__ = ABCMeta + + @abstractmethod + def __len__(self): + return 0 + + @classmethod + def __subclasshook__(cls, C): + if cls is Sized: + if _hasattr(C, "__len__"): + return True + return NotImplemented + + +class Container: + __metaclass__ = ABCMeta + + @abstractmethod + def __contains__(self, x): + return False + + @classmethod + def __subclasshook__(cls, C): + if cls is Container: + if _hasattr(C, "__contains__"): + return True + return NotImplemented + + +class Callable: + __metaclass__ = ABCMeta + + @abstractmethod + def __call__(self, *args, **kwds): + return False + + @classmethod + def __subclasshook__(cls, C): + if cls is Callable: + if _hasattr(C, "__call__"): + return True + return NotImplemented + + +### SETS ### + + +class Set(Sized, Iterable, Container): + """A set is a finite, iterable container. + + This class provides concrete generic implementations of all + methods except for __contains__, __iter__ and __len__. + + To override the comparisons (presumably for speed, as the + semantics are fixed), all you have to do is redefine __le__ and + then the other operations will automatically follow suit. + """ + + def __le__(self, other): + if not isinstance(other, Set): + return NotImplemented + if len(self) > len(other): + return False + for elem in self: + if elem not in other: + return False + return True + + def __lt__(self, other): + if not isinstance(other, Set): + return NotImplemented + return len(self) < len(other) and self.__le__(other) + + def __gt__(self, other): + if not isinstance(other, Set): + return NotImplemented + return other < self + + def __ge__(self, other): + if not isinstance(other, Set): + return NotImplemented + return other <= self + + def __eq__(self, other): + if not isinstance(other, Set): + return NotImplemented + return len(self) == len(other) and self.__le__(other) + + def __ne__(self, other): + return not (self == other) + + @classmethod + def _from_iterable(cls, it): + '''Construct an instance of the class from any iterable input. + + Must override this method if the class constructor signature + does not accept an iterable for an input. + ''' + return cls(it) + + def __and__(self, other): + if not isinstance(other, Iterable): + return NotImplemented + return self._from_iterable(value for value in other if value in self) + + def isdisjoint(self, other): + for value in other: + if value in self: + return False + return True + + def __or__(self, other): + if not isinstance(other, Iterable): + return NotImplemented + chain = (e for s in (self, other) for e in s) + return self._from_iterable(chain) + + def __sub__(self, other): + if not isinstance(other, Set): + if not isinstance(other, Iterable): + return NotImplemented + other = self._from_iterable(other) + return self._from_iterable(value for value in self + if value not in other) + + def __xor__(self, other): + if not isinstance(other, Set): + if not isinstance(other, Iterable): + return NotImplemented + other = self._from_iterable(other) + return (self - other) | (other - self) + + # Sets are not hashable by default, but subclasses can change this + __hash__ = None + + def _hash(self): + """Compute the hash value of a set. + + Note that we don't define __hash__: not all sets are hashable. + But if you define a hashable set type, its __hash__ should + call this function. + + This must be compatible __eq__. + + All sets ought to compare equal if they contain the same + elements, regardless of how they are implemented, and + regardless of the order of the elements; so there's not much + freedom for __eq__ or __hash__. We match the algorithm used + by the built-in frozenset type. + """ + MAX = sys.maxint + MASK = 2 * MAX + 1 + n = len(self) + h = 1927868237 * (n + 1) + h &= MASK + for x in self: + hx = hash(x) + h ^= (hx ^ (hx << 16) ^ 89869747) * 3644798167 + h &= MASK + h = h * 69069 + 907133923 + h &= MASK + if h > MAX: + h -= MASK + 1 + if h == -1: + h = 590923713 + return h + +Set.register(frozenset) + + +class MutableSet(Set): + + @abstractmethod + def add(self, value): + """Add an element.""" + raise NotImplementedError + + @abstractmethod + def discard(self, value): + """Remove an element. Do not raise an exception if absent.""" + raise NotImplementedError + + def remove(self, value): + """Remove an element. If not a member, raise a KeyError.""" + if value not in self: + raise KeyError(value) + self.discard(value) + + def pop(self): + """Return the popped value. Raise KeyError if empty.""" + it = iter(self) + try: + value = next(it) + except StopIteration: + raise KeyError + self.discard(value) + return value + + def clear(self): + """This is slow (creates N new iterators!) but effective.""" + try: + while True: + self.pop() + except KeyError: + pass + + def __ior__(self, it): + for value in it: + self.add(value) + return self + + def __iand__(self, it): + for value in (self - it): + self.discard(value) + return self + + def __ixor__(self, it): + if it is self: + self.clear() + else: + if not isinstance(it, Set): + it = self._from_iterable(it) + for value in it: + if value in self: + self.discard(value) + else: + self.add(value) + return self + + def __isub__(self, it): + if it is self: + self.clear() + else: + for value in it: + self.discard(value) + return self + +MutableSet.register(set) + + +### MAPPINGS ### + + +class Mapping(Sized, Iterable, Container): + + @abstractmethod + def __getitem__(self, key): + raise KeyError + + def get(self, key, default=None): + try: + return self[key] + except KeyError: + return default + + def __contains__(self, key): + try: + self[key] + except KeyError: + return False + else: + return True + + def iterkeys(self): + return iter(self) + + def itervalues(self): + for key in self: + yield self[key] + + def iteritems(self): + for key in self: + yield (key, self[key]) + + def keys(self): + return list(self) + + def items(self): + return [(key, self[key]) for key in self] + + def values(self): + return [self[key] for key in self] + + # Mappings are not hashable by default, but subclasses can change this + __hash__ = None + + def __eq__(self, other): + if not isinstance(other, Mapping): + return NotImplemented + return dict(self.items()) == dict(other.items()) + + def __ne__(self, other): + return not (self == other) + +class MappingView(Sized): + + def __init__(self, mapping): + self._mapping = mapping + + def __len__(self): + return len(self._mapping) + + def __repr__(self): + return '{0.__class__.__name__}({0._mapping!r})'.format(self) + + +class KeysView(MappingView, Set): + + @classmethod + def _from_iterable(self, it): + return set(it) + + def __contains__(self, key): + return key in self._mapping + + def __iter__(self): + for key in self._mapping: + yield key + + +class ItemsView(MappingView, Set): + + @classmethod + def _from_iterable(self, it): + return set(it) + + def __contains__(self, item): + key, value = item + try: + v = self._mapping[key] + except KeyError: + return False + else: + return v == value + + def __iter__(self): + for key in self._mapping: + yield (key, self._mapping[key]) + + +class ValuesView(MappingView): + + def __contains__(self, value): + for key in self._mapping: + if value == self._mapping[key]: + return True + return False + + def __iter__(self): + for key in self._mapping: + yield self._mapping[key] + + +class MutableMapping(Mapping): + + @abstractmethod + def __setitem__(self, key, value): + raise KeyError + + @abstractmethod + def __delitem__(self, key): + raise KeyError + + __marker = object() + + def pop(self, key, default=__marker): + try: + value = self[key] + except KeyError: + if default is self.__marker: + raise + return default + else: + del self[key] + return value + + def popitem(self): + try: + key = next(iter(self)) + except StopIteration: + raise KeyError + value = self[key] + del self[key] + return key, value + + def clear(self): + try: + while True: + self.popitem() + except KeyError: + pass + + def update(*args, **kwds): + if len(args) > 2: + raise TypeError("update() takes at most 2 positional " + "arguments ({} given)".format(len(args))) + elif not args: + raise TypeError("update() takes at least 1 argument (0 given)") + self = args[0] + other = args[1] if len(args) >= 2 else () + + if isinstance(other, Mapping): + for key in other: + self[key] = other[key] + elif hasattr(other, "keys"): + for key in other.keys(): + self[key] = other[key] + else: + for key, value in other: + self[key] = value + for key, value in kwds.items(): + self[key] = value + + def setdefault(self, key, default=None): + try: + return self[key] + except KeyError: + self[key] = default + return default + +MutableMapping.register(dict) + + +### SEQUENCES ### + + +class Sequence(Sized, Iterable, Container): + """All the operations on a read-only sequence. + + Concrete subclasses must override __new__ or __init__, + __getitem__, and __len__. + """ + + @abstractmethod + def __getitem__(self, index): + raise IndexError + + def __iter__(self): + i = 0 + try: + while True: + v = self[i] + yield v + i += 1 + except IndexError: + return + + def __contains__(self, value): + for v in self: + if v == value: + return True + return False + + def __reversed__(self): + for i in reversed(range(len(self))): + yield self[i] + + def index(self, value): + for i, v in enumerate(self): + if v == value: + return i + raise ValueError + + def count(self, value): + return sum(1 for v in self if v == value) + +Sequence.register(tuple) +Sequence.register(basestring) +Sequence.register(buffer) +Sequence.register(xrange) + + +class MutableSequence(Sequence): + + @abstractmethod + def __setitem__(self, index, value): + raise IndexError + + @abstractmethod + def __delitem__(self, index): + raise IndexError + + @abstractmethod + def insert(self, index, value): + raise IndexError + + def append(self, value): + self.insert(len(self), value) + + def reverse(self): + n = len(self) + for i in range(n//2): + self[i], self[n-i-1] = self[n-i-1], self[i] + + def extend(self, values): + for v in values: + self.append(v) + + def pop(self, index=-1): + v = self[index] + del self[index] + return v + + def remove(self, value): + del self[self.index(value)] + + def __iadd__(self, values): + self.extend(values) + return self + +MutableSequence.register(list) diff --git a/python/testData/MockSdk2.7/Lib/collections.py b/python/testData/MockSdk2.7/Lib/collections.py new file mode 100644 index 000000000000..958e523b6c70 --- /dev/null +++ b/python/testData/MockSdk2.7/Lib/collections.py @@ -0,0 +1,668 @@ +__all__ = ['Counter', 'deque', 'defaultdict', 'namedtuple', 'OrderedDict'] +# For bootstrapping reasons, the collection ABCs are defined in _abcoll.py. +# They should however be considered an integral part of collections.py. +from _abcoll import * +import _abcoll +__all__ += _abcoll.__all__ + +from _collections import deque, defaultdict +from operator import itemgetter as _itemgetter +from keyword import iskeyword as _iskeyword +import sys as _sys +import heapq as _heapq +from itertools import repeat as _repeat, chain as _chain, starmap as _starmap + +try: + from thread import get_ident as _get_ident +except ImportError: + from dummy_thread import get_ident as _get_ident + + +################################################################################ +### OrderedDict +################################################################################ + +class OrderedDict(dict): + 'Dictionary that remembers insertion order' + # An inherited dict maps keys to values. + # The inherited dict provides __getitem__, __len__, __contains__, and get. + # The remaining methods are order-aware. + # Big-O running times for all methods are the same as regular dictionaries. + + # The internal self.__map dict maps keys to links in a doubly linked list. + # The circular doubly linked list starts and ends with a sentinel element. + # The sentinel element never gets deleted (this simplifies the algorithm). + # Each link is stored as a list of length three: [PREV, NEXT, KEY]. + + def __init__(self, *args, **kwds): + '''Initialize an ordered dictionary. The signature is the same as + regular dictionaries, but keyword arguments are not recommended because + their insertion order is arbitrary. + + ''' + if len(args) > 1: + raise TypeError('expected at most 1 arguments, got %d' % len(args)) + try: + self.__root + except AttributeError: + self.__root = root = [] # sentinel node + root[:] = [root, root, None] + self.__map = {} + self.__update(*args, **kwds) + + def __setitem__(self, key, value, PREV=0, NEXT=1, dict_setitem=dict.__setitem__): + 'od.__setitem__(i, y) <==> od[i]=y' + # Setting a new item creates a new link at the end of the linked list, + # and the inherited dictionary is updated with the new key/value pair. + if key not in self: + root = self.__root + last = root[PREV] + last[NEXT] = root[PREV] = self.__map[key] = [last, root, key] + dict_setitem(self, key, value) + + def __delitem__(self, key, PREV=0, NEXT=1, dict_delitem=dict.__delitem__): + 'od.__delitem__(y) <==> del od[y]' + # Deleting an existing item uses self.__map to find the link which gets + # removed by updating the links in the predecessor and successor nodes. + dict_delitem(self, key) + link_prev, link_next, key = self.__map.pop(key) + link_prev[NEXT] = link_next + link_next[PREV] = link_prev + + def __iter__(self): + 'od.__iter__() <==> iter(od)' + # Traverse the linked list in order. + NEXT, KEY = 1, 2 + root = self.__root + curr = root[NEXT] + while curr is not root: + yield curr[KEY] + curr = curr[NEXT] + + def __reversed__(self): + 'od.__reversed__() <==> reversed(od)' + # Traverse the linked list in reverse order. + PREV, KEY = 0, 2 + root = self.__root + curr = root[PREV] + while curr is not root: + yield curr[KEY] + curr = curr[PREV] + + def clear(self): + 'od.clear() -> None. Remove all items from od.' + for node in self.__map.itervalues(): + del node[:] + root = self.__root + root[:] = [root, root, None] + self.__map.clear() + dict.clear(self) + + # -- the following methods do not depend on the internal structure -- + + def keys(self): + 'od.keys() -> list of keys in od' + return list(self) + + def values(self): + 'od.values() -> list of values in od' + return [self[key] for key in self] + + def items(self): + 'od.items() -> list of (key, value) pairs in od' + return [(key, self[key]) for key in self] + + def iterkeys(self): + 'od.iterkeys() -> an iterator over the keys in od' + return iter(self) + + def itervalues(self): + 'od.itervalues -> an iterator over the values in od' + for k in self: + yield self[k] + + def iteritems(self): + 'od.iteritems -> an iterator over the (key, value) pairs in od' + for k in self: + yield (k, self[k]) + + update = MutableMapping.update + + __update = update # let subclasses override update without breaking __init__ + + __marker = object() + + def pop(self, key, default=__marker): + '''od.pop(k[,d]) -> v, remove specified key and return the corresponding + value. If key is not found, d is returned if given, otherwise KeyError + is raised. + + ''' + if key in self: + result = self[key] + del self[key] + return result + if default is self.__marker: + raise KeyError(key) + return default + + def setdefault(self, key, default=None): + 'od.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in od' + if key in self: + return self[key] + self[key] = default + return default + + def popitem(self, last=True): + '''od.popitem() -> (k, v), return and remove a (key, value) pair. + Pairs are returned in LIFO order if last is true or FIFO order if false. + + ''' + if not self: + raise KeyError('dictionary is empty') + key = next(reversed(self) if last else iter(self)) + value = self.pop(key) + return key, value + + def __repr__(self, _repr_running={}): + 'od.__repr__() <==> repr(od)' + call_key = id(self), _get_ident() + if call_key in _repr_running: + return '...' + _repr_running[call_key] = 1 + try: + if not self: + return '%s()' % (self.__class__.__name__,) + return '%s(%r)' % (self.__class__.__name__, self.items()) + finally: + del _repr_running[call_key] + + def __reduce__(self): + 'Return state information for pickling' + items = [[k, self[k]] for k in self] + inst_dict = vars(self).copy() + for k in vars(OrderedDict()): + inst_dict.pop(k, None) + if inst_dict: + return (self.__class__, (items,), inst_dict) + return self.__class__, (items,) + + def copy(self): + 'od.copy() -> a shallow copy of od' + return self.__class__(self) + + @classmethod + def fromkeys(cls, iterable, value=None): + '''OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S. + If not specified, the value defaults to None. + + ''' + self = cls() + for key in iterable: + self[key] = value + return self + + def __eq__(self, other): + '''od.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive + while comparison to a regular mapping is order-insensitive. + + ''' + if isinstance(other, OrderedDict): + return len(self)==len(other) and self.items() == other.items() + return dict.__eq__(self, other) + + def __ne__(self, other): + 'od.__ne__(y) <==> od!=y' + return not self == other + + # -- the following methods support python 3.x style dictionary views -- + + def viewkeys(self): + "od.viewkeys() -> a set-like object providing a view on od's keys" + return KeysView(self) + + def viewvalues(self): + "od.viewvalues() -> an object providing a view on od's values" + return ValuesView(self) + + def viewitems(self): + "od.viewitems() -> a set-like object providing a view on od's items" + return ItemsView(self) + + +################################################################################ +### namedtuple +################################################################################ + +def namedtuple(typename, field_names, verbose=False, rename=False): + """Returns a new subclass of tuple with named fields. + + >>> Point = namedtuple('Point', 'x y') + >>> Point.__doc__ # docstring for the new class + 'Point(x, y)' + >>> p = Point(11, y=22) # instantiate with positional args or keywords + >>> p[0] + p[1] # indexable like a plain tuple + 33 + >>> x, y = p # unpack like a regular tuple + >>> x, y + (11, 22) + >>> p.x + p.y # fields also accessable by name + 33 + >>> d = p._asdict() # convert to a dictionary + >>> d['x'] + 11 + >>> Point(**d) # convert from a dictionary + Point(x=11, y=22) + >>> p._replace(x=100) # _replace() is like str.replace() but targets named fields + Point(x=100, y=22) + + """ + + # Parse and validate the field names. Validation serves two purposes, + # generating informative error messages and preventing template injection attacks. + if isinstance(field_names, basestring): + field_names = field_names.replace(',', ' ').split() # names separated by whitespace and/or commas + field_names = tuple(map(str, field_names)) + if rename: + names = list(field_names) + seen = set() + for i, name in enumerate(names): + if (not all(c.isalnum() or c=='_' for c in name) or _iskeyword(name) + or not name or name[0].isdigit() or name.startswith('_') + or name in seen): + names[i] = '_%d' % i + seen.add(name) + field_names = tuple(names) + for name in (typename,) + field_names: + if not all(c.isalnum() or c=='_' for c in name): + raise ValueError('Type names and field names can only contain alphanumeric characters and underscores: %r' % name) + if _iskeyword(name): + raise ValueError('Type names and field names cannot be a keyword: %r' % name) + if name[0].isdigit(): + raise ValueError('Type names and field names cannot start with a number: %r' % name) + seen_names = set() + for name in field_names: + if name.startswith('_') and not rename: + raise ValueError('Field names cannot start with an underscore: %r' % name) + if name in seen_names: + raise ValueError('Encountered duplicate field name: %r' % name) + seen_names.add(name) + + # Create and fill-in the class template + numfields = len(field_names) + argtxt = repr(field_names).replace("'", "")[1:-1] # tuple repr without parens or quotes + reprtxt = ', '.join('%s=%%r' % name for name in field_names) + template = '''class %(typename)s(tuple): + '%(typename)s(%(argtxt)s)' \n + __slots__ = () \n + _fields = %(field_names)r \n + def __new__(_cls, %(argtxt)s): + 'Create new instance of %(typename)s(%(argtxt)s)' + return _tuple.__new__(_cls, (%(argtxt)s)) \n + @classmethod + def _make(cls, iterable, new=tuple.__new__, len=len): + 'Make a new %(typename)s object from a sequence or iterable' + result = new(cls, iterable) + if len(result) != %(numfields)d: + raise TypeError('Expected %(numfields)d arguments, got %%d' %% len(result)) + return result \n + def __repr__(self): + 'Return a nicely formatted representation string' + return '%(typename)s(%(reprtxt)s)' %% self \n + def _asdict(self): + 'Return a new OrderedDict which maps field names to their values' + return OrderedDict(zip(self._fields, self)) \n + __dict__ = property(_asdict) \n + def _replace(_self, **kwds): + 'Return a new %(typename)s object replacing specified fields with new values' + result = _self._make(map(kwds.pop, %(field_names)r, _self)) + if kwds: + raise ValueError('Got unexpected field names: %%r' %% kwds.keys()) + return result \n + def __getnewargs__(self): + 'Return self as a plain tuple. Used by copy and pickle.' + return tuple(self) \n\n''' % locals() + for i, name in enumerate(field_names): + template += " %s = _property(_itemgetter(%d), doc='Alias for field number %d')\n" % (name, i, i) + if verbose: + print template + + # Execute the template string in a temporary namespace and + # support tracing utilities by setting a value for frame.f_globals['__name__'] + namespace = dict(_itemgetter=_itemgetter, __name__='namedtuple_%s' % typename, + OrderedDict=OrderedDict, _property=property, _tuple=tuple) + try: + exec template in namespace + except SyntaxError, e: + raise SyntaxError(e.message + ':\n' + template) + result = namespace[typename] + + # For pickling to work, the __module__ variable needs to be set to the frame + # where the named tuple is created. Bypass this step in enviroments where + # sys._getframe is not defined (Jython for example) or sys._getframe is not + # defined for arguments greater than 0 (IronPython). + try: + result.__module__ = _sys._getframe(1).f_globals.get('__name__', '__main__') + except (AttributeError, ValueError): + pass + + return result + + +######################################################################## +### Counter +######################################################################## + +class Counter(dict): + '''Dict subclass for counting hashable items. Sometimes called a bag + or multiset. Elements are stored as dictionary keys and their counts + are stored as dictionary values. + + >>> c = Counter('abcdeabcdabcaba') # count elements from a string + + >>> c.most_common(3) # three most common elements + [('a', 5), ('b', 4), ('c', 3)] + >>> sorted(c) # list all unique elements + ['a', 'b', 'c', 'd', 'e'] + >>> ''.join(sorted(c.elements())) # list elements with repetitions + 'aaaaabbbbcccdde' + >>> sum(c.values()) # total of all counts + 15 + + >>> c['a'] # count of letter 'a' + 5 + >>> for elem in 'shazam': # update counts from an iterable + ... c[elem] += 1 # by adding 1 to each element's count + >>> c['a'] # now there are seven 'a' + 7 + >>> del c['b'] # remove all 'b' + >>> c['b'] # now there are zero 'b' + 0 + + >>> d = Counter('simsalabim') # make another counter + >>> c.update(d) # add in the second counter + >>> c['a'] # now there are nine 'a' + 9 + + >>> c.clear() # empty the counter + >>> c + Counter() + + Note: If a count is set to zero or reduced to zero, it will remain + in the counter until the entry is deleted or the counter is cleared: + + >>> c = Counter('aaabbc') + >>> c['b'] -= 2 # reduce the count of 'b' by two + >>> c.most_common() # 'b' is still in, but its count is zero + [('a', 3), ('c', 1), ('b', 0)] + + ''' + # References: + # http://en.wikipedia.org/wiki/Multiset + # http://www.gnu.org/software/smalltalk/manual-base/html_node/Bag.html + # http://www.demo2s.com/Tutorial/Cpp/0380__set-multiset/Catalog0380__set-multiset.htm + # http://code.activestate.com/recipes/259174/ + # Knuth, TAOCP Vol. II section 4.6.3 + + def __init__(self, iterable=None, **kwds): + '''Create a new, empty Counter object. And if given, count elements + from an input iterable. Or, initialize the count from another mapping + of elements to their counts. + + >>> c = Counter() # a new, empty counter + >>> c = Counter('gallahad') # a new counter from an iterable + >>> c = Counter({'a': 4, 'b': 2}) # a new counter from a mapping + >>> c = Counter(a=4, b=2) # a new counter from keyword args + + ''' + super(Counter, self).__init__() + self.update(iterable, **kwds) + + def __missing__(self, key): + 'The count of elements not in the Counter is zero.' + # Needed so that self[missing_item] does not raise KeyError + return 0 + + def most_common(self, n=None): + '''List the n most common elements and their counts from the most + common to the least. If n is None, then list all element counts. + + >>> Counter('abcdeabcdabcaba').most_common(3) + [('a', 5), ('b', 4), ('c', 3)] + + ''' + # Emulate Bag.sortedByCount from Smalltalk + if n is None: + return sorted(self.iteritems(), key=_itemgetter(1), reverse=True) + return _heapq.nlargest(n, self.iteritems(), key=_itemgetter(1)) + + def elements(self): + '''Iterator over elements repeating each as many times as its count. + + >>> c = Counter('ABCABC') + >>> sorted(c.elements()) + ['A', 'A', 'B', 'B', 'C', 'C'] + + # Knuth's example for prime factors of 1836: 2**2 * 3**3 * 17**1 + >>> prime_factors = Counter({2: 2, 3: 3, 17: 1}) + >>> product = 1 + >>> for factor in prime_factors.elements(): # loop over factors + ... product *= factor # and multiply them + >>> product + 1836 + + Note, if an element's count has been set to zero or is a negative + number, elements() will ignore it. + + ''' + # Emulate Bag.do from Smalltalk and Multiset.begin from C++. + return _chain.from_iterable(_starmap(_repeat, self.iteritems())) + + # Override dict methods where necessary + + @classmethod + def fromkeys(cls, iterable, v=None): + # There is no equivalent method for counters because setting v=1 + # means that no element can have a count greater than one. + raise NotImplementedError( + 'Counter.fromkeys() is undefined. Use Counter(iterable) instead.') + + def update(self, iterable=None, **kwds): + '''Like dict.update() but add counts instead of replacing them. + + Source can be an iterable, a dictionary, or another Counter instance. + + >>> c = Counter('which') + >>> c.update('witch') # add elements from another iterable + >>> d = Counter('watch') + >>> c.update(d) # add elements from another counter + >>> c['h'] # four 'h' in which, witch, and watch + 4 + + ''' + # The regular dict.update() operation makes no sense here because the + # replace behavior results in the some of original untouched counts + # being mixed-in with all of the other counts for a mismash that + # doesn't have a straight-forward interpretation in most counting + # contexts. Instead, we implement straight-addition. Both the inputs + # and outputs are allowed to contain zero and negative counts. + + if iterable is not None: + if isinstance(iterable, Mapping): + if self: + self_get = self.get + for elem, count in iterable.iteritems(): + self[elem] = self_get(elem, 0) + count + else: + super(Counter, self).update(iterable) # fast path when counter is empty + else: + self_get = self.get + for elem in iterable: + self[elem] = self_get(elem, 0) + 1 + if kwds: + self.update(kwds) + + def subtract(self, iterable=None, **kwds): + '''Like dict.update() but subtracts counts instead of replacing them. + Counts can be reduced below zero. Both the inputs and outputs are + allowed to contain zero and negative counts. + + Source can be an iterable, a dictionary, or another Counter instance. + + >>> c = Counter('which') + >>> c.subtract('witch') # subtract elements from another iterable + >>> c.subtract(Counter('watch')) # subtract elements from another counter + >>> c['h'] # 2 in which, minus 1 in witch, minus 1 in watch + 0 + >>> c['w'] # 1 in which, minus 1 in witch, minus 1 in watch + -1 + + ''' + if iterable is not None: + self_get = self.get + if isinstance(iterable, Mapping): + for elem, count in iterable.items(): + self[elem] = self_get(elem, 0) - count + else: + for elem in iterable: + self[elem] = self_get(elem, 0) - 1 + if kwds: + self.subtract(kwds) + + def copy(self): + 'Return a shallow copy.' + return self.__class__(self) + + def __reduce__(self): + return self.__class__, (dict(self),) + + def __delitem__(self, elem): + 'Like dict.__delitem__() but does not raise KeyError for missing values.' + if elem in self: + super(Counter, self).__delitem__(elem) + + def __repr__(self): + if not self: + return '%s()' % self.__class__.__name__ + items = ', '.join(map('%r: %r'.__mod__, self.most_common())) + return '%s({%s})' % (self.__class__.__name__, items) + + # Multiset-style mathematical operations discussed in: + # Knuth TAOCP Volume II section 4.6.3 exercise 19 + # and at http://en.wikipedia.org/wiki/Multiset + # + # Outputs guaranteed to only include positive counts. + # + # To strip negative and zero counts, add-in an empty counter: + # c += Counter() + + def __add__(self, other): + '''Add counts from two counters. + + >>> Counter('abbb') + Counter('bcc') + Counter({'b': 4, 'c': 2, 'a': 1}) + + ''' + if not isinstance(other, Counter): + return NotImplemented + result = Counter() + for elem, count in self.items(): + newcount = count + other[elem] + if newcount > 0: + result[elem] = newcount + for elem, count in other.items(): + if elem not in self and count > 0: + result[elem] = count + return result + + def __sub__(self, other): + ''' Subtract count, but keep only results with positive counts. + + >>> Counter('abbbc') - Counter('bccd') + Counter({'b': 2, 'a': 1}) + + ''' + if not isinstance(other, Counter): + return NotImplemented + result = Counter() + for elem, count in self.items(): + newcount = count - other[elem] + if newcount > 0: + result[elem] = newcount + for elem, count in other.items(): + if elem not in self and count < 0: + result[elem] = 0 - count + return result + + def __or__(self, other): + '''Union is the maximum of value in either of the input counters. + + >>> Counter('abbb') | Counter('bcc') + Counter({'b': 3, 'c': 2, 'a': 1}) + + ''' + if not isinstance(other, Counter): + return NotImplemented + result = Counter() + for elem, count in self.items(): + other_count = other[elem] + newcount = other_count if count < other_count else count + if newcount > 0: + result[elem] = newcount + for elem, count in other.items(): + if elem not in self and count > 0: + result[elem] = count + return result + + def __and__(self, other): + ''' Intersection is the minimum of corresponding counts. + + >>> Counter('abbb') & Counter('bcc') + Counter({'b': 1}) + + ''' + if not isinstance(other, Counter): + return NotImplemented + result = Counter() + for elem, count in self.items(): + other_count = other[elem] + newcount = count if count < other_count else other_count + if newcount > 0: + result[elem] = newcount + return result + + +if __name__ == '__main__': + # verify that instances can be pickled + from cPickle import loads, dumps + Point = namedtuple('Point', 'x, y', True) + p = Point(x=10, y=20) + assert p == loads(dumps(p)) + + # test and demonstrate ability to override methods + class Point(namedtuple('Point', 'x y')): + __slots__ = () + @property + def hypot(self): + return (self.x ** 2 + self.y ** 2) ** 0.5 + def __str__(self): + return 'Point: x=%6.3f y=%6.3f hypot=%6.3f' % (self.x, self.y, self.hypot) + + for p in Point(3, 4), Point(14, 5/7.): + print p + + class Point(namedtuple('Point', 'x y')): + 'Point class with optimized _make() and _replace() without error-checking' + __slots__ = () + _make = classmethod(tuple.__new__) + def _replace(self, _map=map, **kwds): + return self._make(_map(kwds.get, ('x', 'y'), self)) + + print Point(11, 22)._replace(x=100) + + Point3D = namedtuple('Point3D', Point._fields + ('z',)) + print Point3D.__doc__ + + import doctest + TestResults = namedtuple('TestResults', 'failed attempted') + print TestResults(*doctest.testmod()) diff --git a/python/testData/MockSdk2.7/Lib/re.py b/python/testData/MockSdk2.7/Lib/re.py new file mode 100644 index 000000000000..6a0174308969 --- /dev/null +++ b/python/testData/MockSdk2.7/Lib/re.py @@ -0,0 +1,326 @@ +# +# Secret Labs' Regular Expression Engine +# +# re-compatible interface for the sre matching engine +# +# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved. +# +# This version of the SRE library can be redistributed under CNRI's +# Python 1.6 license. For any other use, please contact Secret Labs +# AB (info@pythonware.com). +# +# Portions of this engine have been developed in cooperation with +# CNRI. Hewlett-Packard provided funding for 1.6 integration and +# other compatibility work. +# + +r"""Support for regular expressions (RE). + +This module provides regular expression matching operations similar to +those found in Perl. It supports both 8-bit and Unicode strings; both +the pattern and the strings being processed can contain null bytes and +characters outside the US ASCII range. + +Regular expressions can contain both special and ordinary characters. +Most ordinary characters, like "A", "a", or "0", are the simplest +regular expressions; they simply match themselves. You can +concatenate ordinary characters, so last matches the string 'last'. + +The special characters are: + "." Matches any character except a newline. + "^" Matches the start of the string. + "$" Matches the end of the string or just before the newline at + the end of the string. + "*" Matches 0 or more (greedy) repetitions of the preceding RE. + Greedy means that it will match as many repetitions as possible. + "+" Matches 1 or more (greedy) repetitions of the preceding RE. + "?" Matches 0 or 1 (greedy) of the preceding RE. + *?,+?,?? Non-greedy versions of the previous three special characters. + {m,n} Matches from m to n repetitions of the preceding RE. + {m,n}? Non-greedy version of the above. + "\\" Either escapes special characters or signals a special sequence. + [] Indicates a set of characters. + A "^" as the first character indicates a complementing set. + "|" A|B, creates an RE that will match either A or B. + (...) Matches the RE inside the parentheses. + The contents can be retrieved or matched later in the string. + (?iLmsux) Set the I, L, M, S, U, or X flag for the RE (see below). + (?:...) Non-grouping version of regular parentheses. + (?P...) The substring matched by the group is accessible by name. + (?P=name) Matches the text matched earlier by the group named name. + (?#...) A comment; ignored. + (?=...) Matches if ... matches next, but doesn't consume the string. + (?!...) Matches if ... doesn't match next. + (?<=...) Matches if preceded by ... (must be fixed length). + (?= 0x02020000: + __all__.append("finditer") + def finditer(pattern, string, flags=0): + """Return an iterator over all non-overlapping matches in the + string. For each match, the iterator returns a match object. + + Empty matches are included in the result.""" + return _compile(pattern, flags).finditer(string) + +def compile(pattern, flags=0): + "Compile a regular expression pattern, returning a pattern object." + return _compile(pattern, flags) + +def purge(): + "Clear the regular expression cache" + _cache.clear() + _cache_repl.clear() + +def template(pattern, flags=0): + "Compile a template pattern, returning a pattern object" + return _compile(pattern, flags|T) + +_alphanum = {} +for c in 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890': + _alphanum[c] = 1 +del c + +def escape(pattern): + "Escape all non-alphanumeric characters in pattern." + s = list(pattern) + alphanum = _alphanum + for i, c in enumerate(pattern): + if c not in alphanum: + if c == "\000": + s[i] = "\\000" + else: + s[i] = "\\" + c + return pattern[:0].join(s) + +# -------------------------------------------------------------------- +# internals + +_cache = {} +_cache_repl = {} + +_pattern_type = type(sre_compile.compile("", 0)) + +_MAXCACHE = 100 + +def _compile(*key): + # internal: compile pattern + cachekey = (type(key[0]),) + key + p = _cache.get(cachekey) + if p is not None: + return p + pattern, flags = key + if isinstance(pattern, _pattern_type): + if flags: + raise ValueError('Cannot process flags argument with a compiled pattern') + return pattern + if not sre_compile.isstring(pattern): + raise TypeError, "first argument must be string or compiled pattern" + try: + p = sre_compile.compile(pattern, flags) + except error, v: + raise error, v # invalid expression + if len(_cache) >= _MAXCACHE: + _cache.clear() + _cache[cachekey] = p + return p + +def _compile_repl(*key): + # internal: compile replacement pattern + p = _cache_repl.get(key) + if p is not None: + return p + repl, pattern = key + try: + p = sre_parse.parse_template(repl, pattern) + except error, v: + raise error, v # invalid expression + if len(_cache_repl) >= _MAXCACHE: + _cache_repl.clear() + _cache_repl[key] = p + return p + +def _expand(pattern, match, template): + # internal: match.expand implementation hook + template = sre_parse.parse_template(template, pattern) + return sre_parse.expand_template(template, match) + +def _subx(pattern, template): + # internal: pattern.sub/subn implementation helper + template = _compile_repl(template, pattern) + if not template[0] and len(template[1]) == 1: + # literal replacement + return template[1][0] + def filter(match, template=template): + return sre_parse.expand_template(template, match) + return filter + +# register myself for pickling + +import copy_reg + +def _pickle(p): + return _compile, (p.pattern, p.flags) + +copy_reg.pickle(_pattern_type, _pickle, _compile) + +# -------------------------------------------------------------------- +# experimental stuff (see python-dev discussions for details) + +class Scanner: + def __init__(self, lexicon, flags=0): + from sre_constants import BRANCH, SUBPATTERN + self.lexicon = lexicon + # combine phrases into a compound pattern + p = [] + s = sre_parse.Pattern() + s.flags = flags + for phrase, action in lexicon: + p.append(sre_parse.SubPattern(s, [ + (SUBPATTERN, (len(p)+1, sre_parse.parse(phrase, flags))), + ])) + s.groups = len(p)+1 + p = sre_parse.SubPattern(s, [(BRANCH, (None, p))]) + self.scanner = sre_compile.compile(p) + def scan(self, string): + result = [] + append = result.append + match = self.scanner.scanner(string).match + i = 0 + while 1: + m = match() + if not m: + break + j = m.end() + if i == j: + break + action = self.lexicon[m.lastindex-1][1] + if hasattr(action, '__call__'): + self.match = m + action = action(self, m.group()) + if action is not None: + append(action) + i = j + return result, string[i:] diff --git a/python/testData/MockSdk2.7/bin/python2.7 b/python/testData/MockSdk2.7/bin/python2.7 new file mode 100644 index 000000000000..586f986fd3af --- /dev/null +++ b/python/testData/MockSdk2.7/bin/python2.7 @@ -0,0 +1 @@ +# placeholder for python interpreter diff --git a/python/testData/MockSdk2.7/python_stubs/__builtin__.py b/python/testData/MockSdk2.7/python_stubs/__builtin__.py new file mode 100644 index 000000000000..6ae5948e3546 --- /dev/null +++ b/python/testData/MockSdk2.7/python_stubs/__builtin__.py @@ -0,0 +1,5028 @@ +# encoding: utf-8 +# module __builtin__ +# from (built-in) +# by generator 1.124 +from __future__ import print_function +""" +Built-in functions, exceptions, and other objects. + +Noteworthy: None is the `nil' object; Ellipsis represents `...' in slices. +""" + +# imports +from exceptions import (ArithmeticError, AssertionError, AttributeError, + BaseException, BufferError, BytesWarning, DeprecationWarning, EOFError, + EnvironmentError, Exception, FloatingPointError, FutureWarning, + GeneratorExit, IOError, ImportError, ImportWarning, IndentationError, + IndexError, KeyError, KeyboardInterrupt, LookupError, MemoryError, + NameError, NotImplementedError, OSError, OverflowError, + PendingDeprecationWarning, ReferenceError, RuntimeError, RuntimeWarning, + StandardError, StopIteration, SyntaxError, SyntaxWarning, SystemError, + SystemExit, TabError, TypeError, UnboundLocalError, UnicodeDecodeError, + UnicodeEncodeError, UnicodeError, UnicodeTranslateError, UnicodeWarning, + UserWarning, ValueError, Warning, ZeroDivisionError) + + +# Variables with simple values + +False = False + +None = object() # real value of type replaced + +True = True + +__debug__ = True + +# functions + +def abs(number): # real signature unknown; restored from __doc__ + """ + abs(number) -> number + + Return the absolute value of the argument. + """ + return 0 + + +def all(iterable): # real signature unknown; restored from __doc__ + """ + all(iterable) -> bool + + Return True if bool(x) is True for all values x in the iterable. + """ + return False + + +def any(iterable): # real signature unknown; restored from __doc__ + """ + any(iterable) -> bool + + Return True if bool(x) is True for any x in the iterable. + """ + return False + + +def apply(p_object, args=None, kwargs=None): # real signature unknown; restored from __doc__ + """ + apply(object[, args[, kwargs]]) -> value + + Call a callable object with positional arguments taken from the tuple args, + and keyword arguments taken from the optional dictionary kwargs. + Note that classes are callable, as are instances with a __call__() method. + + Deprecated since release 2.3. Instead, use the extended call syntax: + function(*args, **keywords). + """ + pass + + +def bin(number): # real signature unknown; restored from __doc__ + """ + bin(number) -> string + + Return the binary representation of an integer or long integer. + """ + return "" + + +def callable(p_object): # real signature unknown; restored from __doc__ + """ + callable(object) -> bool + + Return whether the object is callable (i.e., some kind of function). + Note that classes are callable, as are instances with a __call__() method. + """ + return False + + +def chr(i): # real signature unknown; restored from __doc__ + """ + chr(i) -> character + + Return a string of one character with ordinal i; 0 <= i < 256. + """ + return "" + + +def cmp(x, y): # real signature unknown; restored from __doc__ + """ + cmp(x, y) -> integer + + Return negative if xy. + """ + return 0 + + +def coerce(x, y): # real signature unknown; restored from __doc__ + """ + coerce(x, y) -> (x1, y1) + + Return a tuple consisting of the two numeric arguments converted to + a common type, using the same rules as used by arithmetic operations. + If coercion is not possible, raise TypeError. + """ + pass + + +def compile(source, filename, mode, flags=None, dont_inherit=None): # real signature unknown; restored from __doc__ + """ + compile(source, filename, mode[, flags[, dont_inherit]]) -> code object + + Compile the source string (a Python module, statement or expression) + into a code object that can be executed by the exec statement or eval(). + The filename will be used for run-time error messages. + The mode must be 'exec' to compile a module, 'single' to compile a + single (interactive) statement, or 'eval' to compile an expression. + The flags argument, if present, controls which future statements influence + the compilation of the code. + The dont_inherit argument, if non-zero, stops the compilation inheriting + the effects of any future statements in effect in the code calling + compile; if absent or zero these statements do influence the compilation, + in addition to any features explicitly specified. + """ + pass + + +def copyright(*args, **kwargs): # real signature unknown + """ + interactive prompt objects for printing the license text, a list of + contributors and the copyright notice. + """ + pass + + +def credits(*args, **kwargs): # real signature unknown + """ + interactive prompt objects for printing the license text, a list of + contributors and the copyright notice. + """ + pass + + +def delattr(p_object, name): # real signature unknown; restored from __doc__ + """ + delattr(object, name) + + Delete a named attribute on an object; delattr(x, 'y') is equivalent to + ``del x.y''. + """ + pass + + +def dir(p_object=None): # real signature unknown; restored from __doc__ + """ + dir([object]) -> list of strings + + If called without an argument, return the names in the current scope. + Else, return an alphabetized list of names comprising (some of) the attributes + of the given object, and of attributes reachable from it. + If the object supplies a method named __dir__, it will be used; otherwise + the default dir() logic is used and returns: + for a module object: the module's attributes. + for a class object: its attributes, and recursively the attributes + of its bases. + for any other object: its attributes, its class's attributes, and + recursively the attributes of its class's base classes. + """ + return [] + + +def divmod(x, y): # known case of __builtin__.divmod + """ + divmod(x, y) -> (quotient, remainder) + + Return the tuple ((x-x%y)/y, x%y). Invariant: div*y + mod == x. + """ + return (0, 0) + + +def eval(source, globals=None, locals=None): # real signature unknown; restored from __doc__ + """ + eval(source[, globals[, locals]]) -> value + + Evaluate the source in the context of globals and locals. + The source may be a string representing a Python expression + or a code object as returned by compile(). + The globals must be a dictionary and locals can be any mapping, + defaulting to the current globals and locals. + If only globals is given, locals defaults to it. + """ + pass + + +def execfile(filename, globals=None, locals=None): # real signature unknown; restored from __doc__ + """ + execfile(filename[, globals[, locals]]) + + Read and execute a Python script from a file. + The globals and locals are dictionaries, defaulting to the current + globals and locals. If only globals is given, locals defaults to it. + """ + pass + + +def exit(*args, **kwargs): # real signature unknown + pass + + +def filter(function_or_none, sequence): # known special case of filter + """ + filter(function or None, sequence) -> list, tuple, or string + + Return those items of sequence for which function(item) is true. If + function is None, return the items that are true. If sequence is a tuple + or string, return the same type, else return a list. + """ + pass + + +def format(value, format_spec=None): # real signature unknown; restored from __doc__ + """ + format(value[, format_spec]) -> string + + Returns value.__format__(format_spec) + format_spec defaults to "" + """ + return "" + + +def getattr(object, name, default=None): # known special case of getattr + """ + getattr(object, name[, default]) -> value + + Get a named attribute from an object; getattr(x, 'y') is equivalent to x.y. + When a default argument is given, it is returned when the attribute doesn't + exist; without it, an exception is raised in that case. + """ + pass + + +def globals(): # real signature unknown; restored from __doc__ + """ + globals() -> dictionary + + Return the dictionary containing the current scope's global variables. + """ + return {} + + +def hasattr(p_object, name): # real signature unknown; restored from __doc__ + """ + hasattr(object, name) -> bool + + Return whether the object has an attribute with the given name. + (This is done by calling getattr(object, name) and catching exceptions.) + """ + return False + + +def hash(p_object): # real signature unknown; restored from __doc__ + """ + hash(object) -> integer + + Return a hash value for the object. Two objects with the same value have + the same hash value. The reverse is not necessarily true, but likely. + """ + return 0 + + +def help(with_a_twist): # real signature unknown; restored from __doc__ + """ + Define the builtin 'help'. + This is a wrapper around pydoc.help (with a twist). + """ + pass + + +def hex(number): # real signature unknown; restored from __doc__ + """ + hex(number) -> string + + Return the hexadecimal representation of an integer or long integer. + """ + return "" + + +def id(p_object): # real signature unknown; restored from __doc__ + """ + id(object) -> integer + + Return the identity of an object. This is guaranteed to be unique among + simultaneously existing objects. (Hint: it's the object's memory address.) + """ + return 0 + + +def input(prompt=None): # real signature unknown; restored from __doc__ + """ + input([prompt]) -> value + + Equivalent to eval(raw_input(prompt)). + """ + pass + + +def intern(string): # real signature unknown; restored from __doc__ + """ + intern(string) -> string + + ``Intern'' the given string. This enters the string in the (global) + table of interned strings whose purpose is to speed up dictionary lookups. + Return the string itself or the previously interned string object with the + same value. + """ + return "" + + +def isinstance(p_object, class_or_type_or_tuple): # real signature unknown; restored from __doc__ + """ + isinstance(object, class-or-type-or-tuple) -> bool + + Return whether an object is an instance of a class or of a subclass thereof. + With a type as second argument, return whether that is the object's type. + The form using a tuple, isinstance(x, (A, B, ...)), is a shortcut for + isinstance(x, A) or isinstance(x, B) or ... (etc.). + """ + return False + + +def issubclass(C, B): # real signature unknown; restored from __doc__ + """ + issubclass(C, B) -> bool + + Return whether class C is a subclass (i.e., a derived class) of class B. + When using a tuple as the second argument issubclass(X, (A, B, ...)), + is a shortcut for issubclass(X, A) or issubclass(X, B) or ... (etc.). + """ + return False + + +def iter(source, sentinel=None): # known special case of iter + """ + iter(collection) -> iterator + iter(callable, sentinel) -> iterator + + Get an iterator from an object. In the first form, the argument must + supply its own iterator, or be a sequence. + In the second form, the callable is called until it returns the sentinel. + """ + pass + + +def len(p_object): # real signature unknown; restored from __doc__ + """ + len(object) -> integer + + Return the number of items of a sequence or mapping. + """ + return 0 + + +def license(*args, **kwargs): # real signature unknown + """ + interactive prompt objects for printing the license text, a list of + contributors and the copyright notice. + """ + pass + + +def locals(): # real signature unknown; restored from __doc__ + """ + locals() -> dictionary + + Update and return a dictionary containing the current scope's local variables. + """ + return {} + + +def map(function, sequence, *sequence_1): # real signature unknown; restored from __doc__ + """ + map(function, sequence[, sequence, ...]) -> list + + Return a list of the results of applying the function to the items of + the argument sequence(s). If more than one sequence is given, the + function is called with an argument list consisting of the corresponding + item of each sequence, substituting None for missing values when not all + sequences have the same length. If the function is None, return a list of + the items of the sequence (or a list of tuples if more than one sequence). + """ + return [] + + +def max(*args, **kwargs): # known special case of max + """ + max(iterable[, key=func]) -> value + max(a, b, c, ...[, key=func]) -> value + + With a single iterable argument, return its largest item. + With two or more arguments, return the largest argument. + """ + pass + + +def min(*args, **kwargs): # known special case of min + """ + min(iterable[, key=func]) -> value + min(a, b, c, ...[, key=func]) -> value + + With a single iterable argument, return its smallest item. + With two or more arguments, return the smallest argument. + """ + pass + + +def next(iterator, default=None): # real signature unknown; restored from __doc__ + """ + next(iterator[, default]) + + Return the next item from the iterator. If default is given and the iterator + is exhausted, it is returned instead of raising StopIteration. + """ + pass + + +def oct(number): # real signature unknown; restored from __doc__ + """ + oct(number) -> string + + Return the octal representation of an integer or long integer. + """ + return "" + + +def open(name, mode=None, buffering=None): # real signature unknown; restored from __doc__ + """ + open(name[, mode[, buffering]]) -> file object + + Open a file using the file() type, returns a file object. This is the + preferred way to open a file. See file.__doc__ for further information. + """ + return file('/dev/null') + + +def ord(c): # real signature unknown; restored from __doc__ + """ + ord(c) -> integer + + Return the integer ordinal of a one-character string. + """ + return 0 + + +def pow(x, y, z=None): # real signature unknown; restored from __doc__ + """ + pow(x, y[, z]) -> number + + With two arguments, equivalent to x**y. With three arguments, + equivalent to (x**y) % z, but may be more efficient (e.g. for longs). + """ + return 0 + + +def print(*args, **kwargs): # known special case of print + """ + print(value, ..., sep=' ', end='\n', file=sys.stdout) + + Prints the values to a stream, or to sys.stdout by default. + Optional keyword arguments: + file: a file-like object (stream); defaults to the current sys.stdout. + sep: string inserted between values, default a space. + end: string appended after the last value, default a newline. + """ + pass + + +def quit(*args, **kwargs): # real signature unknown + pass + + +def range(start=None, stop=None, step=None): # known special case of range + """ + range([start,] stop[, step]) -> list of integers + + Return a list containing an arithmetic progression of integers. + range(i, j) returns [i, i+1, i+2, ..., j-1]; start (!) defaults to 0. + When step is given, it specifies the increment (or decrement). + For example, range(4) returns [0, 1, 2, 3]. The end point is omitted! + These are exactly the valid indices for a list of 4 elements. + """ + pass + + +def raw_input(prompt=None): # real signature unknown; restored from __doc__ + """ + raw_input([prompt]) -> string + + Read a string from standard input. The trailing newline is stripped. + If the user hits EOF (Unix: Ctl-D, Windows: Ctl-Z+Return), raise EOFError. + On Unix, GNU readline is used if enabled. The prompt string, if given, + is printed without a trailing newline before reading. + """ + return "" + + +def reduce(function, sequence, initial=None): # real signature unknown; restored from __doc__ + """ + reduce(function, sequence[, initial]) -> value + + Apply a function of two arguments cumulatively to the items of a sequence, + from left to right, so as to reduce the sequence to a single value. + For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates + ((((1+2)+3)+4)+5). If initial is present, it is placed before the items + of the sequence in the calculation, and serves as a default when the + sequence is empty. + """ + pass + + +def reload(module): # real signature unknown; restored from __doc__ + """ + reload(module) -> module + + Reload the module. The module must have been successfully imported before. + """ + pass + + +def repr(p_object): # real signature unknown; restored from __doc__ + """ + repr(object) -> string + + Return the canonical string representation of the object. + For most object types, eval(repr(object)) == object. + """ + return "" + + +def round(number, ndigits=None): # real signature unknown; restored from __doc__ + """ + round(number[, ndigits]) -> floating point number + + Round a number to a given precision in decimal digits (default 0 digits). + This always returns a floating point number. Precision may be negative. + """ + return 0.0 + + +def setattr(p_object, name, value): # real signature unknown; restored from __doc__ + """ + setattr(object, name, value) + + Set a named attribute on an object; setattr(x, 'y', v) is equivalent to + ``x.y = v''. + """ + pass + + +def sorted(iterable, cmp=None, key=None, reverse=False): # real signature unknown; restored from __doc__ + """ sorted(iterable, cmp=None, key=None, reverse=False) --> new sorted list """ + pass + + +def sum(sequence, start=None): # real signature unknown; restored from __doc__ + """ + sum(sequence[, start]) -> value + + Returns the sum of a sequence of numbers (NOT strings) plus the value + of parameter 'start' (which defaults to 0). When the sequence is + empty, returns start. + """ + pass + + +def unichr(i): # real signature unknown; restored from __doc__ + """ + unichr(i) -> Unicode character + + Return a Unicode string of one character with ordinal i; 0 <= i <= 0x10ffff. + """ + return u"" + + +def vars(p_object=None): # real signature unknown; restored from __doc__ + """ + vars([object]) -> dictionary + + Without arguments, equivalent to locals(). + With an argument, equivalent to object.__dict__. + """ + return {} + + +def zip(seq1, seq2, *more_seqs): # known special case of zip + """ + zip(seq1 [, seq2 [...]]) -> [(seq1[0], seq2[0] ...), (...)] + + Return a list of tuples, where each tuple contains the i-th element + from each of the argument sequences. The returned list is truncated + in length to the length of the shortest argument sequence. + """ + pass + + +def __import__(name, globals={}, locals={}, fromlist=[], level=-1): # real signature unknown; restored from __doc__ + """ + __import__(name, globals={}, locals={}, fromlist=[], level=-1) -> module + + Import a module. The globals are only used to determine the context; + they are not modified. The locals are currently unused. The fromlist + should be a list of names to emulate ``from name import ...'', or an + empty list to emulate ``import name''. + When importing a module from a package, note that __import__('A.B', ...) + returns package A when fromlist is empty, but its submodule B when + fromlist is not empty. Level is used to determine whether to perform + absolute or relative imports. -1 is the original strategy of attempting + both absolute and relative imports, 0 is absolute, a positive number + is the number of parent directories to search relative to the current module. + """ + pass + + +# classes + +class object: + """ The most base type """ + def __delattr__(self, name): # real signature unknown; restored from __doc__ + """ x.__delattr__('name') <==> del x.name """ + pass + + def __format__(self, *args, **kwargs): # real signature unknown + """ default object formatter """ + pass + + def __getattribute__(self, name): # real signature unknown; restored from __doc__ + """ x.__getattribute__('name') <==> x.name """ + pass + + def __hash__(self): # real signature unknown; restored from __doc__ + """ x.__hash__() <==> hash(x) """ + pass + + def __init__(self): # known special case of object.__init__ + """ x.__init__(...) initializes x; see help(type(x)) for signature """ + pass + + @staticmethod # known case of __new__ + def __new__(cls, *more): # known special case of object.__new__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + def __reduce_ex__(self, *args, **kwargs): # real signature unknown + """ helper for pickle """ + pass + + def __reduce__(self, *args, **kwargs): # real signature unknown + """ helper for pickle """ + pass + + def __repr__(self): # real signature unknown; restored from __doc__ + """ x.__repr__() <==> repr(x) """ + pass + + def __setattr__(self, name, value): # real signature unknown; restored from __doc__ + """ x.__setattr__('name', value) <==> x.name = value """ + pass + + def __sizeof__(self): # real signature unknown; restored from __doc__ + """ + __sizeof__() -> int + size of object in memory, in bytes + """ + return 0 + + def __str__(self): # real signature unknown; restored from __doc__ + """ x.__str__() <==> str(x) """ + pass + + @classmethod # known case + def __subclasshook__(cls, subclass): # known special case of object.__subclasshook__ + """ + Abstract classes can override this to customize issubclass(). + + This is invoked early on by abc.ABCMeta.__subclasscheck__(). + It should return True, False or NotImplemented. If it returns + NotImplemented, the normal algorithm is used. Otherwise, it + overrides the normal algorithm (and the outcome is cached). + """ + pass + + __class__ = None # (!) forward: type, real value is '' + __dict__ = {} + __doc__ = '' + __module__ = '' + + +class basestring(object): + """ Type basestring cannot be instantiated; it is the base for str and unicode. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class int(object): + """ + int(x[, base]) -> integer + + Convert a string or number to an integer, if possible. A floating point + argument will be truncated towards zero (this does not include a string + representation of a floating point number!) When converting a string, use + the optional base. It is an error to supply a base when converting a + non-string. If base is zero, the proper base is guessed based on the + string content. If the argument is outside the integer range a + long object will be returned instead. + """ + def bit_length(self): # real signature unknown; restored from __doc__ + """ + int.bit_length() -> int + + Number of bits necessary to represent self in binary. + >>> bin(37) + '0b100101' + >>> (37).bit_length() + 6 + """ + return 0 + + def conjugate(self, *args, **kwargs): # real signature unknown + """ Returns self, the complex conjugate of any int. """ + pass + + def __abs__(self): # real signature unknown; restored from __doc__ + """ x.__abs__() <==> abs(x) """ + pass + + def __add__(self, y): # real signature unknown; restored from __doc__ + """ x.__add__(y) <==> x+y """ + pass + + def __and__(self, y): # real signature unknown; restored from __doc__ + """ x.__and__(y) <==> x&y """ + pass + + def __cmp__(self, y): # real signature unknown; restored from __doc__ + """ x.__cmp__(y) <==> cmp(x,y) """ + pass + + def __coerce__(self, y): # real signature unknown; restored from __doc__ + """ x.__coerce__(y) <==> coerce(x, y) """ + pass + + def __divmod__(self, y): # real signature unknown; restored from __doc__ + """ x.__divmod__(y) <==> divmod(x, y) """ + pass + + def __div__(self, y): # real signature unknown; restored from __doc__ + """ x.__div__(y) <==> x/y """ + pass + + def __float__(self): # real signature unknown; restored from __doc__ + """ x.__float__() <==> float(x) """ + pass + + def __floordiv__(self, y): # real signature unknown; restored from __doc__ + """ x.__floordiv__(y) <==> x//y """ + pass + + def __format__(self, *args, **kwargs): # real signature unknown + pass + + def __getattribute__(self, name): # real signature unknown; restored from __doc__ + """ x.__getattribute__('name') <==> x.name """ + pass + + def __getnewargs__(self, *args, **kwargs): # real signature unknown + pass + + def __hash__(self): # real signature unknown; restored from __doc__ + """ x.__hash__() <==> hash(x) """ + pass + + def __hex__(self): # real signature unknown; restored from __doc__ + """ x.__hex__() <==> hex(x) """ + pass + + def __index__(self): # real signature unknown; restored from __doc__ + """ x[y:z] <==> x[y.__index__():z.__index__()] """ + pass + + def __init__(self, x, base=10): # known special case of int.__init__ + """ + int(x[, base]) -> integer + + Convert a string or number to an integer, if possible. A floating point + argument will be truncated towards zero (this does not include a string + representation of a floating point number!) When converting a string, use + the optional base. It is an error to supply a base when converting a + non-string. If base is zero, the proper base is guessed based on the + string content. If the argument is outside the integer range a + long object will be returned instead. + # (copied from class doc) + """ + pass + + def __int__(self): # real signature unknown; restored from __doc__ + """ x.__int__() <==> int(x) """ + pass + + def __invert__(self): # real signature unknown; restored from __doc__ + """ x.__invert__() <==> ~x """ + pass + + def __long__(self): # real signature unknown; restored from __doc__ + """ x.__long__() <==> long(x) """ + pass + + def __lshift__(self, y): # real signature unknown; restored from __doc__ + """ x.__lshift__(y) <==> x< x%y """ + pass + + def __mul__(self, y): # real signature unknown; restored from __doc__ + """ x.__mul__(y) <==> x*y """ + pass + + def __neg__(self): # real signature unknown; restored from __doc__ + """ x.__neg__() <==> -x """ + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + def __nonzero__(self): # real signature unknown; restored from __doc__ + """ x.__nonzero__() <==> x != 0 """ + pass + + def __oct__(self): # real signature unknown; restored from __doc__ + """ x.__oct__() <==> oct(x) """ + pass + + def __or__(self, y): # real signature unknown; restored from __doc__ + """ x.__or__(y) <==> x|y """ + pass + + def __pos__(self): # real signature unknown; restored from __doc__ + """ x.__pos__() <==> +x """ + pass + + def __pow__(self, y, z=None): # real signature unknown; restored from __doc__ + """ x.__pow__(y[, z]) <==> pow(x, y[, z]) """ + pass + + def __radd__(self, y): # real signature unknown; restored from __doc__ + """ x.__radd__(y) <==> y+x """ + pass + + def __rand__(self, y): # real signature unknown; restored from __doc__ + """ x.__rand__(y) <==> y&x """ + pass + + def __rdivmod__(self, y): # real signature unknown; restored from __doc__ + """ x.__rdivmod__(y) <==> divmod(y, x) """ + pass + + def __rdiv__(self, y): # real signature unknown; restored from __doc__ + """ x.__rdiv__(y) <==> y/x """ + pass + + def __repr__(self): # real signature unknown; restored from __doc__ + """ x.__repr__() <==> repr(x) """ + pass + + def __rfloordiv__(self, y): # real signature unknown; restored from __doc__ + """ x.__rfloordiv__(y) <==> y//x """ + pass + + def __rlshift__(self, y): # real signature unknown; restored from __doc__ + """ x.__rlshift__(y) <==> y< y%x """ + pass + + def __rmul__(self, y): # real signature unknown; restored from __doc__ + """ x.__rmul__(y) <==> y*x """ + pass + + def __ror__(self, y): # real signature unknown; restored from __doc__ + """ x.__ror__(y) <==> y|x """ + pass + + def __rpow__(self, x, z=None): # real signature unknown; restored from __doc__ + """ y.__rpow__(x[, z]) <==> pow(x, y[, z]) """ + pass + + def __rrshift__(self, y): # real signature unknown; restored from __doc__ + """ x.__rrshift__(y) <==> y>>x """ + pass + + def __rshift__(self, y): # real signature unknown; restored from __doc__ + """ x.__rshift__(y) <==> x>>y """ + pass + + def __rsub__(self, y): # real signature unknown; restored from __doc__ + """ x.__rsub__(y) <==> y-x """ + pass + + def __rtruediv__(self, y): # real signature unknown; restored from __doc__ + """ x.__rtruediv__(y) <==> y/x """ + pass + + def __rxor__(self, y): # real signature unknown; restored from __doc__ + """ x.__rxor__(y) <==> y^x """ + pass + + def __str__(self): # real signature unknown; restored from __doc__ + """ x.__str__() <==> str(x) """ + pass + + def __sub__(self, y): # real signature unknown; restored from __doc__ + """ x.__sub__(y) <==> x-y """ + pass + + def __truediv__(self, y): # real signature unknown; restored from __doc__ + """ x.__truediv__(y) <==> x/y """ + pass + + def __trunc__(self, *args, **kwargs): # real signature unknown + """ Truncating an Integral returns itself. """ + pass + + def __xor__(self, y): # real signature unknown; restored from __doc__ + """ x.__xor__(y) <==> x^y """ + pass + + denominator = property(lambda self: object()) # default + imag = property(lambda self: object()) # default + numerator = property(lambda self: object()) # default + real = property(lambda self: object()) # default + + +class bool(int): + """ + bool(x) -> bool + + Returns True when the argument x is true, False otherwise. + The builtins True and False are the only two instances of the class bool. + The class bool is a subclass of the class int, and cannot be subclassed. + """ + def __and__(self, y): # real signature unknown; restored from __doc__ + """ x.__and__(y) <==> x&y """ + pass + + def __init__(self, x): # real signature unknown; restored from __doc__ + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + def __or__(self, y): # real signature unknown; restored from __doc__ + """ x.__or__(y) <==> x|y """ + pass + + def __rand__(self, y): # real signature unknown; restored from __doc__ + """ x.__rand__(y) <==> y&x """ + pass + + def __repr__(self): # real signature unknown; restored from __doc__ + """ x.__repr__() <==> repr(x) """ + pass + + def __ror__(self, y): # real signature unknown; restored from __doc__ + """ x.__ror__(y) <==> y|x """ + pass + + def __rxor__(self, y): # real signature unknown; restored from __doc__ + """ x.__rxor__(y) <==> y^x """ + pass + + def __str__(self): # real signature unknown; restored from __doc__ + """ x.__str__() <==> str(x) """ + pass + + def __xor__(self, y): # real signature unknown; restored from __doc__ + """ x.__xor__(y) <==> x^y """ + pass + + +class buffer(object): + """ + buffer(object [, offset[, size]]) + + Create a new buffer object which references the given object. + The buffer will reference a slice of the target object from the + start of the object (or at the specified offset). The slice will + extend to the end of the target object (or with the specified size). + """ + def __add__(self, y): # real signature unknown; restored from __doc__ + """ x.__add__(y) <==> x+y """ + pass + + def __cmp__(self, y): # real signature unknown; restored from __doc__ + """ x.__cmp__(y) <==> cmp(x,y) """ + pass + + def __delitem__(self, y): # real signature unknown; restored from __doc__ + """ x.__delitem__(y) <==> del x[y] """ + pass + + def __delslice__(self, i, j): # real signature unknown; restored from __doc__ + """ + x.__delslice__(i, j) <==> del x[i:j] + + Use of negative indices is not supported. + """ + pass + + def __getattribute__(self, name): # real signature unknown; restored from __doc__ + """ x.__getattribute__('name') <==> x.name """ + pass + + def __getitem__(self, y): # real signature unknown; restored from __doc__ + """ x.__getitem__(y) <==> x[y] """ + pass + + def __getslice__(self, i, j): # real signature unknown; restored from __doc__ + """ + x.__getslice__(i, j) <==> x[i:j] + + Use of negative indices is not supported. + """ + pass + + def __hash__(self): # real signature unknown; restored from __doc__ + """ x.__hash__() <==> hash(x) """ + pass + + def __init__(self, p_object, offset=None, size=None): # real signature unknown; restored from __doc__ + pass + + def __len__(self): # real signature unknown; restored from __doc__ + """ x.__len__() <==> len(x) """ + pass + + def __mul__(self, n): # real signature unknown; restored from __doc__ + """ x.__mul__(n) <==> x*n """ + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + def __repr__(self): # real signature unknown; restored from __doc__ + """ x.__repr__() <==> repr(x) """ + pass + + def __rmul__(self, n): # real signature unknown; restored from __doc__ + """ x.__rmul__(n) <==> n*x """ + pass + + def __setitem__(self, i, y): # real signature unknown; restored from __doc__ + """ x.__setitem__(i, y) <==> x[i]=y """ + pass + + def __setslice__(self, i, j, y): # real signature unknown; restored from __doc__ + """ + x.__setslice__(i, j, y) <==> x[i:j]=y + + Use of negative indices is not supported. + """ + pass + + def __str__(self): # real signature unknown; restored from __doc__ + """ x.__str__() <==> str(x) """ + pass + + +class bytearray(object): + """ + bytearray(iterable_of_ints) -> bytearray. + bytearray(string, encoding[, errors]) -> bytearray. + bytearray(bytes_or_bytearray) -> mutable copy of bytes_or_bytearray. + bytearray(memory_view) -> bytearray. + + Construct an mutable bytearray object from: + - an iterable yielding integers in range(256) + - a text string encoded using the specified encoding + - a bytes or a bytearray object + - any object implementing the buffer API. + + bytearray(int) -> bytearray. + + Construct a zero-initialized bytearray of the given length. + """ + def append(self, p_int): # real signature unknown; restored from __doc__ + """ + B.append(int) -> None + + Append a single item to the end of B. + """ + pass + + def capitalize(self): # real signature unknown; restored from __doc__ + """ + B.capitalize() -> copy of B + + Return a copy of B with only its first character capitalized (ASCII) + and the rest lower-cased. + """ + pass + + def center(self, width, fillchar=None): # real signature unknown; restored from __doc__ + """ + B.center(width[, fillchar]) -> copy of B + + Return B centered in a string of length width. Padding is + done using the specified fill character (default is a space). + """ + pass + + def count(self, sub, start=None, end=None): # real signature unknown; restored from __doc__ + """ + B.count(sub [,start [,end]]) -> int + + Return the number of non-overlapping occurrences of subsection sub in + bytes B[start:end]. Optional arguments start and end are interpreted + as in slice notation. + """ + return 0 + + def decode(self, encoding=None, errors=None): # real signature unknown; restored from __doc__ + """ + B.decode([encoding[, errors]]) -> unicode object. + + Decodes B using the codec registered for encoding. encoding defaults + to the default encoding. errors may be given to set a different error + handling scheme. Default is 'strict' meaning that encoding errors raise + a UnicodeDecodeError. Other possible values are 'ignore' and 'replace' + as well as any other name registered with codecs.register_error that is + able to handle UnicodeDecodeErrors. + """ + return u"" + + def endswith(self, suffix, start=None, end=None): # real signature unknown; restored from __doc__ + """ + B.endswith(suffix [,start [,end]]) -> bool + + Return True if B ends with the specified suffix, False otherwise. + With optional start, test B beginning at that position. + With optional end, stop comparing B at that position. + suffix can also be a tuple of strings to try. + """ + return False + + def expandtabs(self, tabsize=None): # real signature unknown; restored from __doc__ + """ + B.expandtabs([tabsize]) -> copy of B + + Return a copy of B where all tab characters are expanded using spaces. + If tabsize is not given, a tab size of 8 characters is assumed. + """ + pass + + def extend(self, iterable_int): # real signature unknown; restored from __doc__ + """ + B.extend(iterable int) -> None + + Append all the elements from the iterator or sequence to the + end of B. + """ + pass + + def find(self, sub, start=None, end=None): # real signature unknown; restored from __doc__ + """ + B.find(sub [,start [,end]]) -> int + + Return the lowest index in B where subsection sub is found, + such that sub is contained within B[start,end]. Optional + arguments start and end are interpreted as in slice notation. + + Return -1 on failure. + """ + return 0 + + @classmethod # known case + def fromhex(cls, string): # real signature unknown; restored from __doc__ + """ + bytearray.fromhex(string) -> bytearray + + Create a bytearray object from a string of hexadecimal numbers. + Spaces between two numbers are accepted. + Example: bytearray.fromhex('B9 01EF') -> bytearray(b'\xb9\x01\xef'). + """ + return bytearray + + def index(self, sub, start=None, end=None): # real signature unknown; restored from __doc__ + """ + B.index(sub [,start [,end]]) -> int + + Like B.find() but raise ValueError when the subsection is not found. + """ + return 0 + + def insert(self, index, p_int): # real signature unknown; restored from __doc__ + """ + B.insert(index, int) -> None + + Insert a single item into the bytearray before the given index. + """ + pass + + def isalnum(self): # real signature unknown; restored from __doc__ + """ + B.isalnum() -> bool + + Return True if all characters in B are alphanumeric + and there is at least one character in B, False otherwise. + """ + return False + + def isalpha(self): # real signature unknown; restored from __doc__ + """ + B.isalpha() -> bool + + Return True if all characters in B are alphabetic + and there is at least one character in B, False otherwise. + """ + return False + + def isdigit(self): # real signature unknown; restored from __doc__ + """ + B.isdigit() -> bool + + Return True if all characters in B are digits + and there is at least one character in B, False otherwise. + """ + return False + + def islower(self): # real signature unknown; restored from __doc__ + """ + B.islower() -> bool + + Return True if all cased characters in B are lowercase and there is + at least one cased character in B, False otherwise. + """ + return False + + def isspace(self): # real signature unknown; restored from __doc__ + """ + B.isspace() -> bool + + Return True if all characters in B are whitespace + and there is at least one character in B, False otherwise. + """ + return False + + def istitle(self): # real signature unknown; restored from __doc__ + """ + B.istitle() -> bool + + Return True if B is a titlecased string and there is at least one + character in B, i.e. uppercase characters may only follow uncased + characters and lowercase characters only cased ones. Return False + otherwise. + """ + return False + + def isupper(self): # real signature unknown; restored from __doc__ + """ + B.isupper() -> bool + + Return True if all cased characters in B are uppercase and there is + at least one cased character in B, False otherwise. + """ + return False + + def join(self, iterable_of_bytes): # real signature unknown; restored from __doc__ + """ + B.join(iterable_of_bytes) -> bytes + + Concatenates any number of bytearray objects, with B in between each pair. + """ + return "" + + def ljust(self, width, fillchar=None): # real signature unknown; restored from __doc__ + """ + B.ljust(width[, fillchar]) -> copy of B + + Return B left justified in a string of length width. Padding is + done using the specified fill character (default is a space). + """ + pass + + def lower(self): # real signature unknown; restored from __doc__ + """ + B.lower() -> copy of B + + Return a copy of B with all ASCII characters converted to lowercase. + """ + pass + + def lstrip(self, bytes=None): # real signature unknown; restored from __doc__ + """ + B.lstrip([bytes]) -> bytearray + + Strip leading bytes contained in the argument. + If the argument is omitted, strip leading ASCII whitespace. + """ + return bytearray + + def partition(self, sep): # real signature unknown; restored from __doc__ + """ + B.partition(sep) -> (head, sep, tail) + + Searches for the separator sep in B, and returns the part before it, + the separator itself, and the part after it. If the separator is not + found, returns B and two empty bytearray objects. + """ + pass + + def pop(self, index=None): # real signature unknown; restored from __doc__ + """ + B.pop([index]) -> int + + Remove and return a single item from B. If no index + argument is given, will pop the last value. + """ + return 0 + + def remove(self, p_int): # real signature unknown; restored from __doc__ + """ + B.remove(int) -> None + + Remove the first occurance of a value in B. + """ + pass + + def replace(self, old, new, count=None): # real signature unknown; restored from __doc__ + """ + B.replace(old, new[, count]) -> bytes + + Return a copy of B with all occurrences of subsection + old replaced by new. If the optional argument count is + given, only the first count occurrences are replaced. + """ + return "" + + def reverse(self): # real signature unknown; restored from __doc__ + """ + B.reverse() -> None + + Reverse the order of the values in B in place. + """ + pass + + def rfind(self, sub, start=None, end=None): # real signature unknown; restored from __doc__ + """ + B.rfind(sub [,start [,end]]) -> int + + Return the highest index in B where subsection sub is found, + such that sub is contained within B[start,end]. Optional + arguments start and end are interpreted as in slice notation. + + Return -1 on failure. + """ + return 0 + + def rindex(self, sub, start=None, end=None): # real signature unknown; restored from __doc__ + """ + B.rindex(sub [,start [,end]]) -> int + + Like B.rfind() but raise ValueError when the subsection is not found. + """ + return 0 + + def rjust(self, width, fillchar=None): # real signature unknown; restored from __doc__ + """ + B.rjust(width[, fillchar]) -> copy of B + + Return B right justified in a string of length width. Padding is + done using the specified fill character (default is a space) + """ + pass + + def rpartition(self, sep): # real signature unknown; restored from __doc__ + """ + B.rpartition(sep) -> (head, sep, tail) + + Searches for the separator sep in B, starting at the end of B, + and returns the part before it, the separator itself, and the + part after it. If the separator is not found, returns two empty + bytearray objects and B. + """ + pass + + def rsplit(self, sep, maxsplit=None): # real signature unknown; restored from __doc__ + """ + B.rsplit(sep[, maxsplit]) -> list of bytearray + + Return a list of the sections in B, using sep as the delimiter, + starting at the end of B and working to the front. + If sep is not given, B is split on ASCII whitespace characters + (space, tab, return, newline, formfeed, vertical tab). + If maxsplit is given, at most maxsplit splits are done. + """ + return [] + + def rstrip(self, bytes=None): # real signature unknown; restored from __doc__ + """ + B.rstrip([bytes]) -> bytearray + + Strip trailing bytes contained in the argument. + If the argument is omitted, strip trailing ASCII whitespace. + """ + return bytearray + + def split(self, sep=None, maxsplit=None): # real signature unknown; restored from __doc__ + """ + B.split([sep[, maxsplit]]) -> list of bytearray + + Return a list of the sections in B, using sep as the delimiter. + If sep is not given, B is split on ASCII whitespace characters + (space, tab, return, newline, formfeed, vertical tab). + If maxsplit is given, at most maxsplit splits are done. + """ + return [] + + def splitlines(self, keepends=None): # real signature unknown; restored from __doc__ + """ + B.splitlines([keepends]) -> list of lines + + Return a list of the lines in B, breaking at line boundaries. + Line breaks are not included in the resulting list unless keepends + is given and true. + """ + return [] + + def startswith(self, prefix, start=None, end=None): # real signature unknown; restored from __doc__ + """ + B.startswith(prefix [,start [,end]]) -> bool + + Return True if B starts with the specified prefix, False otherwise. + With optional start, test B beginning at that position. + With optional end, stop comparing B at that position. + prefix can also be a tuple of strings to try. + """ + return False + + def strip(self, bytes=None): # real signature unknown; restored from __doc__ + """ + B.strip([bytes]) -> bytearray + + Strip leading and trailing bytes contained in the argument. + If the argument is omitted, strip ASCII whitespace. + """ + return bytearray + + def swapcase(self): # real signature unknown; restored from __doc__ + """ + B.swapcase() -> copy of B + + Return a copy of B with uppercase ASCII characters converted + to lowercase ASCII and vice versa. + """ + pass + + def title(self): # real signature unknown; restored from __doc__ + """ + B.title() -> copy of B + + Return a titlecased version of B, i.e. ASCII words start with uppercase + characters, all remaining cased characters have lowercase. + """ + pass + + def translate(self, table, deletechars=None): # real signature unknown; restored from __doc__ + """ + B.translate(table[, deletechars]) -> bytearray + + Return a copy of B, where all characters occurring in the + optional argument deletechars are removed, and the remaining + characters have been mapped through the given translation + table, which must be a bytes object of length 256. + """ + return bytearray + + def upper(self): # real signature unknown; restored from __doc__ + """ + B.upper() -> copy of B + + Return a copy of B with all ASCII characters converted to uppercase. + """ + pass + + def zfill(self, width): # real signature unknown; restored from __doc__ + """ + B.zfill(width) -> copy of B + + Pad a numeric string B with zeros on the left, to fill a field + of the specified width. B is never truncated. + """ + pass + + def __add__(self, y): # real signature unknown; restored from __doc__ + """ x.__add__(y) <==> x+y """ + pass + + def __alloc__(self): # real signature unknown; restored from __doc__ + """ + B.__alloc__() -> int + + Returns the number of bytes actually allocated. + """ + return 0 + + def __contains__(self, y): # real signature unknown; restored from __doc__ + """ x.__contains__(y) <==> y in x """ + pass + + def __delitem__(self, y): # real signature unknown; restored from __doc__ + """ x.__delitem__(y) <==> del x[y] """ + pass + + def __eq__(self, y): # real signature unknown; restored from __doc__ + """ x.__eq__(y) <==> x==y """ + pass + + def __getattribute__(self, name): # real signature unknown; restored from __doc__ + """ x.__getattribute__('name') <==> x.name """ + pass + + def __getitem__(self, y): # real signature unknown; restored from __doc__ + """ x.__getitem__(y) <==> x[y] """ + pass + + def __ge__(self, y): # real signature unknown; restored from __doc__ + """ x.__ge__(y) <==> x>=y """ + pass + + def __gt__(self, y): # real signature unknown; restored from __doc__ + """ x.__gt__(y) <==> x>y """ + pass + + def __iadd__(self, y): # real signature unknown; restored from __doc__ + """ x.__iadd__(y) <==> x+=y """ + pass + + def __imul__(self, y): # real signature unknown; restored from __doc__ + """ x.__imul__(y) <==> x*=y """ + pass + + def __init__(self, source=None, encoding=None, errors='strict'): # known special case of bytearray.__init__ + """ + bytearray(iterable_of_ints) -> bytearray. + bytearray(string, encoding[, errors]) -> bytearray. + bytearray(bytes_or_bytearray) -> mutable copy of bytes_or_bytearray. + bytearray(memory_view) -> bytearray. + + Construct an mutable bytearray object from: + - an iterable yielding integers in range(256) + - a text string encoded using the specified encoding + - a bytes or a bytearray object + - any object implementing the buffer API. + + bytearray(int) -> bytearray. + + Construct a zero-initialized bytearray of the given length. + # (copied from class doc) + """ + pass + + def __iter__(self): # real signature unknown; restored from __doc__ + """ x.__iter__() <==> iter(x) """ + pass + + def __len__(self): # real signature unknown; restored from __doc__ + """ x.__len__() <==> len(x) """ + pass + + def __le__(self, y): # real signature unknown; restored from __doc__ + """ x.__le__(y) <==> x<=y """ + pass + + def __lt__(self, y): # real signature unknown; restored from __doc__ + """ x.__lt__(y) <==> x x*n """ + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + def __ne__(self, y): # real signature unknown; restored from __doc__ + """ x.__ne__(y) <==> x!=y """ + pass + + def __reduce__(self, *args, **kwargs): # real signature unknown + """ Return state information for pickling. """ + pass + + def __repr__(self): # real signature unknown; restored from __doc__ + """ x.__repr__() <==> repr(x) """ + pass + + def __rmul__(self, n): # real signature unknown; restored from __doc__ + """ x.__rmul__(n) <==> n*x """ + pass + + def __setitem__(self, i, y): # real signature unknown; restored from __doc__ + """ x.__setitem__(i, y) <==> x[i]=y """ + pass + + def __sizeof__(self): # real signature unknown; restored from __doc__ + """ + B.__sizeof__() -> int + + Returns the size of B in memory, in bytes + """ + return 0 + + def __str__(self): # real signature unknown; restored from __doc__ + """ x.__str__() <==> str(x) """ + pass + + +class str(basestring): + """ + str(object) -> string + + Return a nice string representation of the object. + If the argument is a string, the return value is the same object. + """ + def capitalize(self): # real signature unknown; restored from __doc__ + """ + S.capitalize() -> string + + Return a copy of the string S with only its first character + capitalized. + """ + return "" + + def center(self, width, fillchar=None): # real signature unknown; restored from __doc__ + """ + S.center(width[, fillchar]) -> string + + Return S centered in a string of length width. Padding is + done using the specified fill character (default is a space) + """ + return "" + + def count(self, sub, start=None, end=None): # real signature unknown; restored from __doc__ + """ + S.count(sub[, start[, end]]) -> int + + Return the number of non-overlapping occurrences of substring sub in + string S[start:end]. Optional arguments start and end are interpreted + as in slice notation. + """ + return 0 + + def decode(self, encoding=None, errors=None): # real signature unknown; restored from __doc__ + """ + S.decode([encoding[,errors]]) -> object + + Decodes S using the codec registered for encoding. encoding defaults + to the default encoding. errors may be given to set a different error + handling scheme. Default is 'strict' meaning that encoding errors raise + a UnicodeDecodeError. Other possible values are 'ignore' and 'replace' + as well as any other name registered with codecs.register_error that is + able to handle UnicodeDecodeErrors. + """ + return object() + + def encode(self, encoding=None, errors=None): # real signature unknown; restored from __doc__ + """ + S.encode([encoding[,errors]]) -> object + + Encodes S using the codec registered for encoding. encoding defaults + to the default encoding. errors may be given to set a different error + handling scheme. Default is 'strict' meaning that encoding errors raise + a UnicodeEncodeError. Other possible values are 'ignore', 'replace' and + 'xmlcharrefreplace' as well as any other name registered with + codecs.register_error that is able to handle UnicodeEncodeErrors. + """ + return object() + + def endswith(self, suffix, start=None, end=None): # real signature unknown; restored from __doc__ + """ + S.endswith(suffix[, start[, end]]) -> bool + + Return True if S ends with the specified suffix, False otherwise. + With optional start, test S beginning at that position. + With optional end, stop comparing S at that position. + suffix can also be a tuple of strings to try. + """ + return False + + def expandtabs(self, tabsize=None): # real signature unknown; restored from __doc__ + """ + S.expandtabs([tabsize]) -> string + + Return a copy of S where all tab characters are expanded using spaces. + If tabsize is not given, a tab size of 8 characters is assumed. + """ + return "" + + def find(self, sub, start=None, end=None): # real signature unknown; restored from __doc__ + """ + S.find(sub [,start [,end]]) -> int + + Return the lowest index in S where substring sub is found, + such that sub is contained within S[start:end]. Optional + arguments start and end are interpreted as in slice notation. + + Return -1 on failure. + """ + return 0 + + def format(*args, **kwargs): # known special case of str.format + """ + S.format(*args, **kwargs) -> string + + Return a formatted version of S, using substitutions from args and kwargs. + The substitutions are identified by braces ('{' and '}'). + """ + pass + + def index(self, sub, start=None, end=None): # real signature unknown; restored from __doc__ + """ + S.index(sub [,start [,end]]) -> int + + Like S.find() but raise ValueError when the substring is not found. + """ + return 0 + + def isalnum(self): # real signature unknown; restored from __doc__ + """ + S.isalnum() -> bool + + Return True if all characters in S are alphanumeric + and there is at least one character in S, False otherwise. + """ + return False + + def isalpha(self): # real signature unknown; restored from __doc__ + """ + S.isalpha() -> bool + + Return True if all characters in S are alphabetic + and there is at least one character in S, False otherwise. + """ + return False + + def isdigit(self): # real signature unknown; restored from __doc__ + """ + S.isdigit() -> bool + + Return True if all characters in S are digits + and there is at least one character in S, False otherwise. + """ + return False + + def islower(self): # real signature unknown; restored from __doc__ + """ + S.islower() -> bool + + Return True if all cased characters in S are lowercase and there is + at least one cased character in S, False otherwise. + """ + return False + + def isspace(self): # real signature unknown; restored from __doc__ + """ + S.isspace() -> bool + + Return True if all characters in S are whitespace + and there is at least one character in S, False otherwise. + """ + return False + + def istitle(self): # real signature unknown; restored from __doc__ + """ + S.istitle() -> bool + + Return True if S is a titlecased string and there is at least one + character in S, i.e. uppercase characters may only follow uncased + characters and lowercase characters only cased ones. Return False + otherwise. + """ + return False + + def isupper(self): # real signature unknown; restored from __doc__ + """ + S.isupper() -> bool + + Return True if all cased characters in S are uppercase and there is + at least one cased character in S, False otherwise. + """ + return False + + def join(self, iterable): # real signature unknown; restored from __doc__ + """ + S.join(iterable) -> string + + Return a string which is the concatenation of the strings in the + iterable. The separator between elements is S. + """ + return "" + + def ljust(self, width, fillchar=None): # real signature unknown; restored from __doc__ + """ + S.ljust(width[, fillchar]) -> string + + Return S left-justified in a string of length width. Padding is + done using the specified fill character (default is a space). + """ + return "" + + def lower(self): # real signature unknown; restored from __doc__ + """ + S.lower() -> string + + Return a copy of the string S converted to lowercase. + """ + return "" + + def lstrip(self, chars=None): # real signature unknown; restored from __doc__ + """ + S.lstrip([chars]) -> string or unicode + + Return a copy of the string S with leading whitespace removed. + If chars is given and not None, remove characters in chars instead. + If chars is unicode, S will be converted to unicode before stripping + """ + return "" + + def partition(self, sep): # real signature unknown; restored from __doc__ + """ + S.partition(sep) -> (head, sep, tail) + + Search for the separator sep in S, and return the part before it, + the separator itself, and the part after it. If the separator is not + found, return S and two empty strings. + """ + pass + + def replace(self, old, new, count=None): # real signature unknown; restored from __doc__ + """ + S.replace(old, new[, count]) -> string + + Return a copy of string S with all occurrences of substring + old replaced by new. If the optional argument count is + given, only the first count occurrences are replaced. + """ + return "" + + def rfind(self, sub, start=None, end=None): # real signature unknown; restored from __doc__ + """ + S.rfind(sub [,start [,end]]) -> int + + Return the highest index in S where substring sub is found, + such that sub is contained within S[start:end]. Optional + arguments start and end are interpreted as in slice notation. + + Return -1 on failure. + """ + return 0 + + def rindex(self, sub, start=None, end=None): # real signature unknown; restored from __doc__ + """ + S.rindex(sub [,start [,end]]) -> int + + Like S.rfind() but raise ValueError when the substring is not found. + """ + return 0 + + def rjust(self, width, fillchar=None): # real signature unknown; restored from __doc__ + """ + S.rjust(width[, fillchar]) -> string + + Return S right-justified in a string of length width. Padding is + done using the specified fill character (default is a space) + """ + return "" + + def rpartition(self, sep): # real signature unknown; restored from __doc__ + """ + S.rpartition(sep) -> (head, sep, tail) + + Search for the separator sep in S, starting at the end of S, and return + the part before it, the separator itself, and the part after it. If the + separator is not found, return two empty strings and S. + """ + pass + + def rsplit(self, sep=None, maxsplit=None): # real signature unknown; restored from __doc__ + """ + S.rsplit([sep [,maxsplit]]) -> list of strings + + Return a list of the words in the string S, using sep as the + delimiter string, starting at the end of the string and working + to the front. If maxsplit is given, at most maxsplit splits are + done. If sep is not specified or is None, any whitespace string + is a separator. + """ + return [] + + def rstrip(self, chars=None): # real signature unknown; restored from __doc__ + """ + S.rstrip([chars]) -> string or unicode + + Return a copy of the string S with trailing whitespace removed. + If chars is given and not None, remove characters in chars instead. + If chars is unicode, S will be converted to unicode before stripping + """ + return "" + + def split(self, sep=None, maxsplit=None): # real signature unknown; restored from __doc__ + """ + S.split([sep [,maxsplit]]) -> list of strings + + Return a list of the words in the string S, using sep as the + delimiter string. If maxsplit is given, at most maxsplit + splits are done. If sep is not specified or is None, any + whitespace string is a separator and empty strings are removed + from the result. + """ + return [] + + def splitlines(self, keepends=None): # real signature unknown; restored from __doc__ + """ + S.splitlines([keepends]) -> list of strings + + Return a list of the lines in S, breaking at line boundaries. + Line breaks are not included in the resulting list unless keepends + is given and true. + """ + return [] + + def startswith(self, prefix, start=None, end=None): # real signature unknown; restored from __doc__ + """ + S.startswith(prefix[, start[, end]]) -> bool + + Return True if S starts with the specified prefix, False otherwise. + With optional start, test S beginning at that position. + With optional end, stop comparing S at that position. + prefix can also be a tuple of strings to try. + """ + return False + + def strip(self, chars=None): # real signature unknown; restored from __doc__ + """ + S.strip([chars]) -> string or unicode + + Return a copy of the string S with leading and trailing + whitespace removed. + If chars is given and not None, remove characters in chars instead. + If chars is unicode, S will be converted to unicode before stripping + """ + return "" + + def swapcase(self): # real signature unknown; restored from __doc__ + """ + S.swapcase() -> string + + Return a copy of the string S with uppercase characters + converted to lowercase and vice versa. + """ + return "" + + def title(self): # real signature unknown; restored from __doc__ + """ + S.title() -> string + + Return a titlecased version of S, i.e. words start with uppercase + characters, all remaining cased characters have lowercase. + """ + return "" + + def translate(self, table, deletechars=None): # real signature unknown; restored from __doc__ + """ + S.translate(table [,deletechars]) -> string + + Return a copy of the string S, where all characters occurring + in the optional argument deletechars are removed, and the + remaining characters have been mapped through the given + translation table, which must be a string of length 256 or None. + If the table argument is None, no translation is applied and + the operation simply removes the characters in deletechars. + """ + return "" + + def upper(self): # real signature unknown; restored from __doc__ + """ + S.upper() -> string + + Return a copy of the string S converted to uppercase. + """ + return "" + + def zfill(self, width): # real signature unknown; restored from __doc__ + """ + S.zfill(width) -> string + + Pad a numeric string S with zeros on the left, to fill a field + of the specified width. The string S is never truncated. + """ + return "" + + def _formatter_field_name_split(self, *args, **kwargs): # real signature unknown + pass + + def _formatter_parser(self, *args, **kwargs): # real signature unknown + pass + + def __add__(self, y): # real signature unknown; restored from __doc__ + """ x.__add__(y) <==> x+y """ + pass + + def __contains__(self, y): # real signature unknown; restored from __doc__ + """ x.__contains__(y) <==> y in x """ + pass + + def __eq__(self, y): # real signature unknown; restored from __doc__ + """ x.__eq__(y) <==> x==y """ + pass + + def __format__(self, format_spec): # real signature unknown; restored from __doc__ + """ + S.__format__(format_spec) -> string + + Return a formatted version of S as described by format_spec. + """ + return "" + + def __getattribute__(self, name): # real signature unknown; restored from __doc__ + """ x.__getattribute__('name') <==> x.name """ + pass + + def __getitem__(self, y): # real signature unknown; restored from __doc__ + """ x.__getitem__(y) <==> x[y] """ + pass + + def __getnewargs__(self, *args, **kwargs): # real signature unknown + pass + + def __getslice__(self, i, j): # real signature unknown; restored from __doc__ + """ + x.__getslice__(i, j) <==> x[i:j] + + Use of negative indices is not supported. + """ + pass + + def __ge__(self, y): # real signature unknown; restored from __doc__ + """ x.__ge__(y) <==> x>=y """ + pass + + def __gt__(self, y): # real signature unknown; restored from __doc__ + """ x.__gt__(y) <==> x>y """ + pass + + def __hash__(self): # real signature unknown; restored from __doc__ + """ x.__hash__() <==> hash(x) """ + pass + + def __init__(self, string=''): # known special case of str.__init__ + """ + str(object) -> string + + Return a nice string representation of the object. + If the argument is a string, the return value is the same object. + # (copied from class doc) + """ + pass + + def __len__(self): # real signature unknown; restored from __doc__ + """ x.__len__() <==> len(x) """ + pass + + def __le__(self, y): # real signature unknown; restored from __doc__ + """ x.__le__(y) <==> x<=y """ + pass + + def __lt__(self, y): # real signature unknown; restored from __doc__ + """ x.__lt__(y) <==> x x%y """ + pass + + def __mul__(self, n): # real signature unknown; restored from __doc__ + """ x.__mul__(n) <==> x*n """ + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + def __ne__(self, y): # real signature unknown; restored from __doc__ + """ x.__ne__(y) <==> x!=y """ + pass + + def __repr__(self): # real signature unknown; restored from __doc__ + """ x.__repr__() <==> repr(x) """ + pass + + def __rmod__(self, y): # real signature unknown; restored from __doc__ + """ x.__rmod__(y) <==> y%x """ + pass + + def __rmul__(self, n): # real signature unknown; restored from __doc__ + """ x.__rmul__(n) <==> n*x """ + pass + + def __sizeof__(self): # real signature unknown; restored from __doc__ + """ S.__sizeof__() -> size of S in memory, in bytes """ + pass + + def __str__(self): # real signature unknown; restored from __doc__ + """ x.__str__() <==> str(x) """ + pass + + +bytes = str + + +class classmethod(object): + """ + classmethod(function) -> method + + Convert a function to be a class method. + + A class method receives the class as implicit first argument, + just like an instance method receives the instance. + To declare a class method, use this idiom: + + class C: + def f(cls, arg1, arg2, ...): ... + f = classmethod(f) + + It can be called either on the class (e.g. C.f()) or on an instance + (e.g. C().f()). The instance is ignored except for its class. + If a class method is called for a derived class, the derived class + object is passed as the implied first argument. + + Class methods are different than C++ or Java static methods. + If you want those, see the staticmethod builtin. + """ + def __getattribute__(self, name): # real signature unknown; restored from __doc__ + """ x.__getattribute__('name') <==> x.name """ + pass + + def __get__(self, obj, type=None): # real signature unknown; restored from __doc__ + """ descr.__get__(obj[, type]) -> value """ + pass + + def __init__(self, function): # real signature unknown; restored from __doc__ + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + __func__ = property(lambda self: object()) # default + + +class complex(object): + """ + complex(real[, imag]) -> complex number + + Create a complex number from a real part and an optional imaginary part. + This is equivalent to (real + imag*1j) where imag defaults to 0. + """ + def conjugate(self): # real signature unknown; restored from __doc__ + """ + complex.conjugate() -> complex + + Returns the complex conjugate of its argument. (3-4j).conjugate() == 3+4j. + """ + return complex + + def __abs__(self): # real signature unknown; restored from __doc__ + """ x.__abs__() <==> abs(x) """ + pass + + def __add__(self, y): # real signature unknown; restored from __doc__ + """ x.__add__(y) <==> x+y """ + pass + + def __coerce__(self, y): # real signature unknown; restored from __doc__ + """ x.__coerce__(y) <==> coerce(x, y) """ + pass + + def __divmod__(self, y): # real signature unknown; restored from __doc__ + """ x.__divmod__(y) <==> divmod(x, y) """ + pass + + def __div__(self, y): # real signature unknown; restored from __doc__ + """ x.__div__(y) <==> x/y """ + pass + + def __eq__(self, y): # real signature unknown; restored from __doc__ + """ x.__eq__(y) <==> x==y """ + pass + + def __float__(self): # real signature unknown; restored from __doc__ + """ x.__float__() <==> float(x) """ + pass + + def __floordiv__(self, y): # real signature unknown; restored from __doc__ + """ x.__floordiv__(y) <==> x//y """ + pass + + def __format__(self): # real signature unknown; restored from __doc__ + """ + complex.__format__() -> str + + Converts to a string according to format_spec. + """ + return "" + + def __getattribute__(self, name): # real signature unknown; restored from __doc__ + """ x.__getattribute__('name') <==> x.name """ + pass + + def __getnewargs__(self, *args, **kwargs): # real signature unknown + pass + + def __ge__(self, y): # real signature unknown; restored from __doc__ + """ x.__ge__(y) <==> x>=y """ + pass + + def __gt__(self, y): # real signature unknown; restored from __doc__ + """ x.__gt__(y) <==> x>y """ + pass + + def __hash__(self): # real signature unknown; restored from __doc__ + """ x.__hash__() <==> hash(x) """ + pass + + def __init__(self, real, imag=None): # real signature unknown; restored from __doc__ + pass + + def __int__(self): # real signature unknown; restored from __doc__ + """ x.__int__() <==> int(x) """ + pass + + def __le__(self, y): # real signature unknown; restored from __doc__ + """ x.__le__(y) <==> x<=y """ + pass + + def __long__(self): # real signature unknown; restored from __doc__ + """ x.__long__() <==> long(x) """ + pass + + def __lt__(self, y): # real signature unknown; restored from __doc__ + """ x.__lt__(y) <==> x x%y """ + pass + + def __mul__(self, y): # real signature unknown; restored from __doc__ + """ x.__mul__(y) <==> x*y """ + pass + + def __neg__(self): # real signature unknown; restored from __doc__ + """ x.__neg__() <==> -x """ + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + def __ne__(self, y): # real signature unknown; restored from __doc__ + """ x.__ne__(y) <==> x!=y """ + pass + + def __nonzero__(self): # real signature unknown; restored from __doc__ + """ x.__nonzero__() <==> x != 0 """ + pass + + def __pos__(self): # real signature unknown; restored from __doc__ + """ x.__pos__() <==> +x """ + pass + + def __pow__(self, y, z=None): # real signature unknown; restored from __doc__ + """ x.__pow__(y[, z]) <==> pow(x, y[, z]) """ + pass + + def __radd__(self, y): # real signature unknown; restored from __doc__ + """ x.__radd__(y) <==> y+x """ + pass + + def __rdivmod__(self, y): # real signature unknown; restored from __doc__ + """ x.__rdivmod__(y) <==> divmod(y, x) """ + pass + + def __rdiv__(self, y): # real signature unknown; restored from __doc__ + """ x.__rdiv__(y) <==> y/x """ + pass + + def __repr__(self): # real signature unknown; restored from __doc__ + """ x.__repr__() <==> repr(x) """ + pass + + def __rfloordiv__(self, y): # real signature unknown; restored from __doc__ + """ x.__rfloordiv__(y) <==> y//x """ + pass + + def __rmod__(self, y): # real signature unknown; restored from __doc__ + """ x.__rmod__(y) <==> y%x """ + pass + + def __rmul__(self, y): # real signature unknown; restored from __doc__ + """ x.__rmul__(y) <==> y*x """ + pass + + def __rpow__(self, x, z=None): # real signature unknown; restored from __doc__ + """ y.__rpow__(x[, z]) <==> pow(x, y[, z]) """ + pass + + def __rsub__(self, y): # real signature unknown; restored from __doc__ + """ x.__rsub__(y) <==> y-x """ + pass + + def __rtruediv__(self, y): # real signature unknown; restored from __doc__ + """ x.__rtruediv__(y) <==> y/x """ + pass + + def __str__(self): # real signature unknown; restored from __doc__ + """ x.__str__() <==> str(x) """ + pass + + def __sub__(self, y): # real signature unknown; restored from __doc__ + """ x.__sub__(y) <==> x-y """ + pass + + def __truediv__(self, y): # real signature unknown; restored from __doc__ + """ x.__truediv__(y) <==> x/y """ + pass + + imag = property(lambda self: 0.0) + real = property(lambda self: 0.0) + + +class dict(object): + """ + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + """ + def clear(self): # real signature unknown; restored from __doc__ + """ D.clear() -> None. Remove all items from D. """ + pass + + def copy(self): # real signature unknown; restored from __doc__ + """ D.copy() -> a shallow copy of D """ + pass + + @staticmethod # known case + def fromkeys(S, v=None): # real signature unknown; restored from __doc__ + """ + dict.fromkeys(S[,v]) -> New dict with keys from S and values equal to v. + v defaults to None. + """ + pass + + def get(self, k, d=None): # real signature unknown; restored from __doc__ + """ D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None. """ + pass + + def has_key(self, k): # real signature unknown; restored from __doc__ + """ D.has_key(k) -> True if D has a key k, else False """ + return False + + def items(self): # real signature unknown; restored from __doc__ + """ D.items() -> list of D's (key, value) pairs, as 2-tuples """ + return [] + + def iteritems(self): # real signature unknown; restored from __doc__ + """ D.iteritems() -> an iterator over the (key, value) items of D """ + pass + + def iterkeys(self): # real signature unknown; restored from __doc__ + """ D.iterkeys() -> an iterator over the keys of D """ + pass + + def itervalues(self): # real signature unknown; restored from __doc__ + """ D.itervalues() -> an iterator over the values of D """ + pass + + def keys(self): # real signature unknown; restored from __doc__ + """ D.keys() -> list of D's keys """ + return [] + + def pop(self, k, d=None): # real signature unknown; restored from __doc__ + """ + D.pop(k[,d]) -> v, remove specified key and return the corresponding value. + If key is not found, d is returned if given, otherwise KeyError is raised + """ + pass + + def popitem(self): # real signature unknown; restored from __doc__ + """ + D.popitem() -> (k, v), remove and return some (key, value) pair as a + 2-tuple; but raise KeyError if D is empty. + """ + pass + + def setdefault(self, k, d=None): # real signature unknown; restored from __doc__ + """ D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D """ + pass + + def update(self, E=None, **F): # known special case of dict.update + """ + D.update(E, **F) -> None. Update D from dict/iterable E and F. + If E has a .keys() method, does: for k in E: D[k] = E[k] + If E lacks .keys() method, does: for (k, v) in E: D[k] = v + In either case, this is followed by: for k in F: D[k] = F[k] + """ + pass + + def values(self): # real signature unknown; restored from __doc__ + """ D.values() -> list of D's values """ + return [] + + def viewitems(self): # real signature unknown; restored from __doc__ + """ D.viewitems() -> a set-like object providing a view on D's items """ + pass + + def viewkeys(self): # real signature unknown; restored from __doc__ + """ D.viewkeys() -> a set-like object providing a view on D's keys """ + pass + + def viewvalues(self): # real signature unknown; restored from __doc__ + """ D.viewvalues() -> an object providing a view on D's values """ + pass + + def __cmp__(self, y): # real signature unknown; restored from __doc__ + """ x.__cmp__(y) <==> cmp(x,y) """ + pass + + def __contains__(self, k): # real signature unknown; restored from __doc__ + """ D.__contains__(k) -> True if D has a key k, else False """ + return False + + def __delitem__(self, y): # real signature unknown; restored from __doc__ + """ x.__delitem__(y) <==> del x[y] """ + pass + + def __eq__(self, y): # real signature unknown; restored from __doc__ + """ x.__eq__(y) <==> x==y """ + pass + + def __getattribute__(self, name): # real signature unknown; restored from __doc__ + """ x.__getattribute__('name') <==> x.name """ + pass + + def __getitem__(self, y): # real signature unknown; restored from __doc__ + """ x.__getitem__(y) <==> x[y] """ + pass + + def __ge__(self, y): # real signature unknown; restored from __doc__ + """ x.__ge__(y) <==> x>=y """ + pass + + def __gt__(self, y): # real signature unknown; restored from __doc__ + """ x.__gt__(y) <==> x>y """ + pass + + def __init__(self, seq=None, **kwargs): # known special case of dict.__init__ + """ + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + # (copied from class doc) + """ + pass + + def __iter__(self): # real signature unknown; restored from __doc__ + """ x.__iter__() <==> iter(x) """ + pass + + def __len__(self): # real signature unknown; restored from __doc__ + """ x.__len__() <==> len(x) """ + pass + + def __le__(self, y): # real signature unknown; restored from __doc__ + """ x.__le__(y) <==> x<=y """ + pass + + def __lt__(self, y): # real signature unknown; restored from __doc__ + """ x.__lt__(y) <==> x a new object with type S, a subtype of T """ + pass + + def __ne__(self, y): # real signature unknown; restored from __doc__ + """ x.__ne__(y) <==> x!=y """ + pass + + def __repr__(self): # real signature unknown; restored from __doc__ + """ x.__repr__() <==> repr(x) """ + pass + + def __setitem__(self, i, y): # real signature unknown; restored from __doc__ + """ x.__setitem__(i, y) <==> x[i]=y """ + pass + + def __sizeof__(self): # real signature unknown; restored from __doc__ + """ D.__sizeof__() -> size of D in memory, in bytes """ + pass + + __hash__ = None + + +class enumerate(object): + """ + enumerate(iterable[, start]) -> iterator for index, value of iterable + + Return an enumerate object. iterable must be another object that supports + iteration. The enumerate object yields pairs containing a count (from + start, which defaults to zero) and a value yielded by the iterable argument. + enumerate is useful for obtaining an indexed list: + (0, seq[0]), (1, seq[1]), (2, seq[2]), ... + """ + def next(self): # real signature unknown; restored from __doc__ + """ x.next() -> the next value, or raise StopIteration """ + pass + + def __getattribute__(self, name): # real signature unknown; restored from __doc__ + """ x.__getattribute__('name') <==> x.name """ + pass + + def __init__(self, iterable, start=0): # known special case of enumerate.__init__ + """ x.__init__(...) initializes x; see help(type(x)) for signature """ + pass + + def __iter__(self): # real signature unknown; restored from __doc__ + """ x.__iter__() <==> iter(x) """ + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class file(object): + """ + file(name[, mode[, buffering]]) -> file object + + Open a file. The mode can be 'r', 'w' or 'a' for reading (default), + writing or appending. The file will be created if it doesn't exist + when opened for writing or appending; it will be truncated when + opened for writing. Add a 'b' to the mode for binary files. + Add a '+' to the mode to allow simultaneous reading and writing. + If the buffering argument is given, 0 means unbuffered, 1 means line + buffered, and larger numbers specify the buffer size. The preferred way + to open a file is with the builtin open() function. + Add a 'U' to mode to open the file for input with universal newline + support. Any line ending in the input file will be seen as a '\n' + in Python. Also, a file so opened gains the attribute 'newlines'; + the value for this attribute is one of None (no newline read yet), + '\r', '\n', '\r\n' or a tuple containing all the newline types seen. + + 'U' cannot be combined with 'w' or '+' mode. + """ + def close(self): # real signature unknown; restored from __doc__ + """ + close() -> None or (perhaps) an integer. Close the file. + + Sets data attribute .closed to True. A closed file cannot be used for + further I/O operations. close() may be called more than once without + error. Some kinds of file objects (for example, opened by popen()) + may return an exit status upon closing. + """ + pass + + def fileno(self): # real signature unknown; restored from __doc__ + """ + fileno() -> integer "file descriptor". + + This is needed for lower-level file interfaces, such os.read(). + """ + return 0 + + def flush(self): # real signature unknown; restored from __doc__ + """ flush() -> None. Flush the internal I/O buffer. """ + pass + + def isatty(self): # real signature unknown; restored from __doc__ + """ isatty() -> true or false. True if the file is connected to a tty device. """ + return False + + def next(self): # real signature unknown; restored from __doc__ + """ x.next() -> the next value, or raise StopIteration """ + pass + + def read(self, size=None): # real signature unknown; restored from __doc__ + """ + read([size]) -> read at most size bytes, returned as a string. + + If the size argument is negative or omitted, read until EOF is reached. + Notice that when in non-blocking mode, less data than what was requested + may be returned, even if no size parameter was given. + """ + pass + + def readinto(self): # real signature unknown; restored from __doc__ + """ readinto() -> Undocumented. Don't use this; it may go away. """ + pass + + def readline(self, size=None): # real signature unknown; restored from __doc__ + """ + readline([size]) -> next line from the file, as a string. + + Retain newline. A non-negative size argument limits the maximum + number of bytes to return (an incomplete line may be returned then). + Return an empty string at EOF. + """ + pass + + def readlines(self, size=None): # real signature unknown; restored from __doc__ + """ + readlines([size]) -> list of strings, each a line from the file. + + Call readline() repeatedly and return a list of the lines so read. + The optional size argument, if given, is an approximate bound on the + total number of bytes in the lines returned. + """ + return [] + + def seek(self, offset, whence=None): # real signature unknown; restored from __doc__ + """ + seek(offset[, whence]) -> None. Move to new file position. + + Argument offset is a byte count. Optional argument whence defaults to + 0 (offset from start of file, offset should be >= 0); other values are 1 + (move relative to current position, positive or negative), and 2 (move + relative to end of file, usually negative, although many platforms allow + seeking beyond the end of a file). If the file is opened in text mode, + only offsets returned by tell() are legal. Use of other offsets causes + undefined behavior. + Note that not all file objects are seekable. + """ + pass + + def tell(self): # real signature unknown; restored from __doc__ + """ tell() -> current file position, an integer (may be a long integer). """ + pass + + def truncate(self, size=None): # real signature unknown; restored from __doc__ + """ + truncate([size]) -> None. Truncate the file to at most size bytes. + + Size defaults to the current file position, as returned by tell(). + """ + pass + + def write(self, p_str): # real signature unknown; restored from __doc__ + """ + write(str) -> None. Write string str to file. + + Note that due to buffering, flush() or close() may be needed before + the file on disk reflects the data written. + """ + pass + + def writelines(self, sequence_of_strings): # real signature unknown; restored from __doc__ + """ + writelines(sequence_of_strings) -> None. Write the strings to the file. + + Note that newlines are not added. The sequence can be any iterable object + producing strings. This is equivalent to calling write() for each string. + """ + pass + + def xreadlines(self): # real signature unknown; restored from __doc__ + """ + xreadlines() -> returns self. + + For backward compatibility. File objects now include the performance + optimizations previously implemented in the xreadlines module. + """ + pass + + def __delattr__(self, name): # real signature unknown; restored from __doc__ + """ x.__delattr__('name') <==> del x.name """ + pass + + def __enter__(self): # real signature unknown; restored from __doc__ + """ __enter__() -> self. """ + return self + + def __exit__(self, *excinfo): # real signature unknown; restored from __doc__ + """ __exit__(*excinfo) -> None. Closes the file. """ + pass + + def __getattribute__(self, name): # real signature unknown; restored from __doc__ + """ x.__getattribute__('name') <==> x.name """ + pass + + def __init__(self, name, mode=None, buffering=None): # real signature unknown; restored from __doc__ + pass + + def __iter__(self): # real signature unknown; restored from __doc__ + """ x.__iter__() <==> iter(x) """ + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + def __repr__(self): # real signature unknown; restored from __doc__ + """ x.__repr__() <==> repr(x) """ + pass + + def __setattr__(self, name, value): # real signature unknown; restored from __doc__ + """ x.__setattr__('name', value) <==> x.name = value """ + pass + + closed = property(lambda self: True) + encoding = property(lambda self: '') + errors = property(lambda self: object()) # default + mode = property(lambda self: '') + name = property(lambda self: '') + newlines = property(lambda self: '') + softspace = property(lambda self: True) + + +class float(object): + """ + float(x) -> floating point number + + Convert a string or number to a floating point number, if possible. + """ + def as_integer_ratio(self): # real signature unknown; restored from __doc__ + """ + float.as_integer_ratio() -> (int, int) + + Returns a pair of integers, whose ratio is exactly equal to the original + float and with a positive denominator. + Raises OverflowError on infinities and a ValueError on NaNs. + + >>> (10.0).as_integer_ratio() + (10, 1) + >>> (0.0).as_integer_ratio() + (0, 1) + >>> (-.25).as_integer_ratio() + (-1, 4) + """ + pass + + def conjugate(self, *args, **kwargs): # real signature unknown + """ Returns self, the complex conjugate of any float. """ + pass + + def fromhex(self, string): # real signature unknown; restored from __doc__ + """ + float.fromhex(string) -> float + + Create a floating-point number from a hexadecimal string. + >>> float.fromhex('0x1.ffffp10') + 2047.984375 + >>> float.fromhex('-0x1p-1074') + -4.9406564584124654e-324 + """ + return 0.0 + + def hex(self): # real signature unknown; restored from __doc__ + """ + float.hex() -> string + + Return a hexadecimal representation of a floating-point number. + >>> (-0.1).hex() + '-0x1.999999999999ap-4' + >>> 3.14159.hex() + '0x1.921f9f01b866ep+1' + """ + return "" + + def is_integer(self, *args, **kwargs): # real signature unknown + """ Returns True if the float is an integer. """ + pass + + def __abs__(self): # real signature unknown; restored from __doc__ + """ x.__abs__() <==> abs(x) """ + pass + + def __add__(self, y): # real signature unknown; restored from __doc__ + """ x.__add__(y) <==> x+y """ + pass + + def __coerce__(self, y): # real signature unknown; restored from __doc__ + """ x.__coerce__(y) <==> coerce(x, y) """ + pass + + def __divmod__(self, y): # real signature unknown; restored from __doc__ + """ x.__divmod__(y) <==> divmod(x, y) """ + pass + + def __div__(self, y): # real signature unknown; restored from __doc__ + """ x.__div__(y) <==> x/y """ + pass + + def __eq__(self, y): # real signature unknown; restored from __doc__ + """ x.__eq__(y) <==> x==y """ + pass + + def __float__(self): # real signature unknown; restored from __doc__ + """ x.__float__() <==> float(x) """ + pass + + def __floordiv__(self, y): # real signature unknown; restored from __doc__ + """ x.__floordiv__(y) <==> x//y """ + pass + + def __format__(self, format_spec): # real signature unknown; restored from __doc__ + """ + float.__format__(format_spec) -> string + + Formats the float according to format_spec. + """ + return "" + + def __getattribute__(self, name): # real signature unknown; restored from __doc__ + """ x.__getattribute__('name') <==> x.name """ + pass + + def __getformat__(self, typestr): # real signature unknown; restored from __doc__ + """ + float.__getformat__(typestr) -> string + + You probably don't want to use this function. It exists mainly to be + used in Python's test suite. + + typestr must be 'double' or 'float'. This function returns whichever of + 'unknown', 'IEEE, big-endian' or 'IEEE, little-endian' best describes the + format of floating point numbers used by the C type named by typestr. + """ + return "" + + def __getnewargs__(self, *args, **kwargs): # real signature unknown + pass + + def __ge__(self, y): # real signature unknown; restored from __doc__ + """ x.__ge__(y) <==> x>=y """ + pass + + def __gt__(self, y): # real signature unknown; restored from __doc__ + """ x.__gt__(y) <==> x>y """ + pass + + def __hash__(self): # real signature unknown; restored from __doc__ + """ x.__hash__() <==> hash(x) """ + pass + + def __init__(self, x): # real signature unknown; restored from __doc__ + pass + + def __int__(self): # real signature unknown; restored from __doc__ + """ x.__int__() <==> int(x) """ + pass + + def __le__(self, y): # real signature unknown; restored from __doc__ + """ x.__le__(y) <==> x<=y """ + pass + + def __long__(self): # real signature unknown; restored from __doc__ + """ x.__long__() <==> long(x) """ + pass + + def __lt__(self, y): # real signature unknown; restored from __doc__ + """ x.__lt__(y) <==> x x%y """ + pass + + def __mul__(self, y): # real signature unknown; restored from __doc__ + """ x.__mul__(y) <==> x*y """ + pass + + def __neg__(self): # real signature unknown; restored from __doc__ + """ x.__neg__() <==> -x """ + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + def __ne__(self, y): # real signature unknown; restored from __doc__ + """ x.__ne__(y) <==> x!=y """ + pass + + def __nonzero__(self): # real signature unknown; restored from __doc__ + """ x.__nonzero__() <==> x != 0 """ + pass + + def __pos__(self): # real signature unknown; restored from __doc__ + """ x.__pos__() <==> +x """ + pass + + def __pow__(self, y, z=None): # real signature unknown; restored from __doc__ + """ x.__pow__(y[, z]) <==> pow(x, y[, z]) """ + pass + + def __radd__(self, y): # real signature unknown; restored from __doc__ + """ x.__radd__(y) <==> y+x """ + pass + + def __rdivmod__(self, y): # real signature unknown; restored from __doc__ + """ x.__rdivmod__(y) <==> divmod(y, x) """ + pass + + def __rdiv__(self, y): # real signature unknown; restored from __doc__ + """ x.__rdiv__(y) <==> y/x """ + pass + + def __repr__(self): # real signature unknown; restored from __doc__ + """ x.__repr__() <==> repr(x) """ + pass + + def __rfloordiv__(self, y): # real signature unknown; restored from __doc__ + """ x.__rfloordiv__(y) <==> y//x """ + pass + + def __rmod__(self, y): # real signature unknown; restored from __doc__ + """ x.__rmod__(y) <==> y%x """ + pass + + def __rmul__(self, y): # real signature unknown; restored from __doc__ + """ x.__rmul__(y) <==> y*x """ + pass + + def __rpow__(self, x, z=None): # real signature unknown; restored from __doc__ + """ y.__rpow__(x[, z]) <==> pow(x, y[, z]) """ + pass + + def __rsub__(self, y): # real signature unknown; restored from __doc__ + """ x.__rsub__(y) <==> y-x """ + pass + + def __rtruediv__(self, y): # real signature unknown; restored from __doc__ + """ x.__rtruediv__(y) <==> y/x """ + pass + + def __setformat__(self, typestr, fmt): # real signature unknown; restored from __doc__ + """ + float.__setformat__(typestr, fmt) -> None + + You probably don't want to use this function. It exists mainly to be + used in Python's test suite. + + typestr must be 'double' or 'float'. fmt must be one of 'unknown', + 'IEEE, big-endian' or 'IEEE, little-endian', and in addition can only be + one of the latter two if it appears to match the underlying C reality. + + Overrides the automatic determination of C-level floating point type. + This affects how floats are converted to and from binary strings. + """ + pass + + def __str__(self): # real signature unknown; restored from __doc__ + """ x.__str__() <==> str(x) """ + pass + + def __sub__(self, y): # real signature unknown; restored from __doc__ + """ x.__sub__(y) <==> x-y """ + pass + + def __truediv__(self, y): # real signature unknown; restored from __doc__ + """ x.__truediv__(y) <==> x/y """ + pass + + def __trunc__(self, *args, **kwargs): # real signature unknown + """ Returns the Integral closest to x between 0 and x. """ + pass + + imag = property(lambda self: object()) # default + real = property(lambda self: object()) # default + + +class frozenset(object): + """ + frozenset() -> empty frozenset object + frozenset(iterable) -> frozenset object + + Build an immutable unordered collection of unique elements. + """ + def copy(self, *args, **kwargs): # real signature unknown + """ Return a shallow copy of a set. """ + pass + + def difference(self, *args, **kwargs): # real signature unknown + """ + Return the difference of two or more sets as a new set. + + (i.e. all elements that are in this set but not the others.) + """ + pass + + def intersection(self, *args, **kwargs): # real signature unknown + """ + Return the intersection of two or more sets as a new set. + + (i.e. elements that are common to all of the sets.) + """ + pass + + def isdisjoint(self, *args, **kwargs): # real signature unknown + """ Return True if two sets have a null intersection. """ + pass + + def issubset(self, *args, **kwargs): # real signature unknown + """ Report whether another set contains this set. """ + pass + + def issuperset(self, *args, **kwargs): # real signature unknown + """ Report whether this set contains another set. """ + pass + + def symmetric_difference(self, *args, **kwargs): # real signature unknown + """ + Return the symmetric difference of two sets as a new set. + + (i.e. all elements that are in exactly one of the sets.) + """ + pass + + def union(self, *args, **kwargs): # real signature unknown + """ + Return the union of sets as a new set. + + (i.e. all elements that are in either set.) + """ + pass + + def __and__(self, y): # real signature unknown; restored from __doc__ + """ x.__and__(y) <==> x&y """ + pass + + def __cmp__(self, y): # real signature unknown; restored from __doc__ + """ x.__cmp__(y) <==> cmp(x,y) """ + pass + + def __contains__(self, y): # real signature unknown; restored from __doc__ + """ x.__contains__(y) <==> y in x. """ + pass + + def __eq__(self, y): # real signature unknown; restored from __doc__ + """ x.__eq__(y) <==> x==y """ + pass + + def __getattribute__(self, name): # real signature unknown; restored from __doc__ + """ x.__getattribute__('name') <==> x.name """ + pass + + def __ge__(self, y): # real signature unknown; restored from __doc__ + """ x.__ge__(y) <==> x>=y """ + pass + + def __gt__(self, y): # real signature unknown; restored from __doc__ + """ x.__gt__(y) <==> x>y """ + pass + + def __hash__(self): # real signature unknown; restored from __doc__ + """ x.__hash__() <==> hash(x) """ + pass + + def __init__(self, seq=()): # known special case of frozenset.__init__ + """ x.__init__(...) initializes x; see help(type(x)) for signature """ + pass + + def __iter__(self): # real signature unknown; restored from __doc__ + """ x.__iter__() <==> iter(x) """ + pass + + def __len__(self): # real signature unknown; restored from __doc__ + """ x.__len__() <==> len(x) """ + pass + + def __le__(self, y): # real signature unknown; restored from __doc__ + """ x.__le__(y) <==> x<=y """ + pass + + def __lt__(self, y): # real signature unknown; restored from __doc__ + """ x.__lt__(y) <==> x a new object with type S, a subtype of T """ + pass + + def __ne__(self, y): # real signature unknown; restored from __doc__ + """ x.__ne__(y) <==> x!=y """ + pass + + def __or__(self, y): # real signature unknown; restored from __doc__ + """ x.__or__(y) <==> x|y """ + pass + + def __rand__(self, y): # real signature unknown; restored from __doc__ + """ x.__rand__(y) <==> y&x """ + pass + + def __reduce__(self, *args, **kwargs): # real signature unknown + """ Return state information for pickling. """ + pass + + def __repr__(self): # real signature unknown; restored from __doc__ + """ x.__repr__() <==> repr(x) """ + pass + + def __ror__(self, y): # real signature unknown; restored from __doc__ + """ x.__ror__(y) <==> y|x """ + pass + + def __rsub__(self, y): # real signature unknown; restored from __doc__ + """ x.__rsub__(y) <==> y-x """ + pass + + def __rxor__(self, y): # real signature unknown; restored from __doc__ + """ x.__rxor__(y) <==> y^x """ + pass + + def __sizeof__(self): # real signature unknown; restored from __doc__ + """ S.__sizeof__() -> size of S in memory, in bytes """ + pass + + def __sub__(self, y): # real signature unknown; restored from __doc__ + """ x.__sub__(y) <==> x-y """ + pass + + def __xor__(self, y): # real signature unknown; restored from __doc__ + """ x.__xor__(y) <==> x^y """ + pass + + +class list(object): + """ + list() -> new empty list + list(iterable) -> new list initialized from iterable's items + """ + def append(self, p_object): # real signature unknown; restored from __doc__ + """ L.append(object) -- append object to end """ + pass + + def count(self, value): # real signature unknown; restored from __doc__ + """ L.count(value) -> integer -- return number of occurrences of value """ + return 0 + + def extend(self, iterable): # real signature unknown; restored from __doc__ + """ L.extend(iterable) -- extend list by appending elements from the iterable """ + pass + + def index(self, value, start=None, stop=None): # real signature unknown; restored from __doc__ + """ + L.index(value, [start, [stop]]) -> integer -- return first index of value. + Raises ValueError if the value is not present. + """ + return 0 + + def insert(self, index, p_object): # real signature unknown; restored from __doc__ + """ L.insert(index, object) -- insert object before index """ + pass + + def pop(self, index=None): # real signature unknown; restored from __doc__ + """ + L.pop([index]) -> item -- remove and return item at index (default last). + Raises IndexError if list is empty or index is out of range. + """ + pass + + def remove(self, value): # real signature unknown; restored from __doc__ + """ + L.remove(value) -- remove first occurrence of value. + Raises ValueError if the value is not present. + """ + pass + + def reverse(self): # real signature unknown; restored from __doc__ + """ L.reverse() -- reverse *IN PLACE* """ + pass + + def sort(self, cmp=None, key=None, reverse=False): # real signature unknown; restored from __doc__ + """ + L.sort(cmp=None, key=None, reverse=False) -- stable sort *IN PLACE*; + cmp(x, y) -> -1, 0, 1 + """ + pass + + def __add__(self, y): # real signature unknown; restored from __doc__ + """ x.__add__(y) <==> x+y """ + pass + + def __contains__(self, y): # real signature unknown; restored from __doc__ + """ x.__contains__(y) <==> y in x """ + pass + + def __delitem__(self, y): # real signature unknown; restored from __doc__ + """ x.__delitem__(y) <==> del x[y] """ + pass + + def __delslice__(self, i, j): # real signature unknown; restored from __doc__ + """ + x.__delslice__(i, j) <==> del x[i:j] + + Use of negative indices is not supported. + """ + pass + + def __eq__(self, y): # real signature unknown; restored from __doc__ + """ x.__eq__(y) <==> x==y """ + pass + + def __getattribute__(self, name): # real signature unknown; restored from __doc__ + """ x.__getattribute__('name') <==> x.name """ + pass + + def __getitem__(self, y): # real signature unknown; restored from __doc__ + """ x.__getitem__(y) <==> x[y] """ + pass + + def __getslice__(self, i, j): # real signature unknown; restored from __doc__ + """ + x.__getslice__(i, j) <==> x[i:j] + + Use of negative indices is not supported. + """ + pass + + def __ge__(self, y): # real signature unknown; restored from __doc__ + """ x.__ge__(y) <==> x>=y """ + pass + + def __gt__(self, y): # real signature unknown; restored from __doc__ + """ x.__gt__(y) <==> x>y """ + pass + + def __iadd__(self, y): # real signature unknown; restored from __doc__ + """ x.__iadd__(y) <==> x+=y """ + pass + + def __imul__(self, y): # real signature unknown; restored from __doc__ + """ x.__imul__(y) <==> x*=y """ + pass + + def __init__(self, seq=()): # known special case of list.__init__ + """ + list() -> new empty list + list(iterable) -> new list initialized from iterable's items + # (copied from class doc) + """ + pass + + def __iter__(self): # real signature unknown; restored from __doc__ + """ x.__iter__() <==> iter(x) """ + pass + + def __len__(self): # real signature unknown; restored from __doc__ + """ x.__len__() <==> len(x) """ + pass + + def __le__(self, y): # real signature unknown; restored from __doc__ + """ x.__le__(y) <==> x<=y """ + pass + + def __lt__(self, y): # real signature unknown; restored from __doc__ + """ x.__lt__(y) <==> x x*n """ + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + def __ne__(self, y): # real signature unknown; restored from __doc__ + """ x.__ne__(y) <==> x!=y """ + pass + + def __repr__(self): # real signature unknown; restored from __doc__ + """ x.__repr__() <==> repr(x) """ + pass + + def __reversed__(self): # real signature unknown; restored from __doc__ + """ L.__reversed__() -- return a reverse iterator over the list """ + pass + + def __rmul__(self, n): # real signature unknown; restored from __doc__ + """ x.__rmul__(n) <==> n*x """ + pass + + def __setitem__(self, i, y): # real signature unknown; restored from __doc__ + """ x.__setitem__(i, y) <==> x[i]=y """ + pass + + def __setslice__(self, i, j, y): # real signature unknown; restored from __doc__ + """ + x.__setslice__(i, j, y) <==> x[i:j]=y + + Use of negative indices is not supported. + """ + pass + + def __sizeof__(self): # real signature unknown; restored from __doc__ + """ L.__sizeof__() -- size of L in memory, in bytes """ + pass + + __hash__ = None + + +class long(object): + """ + long(x[, base]) -> integer + + Convert a string or number to a long integer, if possible. A floating + point argument will be truncated towards zero (this does not include a + string representation of a floating point number!) When converting a + string, use the optional base. It is an error to supply a base when + converting a non-string. + """ + def bit_length(self): # real signature unknown; restored from __doc__ + """ + long.bit_length() -> int or long + + Number of bits necessary to represent self in binary. + >>> bin(37L) + '0b100101' + >>> (37L).bit_length() + 6 + """ + return 0 + + def conjugate(self, *args, **kwargs): # real signature unknown + """ Returns self, the complex conjugate of any long. """ + pass + + def __abs__(self): # real signature unknown; restored from __doc__ + """ x.__abs__() <==> abs(x) """ + pass + + def __add__(self, y): # real signature unknown; restored from __doc__ + """ x.__add__(y) <==> x+y """ + pass + + def __and__(self, y): # real signature unknown; restored from __doc__ + """ x.__and__(y) <==> x&y """ + pass + + def __cmp__(self, y): # real signature unknown; restored from __doc__ + """ x.__cmp__(y) <==> cmp(x,y) """ + pass + + def __coerce__(self, y): # real signature unknown; restored from __doc__ + """ x.__coerce__(y) <==> coerce(x, y) """ + pass + + def __divmod__(self, y): # real signature unknown; restored from __doc__ + """ x.__divmod__(y) <==> divmod(x, y) """ + pass + + def __div__(self, y): # real signature unknown; restored from __doc__ + """ x.__div__(y) <==> x/y """ + pass + + def __float__(self): # real signature unknown; restored from __doc__ + """ x.__float__() <==> float(x) """ + pass + + def __floordiv__(self, y): # real signature unknown; restored from __doc__ + """ x.__floordiv__(y) <==> x//y """ + pass + + def __format__(self, *args, **kwargs): # real signature unknown + pass + + def __getattribute__(self, name): # real signature unknown; restored from __doc__ + """ x.__getattribute__('name') <==> x.name """ + pass + + def __getnewargs__(self, *args, **kwargs): # real signature unknown + pass + + def __hash__(self): # real signature unknown; restored from __doc__ + """ x.__hash__() <==> hash(x) """ + pass + + def __hex__(self): # real signature unknown; restored from __doc__ + """ x.__hex__() <==> hex(x) """ + pass + + def __index__(self): # real signature unknown; restored from __doc__ + """ x[y:z] <==> x[y.__index__():z.__index__()] """ + pass + + def __init__(self, x, base=None): # real signature unknown; restored from __doc__ + pass + + def __int__(self): # real signature unknown; restored from __doc__ + """ x.__int__() <==> int(x) """ + pass + + def __invert__(self): # real signature unknown; restored from __doc__ + """ x.__invert__() <==> ~x """ + pass + + def __long__(self): # real signature unknown; restored from __doc__ + """ x.__long__() <==> long(x) """ + pass + + def __lshift__(self, y): # real signature unknown; restored from __doc__ + """ x.__lshift__(y) <==> x< x%y """ + pass + + def __mul__(self, y): # real signature unknown; restored from __doc__ + """ x.__mul__(y) <==> x*y """ + pass + + def __neg__(self): # real signature unknown; restored from __doc__ + """ x.__neg__() <==> -x """ + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + def __nonzero__(self): # real signature unknown; restored from __doc__ + """ x.__nonzero__() <==> x != 0 """ + pass + + def __oct__(self): # real signature unknown; restored from __doc__ + """ x.__oct__() <==> oct(x) """ + pass + + def __or__(self, y): # real signature unknown; restored from __doc__ + """ x.__or__(y) <==> x|y """ + pass + + def __pos__(self): # real signature unknown; restored from __doc__ + """ x.__pos__() <==> +x """ + pass + + def __pow__(self, y, z=None): # real signature unknown; restored from __doc__ + """ x.__pow__(y[, z]) <==> pow(x, y[, z]) """ + pass + + def __radd__(self, y): # real signature unknown; restored from __doc__ + """ x.__radd__(y) <==> y+x """ + pass + + def __rand__(self, y): # real signature unknown; restored from __doc__ + """ x.__rand__(y) <==> y&x """ + pass + + def __rdivmod__(self, y): # real signature unknown; restored from __doc__ + """ x.__rdivmod__(y) <==> divmod(y, x) """ + pass + + def __rdiv__(self, y): # real signature unknown; restored from __doc__ + """ x.__rdiv__(y) <==> y/x """ + pass + + def __repr__(self): # real signature unknown; restored from __doc__ + """ x.__repr__() <==> repr(x) """ + pass + + def __rfloordiv__(self, y): # real signature unknown; restored from __doc__ + """ x.__rfloordiv__(y) <==> y//x """ + pass + + def __rlshift__(self, y): # real signature unknown; restored from __doc__ + """ x.__rlshift__(y) <==> y< y%x """ + pass + + def __rmul__(self, y): # real signature unknown; restored from __doc__ + """ x.__rmul__(y) <==> y*x """ + pass + + def __ror__(self, y): # real signature unknown; restored from __doc__ + """ x.__ror__(y) <==> y|x """ + pass + + def __rpow__(self, x, z=None): # real signature unknown; restored from __doc__ + """ y.__rpow__(x[, z]) <==> pow(x, y[, z]) """ + pass + + def __rrshift__(self, y): # real signature unknown; restored from __doc__ + """ x.__rrshift__(y) <==> y>>x """ + pass + + def __rshift__(self, y): # real signature unknown; restored from __doc__ + """ x.__rshift__(y) <==> x>>y """ + pass + + def __rsub__(self, y): # real signature unknown; restored from __doc__ + """ x.__rsub__(y) <==> y-x """ + pass + + def __rtruediv__(self, y): # real signature unknown; restored from __doc__ + """ x.__rtruediv__(y) <==> y/x """ + pass + + def __rxor__(self, y): # real signature unknown; restored from __doc__ + """ x.__rxor__(y) <==> y^x """ + pass + + def __sizeof__(self, *args, **kwargs): # real signature unknown + """ Returns size in memory, in bytes """ + pass + + def __str__(self): # real signature unknown; restored from __doc__ + """ x.__str__() <==> str(x) """ + pass + + def __sub__(self, y): # real signature unknown; restored from __doc__ + """ x.__sub__(y) <==> x-y """ + pass + + def __truediv__(self, y): # real signature unknown; restored from __doc__ + """ x.__truediv__(y) <==> x/y """ + pass + + def __trunc__(self, *args, **kwargs): # real signature unknown + """ Truncating an Integral returns itself. """ + pass + + def __xor__(self, y): # real signature unknown; restored from __doc__ + """ x.__xor__(y) <==> x^y """ + pass + + denominator = property(lambda self: object()) # default + imag = property(lambda self: object()) # default + numerator = property(lambda self: object()) # default + real = property(lambda self: object()) # default + + +class memoryview(object): + """ + memoryview(object) + + Create a new memoryview object which references the given object. + """ + def tobytes(self, *args, **kwargs): # real signature unknown + pass + + def tolist(self, *args, **kwargs): # real signature unknown + pass + + def __delitem__(self, y): # real signature unknown; restored from __doc__ + """ x.__delitem__(y) <==> del x[y] """ + pass + + def __eq__(self, y): # real signature unknown; restored from __doc__ + """ x.__eq__(y) <==> x==y """ + pass + + def __getattribute__(self, name): # real signature unknown; restored from __doc__ + """ x.__getattribute__('name') <==> x.name """ + pass + + def __getitem__(self, y): # real signature unknown; restored from __doc__ + """ x.__getitem__(y) <==> x[y] """ + pass + + def __ge__(self, y): # real signature unknown; restored from __doc__ + """ x.__ge__(y) <==> x>=y """ + pass + + def __gt__(self, y): # real signature unknown; restored from __doc__ + """ x.__gt__(y) <==> x>y """ + pass + + def __init__(self, p_object): # real signature unknown; restored from __doc__ + pass + + def __len__(self): # real signature unknown; restored from __doc__ + """ x.__len__() <==> len(x) """ + pass + + def __le__(self, y): # real signature unknown; restored from __doc__ + """ x.__le__(y) <==> x<=y """ + pass + + def __lt__(self, y): # real signature unknown; restored from __doc__ + """ x.__lt__(y) <==> x a new object with type S, a subtype of T """ + pass + + def __ne__(self, y): # real signature unknown; restored from __doc__ + """ x.__ne__(y) <==> x!=y """ + pass + + def __repr__(self): # real signature unknown; restored from __doc__ + """ x.__repr__() <==> repr(x) """ + pass + + def __setitem__(self, i, y): # real signature unknown; restored from __doc__ + """ x.__setitem__(i, y) <==> x[i]=y """ + pass + + format = property(lambda self: object()) # default + itemsize = property(lambda self: object()) # default + ndim = property(lambda self: object()) # default + readonly = property(lambda self: object()) # default + shape = property(lambda self: object()) # default + strides = property(lambda self: object()) # default + suboffsets = property(lambda self: object()) # default + + +class property(object): + """ + property(fget=None, fset=None, fdel=None, doc=None) -> property attribute + + fget is a function to be used for getting an attribute value, and likewise + fset is a function for setting, and fdel a function for del'ing, an + attribute. Typical use is to define a managed attribute x: + class C(object): + def getx(self): return self._x + def setx(self, value): self._x = value + def delx(self): del self._x + x = property(getx, setx, delx, "I'm the 'x' property.") + + Decorators make defining new properties or modifying existing ones easy: + class C(object): + @property + def x(self): return self._x + @x.setter + def x(self, value): self._x = value + @x.deleter + def x(self): del self._x + """ + def deleter(self, *args, **kwargs): # real signature unknown + """ Descriptor to change the deleter on a property. """ + pass + + def getter(self, *args, **kwargs): # real signature unknown + """ Descriptor to change the getter on a property. """ + pass + + def setter(self, *args, **kwargs): # real signature unknown + """ Descriptor to change the setter on a property. """ + pass + + def __delete__(self, obj): # real signature unknown; restored from __doc__ + """ descr.__delete__(obj) """ + pass + + def __getattribute__(self, name): # real signature unknown; restored from __doc__ + """ x.__getattribute__('name') <==> x.name """ + pass + + def __get__(self, obj, type=None): # real signature unknown; restored from __doc__ + """ descr.__get__(obj[, type]) -> value """ + pass + + def __init__(self, fget=None, fset=None, fdel=None, doc=None): # known special case of property.__init__ + """ + property(fget=None, fset=None, fdel=None, doc=None) -> property attribute + + fget is a function to be used for getting an attribute value, and likewise + fset is a function for setting, and fdel a function for del'ing, an + attribute. Typical use is to define a managed attribute x: + class C(object): + def getx(self): return self._x + def setx(self, value): self._x = value + def delx(self): del self._x + x = property(getx, setx, delx, "I'm the 'x' property.") + + Decorators make defining new properties or modifying existing ones easy: + class C(object): + @property + def x(self): return self._x + @x.setter + def x(self, value): self._x = value + @x.deleter + def x(self): del self._x + + # (copied from class doc) + """ + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + def __set__(self, obj, value): # real signature unknown; restored from __doc__ + """ descr.__set__(obj, value) """ + pass + + fdel = property(lambda self: object()) # default + fget = property(lambda self: object()) # default + fset = property(lambda self: object()) # default + + +class reversed(object): + """ + reversed(sequence) -> reverse iterator over values of the sequence + + Return a reverse iterator + """ + def next(self): # real signature unknown; restored from __doc__ + """ x.next() -> the next value, or raise StopIteration """ + pass + + def __getattribute__(self, name): # real signature unknown; restored from __doc__ + """ x.__getattribute__('name') <==> x.name """ + pass + + def __init__(self, sequence): # real signature unknown; restored from __doc__ + pass + + def __iter__(self): # real signature unknown; restored from __doc__ + """ x.__iter__() <==> iter(x) """ + pass + + def __length_hint__(self, *args, **kwargs): # real signature unknown + """ Private method returning an estimate of len(list(it)). """ + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class set(object): + """ + set() -> new empty set object + set(iterable) -> new set object + + Build an unordered collection of unique elements. + """ + def add(self, *args, **kwargs): # real signature unknown + """ + Add an element to a set. + + This has no effect if the element is already present. + """ + pass + + def clear(self, *args, **kwargs): # real signature unknown + """ Remove all elements from this set. """ + pass + + def copy(self, *args, **kwargs): # real signature unknown + """ Return a shallow copy of a set. """ + pass + + def difference(self, *args, **kwargs): # real signature unknown + """ + Return the difference of two or more sets as a new set. + + (i.e. all elements that are in this set but not the others.) + """ + pass + + def difference_update(self, *args, **kwargs): # real signature unknown + """ Remove all elements of another set from this set. """ + pass + + def discard(self, *args, **kwargs): # real signature unknown + """ + Remove an element from a set if it is a member. + + If the element is not a member, do nothing. + """ + pass + + def intersection(self, *args, **kwargs): # real signature unknown + """ + Return the intersection of two or more sets as a new set. + + (i.e. elements that are common to all of the sets.) + """ + pass + + def intersection_update(self, *args, **kwargs): # real signature unknown + """ Update a set with the intersection of itself and another. """ + pass + + def isdisjoint(self, *args, **kwargs): # real signature unknown + """ Return True if two sets have a null intersection. """ + pass + + def issubset(self, *args, **kwargs): # real signature unknown + """ Report whether another set contains this set. """ + pass + + def issuperset(self, *args, **kwargs): # real signature unknown + """ Report whether this set contains another set. """ + pass + + def pop(self, *args, **kwargs): # real signature unknown + """ + Remove and return an arbitrary set element. + Raises KeyError if the set is empty. + """ + pass + + def remove(self, *args, **kwargs): # real signature unknown + """ + Remove an element from a set; it must be a member. + + If the element is not a member, raise a KeyError. + """ + pass + + def symmetric_difference(self, *args, **kwargs): # real signature unknown + """ + Return the symmetric difference of two sets as a new set. + + (i.e. all elements that are in exactly one of the sets.) + """ + pass + + def symmetric_difference_update(self, *args, **kwargs): # real signature unknown + """ Update a set with the symmetric difference of itself and another. """ + pass + + def union(self, *args, **kwargs): # real signature unknown + """ + Return the union of sets as a new set. + + (i.e. all elements that are in either set.) + """ + pass + + def update(self, *args, **kwargs): # real signature unknown + """ Update a set with the union of itself and others. """ + pass + + def __and__(self, y): # real signature unknown; restored from __doc__ + """ x.__and__(y) <==> x&y """ + pass + + def __cmp__(self, y): # real signature unknown; restored from __doc__ + """ x.__cmp__(y) <==> cmp(x,y) """ + pass + + def __contains__(self, y): # real signature unknown; restored from __doc__ + """ x.__contains__(y) <==> y in x. """ + pass + + def __eq__(self, y): # real signature unknown; restored from __doc__ + """ x.__eq__(y) <==> x==y """ + pass + + def __getattribute__(self, name): # real signature unknown; restored from __doc__ + """ x.__getattribute__('name') <==> x.name """ + pass + + def __ge__(self, y): # real signature unknown; restored from __doc__ + """ x.__ge__(y) <==> x>=y """ + pass + + def __gt__(self, y): # real signature unknown; restored from __doc__ + """ x.__gt__(y) <==> x>y """ + pass + + def __iand__(self, y): # real signature unknown; restored from __doc__ + """ x.__iand__(y) <==> x&y """ + pass + + def __init__(self, seq=()): # known special case of set.__init__ + """ + set() -> new empty set object + set(iterable) -> new set object + + Build an unordered collection of unique elements. + # (copied from class doc) + """ + pass + + def __ior__(self, y): # real signature unknown; restored from __doc__ + """ x.__ior__(y) <==> x|y """ + pass + + def __isub__(self, y): # real signature unknown; restored from __doc__ + """ x.__isub__(y) <==> x-y """ + pass + + def __iter__(self): # real signature unknown; restored from __doc__ + """ x.__iter__() <==> iter(x) """ + pass + + def __ixor__(self, y): # real signature unknown; restored from __doc__ + """ x.__ixor__(y) <==> x^y """ + pass + + def __len__(self): # real signature unknown; restored from __doc__ + """ x.__len__() <==> len(x) """ + pass + + def __le__(self, y): # real signature unknown; restored from __doc__ + """ x.__le__(y) <==> x<=y """ + pass + + def __lt__(self, y): # real signature unknown; restored from __doc__ + """ x.__lt__(y) <==> x a new object with type S, a subtype of T """ + pass + + def __ne__(self, y): # real signature unknown; restored from __doc__ + """ x.__ne__(y) <==> x!=y """ + pass + + def __or__(self, y): # real signature unknown; restored from __doc__ + """ x.__or__(y) <==> x|y """ + pass + + def __rand__(self, y): # real signature unknown; restored from __doc__ + """ x.__rand__(y) <==> y&x """ + pass + + def __reduce__(self, *args, **kwargs): # real signature unknown + """ Return state information for pickling. """ + pass + + def __repr__(self): # real signature unknown; restored from __doc__ + """ x.__repr__() <==> repr(x) """ + pass + + def __ror__(self, y): # real signature unknown; restored from __doc__ + """ x.__ror__(y) <==> y|x """ + pass + + def __rsub__(self, y): # real signature unknown; restored from __doc__ + """ x.__rsub__(y) <==> y-x """ + pass + + def __rxor__(self, y): # real signature unknown; restored from __doc__ + """ x.__rxor__(y) <==> y^x """ + pass + + def __sizeof__(self): # real signature unknown; restored from __doc__ + """ S.__sizeof__() -> size of S in memory, in bytes """ + pass + + def __sub__(self, y): # real signature unknown; restored from __doc__ + """ x.__sub__(y) <==> x-y """ + pass + + def __xor__(self, y): # real signature unknown; restored from __doc__ + """ x.__xor__(y) <==> x^y """ + pass + + __hash__ = None + + +class slice(object): + """ + slice([start,] stop[, step]) + + Create a slice object. This is used for extended slicing (e.g. a[0:10:2]). + """ + def indices(self, len): # real signature unknown; restored from __doc__ + """ + S.indices(len) -> (start, stop, stride) + + Assuming a sequence of length len, calculate the start and stop + indices, and the stride length of the extended slice described by + S. Out of bounds indices are clipped in a manner consistent with the + handling of normal slices. + """ + pass + + def __cmp__(self, y): # real signature unknown; restored from __doc__ + """ x.__cmp__(y) <==> cmp(x,y) """ + pass + + def __getattribute__(self, name): # real signature unknown; restored from __doc__ + """ x.__getattribute__('name') <==> x.name """ + pass + + def __hash__(self): # real signature unknown; restored from __doc__ + """ x.__hash__() <==> hash(x) """ + pass + + def __init__(self, start=None, *args, **kwargs): # real signature unknown; NOTE: unreliably restored from __doc__ + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + def __reduce__(self, *args, **kwargs): # real signature unknown + """ Return state information for pickling. """ + pass + + def __repr__(self): # real signature unknown; restored from __doc__ + """ x.__repr__() <==> repr(x) """ + pass + + start = property(lambda self: 0) + step = property(lambda self: 0) + stop = property(lambda self: 0) + + +class staticmethod(object): + """ + staticmethod(function) -> method + + Convert a function to be a static method. + + A static method does not receive an implicit first argument. + To declare a static method, use this idiom: + + class C: + def f(arg1, arg2, ...): ... + f = staticmethod(f) + + It can be called either on the class (e.g. C.f()) or on an instance + (e.g. C().f()). The instance is ignored except for its class. + + Static methods in Python are similar to those found in Java or C++. + For a more advanced concept, see the classmethod builtin. + """ + def __getattribute__(self, name): # real signature unknown; restored from __doc__ + """ x.__getattribute__('name') <==> x.name """ + pass + + def __get__(self, obj, type=None): # real signature unknown; restored from __doc__ + """ descr.__get__(obj[, type]) -> value """ + pass + + def __init__(self, function): # real signature unknown; restored from __doc__ + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + __func__ = property(lambda self: object()) # default + + +class super(object): + """ + super(type) -> unbound super object + super(type, obj) -> bound super object; requires isinstance(obj, type) + super(type, type2) -> bound super object; requires issubclass(type2, type) + Typical use to call a cooperative superclass method: + class C(B): + def meth(self, arg): + super(C, self).meth(arg) + """ + def __getattribute__(self, name): # real signature unknown; restored from __doc__ + """ x.__getattribute__('name') <==> x.name """ + pass + + def __get__(self, obj, type=None): # real signature unknown; restored from __doc__ + """ descr.__get__(obj[, type]) -> value """ + pass + + def __init__(self, type1, type2=None): # known special case of super.__init__ + """ + super(type) -> unbound super object + super(type, obj) -> bound super object; requires isinstance(obj, type) + super(type, type2) -> bound super object; requires issubclass(type2, type) + Typical use to call a cooperative superclass method: + class C(B): + def meth(self, arg): + super(C, self).meth(arg) + # (copied from class doc) + """ + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + def __repr__(self): # real signature unknown; restored from __doc__ + """ x.__repr__() <==> repr(x) """ + pass + + __self_class__ = property(lambda self: type(object)) + __self__ = property(lambda self: type(object)) + __thisclass__ = property(lambda self: type(object)) + + +class tuple(object): + """ + tuple() -> empty tuple + tuple(iterable) -> tuple initialized from iterable's items + + If the argument is a tuple, the return value is the same object. + """ + def count(self, value): # real signature unknown; restored from __doc__ + """ T.count(value) -> integer -- return number of occurrences of value """ + return 0 + + def index(self, value, start=None, stop=None): # real signature unknown; restored from __doc__ + """ + T.index(value, [start, [stop]]) -> integer -- return first index of value. + Raises ValueError if the value is not present. + """ + return 0 + + def __add__(self, y): # real signature unknown; restored from __doc__ + """ x.__add__(y) <==> x+y """ + pass + + def __contains__(self, y): # real signature unknown; restored from __doc__ + """ x.__contains__(y) <==> y in x """ + pass + + def __eq__(self, y): # real signature unknown; restored from __doc__ + """ x.__eq__(y) <==> x==y """ + pass + + def __getattribute__(self, name): # real signature unknown; restored from __doc__ + """ x.__getattribute__('name') <==> x.name """ + pass + + def __getitem__(self, y): # real signature unknown; restored from __doc__ + """ x.__getitem__(y) <==> x[y] """ + pass + + def __getnewargs__(self, *args, **kwargs): # real signature unknown + pass + + def __getslice__(self, i, j): # real signature unknown; restored from __doc__ + """ + x.__getslice__(i, j) <==> x[i:j] + + Use of negative indices is not supported. + """ + pass + + def __ge__(self, y): # real signature unknown; restored from __doc__ + """ x.__ge__(y) <==> x>=y """ + pass + + def __gt__(self, y): # real signature unknown; restored from __doc__ + """ x.__gt__(y) <==> x>y """ + pass + + def __hash__(self): # real signature unknown; restored from __doc__ + """ x.__hash__() <==> hash(x) """ + pass + + def __init__(self, seq=()): # known special case of tuple.__init__ + """ + tuple() -> empty tuple + tuple(iterable) -> tuple initialized from iterable's items + + If the argument is a tuple, the return value is the same object. + # (copied from class doc) + """ + pass + + def __iter__(self): # real signature unknown; restored from __doc__ + """ x.__iter__() <==> iter(x) """ + pass + + def __len__(self): # real signature unknown; restored from __doc__ + """ x.__len__() <==> len(x) """ + pass + + def __le__(self, y): # real signature unknown; restored from __doc__ + """ x.__le__(y) <==> x<=y """ + pass + + def __lt__(self, y): # real signature unknown; restored from __doc__ + """ x.__lt__(y) <==> x x*n """ + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + def __ne__(self, y): # real signature unknown; restored from __doc__ + """ x.__ne__(y) <==> x!=y """ + pass + + def __repr__(self): # real signature unknown; restored from __doc__ + """ x.__repr__() <==> repr(x) """ + pass + + def __rmul__(self, n): # real signature unknown; restored from __doc__ + """ x.__rmul__(n) <==> n*x """ + pass + + def __sizeof__(self): # real signature unknown; restored from __doc__ + """ T.__sizeof__() -- size of T in memory, in bytes """ + pass + + +class type(object): + """ + type(object) -> the object's type + type(name, bases, dict) -> a new type + """ + def mro(self): # real signature unknown; restored from __doc__ + """ + mro() -> list + return a type's method resolution order + """ + return [] + + def __call__(self, *more): # real signature unknown; restored from __doc__ + """ x.__call__(...) <==> x(...) """ + pass + + def __delattr__(self, name): # real signature unknown; restored from __doc__ + """ x.__delattr__('name') <==> del x.name """ + pass + + def __eq__(self, y): # real signature unknown; restored from __doc__ + """ x.__eq__(y) <==> x==y """ + pass + + def __getattribute__(self, name): # real signature unknown; restored from __doc__ + """ x.__getattribute__('name') <==> x.name """ + pass + + def __ge__(self, y): # real signature unknown; restored from __doc__ + """ x.__ge__(y) <==> x>=y """ + pass + + def __gt__(self, y): # real signature unknown; restored from __doc__ + """ x.__gt__(y) <==> x>y """ + pass + + def __hash__(self): # real signature unknown; restored from __doc__ + """ x.__hash__() <==> hash(x) """ + pass + + def __init__(cls, what, bases=None, dict=None): # known special case of type.__init__ + """ + type(object) -> the object's type + type(name, bases, dict) -> a new type + # (copied from class doc) + """ + pass + + def __instancecheck__(self): # real signature unknown; restored from __doc__ + """ + __instancecheck__() -> bool + check if an object is an instance + """ + return False + + def __le__(self, y): # real signature unknown; restored from __doc__ + """ x.__le__(y) <==> x<=y """ + pass + + def __lt__(self, y): # real signature unknown; restored from __doc__ + """ x.__lt__(y) <==> x a new object with type S, a subtype of T """ + pass + + def __ne__(self, y): # real signature unknown; restored from __doc__ + """ x.__ne__(y) <==> x!=y """ + pass + + def __repr__(self): # real signature unknown; restored from __doc__ + """ x.__repr__() <==> repr(x) """ + pass + + def __setattr__(self, name, value): # real signature unknown; restored from __doc__ + """ x.__setattr__('name', value) <==> x.name = value """ + pass + + def __subclasscheck__(self): # real signature unknown; restored from __doc__ + """ + __subclasscheck__() -> bool + check if a class is a subclass + """ + return False + + def __subclasses__(self): # real signature unknown; restored from __doc__ + """ __subclasses__() -> list of immediate subclasses """ + return [] + + __abstractmethods__ = property(lambda self: object()) # default + + __bases__ = ( + object, + ) + __base__ = object + __basicsize__ = 872 + __dictoffset__ = 264 + __dict__ = None # (!) real value is '' + __flags__ = 2148423147 + __itemsize__ = 40 + __mro__ = ( + None, # (!) forward: type, real value is '' + object, + ) + __name__ = 'type' + __weakrefoffset__ = 368 + + +class unicode(basestring): + """ + unicode(string [, encoding[, errors]]) -> object + + Create a new Unicode object from the given encoded string. + encoding defaults to the current default string encoding. + errors can be 'strict', 'replace' or 'ignore' and defaults to 'strict'. + """ + def capitalize(self): # real signature unknown; restored from __doc__ + """ + S.capitalize() -> unicode + + Return a capitalized version of S, i.e. make the first character + have upper case and the rest lower case. + """ + return u"" + + def center(self, width, fillchar=None): # real signature unknown; restored from __doc__ + """ + S.center(width[, fillchar]) -> unicode + + Return S centered in a Unicode string of length width. Padding is + done using the specified fill character (default is a space) + """ + return u"" + + def count(self, sub, start=None, end=None): # real signature unknown; restored from __doc__ + """ + S.count(sub[, start[, end]]) -> int + + Return the number of non-overlapping occurrences of substring sub in + Unicode string S[start:end]. Optional arguments start and end are + interpreted as in slice notation. + """ + return 0 + + def decode(self, encoding=None, errors=None): # real signature unknown; restored from __doc__ + """ + S.decode([encoding[,errors]]) -> string or unicode + + Decodes S using the codec registered for encoding. encoding defaults + to the default encoding. errors may be given to set a different error + handling scheme. Default is 'strict' meaning that encoding errors raise + a UnicodeDecodeError. Other possible values are 'ignore' and 'replace' + as well as any other name registerd with codecs.register_error that is + able to handle UnicodeDecodeErrors. + """ + return "" + + def encode(self, encoding=None, errors=None): # real signature unknown; restored from __doc__ + """ + S.encode([encoding[,errors]]) -> string or unicode + + Encodes S using the codec registered for encoding. encoding defaults + to the default encoding. errors may be given to set a different error + handling scheme. Default is 'strict' meaning that encoding errors raise + a UnicodeEncodeError. Other possible values are 'ignore', 'replace' and + 'xmlcharrefreplace' as well as any other name registered with + codecs.register_error that can handle UnicodeEncodeErrors. + """ + return "" + + def endswith(self, suffix, start=None, end=None): # real signature unknown; restored from __doc__ + """ + S.endswith(suffix[, start[, end]]) -> bool + + Return True if S ends with the specified suffix, False otherwise. + With optional start, test S beginning at that position. + With optional end, stop comparing S at that position. + suffix can also be a tuple of strings to try. + """ + return False + + def expandtabs(self, tabsize=None): # real signature unknown; restored from __doc__ + """ + S.expandtabs([tabsize]) -> unicode + + Return a copy of S where all tab characters are expanded using spaces. + If tabsize is not given, a tab size of 8 characters is assumed. + """ + return u"" + + def find(self, sub, start=None, end=None): # real signature unknown; restored from __doc__ + """ + S.find(sub [,start [,end]]) -> int + + Return the lowest index in S where substring sub is found, + such that sub is contained within S[start:end]. Optional + arguments start and end are interpreted as in slice notation. + + Return -1 on failure. + """ + return 0 + + def format(*args, **kwargs): # known special case of unicode.format + """ + S.format(*args, **kwargs) -> unicode + + Return a formatted version of S, using substitutions from args and kwargs. + The substitutions are identified by braces ('{' and '}'). + """ + pass + + def index(self, sub, start=None, end=None): # real signature unknown; restored from __doc__ + """ + S.index(sub [,start [,end]]) -> int + + Like S.find() but raise ValueError when the substring is not found. + """ + return 0 + + def isalnum(self): # real signature unknown; restored from __doc__ + """ + S.isalnum() -> bool + + Return True if all characters in S are alphanumeric + and there is at least one character in S, False otherwise. + """ + return False + + def isalpha(self): # real signature unknown; restored from __doc__ + """ + S.isalpha() -> bool + + Return True if all characters in S are alphabetic + and there is at least one character in S, False otherwise. + """ + return False + + def isdecimal(self): # real signature unknown; restored from __doc__ + """ + S.isdecimal() -> bool + + Return True if there are only decimal characters in S, + False otherwise. + """ + return False + + def isdigit(self): # real signature unknown; restored from __doc__ + """ + S.isdigit() -> bool + + Return True if all characters in S are digits + and there is at least one character in S, False otherwise. + """ + return False + + def islower(self): # real signature unknown; restored from __doc__ + """ + S.islower() -> bool + + Return True if all cased characters in S are lowercase and there is + at least one cased character in S, False otherwise. + """ + return False + + def isnumeric(self): # real signature unknown; restored from __doc__ + """ + S.isnumeric() -> bool + + Return True if there are only numeric characters in S, + False otherwise. + """ + return False + + def isspace(self): # real signature unknown; restored from __doc__ + """ + S.isspace() -> bool + + Return True if all characters in S are whitespace + and there is at least one character in S, False otherwise. + """ + return False + + def istitle(self): # real signature unknown; restored from __doc__ + """ + S.istitle() -> bool + + Return True if S is a titlecased string and there is at least one + character in S, i.e. upper- and titlecase characters may only + follow uncased characters and lowercase characters only cased ones. + Return False otherwise. + """ + return False + + def isupper(self): # real signature unknown; restored from __doc__ + """ + S.isupper() -> bool + + Return True if all cased characters in S are uppercase and there is + at least one cased character in S, False otherwise. + """ + return False + + def join(self, iterable): # real signature unknown; restored from __doc__ + """ + S.join(iterable) -> unicode + + Return a string which is the concatenation of the strings in the + iterable. The separator between elements is S. + """ + return u"" + + def ljust(self, width, fillchar=None): # real signature unknown; restored from __doc__ + """ + S.ljust(width[, fillchar]) -> int + + Return S left-justified in a Unicode string of length width. Padding is + done using the specified fill character (default is a space). + """ + return 0 + + def lower(self): # real signature unknown; restored from __doc__ + """ + S.lower() -> unicode + + Return a copy of the string S converted to lowercase. + """ + return u"" + + def lstrip(self, chars=None): # real signature unknown; restored from __doc__ + """ + S.lstrip([chars]) -> unicode + + Return a copy of the string S with leading whitespace removed. + If chars is given and not None, remove characters in chars instead. + If chars is a str, it will be converted to unicode before stripping + """ + return u"" + + def partition(self, sep): # real signature unknown; restored from __doc__ + """ + S.partition(sep) -> (head, sep, tail) + + Search for the separator sep in S, and return the part before it, + the separator itself, and the part after it. If the separator is not + found, return S and two empty strings. + """ + pass + + def replace(self, old, new, count=None): # real signature unknown; restored from __doc__ + """ + S.replace(old, new[, count]) -> unicode + + Return a copy of S with all occurrences of substring + old replaced by new. If the optional argument count is + given, only the first count occurrences are replaced. + """ + return u"" + + def rfind(self, sub, start=None, end=None): # real signature unknown; restored from __doc__ + """ + S.rfind(sub [,start [,end]]) -> int + + Return the highest index in S where substring sub is found, + such that sub is contained within S[start:end]. Optional + arguments start and end are interpreted as in slice notation. + + Return -1 on failure. + """ + return 0 + + def rindex(self, sub, start=None, end=None): # real signature unknown; restored from __doc__ + """ + S.rindex(sub [,start [,end]]) -> int + + Like S.rfind() but raise ValueError when the substring is not found. + """ + return 0 + + def rjust(self, width, fillchar=None): # real signature unknown; restored from __doc__ + """ + S.rjust(width[, fillchar]) -> unicode + + Return S right-justified in a Unicode string of length width. Padding is + done using the specified fill character (default is a space). + """ + return u"" + + def rpartition(self, sep): # real signature unknown; restored from __doc__ + """ + S.rpartition(sep) -> (head, sep, tail) + + Search for the separator sep in S, starting at the end of S, and return + the part before it, the separator itself, and the part after it. If the + separator is not found, return two empty strings and S. + """ + pass + + def rsplit(self, sep=None, maxsplit=None): # real signature unknown; restored from __doc__ + """ + S.rsplit([sep [,maxsplit]]) -> list of strings + + Return a list of the words in S, using sep as the + delimiter string, starting at the end of the string and + working to the front. If maxsplit is given, at most maxsplit + splits are done. If sep is not specified, any whitespace string + is a separator. + """ + return [] + + def rstrip(self, chars=None): # real signature unknown; restored from __doc__ + """ + S.rstrip([chars]) -> unicode + + Return a copy of the string S with trailing whitespace removed. + If chars is given and not None, remove characters in chars instead. + If chars is a str, it will be converted to unicode before stripping + """ + return u"" + + def split(self, sep=None, maxsplit=None): # real signature unknown; restored from __doc__ + """ + S.split([sep [,maxsplit]]) -> list of strings + + Return a list of the words in S, using sep as the + delimiter string. If maxsplit is given, at most maxsplit + splits are done. If sep is not specified or is None, any + whitespace string is a separator and empty strings are + removed from the result. + """ + return [] + + def splitlines(self, keepends=None): # real signature unknown; restored from __doc__ + """ + S.splitlines([keepends]) -> list of strings + + Return a list of the lines in S, breaking at line boundaries. + Line breaks are not included in the resulting list unless keepends + is given and true. + """ + return [] + + def startswith(self, prefix, start=None, end=None): # real signature unknown; restored from __doc__ + """ + S.startswith(prefix[, start[, end]]) -> bool + + Return True if S starts with the specified prefix, False otherwise. + With optional start, test S beginning at that position. + With optional end, stop comparing S at that position. + prefix can also be a tuple of strings to try. + """ + return False + + def strip(self, chars=None): # real signature unknown; restored from __doc__ + """ + S.strip([chars]) -> unicode + + Return a copy of the string S with leading and trailing + whitespace removed. + If chars is given and not None, remove characters in chars instead. + If chars is a str, it will be converted to unicode before stripping + """ + return u"" + + def swapcase(self): # real signature unknown; restored from __doc__ + """ + S.swapcase() -> unicode + + Return a copy of S with uppercase characters converted to lowercase + and vice versa. + """ + return u"" + + def title(self): # real signature unknown; restored from __doc__ + """ + S.title() -> unicode + + Return a titlecased version of S, i.e. words start with title case + characters, all remaining cased characters have lower case. + """ + return u"" + + def translate(self, table): # real signature unknown; restored from __doc__ + """ + S.translate(table) -> unicode + + Return a copy of the string S, where all characters have been mapped + through the given translation table, which must be a mapping of + Unicode ordinals to Unicode ordinals, Unicode strings or None. + Unmapped characters are left untouched. Characters mapped to None + are deleted. + """ + return u"" + + def upper(self): # real signature unknown; restored from __doc__ + """ + S.upper() -> unicode + + Return a copy of S converted to uppercase. + """ + return u"" + + def zfill(self, width): # real signature unknown; restored from __doc__ + """ + S.zfill(width) -> unicode + + Pad a numeric string S with zeros on the left, to fill a field + of the specified width. The string S is never truncated. + """ + return u"" + + def _formatter_field_name_split(self, *args, **kwargs): # real signature unknown + pass + + def _formatter_parser(self, *args, **kwargs): # real signature unknown + pass + + def __add__(self, y): # real signature unknown; restored from __doc__ + """ x.__add__(y) <==> x+y """ + pass + + def __contains__(self, y): # real signature unknown; restored from __doc__ + """ x.__contains__(y) <==> y in x """ + pass + + def __eq__(self, y): # real signature unknown; restored from __doc__ + """ x.__eq__(y) <==> x==y """ + pass + + def __format__(self, format_spec): # real signature unknown; restored from __doc__ + """ + S.__format__(format_spec) -> unicode + + Return a formatted version of S as described by format_spec. + """ + return u"" + + def __getattribute__(self, name): # real signature unknown; restored from __doc__ + """ x.__getattribute__('name') <==> x.name """ + pass + + def __getitem__(self, y): # real signature unknown; restored from __doc__ + """ x.__getitem__(y) <==> x[y] """ + pass + + def __getnewargs__(self, *args, **kwargs): # real signature unknown + pass + + def __getslice__(self, i, j): # real signature unknown; restored from __doc__ + """ + x.__getslice__(i, j) <==> x[i:j] + + Use of negative indices is not supported. + """ + pass + + def __ge__(self, y): # real signature unknown; restored from __doc__ + """ x.__ge__(y) <==> x>=y """ + pass + + def __gt__(self, y): # real signature unknown; restored from __doc__ + """ x.__gt__(y) <==> x>y """ + pass + + def __hash__(self): # real signature unknown; restored from __doc__ + """ x.__hash__() <==> hash(x) """ + pass + + def __init__(self, string=u'', encoding=None, errors='strict'): # known special case of unicode.__init__ + """ + unicode(string [, encoding[, errors]]) -> object + + Create a new Unicode object from the given encoded string. + encoding defaults to the current default string encoding. + errors can be 'strict', 'replace' or 'ignore' and defaults to 'strict'. + # (copied from class doc) + """ + pass + + def __len__(self): # real signature unknown; restored from __doc__ + """ x.__len__() <==> len(x) """ + pass + + def __le__(self, y): # real signature unknown; restored from __doc__ + """ x.__le__(y) <==> x<=y """ + pass + + def __lt__(self, y): # real signature unknown; restored from __doc__ + """ x.__lt__(y) <==> x x%y """ + pass + + def __mul__(self, n): # real signature unknown; restored from __doc__ + """ x.__mul__(n) <==> x*n """ + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + def __ne__(self, y): # real signature unknown; restored from __doc__ + """ x.__ne__(y) <==> x!=y """ + pass + + def __repr__(self): # real signature unknown; restored from __doc__ + """ x.__repr__() <==> repr(x) """ + pass + + def __rmod__(self, y): # real signature unknown; restored from __doc__ + """ x.__rmod__(y) <==> y%x """ + pass + + def __rmul__(self, n): # real signature unknown; restored from __doc__ + """ x.__rmul__(n) <==> n*x """ + pass + + def __sizeof__(self): # real signature unknown; restored from __doc__ + """ S.__sizeof__() -> size of S in memory, in bytes """ + pass + + def __str__(self): # real signature unknown; restored from __doc__ + """ x.__str__() <==> str(x) """ + pass + + +class xrange(object): + """ + xrange([start,] stop[, step]) -> xrange object + + Like range(), but instead of returning a list, returns an object that + generates the numbers in the range on demand. For looping, this is + slightly faster than range() and more memory efficient. + """ + def __getattribute__(self, name): # real signature unknown; restored from __doc__ + """ x.__getattribute__('name') <==> x.name """ + pass + + def __getitem__(self, y): # real signature unknown; restored from __doc__ + """ x.__getitem__(y) <==> x[y] """ + pass + + def __init__(self, start=None, *args, **kwargs): # real signature unknown; NOTE: unreliably restored from __doc__ + pass + + def __iter__(self): # real signature unknown; restored from __doc__ + """ x.__iter__() <==> iter(x) """ + pass + + def __len__(self): # real signature unknown; restored from __doc__ + """ x.__len__() <==> len(x) """ + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + def __reduce__(self, *args, **kwargs): # real signature unknown + pass + + def __repr__(self): # real signature unknown; restored from __doc__ + """ x.__repr__() <==> repr(x) """ + pass + + def __reversed__(self, *args, **kwargs): # real signature unknown + """ Returns a reverse iterator. """ + pass + + +class ___Classobj: + '''A mock class representing the old style class base.''' + __module__ = '' + __class__ = None + + def __init__(self): + pass + __dict__ = {} + __doc__ = '' + + +class __generator(object): + '''A mock class representing the generator function type.''' + def __init__(self): + self.gi_code = None + self.gi_frame = None + self.gi_running = 0 + + def __iter__(self): + '''Defined to support iteration over container.''' + pass + + def next(self): + '''Return the next item from the container.''' + pass + + def close(self): + '''Raises new GeneratorExit exception inside the generator to terminate the iteration.''' + pass + + def send(self, value): + '''Resumes the generator and "sends" a value that becomes the result of the current yield-expression.''' + pass + + def throw(self, type, value=None, traceback=None): + '''Used to raise an exception inside the generator.''' + pass + + +class __namedtuple(tuple): + '''A mock base class for named tuples.''' + + __slots__ = () + _fields = () + + def __new__(cls, *args, **kwargs): + 'Create a new instance of the named tuple.' + return tuple.__new__(cls, *args) + + @classmethod + def _make(cls, iterable, new=tuple.__new__, len=len): + 'Make a new named tuple object from a sequence or iterable.' + return new(cls, iterable) + + def __repr__(self): + return '' + + def _asdict(self): + 'Return a new dict which maps field types to their values.' + return {} + + def _replace(self, **kwargs): + 'Return a new named tuple object replacing specified fields with new values.' + return self + + def __getnewargs__(self): + return tuple(self) + +# variables with complex values + +Ellipsis = None # (!) real value is '' + +NotImplemented = None # (!) real value is '' + diff --git a/python/testData/MockSdk2.7/python_stubs/datetime.py b/python/testData/MockSdk2.7/python_stubs/datetime.py new file mode 100644 index 000000000000..85b0ac7961e2 --- /dev/null +++ b/python/testData/MockSdk2.7/python_stubs/datetime.py @@ -0,0 +1,588 @@ +# encoding: utf-8 +# module datetime +# from /usr/lib/python2.7/lib-dynload/datetime.so +# by generator 1.124 +""" Fast implementation of the datetime type. """ +# no imports + +# Variables with simple values + +MAXYEAR = 9999 + +MINYEAR = 1 + +# no functions +# classes + +class date(object): + """ date(year, month, day) --> date object """ + def ctime(self): # real signature unknown; restored from __doc__ + """ Return ctime() style string. """ + pass + + @classmethod + def fromordinal(cls, ordinal): # known case of datetime.date.fromordinal + """ int -> date corresponding to a proleptic Gregorian ordinal. """ + return date(1,1,1) + + @classmethod + def fromtimestamp(cls, timestamp): # known case of datetime.date.fromtimestamp + """ timestamp -> local date from a POSIX timestamp (like time.time()). """ + return date(1,1,1) + + def isocalendar(self): # known case of datetime.date.isocalendar + """ Return a 3-tuple containing ISO year, week number, and weekday. """ + return (1, 1, 1) + + def isoformat(self): # known case of datetime.date.isoformat + """ Return string in ISO 8601 format, YYYY-MM-DD. """ + return "" + + def isoweekday(self): # known case of datetime.date.isoweekday + """ + Return the day of the week represented by the date. + Monday == 1 ... Sunday == 7 + """ + return 0 + + def replace(self, year=None, month=None, day=None): # known case of datetime.date.replace + """ Return date with new specified fields. """ + return date(1,1,1) + + def strftime(self, format): # known case of datetime.date.strftime + """ format -> strftime() style string. """ + return "" + + def timetuple(self): # known case of datetime.date.timetuple + """ Return time tuple, compatible with time.localtime(). """ + return (0, 0, 0, 0, 0, 0, 0, 0, 0) + + @classmethod + def today(self): # known case of datetime.date.today + """ Current date or datetime: same as self.__class__.fromtimestamp(time.time()). """ + return date(1, 1, 1) + + def toordinal(self): # known case of datetime.date.toordinal + """ Return proleptic Gregorian ordinal. January 1 of year 1 is day 1. """ + return 0 + + def weekday(self): # known case of datetime.date.weekday + """ + Return the day of the week represented by the date. + Monday == 0 ... Sunday == 6 + """ + return 0 + + def __add__(self, y): # real signature unknown; restored from __doc__ + """ x.__add__(y) <==> x+y """ + pass + + def __eq__(self, y): # real signature unknown; restored from __doc__ + """ x.__eq__(y) <==> x==y """ + pass + + def __format__(self, *args, **kwargs): # real signature unknown + """ Formats self with strftime. """ + pass + + def __getattribute__(self, name): # real signature unknown; restored from __doc__ + """ x.__getattribute__('name') <==> x.name """ + pass + + def __ge__(self, y): # real signature unknown; restored from __doc__ + """ x.__ge__(y) <==> x>=y """ + pass + + def __gt__(self, y): # real signature unknown; restored from __doc__ + """ x.__gt__(y) <==> x>y """ + pass + + def __hash__(self): # real signature unknown; restored from __doc__ + """ x.__hash__() <==> hash(x) """ + pass + + def __init__(self, year, month, day): # real signature unknown; restored from __doc__ + pass + + def __le__(self, y): # real signature unknown; restored from __doc__ + """ x.__le__(y) <==> x<=y """ + pass + + def __lt__(self, y): # real signature unknown; restored from __doc__ + """ x.__lt__(y) <==> x a new object with type S, a subtype of T """ + pass + + def __ne__(self, y): # real signature unknown; restored from __doc__ + """ x.__ne__(y) <==> x!=y """ + pass + + def __radd__(self, y): # real signature unknown; restored from __doc__ + """ x.__radd__(y) <==> y+x """ + pass + + def __reduce__(self): # real signature unknown; restored from __doc__ + """ __reduce__() -> (cls, state) """ + pass + + def __repr__(self): # real signature unknown; restored from __doc__ + """ x.__repr__() <==> repr(x) """ + pass + + def __rsub__(self, y): # real signature unknown; restored from __doc__ + """ x.__rsub__(y) <==> y-x """ + pass + + def __str__(self): # real signature unknown; restored from __doc__ + """ x.__str__() <==> str(x) """ + pass + + def __sub__(self, y): # real signature unknown; restored from __doc__ + """ x.__sub__(y) <==> x-y """ + pass + + day = property(lambda self: 0) + month = property(lambda self: 0) + year = property(lambda self: 0) + + max = None # (!) real value is '' + min = None # (!) real value is '' + resolution = None # (!) real value is '' + + +class datetime(date): + """ + datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]]) + + The year, month and day arguments are required. tzinfo may be None, or an + instance of a tzinfo subclass. The remaining arguments may be ints or longs. + """ + def astimezone(self, tz): # known case of datetime.datetime.astimezone + """ tz -> convert to local time in new timezone tz """ + return datetime(1, 1, 1) + + @classmethod + def combine(cls, date, time): # known case of datetime.datetime.combine + """ date, time -> datetime with same date and time fields """ + return datetime(1, 1, 1) + + def ctime(self): # real signature unknown; restored from __doc__ + """ Return ctime() style string. """ + pass + + def date(self): # known case of datetime.datetime.date + """ Return date object with same year, month and day. """ + return datetime(1, 1, 1) + + def dst(self): # real signature unknown; restored from __doc__ + """ Return self.tzinfo.dst(self). """ + pass + + @classmethod + def fromtimestamp(cls, timestamp, tz=None): # known case of datetime.datetime.fromtimestamp + """ timestamp[, tz] -> tz's local time from POSIX timestamp. """ + return datetime(1, 1, 1) + + def isoformat(self, sep='T'): # known case of datetime.datetime.isoformat + """ + [sep] -> string in ISO 8601 format, YYYY-MM-DDTHH:MM:SS[.mmmmmm][+HH:MM]. + + sep is used to separate the year from the time, and defaults to 'T'. + """ + return "" + + @classmethod + def now(cls, tz=None): # known case of datetime.datetime.now + """ [tz] -> new datetime with tz's local day and time. """ + return datetime(1, 1, 1) + + def replace(self, year=None, month=None, day=None, hour=None, minute=None, second=None, microsecond=None, tzinfo=None): # known case of datetime.datetime.replace + """ Return datetime with new specified fields. """ + return datetime(1, 1, 1) + + @classmethod + def strptime(cls, date_string, format): # known case of datetime.datetime.strptime + """ string, format -> new datetime parsed from a string (like time.strptime()). """ + return "" + + def time(self): # known case of datetime.datetime.time + """ Return time object with same time but with tzinfo=None. """ + return time(0, 0) + + def timetuple(self): # known case of datetime.datetime.timetuple + """ Return time tuple, compatible with time.localtime(). """ + return (0, 0, 0, 0, 0, 0, 0, 0, 0) + + def timetz(self): # known case of datetime.datetime.timetz + """ Return time object with same time and tzinfo. """ + return time(0, 0) + + def tzname(self): # real signature unknown; restored from __doc__ + """ Return self.tzinfo.tzname(self). """ + pass + + @classmethod + def utcfromtimestamp(self, timestamp): # known case of datetime.datetime.utcfromtimestamp + """ timestamp -> UTC datetime from a POSIX timestamp (like time.time()). """ + return datetime(1, 1, 1) + + @classmethod + def utcnow(cls): # known case of datetime.datetime.utcnow + """ Return a new datetime representing UTC day and time. """ + return datetime(1, 1, 1) + + def utcoffset(self): # real signature unknown; restored from __doc__ + """ Return self.tzinfo.utcoffset(self). """ + pass + + def utctimetuple(self): # known case of datetime.datetime.utctimetuple + """ Return UTC time tuple, compatible with time.localtime(). """ + return (0, 0, 0, 0, 0, 0, 0, 0, 0) + + def __add__(self, y): # real signature unknown; restored from __doc__ + """ x.__add__(y) <==> x+y """ + pass + + def __eq__(self, y): # real signature unknown; restored from __doc__ + """ x.__eq__(y) <==> x==y """ + pass + + def __getattribute__(self, name): # real signature unknown; restored from __doc__ + """ x.__getattribute__('name') <==> x.name """ + pass + + def __ge__(self, y): # real signature unknown; restored from __doc__ + """ x.__ge__(y) <==> x>=y """ + pass + + def __gt__(self, y): # real signature unknown; restored from __doc__ + """ x.__gt__(y) <==> x>y """ + pass + + def __hash__(self): # real signature unknown; restored from __doc__ + """ x.__hash__() <==> hash(x) """ + pass + + def __init__(self, year, month, day, hour=None, minute=None, second=None, microsecond=None, tzinfo=None): # real signature unknown; restored from __doc__ + pass + + def __le__(self, y): # real signature unknown; restored from __doc__ + """ x.__le__(y) <==> x<=y """ + pass + + def __lt__(self, y): # real signature unknown; restored from __doc__ + """ x.__lt__(y) <==> x a new object with type S, a subtype of T """ + pass + + def __ne__(self, y): # real signature unknown; restored from __doc__ + """ x.__ne__(y) <==> x!=y """ + pass + + def __radd__(self, y): # real signature unknown; restored from __doc__ + """ x.__radd__(y) <==> y+x """ + pass + + def __reduce__(self): # real signature unknown; restored from __doc__ + """ __reduce__() -> (cls, state) """ + pass + + def __repr__(self): # real signature unknown; restored from __doc__ + """ x.__repr__() <==> repr(x) """ + pass + + def __rsub__(self, y): # real signature unknown; restored from __doc__ + """ x.__rsub__(y) <==> y-x """ + pass + + def __str__(self): # real signature unknown; restored from __doc__ + """ x.__str__() <==> str(x) """ + pass + + def __sub__(self, y): # real signature unknown; restored from __doc__ + """ x.__sub__(y) <==> x-y """ + pass + + hour = property(lambda self: 0) + microsecond = property(lambda self: 0) + minute = property(lambda self: 0) + second = property(lambda self: 0) + tzinfo = property(lambda self: object()) # default + + max = None # (!) real value is '' + min = None # (!) real value is '' + resolution = None # (!) real value is '' + + +class time(object): + """ + time([hour[, minute[, second[, microsecond[, tzinfo]]]]]) --> a time object + + All arguments are optional. tzinfo may be None, or an instance of + a tzinfo subclass. The remaining arguments may be ints or longs. + """ + def dst(self): # real signature unknown; restored from __doc__ + """ Return self.tzinfo.dst(self). """ + pass + + def isoformat(self): # known case of datetime.time.isoformat + """ Return string in ISO 8601 format, HH:MM:SS[.mmmmmm][+HH:MM]. """ + return "" + + def replace(self, hour=None, minute=None, second=None, microsecond=None, tzinfo=None): # known case of datetime.time.replace + """ Return time with new specified fields. """ + return time(0, 0) + + def strftime(self, format): # known case of datetime.time.strftime + """ format -> strftime() style string. """ + return "" + + def tzname(self): # real signature unknown; restored from __doc__ + """ Return self.tzinfo.tzname(self). """ + pass + + def utcoffset(self): # real signature unknown; restored from __doc__ + """ Return self.tzinfo.utcoffset(self). """ + pass + + def __eq__(self, y): # real signature unknown; restored from __doc__ + """ x.__eq__(y) <==> x==y """ + pass + + def __format__(self, *args, **kwargs): # real signature unknown + """ Formats self with strftime. """ + pass + + def __getattribute__(self, name): # real signature unknown; restored from __doc__ + """ x.__getattribute__('name') <==> x.name """ + pass + + def __ge__(self, y): # real signature unknown; restored from __doc__ + """ x.__ge__(y) <==> x>=y """ + pass + + def __gt__(self, y): # real signature unknown; restored from __doc__ + """ x.__gt__(y) <==> x>y """ + pass + + def __hash__(self): # real signature unknown; restored from __doc__ + """ x.__hash__() <==> hash(x) """ + pass + + def __init__(self, hour=None, minute=None, second=None, microsecond=None, tzinfo=None): # real signature unknown; restored from __doc__ + pass + + def __le__(self, y): # real signature unknown; restored from __doc__ + """ x.__le__(y) <==> x<=y """ + pass + + def __lt__(self, y): # real signature unknown; restored from __doc__ + """ x.__lt__(y) <==> x a new object with type S, a subtype of T """ + pass + + def __ne__(self, y): # real signature unknown; restored from __doc__ + """ x.__ne__(y) <==> x!=y """ + pass + + def __nonzero__(self): # real signature unknown; restored from __doc__ + """ x.__nonzero__() <==> x != 0 """ + pass + + def __reduce__(self): # real signature unknown; restored from __doc__ + """ __reduce__() -> (cls, state) """ + pass + + def __repr__(self): # real signature unknown; restored from __doc__ + """ x.__repr__() <==> repr(x) """ + pass + + def __str__(self): # real signature unknown; restored from __doc__ + """ x.__str__() <==> str(x) """ + pass + + hour = property(lambda self: 0) + microsecond = property(lambda self: 0) + minute = property(lambda self: 0) + second = property(lambda self: 0) + tzinfo = property(lambda self: object()) # default + + max = None # (!) real value is '' + min = None # (!) real value is '' + resolution = None # (!) real value is '' + + +class timedelta(object): + """ Difference between two datetime values. """ + def total_seconds(self, *args, **kwargs): # real signature unknown + """ Total seconds in the duration. """ + pass + + def __abs__(self): # real signature unknown; restored from __doc__ + """ x.__abs__() <==> abs(x) """ + pass + + def __add__(self, y): # real signature unknown; restored from __doc__ + """ x.__add__(y) <==> x+y """ + pass + + def __div__(self, y): # real signature unknown; restored from __doc__ + """ x.__div__(y) <==> x/y """ + pass + + def __eq__(self, y): # real signature unknown; restored from __doc__ + """ x.__eq__(y) <==> x==y """ + pass + + def __floordiv__(self, y): # real signature unknown; restored from __doc__ + """ x.__floordiv__(y) <==> x//y """ + pass + + def __getattribute__(self, name): # real signature unknown; restored from __doc__ + """ x.__getattribute__('name') <==> x.name """ + pass + + def __ge__(self, y): # real signature unknown; restored from __doc__ + """ x.__ge__(y) <==> x>=y """ + pass + + def __gt__(self, y): # real signature unknown; restored from __doc__ + """ x.__gt__(y) <==> x>y """ + pass + + def __hash__(self): # real signature unknown; restored from __doc__ + """ x.__hash__() <==> hash(x) """ + pass + + def __init__(self, *args, **kwargs): # real signature unknown + pass + + def __le__(self, y): # real signature unknown; restored from __doc__ + """ x.__le__(y) <==> x<=y """ + pass + + def __lt__(self, y): # real signature unknown; restored from __doc__ + """ x.__lt__(y) <==> x x*y """ + pass + + def __neg__(self): # real signature unknown; restored from __doc__ + """ x.__neg__() <==> -x """ + pass + + @staticmethod # known case of __new__ + def __new__(cls, days=None, seconds=None, microseconds=None, milliseconds=None, minutes=None, hours=None, weeks=None): # known case of datetime.timedelta.__new__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + def __ne__(self, y): # real signature unknown; restored from __doc__ + """ x.__ne__(y) <==> x!=y """ + pass + + def __nonzero__(self): # real signature unknown; restored from __doc__ + """ x.__nonzero__() <==> x != 0 """ + pass + + def __pos__(self): # real signature unknown; restored from __doc__ + """ x.__pos__() <==> +x """ + pass + + def __radd__(self, y): # real signature unknown; restored from __doc__ + """ x.__radd__(y) <==> y+x """ + pass + + def __rdiv__(self, y): # real signature unknown; restored from __doc__ + """ x.__rdiv__(y) <==> y/x """ + pass + + def __reduce__(self): # real signature unknown; restored from __doc__ + """ __reduce__() -> (cls, state) """ + pass + + def __repr__(self): # real signature unknown; restored from __doc__ + """ x.__repr__() <==> repr(x) """ + pass + + def __rfloordiv__(self, y): # real signature unknown; restored from __doc__ + """ x.__rfloordiv__(y) <==> y//x """ + pass + + def __rmul__(self, y): # real signature unknown; restored from __doc__ + """ x.__rmul__(y) <==> y*x """ + pass + + def __rsub__(self, y): # real signature unknown; restored from __doc__ + """ x.__rsub__(y) <==> y-x """ + pass + + def __str__(self): # real signature unknown; restored from __doc__ + """ x.__str__() <==> str(x) """ + pass + + def __sub__(self, y): # real signature unknown; restored from __doc__ + """ x.__sub__(y) <==> x-y """ + pass + + days = property(lambda self: 0) + microseconds = property(lambda self: 0) + seconds = property(lambda self: 0) + + max = None # (!) real value is '' + min = None # (!) real value is '' + resolution = None # (!) real value is '' + + +class tzinfo(object): + """ Abstract base class for time zone info objects. """ + def dst(self, date_time): # known case of datetime.tzinfo.dst + """ datetime -> DST offset in minutes east of UTC. """ + return 0 + + def fromutc(self, date_time): # known case of datetime.tzinfo.fromutc + """ datetime in UTC -> datetime in local time. """ + return datetime(1, 1, 1) + + def tzname(self, date_time): # known case of datetime.tzinfo.tzname + """ datetime -> string name of time zone. """ + return "" + + def utcoffset(self, date_time): # known case of datetime.tzinfo.utcoffset + """ datetime -> minutes east of UTC (negative for west of UTC). """ + return 0 + + def __getattribute__(self, name): # real signature unknown; restored from __doc__ + """ x.__getattribute__('name') <==> x.name """ + pass + + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + def __reduce__(self, *args, **kwargs): # real signature unknown + """ -> (cls, state) """ + pass + + +# variables with complex values + +datetime_CAPI = None # (!) real value is '' + diff --git a/python/testData/MockSdk2.7/python_stubs/exceptions.py b/python/testData/MockSdk2.7/python_stubs/exceptions.py new file mode 100644 index 000000000000..9b86536cd704 --- /dev/null +++ b/python/testData/MockSdk2.7/python_stubs/exceptions.py @@ -0,0 +1,670 @@ +# encoding: utf-8 +# module exceptions +# from (built-in) +# by generator 1.124 +""" +Python's standard exception class hierarchy. + +Exceptions found here are defined both in the exceptions module and the +built-in namespace. It is recommended that user-defined exceptions +inherit from Exception. See the documentation for the exception +inheritance hierarchy. +""" +# no imports + +# no functions +# classes + +class BaseException(object): + """ Common base class for all exceptions """ + def __delattr__(self, name): # real signature unknown; restored from __doc__ + """ x.__delattr__('name') <==> del x.name """ + pass + + def __getattribute__(self, name): # real signature unknown; restored from __doc__ + """ x.__getattribute__('name') <==> x.name """ + pass + + def __getitem__(self, y): # real signature unknown; restored from __doc__ + """ x.__getitem__(y) <==> x[y] """ + pass + + def __getslice__(self, i, j): # real signature unknown; restored from __doc__ + """ + x.__getslice__(i, j) <==> x[i:j] + + Use of negative indices is not supported. + """ + pass + + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + def __reduce__(self, *args, **kwargs): # real signature unknown + pass + + def __repr__(self): # real signature unknown; restored from __doc__ + """ x.__repr__() <==> repr(x) """ + pass + + def __setattr__(self, name, value): # real signature unknown; restored from __doc__ + """ x.__setattr__('name', value) <==> x.name = value """ + pass + + def __setstate__(self, *args, **kwargs): # real signature unknown + pass + + def __str__(self): # real signature unknown; restored from __doc__ + """ x.__str__() <==> str(x) """ + pass + + def __unicode__(self): # known case of exceptions.BaseException.__unicode__ + # no doc + return u"" + + args = property(lambda self: tuple()) + message = property(lambda self: '', lambda self, v: None, lambda self: None) + + __dict__ = None # (!) real value is '' + + +class Exception(BaseException): + """ Common base class for all non-exit exceptions. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class StandardError(Exception): + """ + Base class for all standard Python exceptions that do not represent + interpreter exiting. + """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class ArithmeticError(StandardError): + """ Base class for arithmetic errors. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class AssertionError(StandardError): + """ Assertion failed. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class AttributeError(StandardError): + """ Attribute not found. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class BufferError(StandardError): + """ Buffer error. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class Warning(Exception): + """ Base class for warning categories. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class BytesWarning(Warning): + """ + Base class for warnings about bytes and buffer related problems, mostly + related to conversion from str or comparing to str. + """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class DeprecationWarning(Warning): + """ Base class for warnings about deprecated features. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class EnvironmentError(StandardError): + """ Base class for I/O related errors. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + def __reduce__(self, *args, **kwargs): # real signature unknown + pass + + def __str__(self): # real signature unknown; restored from __doc__ + """ x.__str__() <==> str(x) """ + pass + + errno = property(lambda self: 0, lambda self, v: None, lambda self: None) + filename = property(lambda self: '', lambda self, v: None, lambda self: None) + strerror = property(lambda self: 0, lambda self, v: None, lambda self: None) + + +class EOFError(StandardError): + """ Read beyond end of file. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class FloatingPointError(ArithmeticError): + """ Floating point operation failed. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class FutureWarning(Warning): + """ + Base class for warnings about constructs that will change semantically + in the future. + """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class GeneratorExit(BaseException): + """ Request that a generator exit. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class ImportError(StandardError): + """ Import can't find module, or can't find name in module. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class ImportWarning(Warning): + """ Base class for warnings about probable mistakes in module imports """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class SyntaxError(StandardError): + """ Invalid syntax. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + def __str__(self): # real signature unknown; restored from __doc__ + """ x.__str__() <==> str(x) """ + pass + + filename = property(lambda self: '', lambda self, v: None, lambda self: None) + lineno = property(lambda self: 0, lambda self, v: None, lambda self: None) + msg = property(lambda self: '', lambda self, v: None, lambda self: None) + offset = property(lambda self: 0, lambda self, v: None, lambda self: None) + print_file_and_line = property(lambda self: True, lambda self, v: None, lambda self: None) + text = property(lambda self: '', lambda self, v: None, lambda self: None) + + +class IndentationError(SyntaxError): + """ Improper indentation. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class LookupError(StandardError): + """ Base class for lookup errors. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class IndexError(LookupError): + """ Sequence index out of range. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class IOError(EnvironmentError): + """ I/O operation failed. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class KeyboardInterrupt(BaseException): + """ Program interrupted by user. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class KeyError(LookupError): + """ Mapping key not found. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + def __str__(self): # real signature unknown; restored from __doc__ + """ x.__str__() <==> str(x) """ + pass + + +class MemoryError(StandardError): + """ Out of memory. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class NameError(StandardError): + """ Name not found globally. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class RuntimeError(StandardError): + """ Unspecified run-time error. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class NotImplementedError(RuntimeError): + """ Method or function hasn't been implemented yet. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class OSError(EnvironmentError): + """ OS system call failed. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class OverflowError(ArithmeticError): + """ Result too large to be represented. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class PendingDeprecationWarning(Warning): + """ + Base class for warnings about features which will be deprecated + in the future. + """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class ReferenceError(StandardError): + """ Weak ref proxy used after referent went away. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class RuntimeWarning(Warning): + """ Base class for warnings about dubious runtime behavior. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class StopIteration(Exception): + """ Signal the end from iterator.next(). """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class SyntaxWarning(Warning): + """ Base class for warnings about dubious syntax. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class SystemError(StandardError): + """ + Internal error in the Python interpreter. + + Please report this to the Python maintainer, along with the traceback, + the Python version, and the hardware/OS platform and version. + """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class SystemExit(BaseException): + """ Request to exit from the interpreter. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + code = property(lambda self: object(), lambda self, v: None, lambda self: None) + + +class TabError(IndentationError): + """ Improper mixture of spaces and tabs. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class TypeError(StandardError): + """ Inappropriate argument type. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class UnboundLocalError(NameError): + """ Local name referenced but not bound to a value. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class ValueError(StandardError): + """ Inappropriate argument value (of correct type). """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class UnicodeError(ValueError): + """ Unicode related error. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class UnicodeDecodeError(UnicodeError): + """ Unicode decoding error. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + def __str__(self): # real signature unknown; restored from __doc__ + """ x.__str__() <==> str(x) """ + pass + + encoding = property(lambda self: object()) # default + end = property(lambda self: object()) # default + object = property(lambda self: object()) # default + reason = property(lambda self: object()) # default + start = property(lambda self: object()) # default + + +class UnicodeEncodeError(UnicodeError): + """ Unicode encoding error. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + def __str__(self): # real signature unknown; restored from __doc__ + """ x.__str__() <==> str(x) """ + pass + + encoding = property(lambda self: '', lambda self, v: None, lambda self: None) + end = property(lambda self: 0, lambda self, v: None, lambda self: None) + object = property(lambda self: object(), lambda self, v: None, lambda self: None) + reason = property(lambda self: '', lambda self, v: None, lambda self: None) + start = property(lambda self: 0, lambda self, v: None, lambda self: None) + + +class UnicodeTranslateError(UnicodeError): + """ Unicode translation error. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + def __str__(self): # real signature unknown; restored from __doc__ + """ x.__str__() <==> str(x) """ + pass + + encoding = property(lambda self: '', lambda self, v: None, lambda self: None) + end = property(lambda self: 0, lambda self, v: None, lambda self: None) + object = property(lambda self: object(), lambda self, v: None, lambda self: None) + reason = property(lambda self: '', lambda self, v: None, lambda self: None) + start = property(lambda self: 0, lambda self, v: None, lambda self: None) + + +class UnicodeWarning(Warning): + """ + Base class for warnings about Unicode related problems, mostly + related to conversion problems. + """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class UserWarning(Warning): + """ Base class for warnings generated by user code. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + +class ZeroDivisionError(ArithmeticError): + """ Second argument to a division or modulo operation was zero. """ + def __init__(self, *args, **kwargs): # real signature unknown + pass + + @staticmethod # known case of __new__ + def __new__(S, *more): # real signature unknown; restored from __doc__ + """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ + pass + + diff --git a/python/testData/MockSdk2.7/python_stubs/sys.py b/python/testData/MockSdk2.7/python_stubs/sys.py new file mode 100644 index 000000000000..b80979b3a0f3 --- /dev/null +++ b/python/testData/MockSdk2.7/python_stubs/sys.py @@ -0,0 +1,494 @@ +# encoding: utf-8 +# module sys +# from (built-in) +# by generator 1.124 +""" +This module provides access to some objects used or maintained by the +interpreter and to functions that interact strongly with the interpreter. + +Dynamic objects: + +argv -- command line arguments; argv[0] is the script pathname if known +path -- module search path; path[0] is the script directory, else '' +modules -- dictionary of loaded modules + +displayhook -- called to show results in an interactive session +excepthook -- called to handle any uncaught exception other than SystemExit + To customize printing in an interactive session or to install a custom + top-level exception handler, assign other functions to replace these. + +exitfunc -- if sys.exitfunc exists, this routine is called when Python exits + Assigning to sys.exitfunc is deprecated; use the atexit module instead. + +stdin -- standard input file object; used by raw_input() and input() +stdout -- standard output file object; used by the print statement +stderr -- standard error object; used for error messages + By assigning other file objects (or objects that behave like files) + to these, it is possible to redirect all of the interpreter's I/O. + +last_type -- type of last uncaught exception +last_value -- value of last uncaught exception +last_traceback -- traceback of last uncaught exception + These three are only available in an interactive session after a + traceback has been printed. + +exc_type -- type of exception currently being handled +exc_value -- value of exception currently being handled +exc_traceback -- traceback of exception currently being handled + The function exc_info() should be used instead of these three, + because it is thread-safe. + +Static objects: + +float_info -- a dict with information about the float inplementation. +long_info -- a struct sequence with information about the long implementation. +maxint -- the largest supported integer (the smallest is -maxint-1) +maxsize -- the largest supported length of containers. +maxunicode -- the largest supported character +builtin_module_names -- tuple of module names built into this interpreter +version -- the version of this interpreter as a string +version_info -- version information as a named tuple +hexversion -- version information encoded as a single integer +copyright -- copyright notice pertaining to this interpreter +platform -- platform identifier +executable -- pathname of this Python interpreter +prefix -- prefix used to find the Python library +exec_prefix -- prefix used to find the machine-specific Python library +float_repr_style -- string indicating the style of repr() output for floats +__stdin__ -- the original stdin; don't touch! +__stdout__ -- the original stdout; don't touch! +__stderr__ -- the original stderr; don't touch! +__displayhook__ -- the original displayhook; don't touch! +__excepthook__ -- the original excepthook; don't touch! + +Functions: + +displayhook() -- print an object to the screen, and save it in __builtin__._ +excepthook() -- print an exception and its traceback to sys.stderr +exc_info() -- return thread-safe information about the current exception +exc_clear() -- clear the exception state for the current thread +exit() -- exit the interpreter by raising SystemExit +getdlopenflags() -- returns flags to be used for dlopen() calls +getprofile() -- get the global profiling function +getrefcount() -- return the reference count for an object (plus one :-) +getrecursionlimit() -- return the max recursion depth for the interpreter +getsizeof() -- return the size of an object in bytes +gettrace() -- get the global debug tracing function +setcheckinterval() -- control how often the interpreter checks for events +setdlopenflags() -- set the flags to be used for dlopen() calls +setprofile() -- set the global profiling function +setrecursionlimit() -- set the max recursion depth for the interpreter +settrace() -- set the global debug tracing function +""" +# no imports + +# Variables with simple values + +api_version = 1013 + +byteorder = 'little' + +copyright = 'Copyright (c) 2001-2011 Python Software Foundation.\nAll Rights Reserved.\n\nCopyright (c) 2000 BeOpen.com.\nAll Rights Reserved.\n\nCopyright (c) 1995-2001 Corporation for National Research Initiatives.\nAll Rights Reserved.\n\nCopyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.\nAll Rights Reserved.' + +dont_write_bytecode = False + +exc_type = None + +executable = '/usr/bin/python2.7' + +exec_prefix = '/usr' + +float_repr_style = 'short' + +hexversion = 34013936 + +maxint = 9223372036854775807 +maxsize = 9223372036854775807 +maxunicode = 1114111 + +platform = 'linux2' + +prefix = '/usr' + +py3kwarning = False +pydebug = False + +version = '2.7.2+ (default, Jul 20 2012, 22:15:08) \n[GCC 4.6.1]' + +__egginsert = 1 +__plen = 7 + +# functions + +def callstats(): # real signature unknown; restored from __doc__ + """ + callstats() -> tuple of integers + + Return a tuple of function call statistics, if CALL_PROFILE was defined + when Python was built. Otherwise, return None. + + When enabled, this function returns detailed, implementation-specific + details about the number of function calls executed. The return value is + a 11-tuple where the entries in the tuple are counts of: + 0. all function calls + 1. calls to PyFunction_Type objects + 2. PyFunction calls that do not create an argument tuple + 3. PyFunction calls that do not create an argument tuple + and bypass PyEval_EvalCodeEx() + 4. PyMethod calls + 5. PyMethod calls on bound methods + 6. PyType calls + 7. PyCFunction calls + 8. generator calls + 9. All other calls + 10. Number of stack pops performed by call_function() + """ + return () + + +def call_tracing(func, args): # real signature unknown; restored from __doc__ + """ + call_tracing(func, args) -> object + + Call func(*args), while tracing is enabled. The tracing state is + saved, and restored afterwards. This is intended to be called from + a debugger from a checkpoint, to recursively debug some other code. + """ + return object() + + +def displayhook(p_object): # real signature unknown; restored from __doc__ + """ + displayhook(object) -> None + + Print an object to sys.stdout and also save it in __builtin__._ + """ + pass + + +def excepthook(exc_type, exc_obj, exc_tb): # reliably restored by inspect + """ Catch an uncaught exception and make a traceback. """ + pass + + +def exc_clear(): # real signature unknown; restored from __doc__ + """ + exc_clear() -> None + + Clear global information on the current exception. Subsequent calls to + exc_info() will return (None,None,None) until another exception is raised + in the current thread or the execution stack returns to a frame where + another exception is being handled. + """ + pass + + +def exc_info(): # real signature unknown; restored from __doc__ + """ + exc_info() -> (type, value, traceback) + + Return information about the most recent exception caught by an except + clause in the current stack frame or in an older stack frame. + """ + pass + + +def exit(status=None): # real signature unknown; restored from __doc__ + """ + exit([status]) + + Exit the interpreter by raising SystemExit(status). + If the status is omitted or None, it defaults to zero (i.e., success). + If the status is numeric, it will be used as the system exit status. + If it is another kind of object, it will be printed and the system + exit status will be one (i.e., failure). + """ + pass + + +def exitfunc(): # reliably restored by inspect + """ + run any registered exit functions + + _exithandlers is traversed in reverse order so functions are executed + last in, first out. + """ + pass + + +def getcheckinterval(): # real signature unknown; restored from __doc__ + """ getcheckinterval() -> current check interval; see setcheckinterval(). """ + pass + + +def getdefaultencoding(): # real signature unknown; restored from __doc__ + """ + getdefaultencoding() -> string + + Return the current default string encoding used by the Unicode + implementation. + """ + return "" + + +def getdlopenflags(): # real signature unknown; restored from __doc__ + """ + getdlopenflags() -> int + + Return the current value of the flags that are used for dlopen calls. + The flag constants are defined in the ctypes and DLFCN modules. + """ + return 0 + + +def getfilesystemencoding(): # real signature unknown; restored from __doc__ + """ + getfilesystemencoding() -> string + + Return the encoding used to convert Unicode filenames in + operating system filenames. + """ + return "" + + +def getprofile(): # real signature unknown; restored from __doc__ + """ + getprofile() + + Return the profiling function set with sys.setprofile. + See the profiler chapter in the library manual. + """ + pass + + +def getrecursionlimit(): # real signature unknown; restored from __doc__ + """ + getrecursionlimit() + + Return the current value of the recursion limit, the maximum depth + of the Python interpreter stack. This limit prevents infinite + recursion from causing an overflow of the C stack and crashing Python. + """ + pass + + +def getrefcount(p_object): # real signature unknown; restored from __doc__ + """ + getrefcount(object) -> integer + + Return the reference count of object. The count returned is generally + one higher than you might expect, because it includes the (temporary) + reference as an argument to getrefcount(). + """ + return 0 + + +def getsizeof(p_object, default): # real signature unknown; restored from __doc__ + """ + getsizeof(object, default) -> int + + Return the size of object in bytes. + """ + return 0 + + +def gettrace(): # real signature unknown; restored from __doc__ + """ + gettrace() + + Return the global debug tracing function set with sys.settrace. + See the debugger chapter in the library manual. + """ + pass + + +def setcheckinterval(n): # real signature unknown; restored from __doc__ + """ + setcheckinterval(n) + + Tell the Python interpreter to check for asynchronous events every + n instructions. This also affects how often thread switches occur. + """ + pass + + +def setdlopenflags(n): # real signature unknown; restored from __doc__ + """ + setdlopenflags(n) -> None + + Set the flags used by the interpreter for dlopen calls, such as when the + interpreter loads extension modules. Among other things, this will enable + a lazy resolving of symbols when importing a module, if called as + sys.setdlopenflags(0). To share symbols across extension modules, call as + sys.setdlopenflags(ctypes.RTLD_GLOBAL). Symbolic names for the flag modules + can be either found in the ctypes module, or in the DLFCN module. If DLFCN + is not available, it can be generated from /usr/include/dlfcn.h using the + h2py script. + """ + pass + + +def setprofile(function): # real signature unknown; restored from __doc__ + """ + setprofile(function) + + Set the profiling function. It will be called on each function call + and return. See the profiler chapter in the library manual. + """ + pass + + +def setrecursionlimit(n): # real signature unknown; restored from __doc__ + """ + setrecursionlimit(n) + + Set the maximum depth of the Python interpreter stack to n. This + limit prevents infinite recursion from causing an overflow of the C + stack and crashing Python. The highest possible limit is platform- + dependent. + """ + pass + + +def settrace(function): # real signature unknown; restored from __doc__ + """ + settrace(function) + + Set the global debug tracing function. It will be called on each + function call. See the debugger chapter in the library manual. + """ + pass + + +def _clear_type_cache(): # real signature unknown; restored from __doc__ + """ + _clear_type_cache() -> None + Clear the internal type lookup cache. + """ + pass + + +def _current_frames(): # real signature unknown; restored from __doc__ + """ + _current_frames() -> dictionary + + Return a dictionary mapping each current thread T's thread id to T's + current stack frame. + + This function should be used for specialized purposes only. + """ + return {} + + +def _getframe(depth=None): # real signature unknown; restored from __doc__ + """ + _getframe([depth]) -> frameobject + + Return a frame object from the call stack. If optional integer depth is + given, return the frame object that many calls below the top of the stack. + If that is deeper than the call stack, ValueError is raised. The default + for depth is zero, returning the frame at the top of the call stack. + + This function should be used for internal and specialized + purposes only. + """ + pass + + +def __displayhook__(*args, **kwargs): # real signature unknown + """ + displayhook(object) -> None + + Print an object to sys.stdout and also save it in __builtin__._ + """ + pass + + +def __excepthook__(*args, **kwargs): # real signature unknown + """ + excepthook(exctype, value, traceback) -> None + + Handle an exception by displaying it with a traceback on sys.stderr. + """ + pass + + +# no classes +# variables with complex values + +argv = [] # real value of type skipped + +builtin_module_names = () # real value of type skipped + +flags = None # (!) real value is '' + +float_info = None # (!) real value is '' + +long_info = None # (!) real value is '' + +meta_path = [] + +modules = {} # real value of type skipped + +path = [ + '/home/user/src/idea/out/classes/production/python-helpers', + '/usr/local/lib/python2.7/dist-packages/distribute-0.6.27-py2.7.egg', + '/usr/lib/python2.7', + '/usr/lib/python2.7/plat-linux2', + '/usr/lib/python2.7/lib-tk', + '/usr/lib/python2.7/lib-old', + '/usr/lib/python2.7/lib-dynload', + '/home/user/.local/lib/python2.7/site-packages', + '/usr/local/lib/python2.7/dist-packages', + '/usr/local/lib/python2.7/dist-packages/setuptools-0.6c11-py2.7.egg-info', + '/usr/lib/python2.7/dist-packages', + '/usr/lib/python2.7/dist-packages/PIL', + '/usr/lib/python2.7/dist-packages/gst-0.10', + '/usr/lib/python2.7/dist-packages/gtk-2.0', + '/usr/lib/pymodules/python2.7', + '/usr/lib/python2.7/dist-packages/ubuntu-sso-client', + '/usr/lib/python2.7/dist-packages/ubuntuone-client', + '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel', + '/usr/lib/python2.7/dist-packages/ubuntuone-couch', + '/usr/lib/python2.7/dist-packages/ubuntuone-installer', + '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol', + '/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode', +] + +path_hooks = [ + None, # (!) real value is '' +] + +path_importer_cache = {} # real value of type skipped + +stderr = open('') # real value of type replaced + +stdin = open('') # real value of type replaced + +stdout = open('') # real value of type replaced + +subversion = ( + 'CPython', + '', + '', +) + +version_info = None # (!) real value is '' + +warnoptions = [] + +_mercurial = ( + 'CPython', + '', + '', +) + +__stderr__ = None # (!) real value is '' + +__stdin__ = None # (!) real value is '' + +__stdout__ = stdout + +# intermittent names +exc_value = Exception() +exc_traceback=None diff --git a/python/testData/override/qualified.py b/python/testData/override/qualified.py index 571f9fc91ca5..76e56f75c956 100644 --- a/python/testData/override/qualified.py +++ b/python/testData/override/qualified.py @@ -1,4 +1,4 @@ import datetime -class MyDate(datetime.tmxxx): +class MyDate(datetime.date): pass \ No newline at end of file diff --git a/python/testData/override/qualified_after.py b/python/testData/override/qualified_after.py index 08194c55c2ea..bddb093e720e 100644 --- a/python/testData/override/qualified_after.py +++ b/python/testData/override/qualified_after.py @@ -1,6 +1,6 @@ import datetime -class MyDate(datetime.tmxxx): - def __init__(self, year, month, day, hour=0, minute=0, second=0, microsecond=0): - datetime.tmxxx.__init__(self, year, month, day, hour, minute, second, microsecond) +class MyDate(datetime.date): + def __init__(self, year, month, day): + super(MyDate, self).__init__(year, month, day) diff --git a/python/testData/stubs/ImportInExcept.py b/python/testData/stubs/ImportInExcept.py index d3f328f51c55..18033763c144 100644 --- a/python/testData/stubs/ImportInExcept.py +++ b/python/testData/stubs/ImportInExcept.py @@ -9,4 +9,4 @@ except ImportError: from unittest import * else: # otherwise use our bundled version - from datetime import tmxxx + from datetime import tzinfo diff --git a/python/testSrc/com/jetbrains/python/PyIntentionTest.java b/python/testSrc/com/jetbrains/python/PyIntentionTest.java index 13ecb4392e5d..9884a7bc581c 100644 --- a/python/testSrc/com/jetbrains/python/PyIntentionTest.java +++ b/python/testSrc/com/jetbrains/python/PyIntentionTest.java @@ -110,19 +110,24 @@ public class PyIntentionTest extends PyTestCase { } public void testStringConcatToFormat() { - doTest(PyBundle.message("INTN.replace.plus.with.format.operator")); + doTest(PyBundle.message("INTN.replace.plus.with.format.operator"), LanguageLevel.PYTHON25); } public void testStringConcatToFormat1() { //PY-5226 - doTest(PyBundle.message("INTN.replace.plus.with.format.operator")); + doTest(PyBundle.message("INTN.replace.plus.with.format.operator"), LanguageLevel.PYTHON25); } public void testStringConcatToFormat2() { //PY-6505 - doNegativeTest(PyBundle.message("INTN.replace.plus.with.format.operator")); + runWithLanguageLevel(LanguageLevel.PYTHON25, new Runnable() { + @Override + public void run() { + doNegativeTest(PyBundle.message("INTN.replace.plus.with.format.operator")); + } + }); } public void testStringConcatToFormat3() { //PY-6505 - doTest(PyBundle.message("INTN.replace.plus.with.format.operator")); + doTest(PyBundle.message("INTN.replace.plus.with.format.operator"), LanguageLevel.PYTHON25); } public void testStringConcatToFormat4() { //PY-7969 @@ -350,7 +355,7 @@ public class PyIntentionTest extends PyTestCase { } public void testUnicodeStringConcatToFormat() { //PY-7463 - doTest(PyBundle.message("INTN.replace.plus.with.format.operator")); + doTest(PyBundle.message("INTN.replace.plus.with.format.operator"), LanguageLevel.PYTHON25); } // PY-8366 @@ -360,7 +365,7 @@ public class PyIntentionTest extends PyTestCase { // PY-8588 public void testStringConcatToFormatEscaping() { - doTest(PyBundle.message("INTN.replace.plus.with.format.operator")); + doTest(PyBundle.message("INTN.replace.plus.with.format.operator"), LanguageLevel.PYTHON25); } private void doDocStubTest(LanguageLevel languageLevel) { diff --git a/python/testSrc/com/jetbrains/python/PyOverrideTest.java b/python/testSrc/com/jetbrains/python/PyOverrideTest.java index b6d581125685..2039877a1ecc 100644 --- a/python/testSrc/com/jetbrains/python/PyOverrideTest.java +++ b/python/testSrc/com/jetbrains/python/PyOverrideTest.java @@ -65,7 +65,7 @@ public class PyOverrideTest extends PyTestCase { public void testQualified() { // PY-2171 myFixture.configureByFile("override/" + getTestName(true) + ".py"); - PyClass dateClass = PyClassNameIndex.findClass("datetime.tmxxx", myFixture.getProject()); + PyClass dateClass = PyClassNameIndex.findClass("datetime.date", myFixture.getProject()); assertNotNull(dateClass); PyFunction initMethod = dateClass.findMethodByName(PyNames.INIT, false); assertNotNull(initMethod); diff --git a/python/testSrc/com/jetbrains/python/PyStubsTest.java b/python/testSrc/com/jetbrains/python/PyStubsTest.java index 3262bb3b1a47..850d4ffbbf60 100644 --- a/python/testSrc/com/jetbrains/python/PyStubsTest.java +++ b/python/testSrc/com/jetbrains/python/PyStubsTest.java @@ -309,7 +309,7 @@ public class PyStubsTest extends PyTestCase { public void testImportInExcept() { final PyFileImpl file = (PyFileImpl) getTestFile(); - final PsiElement element = file.getElementNamed("tmxxx"); + final PsiElement element = file.getElementNamed("tzinfo"); assertTrue(element != null ? element.toString() : "null", element instanceof PyClass); assertNotParsed(file); } diff --git a/python/testSrc/com/jetbrains/python/fixtures/PyTestCase.java b/python/testSrc/com/jetbrains/python/fixtures/PyTestCase.java index ff7cd2204ad0..a09f7b0893b2 100644 --- a/python/testSrc/com/jetbrains/python/fixtures/PyTestCase.java +++ b/python/testSrc/com/jetbrains/python/fixtures/PyTestCase.java @@ -36,7 +36,7 @@ import org.jetbrains.annotations.Nullable; */ @TestDataPath("$CONTENT_ROOT/../testData/") public abstract class PyTestCase extends UsefulTestCase { - private static final PyLightProjectDescriptor ourPyDescriptor = new PyLightProjectDescriptor("2.5"); + private static final PyLightProjectDescriptor ourPyDescriptor = new PyLightProjectDescriptor("2.7"); protected static final PyLightProjectDescriptor ourPy3Descriptor = new PyLightProjectDescriptor("3.2"); private static final String PARSED_ERROR_MSG = "Operations should have been performed on stubs but caused file to be parsed";