mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Added snapshot of python-skeletons @ 031d9cc
This commit is contained in:
@@ -4,6 +4,5 @@
|
||||
.idea/workspace.xml
|
||||
/out
|
||||
.DS_Store
|
||||
/python/helpers/python-skeletons
|
||||
/test-system
|
||||
/test-config
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
The current maintainer:
|
||||
|
||||
* Andrey Vlasovskikh <andrey.vlasovskikh@jetbrains.com>
|
||||
|
||||
Contributors:
|
||||
|
||||
TODO: The list of contributors
|
||||
@@ -0,0 +1,13 @@
|
||||
Copyright 2013 The python-skeletons authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
@@ -0,0 +1,237 @@
|
||||
Python Skeletons
|
||||
================
|
||||
|
||||
_This proposal is a draft._
|
||||
|
||||
Python skeletons are Python files that contain API definitions of existing
|
||||
libraries extended for static analysis tools.
|
||||
|
||||
Rationale
|
||||
---------
|
||||
|
||||
Python is a dynamic language less suitable for static code analysis than static
|
||||
languages like C or Java. Although Python static analysis tools can extract
|
||||
some information from Python source code without executing it, this information
|
||||
is often very shallow and incomplete.
|
||||
|
||||
Dynamic features of Python are very useful for user code. But using these
|
||||
features in APIs of third-party libraries and the standard library is not
|
||||
always a good idea. Tools (and users, in fact) need clear definitions of APIs.
|
||||
Often library API definitions are quite static and easy to grasp (defined
|
||||
using `class`, `def`), but types of function parameters and return values
|
||||
usually are not specified. Sometimes API definitions involve metaprogramming.
|
||||
|
||||
As there is not enough information in API definition code of libraries,
|
||||
developers of static analysis tools collect extended API data themselves and
|
||||
store it in their own formats. For example, PyLint uses imperative AST
|
||||
transformations of API modules in order to extend them with hard-coded data.
|
||||
PyCharm extends APIs via its proprietary database of declarative type
|
||||
annotations. The absence of a common extended API information format makes it
|
||||
hard for developers and users of tools to collect and share data.
|
||||
|
||||
|
||||
Proposal
|
||||
--------
|
||||
|
||||
The proposal is to create a common database of extended API definitions as a
|
||||
collection of Python files called skeletons. Static analysis tools already
|
||||
understand Python code, so it should be easy to start extracting API
|
||||
definitions from these Python skeleton files. Regular function and class
|
||||
definitions can be extended with additional docstrings and decorators, e.g. for
|
||||
providing types of function parameters and return values. Static analysis tools
|
||||
may use a subset of information contained in skeleton files needed for their
|
||||
operation. Using Python files instead of a custom API definition format will
|
||||
also make it easier for users to populate the skeletons database.
|
||||
|
||||
Declarative Python API definitions for static analysis tools cannot cover all
|
||||
dynamic tricks used in real APIs of libraries: some of them still require
|
||||
library-specific code analysis. Nevertheless the skeletons database is enough
|
||||
for many libraries.
|
||||
|
||||
The proposed [python-skeletons](https://github.com/JetBrains/python-skeletons)
|
||||
repository is hosted on GitHub.
|
||||
|
||||
|
||||
Conventions
|
||||
-----------
|
||||
|
||||
Skeletons should contain syntactically correct Python code, preferably compatible
|
||||
with Python 2.6-3.3.
|
||||
|
||||
Skeletons should respect [PEP-8](http://www.python.org/dev/peps/pep-0008/) and
|
||||
[PEP-257](http://www.python.org/dev/peps/pep-0257/) style guides.
|
||||
|
||||
If you need to reference the members of the original module of a skeleton, you
|
||||
should import it explicitly. For example, in a skeleton for the `foo` module:
|
||||
|
||||
import foo
|
||||
|
||||
|
||||
class C(foo.B):
|
||||
def bar():
|
||||
"""Do bar and return Bar.
|
||||
|
||||
:rtype: foo.Bar
|
||||
"""
|
||||
return foo.Bar()
|
||||
|
||||
Modules can be referenced in docstring without explicit imports.
|
||||
|
||||
The body of a function in a skeleton file should consist of a single `return`
|
||||
statement that returns a simple value of the declared return type (e.g. `0`
|
||||
for `int`, `False` for `bool`, `Foo()` for `Foo`). If the function returns
|
||||
something non-trivial, its may consist of a `pass` statement.
|
||||
|
||||
|
||||
### Types
|
||||
|
||||
There is no standard notation for specifying types in Python code. We would
|
||||
like this standard to emerge, see the related work below.
|
||||
|
||||
The current understanding is that a standard for optional type annotations in
|
||||
Python could use the syntax of function annotations in Python 3 and decorators
|
||||
as a fallback in Python 2. The type system should be relatively simple, but it
|
||||
has to include parametric (generic) types for collections and probably more.
|
||||
|
||||
As a temporary solution, we propose a simple way of specifying types in
|
||||
skeletons using Sphinx docstrings using the following notation:
|
||||
|
||||
Foo # Class Foo visible in the current scope
|
||||
x.y.Bar # Class Bar from x.y module
|
||||
Foo | Bar # Foo or Bar
|
||||
(Foo, Bar) # Tuple of Foo and Bar
|
||||
list[Foo] # List of Foo elements
|
||||
dict[Foo, Bar] # Dict from Foo to Bar
|
||||
T # Generic type (T-Z are reserved for generics)
|
||||
T <= Foo # Generic type with upper bound Foo
|
||||
Foo[T] # Foo parameterized with T
|
||||
(Foo, Bar) -> Baz # Function of Foo and Bar that returns Baz
|
||||
|
||||
There are several shortcuts available:
|
||||
|
||||
unknown # Unknown type
|
||||
None # type(None)
|
||||
string # Py2: str | unicode, Py3: str
|
||||
bytestring # Py2: str | unicode, Py3: bytes
|
||||
bytes # Py2: str, Py3: bytes
|
||||
unicode # Py2: unicode, Py3: str
|
||||
|
||||
The syntax is a subject to change. It is almost compatible to Python (except
|
||||
function types), but its semantics differs from Python (no `|`, no implicitly
|
||||
visible names, no generic types). So you cannot use these expressions in
|
||||
Python 3 function annotations.
|
||||
|
||||
If you want to create a parameterized class, you should define its parameters
|
||||
in the mock return type of a constructor:
|
||||
|
||||
class C(object):
|
||||
"""Some collection C that can contain values of T."""
|
||||
|
||||
def __init__(self, value):
|
||||
"""Initialize C.
|
||||
|
||||
:type value: T
|
||||
:rtype: C[T]
|
||||
"""
|
||||
pass
|
||||
|
||||
def get(self):
|
||||
"""Return the contained value.
|
||||
|
||||
:rtype: T
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
### Versioning
|
||||
|
||||
The recommended way of checking the version of Python is:
|
||||
|
||||
import sys
|
||||
|
||||
|
||||
if sys.version_info >= (2, 7) and sys.version_info < (3,):
|
||||
def from_27_until_30():
|
||||
pass
|
||||
|
||||
A skeleton should document the most recently released version of a library. Use
|
||||
deprecation warnings for functions that have been removed from the API.
|
||||
|
||||
Skeletons for built-in symbols is an exception. There are two modules:
|
||||
`__builtin__` for Python 2 and `builtins` for Python 3.
|
||||
|
||||
|
||||
Related Work
|
||||
------------
|
||||
|
||||
The JavaScript community is also interested in formalizing API definitions and
|
||||
specifying types. They have come up with several JavaScript dialects that
|
||||
support optional types: TypeScript, Dart. There is a JavaScript initiative
|
||||
similar to the proposed Python skeletons called
|
||||
[DefinitelyTyped](https://github.com/borisyankov/DefinitelyTyped). The idea is
|
||||
to use TypeScript API stubs for various JavaScript libraries.
|
||||
|
||||
There are many approaches to specifying types in Python, none of them is widely
|
||||
adopted at the moment:
|
||||
|
||||
* A series of old (2005) posts by GvR:
|
||||
[1](http://www.artima.com/weblogs/viewpost.jsp?thread=85551),
|
||||
[2](http://www.artima.com/weblogs/viewpost.jsp?thread=86641),
|
||||
[3](http://www.artima.com/weblogs/viewpost.jsp?thread=87182)
|
||||
* String-based [python-rightarrow](https://github.com/kennknowles/python-rightarrow)
|
||||
library
|
||||
* Expression-based [typeannotations](https://github.com/ceronman/typeannotations)
|
||||
library for Python 3
|
||||
* [mypy](http://www.mypy-lang.org/) Python dialect
|
||||
* [pytypes](https://github.com/pytypes/pytypes): Optional typing for Python proposal
|
||||
* [Proposal: Use mypy syntax for function annotations](https://mail.python.org/pipermail/python-ideas/2014-August/028618.html) by GvR
|
||||
|
||||
See also the notes on function annotations in
|
||||
[PEP-8](http://www.python.org/dev/peps/pep-0008/).
|
||||
|
||||
|
||||
PyCharm / IntelliJ
|
||||
------------------
|
||||
|
||||
PyCharm 3 and the Python plugin 3.x for IntelliJ can extract the following
|
||||
information from the skeletons:
|
||||
|
||||
* Parameters of functions and methods
|
||||
* Return types and parameter types of functions and methods
|
||||
* Types of assignment targets
|
||||
* Extra module members
|
||||
* Extra class members
|
||||
* TODO
|
||||
|
||||
PyCharm 3 comes with a snapshot of the Python skeletons repository (Python
|
||||
plugin 3.0.1 for IntelliJ still doesn't include this repository). You
|
||||
**should not** modify it, because it will be updated with the PyCharm / Python
|
||||
plugin for IntelliJ installation. If you want to change the skeletons, clone
|
||||
the skeletons GitHub repository into your PyCharm/IntelliJ config directory:
|
||||
|
||||
cd <config directory>
|
||||
git clone https://github.com/JetBrains/python-skeletons.git
|
||||
|
||||
where `<config directory>` is:
|
||||
|
||||
* PyCharm
|
||||
* Mac OS X: `~/Library/Preferences/PyCharmXX`
|
||||
* Linux: `~/.PyCharmXX/config`
|
||||
* Windows: `<User home>\.PyCharmXX\config`
|
||||
* IntelliJ
|
||||
* Mac OS X: `~/Library/Preferences/IntelliJIdeaXX`
|
||||
* Linux: `~/.IntelliJIdeaXX/config`
|
||||
* Windows: `<User home>\.IntelliJIdeaXX\config`
|
||||
|
||||
Please send your PyCharm/IntelliJ-related bug reports and feature requests to
|
||||
[PyCharm issue tracker](http://youtrack.jetbrains.com/issues/PY).
|
||||
|
||||
|
||||
Feedback
|
||||
--------
|
||||
|
||||
If you want to contribute, send your pull requests to the Python skeletons
|
||||
repository on GitHub. Please make sure, that you follow the conventions above.
|
||||
|
||||
Use [code-quality](http://mail.python.org/mailman/listinfo/code-quality)
|
||||
mailing list to discuss Python skeletons.
|
||||
@@ -0,0 +1,126 @@
|
||||
"""Skeleton for 'StringIO' stdlib module."""
|
||||
|
||||
|
||||
import StringIO as _StringIO
|
||||
|
||||
|
||||
class StringIO(object):
|
||||
"""Reads and writes a string buffer (also known as memory files)."""
|
||||
|
||||
def __init__(self, buffer=None):
|
||||
"""When a StringIO object is created, it can be initialized to an existing
|
||||
string by passing the string to the constructor.
|
||||
|
||||
:type buffer: T <= bytes | unicode
|
||||
:rtype: _StringIO.StringIO[T]
|
||||
"""
|
||||
self.closed = False
|
||||
|
||||
def getvalue(self):
|
||||
"""Retrieve the entire contents of the "file" at any time before the
|
||||
StringIO object's close() method is called.
|
||||
|
||||
:rtype: T
|
||||
"""
|
||||
pass
|
||||
|
||||
def close(self):
|
||||
"""Free the memory buffer.
|
||||
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def flush(self):
|
||||
"""Flush the internal buffer.
|
||||
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def isatty(self):
|
||||
"""Return True if the file is connected to a tty(-like) device,
|
||||
else False.
|
||||
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
def __iter__(self):
|
||||
"""Return an iterator over lines.
|
||||
|
||||
:rtype: _StringIO.StringIO[T]
|
||||
"""
|
||||
return self
|
||||
|
||||
def next(self):
|
||||
"""Returns the next input line.
|
||||
|
||||
:rtype: T
|
||||
"""
|
||||
pass
|
||||
|
||||
def read(self, size=-1):
|
||||
"""Read at most size bytes or characters from the buffer.
|
||||
|
||||
:type size: numbers.Integral
|
||||
:rtype: T
|
||||
"""
|
||||
pass
|
||||
|
||||
def readline(self, size=-1):
|
||||
"""Read one entire line from the buffer.
|
||||
|
||||
:type size: numbers.Integral
|
||||
:rtype: T
|
||||
"""
|
||||
pass
|
||||
|
||||
def readlines(self, sizehint=-1):
|
||||
"""Read until EOF using readline() and return a list containing the
|
||||
lines thus read.
|
||||
|
||||
:type sizehint: numbers.Integral
|
||||
:rtype: list[T]
|
||||
"""
|
||||
pass
|
||||
|
||||
def seek(self, offset, whence=0):
|
||||
"""Set the buffer's current position, like stdio's fseek().
|
||||
|
||||
:type offset: numbers.Integral
|
||||
:type whence: numbers.Integral
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def tell(self):
|
||||
"""Return the buffer's current position, like stdio's ftell().
|
||||
|
||||
:rtype: int
|
||||
"""
|
||||
pass
|
||||
|
||||
def truncate(self, size=-1):
|
||||
"""Truncate the buffer's size.
|
||||
|
||||
:type size: numbers.Integral
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def write(self, str):
|
||||
""""Write bytes or a string to the buffer.
|
||||
|
||||
:type str: T
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def writelines(self, sequence):
|
||||
"""Write a sequence of bytes or strings to the buffer.
|
||||
|
||||
:type sequence: collections.Iterable[T]
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,12 @@
|
||||
"""Skeleton for 'asyncio' stdlib module."""
|
||||
|
||||
|
||||
import asyncio
|
||||
|
||||
|
||||
def get_event_loop():
|
||||
"""Get the event loop for the current context.
|
||||
|
||||
:rtype: asyncio.AbstractEventLoop
|
||||
"""
|
||||
pass
|
||||
@@ -0,0 +1,60 @@
|
||||
# coding=utf-8
|
||||
"""
|
||||
Python Behave skeletons (https://pythonhosted.org/behave/)
|
||||
"""
|
||||
|
||||
|
||||
def given(pattern):
|
||||
"""Decorates a function, so that it will become a new step
|
||||
definition.
|
||||
:param pattern pattern to match, may be regular expression or something else depends on step matcher
|
||||
"""
|
||||
pass
|
||||
|
||||
def when(pattern):
|
||||
"""Decorates a function, so that it will become a new step
|
||||
definition.
|
||||
:param pattern pattern to match, may be regular expression or something else depends on step matcher
|
||||
"""
|
||||
pass
|
||||
|
||||
def then(pattern):
|
||||
"""Decorates a function, so that it will become a new step
|
||||
definition.
|
||||
:param pattern pattern to match, may be regular expression or something else depends on step matcher
|
||||
"""
|
||||
pass
|
||||
|
||||
def step(pattern):
|
||||
"""Decorates a function, so that it will become a new step
|
||||
definition.
|
||||
:param pattern pattern to match, may be regular expression or something else depends on step matcher
|
||||
"""
|
||||
pass
|
||||
def Given(pattern):
|
||||
"""Decorates a function, so that it will become a new step
|
||||
definition.
|
||||
:param pattern pattern to match, may be regular expression or something else depends on step matcher
|
||||
"""
|
||||
pass
|
||||
|
||||
def When(pattern):
|
||||
"""Decorates a function, so that it will become a new step
|
||||
definition.
|
||||
:param pattern pattern to match, may be regular expression or something else depends on step matcher
|
||||
"""
|
||||
pass
|
||||
|
||||
def Then(pattern):
|
||||
"""Decorates a function, so that it will become a new step
|
||||
definition.
|
||||
:param pattern pattern to match, may be regular expression or something else depends on step matcher
|
||||
"""
|
||||
pass
|
||||
|
||||
def Step(pattern):
|
||||
"""Decorates a function, so that it will become a new step
|
||||
definition.
|
||||
:param pattern pattern to match, may be regular expression or something else depends on step matcher
|
||||
"""
|
||||
pass
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,131 @@
|
||||
"""Skeleton for 'cStringIO' stdlib module."""
|
||||
|
||||
|
||||
import cStringIO
|
||||
|
||||
|
||||
def StringIO(s=None):
|
||||
"""Return a StringIO-like stream for reading or writing.
|
||||
|
||||
:type s: T <= bytes | unicode
|
||||
:rtype: cStringIO.OutputType[T]
|
||||
"""
|
||||
return cStringIO.OutputType(s)
|
||||
|
||||
|
||||
class OutputType(object):
|
||||
def __init__(self, s):
|
||||
"""Create an OutputType object.
|
||||
|
||||
:rtype: cStringIO.OutputType[T <= bytes | unicode]
|
||||
"""
|
||||
pass
|
||||
|
||||
def getvalue(self):
|
||||
"""Retrieve the entire contents of the "file" at any time before the
|
||||
StringIO object's close() method is called.
|
||||
|
||||
:rtype: T
|
||||
"""
|
||||
pass
|
||||
|
||||
def close(self):
|
||||
"""Free the memory buffer.
|
||||
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def flush(self):
|
||||
"""Flush the internal buffer.
|
||||
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def isatty(self):
|
||||
"""Return True if the file is connected to a tty(-like) device,
|
||||
else False.
|
||||
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
def __iter__(self):
|
||||
"""Return an iterator over lines.
|
||||
|
||||
:rtype: cStringIO.OutputType[T]
|
||||
"""
|
||||
return self
|
||||
|
||||
def next(self):
|
||||
"""Returns the next input line.
|
||||
|
||||
:rtype: T
|
||||
"""
|
||||
pass
|
||||
|
||||
def read(self, size=-1):
|
||||
"""Read at most size bytes or characters from the buffer.
|
||||
|
||||
:type size: numbers.Integral
|
||||
:rtype: T
|
||||
"""
|
||||
pass
|
||||
|
||||
def readline(self, size=-1):
|
||||
"""Read one entire line from the buffer.
|
||||
|
||||
:type size: numbers.Integral
|
||||
:rtype: T
|
||||
"""
|
||||
pass
|
||||
|
||||
def readlines(self, sizehint=-1):
|
||||
"""Read until EOF using readline() and return a list containing the
|
||||
lines thus read.
|
||||
|
||||
:type sizehint: numbers.Integral
|
||||
:rtype: list[T]
|
||||
"""
|
||||
return []
|
||||
|
||||
def seek(self, offset, whence=0):
|
||||
"""Set the buffer's current position, like stdio's fseek().
|
||||
|
||||
:type offset: numbers.Integral
|
||||
:type whence: numbers.Integral
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def tell(self):
|
||||
"""Return the buffer's current position, like stdio's ftell().
|
||||
|
||||
:rtype: int
|
||||
"""
|
||||
return 0
|
||||
|
||||
def truncate(self, size=-1):
|
||||
"""Truncate the buffer's size.
|
||||
|
||||
:type size: numbers.Integral
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def write(self, str):
|
||||
""""Write bytes or a string to the buffer.
|
||||
|
||||
:type str: T
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def writelines(self, sequence):
|
||||
"""Write a sequence of bytes or strings to the buffer.
|
||||
|
||||
:type sequence: collections.Iterable[T]
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
@@ -0,0 +1,26 @@
|
||||
"""Skeleton for 'collections' stdlib module."""
|
||||
|
||||
|
||||
import sys
|
||||
import collections
|
||||
|
||||
|
||||
class Iterator(collections.Iterable):
|
||||
def __init__(self):
|
||||
"""
|
||||
:rtype: collections.Iterator[T]
|
||||
"""
|
||||
pass
|
||||
|
||||
if sys.version_info >= (3, 0):
|
||||
def __next__(self):
|
||||
"""
|
||||
:rtype: T
|
||||
"""
|
||||
pass
|
||||
|
||||
def next(self):
|
||||
"""
|
||||
:rtype: T
|
||||
"""
|
||||
pass
|
||||
@@ -0,0 +1,625 @@
|
||||
"""Skeleton for 'datetime' stdlib module."""
|
||||
|
||||
|
||||
import sys
|
||||
import datetime as _datetime
|
||||
from time import struct_time
|
||||
|
||||
|
||||
class timedelta(object):
|
||||
"""A timedelta object represents a duration, the difference between two
|
||||
dates or times."""
|
||||
|
||||
def __init__(self, days=0, seconds=0, microseconds=0, milliseconds=0,
|
||||
minutes=0, hours=0, weeks=0):
|
||||
"""Create a timedelta object.
|
||||
|
||||
:type days: numbers.Real
|
||||
:type seconds: numbers.Real
|
||||
:type microseconds: numbers.Real
|
||||
:type milliseconds: numbers.Real
|
||||
:type minutes: numbers.Real
|
||||
:type hours: numbers.Real
|
||||
:type weeks: numbers.Real
|
||||
"""
|
||||
self.days = 0
|
||||
self.seconds = 0
|
||||
self.microseconds = 0
|
||||
|
||||
def __add__(self, other):
|
||||
"""Add timedelta, date or datetime.
|
||||
|
||||
:type other: T <= _datetime.timedelta | _datetime.date | _datetime.datetime
|
||||
:rtype: T
|
||||
"""
|
||||
pass
|
||||
|
||||
def __radd__(self, other):
|
||||
"""Add timedelta, date or datetime.
|
||||
|
||||
:type other: T <= _datetime.timedelta | _datetime.date | _datetime.datetime
|
||||
:rtype: T
|
||||
"""
|
||||
pass
|
||||
|
||||
def __sub__(self, other):
|
||||
"""Subtract timedelta, date or datetime.
|
||||
|
||||
:type other: _datetime.timedelta | _datetime.date | _datetime.datetime
|
||||
:rtype: _datetime.timedelta | _datetime.date | _datetime.datetime
|
||||
"""
|
||||
pass
|
||||
|
||||
def __rsub__(self, other):
|
||||
"""Subtract timedelta, date or datetime.
|
||||
|
||||
:type other: _datetime.timedelta | _datetime.date | _datetime.datetime
|
||||
:rtype: _datetime.timedelta | _datetime.date | _datetime.datetime
|
||||
"""
|
||||
pass
|
||||
|
||||
def __mul__(self, other):
|
||||
"""Multiply by an integer.
|
||||
|
||||
:type other: numbers.Integral
|
||||
:rtype: _datetime.timedelta
|
||||
"""
|
||||
return _datetime.timedelta()
|
||||
|
||||
def __rmul__(self, other):
|
||||
"""Multiply by an integer.
|
||||
|
||||
:type other: numbers.Integral
|
||||
:rtype: _datetime.timedelta
|
||||
"""
|
||||
return _datetime.timedelta()
|
||||
|
||||
def __floordiv__(self, other):
|
||||
"""Divide by an integer or a timedelta.
|
||||
|
||||
:type other: numbers.Integral | _datetime.timedelta
|
||||
:rtype: _datetime.timedelta | int
|
||||
"""
|
||||
pass
|
||||
|
||||
def __div__(self, other):
|
||||
"""Divide by an integer.
|
||||
|
||||
:type other: numbers.Integral
|
||||
:rtype: _datetime.timedelta
|
||||
"""
|
||||
pass
|
||||
|
||||
def __truediv__(self, other):
|
||||
"""Divide by a float or a timedelta.
|
||||
|
||||
:type other: numbers.Real | _datetime.timedelta
|
||||
:rtype: _datetime.timedelta | float
|
||||
"""
|
||||
pass
|
||||
|
||||
if sys.version_info >= (2, 7):
|
||||
def total_seconds(self):
|
||||
"""Return the total number of seconds contained in the duration.
|
||||
|
||||
:rtype: int
|
||||
"""
|
||||
return 0
|
||||
|
||||
min = _datetime.timedelta()
|
||||
max = _datetime.timedelta()
|
||||
resoultion = _datetime.timedelta()
|
||||
|
||||
|
||||
class date(object):
|
||||
"""An idealized naive date, assuming the current Gregorian calendar always
|
||||
was, and always will be, in effect."""
|
||||
|
||||
def __init__(self, year, month, day):
|
||||
"""Create a date object.
|
||||
|
||||
:type year: numbers.Integral
|
||||
:type month: numbers.Integral
|
||||
:type day: numbers.Integral
|
||||
"""
|
||||
self.year = year
|
||||
self.month = month
|
||||
self.day = day
|
||||
|
||||
@classmethod
|
||||
def today(cls):
|
||||
"""Return the current local date.
|
||||
|
||||
:rtype: _datetime.date
|
||||
"""
|
||||
return _datetime.date(0, 0, 0)
|
||||
|
||||
@classmethod
|
||||
def fromtimestamp(cls, timestamp):
|
||||
"""Return the local date corresponding to the POSIX timestamp, such as
|
||||
is returned by time.time().
|
||||
|
||||
:type timestamp: numbers.Real
|
||||
:rtype: _datetime.date
|
||||
"""
|
||||
return _datetime.date(0, 0, 0)
|
||||
|
||||
@classmethod
|
||||
def fromordinal(cls, ordinal):
|
||||
"""Return the date corresponding to the proleptic Gregorian ordinal,
|
||||
where January 1 of year 1 has ordinal 1.
|
||||
|
||||
:type ordinal: numbers.Integral
|
||||
:rtype: _datetime.date
|
||||
"""
|
||||
return _datetime.date(0, 0, 0)
|
||||
|
||||
def __add__(self, other):
|
||||
"""Add timedelta.
|
||||
|
||||
:type other: _datetime.timedelta
|
||||
:rtype: _datetime.date
|
||||
"""
|
||||
return _datetime.date(0, 0, 0)
|
||||
|
||||
def __radd__(self, other):
|
||||
"""Add timedelta.
|
||||
|
||||
:type other: _datetime.timedelta
|
||||
:rtype: _datetime.date
|
||||
"""
|
||||
return _datetime.date(0, 0, 0)
|
||||
|
||||
def __sub__(self, other):
|
||||
"""Subtract date or timedelta.
|
||||
|
||||
:type other: _datetime.date | _datetime.timedelta
|
||||
:rtype: _datetime.timedelta | _datetime.date
|
||||
"""
|
||||
pass
|
||||
|
||||
def __rsub__(self, other):
|
||||
"""Subtract date.
|
||||
|
||||
:type other: _datetime.date
|
||||
:rtype: _datetime.timedelta
|
||||
"""
|
||||
return _datetime.timedelta()
|
||||
|
||||
def replace(self, year=None, month=None, day=None):
|
||||
"""Return a date with the same value, except for those parameters given
|
||||
new values by whichever keyword arguments are specified.
|
||||
|
||||
:type year: numbers.Integral
|
||||
:type month: numbers.Integral
|
||||
:type day: numbers.Integral
|
||||
:rtype: _datetime.date
|
||||
"""
|
||||
return _datetime.date(0, 0, 0)
|
||||
|
||||
def timetuple(self):
|
||||
"""Return a time.struct_time such as returned by time.localtime().
|
||||
|
||||
:rtype: struct_time
|
||||
"""
|
||||
return struct_time()
|
||||
|
||||
def toordinal(self):
|
||||
"""Return the proleptic Gregorian ordinal of the date, where January 1
|
||||
of year 1 has ordinal 1.
|
||||
|
||||
:rtype: int
|
||||
"""
|
||||
return 0
|
||||
|
||||
def weekday(self):
|
||||
"""Return the day of the week as an integer, where Monday is 0 and
|
||||
Sunday is 6.
|
||||
|
||||
:rtype: int
|
||||
"""
|
||||
return 0
|
||||
|
||||
def isoweekday(self):
|
||||
"""Return the day of the week as an integer, where Monday is 1 and
|
||||
Sunday is 7.
|
||||
|
||||
:rtype: int
|
||||
"""
|
||||
return 0
|
||||
|
||||
def isocalendar(self):
|
||||
"""Return a 3-tuple, (ISO year, ISO week number, ISO weekday).
|
||||
|
||||
:rtype: (int, int, int)
|
||||
"""
|
||||
return (0, 0, 0)
|
||||
|
||||
def isoformat(self):
|
||||
"""Return a string representing the date in ISO 8601 format,
|
||||
'YYYY-MM-DD'.
|
||||
|
||||
:rtype: string
|
||||
"""
|
||||
return str()
|
||||
|
||||
def ctime(self):
|
||||
"""Return a string representing the date.
|
||||
|
||||
:rtype: string
|
||||
"""
|
||||
return str()
|
||||
|
||||
def strftime(self, format):
|
||||
"""Return a string representing the date, controlled by an explicit
|
||||
format string.
|
||||
|
||||
:type format: string
|
||||
:rtype: string
|
||||
"""
|
||||
return str()
|
||||
|
||||
min = _datetime.date(0, 0, 0)
|
||||
max = _datetime.date(0, 0, 0)
|
||||
resoultion = _datetime.timedelta()
|
||||
|
||||
|
||||
class datetime(object):
|
||||
"""A datetime object is a single object containing all the information from
|
||||
a date object and a time object."""
|
||||
|
||||
def __init__(self, year, month, day, hour=0, minute=0, second=0,
|
||||
microsecond=0, tzinfo=None):
|
||||
"""Create a datetime object.
|
||||
|
||||
:type year: numbers.Integral
|
||||
:type month: numbers.Integral
|
||||
:type day: numbers.Integral
|
||||
:type hour: numbers.Integral
|
||||
:type minute: numbers.Integral
|
||||
:type second: numbers.Integral
|
||||
:type microsecond: numbers.Integral
|
||||
:type tzinfo: _datetime.tzinfo | None
|
||||
"""
|
||||
self.year = year
|
||||
self.month = month
|
||||
self.day = day
|
||||
self.hour = hour
|
||||
self.minute = minute
|
||||
self.second = second
|
||||
self.microsecond = microsecond
|
||||
self.tzinfo = tzinfo
|
||||
|
||||
@classmethod
|
||||
def today(cls):
|
||||
"""Return the current local datetime, with tzinfo None.
|
||||
|
||||
:rtype: _datetime.datetime
|
||||
"""
|
||||
return _datetime.datetime(0, 0, 0)
|
||||
|
||||
@classmethod
|
||||
def now(cls, tz=None):
|
||||
"""Return the current local date and time.
|
||||
|
||||
:type tz: _datetime.tzinfo | None
|
||||
:rtype: _datetime.datetime
|
||||
"""
|
||||
return _datetime.datetime(0, 0, 0)
|
||||
|
||||
@classmethod
|
||||
def utcnow(cls):
|
||||
"""Return the current UTC date and time, with tzinfo None.
|
||||
|
||||
:rtype: _datetime.datetime
|
||||
"""
|
||||
return _datetime.datetime(0, 0, 0)
|
||||
|
||||
@classmethod
|
||||
def fromtimestamp(cls, timestamp, tz=None):
|
||||
"""Return the local date and time corresponding to the POSIX timestamp,
|
||||
such as is returned by time.time().
|
||||
|
||||
:type timestamp: numbers.Real
|
||||
:type tz: _datetime.tzinfo | None
|
||||
:rtype: _datetime.datetime
|
||||
"""
|
||||
return _datetime.datetime(0, 0, 0)
|
||||
|
||||
@classmethod
|
||||
def utcfromtimestamp(cls, timestamp):
|
||||
"""Return the UTC datetime corresponding to the POSIX timestamp, with
|
||||
tzinfo None.
|
||||
|
||||
:type timestamp: numbers.Real
|
||||
:rtype: _datetime.datetime
|
||||
"""
|
||||
return _datetime.datetime(0, 0, 0)
|
||||
|
||||
@classmethod
|
||||
def fromordinal(cls, ordinal):
|
||||
"""Return the datetime corresponding to the proleptic Gregorian
|
||||
ordinal.
|
||||
|
||||
:type ordinal: numbers.Integral
|
||||
:rtype: _datetime.datetime
|
||||
"""
|
||||
return _datetime.datetime(0, 0, 0)
|
||||
|
||||
@classmethod
|
||||
def combine(cls, date, time):
|
||||
"""Return a new datetime object whose date components are equal to the
|
||||
given date object's, and whose time components and tzinfo attributes
|
||||
are equal to the given time object's.
|
||||
|
||||
:type date: _datetime.date
|
||||
:type time: _datetime.time
|
||||
:rtype: _datetime.datetime
|
||||
"""
|
||||
return _datetime.datetime(0, 0, 0)
|
||||
|
||||
@classmethod
|
||||
def strptime(cls, date_string, format):
|
||||
"""Return a datetime corresponding to date_string, parsed according to
|
||||
format.
|
||||
|
||||
:type date_string: string
|
||||
:type format: string
|
||||
:rtype: _datetime.datetime
|
||||
"""
|
||||
return _datetime.datetime(0, 0, 0)
|
||||
|
||||
def __add__(self, other):
|
||||
"""Add timedelta.
|
||||
|
||||
:type other: _datetime.timedelta
|
||||
:rtype: _datetime.datetime
|
||||
"""
|
||||
return _datetime.datetime(0, 0, 0)
|
||||
|
||||
def __radd__(self, other):
|
||||
"""Add timedelta.
|
||||
|
||||
:type other: _datetime.timedelta
|
||||
:rtype: _datetime.datetime
|
||||
"""
|
||||
return _datetime.datetime(0, 0, 0)
|
||||
|
||||
def __sub__(self, other):
|
||||
"""Subtract timedelta or datetime.
|
||||
|
||||
:type other: _datetime.timedelta | _datetime.datetime
|
||||
:rtype: _datetime.datetime | _datetime.timedelta
|
||||
"""
|
||||
pass
|
||||
|
||||
def __rsub__(self, other):
|
||||
"""Subtract datetime.
|
||||
|
||||
:type other: _datetime.datetime
|
||||
:rtype: _datetime.timedelta
|
||||
"""
|
||||
return _datetime.timedelta()
|
||||
|
||||
def date(self):
|
||||
"""Return date object with same year, month and day.
|
||||
|
||||
:rtype: _datetime.date
|
||||
"""
|
||||
return _datetime.date(0, 0, 0)
|
||||
|
||||
def time(self):
|
||||
"""Return time object with same hour, minute, second and microsecond.
|
||||
|
||||
:rtype: _datetime.time
|
||||
"""
|
||||
return _datetime.time()
|
||||
|
||||
def timetz(self):
|
||||
"""Return time object with same hour, minute, second, microsecond, and
|
||||
tzinfo attributes.
|
||||
|
||||
:rtype: _datetime.time
|
||||
"""
|
||||
return _datetime.time()
|
||||
|
||||
def replace(self, year=None, month=None, day=None, hour=None, minute=None,
|
||||
second=None, microsecond=None, tzinfo=None):
|
||||
"""Return a datetime with the same attributes, except for those
|
||||
attributes given new values by whichever keyword arguments are
|
||||
specified.
|
||||
|
||||
:type year: numbers.Integral
|
||||
:type month: numbers.Integral
|
||||
:type day: numbers.Integral
|
||||
:type hour: numbers.Integral
|
||||
:type minute: numbers.Integral
|
||||
:type second: numbers.Integral
|
||||
:type microsecond: numbers.Integral
|
||||
:type tzinfo: _datetime.tzinfo | None
|
||||
:rtype: _datetime.datetime
|
||||
"""
|
||||
return _datetime.datetime(0, 0, 0)
|
||||
|
||||
def astimezone(self, tz):
|
||||
"""Return a datetime object with new tzinfo attribute tz, adjusting the
|
||||
date and time data so the result is the same UTC time as self, but in
|
||||
tz's local time.
|
||||
|
||||
:type tz: _datetime.tzinfo
|
||||
:rtype: _datetime.datetime
|
||||
"""
|
||||
return _datetime.datetime(0, 0, 0)
|
||||
|
||||
def utcoffset(self):
|
||||
"""If tzinfo is None, returns None, else returns
|
||||
self.tzinfo.utcoffset(self).
|
||||
|
||||
:rtype: _datetime.timedelta | None
|
||||
"""
|
||||
return _datetime.timedelta()
|
||||
|
||||
def dst(self):
|
||||
"""If tzinfo is None, returns None, else returns self.tzinfo.dst(self).
|
||||
|
||||
:rtype: _datetime.timedelta | None
|
||||
"""
|
||||
return _datetime.timedelta()
|
||||
|
||||
def tzname(self):
|
||||
"""If tzinfo is None, returns None, else returns
|
||||
self.tzinfo.tzname(self).
|
||||
|
||||
:rtype: string | None
|
||||
"""
|
||||
return str()
|
||||
|
||||
def timetuple(self):
|
||||
"""Return a time.struct_time such as returned by time.localtime().
|
||||
|
||||
:rtype: struct_time
|
||||
"""
|
||||
return struct_time()
|
||||
|
||||
def utctimetuple(self):
|
||||
"""If datetime instance d is naive, this is the same as d.timetuple()
|
||||
except that tm_isdst is forced to 0 regardless of what d.dst() returns.
|
||||
|
||||
:rtype: struct_time
|
||||
"""
|
||||
return struct_time()
|
||||
|
||||
def toordinal(self):
|
||||
"""Return the proleptic Gregorian ordinal of the date.
|
||||
|
||||
:rtype: int
|
||||
"""
|
||||
return 0
|
||||
|
||||
def weekday(self):
|
||||
"""Return the day of the week as an integer, where Monday is 0 and
|
||||
Sunday is 6.
|
||||
|
||||
:rtype: int
|
||||
"""
|
||||
return 0
|
||||
|
||||
def isoweekday(self):
|
||||
"""Return the day of the week as an integer, where Monday is 1 and
|
||||
Sunday is 7.
|
||||
|
||||
:rtype: int
|
||||
"""
|
||||
return 0
|
||||
|
||||
def isocalendar(self):
|
||||
"""Return a 3-tuple, (ISO year, ISO week number, ISO weekday).
|
||||
|
||||
:rtype: (int, int, int)
|
||||
"""
|
||||
return (0, 0, 0)
|
||||
|
||||
def isoformat(self, sep='T'):
|
||||
"""Return a string representing the date and time in ISO 8601 format.
|
||||
|
||||
:type sep: string
|
||||
:rtype: string
|
||||
"""
|
||||
return str()
|
||||
|
||||
def ctime(self):
|
||||
"""Return a string representing the date and time.
|
||||
|
||||
:rtype: string
|
||||
"""
|
||||
return str()
|
||||
|
||||
def strftime(self, format):
|
||||
"""Return a string representing the date and time, controlled by an
|
||||
explicit format string.
|
||||
|
||||
:type format: string
|
||||
:rtype: string
|
||||
"""
|
||||
return str()
|
||||
|
||||
min = _datetime.datetime(0, 0, 0)
|
||||
max = _datetime.datetime(0, 0, 0)
|
||||
resoultion = _datetime.timedelta()
|
||||
|
||||
|
||||
class time(object):
|
||||
"""A time object represents a (local) time of day, independent of any
|
||||
particular day, and subject to adjustment via a tzinfo object."""
|
||||
|
||||
def __init__(self, hour=0, minute=0, second=0, microsecond=0, tzinfo=None):
|
||||
"""Create a time object.
|
||||
|
||||
:type hour: numbers.Integral
|
||||
:type minute: numbers.Integral
|
||||
:type second: numbers.Integral
|
||||
:type microsecond: numbers.Integral
|
||||
:type tzinfo: _datetime.tzinfo | None
|
||||
"""
|
||||
self.hour = hour
|
||||
self.minute = minute
|
||||
self.second = second
|
||||
self.microsecond = microsecond
|
||||
sefl.tzinfo = tzinfo
|
||||
|
||||
def replace(self, hour=None, minute=None, second=None, microsecond=None,
|
||||
tzinfo=None):
|
||||
"""Return a time with the same value, except for those attributes given
|
||||
new values by whichever keyword arguments are specified.
|
||||
|
||||
:type hour: numbers.Integral
|
||||
:type minute: numbers.Integral
|
||||
:type second: numbers.Integral
|
||||
:type microsecond: numbers.Integral
|
||||
:type tzinfo: _datetime.tzinfo | None
|
||||
:rtype: _datetime.time
|
||||
"""
|
||||
return _datetime.time()
|
||||
|
||||
def isoformat(self):
|
||||
"""Return a string representing the time in ISO 8601 format.
|
||||
|
||||
:rtype: string
|
||||
"""
|
||||
return str()
|
||||
|
||||
def strftime(self, format):
|
||||
"""Return a string representing the time, controlled by an explicit
|
||||
format string.
|
||||
|
||||
:type format: string
|
||||
:rtype: string
|
||||
"""
|
||||
return str()
|
||||
|
||||
def utcoffset(self):
|
||||
"""If tzinfo is None, returns None, else returns
|
||||
self.tzinfo.utcoffset(self).
|
||||
|
||||
:rtype: _datetime.timedelta | None
|
||||
"""
|
||||
return _datetime.timedelta()
|
||||
|
||||
def dst(self):
|
||||
"""If tzinfo is None, returns None, else returns self.tzinfo.dst(self).
|
||||
|
||||
:rtype: _datetime.timedelta | None
|
||||
"""
|
||||
return _datetime.timedelta()
|
||||
|
||||
def tzname(self):
|
||||
"""If tzinfo is None, returns None, else returns
|
||||
self.tzinfo.tzname(self).
|
||||
|
||||
:rtype: string | None
|
||||
"""
|
||||
return str()
|
||||
|
||||
min = _datetime.time()
|
||||
max = _datetime.time()
|
||||
resoultion = _datetime.timedelta()
|
||||
@@ -0,0 +1,82 @@
|
||||
"""Skeleton for 'decimal' stdlib module."""
|
||||
|
||||
|
||||
import decimal
|
||||
|
||||
|
||||
def getcontext():
|
||||
"""Returns this thread's context.
|
||||
|
||||
:rtype: decimal.Context
|
||||
"""
|
||||
return decimal.Context()
|
||||
|
||||
|
||||
def setcontext(context):
|
||||
"""Set this thread's context to context.
|
||||
|
||||
:type context: decimal.Context
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class Decimal(object):
|
||||
"""Floating point class for decimal arithmetic."""
|
||||
|
||||
def __add__(self, other, context=None):
|
||||
"""Returns self + other.
|
||||
|
||||
:type other: numbers.Number
|
||||
:type context: decimal.Context | None
|
||||
:rtype: decimal.Decimal
|
||||
"""
|
||||
return decimal.Decimal()
|
||||
|
||||
def __sub__(self, other, context=None):
|
||||
"""Return self - other.
|
||||
|
||||
:type other: numbers.Number
|
||||
:type context: decimal.Context | None
|
||||
:rtype: decimal.Decimal
|
||||
"""
|
||||
return decimal.Decimal()
|
||||
|
||||
def __mul__(self, other, context=None):
|
||||
"""Return self * other.
|
||||
|
||||
:type other: numbers.Number
|
||||
:type context: decimal.Context | None
|
||||
:rtype: decimal.Decimal
|
||||
"""
|
||||
return decimal.Decimal()
|
||||
|
||||
|
||||
def __truediv__(self, other, context=None):
|
||||
"""Return self / other.
|
||||
|
||||
:type other: numbers.Number
|
||||
:type context: decimal.Context | None
|
||||
:rtype: decimal.Decimal
|
||||
"""
|
||||
return decimal.Decimal()
|
||||
|
||||
|
||||
def __floordiv__(self, other, context=None):
|
||||
"""Return self // other.
|
||||
|
||||
:type other: numbers.Number
|
||||
:type context: decimal.Context | None
|
||||
:rtype: decimal.Decimal
|
||||
"""
|
||||
return decimal.Decimal()
|
||||
|
||||
def __pow__(self, other, modulo=None, context=None):
|
||||
"""Return self ** other [ % modulo].
|
||||
|
||||
:type other: numbers.Number
|
||||
:type modulo: numbers.Number
|
||||
:type context: decimal.Context | None
|
||||
:rtype: decimal.Decimal
|
||||
"""
|
||||
return decimal.Decimal()
|
||||
@@ -0,0 +1,16 @@
|
||||
"""Skeleton for 'functools' stdlib module."""
|
||||
|
||||
|
||||
def reduce(function, sequence, initial=None):
|
||||
"""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.
|
||||
|
||||
:type function: collections.Callable
|
||||
:type sequence: collections.Iterable
|
||||
:type initial: T
|
||||
:rtype: T | unknown
|
||||
"""
|
||||
return initial
|
||||
|
||||
|
||||
@@ -0,0 +1,622 @@
|
||||
"""Skeleton for 'io' stdlib module."""
|
||||
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import sys
|
||||
import io
|
||||
|
||||
|
||||
def open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None,
|
||||
closefd=True, opener=None):
|
||||
"""This is an alias for the builtin open() function.
|
||||
|
||||
:type file: string
|
||||
:type mode: string
|
||||
:type buffering: numbers.Integral
|
||||
:type encoding: string | None
|
||||
:type errors: string | None
|
||||
:type newline: string | None
|
||||
:type closefd: bool
|
||||
:type opener: ((string, int) -> int) | None
|
||||
:rtype: io.FileIO[bytes] | io.TextIOWrapper[unicode]
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class IOBase(object):
|
||||
"""The abstract base class for all I/O classes, acting on streams of
|
||||
bytes.
|
||||
|
||||
:type closed: bool
|
||||
"""
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
"""Private constructor of IOBase.
|
||||
|
||||
:rtype: io.IOBase[T <= bytes | unicode]
|
||||
"""
|
||||
self.closed = False
|
||||
|
||||
def __iter__(self):
|
||||
"""Iterate over lines.
|
||||
|
||||
:rtype: collections.Iterator[T]
|
||||
"""
|
||||
return []
|
||||
|
||||
def close(self):
|
||||
"""Flush and close this stream.
|
||||
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def fileno(self):
|
||||
"""Return the underlying file descriptor (an integer) of the stream if
|
||||
it exists.
|
||||
|
||||
:rtype: int
|
||||
"""
|
||||
return 0
|
||||
|
||||
def flush(self):
|
||||
"""Flush the write buffers of the stream if applicable.
|
||||
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def isatty(self):
|
||||
"""Return True if the stream is interactive (i.e., connected to a
|
||||
terminal/tty device).
|
||||
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
def readable(self):
|
||||
"""Return True if the stream can be read from.
|
||||
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
def readline(self, limit=-1):
|
||||
"""Read and return one line from the stream.
|
||||
|
||||
:type limit: numbers.Integral
|
||||
:rtype: T
|
||||
"""
|
||||
pass
|
||||
|
||||
def readlines(self, hint=-1):
|
||||
"""Read and return a list of lines from the stream.
|
||||
|
||||
:type hint: numbers.Integral
|
||||
:rtype: list[T]
|
||||
"""
|
||||
return []
|
||||
|
||||
def seek(self, offset, whence=io.SEEK_SET):
|
||||
"""Change the stream position to the given byte offset.
|
||||
|
||||
:type offset: numbers.Integral
|
||||
:type whence: numbers.Integral
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def seekable(self):
|
||||
"""Return True if the stream supports random access.
|
||||
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
def tell(self):
|
||||
"""Return the current stream position.
|
||||
|
||||
:rtype: int
|
||||
"""
|
||||
return 0
|
||||
|
||||
def truncate(self, size=None):
|
||||
"""Resize the stream to the given size in bytes (or the current
|
||||
position if size is not specified).
|
||||
|
||||
:type size: numbers.Integral | None
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def writable(self):
|
||||
"""Return True if the stream supports writing.
|
||||
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
def writelines(self, lines):
|
||||
"""Write a list of lines to the stream.
|
||||
|
||||
:type lines: collections.Iterable[T]
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class RawIOBase(io.IOBase):
|
||||
"""Base class for raw binary I/O."""
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
"""Private constructor of RawIOBase.
|
||||
|
||||
:rtype: io.RawIOBase[bytes]
|
||||
"""
|
||||
pass
|
||||
|
||||
def read(self, n=1):
|
||||
"""Read up to n bytes from the object and return them.
|
||||
|
||||
:type n: numbers.Integral
|
||||
:rtype: bytes
|
||||
"""
|
||||
return b''
|
||||
|
||||
def readall(self):
|
||||
"""Read and return all the bytes from the stream until EOF, using
|
||||
multiple calls to the stream if necessary.
|
||||
|
||||
:rtype: bytes
|
||||
"""
|
||||
return b''
|
||||
|
||||
def readinto(self, b):
|
||||
"""Read up to len(b) bytes into bytearray b and return the number of
|
||||
bytes read.
|
||||
|
||||
:type b: bytearray
|
||||
:rtype: int
|
||||
"""
|
||||
return 0
|
||||
|
||||
def write(self, b):
|
||||
"""Write the given bytes or bytearray object, b, to the underlying raw
|
||||
stream and return the number of bytes written.
|
||||
|
||||
:type b: bytes | bytearray
|
||||
:rtype: int
|
||||
"""
|
||||
return 0
|
||||
|
||||
|
||||
class BufferedIOBase(io.IOBase):
|
||||
"""Base class for binary streams that support some kind of buffering."""
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
"""Private constructor of BufferedIOBase.
|
||||
|
||||
:rtype: io.BufferedIOBase[bytes]
|
||||
"""
|
||||
pass
|
||||
|
||||
if sys.version_info >= (2, 7):
|
||||
def detach(self):
|
||||
"""Separate the underlying raw stream from the buffer and return
|
||||
it.
|
||||
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def read1(self, n=-1):
|
||||
"""Read and return up to n bytes, with at most one call to the
|
||||
underlying raw stream's read() method.
|
||||
|
||||
:type n: numbers.Integral
|
||||
:rtype: bytes
|
||||
"""
|
||||
return b''
|
||||
|
||||
|
||||
class FileIO(io.RawIOBase):
|
||||
"""FileIO represents an OS-level file containing bytes data.
|
||||
|
||||
:type name: string
|
||||
:type mode: string
|
||||
:type closefd: bool
|
||||
:type closed: bool
|
||||
"""
|
||||
|
||||
def __init__(self, name, mode='r', closefd=True):
|
||||
"""Create a FileIO object.
|
||||
|
||||
:type name: string
|
||||
:type mode: string
|
||||
:type closefd: bool
|
||||
:rtype: io.FileIO[bytes]
|
||||
"""
|
||||
self.name = name
|
||||
self.mode = mode
|
||||
self.closefd = closefd
|
||||
self.closed = False
|
||||
pass
|
||||
|
||||
def __iter__(self):
|
||||
"""Iterate over lines.
|
||||
|
||||
:rtype: collections.Iterator[bytes]
|
||||
"""
|
||||
return []
|
||||
|
||||
def close(self):
|
||||
"""Flush and close this stream.
|
||||
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def fileno(self):
|
||||
"""Return the underlying file descriptor (an integer) of the stream if
|
||||
it exists.
|
||||
|
||||
:rtype: int
|
||||
"""
|
||||
return 0
|
||||
|
||||
def flush(self):
|
||||
"""Flush the write buffers of the stream if applicable.
|
||||
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def isatty(self):
|
||||
"""Return True if the stream is interactive (i.e., connected to a
|
||||
terminal/tty device).
|
||||
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
def readable(self):
|
||||
"""Return True if the stream can be read from.
|
||||
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
def readline(self, limit=-1):
|
||||
"""Read and return one line from the stream.
|
||||
|
||||
:type limit: numbers.Integral
|
||||
:rtype: bytes
|
||||
"""
|
||||
return b''
|
||||
|
||||
def readlines(self, hint=-1):
|
||||
"""Read and return a list of lines from the stream.
|
||||
|
||||
:type hint: numbers.Integral
|
||||
:rtype: list[bytes]
|
||||
"""
|
||||
return []
|
||||
|
||||
def seek(self, offset, whence=io.SEEK_SET):
|
||||
"""Change the stream position to the given byte offset.
|
||||
|
||||
:type offset: numbers.Integral
|
||||
:type whence: numbers.Integral
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def seekable(self):
|
||||
"""Return True if the stream supports random access.
|
||||
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
def tell(self):
|
||||
"""Return the current stream position.
|
||||
|
||||
:rtype: int
|
||||
"""
|
||||
return 0
|
||||
|
||||
def truncate(self, size=None):
|
||||
"""Resize the stream to the given size in bytes (or the current
|
||||
position if size is not specified).
|
||||
|
||||
:type size: numbers.Integral | None
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def writable(self):
|
||||
"""Return True if the stream supports writing.
|
||||
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
def writelines(self, lines):
|
||||
"""Write a list of lines to the stream.
|
||||
|
||||
:type lines: collections.Iterable[bytes]
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def read(self, n=1):
|
||||
"""Read up to n bytes from the object and return them.
|
||||
|
||||
:type n: numbers.Integral
|
||||
:rtype: bytes
|
||||
"""
|
||||
return b''
|
||||
|
||||
def readall(self):
|
||||
"""Read and return all the bytes from the stream until EOF, using
|
||||
multiple calls to the stream if necessary.
|
||||
|
||||
:rtype: bytes
|
||||
"""
|
||||
return b''
|
||||
|
||||
def readinto(self, b):
|
||||
"""Read up to len(b) bytes into bytearray b and return the number of
|
||||
bytes read.
|
||||
|
||||
:type b: bytearray
|
||||
:rtype: int
|
||||
"""
|
||||
return 0
|
||||
|
||||
def write(self, b):
|
||||
"""Write the given bytes or bytearray object, b, to the underlying raw
|
||||
stream and return the number of bytes written.
|
||||
|
||||
:type b: bytes | bytearray
|
||||
:rtype: int
|
||||
"""
|
||||
return 0
|
||||
|
||||
|
||||
class BytesIO(io.BufferedIOBase):
|
||||
"""A stream implementation using an in-memory bytes buffer."""
|
||||
|
||||
def __init__(self, initial_bytes=None):
|
||||
"""Create a BytesIO object.
|
||||
|
||||
:rtype: io.BytesIO[bytes]
|
||||
"""
|
||||
pass
|
||||
|
||||
if sys.version_info >= (3, 2):
|
||||
def getbuffer(self):
|
||||
"""Return a readable and writable view over the contents of the
|
||||
buffer without copying them.
|
||||
|
||||
:rtype: bytearray
|
||||
"""
|
||||
return bytearray()
|
||||
|
||||
def getvalue(self):
|
||||
"""Return bytes containing the entire contents of the buffer.
|
||||
|
||||
:rtype: bytes
|
||||
"""
|
||||
return b''
|
||||
|
||||
|
||||
class TextIOBase(io.IOBase):
|
||||
"""Base class for text streams.
|
||||
|
||||
:type encoding: string
|
||||
:type errors: string
|
||||
:type newlines: string | tuple | None
|
||||
:type buffer: BufferedIOBase
|
||||
"""
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
"""Private constructor of TextIOBase.
|
||||
|
||||
:rtype: TextIOBase[unicode]
|
||||
"""
|
||||
self.encoding = str()
|
||||
self.errors = str()
|
||||
self.newlines = None
|
||||
self.buffer = BufferedIOBase()
|
||||
|
||||
if sys.version_info >= (2, 7):
|
||||
def detach(self):
|
||||
"""Separate the underlying raw stream from the buffer and return
|
||||
it.
|
||||
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def read(self, n=None):
|
||||
"""Read and return at most n characters from the stream as a single
|
||||
unicode.
|
||||
|
||||
:type n: numbers.Integral | None
|
||||
:rtype: unicode
|
||||
"""
|
||||
return ''
|
||||
|
||||
def write(self, s):
|
||||
"""Write the unicode string s to the stream and return the number of
|
||||
characters written.
|
||||
|
||||
:type b: unicode
|
||||
:rtype: int
|
||||
"""
|
||||
return 0
|
||||
|
||||
|
||||
class TextIOWrapper(io.TextIOBase):
|
||||
"""A buffered text stream over a BufferedIOBase binary stream.
|
||||
|
||||
:type buffer: io.BufferedIOBase
|
||||
:type encoding: string
|
||||
:type errors: string
|
||||
:type newlines: string
|
||||
:type line_buffering: bool
|
||||
:type name: string
|
||||
"""
|
||||
|
||||
def __init__(self, buffer, encoding=None, errors=None, newline=None,
|
||||
line_buffering=False):
|
||||
"""Creat a TextIOWrapper object.
|
||||
|
||||
:type buffer: io.BufferedIOBase
|
||||
:type encoding: string | None
|
||||
:type errors: string | None
|
||||
:type newline: string | None
|
||||
:type line_buffering: bool
|
||||
:rtype: io.TextIOWrapper[unicode]
|
||||
"""
|
||||
self.name = ''
|
||||
self.buffer = buffer
|
||||
self.encoding = encoding
|
||||
self.errors = errors
|
||||
self.newlines = newline
|
||||
self.line_buffering = line_buffering
|
||||
|
||||
def __iter__(self):
|
||||
"""Iterate over lines.
|
||||
|
||||
:rtype: collections.Iterator[unicode]
|
||||
"""
|
||||
return []
|
||||
|
||||
def close(self):
|
||||
"""Flush and close this stream.
|
||||
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def fileno(self):
|
||||
"""Return the underlying file descriptor (an integer) of the stream if
|
||||
it exists.
|
||||
|
||||
:rtype: int
|
||||
"""
|
||||
return 0
|
||||
|
||||
def flush(self):
|
||||
"""Flush the write buffers of the stream if applicable.
|
||||
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def isatty(self):
|
||||
"""Return True if the stream is interactive (i.e., connected to a
|
||||
terminal/tty device).
|
||||
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
def readable(self):
|
||||
"""Return True if the stream can be read from.
|
||||
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
def readline(self, limit=-1):
|
||||
"""Read and return one line from the stream.
|
||||
|
||||
:type limit: numbers.Integral
|
||||
:rtype: unicode
|
||||
"""
|
||||
pass
|
||||
|
||||
def readlines(self, hint=-1):
|
||||
"""Read and return a list of lines from the stream.
|
||||
|
||||
:type hint: numbers.Integral
|
||||
:rtype: list[unicode]
|
||||
"""
|
||||
return []
|
||||
|
||||
def seek(self, offset, whence=io.SEEK_SET):
|
||||
"""Change the stream position to the given byte offset.
|
||||
|
||||
:type offset: numbers.Integral
|
||||
:type whence: numbers.Integral
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def seekable(self):
|
||||
"""Return True if the stream supports random access.
|
||||
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
def tell(self):
|
||||
"""Return the current stream position.
|
||||
|
||||
:rtype: int
|
||||
"""
|
||||
return 0
|
||||
|
||||
def truncate(self, size=None):
|
||||
"""Resize the stream to the given size in bytes (or the current
|
||||
position if size is not specified).
|
||||
|
||||
:type size: numbers.Integral | None
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def writable(self):
|
||||
"""Return True if the stream supports writing.
|
||||
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
def writelines(self, lines):
|
||||
"""Write a list of lines to the stream.
|
||||
|
||||
:type lines: collections.Iterable[unicode]
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
if sys.version_info >= (2, 7):
|
||||
def detach(self):
|
||||
"""Separate the underlying raw stream from the buffer and return
|
||||
it.
|
||||
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def read(self, n=None):
|
||||
"""Read and return at most n characters from the stream as a single
|
||||
unicode.
|
||||
|
||||
:type n: numbers.Integral | None
|
||||
:rtype: unicode
|
||||
"""
|
||||
return ''
|
||||
|
||||
def write(self, s):
|
||||
"""Write the unicode string s to the stream and return the number of
|
||||
characters written.
|
||||
|
||||
:type b: unicode
|
||||
:rtype: int
|
||||
"""
|
||||
return 0
|
||||
@@ -0,0 +1,2 @@
|
||||
# coding=utf-8
|
||||
__author__ = 'Ilya.Kazakevich'
|
||||
@@ -0,0 +1,68 @@
|
||||
# coding=utf-8
|
||||
"""
|
||||
Lettuce terrain hooks: http://lettuce.it/reference/terrain.html
|
||||
"""
|
||||
__author__ = 'Ilya.Kazakevich'
|
||||
|
||||
|
||||
class __When(object):
|
||||
@staticmethod
|
||||
def all(function):
|
||||
"""
|
||||
Runs before/after all features, scenarios and steps
|
||||
"""
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def each_step(function):
|
||||
"""
|
||||
Runs before/after each step
|
||||
"""
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def each_scenario(function):
|
||||
"""
|
||||
Runs before/after each scenario
|
||||
"""
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def each_background(function):
|
||||
"""
|
||||
Runs before/after each background
|
||||
"""
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def each_feature(function):
|
||||
"""
|
||||
Runs before/after each feature
|
||||
"""
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def each_app(function):
|
||||
"""
|
||||
Runs before/after each Django app.
|
||||
"""
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def runserver(function):
|
||||
"""
|
||||
Runs before/after lettuce starts up the built-in http server.
|
||||
"""
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def handle_request(function):
|
||||
"""
|
||||
Runs before/after lettuce’s built-in HTTP server responds to a request.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
before = __When()
|
||||
after = __When()
|
||||
|
||||
@@ -0,0 +1,381 @@
|
||||
"""Skeleton for 'math' stdlib module."""
|
||||
|
||||
|
||||
import sys
|
||||
import math
|
||||
|
||||
|
||||
def ceil(x):
|
||||
"""Return the ceiling of x as a float, the smallest integer value greater
|
||||
than or equal to x.
|
||||
|
||||
:type x: numbers.Real
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
|
||||
if sys.version_info >= (2, 6):
|
||||
def copysign(x, y):
|
||||
"""Return x with the sign of y. On a platform that supports signed
|
||||
zeros, copysign(1.0, -0.0) returns -1.0.
|
||||
|
||||
:type x: numbers.Real
|
||||
:type y: numbers.Real
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
|
||||
def fabs(x):
|
||||
"""Return the absolute value of x.
|
||||
|
||||
:type x: numbers.Real
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
|
||||
if sys.version_info >= (2, 6):
|
||||
def factorial(x):
|
||||
"""Return x factorial.
|
||||
|
||||
:type x: numbers.Integral
|
||||
:rtype: int
|
||||
"""
|
||||
return 0
|
||||
|
||||
|
||||
def floor(x):
|
||||
"""Return the floor of x as a float, the largest integer value less than or
|
||||
equal to x.
|
||||
|
||||
:type x: numbers.Real
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
|
||||
def fmod(x, y):
|
||||
"""Return fmod(x, y), as defined by the platform C library.
|
||||
|
||||
:type x: numbers.Real
|
||||
:type y: numbers.Real
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
|
||||
def frexp(x):
|
||||
"""Return the mantissa and exponent of x as the pair (m, e).
|
||||
|
||||
:type x: numbers.Real
|
||||
:rtype: (float, int)
|
||||
"""
|
||||
return 0.0, 0
|
||||
|
||||
|
||||
if sys.version_info >= (2, 6):
|
||||
def fsum(iterable):
|
||||
"""Return an accurate floating point sum of values in the iterable.
|
||||
|
||||
:type iterable: collections.Iterable[numbers.Real]
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
def isinf(x):
|
||||
"""Check if the float x is positive or negative infinity.
|
||||
|
||||
:type x: numbers.Real
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
def isnan(x):
|
||||
"""Check if the float x is a NaN (not a number).
|
||||
|
||||
:type x: numbers.Real
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
|
||||
def ldexp(x, i):
|
||||
"""Return x * (2**i).
|
||||
|
||||
:type x: numbers.Real
|
||||
:type i: numbers.Integral
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
|
||||
def modf(x):
|
||||
"""Return the fractional and integer parts of x.
|
||||
|
||||
:type x: numbers.Real
|
||||
:rtype: (float, float)
|
||||
"""
|
||||
return 0.0, 0.0
|
||||
|
||||
|
||||
if sys.version_info >= (2, 6):
|
||||
def trunc(x):
|
||||
"""Return the Real value x truncated to an Integral (usually a long
|
||||
integer).
|
||||
|
||||
:type x: numbers.Real
|
||||
:rtype: int
|
||||
"""
|
||||
return 0
|
||||
|
||||
|
||||
def exp(x):
|
||||
"""Return e**x.
|
||||
|
||||
:type x: numbers.Real
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
|
||||
if sys.version_info >= (2, 7):
|
||||
def expm1(x):
|
||||
"""Return e**x - 1.
|
||||
|
||||
:type x: numbers.Real
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
|
||||
def log(x, base=math.e):
|
||||
"""With one argument, return the natural logarithm of x (to base e).
|
||||
|
||||
With two arguments, return the logarithm of x to the given base, calculated
|
||||
as log(x)/log(base).
|
||||
|
||||
:type x: numbers.Real
|
||||
:type base: numbers.Real
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
|
||||
if sys.version_info >= (2, 6):
|
||||
def log1p(x):
|
||||
"""Return the natural logarithm of 1+x (base e).
|
||||
|
||||
:type x: numbers.Real
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
|
||||
def log10(x):
|
||||
"""Return the base-10 logarithm of x.
|
||||
|
||||
:type x: numbers.Real
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
|
||||
def pow(x, y):
|
||||
"""Return x raised to the power y.
|
||||
|
||||
:type x: numbers.Real
|
||||
:type y: numbers.Real
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
|
||||
def sqrt(x):
|
||||
"""Return the square root of x.
|
||||
|
||||
:type x: numbers.Real
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
|
||||
def acos(x):
|
||||
"""Return the arc cosine of x, in radians.
|
||||
|
||||
:type x: numbers.Real
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
|
||||
def asin(x):
|
||||
"""Return the arc sine of x, in radians.
|
||||
|
||||
:type x: numbers.Real
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
|
||||
def atan(x):
|
||||
"""Return the arc tangent of x, in radians.
|
||||
|
||||
:type x: numbers.Real
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
|
||||
def atan2(y, x):
|
||||
"""Return atan(y / x), in radians.
|
||||
|
||||
:type y: numbers.Real
|
||||
:type x: numbers.Real
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
|
||||
def cos(x):
|
||||
"""Return the cosine of x radians.
|
||||
|
||||
:type x: numbers.Real
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
|
||||
def hypot(x, y):
|
||||
"""Return the Euclidean norm, sqrt(x*x + y*y).
|
||||
|
||||
:type x: numbers.Real
|
||||
:type y: numbers.Real
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
|
||||
def sin(x):
|
||||
"""Return the sine of x radians.
|
||||
|
||||
:type x: numbers.Real
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
|
||||
def tan(x):
|
||||
"""Return the tangent of x radians.
|
||||
|
||||
:type x: numbers.Real
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
|
||||
def degrees(x):
|
||||
"""Converts angle x from radians to degrees.
|
||||
|
||||
:type x: numbers.Real
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
|
||||
def radians(x):
|
||||
"""Converts angle x from degrees to radians.
|
||||
|
||||
:type x: numbers.Real
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
|
||||
if sys.version_info >= (2, 6):
|
||||
def acosh(x):
|
||||
"""Return the inverse hyperbolic cosine of x.
|
||||
|
||||
:type x: numbers.Real
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
def asinh(x):
|
||||
"""Return the inverse hyperbolic sine of x.
|
||||
|
||||
:type x: numbers.Real
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
def atanh(x):
|
||||
"""Return the inverse hyperbolic tangent of x.
|
||||
|
||||
:type x: numbers.Real
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
|
||||
def cosh(x):
|
||||
"""Return the hyperbolic cosine of x.
|
||||
|
||||
:type x: numbers.Real
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
|
||||
def sinh(x):
|
||||
"""Return the hyperbolic sine of x.
|
||||
|
||||
:type x: numbers.Real
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
|
||||
def tanh(x):
|
||||
"""Return the hyperbolic tangent of x.
|
||||
|
||||
:type x: numbers.Real
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
|
||||
if sys.version_info >= (2, 7):
|
||||
def erf(x):
|
||||
"""Return the error function at x.
|
||||
|
||||
:type x: numbers.Real
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
def erfc(x):
|
||||
"""Return the complementary error function at x.
|
||||
|
||||
:type x: numbers.Real
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
def gamma(x):
|
||||
"""Return the Gamma function at x.
|
||||
|
||||
:type x: numbers.Real
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
def lgamma(x):
|
||||
"""Return the natural logarithm of the absolute value of the Gamma
|
||||
function at x.
|
||||
|
||||
:type x: numbers.Real
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
@@ -0,0 +1,280 @@
|
||||
"""Skeleton for 'multiprocessing' stdlib module."""
|
||||
|
||||
|
||||
from multiprocessing.pool import Pool
|
||||
|
||||
|
||||
class Process(object):
|
||||
def __init__(self, group=None, target=None, name=None, args=(), kwargs={}):
|
||||
self.name = ''
|
||||
self.daemon = False
|
||||
self.authkey = None
|
||||
self.exitcode = None
|
||||
self.ident = 0
|
||||
self.pid = 0
|
||||
self.sentinel = None
|
||||
|
||||
def run(self):
|
||||
pass
|
||||
|
||||
def start(self):
|
||||
pass
|
||||
|
||||
def terminate(self):
|
||||
pass
|
||||
|
||||
def join(self, timeout=None):
|
||||
pass
|
||||
|
||||
def is_alive(self):
|
||||
return False
|
||||
|
||||
|
||||
class ProcessError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class BufferTooShort(ProcessError):
|
||||
pass
|
||||
|
||||
|
||||
class AuthenticationError(ProcessError):
|
||||
pass
|
||||
|
||||
|
||||
class TimeoutError(ProcessError):
|
||||
pass
|
||||
|
||||
|
||||
class Connection(object):
|
||||
def send(self, obj):
|
||||
pass
|
||||
|
||||
def recv(self):
|
||||
pass
|
||||
|
||||
def fileno(self):
|
||||
return 0
|
||||
|
||||
def close(self):
|
||||
pass
|
||||
|
||||
def poll(self, timeout=None):
|
||||
pass
|
||||
|
||||
def send_bytes(self, buffer, offset=-1, size=-1):
|
||||
pass
|
||||
|
||||
def recv_bytes(self, maxlength=-1):
|
||||
pass
|
||||
|
||||
def recv_bytes_into(self, buffer, offset=-1):
|
||||
pass
|
||||
|
||||
def __enter__(self):
|
||||
pass
|
||||
|
||||
def __exit__(self, exc_type, exc_val, exc_tb):
|
||||
pass
|
||||
|
||||
|
||||
def Pipe(duplex=True):
|
||||
return Connection(), Connection()
|
||||
|
||||
|
||||
class Queue(object):
|
||||
def __init__(self, maxsize=-1):
|
||||
self._maxsize = maxsize
|
||||
|
||||
def qsize(self):
|
||||
return 0
|
||||
|
||||
def empty(self):
|
||||
return False
|
||||
|
||||
def full(self):
|
||||
return False
|
||||
|
||||
def put(self, obj, block=True, timeout=None):
|
||||
pass
|
||||
|
||||
def put_nowait(self, obj):
|
||||
pass
|
||||
|
||||
def get(self, block=True, timeout=None):
|
||||
pass
|
||||
|
||||
def get_nowait(self):
|
||||
pass
|
||||
|
||||
def close(self):
|
||||
pass
|
||||
|
||||
def join_thread(self):
|
||||
pass
|
||||
|
||||
def cancel_join_thread(self):
|
||||
pass
|
||||
|
||||
|
||||
class SimpleQueue(object):
|
||||
def empty(self):
|
||||
return False
|
||||
|
||||
def get(self):
|
||||
pass
|
||||
|
||||
def put(self, item):
|
||||
pass
|
||||
|
||||
|
||||
class JoinableQueue(multiprocessing.Queue):
|
||||
def task_done(self):
|
||||
pass
|
||||
|
||||
def join(self):
|
||||
pass
|
||||
|
||||
|
||||
def active_childern():
|
||||
"""
|
||||
:rtype: list[multiprocessing.Process]
|
||||
"""
|
||||
return []
|
||||
|
||||
|
||||
def cpu_count():
|
||||
return 0
|
||||
|
||||
|
||||
def current_process():
|
||||
"""
|
||||
:rtype: multiprocessing.Process
|
||||
"""
|
||||
return Process()
|
||||
|
||||
|
||||
def freeze_support():
|
||||
pass
|
||||
|
||||
|
||||
def get_all_start_methods():
|
||||
return []
|
||||
|
||||
|
||||
def get_context(method=None):
|
||||
pass
|
||||
|
||||
|
||||
def get_start_method(allow_none=False):
|
||||
pass
|
||||
|
||||
|
||||
def set_executable(path):
|
||||
pass
|
||||
|
||||
|
||||
def set_start_method(method):
|
||||
pass
|
||||
|
||||
|
||||
class Barrier(object):
|
||||
def __init__(self, parties, action=None, timeout=None):
|
||||
self.parties = parties
|
||||
self.n_waiting = 0
|
||||
self.broken = False
|
||||
|
||||
def wait(self, timeout=None):
|
||||
pass
|
||||
|
||||
def reset(self):
|
||||
pass
|
||||
|
||||
def abort(self):
|
||||
pass
|
||||
|
||||
|
||||
class Semaphore(object):
|
||||
def __init__(self, value=1):
|
||||
pass
|
||||
|
||||
def acquire(self, blocking=True, timeout=None):
|
||||
pass
|
||||
|
||||
def release(self):
|
||||
pass
|
||||
|
||||
|
||||
class BoundedSemaphore(multiprocessing.Semaphore):
|
||||
pass
|
||||
|
||||
|
||||
class Condition(object):
|
||||
def __init__(self, lock=None):
|
||||
pass
|
||||
|
||||
def acquire(self, *args):
|
||||
pass
|
||||
|
||||
def release(self):
|
||||
pass
|
||||
|
||||
def wait(self, timeout=None):
|
||||
pass
|
||||
|
||||
def wait_for(self, predicate, timeout=None):
|
||||
pass
|
||||
|
||||
def notify(self, n=1):
|
||||
pass
|
||||
|
||||
def notify_all(self):
|
||||
pass
|
||||
|
||||
|
||||
class Event(object):
|
||||
def is_set(self):
|
||||
return False
|
||||
|
||||
def set(self):
|
||||
pass
|
||||
|
||||
def clear(self):
|
||||
pass
|
||||
|
||||
def wait(self, timeout=None):
|
||||
pass
|
||||
|
||||
|
||||
class Lock(object):
|
||||
def acquire(self, blocking=True, timeout=-1):
|
||||
pass
|
||||
|
||||
def release(self):
|
||||
pass
|
||||
|
||||
|
||||
class RLock(object):
|
||||
def acquire(self, blocking=True, timeout=-1):
|
||||
pass
|
||||
|
||||
def release(self):
|
||||
pass
|
||||
|
||||
def __enter__(self):
|
||||
pass
|
||||
|
||||
def __exit__(self, exc_type, exc_val, exc_tb):
|
||||
pass
|
||||
|
||||
|
||||
def Value(typecode_or_type, *args, **kwargs):
|
||||
pass
|
||||
|
||||
|
||||
def Array(typecode_or_type, size_or_initializer, lock=True):
|
||||
pass
|
||||
|
||||
|
||||
def Manager():
|
||||
return multiprocessing.SyncManager()
|
||||
@@ -0,0 +1,76 @@
|
||||
"""Skeleton for 'multiprocessing.managers' stdlib module."""
|
||||
|
||||
|
||||
import threading
|
||||
import queue
|
||||
import multiprocessing
|
||||
import multiprocessing.managers
|
||||
|
||||
|
||||
class BaseManager(object):
|
||||
def __init__(self, address=None, authkey=None):
|
||||
self.address = address
|
||||
|
||||
def start(self, initializer=None, initargs=None):
|
||||
pass
|
||||
|
||||
def get_server(self):
|
||||
pass
|
||||
|
||||
def connect(self):
|
||||
pass
|
||||
|
||||
def shutdown(self):
|
||||
pass
|
||||
|
||||
@classmethod
|
||||
def register(cls, typeid, callable=None, proxytype=None, exposed=None,
|
||||
method_to_typeid=None, create_method=None):
|
||||
pass
|
||||
|
||||
def __enter__(self):
|
||||
pass
|
||||
|
||||
def __exit__(self, exc_type, exc_val, exc_tb):
|
||||
pass
|
||||
|
||||
|
||||
class SyncManager(multiprocessing.managers.BaseManager):
|
||||
def Barrier(self, parties, action=None, timeout=None):
|
||||
return threading.Barrier(parties, action, timeout)
|
||||
|
||||
def BoundedSemaphore(self, value=None):
|
||||
return threading.BoundedSemaphore(value)
|
||||
|
||||
def Condition(self, lock=None):
|
||||
return threading.Condition(lock)
|
||||
|
||||
def Event(self):
|
||||
return threading.Event()
|
||||
|
||||
def Lock(self):
|
||||
return threading.Lock()
|
||||
|
||||
def Namespace(self):
|
||||
pass
|
||||
|
||||
def Queue(self, maxsize=None):
|
||||
return queue.Queue()
|
||||
|
||||
def RLock(self):
|
||||
return threading.RLock()
|
||||
|
||||
def Semaphore(self, value=None):
|
||||
return threading.Semaphore(value)
|
||||
|
||||
def Array(self, typecode, sequence):
|
||||
pass
|
||||
|
||||
def Value(self, typecode, value):
|
||||
pass
|
||||
|
||||
def dict(self, mapping_or_sequence):
|
||||
pass
|
||||
|
||||
def list(self, sequence):
|
||||
pass
|
||||
@@ -0,0 +1,5 @@
|
||||
"""Skeleton for 'nose' module.
|
||||
|
||||
Project: nose 1.3 <https://nose.readthedocs.org/>
|
||||
Skeleton by: Andrey Vlasovskikh <andrey.vlasovskikh@jetbrains.com>
|
||||
"""
|
||||
@@ -0,0 +1,181 @@
|
||||
"""Skeleton for 'nose.tools' module.
|
||||
|
||||
Project: nose 1.3 <https://nose.readthedocs.org/>
|
||||
Skeleton by: Andrey Vlasovskikh <andrey.vlasovskikh@jetbrains.com>
|
||||
"""
|
||||
|
||||
|
||||
import sys
|
||||
|
||||
|
||||
def assert_equal(first, second, msg=None):
|
||||
"""Fail if the two objects are unequal as determined by the '==' operator.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def assert_not_equal(first, second, msg=None):
|
||||
"""Fail if the two objects are equal as determined by the '==' operator.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def assert_true(expr, msg=None):
|
||||
"""Check that the expression is true."""
|
||||
pass
|
||||
|
||||
|
||||
def assert_false(expr, msg=None):
|
||||
"""Check that the expression is false."""
|
||||
pass
|
||||
|
||||
|
||||
if sys.version_info >= (2, 7):
|
||||
def assert_is(expr1, expr2, msg=None):
|
||||
"""Just like assert_true(a is b), but with a nicer default message."""
|
||||
pass
|
||||
|
||||
def assert_is_not(expr1, expr2, msg=None):
|
||||
"""Just like assert_true(a is not b), but with a nicer default message.
|
||||
"""
|
||||
pass
|
||||
|
||||
def assert_is_none(obj, msg=None):
|
||||
"""Same as assert_true(obj is None), with a nicer default message.
|
||||
"""
|
||||
pass
|
||||
|
||||
def assert_is_not_none(obj, msg=None):
|
||||
"""Included for symmetry with assert_is_none."""
|
||||
pass
|
||||
|
||||
def assert_in(member, container, msg=None):
|
||||
"""Just like assert_true(a in b), but with a nicer default message."""
|
||||
pass
|
||||
|
||||
def assert_not_in(member, container, msg=None):
|
||||
"""Just like assert_true(a not in b), but with a nicer default message.
|
||||
"""
|
||||
pass
|
||||
|
||||
def assert_is_instance(obj, cls, msg=None):
|
||||
"""Same as assert_true(isinstance(obj, cls)), with a nicer default
|
||||
message.
|
||||
"""
|
||||
pass
|
||||
|
||||
def assert_not_is_instance(obj, cls, msg=None):
|
||||
"""Included for symmetry with assert_is_instance."""
|
||||
pass
|
||||
|
||||
|
||||
def assert_raises(excClass, callableObj=None, *args, **kwargs):
|
||||
"""Fail unless an exception of class excClass is thrown by callableObj when
|
||||
invoked with arguments args and keyword arguments kwargs.
|
||||
|
||||
If called with callableObj omitted or None, will return a
|
||||
context object used like this::
|
||||
|
||||
with assert_raises(SomeException):
|
||||
do_something()
|
||||
|
||||
:rtype: unittest.case._AssertRaisesContext | None
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
if sys.version_info >= (2, 7):
|
||||
def assert_raises_regexp(expected_exception, expected_regexp,
|
||||
callable_obj=None, *args, **kwargs):
|
||||
"""Asserts that the message in a raised exception matches a regexp.
|
||||
|
||||
:rtype: unittest.case._AssertRaisesContext | None
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def assert_almost_equal(first, second, places=None, msg=None, delta=None):
|
||||
"""Fail if the two objects are unequal as determined by their difference
|
||||
rounded to the given number of decimal places (default 7) and comparing to
|
||||
zero, or by comparing that the between the two objects is more than the
|
||||
given delta.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def assert_not_almost_equal(first, second, places=None, msg=None, delta=None):
|
||||
"""Fail if the two objects are equal as determined by their difference
|
||||
rounded to the given number of decimal places (default 7) and comparing to
|
||||
zero, or by comparing that the between the two objects is less than the
|
||||
given delta.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
if sys.version_info >= (2, 7):
|
||||
def assert_greater(a, b, msg=None):
|
||||
"""Just like assert_true(a > b), but with a nicer default message."""
|
||||
pass
|
||||
|
||||
def assert_greater_equal(a, b, msg=None):
|
||||
"""Just like assert_true(a >= b), but with a nicer default message."""
|
||||
pass
|
||||
|
||||
def assert_less(a, b, msg=None):
|
||||
"""Just like assert_true(a < b), but with a nicer default message."""
|
||||
pass
|
||||
|
||||
def assert_less_equal(a, b, msg=None):
|
||||
"""Just like self.assertTrue(a <= b), but with a nicer default
|
||||
message.
|
||||
"""
|
||||
pass
|
||||
|
||||
def assert_regexp_matches(text, expected_regexp, msg=None):
|
||||
"""Fail the test unless the text matches the regular expression."""
|
||||
pass
|
||||
|
||||
def assert_not_regexp_matches(text, unexpected_regexp, msg=None):
|
||||
"""Fail the test if the text matches the regular expression."""
|
||||
pass
|
||||
|
||||
def assert_items_equal(expected_seq, actual_seq, msg=None):
|
||||
"""An unordered sequence specific comparison. It asserts that
|
||||
actual_seq and expected_seq have the same element counts.
|
||||
"""
|
||||
pass
|
||||
|
||||
def assert_dict_contains_subset(expected, actual, msg=None):
|
||||
"""Checks whether actual is a superset of expected."""
|
||||
pass
|
||||
|
||||
def assert_multi_line_equal(first, second, msg=None):
|
||||
"""Assert that two multi-line strings are equal."""
|
||||
pass
|
||||
|
||||
def assert_sequence_equal(seq1, seq2, msg=None, seq_type=None):
|
||||
"""An equality assertion for ordered sequences (like lists and tuples).
|
||||
"""
|
||||
pass
|
||||
|
||||
def assert_list_equal(list1, list2, msg=None):
|
||||
"""A list-specific equality assertion."""
|
||||
pass
|
||||
|
||||
def assert_tuple_equal(tuple1, tuple2, msg=None):
|
||||
"""A tuple-specific equality assertion."""
|
||||
pass
|
||||
|
||||
def assert_set_equal(set1, set2, msg=None):
|
||||
"""A set-specific equality assertion."""
|
||||
pass
|
||||
|
||||
def assert_dict_equal(d1, d2, msg=None):
|
||||
"""A dict-specific equality assertion."""
|
||||
pass
|
||||
|
||||
|
||||
assert_equals = assert_equal
|
||||
assert_not_equals = assert_not_equal
|
||||
assert_almost_equals = assert_almost_equal
|
||||
assert_not_almost_equals = assert_not_almost_equal
|
||||
@@ -0,0 +1,10 @@
|
||||
"""Skeleton for 'numpy' module.
|
||||
|
||||
Project: NumPy 1.8.0 <http://www.numpy.org//>
|
||||
"""
|
||||
|
||||
from . import core
|
||||
from .core import *
|
||||
|
||||
__all__ = []
|
||||
__all__.extend(core.__all__)
|
||||
@@ -0,0 +1,3 @@
|
||||
from . import multiarray
|
||||
|
||||
__all__ = []
|
||||
@@ -0,0 +1,202 @@
|
||||
class ndarray(object):
|
||||
"""
|
||||
ndarray(shape, dtype=float, buffer=None, offset=0,
|
||||
strides=None, order=None)
|
||||
|
||||
An array object represents a multidimensional, homogeneous array
|
||||
of fixed-size items. An associated data-type object describes the
|
||||
format of each element in the array (its byte-order, how many bytes it
|
||||
occupies in memory, whether it is an integer, a floating point number,
|
||||
or something else, etc.)
|
||||
|
||||
Arrays should be constructed using `array`, `zeros` or `empty` (refer
|
||||
to the See Also section below). The parameters given here refer to
|
||||
a low-level method (`ndarray(...)`) for instantiating an array.
|
||||
|
||||
For more information, refer to the `numpy` module and examine the
|
||||
the methods and attributes of an array.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
(for the __new__ method; see Notes below)
|
||||
|
||||
shape : tuple of ints
|
||||
Shape of created array.
|
||||
dtype : data-type, optional
|
||||
Any object that can be interpreted as a numpy data type.
|
||||
buffer : object exposing buffer interface, optional
|
||||
Used to fill the array with data.
|
||||
offset : int, optional
|
||||
Offset of array data in buffer.
|
||||
strides : tuple of ints, optional
|
||||
Strides of data in memory.
|
||||
order : {'C', 'F'}, optional
|
||||
Row-major or column-major order.
|
||||
|
||||
Attributes
|
||||
----------
|
||||
T : ndarray
|
||||
Transpose of the array.
|
||||
data : buffer
|
||||
The array's elements, in memory.
|
||||
dtype : dtype object
|
||||
Describes the format of the elements in the array.
|
||||
flags : dict
|
||||
Dictionary containing information related to memory use, e.g.,
|
||||
'C_CONTIGUOUS', 'OWNDATA', 'WRITEABLE', etc.
|
||||
flat : numpy.flatiter object
|
||||
Flattened version of the array as an iterator. The iterator
|
||||
allows assignments, e.g., ``x.flat = 3`` (See `ndarray.flat` for
|
||||
assignment examples; TODO).
|
||||
imag : ndarray
|
||||
Imaginary part of the array.
|
||||
real : ndarray
|
||||
Real part of the array.
|
||||
size : int
|
||||
Number of elements in the array.
|
||||
itemsize : int
|
||||
The memory use of each array element in bytes.
|
||||
nbytes : int
|
||||
The total number of bytes required to store the array data,
|
||||
i.e., ``itemsize * size``.
|
||||
ndim : int
|
||||
The array's number of dimensions.
|
||||
shape : tuple of ints
|
||||
Shape of the array.
|
||||
strides : tuple of ints
|
||||
The step-size required to move from one element to the next in
|
||||
memory. For example, a contiguous ``(3, 4)`` array of type
|
||||
``int16`` in C-order has strides ``(8, 2)``. This implies that
|
||||
to move from element to element in memory requires jumps of 2 bytes.
|
||||
To move from row-to-row, one needs to jump 8 bytes at a time
|
||||
(``2 * 4``).
|
||||
ctypes : ctypes object
|
||||
Class containing properties of the array needed for interaction
|
||||
with ctypes.
|
||||
base : ndarray
|
||||
If the array is a view into another array, that array is its `base`
|
||||
(unless that array is also a view). The `base` array is where the
|
||||
array data is actually stored.
|
||||
|
||||
See Also
|
||||
--------
|
||||
array : Construct an array.
|
||||
zeros : Create an array, each element of which is zero.
|
||||
empty : Create an array, but leave its allocated memory unchanged (i.e.,
|
||||
it contains "garbage").
|
||||
dtype : Create a data-type.
|
||||
|
||||
Notes
|
||||
-----
|
||||
There are two modes of creating an array using ``__new__``:
|
||||
|
||||
1. If `buffer` is None, then only `shape`, `dtype`, and `order`
|
||||
are used.
|
||||
2. If `buffer` is an object exposing the buffer interface, then
|
||||
all keywords are interpreted.
|
||||
|
||||
No ``__init__`` method is needed because the array is fully initialized
|
||||
after the ``__new__`` method.
|
||||
|
||||
Examples
|
||||
--------
|
||||
These examples illustrate the low-level `ndarray` constructor. Refer
|
||||
to the `See Also` section above for easier ways of constructing an
|
||||
ndarray.
|
||||
|
||||
First mode, `buffer` is None:
|
||||
|
||||
>>> np.ndarray(shape=(2,2), dtype=float, order='F')
|
||||
array([[ -1.13698227e+002, 4.25087011e-303],
|
||||
[ 2.88528414e-306, 3.27025015e-309]]) #random
|
||||
|
||||
Second mode:
|
||||
|
||||
>>> np.ndarray((2,), buffer=np.array([1,2,3]),
|
||||
... offset=np.int_().itemsize,
|
||||
... dtype=int) # offset = 1*itemsize, i.e. skip first element
|
||||
array([2, 3])
|
||||
"""
|
||||
pass
|
||||
|
||||
def __mul__(self, y): # real signature unknown; restored from __doc__
|
||||
"""
|
||||
x.__mul__(y) <==> x*y
|
||||
|
||||
Returns
|
||||
-------
|
||||
out : ndarray
|
||||
"""
|
||||
pass
|
||||
|
||||
def __rmul__(self, y): # real signature unknown; restored from __doc__
|
||||
"""
|
||||
x.__rmul__(y) <==> x*y
|
||||
|
||||
Returns
|
||||
-------
|
||||
out : ndarray
|
||||
"""
|
||||
pass
|
||||
|
||||
def __abs__(self): # real signature unknown; restored from __doc__
|
||||
"""
|
||||
x.__abs__() <==> abs(x)
|
||||
|
||||
Returns
|
||||
-------
|
||||
out : ndarray
|
||||
"""
|
||||
pass
|
||||
|
||||
def __add__(self, y): # real signature unknown; restored from __doc__
|
||||
"""
|
||||
x.__add__(y) <==> x+y
|
||||
|
||||
Returns
|
||||
-------
|
||||
out : ndarray
|
||||
"""
|
||||
pass
|
||||
|
||||
def __copy__(self, order=None): # real signature unknown; restored from __doc__
|
||||
"""
|
||||
a.__copy__([order])
|
||||
|
||||
Return a copy of the array.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
order : {'C', 'F', 'A'}, optional
|
||||
If order is 'C' (False) then the result is contiguous (default).
|
||||
If order is 'Fortran' (True) then the result has fortran order.
|
||||
If order is 'Any' (None) then the result has fortran order
|
||||
only if the array already is in fortran order.
|
||||
|
||||
Returns
|
||||
-------
|
||||
out : ndarray
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def __div__(self, y): # real signature unknown; restored from __doc__
|
||||
"""
|
||||
x.__div__(y) <==> x/y
|
||||
|
||||
Returns
|
||||
-------
|
||||
out : ndarray
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def __sub__(self, y): # real signature unknown; restored from __doc__
|
||||
"""
|
||||
x.__sub__(y) <==> x-y
|
||||
|
||||
Returns
|
||||
-------
|
||||
out : ndarray
|
||||
"""
|
||||
pass
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,293 @@
|
||||
"""Skeleton for 'os.path' stdlib module."""
|
||||
|
||||
|
||||
import sys
|
||||
import os
|
||||
|
||||
|
||||
def abspath(path):
|
||||
"""Return a normalized absolutized version of the pathname path.
|
||||
|
||||
:type path: T <= bytes | unicode
|
||||
:rtype: T
|
||||
"""
|
||||
return path
|
||||
|
||||
|
||||
def basename(path):
|
||||
"""Return the base name of pathname path.
|
||||
|
||||
:type path: T <= bytes | unicode
|
||||
:rtype: T
|
||||
"""
|
||||
return path
|
||||
|
||||
|
||||
def commonprefix(list):
|
||||
"""Return the longest path prefix (taken character-by-character) that is a
|
||||
prefix of all paths in list.
|
||||
|
||||
:type list: collections.Iterable[T <= bytes | unicode]
|
||||
:rtype T
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def dirname(path):
|
||||
"""Return the directory name of pathname path.
|
||||
|
||||
:type path: T <= bytes | unicode
|
||||
:rtype: T
|
||||
"""
|
||||
return path
|
||||
|
||||
|
||||
def exists(path):
|
||||
"""Return True if path refers to an existing path. Returns False for broken
|
||||
symbolic links.
|
||||
|
||||
:type path: bytes | unicode
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
|
||||
def lexists(path):
|
||||
"""Return True if path refers to an existing path. Returns True for broken
|
||||
symbolic links.
|
||||
|
||||
:type path: bytes | unicode
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
|
||||
def expanduser(path):
|
||||
"""On Unix and Windows, return the argument with an initial component of ~
|
||||
or ~user replaced by that user's home directory.
|
||||
|
||||
:type path: T <= bytes | unicode
|
||||
:rtype: T
|
||||
"""
|
||||
return path
|
||||
|
||||
|
||||
def expandvars(path):
|
||||
"""Return the argument with environment variables expanded.
|
||||
|
||||
:type path: T <= bytes | unicode
|
||||
:rtype: T
|
||||
"""
|
||||
return path
|
||||
|
||||
|
||||
def getatime(path):
|
||||
"""Return the time of last access of path.
|
||||
|
||||
:type path: bytes | unicode
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
|
||||
def getmtime(path):
|
||||
"""Return the time of last modification of path.
|
||||
|
||||
:type path: bytes | unicode
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
|
||||
def getctime(path):
|
||||
"""Return the system's ctime.
|
||||
|
||||
:type path: bytes | unicode
|
||||
:rtype: float
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
|
||||
def getsize(path):
|
||||
"""Return the size, in bytes, of path.
|
||||
|
||||
:type path: bytes | unicode
|
||||
:rtype: int
|
||||
"""
|
||||
return 0
|
||||
|
||||
|
||||
def isabs(path):
|
||||
"""Return True if path is an absolute pathname.
|
||||
|
||||
:type path: bytes | unicode
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
|
||||
def isfile(path):
|
||||
"""Return True if path is an existing regular file.
|
||||
|
||||
:type path: bytes | unicode
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
|
||||
def isdir(path):
|
||||
"""Return True if path is an existing directory.
|
||||
|
||||
:type path: bytes | unicode
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
|
||||
def islink(path):
|
||||
"""Return True if path refers to a directory entry that is a symbolic link.
|
||||
|
||||
:type path: bytes | unicode
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
|
||||
def ismount(path):
|
||||
"""Return True if pathname path is a mount point: a point in a file system
|
||||
where a different file system has been mounted.
|
||||
|
||||
:type path: bytes | unicode
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
|
||||
def join(path, *paths):
|
||||
"""Join one or more path components intelligently.
|
||||
|
||||
:type path: T <= bytes | unicode
|
||||
:type paths: collections.Iterable[T]
|
||||
:rtype: T
|
||||
"""
|
||||
return path
|
||||
|
||||
|
||||
def normcase(path):
|
||||
"""Normalize the case of a pathname.
|
||||
|
||||
:type path: T <= bytes | unicode
|
||||
:rtype: T
|
||||
"""
|
||||
return path
|
||||
|
||||
|
||||
def normpath(path):
|
||||
"""Normalize a pathname by collapsing redundant separators and up-level
|
||||
references.
|
||||
|
||||
:type path: T <= bytes | unicode
|
||||
:rtype: T
|
||||
"""
|
||||
return path
|
||||
|
||||
|
||||
def realpath(path):
|
||||
"""Return the canonical path of the specified filename, eliminating any
|
||||
symbolic links encountered in the path.
|
||||
|
||||
:type path: T <= bytes | unicode
|
||||
:rtype: T
|
||||
"""
|
||||
return path
|
||||
|
||||
|
||||
def relpath(path, start=os.curdir):
|
||||
"""Return a relative filepath to path either from the current directory or
|
||||
from an optional start directory.
|
||||
|
||||
:type path: T <= bytes | unicode
|
||||
:type start: T
|
||||
:rtype: T
|
||||
"""
|
||||
return path
|
||||
|
||||
|
||||
def samefile(path1, path2):
|
||||
"""Return True if both pathname arguments refer to the same file or
|
||||
directory.
|
||||
|
||||
:type path1: bytes | unicode
|
||||
:type path2: bytes | unicode
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
|
||||
def sameopenfile(fp1, fp2):
|
||||
"""Return True if the file descriptors fp1 and fp2 refer to the same file.
|
||||
|
||||
:type fp1: int
|
||||
:type fp2: int
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
|
||||
def samestat(stat1, stat2):
|
||||
"""Return True if the stat tuples stat1 and stat2 refer to the same file.
|
||||
|
||||
:type stat1: os.stat_result | tuple
|
||||
:type stat2: os.stat_result | tuple
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
|
||||
def split(path):
|
||||
"""Split the pathname path into a pair, (head, tail).
|
||||
|
||||
:type path: T <= bytes | unicode
|
||||
:rtype: (T, T)
|
||||
"""
|
||||
return path, path
|
||||
|
||||
|
||||
def splitdrive(path):
|
||||
"""Split the pathname path into a pair (drive, tail).
|
||||
|
||||
:type path: T <= bytes | unicode
|
||||
:rtype: (T, T)
|
||||
"""
|
||||
return path, path
|
||||
|
||||
|
||||
def splitext(path):
|
||||
"""Split the pathname path into a pair (root, ext).
|
||||
|
||||
:type path: T <= bytes | unicode
|
||||
:rtype: (T, T)
|
||||
"""
|
||||
return path, path
|
||||
|
||||
|
||||
def splitunc(path):
|
||||
"""Split the pathname path into a pair (unc, rest).
|
||||
|
||||
:type path: T <= bytes | unicode
|
||||
:rtype: (T, T)
|
||||
"""
|
||||
return path, path
|
||||
|
||||
|
||||
if sys.version_info < (3, 0):
|
||||
def walk(path, visit, arg):
|
||||
"""Calls the function visit with arguments (arg, dirname, names) for
|
||||
each directory in the directory tree rooted at path.
|
||||
|
||||
:type path: T <= bytes | unicode
|
||||
:type visit: (V, T, list[T]) -> None
|
||||
:type arg: V
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
@@ -0,0 +1,373 @@
|
||||
"""Skeleton for 'pathlib' stdlib module."""
|
||||
|
||||
import pathlib
|
||||
|
||||
|
||||
class PurePath(object):
|
||||
def __new__(cls, *pathsegments):
|
||||
"""
|
||||
:rtype: pathlib.PurePath
|
||||
"""
|
||||
return cls.__new__(*pathsegments)
|
||||
|
||||
def __truediv__(self, key):
|
||||
"""
|
||||
:type key: string | pathlib.PurePath
|
||||
:rtype: pathlib.PurePath
|
||||
"""
|
||||
return pathlib.PurePath()
|
||||
|
||||
def __rtruediv__(self, key):
|
||||
"""
|
||||
:type key: string | pathlib.PurePath
|
||||
:rtype: pathlib.PurePath
|
||||
"""
|
||||
return pathlib.PurePath()
|
||||
|
||||
@property
|
||||
def parts(self):
|
||||
"""
|
||||
:rtype: tuple[str]
|
||||
"""
|
||||
return ()
|
||||
|
||||
@property
|
||||
def drive(self):
|
||||
"""
|
||||
:rtype: str
|
||||
"""
|
||||
return ''
|
||||
|
||||
@property
|
||||
def root(self):
|
||||
"""
|
||||
:rtype: str
|
||||
"""
|
||||
return ''
|
||||
|
||||
@property
|
||||
def anchor(self):
|
||||
"""
|
||||
:rtype: str
|
||||
"""
|
||||
return ''
|
||||
|
||||
@property
|
||||
def parent(self):
|
||||
"""
|
||||
:rtype: pathlib.PurePath | unknown
|
||||
"""
|
||||
return pathlib.PurePath()
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""
|
||||
:rtype: str
|
||||
"""
|
||||
return ''
|
||||
|
||||
@property
|
||||
def suffix(self):
|
||||
"""
|
||||
:rtype: str
|
||||
"""
|
||||
return ''
|
||||
|
||||
@property
|
||||
def suffixes(self):
|
||||
"""
|
||||
:rtype: list[str]
|
||||
"""
|
||||
return []
|
||||
|
||||
@property
|
||||
def stem(self):
|
||||
"""
|
||||
:rtype: str
|
||||
"""
|
||||
return ''
|
||||
|
||||
def as_posix(self):
|
||||
"""
|
||||
:rtype: str
|
||||
"""
|
||||
return ''
|
||||
|
||||
def as_uri(self):
|
||||
"""
|
||||
:rtype: str
|
||||
"""
|
||||
return ''
|
||||
|
||||
def is_absolute(self):
|
||||
"""
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
def is_reserved(self):
|
||||
"""
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
def joinpath(self, *other):
|
||||
"""
|
||||
:rtype: pathlib.PurePath
|
||||
"""
|
||||
return pathlib.PurePath()
|
||||
|
||||
def match(self, pattern):
|
||||
"""
|
||||
:type pattern: string
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
def relative_to(self, *other):
|
||||
"""
|
||||
:rtype: pathlib.PurePath
|
||||
"""
|
||||
return pathlib.PurePath()
|
||||
|
||||
class PurePosixPath(pathlib.PurePath):
|
||||
pass
|
||||
|
||||
|
||||
class PureWindowsPath(pathlib.PurePath):
|
||||
pass
|
||||
|
||||
|
||||
class Path(pathlib.PurePath):
|
||||
def __new__(cls, *pathsegments):
|
||||
"""
|
||||
:rtype: pathlib.Path
|
||||
"""
|
||||
return cls.__new__(*pathsegments)
|
||||
|
||||
def __truediv__(self, key):
|
||||
"""
|
||||
:type key: string | pathlib.Path
|
||||
:rtype: pathlib.Path
|
||||
"""
|
||||
return pathlib.Path()
|
||||
|
||||
def __rtruediv__(self, key):
|
||||
"""
|
||||
:type key: string | pathlib.Path
|
||||
:rtype: pathlib.Path
|
||||
"""
|
||||
return pathlib.Path()
|
||||
|
||||
@property
|
||||
def parents(self):
|
||||
"""
|
||||
:rtype: collections.Sequence[pathlib.Path]
|
||||
"""
|
||||
return []
|
||||
|
||||
@property
|
||||
def parent(self):
|
||||
"""
|
||||
:rtype: pathlib.Path
|
||||
"""
|
||||
return pathlib.Path()
|
||||
|
||||
def joinpath(self, *other):
|
||||
"""
|
||||
:rtype: pathlib.Path
|
||||
"""
|
||||
return pathlib.Path()
|
||||
|
||||
def relative_to(self, *other):
|
||||
"""
|
||||
:rtype: pathlib.Path
|
||||
"""
|
||||
return pathlib.Path()
|
||||
|
||||
@classmethod
|
||||
def cwd(cls):
|
||||
"""
|
||||
:rtype: pathlib.Path
|
||||
"""
|
||||
return pathlib.Path()
|
||||
|
||||
def stat(self):
|
||||
"""
|
||||
:rtype: os.stat_result
|
||||
"""
|
||||
pass
|
||||
|
||||
def chmod(self, mode):
|
||||
"""
|
||||
:rtype mode: int
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def exists(self):
|
||||
"""
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
def glob(self, pattern):
|
||||
"""
|
||||
:type pattern: string
|
||||
:rtype: collections.Iterable[pathlib.Path]
|
||||
"""
|
||||
return []
|
||||
|
||||
def group(self):
|
||||
"""
|
||||
:rtype: str
|
||||
"""
|
||||
return ''
|
||||
|
||||
def is_dir(self):
|
||||
"""
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
def is_file(self):
|
||||
"""
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
def is_file(self):
|
||||
"""
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
def is_symlink(self):
|
||||
"""
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
def is_socket(self):
|
||||
"""
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
def is_fifo(self):
|
||||
"""
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
def is_block_device(self):
|
||||
"""
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
def is_char_device(self):
|
||||
"""
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
def iterdir(self):
|
||||
"""
|
||||
:rtype: collections.Iterable[pathlib.Path]
|
||||
"""
|
||||
return []
|
||||
|
||||
def lchmod(self, mode):
|
||||
"""
|
||||
:rtype mode: int
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def lstat(self):
|
||||
"""
|
||||
:rtype: os.stat_result
|
||||
"""
|
||||
pass
|
||||
|
||||
def mkdir(self, mode=0o777, parents=False):
|
||||
"""
|
||||
:type mode: int
|
||||
:type parents: bool
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def open(self, mode='r', buffering=-1, encoding=None, errors=None,
|
||||
newline=None):
|
||||
"""
|
||||
:type mode: string
|
||||
:type buffering: numbers.Integral
|
||||
:type encoding: string | None
|
||||
:type errors: string | None
|
||||
:type newline: string | None
|
||||
:rtype: io.FileIO[bytes] | io.TextIOWrapper[unicode]
|
||||
"""
|
||||
pass
|
||||
|
||||
def owner(self):
|
||||
"""
|
||||
:rtype: str
|
||||
"""
|
||||
return ''
|
||||
|
||||
def rename(self, target):
|
||||
"""
|
||||
:type target: string | pathlib.Path
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def replace(self, target):
|
||||
"""
|
||||
:type target: string | pathlib.Path
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def resolve(self):
|
||||
"""
|
||||
:rtype: pathlib.Path
|
||||
"""
|
||||
return pathlib.Path()
|
||||
|
||||
def rglob(self, pattern):
|
||||
"""
|
||||
:type pattern: string
|
||||
:rtype: collections.Iterable[pathlib.Path]
|
||||
"""
|
||||
return []
|
||||
|
||||
def rmdir(self):
|
||||
"""
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def symlink_to(self, target, target_is_directory=False):
|
||||
"""
|
||||
:type target: string | pathlib.Path
|
||||
:type target_is_directory: bool
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def touch(self, mode=0o777, exist_ok=True):
|
||||
"""
|
||||
:type mode: int
|
||||
:type exist_ok: bool
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def unlink(self):
|
||||
"""
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
@@ -0,0 +1,81 @@
|
||||
"""Skeleton for 'pickle' stdlib module."""
|
||||
|
||||
|
||||
HIGHEST_PROTOCOL = 0
|
||||
DEFAULT_PROTOCOL = 0
|
||||
|
||||
|
||||
def dump(obj, file, protocol=None, fix_imports=True):
|
||||
"""Write a pickled representation of obj to the open file object file.
|
||||
|
||||
:type protocol: numbers.Integral | None
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def dumps(obj, protocol=None, fix_imports=True):
|
||||
"""Return the pickled representation of the object as a bytes object,
|
||||
instead of writing it to a file.
|
||||
|
||||
:type protocol: numbers.Integral | None
|
||||
:rtype: bytes
|
||||
"""
|
||||
return b''
|
||||
|
||||
|
||||
def load(file, fix_imports=True, encoding='ASCII', errors='strict'):
|
||||
"""Read a pickled object representation from the open file object file and
|
||||
return the reconstituted object hierarchy specified therein.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def loads(bytes_object, fix_imports=True, encoding='ASCII', errors='strict'):
|
||||
"""Read a pickled object representation from the open file object file and
|
||||
return the reconstituted object hierarchy specified therein.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class PickleError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class PicklingError(PickleError):
|
||||
pass
|
||||
|
||||
|
||||
class UnpicklingError(PickleError):
|
||||
pass
|
||||
|
||||
|
||||
class Pickler(object):
|
||||
"""This takes a binary file for writing a pickle data stream."""
|
||||
|
||||
def __init__(self, file, protocol=None, fix_imports=True):
|
||||
self.dispatch_table = None
|
||||
self.fast = False
|
||||
|
||||
def dump(self, obj):
|
||||
pass
|
||||
|
||||
def persistent_id(self, obj):
|
||||
pass
|
||||
|
||||
|
||||
class Unpickler(object):
|
||||
"""This takes a binary file for reading a pickle data stream."""
|
||||
|
||||
def __init__(self, file, fix_imports=True, encoding='ASCII',
|
||||
errors='strict'):
|
||||
pass
|
||||
|
||||
def load(self):
|
||||
pass
|
||||
|
||||
def persistent_load(self, pid):
|
||||
pass
|
||||
|
||||
def find_class(self, module, name):
|
||||
pass
|
||||
@@ -0,0 +1,277 @@
|
||||
"""Skeleton for 're' stdlib module."""
|
||||
|
||||
|
||||
def compile(pattern, flags=0):
|
||||
"""Compile a regular expression pattern, returning a pattern object.
|
||||
|
||||
:type pattern: bytes | unicode
|
||||
:type flags: int
|
||||
:rtype: __Regex
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def search(pattern, string, flags=0):
|
||||
"""Scan through string looking for a match, and return a corresponding
|
||||
match instance. Return None if no position in the string matches.
|
||||
|
||||
:type pattern: bytes | unicode | __Regex
|
||||
:type string: T <= bytes | unicode
|
||||
:type flags: int
|
||||
:rtype: __Match[T] | None
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def match(pattern, string, flags=0):
|
||||
"""Matches zero or more characters at the beginning of the string.
|
||||
|
||||
:type pattern: bytes | unicode | __Regex
|
||||
:type string: T <= bytes | unicode
|
||||
:type flags: int
|
||||
:rtype: __Match[T] | None
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def split(pattern, string, maxsplit=0, flags=0):
|
||||
"""Split string by the occurrences of pattern.
|
||||
|
||||
:type pattern: bytes | unicode | __Regex
|
||||
:type string: T <= bytes | unicode
|
||||
:type maxsplit: int
|
||||
:type flags: int
|
||||
:rtype: list[T]
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def findall(pattern, string, flags=0):
|
||||
"""Return a list of all non-overlapping matches of pattern in string.
|
||||
|
||||
:type pattern: bytes | unicode | __Regex
|
||||
:type string: T <= bytes | unicode
|
||||
:type flags: int
|
||||
:rtype: list[T]
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def finditer(pattern, string, flags=0):
|
||||
"""Return an iterator over all non-overlapping matches for the pattern in
|
||||
string. For each match, the iterator returns a match object.
|
||||
|
||||
:type pattern: bytes | unicode | __Regex
|
||||
:type string: T <= bytes | unicode
|
||||
:type flags: int
|
||||
:rtype: collections.Iterable[__Match[T]]
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def sub(pattern, repl, string, count=0, flags=0):
|
||||
"""Return the string obtained by replacing the leftmost non-overlapping
|
||||
occurrences of pattern in string by the replacement repl.
|
||||
|
||||
:type pattern: bytes | unicode | __Regex
|
||||
:type repl: bytes | unicode | collections.Callable
|
||||
:type string: T <= bytes | unicode
|
||||
:type count: int
|
||||
:type flags: int
|
||||
:rtype: T
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def subn(pattern, repl, string, count=0, flags=0):
|
||||
"""Return the tuple (new_string, number_of_subs_made) found by replacing
|
||||
the leftmost non-overlapping occurrences of pattern with the
|
||||
replacement repl.
|
||||
|
||||
:type pattern: bytes | unicode | __Regex
|
||||
:type repl: bytes | unicode | collections.Callable
|
||||
:type string: T <= bytes | unicode
|
||||
:type count: int
|
||||
:type flags: int
|
||||
:rtype: (T, int)
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def escape(string):
|
||||
"""Escape all the characters in pattern except ASCII letters and numbers.
|
||||
|
||||
:type string: T <= bytes | unicode
|
||||
:type: T
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class __Regex(object):
|
||||
"""Mock class for a regular expression pattern object."""
|
||||
|
||||
def __init__(self, flags, groups, groupindex, pattern):
|
||||
"""Create a new pattern object.
|
||||
|
||||
:type flags: int
|
||||
:type groups: int
|
||||
:type groupindex: dict[bytes | unicode, int]
|
||||
:type pattern: bytes | unicode
|
||||
"""
|
||||
self.flags = flags
|
||||
self.groups = groups
|
||||
self.groupindex = groupindex
|
||||
self.pattern = pattern
|
||||
|
||||
def search(self, string, pos=0, endpos=-1):
|
||||
"""Scan through string looking for a match, and return a corresponding
|
||||
match instance. Return None if no position in the string matches.
|
||||
|
||||
:type string: T <= bytes | unicode
|
||||
:type pos: int
|
||||
:type endpos: int
|
||||
:rtype: __Match[T] | None
|
||||
"""
|
||||
pass
|
||||
|
||||
def match(self, string, pos=0, endpos=-1):
|
||||
"""Matches zero | more characters at the beginning of the string.
|
||||
|
||||
:type string: T <= bytes | unicode
|
||||
:type pos: int
|
||||
:type endpos: int
|
||||
:rtype: __Match[T] | None
|
||||
"""
|
||||
pass
|
||||
|
||||
def split(self, string, maxsplit=0):
|
||||
"""Split string by the occurrences of pattern.
|
||||
|
||||
:type string: T <= bytes | unicode
|
||||
:type maxsplit: int
|
||||
:rtype: list[T]
|
||||
"""
|
||||
pass
|
||||
|
||||
def findall(self, string, pos=0, endpos=-1):
|
||||
"""Return a list of all non-overlapping matches of pattern in string.
|
||||
|
||||
:type string: T <= bytes | unicode
|
||||
:type pos: int
|
||||
:type endpos: int
|
||||
:rtype: list[T]
|
||||
"""
|
||||
pass
|
||||
|
||||
def finditer(self, string, pos=0, endpos=-1):
|
||||
"""Return an iterator over all non-overlapping matches for the
|
||||
pattern in string. For each match, the iterator returns a
|
||||
match object.
|
||||
|
||||
:type string: T <= bytes | unicode
|
||||
:type pos: int
|
||||
:type endpos: int
|
||||
:rtype: collections.Iterable[__Match[T]]
|
||||
"""
|
||||
pass
|
||||
|
||||
def sub(self, repl, string, count=0):
|
||||
"""Return the string obtained by replacing the leftmost non-overlapping
|
||||
occurrences of pattern in string by the replacement repl.
|
||||
|
||||
:type repl: bytes | unicode | collections.Callable
|
||||
:type string: T <= bytes | unicode
|
||||
:type count: int
|
||||
:rtype: T
|
||||
"""
|
||||
pass
|
||||
|
||||
def subn(self, repl, string, count=0):
|
||||
"""Return the tuple (new_string, number_of_subs_made) found by replacing
|
||||
the leftmost non-overlapping occurrences of pattern with the
|
||||
replacement repl.
|
||||
|
||||
:type repl: bytes | unicode | collections.Callable
|
||||
:type string: T <= bytes | unicode
|
||||
:type count: int
|
||||
:rtype: (T, int)
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class __Match(object):
|
||||
"""Mock class for a match object."""
|
||||
|
||||
def __init__(self, pos, endpos, lastindex, lastgroup, re, string):
|
||||
"""Create a new match object.
|
||||
|
||||
:type pos: int
|
||||
:type endpos: int
|
||||
:type lastindex: int | None
|
||||
:type lastgroup: int | bytes | unicode | None
|
||||
:type re: __Regex
|
||||
:type string: bytes | unicode
|
||||
:rtype: __Match[T]
|
||||
"""
|
||||
self.pos = pos
|
||||
self.endpos = endpos
|
||||
self.lastindex = lastindex
|
||||
self.lastgroup = lastgroup
|
||||
self.re = re
|
||||
self.string = string
|
||||
|
||||
def expand(self, template):
|
||||
"""Return the string obtained by doing backslash substitution on the
|
||||
template string template.
|
||||
|
||||
:type template: T
|
||||
:rtype: T
|
||||
"""
|
||||
pass
|
||||
|
||||
def group(self, *args):
|
||||
"""Return one or more subgroups of the match.
|
||||
|
||||
:rtype: T | tuple
|
||||
"""
|
||||
pass
|
||||
|
||||
def groups(self, default=None):
|
||||
"""Return a tuple containing all the subgroups of the match, from 1 up
|
||||
to however many groups are in the pattern.
|
||||
|
||||
:rtype: tuple
|
||||
"""
|
||||
pass
|
||||
|
||||
def groupdict(self, default=None):
|
||||
"""Return a dictionary containing all the named subgroups of the match,
|
||||
keyed by the subgroup name.
|
||||
|
||||
:rtype: dict[bytes | unicode, T]
|
||||
"""
|
||||
pass
|
||||
|
||||
def start(self, group=0):
|
||||
"""Return the index of the start of the substring matched by group.
|
||||
|
||||
:type group: int | bytes | unicode
|
||||
:rtype: int
|
||||
"""
|
||||
pass
|
||||
|
||||
def end(self, group=0):
|
||||
"""Return the index of the end of the substring matched by group.
|
||||
|
||||
:type group: int | bytes | unicode
|
||||
:rtype: int
|
||||
"""
|
||||
pass
|
||||
|
||||
def span(self, group=0):
|
||||
"""Return a 2-tuple (start, end) for the substring matched by group.
|
||||
|
||||
:type group: int | bytes | unicode
|
||||
:rtype: (int, int)
|
||||
"""
|
||||
pass
|
||||
@@ -0,0 +1,99 @@
|
||||
"""Skeleton for 'shutil' stdlib module."""
|
||||
|
||||
|
||||
import sys
|
||||
|
||||
|
||||
def copyfile(src, dst):
|
||||
"""Copy the contents (no metadata) of the file named src to a file named
|
||||
dst.
|
||||
|
||||
:type src: bytes | unicode
|
||||
:type dst: bytes | unicode
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def copymode(src, dst):
|
||||
"""Copy the permission bits from src to dst.
|
||||
|
||||
:type src: bytes | unicode
|
||||
:type dst: bytes | unicode
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def copystat(src, dst):
|
||||
"""Copy the permission bits, last access time, last modification time, and
|
||||
flags from src to dst.
|
||||
|
||||
:type src: bytes | unicode
|
||||
:type dst: bytes | unicode
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def copy(src, dst):
|
||||
"""Copy the file src to the file or directory dst.
|
||||
|
||||
:type src: bytes | unicode
|
||||
:type dst: bytes | unicode
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def copy2(src, dst):
|
||||
"""Similar to shutil.copy(), but metadata is copied as well.
|
||||
|
||||
:type src: bytes | unicode
|
||||
:type dst: bytes | unicode
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def ignore_patterns(*patterns):
|
||||
"""This factory function creates a function that can be used as a callable
|
||||
for copytree()'s ignore argument, ignoring files and directories that match
|
||||
one of the glob-style patterns provided.
|
||||
|
||||
:type patterns: collections.Iterable[bytes | unicode]
|
||||
:rtype: (bytes | unicode, list[bytes | unicode]) -> collections.Iterable[bytes | unicode]
|
||||
"""
|
||||
return lambda path, files: []
|
||||
|
||||
|
||||
def copytree(src, dst, symlinks=False, ignore=None):
|
||||
"""Recursively copy an entire directory tree rooted at src.
|
||||
|
||||
:type src: bytes | unicode
|
||||
:type dst: bytes | unicode
|
||||
:type symlinks: bool
|
||||
:type ignore: ((bytes | unicode, list[bytes | unicode]) -> collections.Iterable[bytes | unicode]) | None
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def rmtree(path, ignore_errors=False, onerror=None):
|
||||
"""Delete an entire directory tree.
|
||||
|
||||
:type path: bytes | unicode
|
||||
:type ignore_errors: bool
|
||||
:type onerror: (unknown, bytes | unicode, unknown) -> None
|
||||
:rtype: None
|
||||
"""
|
||||
|
||||
|
||||
def move(src, dst):
|
||||
"""Recursively move a file or directory (src) to another location (dst).
|
||||
|
||||
:type src: bytes | unicode
|
||||
:type dst: bytes | unicode
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
@@ -0,0 +1,190 @@
|
||||
"""Skeleton for 'sqlite3' stdlib module."""
|
||||
|
||||
|
||||
import sqlite3
|
||||
|
||||
|
||||
def connect(database, timeout=5.0, detect_types=0, isolation_level=None,
|
||||
check_same_thread=False, factory=None, cached_statements=100):
|
||||
"""Opens a connection to the SQLite database file database.
|
||||
|
||||
:type database: bytes | unicode
|
||||
:type timeout: float
|
||||
:type detect_types: int
|
||||
:type isolation_level: string | None
|
||||
:type check_same_thread: bool
|
||||
:type factory: (() -> sqlite3.Connection) | None
|
||||
:rtype: sqlite3.Connection
|
||||
"""
|
||||
return sqlite3.Connection()
|
||||
|
||||
|
||||
def register_converter(typename, callable):
|
||||
"""Registers a callable to convert a bytestring from the database into a
|
||||
custom Python type.
|
||||
|
||||
:type typename: string
|
||||
:type callable: (bytes) -> unknown
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def register_adapter(type, callable):
|
||||
"""Registers a callable to convert the custom Python type type into one of
|
||||
SQLite's supported types.
|
||||
|
||||
:type type: type
|
||||
:type callable: (unknown) -> unknown
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def complete_statement(sql):
|
||||
"""Returns True if the string sql contains one or more complete SQL
|
||||
statements terminated by semicolons.
|
||||
|
||||
:type sql: string
|
||||
:rtype: bool
|
||||
"""
|
||||
return False
|
||||
|
||||
|
||||
def enable_callback_tracebacks(flag):
|
||||
"""By default you will not get any tracebacks in user-defined functions,
|
||||
aggregates, converters, authorizer callbacks etc.
|
||||
|
||||
:type flag: bool
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class Connection(object):
|
||||
"""A SQLite database connection."""
|
||||
|
||||
def cursor(self, cursorClass=None):
|
||||
"""
|
||||
:type cursorClass: type | None
|
||||
:rtype: sqlite3.Cursor
|
||||
"""
|
||||
return sqlite3.Cursor()
|
||||
|
||||
def execute(self, sql, parameters=()):
|
||||
"""This is a nonstandard shortcut that creates an intermediate cursor
|
||||
object by calling the cursor method, then calls the cursor's execute
|
||||
method with the parameters given.
|
||||
|
||||
:type sql: string
|
||||
:type parameters: collections.Iterable
|
||||
:rtype: sqlite3.Cursor
|
||||
"""
|
||||
pass
|
||||
|
||||
def executemany(self, sql, seq_of_parameters=()):
|
||||
"""This is a nonstandard shortcut that creates an intermediate cursor
|
||||
object by calling the cursor method, then calls the cursor's
|
||||
executemany method with the parameters given.
|
||||
|
||||
:type sql: string
|
||||
:type seq_of_parameters: collections.Iterable[collections.Iterable]
|
||||
:rtype: sqlite3.Cursor
|
||||
"""
|
||||
pass
|
||||
|
||||
def executescript(self, sql_script):
|
||||
"""This is a nonstandard shortcut that creates an intermediate cursor
|
||||
object by calling the cursor method, then calls the cursor's
|
||||
executescript method with the parameters given.
|
||||
|
||||
:type sql_script: bytes | unicode
|
||||
:rtype: sqlite3.Cursor
|
||||
"""
|
||||
pass
|
||||
|
||||
def create_function(self, name, num_params, func):
|
||||
"""Creates a user-defined function that you can later use from within
|
||||
SQL statements under the function name name.
|
||||
|
||||
:type name: string
|
||||
:type num_params: int
|
||||
:type func: collections.Callable
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def create_aggregate(self, name, num_params, aggregate_class):
|
||||
"""Creates a user-defined aggregate function.
|
||||
|
||||
:type name: string
|
||||
:type num_params: int
|
||||
:type aggregate_class: type
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def create_collation(self, name, callable):
|
||||
"""Creates a collation with the specified name and callable.
|
||||
|
||||
:type name: string
|
||||
:type callable: collections.Callable
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class Cursor(object):
|
||||
"""A SQLite database cursor."""
|
||||
|
||||
def execute(self, sql, parameters=()):
|
||||
"""Executes an SQL statement.
|
||||
|
||||
:type sql: string
|
||||
:type parameters: collections.Iterable
|
||||
:rtype: sqlite3.Cursor
|
||||
"""
|
||||
pass
|
||||
|
||||
def executemany(self, sql, seq_of_parameters=()):
|
||||
"""Executes an SQL command against all parameter sequences or mappings
|
||||
found in the sequence.
|
||||
|
||||
:type sql: string
|
||||
:type seq_of_parameters: collections.Iterable[collections.Iterable]
|
||||
:rtype: sqlite3.Cursor
|
||||
"""
|
||||
pass
|
||||
|
||||
def executescript(self, sql_script):
|
||||
"""This is a nonstandard convenience method for executing multiple SQL
|
||||
statements at once.
|
||||
|
||||
:type sql_script: bytes | unicode
|
||||
:rtype: sqlite3.Cursor
|
||||
"""
|
||||
pass
|
||||
|
||||
def fetchone(self):
|
||||
"""Fetches the next row of a query result set, returning a single
|
||||
sequence, or None when no more data is available.
|
||||
|
||||
:rtype: tuple | None
|
||||
"""
|
||||
pass
|
||||
|
||||
def fetchmany(self, size=-1):
|
||||
"""Fetches the next set of rows of a query result, returning a list.
|
||||
|
||||
:type size: numbers.Integral
|
||||
:rtype: list[tuple]
|
||||
"""
|
||||
return []
|
||||
|
||||
def fetchall(self):
|
||||
"""Fetches all (remaining) rows of a query result, returning a list.
|
||||
|
||||
:rtype: list[tuple]
|
||||
"""
|
||||
return []
|
||||
@@ -0,0 +1,106 @@
|
||||
"""Skeleton for 'struct' stdlib module."""
|
||||
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import sys
|
||||
|
||||
|
||||
def pack(fmt, *values):
|
||||
"""Return a string containing the values packed according to the given
|
||||
format.
|
||||
|
||||
:type fmt: bytes | unicode
|
||||
:rtype: bytes
|
||||
"""
|
||||
return b''
|
||||
|
||||
|
||||
def unpack(fmt, string):
|
||||
"""Unpack the string according to the given format.
|
||||
|
||||
:type fmt: bytes | unicode
|
||||
:type string: bytestring
|
||||
:rtype: tuple
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def pack_into(fmt, buffer, offset, *values):
|
||||
""""Pack the values according to the given format, write the packed
|
||||
bytes into the writable buffer starting at offset.
|
||||
|
||||
:type fmt: bytes | unicode
|
||||
:type offset: int | long
|
||||
:rtype: bytes
|
||||
"""
|
||||
return b''
|
||||
|
||||
def unpack_from(fmt, buffer, offset=0):
|
||||
"""Unpack the buffer according to the given format.
|
||||
|
||||
:type fmt: bytes | unicode
|
||||
:type offset: int | long
|
||||
:rtype: tuple
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def calcsize(fmt):
|
||||
"""Return the size of the struct (and hence of the string) corresponding to
|
||||
the given format.
|
||||
|
||||
:type fmt: bytes | unicode
|
||||
:rtype: int
|
||||
"""
|
||||
return 0
|
||||
|
||||
|
||||
class Struct(object):
|
||||
"""Struct object which writes and reads binary data according to the format
|
||||
string.
|
||||
|
||||
:param format: The format string used to construct this Struct object.
|
||||
:type format: bytes | unicode
|
||||
|
||||
:param size: The calculated size of the struct corresponding to format.
|
||||
:type size: int
|
||||
"""
|
||||
|
||||
def __init__(self, format):
|
||||
"""Create a new Struct object.
|
||||
|
||||
:type format: bytes | unicode
|
||||
"""
|
||||
self.format = format
|
||||
self.size = 0
|
||||
|
||||
def pack(self, *values):
|
||||
"""Identical to the pack() function, using the compiled format.
|
||||
|
||||
:rtype: bytes
|
||||
"""
|
||||
return b''
|
||||
|
||||
def pack_into(self, buffer, offset, *values):
|
||||
"""Identical to the pack_into() function, using the compiled format.
|
||||
|
||||
:type offset: int | long
|
||||
:rtype: bytes
|
||||
"""
|
||||
return b''
|
||||
|
||||
def unpack(self, string):
|
||||
"""Identical to the unpack() function, using the compiled format.
|
||||
|
||||
:type string: bytestring
|
||||
:rtype: tuple
|
||||
"""
|
||||
pass
|
||||
|
||||
def unpack_from(self, buffer, offset=0):
|
||||
"""Identical to the unpack_from() function, using the compiled format.
|
||||
|
||||
:type offset: int | long
|
||||
:rtype: tuple
|
||||
"""
|
||||
pass
|
||||
@@ -0,0 +1,140 @@
|
||||
"""Skeleton for 'subprocess' stdlib module."""
|
||||
|
||||
|
||||
def call(args, bufsize=0, executable=None, stdin=None, stdout=None, stderr=None,
|
||||
preexec_fn=None, close_fds=False, shell=False, cwd=None, env=None,
|
||||
universal_newlines=False, startupinfo=None, creationflags=0,
|
||||
timeout=None, restore_signals=True, start_new_session=False,
|
||||
pass_fds=()):
|
||||
"""Run the command described by args.
|
||||
|
||||
:type args: collections.Iterable[bytes | unicode]
|
||||
:type bufsize: int
|
||||
:type executable: bytes | unicode | None
|
||||
:type close_fds: bool
|
||||
:type shell: bool
|
||||
:type cwd: bytes | unicode | None
|
||||
:type env: collections.Mapping | None
|
||||
:type universal_newlines: bool
|
||||
:type creationflags: int
|
||||
:rtype: int
|
||||
"""
|
||||
return 0
|
||||
|
||||
|
||||
def check_call(args, bufsize=0, executable=None, stdin=None, stdout=None,
|
||||
stderr=None, preexec_fn=None, close_fds=False, shell=False,
|
||||
cwd=None, env=None, universal_newlines=False, startupinfo=None,
|
||||
creationflags=0, timeout=None, restore_signals=True,
|
||||
start_new_session=False, pass_fds=()):
|
||||
"""Run command with arguments. Wait for command to complete. If the return
|
||||
code was zero then return, otherwise raise CalledProcessError.
|
||||
|
||||
:type args: collections.Iterable[bytes | unicode]
|
||||
:type bufsize: int
|
||||
:type executable: bytes | unicode | None
|
||||
:type close_fds: bool
|
||||
:type shell: bool
|
||||
:type cwd: bytes | unicode | None
|
||||
:type env: collections.Mapping | None
|
||||
:type universal_newlines: bool
|
||||
:type creationflags: int
|
||||
:rtype: int
|
||||
"""
|
||||
return 0
|
||||
|
||||
|
||||
def check_output(args, bufsize=0, executable=None, stdin=None, stderr=None,
|
||||
preexec_fn=None, close_fds=False, shell=False, cwd=None,
|
||||
env=None, universal_newlines=False, startupinfo=None,
|
||||
creationflags=0, timeout=None, restore_signals=True,
|
||||
start_new_session=False, pass_fds=()):
|
||||
"""Run command with arguments and return its output as a byte string.
|
||||
|
||||
:type args: collections.Iterable[bytes | unicode]
|
||||
:type bufsize: int
|
||||
:type executable: bytes | unicode | None
|
||||
:type close_fds: bool
|
||||
:type shell: bool
|
||||
:type cwd: bytes | unicode | None
|
||||
:type env: collections.Mapping | None
|
||||
:type universal_newlines: bool
|
||||
:type creationflags: int
|
||||
:rtype: bytes
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class Popen(object):
|
||||
"""Execute a child program in a new process.
|
||||
|
||||
:type returncode: int
|
||||
"""
|
||||
|
||||
def __init__(self, args, bufsize=0, executable=None, stdin=None,
|
||||
stdout=None, stderr=None, preexec_fn=None, close_fds=False,
|
||||
shell=False, cwd=None, env=None, universal_newlines=False,
|
||||
startupinfo=None, creationflags=0, timeout=None,
|
||||
restore_signals=True, start_new_session=False, pass_fds=()):
|
||||
"""Popen constructor.
|
||||
|
||||
:type args: collections.Iterable[bytes | unicode]
|
||||
:type bufsize: int
|
||||
:type executable: bytes | unicode | None
|
||||
:type close_fds: bool
|
||||
:type shell: bool
|
||||
:type cwd: bytes | unicode | None
|
||||
:type env: collections.Mapping | None
|
||||
:type universal_newlines: bool
|
||||
:type creationflags: int
|
||||
"""
|
||||
self.stdin = stdin
|
||||
self.stdout = stdout
|
||||
self.stderr = stderr
|
||||
self.pid = 0
|
||||
self.returncode = 0
|
||||
|
||||
def poll(self):
|
||||
"""Check if child process has terminated.
|
||||
|
||||
:rtype: int
|
||||
"""
|
||||
return 0
|
||||
|
||||
def wait(self, timeout=None):
|
||||
"""Wait for child process to terminate.
|
||||
|
||||
:rtype: int
|
||||
"""
|
||||
return 0
|
||||
|
||||
def communicate(self, input=None, timeout=None):
|
||||
"""Interact with process: Send data to stdin. Read data from stdout and
|
||||
stderr, until end-of-file is reached.
|
||||
|
||||
:type input: bytes | unicode | None
|
||||
:rtype: (bytes, bytes)
|
||||
"""
|
||||
return b'', b''
|
||||
|
||||
def send_signal(self, signal):
|
||||
"""Sends the signal signal to the child.
|
||||
|
||||
:type signal: int
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def terminate(self):
|
||||
"""Stop the child.
|
||||
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
|
||||
def kill(self):
|
||||
"""Kills the child.
|
||||
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
Reference in New Issue
Block a user